@jsonforms/angular 3.8.0-alpha.2 → 3.8.0

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,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, Directive, inject, Component, ViewContainerRef, EventEmitter, Output, NgModule } from '@angular/core';
3
- import { Subscription, BehaviorSubject } from 'rxjs';
4
- import { defaultMiddleware, configReducer, setConfig, i18nReducer, updateI18n, generateJsonSchema, generateDefaultUISchema, Actions, coreReducer, uischemaRegistryReducer, computeLabel, removeId, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToArrayControlProps, defaultJsonFormsI18nState, getArrayTranslations, arrayDefaultTranslations, mapStateToJsonFormsRendererProps, getConfig, isControl, createId } from '@jsonforms/core';
2
+ import { Input, Directive, inject, Component, ViewContainerRef, InjectionToken, EventEmitter, Output, NgModule } from '@angular/core';
5
3
  import { FormControl } from '@angular/forms';
4
+ import { defaultMiddleware, configReducer, setConfig, i18nReducer, updateI18n, generateJsonSchema, generateDefaultUISchema, Actions, coreReducer, uischemaRegistryReducer, computeLabel, Id, mapStateToArrayControlProps, defaultJsonFormsI18nState, getArrayTranslations, arrayDefaultTranslations, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToJsonFormsRendererProps, getConfig, isControl } from '@jsonforms/core';
5
+ import { Subscription, BehaviorSubject } from 'rxjs';
6
6
  import cloneDeep from 'lodash/cloneDeep';
7
7
  import merge from 'lodash/merge';
8
8
  import maxBy from 'lodash/maxBy';
@@ -56,10 +56,10 @@ class JsonFormsBaseRenderer {
56
56
  ngOnDestroy() {
57
57
  this.subscriptions.unsubscribe();
58
58
  }
59
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsBaseRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
60
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.21", type: JsonFormsBaseRenderer, isStandalone: true, inputs: { uischema: "uischema", schema: "schema", path: "path" }, ngImport: i0 });
59
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsBaseRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
60
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.24", type: JsonFormsBaseRenderer, isStandalone: true, inputs: { uischema: "uischema", schema: "schema", path: "path" }, ngImport: i0 });
61
61
  }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsBaseRenderer, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsBaseRenderer, decorators: [{
63
63
  type: Directive
64
64
  }], propDecorators: { uischema: [{
65
65
  type: Input
@@ -359,7 +359,7 @@ class JsonFormsAbstractControl extends JsonFormsBaseRenderer {
359
359
  }
360
360
  ngOnDestroy() {
361
361
  super.ngOnDestroy();
362
- removeId(this.id);
362
+ Id.removeId(this.id);
363
363
  }
364
364
  isEnabled() {
365
365
  return this.enabled;
@@ -382,13 +382,17 @@ class JsonFormsAbstractControl extends JsonFormsBaseRenderer {
382
382
  triggerValidation() {
383
383
  // these cause the correct update of the error underline, seems to be
384
384
  // related to ionic-team/ionic#11640
385
- this.form.markAsTouched();
385
+ const config = this.jsonFormsService.getConfig();
386
+ const appliedUiSchemaOptions = merge({}, config, this.uischema?.options);
387
+ if (!appliedUiSchemaOptions.showErrorsOnTouch) {
388
+ this.form.markAsTouched();
389
+ }
386
390
  this.form.updateValueAndValidity();
387
391
  }
388
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsAbstractControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
389
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: JsonFormsAbstractControl, isStandalone: true, selector: "ng-component", inputs: { id: "id", disabled: "disabled", visible: "visible" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
392
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAbstractControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
393
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: JsonFormsAbstractControl, isStandalone: true, selector: "ng-component", inputs: { id: "id", disabled: "disabled", visible: "visible" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
390
394
  }
391
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsAbstractControl, decorators: [{
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAbstractControl, decorators: [{
392
396
  type: Component,
393
397
  args: [{
394
398
  template: '',
@@ -425,16 +429,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
425
429
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
426
430
  THE SOFTWARE.
427
431
  */
428
- class JsonFormsControl extends JsonFormsAbstractControl {
429
- mapToProps(state) {
430
- const props = mapStateToControlProps(state, this.getOwnProps());
431
- return { ...props };
432
- }
433
- }
434
- class JsonFormsControlWithDetail extends JsonFormsAbstractControl {
432
+ class JsonFormsArrayControl extends JsonFormsAbstractControl {
435
433
  mapToProps(state) {
436
- const props = mapStateToControlWithDetailProps(state, this.getOwnProps());
437
- return { ...props };
434
+ const props = mapStateToArrayControlProps(state, this.getOwnProps());
435
+ const t = state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;
436
+ const translations = getArrayTranslations(t, arrayDefaultTranslations, props.i18nKeyPrefix, props.label);
437
+ return { ...props, translations };
438
438
  }
439
439
  }
440
440
 
@@ -462,12 +462,16 @@ class JsonFormsControlWithDetail extends JsonFormsAbstractControl {
462
462
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
463
463
  THE SOFTWARE.
464
464
  */
465
- class JsonFormsArrayControl extends JsonFormsAbstractControl {
465
+ class JsonFormsControl extends JsonFormsAbstractControl {
466
466
  mapToProps(state) {
467
- const props = mapStateToArrayControlProps(state, this.getOwnProps());
468
- const t = state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;
469
- const translations = getArrayTranslations(t, arrayDefaultTranslations, props.i18nKeyPrefix, props.label);
470
- return { ...props, translations };
467
+ const props = mapStateToControlProps(state, this.getOwnProps());
468
+ return { ...props };
469
+ }
470
+ }
471
+ class JsonFormsControlWithDetail extends JsonFormsAbstractControl {
472
+ mapToProps(state) {
473
+ const props = mapStateToControlWithDetailProps(state, this.getOwnProps());
474
+ return { ...props };
471
475
  }
472
476
  }
473
477
 
@@ -496,10 +500,10 @@ class JsonFormsArrayControl extends JsonFormsAbstractControl {
496
500
  THE SOFTWARE.
497
501
  */
498
502
  class UnknownRenderer {
499
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: UnknownRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
500
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: UnknownRenderer, isStandalone: true, selector: "unknown.renderer", ngImport: i0, template: 'No applicable renderer found!', isInline: true });
503
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: UnknownRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
504
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: UnknownRenderer, isStandalone: true, selector: "unknown.renderer", ngImport: i0, template: 'No applicable renderer found!', isInline: true });
501
505
  }
502
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: UnknownRenderer, decorators: [{
506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: UnknownRenderer, decorators: [{
503
507
  type: Component,
504
508
  args: [{
505
509
  selector: 'unknown.renderer',
@@ -590,17 +594,17 @@ class JsonFormsOutlet extends JsonFormsBaseRenderer {
590
594
  const controlInstance = instance;
591
595
  if (controlInstance.id === undefined) {
592
596
  const id = isControl(props.uischema)
593
- ? createId(props.uischema.scope)
597
+ ? Id.createId(props.uischema.scope)
594
598
  : undefined;
595
599
  instance.id = id;
596
600
  }
597
601
  }
598
602
  }
599
603
  }
600
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsOutlet, deps: null, target: i0.ɵɵFactoryTarget.Directive });
601
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.21", type: JsonFormsOutlet, isStandalone: true, selector: "jsonforms-outlet", inputs: { renderProps: "renderProps" }, usesInheritance: true, ngImport: i0 });
604
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsOutlet, deps: null, target: i0.ɵɵFactoryTarget.Directive });
605
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.24", type: JsonFormsOutlet, isStandalone: true, selector: "jsonforms-outlet", inputs: { renderProps: "renderProps" }, usesInheritance: true, ngImport: i0 });
602
606
  }
603
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsOutlet, decorators: [{
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsOutlet, decorators: [{
604
608
  type: Directive,
605
609
  args: [{
606
610
  selector: 'jsonforms-outlet',
@@ -609,6 +613,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
609
613
  type: Input
610
614
  }] } });
611
615
 
616
+ /*
617
+ The MIT License
618
+
619
+ Copyright (c) 2017-2020 EclipseSource Munich
620
+ https://github.com/eclipsesource/jsonforms
621
+
622
+ Permission is hereby granted, free of charge, to any person obtaining a copy
623
+ of this software and associated documentation files (the "Software"), to deal
624
+ in the Software without restriction, including without limitation the rights
625
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
626
+ copies of the Software, and to permit persons to whom the Software is
627
+ furnished to do so, subject to the following conditions:
628
+
629
+ The above copyright notice and this permission notice shall be included in
630
+ all copies or substantial portions of the Software.
631
+
632
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
633
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
634
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
635
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
636
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
637
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
638
+ THE SOFTWARE.
639
+ */
640
+ /**
641
+ * Injection token for providing a global JSONForms config via Angular's DI system.
642
+ * Config provided via this token acts as the base; the `config` @Input on the
643
+ * `<jsonforms>` component takes precedence when both are supplied.
644
+ */
645
+ const JSONFORMS_CONFIG = new InjectionToken('JsonFormsConfig');
646
+ /**
647
+ * Returns an Angular provider that sets the global JSONForms config.
648
+ *
649
+ * @example
650
+ * // Standalone bootstrap (app.config.ts)
651
+ * export const appConfig: ApplicationConfig = {
652
+ * providers: [provideJsonFormsConfig({ showErrorsOnTouch: false })],
653
+ * };
654
+ */
655
+ function provideJsonFormsConfig(config) {
656
+ return { provide: JSONFORMS_CONFIG, useValue: config };
657
+ }
658
+
612
659
  /*
613
660
  The MIT License
614
661
 
@@ -656,6 +703,7 @@ class JsonForms {
656
703
  initialized = false;
657
704
  oldI18N;
658
705
  jsonformsService = inject(JsonFormsAngularService);
706
+ providedConfig = inject(JSONFORMS_CONFIG, { optional: true });
659
707
  ngOnInit() {
660
708
  this.jsonformsService.init({
661
709
  core: {
@@ -669,7 +717,7 @@ class JsonForms {
669
717
  uischemas: this.uischemas,
670
718
  i18n: this.i18n,
671
719
  renderers: this.renderers,
672
- config: this.config,
720
+ config: merge({}, this.providedConfig, this.config),
673
721
  readonly: this.readonly,
674
722
  }, this.middleware);
675
723
  this.subscription = this.jsonformsService.$state.subscribe((state) => {
@@ -739,16 +787,16 @@ class JsonForms {
739
787
  this.jsonformsService.setReadonly(newReadonly.currentValue);
740
788
  }
741
789
  if (newConfig && !newConfig.isFirstChange()) {
742
- this.jsonformsService.updateConfig(Actions.setConfig(newConfig.currentValue));
790
+ this.jsonformsService.updateConfig(Actions.setConfig(merge({}, this.providedConfig, newConfig.currentValue)));
743
791
  }
744
792
  }
745
793
  ngOnDestroy() {
746
794
  this.subscription.unsubscribe();
747
795
  }
748
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonForms, deps: [], target: i0.ɵɵFactoryTarget.Component });
749
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.21", type: JsonForms, isStandalone: true, selector: "jsonforms", inputs: { uischema: "uischema", schema: "schema", data: "data", renderers: "renderers", uischemas: "uischemas", readonly: "readonly", validationMode: "validationMode", ajv: "ajv", config: "config", i18n: "i18n", additionalErrors: "additionalErrors", middleware: "middleware" }, outputs: { dataChange: "dataChange", errors: "errors" }, providers: [JsonFormsAngularService], usesOnChanges: true, ngImport: i0, template: '<jsonforms-outlet></jsonforms-outlet>', isInline: true, dependencies: [{ kind: "directive", type: JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }] });
796
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonForms, deps: [], target: i0.ɵɵFactoryTarget.Component });
797
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: JsonForms, isStandalone: true, selector: "jsonforms", inputs: { uischema: "uischema", schema: "schema", data: "data", renderers: "renderers", uischemas: "uischemas", readonly: "readonly", validationMode: "validationMode", ajv: "ajv", config: "config", i18n: "i18n", additionalErrors: "additionalErrors", middleware: "middleware" }, outputs: { dataChange: "dataChange", errors: "errors" }, providers: [JsonFormsAngularService], usesOnChanges: true, ngImport: i0, template: '<jsonforms-outlet></jsonforms-outlet>', isInline: true, dependencies: [{ kind: "directive", type: JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }] });
750
798
  }
751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonForms, decorators: [{
799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonForms, decorators: [{
752
800
  type: Component,
753
801
  args: [{
754
802
  selector: 'jsonforms',
@@ -811,11 +859,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
811
859
  THE SOFTWARE.
812
860
  */
813
861
  class JsonFormsModule {
814
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
815
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsModule, imports: [JsonFormsOutlet, UnknownRenderer, JsonForms], exports: [JsonFormsOutlet, JsonForms] });
816
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsModule });
862
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
863
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsModule, imports: [JsonFormsOutlet, UnknownRenderer, JsonForms], exports: [JsonFormsOutlet, JsonForms] });
864
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsModule });
817
865
  }
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: JsonFormsModule, decorators: [{
866
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsModule, decorators: [{
819
867
  type: NgModule,
820
868
  args: [{
821
869
  imports: [JsonFormsOutlet, UnknownRenderer, JsonForms],
@@ -825,20 +873,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
825
873
 
826
874
  /*
827
875
  The MIT License
828
-
876
+
829
877
  Copyright (c) 2017-2020 EclipseSource Munich
830
878
  https://github.com/eclipsesource/jsonforms
831
-
879
+
832
880
  Permission is hereby granted, free of charge, to any person obtaining a copy
833
881
  of this software and associated documentation files (the "Software"), to deal
834
882
  in the Software without restriction, including without limitation the rights
835
883
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
836
884
  copies of the Software, and to permit persons to whom the Software is
837
885
  furnished to do so, subject to the following conditions:
838
-
886
+
839
887
  The above copyright notice and this permission notice shall be included in
840
888
  all copies or substantial portions of the Software.
841
-
889
+
842
890
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
843
891
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
844
892
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -852,5 +900,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
852
900
  * Generated bundle index. Do not edit.
853
901
  */
854
902
 
855
- export { JsonForms, JsonFormsAbstractControl, JsonFormsAngularService, JsonFormsArrayControl, JsonFormsBaseRenderer, JsonFormsControl, JsonFormsControlWithDetail, JsonFormsModule, JsonFormsOutlet, USE_STATE_VALUE, UnknownRenderer };
903
+ export { JSONFORMS_CONFIG, JsonForms, JsonFormsAbstractControl, JsonFormsAngularService, JsonFormsArrayControl, JsonFormsBaseRenderer, JsonFormsControl, JsonFormsControlWithDetail, JsonFormsModule, JsonFormsOutlet, USE_STATE_VALUE, UnknownRenderer, provideJsonFormsConfig };
856
904
  //# sourceMappingURL=jsonforms-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonforms-angular.mjs","sources":["../../src/library/base.renderer.ts","../../src/library/jsonforms.service.ts","../../src/library/abstract-control.ts","../../src/library/control.ts","../../src/library/array-control.ts","../../src/library/unknown.component.ts","../../src/library/jsonforms.component.ts","../../src/library/jsonforms-root.component.ts","../../src/library/jsonforms.module.ts","../../src/library/index.ts","../../src/jsonforms-angular.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport {\n JsonSchema,\n OwnPropsOfRenderer,\n UISchemaElement,\n} from '@jsonforms/core';\nimport { Subscription } from 'rxjs';\n\n@Directive()\nexport class JsonFormsBaseRenderer<T extends UISchemaElement>\n implements OnDestroy\n{\n @Input() uischema: T;\n @Input() schema: JsonSchema;\n @Input() path: string;\n protected subscriptions: Subscription = new Subscription();\n\n protected addSubscription(subscription: Subscription | Subscription[]) {\n if (Array.isArray(subscription)) {\n subscription.forEach((sub) => this.subscriptions.add(sub));\n } else {\n this.subscriptions.add(subscription);\n }\n }\n\n protected getOwnProps(): OwnPropsOfRenderer {\n return {\n uischema: this.uischema,\n schema: this.schema,\n path: this.path,\n };\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n Actions,\n configReducer,\n CoreActions,\n coreReducer,\n generateDefaultUISchema,\n generateJsonSchema,\n i18nReducer,\n JsonFormsRendererRegistryEntry,\n JsonFormsState,\n JsonFormsSubStates,\n JsonSchema,\n I18nActions,\n RankedTester,\n setConfig,\n SetConfigAction,\n UISchemaActions,\n UISchemaElement,\n uischemaRegistryReducer,\n UISchemaTester,\n ValidationMode,\n updateI18n,\n Middleware,\n defaultMiddleware,\n} from '@jsonforms/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport type { JsonFormsBaseRenderer } from './base.renderer';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport type Ajv from 'ajv';\nimport type { ErrorObject } from 'ajv';\n\nexport const USE_STATE_VALUE = Symbol('Marker to use state value');\nexport class JsonFormsAngularService {\n private _state: JsonFormsSubStates;\n private state: BehaviorSubject<JsonFormsState>;\n private middleware: Middleware;\n\n init(\n initialState: JsonFormsSubStates = {\n core: {\n data: undefined,\n schema: undefined,\n uischema: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: undefined,\n },\n },\n middleware: Middleware = defaultMiddleware\n ) {\n this.middleware = middleware;\n this._state = initialState;\n this._state.config = configReducer(\n undefined,\n setConfig(this._state.config)\n );\n this._state.i18n = i18nReducer(\n this._state.i18n,\n updateI18n(\n this._state.i18n?.locale,\n this._state.i18n?.translate,\n this._state.i18n?.translateError\n )\n );\n this.state = new BehaviorSubject({ jsonforms: this._state });\n const data = initialState.core.data;\n const schema = initialState.core.schema ?? generateJsonSchema(data);\n const uischema =\n initialState.core.uischema ?? generateDefaultUISchema(schema);\n this.updateCore(Actions.init(data, schema, uischema));\n }\n\n get $state(): Observable<JsonFormsState> {\n if (!this.state) {\n throw new Error('Please call init first!');\n }\n return this.state.asObservable();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.addRenderer}\n */\n registerRenderer(\n renderer: JsonFormsBaseRenderer<UISchemaElement>,\n tester: RankedTester\n ): void {\n this.addRenderer(renderer, tester);\n }\n addRenderer(\n renderer: JsonFormsBaseRenderer<UISchemaElement>,\n tester: RankedTester\n ): void {\n this._state.renderers.push({ renderer, tester });\n this.updateSubject();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.setRenderer}\n */\n registerRenderers(renderers: JsonFormsRendererRegistryEntry[]): void {\n this.setRenderers(renderers);\n }\n setRenderers(renderers: JsonFormsRendererRegistryEntry[]): void {\n this._state.renderers = renderers;\n this.updateSubject();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.removeRenderer}\n */\n unregisterRenderer(tester: RankedTester): void {\n this.removeRenderer(tester);\n }\n removeRenderer(tester: RankedTester): void {\n const findIndex = this._state.renderers.findIndex(\n (v) => v.tester === tester\n );\n if (findIndex === -1) {\n return;\n }\n const renderers = this._state.renderers.filter((v) => v.tester !== tester);\n this._state.renderers = renderers;\n this.updateSubject();\n }\n\n updateValidationMode(validationMode: ValidationMode): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.setValidationMode(validationMode),\n coreReducer\n );\n this._state.core = coreState;\n this.updateSubject();\n }\n\n updateI18n<T extends I18nActions>(i18nAction: T): T {\n const i18nState = i18nReducer(this._state.i18n, i18nAction);\n if (i18nState !== this._state.i18n) {\n this._state.i18n = i18nState;\n this.updateSubject();\n }\n return i18nAction;\n }\n\n updateCore<T extends CoreActions>(coreAction: T): T {\n const coreState = this.middleware(\n this._state.core,\n coreAction,\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n return coreAction;\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.setUiSchemas}\n */\n updateUiSchema<T extends UISchemaActions>(uischemaAction: T): T {\n const uischemaState = uischemaRegistryReducer(\n this._state.uischemas,\n uischemaAction\n );\n this._state.uischemas = uischemaState;\n this.updateSubject();\n return uischemaAction;\n }\n\n setUiSchemas(\n uischemas: { tester: UISchemaTester; uischema: UISchemaElement }[]\n ): void {\n this._state.uischemas = uischemas;\n this.updateSubject();\n }\n\n updateConfig<T extends SetConfigAction>(setConfigAction: T): T {\n const configState = configReducer(this._state.config, setConfigAction);\n this._state.config = configState;\n this.updateSubject();\n return setConfigAction;\n }\n\n setUiSchema(uischema: UISchemaElement | undefined): void {\n const newUiSchema =\n uischema ?? generateDefaultUISchema(this._state.core.schema);\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n this._state.core.data,\n this._state.core.schema,\n newUiSchema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n setSchema(schema: JsonSchema | undefined): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n this._state.core.data,\n schema ?? generateJsonSchema(this._state.core.data),\n this._state.core.uischema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n setData(data: any): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n data,\n this._state.core.schema,\n this._state.core.uischema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n getLocale(): string | undefined {\n return this._state.i18n?.locale;\n }\n\n setLocale(locale: string): void {\n this._state.i18n.locale = locale;\n this.updateSubject();\n }\n\n setReadonly(readonly: boolean): void {\n this._state.readonly = readonly;\n this.updateSubject();\n }\n\n setMiddleware(middleware: Middleware): void {\n this._state.middleware = middleware;\n this.updateSubject();\n }\n\n getState(): JsonFormsState {\n return cloneDeep({ jsonforms: this._state });\n }\n\n getConfig(): any {\n return cloneDeep(this._state.config);\n }\n\n refresh(): void {\n this.updateSubject();\n }\n\n updateCoreState(\n data: any | typeof USE_STATE_VALUE,\n schema: JsonSchema | typeof USE_STATE_VALUE,\n uischema: UISchemaElement | typeof USE_STATE_VALUE,\n ajv: Ajv | typeof USE_STATE_VALUE,\n validationMode: ValidationMode | typeof USE_STATE_VALUE,\n additionalErrors: ErrorObject[] | typeof USE_STATE_VALUE\n ): void {\n const newData = data === USE_STATE_VALUE ? this._state.core.data : data;\n const newSchema =\n schema === USE_STATE_VALUE\n ? this._state.core.schema\n : schema ?? generateJsonSchema(newData);\n const newUischema =\n uischema === USE_STATE_VALUE\n ? this._state.core.uischema\n : uischema ?? generateDefaultUISchema(newSchema);\n const newAjv = ajv === USE_STATE_VALUE ? this._state.core.ajv : ajv;\n const newValidationMode =\n validationMode === USE_STATE_VALUE\n ? this._state.core.validationMode\n : validationMode;\n const newAdditionalErrors =\n additionalErrors === USE_STATE_VALUE\n ? this._state.core.additionalErrors\n : additionalErrors;\n this.updateCore(\n Actions.updateCore(newData, newSchema, newUischema, {\n ajv: newAjv,\n validationMode: newValidationMode,\n additionalErrors: newAdditionalErrors,\n })\n );\n }\n\n private updateSubject(): void {\n this.state.next({ jsonforms: this._state });\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n Actions,\n computeLabel,\n ControlElement,\n JsonFormsState,\n JsonSchema,\n OwnPropsOfControl,\n removeId,\n StatePropsOfControl,\n} from '@jsonforms/core';\nimport { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n ValidationErrors,\n ValidatorFn,\n} from '@angular/forms';\n\nimport { JsonFormsBaseRenderer } from './base.renderer';\nimport { JsonFormsAngularService } from './jsonforms.service';\nimport merge from 'lodash/merge';\n@Component({\n template: '',\n})\nexport abstract class JsonFormsAbstractControl<\n Props extends StatePropsOfControl\n >\n extends JsonFormsBaseRenderer<ControlElement>\n implements OnInit, OnDestroy\n{\n @Input() id: string;\n @Input() disabled: boolean;\n @Input() visible: boolean;\n\n form: FormControl;\n data: any;\n label: string;\n description: string;\n error: string | null;\n scopedSchema: JsonSchema;\n rootSchema: JsonSchema;\n enabled: boolean;\n hidden: boolean;\n propsPath: string;\n\n protected jsonFormsService = inject(JsonFormsAngularService);\n\n constructor() {\n super();\n this.form = new FormControl(\n {\n value: '',\n disabled: true,\n },\n {\n updateOn: 'change',\n validators: this.validator.bind(this),\n }\n );\n }\n\n getEventValue = (event: any) => event.value;\n\n onChange(ev: any) {\n this.jsonFormsService.updateCore(\n Actions.update(this.propsPath, () => this.getEventValue(ev))\n );\n this.triggerValidation();\n }\n\n shouldShowUnfocusedDescription(): boolean {\n const config = this.jsonFormsService.getConfig();\n const appliedUiSchemaOptions = merge({}, config, this.uischema.options);\n return !!appliedUiSchemaOptions.showUnfocusedDescription;\n }\n\n ngOnInit() {\n this.addSubscription(\n this.jsonFormsService.$state.subscribe({\n next: (state: JsonFormsState) => {\n const props = this.mapToProps(state);\n const {\n data,\n enabled,\n errors,\n label,\n required,\n schema,\n rootSchema,\n visible,\n path,\n config,\n } = props;\n this.label = computeLabel(\n label,\n required,\n config ? config.hideRequiredAsterisk : false\n );\n this.data = data;\n this.error = errors;\n this.enabled = enabled;\n this.isEnabled() ? this.form.enable() : this.form.disable();\n this.hidden = !visible;\n this.scopedSchema = schema;\n this.rootSchema = rootSchema;\n this.description = props.description ?? '';\n this.id = props.id;\n this.form.setValue(data);\n this.propsPath = path;\n this.mapAdditionalProps(props);\n },\n })\n );\n this.triggerValidation();\n }\n\n validator: ValidatorFn = (_c: AbstractControl): ValidationErrors | null => {\n return this.error ? { error: this.error } : null;\n };\n\n mapAdditionalProps(_props: Props) {\n // do nothing by default\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n removeId(this.id);\n }\n\n isEnabled(): boolean {\n return this.enabled;\n }\n\n protected getOwnProps(): OwnPropsOfControl {\n const props: OwnPropsOfControl = {\n uischema: this.uischema,\n schema: this.schema,\n path: this.path,\n id: this.id,\n };\n if (this.disabled !== undefined) {\n props.enabled = !this.disabled;\n }\n if (this.visible !== undefined) {\n props.visible = this.visible;\n }\n return props;\n }\n\n protected abstract mapToProps(state: JsonFormsState): Props;\n\n protected triggerValidation() {\n // these cause the correct update of the error underline, seems to be\n // related to ionic-team/ionic#11640\n this.form.markAsTouched();\n this.form.updateValueAndValidity();\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n JsonFormsState,\n mapStateToControlProps,\n mapStateToControlWithDetailProps,\n StatePropsOfControl,\n StatePropsOfControlWithDetail,\n} from '@jsonforms/core';\nimport type { OnDestroy, OnInit } from '@angular/core';\nimport { JsonFormsAbstractControl } from './abstract-control';\n\nexport class JsonFormsControl\n extends JsonFormsAbstractControl<StatePropsOfControl>\n implements OnInit, OnDestroy\n{\n protected mapToProps(state: JsonFormsState): StatePropsOfControl {\n const props = mapStateToControlProps(state, this.getOwnProps());\n return { ...props };\n }\n}\n\nexport class JsonFormsControlWithDetail\n extends JsonFormsAbstractControl<StatePropsOfControlWithDetail>\n implements OnInit, OnDestroy\n{\n protected mapToProps(state: JsonFormsState): StatePropsOfControlWithDetail {\n const props = mapStateToControlWithDetailProps(state, this.getOwnProps());\n return { ...props };\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n defaultJsonFormsI18nState,\n getArrayTranslations,\n JsonFormsState,\n mapStateToArrayControlProps,\n StatePropsOfArrayControl,\n} from '@jsonforms/core';\nimport type { OnDestroy, OnInit } from '@angular/core';\nimport { JsonFormsAbstractControl } from './abstract-control';\n\nexport class JsonFormsArrayControl\n extends JsonFormsAbstractControl<StatePropsOfArrayControl>\n implements OnInit, OnDestroy\n{\n protected mapToProps(\n state: JsonFormsState\n ): StatePropsOfArrayControl & { translations: ArrayTranslations } {\n const props = mapStateToArrayControlProps(state, this.getOwnProps());\n const t =\n state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;\n const translations = getArrayTranslations(\n t,\n arrayDefaultTranslations,\n props.i18nKeyPrefix,\n props.label\n );\n return { ...props, translations };\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { Component } from '@angular/core';\n@Component({\n selector: 'unknown.renderer',\n template: 'No applicable renderer found!',\n})\nexport class UnknownRenderer {}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport maxBy from 'lodash/maxBy';\nimport {\n Directive,\n inject,\n Input,\n OnInit,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n createId,\n isControl,\n getConfig,\n JsonFormsProps,\n JsonFormsState,\n JsonSchema,\n mapStateToJsonFormsRendererProps,\n OwnPropsOfRenderer,\n StatePropsOfJsonFormsRenderer,\n UISchemaElement,\n} from '@jsonforms/core';\nimport { UnknownRenderer } from './unknown.component';\nimport { JsonFormsBaseRenderer } from './base.renderer';\nimport { JsonFormsControl } from './control';\nimport { JsonFormsAngularService } from './jsonforms.service';\n\nimport isEqual from 'lodash/isEqual';\nimport get from 'lodash/get';\n\nconst areEqual = (\n prevProps: StatePropsOfJsonFormsRenderer,\n nextProps: StatePropsOfJsonFormsRenderer\n) => {\n return (\n get(prevProps, 'renderers.length') === get(nextProps, 'renderers.length') &&\n get(prevProps, 'cells.length') === get(nextProps, 'cells.length') &&\n get(prevProps, 'uischemas.length') === get(nextProps, 'uischemas.length') &&\n get(prevProps, 'schema') === get(nextProps, 'schema') &&\n isEqual(get(prevProps, 'uischema'), get(nextProps, 'uischema')) &&\n get(prevProps, 'path') === get(nextProps, 'path')\n );\n};\n\n@Directive({\n selector: 'jsonforms-outlet',\n})\nexport class JsonFormsOutlet\n extends JsonFormsBaseRenderer<UISchemaElement>\n implements OnInit\n{\n private previousProps: StatePropsOfJsonFormsRenderer;\n\n private viewContainerRef = inject(ViewContainerRef);\n private jsonformsService = inject(JsonFormsAngularService);\n\n @Input()\n set renderProps(renderProps: OwnPropsOfRenderer) {\n this.path = renderProps.path;\n this.schema = renderProps.schema;\n this.uischema = renderProps.uischema;\n this.update(this.jsonformsService.getState());\n }\n\n ngOnInit(): void {\n this.addSubscription(\n this.jsonformsService.$state.subscribe({\n next: (state: JsonFormsState) => this.update(state),\n })\n );\n }\n\n update(state: JsonFormsState) {\n const props = mapStateToJsonFormsRendererProps(state, {\n schema: this.schema,\n uischema: this.uischema,\n path: this.path,\n });\n if (areEqual(this.previousProps, props)) {\n return;\n } else {\n this.previousProps = props;\n }\n const { renderers } = props as JsonFormsProps;\n const schema: JsonSchema = this.schema || props.schema;\n const uischema = this.uischema || props.uischema;\n const testerContext = {\n rootSchema: props.rootSchema,\n config: getConfig(state),\n };\n\n const renderer = maxBy(renderers, (r) =>\n r.tester(uischema, schema, testerContext)\n );\n let bestComponent: Type<any> = UnknownRenderer;\n if (\n renderer !== undefined &&\n renderer.tester(uischema, schema, testerContext) !== -1\n ) {\n bestComponent = renderer.renderer;\n }\n\n this.viewContainerRef.clear();\n const currentComponentRef =\n this.viewContainerRef.createComponent(bestComponent);\n\n if (currentComponentRef.instance instanceof JsonFormsBaseRenderer) {\n const instance =\n currentComponentRef.instance as JsonFormsBaseRenderer<UISchemaElement>;\n instance.uischema = uischema;\n instance.schema = schema;\n instance.path = this.path;\n if (instance instanceof JsonFormsControl) {\n const controlInstance = instance as JsonFormsControl;\n if (controlInstance.id === undefined) {\n const id = isControl(props.uischema)\n ? createId(props.uischema.scope)\n : undefined;\n (instance as JsonFormsControl).id = id;\n }\n }\n }\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n Component,\n DoCheck,\n EventEmitter,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport {\n Actions,\n JsonFormsI18nState,\n JsonFormsRendererRegistryEntry,\n JsonSchema,\n Middleware,\n UISchemaElement,\n UISchemaTester,\n ValidationMode,\n defaultMiddleware,\n} from '@jsonforms/core';\nimport type Ajv from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';\nimport { Subscription } from 'rxjs';\nimport { JsonFormsOutlet } from './jsonforms.component';\n\n// TODO Can this be rewritten to not use DoCheck and OnChanges?\n/* eslint-disable @angular-eslint/no-conflicting-lifecycle */\n@Component({\n selector: 'jsonforms',\n template: '<jsonforms-outlet></jsonforms-outlet>',\n providers: [JsonFormsAngularService],\n imports: [JsonFormsOutlet],\n})\nexport class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {\n @Input() uischema: UISchemaElement;\n @Input() schema: JsonSchema;\n @Input() data: any;\n @Input() renderers: JsonFormsRendererRegistryEntry[];\n @Input() uischemas: { tester: UISchemaTester; uischema: UISchemaElement }[];\n @Output() dataChange = new EventEmitter<any>();\n @Input() readonly: boolean;\n @Input() validationMode: ValidationMode;\n @Input() ajv: Ajv;\n @Input() config: any;\n @Input() i18n: JsonFormsI18nState;\n @Input() additionalErrors: ErrorObject[];\n @Input() middleware: Middleware = defaultMiddleware;\n @Output() errors = new EventEmitter<ErrorObject[]>();\n\n private previousData: any;\n private previousErrors: ErrorObject[];\n subscription: Subscription;\n\n private initialized = false;\n oldI18N: JsonFormsI18nState;\n\n private jsonformsService = inject(JsonFormsAngularService);\n\n ngOnInit(): void {\n this.jsonformsService.init(\n {\n core: {\n data: this.data,\n uischema: this.uischema,\n schema: this.schema,\n ajv: this.ajv,\n validationMode: this.validationMode,\n additionalErrors: this.additionalErrors,\n },\n uischemas: this.uischemas,\n i18n: this.i18n,\n renderers: this.renderers,\n config: this.config,\n readonly: this.readonly,\n },\n this.middleware\n );\n this.subscription = this.jsonformsService.$state.subscribe((state) => {\n const data = state?.jsonforms?.core?.data;\n const errors = state?.jsonforms?.core?.errors;\n if (this.previousData !== data) {\n this.previousData = data;\n this.dataChange.emit(data);\n }\n if (this.previousErrors !== errors) {\n this.previousErrors = errors;\n this.errors.emit(errors);\n }\n });\n this.oldI18N = this.i18n;\n this.initialized = true;\n }\n\n ngDoCheck(): void {\n // we can't use ngOnChanges as then nested i18n changes will not be detected\n // the update will result in a no-op when the parameters did not change\n if (\n this.oldI18N?.locale !== this.i18n?.locale ||\n this.oldI18N?.translate !== this.i18n?.translate ||\n this.oldI18N?.translateError !== this.i18n?.translateError\n ) {\n this.jsonformsService.updateI18n(\n Actions.updateI18n(\n this.oldI18N?.locale === this.i18n?.locale\n ? this.jsonformsService.getState().jsonforms.i18n.locale\n : this.i18n?.locale,\n this.oldI18N?.translate === this.i18n?.translate\n ? this.jsonformsService.getState().jsonforms.i18n.translate\n : this.i18n?.translate,\n this.oldI18N?.translateError === this.i18n?.translateError\n ? this.jsonformsService.getState().jsonforms.i18n.translateError\n : this.i18n?.translateError\n )\n );\n this.oldI18N = this.i18n;\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.initialized) {\n return;\n }\n const newData = changes.data;\n const newSchema = changes.schema;\n const newUiSchema = changes.uischema;\n const newRenderers = changes.renderers;\n const newUischemas = changes.uischemas;\n const newI18n = changes.i18n;\n const newReadonly = changes.readonly;\n const newValidationMode = changes.validationMode;\n const newAjv = changes.ajv;\n const newConfig = changes.config;\n const newAdditionalErrors = changes.additionalErrors;\n\n if (\n newData ||\n newSchema ||\n newUiSchema ||\n newValidationMode ||\n newAjv ||\n newAdditionalErrors\n ) {\n this.jsonformsService.updateCoreState(\n newData ? newData.currentValue : USE_STATE_VALUE,\n newSchema ? newSchema.currentValue : USE_STATE_VALUE,\n newUiSchema ? newUiSchema.currentValue : USE_STATE_VALUE,\n newAjv ? newAjv.currentValue : USE_STATE_VALUE,\n newValidationMode ? newValidationMode.currentValue : USE_STATE_VALUE,\n newAdditionalErrors ? newAdditionalErrors.currentValue : USE_STATE_VALUE\n );\n }\n\n if (newRenderers && !newRenderers.isFirstChange()) {\n this.jsonformsService.setRenderers(newRenderers.currentValue);\n }\n\n if (newUischemas && !newUischemas.isFirstChange()) {\n this.jsonformsService.setUiSchemas(newUischemas.currentValue);\n }\n\n if (newI18n && !newI18n.isFirstChange()) {\n this.jsonformsService.updateI18n(\n Actions.updateI18n(\n newI18n.currentValue?.locale,\n newI18n.currentValue?.translate,\n newI18n.currentValue?.translateError\n )\n );\n }\n\n if (newReadonly && !newReadonly.isFirstChange()) {\n this.jsonformsService.setReadonly(newReadonly.currentValue);\n }\n\n if (newConfig && !newConfig.isFirstChange()) {\n this.jsonformsService.updateConfig(\n Actions.setConfig(newConfig.currentValue)\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { NgModule } from '@angular/core';\n\nimport { JsonForms } from './jsonforms-root.component';\nimport { JsonFormsOutlet } from './jsonforms.component';\nimport { UnknownRenderer } from './unknown.component';\n@NgModule({\n imports: [JsonFormsOutlet, UnknownRenderer, JsonForms],\n exports: [JsonFormsOutlet, JsonForms],\n})\nexport class JsonFormsModule {}\n","/*\n The MIT License\n \n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nexport * from './base.renderer';\nexport * from './control';\nexport * from './array-control';\nexport * from './jsonforms.component';\nexport * from './jsonforms.module';\nexport * from './unknown.component';\nexport * from './jsonforms.service';\nexport * from './jsonforms-root.component';\nexport * from './abstract-control';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBE;MAUW,qBAAqB,CAAA;AAGvB,IAAA,QAAQ;AACR,IAAA,MAAM;AACN,IAAA,IAAI;AACH,IAAA,aAAa,GAAiB,IAAI,YAAY,EAAE;AAEhD,IAAA,eAAe,CAAC,YAA2C,EAAA;AACnE,QAA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AAA;;4FAEd,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,QAAQ,EAAE,uCAAuC;oBACjD,SAAS,EAAE,CAAC,uBAAuB,CAAC;oBACpC,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA;;sBAEE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC3EH;;;;;;;;;;;;;;;;;;;;;;;AAuBE;MAUW,eAAe,CAAA;wGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAf,eAAe,EAAA,OAAA,EAAA,CAHhB,eAAe,EAAE,eAAe,EAAE,SAAS,CAAA,EAAA,OAAA,EAAA,CAC3C,eAAe,EAAE,SAAS,CAAA,EAAA,CAAA;yGAEzB,eAAe,EAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,SAAS,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC;AACtC,iBAAA;;;AChCD;;;;;;;;;;;;;;;;;;;;;;;AAuBE;;ACvBF;;AAEG;;;;"}
1
+ {"version":3,"file":"jsonforms-angular.mjs","sources":["../../src/library/base.renderer.ts","../../src/library/jsonforms.service.ts","../../src/library/abstract-control.ts","../../src/library/array-control.ts","../../src/library/control.ts","../../src/library/unknown.component.ts","../../src/library/jsonforms.component.ts","../../src/library/jsonforms.config.ts","../../src/library/jsonforms-root.component.ts","../../src/library/jsonforms.module.ts","../../src/library/index.ts","../../src/jsonforms-angular.ts"],"sourcesContent":["/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport {\n JsonSchema,\n OwnPropsOfRenderer,\n UISchemaElement,\n} from '@jsonforms/core';\nimport { Subscription } from 'rxjs';\n\n@Directive()\nexport class JsonFormsBaseRenderer<T extends UISchemaElement>\n implements OnDestroy\n{\n @Input() uischema: T;\n @Input() schema: JsonSchema;\n @Input() path: string;\n protected subscriptions: Subscription = new Subscription();\n\n protected addSubscription(subscription: Subscription | Subscription[]) {\n if (Array.isArray(subscription)) {\n subscription.forEach((sub) => this.subscriptions.add(sub));\n } else {\n this.subscriptions.add(subscription);\n }\n }\n\n protected getOwnProps(): OwnPropsOfRenderer {\n return {\n uischema: this.uischema,\n schema: this.schema,\n path: this.path,\n };\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n Actions,\n configReducer,\n CoreActions,\n coreReducer,\n generateDefaultUISchema,\n generateJsonSchema,\n i18nReducer,\n JsonFormsRendererRegistryEntry,\n JsonFormsState,\n JsonFormsSubStates,\n JsonSchema,\n I18nActions,\n RankedTester,\n setConfig,\n SetConfigAction,\n UISchemaActions,\n UISchemaElement,\n uischemaRegistryReducer,\n UISchemaTester,\n ValidationMode,\n updateI18n,\n Middleware,\n defaultMiddleware,\n} from '@jsonforms/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport type { JsonFormsBaseRenderer } from './base.renderer';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport type Ajv from 'ajv';\nimport type { ErrorObject } from 'ajv';\n\nexport const USE_STATE_VALUE = Symbol('Marker to use state value');\nexport class JsonFormsAngularService {\n private _state: JsonFormsSubStates;\n private state: BehaviorSubject<JsonFormsState>;\n private middleware: Middleware;\n\n init(\n initialState: JsonFormsSubStates = {\n core: {\n data: undefined,\n schema: undefined,\n uischema: undefined,\n validationMode: 'ValidateAndShow',\n additionalErrors: undefined,\n },\n },\n middleware: Middleware = defaultMiddleware\n ) {\n this.middleware = middleware;\n this._state = initialState;\n this._state.config = configReducer(\n undefined,\n setConfig(this._state.config)\n );\n this._state.i18n = i18nReducer(\n this._state.i18n,\n updateI18n(\n this._state.i18n?.locale,\n this._state.i18n?.translate,\n this._state.i18n?.translateError\n )\n );\n this.state = new BehaviorSubject({ jsonforms: this._state });\n const data = initialState.core.data;\n const schema = initialState.core.schema ?? generateJsonSchema(data);\n const uischema =\n initialState.core.uischema ?? generateDefaultUISchema(schema);\n this.updateCore(Actions.init(data, schema, uischema));\n }\n\n get $state(): Observable<JsonFormsState> {\n if (!this.state) {\n throw new Error('Please call init first!');\n }\n return this.state.asObservable();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.addRenderer}\n */\n registerRenderer(\n renderer: JsonFormsBaseRenderer<UISchemaElement>,\n tester: RankedTester\n ): void {\n this.addRenderer(renderer, tester);\n }\n addRenderer(\n renderer: JsonFormsBaseRenderer<UISchemaElement>,\n tester: RankedTester\n ): void {\n this._state.renderers.push({ renderer, tester });\n this.updateSubject();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.setRenderer}\n */\n registerRenderers(renderers: JsonFormsRendererRegistryEntry[]): void {\n this.setRenderers(renderers);\n }\n setRenderers(renderers: JsonFormsRendererRegistryEntry[]): void {\n this._state.renderers = renderers;\n this.updateSubject();\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.removeRenderer}\n */\n unregisterRenderer(tester: RankedTester): void {\n this.removeRenderer(tester);\n }\n removeRenderer(tester: RankedTester): void {\n const findIndex = this._state.renderers.findIndex(\n (v) => v.tester === tester\n );\n if (findIndex === -1) {\n return;\n }\n const renderers = this._state.renderers.filter((v) => v.tester !== tester);\n this._state.renderers = renderers;\n this.updateSubject();\n }\n\n updateValidationMode(validationMode: ValidationMode): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.setValidationMode(validationMode),\n coreReducer\n );\n this._state.core = coreState;\n this.updateSubject();\n }\n\n updateI18n<T extends I18nActions>(i18nAction: T): T {\n const i18nState = i18nReducer(this._state.i18n, i18nAction);\n if (i18nState !== this._state.i18n) {\n this._state.i18n = i18nState;\n this.updateSubject();\n }\n return i18nAction;\n }\n\n updateCore<T extends CoreActions>(coreAction: T): T {\n const coreState = this.middleware(\n this._state.core,\n coreAction,\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n return coreAction;\n }\n\n /**\n * @deprecated use {@link JsonFormsAngularService.setUiSchemas}\n */\n updateUiSchema<T extends UISchemaActions>(uischemaAction: T): T {\n const uischemaState = uischemaRegistryReducer(\n this._state.uischemas,\n uischemaAction\n );\n this._state.uischemas = uischemaState;\n this.updateSubject();\n return uischemaAction;\n }\n\n setUiSchemas(\n uischemas: { tester: UISchemaTester; uischema: UISchemaElement }[]\n ): void {\n this._state.uischemas = uischemas;\n this.updateSubject();\n }\n\n updateConfig<T extends SetConfigAction>(setConfigAction: T): T {\n const configState = configReducer(this._state.config, setConfigAction);\n this._state.config = configState;\n this.updateSubject();\n return setConfigAction;\n }\n\n setUiSchema(uischema: UISchemaElement | undefined): void {\n const newUiSchema =\n uischema ?? generateDefaultUISchema(this._state.core.schema);\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n this._state.core.data,\n this._state.core.schema,\n newUiSchema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n setSchema(schema: JsonSchema | undefined): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n this._state.core.data,\n schema ?? generateJsonSchema(this._state.core.data),\n this._state.core.uischema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n setData(data: any): void {\n const coreState = this.middleware(\n this._state.core,\n Actions.updateCore(\n data,\n this._state.core.schema,\n this._state.core.uischema\n ),\n coreReducer\n );\n if (coreState !== this._state.core) {\n this._state.core = coreState;\n this.updateSubject();\n }\n }\n\n getLocale(): string | undefined {\n return this._state.i18n?.locale;\n }\n\n setLocale(locale: string): void {\n this._state.i18n.locale = locale;\n this.updateSubject();\n }\n\n setReadonly(readonly: boolean): void {\n this._state.readonly = readonly;\n this.updateSubject();\n }\n\n setMiddleware(middleware: Middleware): void {\n this._state.middleware = middleware;\n this.updateSubject();\n }\n\n getState(): JsonFormsState {\n return cloneDeep({ jsonforms: this._state });\n }\n\n getConfig(): any {\n return cloneDeep(this._state.config);\n }\n\n refresh(): void {\n this.updateSubject();\n }\n\n updateCoreState(\n data: any | typeof USE_STATE_VALUE,\n schema: JsonSchema | typeof USE_STATE_VALUE,\n uischema: UISchemaElement | typeof USE_STATE_VALUE,\n ajv: Ajv | typeof USE_STATE_VALUE,\n validationMode: ValidationMode | typeof USE_STATE_VALUE,\n additionalErrors: ErrorObject[] | typeof USE_STATE_VALUE\n ): void {\n const newData = data === USE_STATE_VALUE ? this._state.core.data : data;\n const newSchema =\n schema === USE_STATE_VALUE\n ? this._state.core.schema\n : schema ?? generateJsonSchema(newData);\n const newUischema =\n uischema === USE_STATE_VALUE\n ? this._state.core.uischema\n : uischema ?? generateDefaultUISchema(newSchema);\n const newAjv = ajv === USE_STATE_VALUE ? this._state.core.ajv : ajv;\n const newValidationMode =\n validationMode === USE_STATE_VALUE\n ? this._state.core.validationMode\n : validationMode;\n const newAdditionalErrors =\n additionalErrors === USE_STATE_VALUE\n ? this._state.core.additionalErrors\n : additionalErrors;\n this.updateCore(\n Actions.updateCore(newData, newSchema, newUischema, {\n ajv: newAjv,\n validationMode: newValidationMode,\n additionalErrors: newAdditionalErrors,\n })\n );\n }\n\n private updateSubject(): void {\n this.state.next({ jsonforms: this._state });\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport {\n AbstractControl,\n FormControl,\n ValidationErrors,\n ValidatorFn,\n} from '@angular/forms';\nimport {\n Actions,\n computeLabel,\n ControlElement,\n Id,\n JsonFormsState,\n JsonSchema,\n OwnPropsOfControl,\n StatePropsOfControl,\n} from '@jsonforms/core';\nimport { JsonFormsBaseRenderer } from './base.renderer';\nimport { JsonFormsAngularService } from './jsonforms.service';\n\nimport merge from 'lodash/merge';\n\n@Component({\n template: '',\n})\nexport abstract class JsonFormsAbstractControl<\n Props extends StatePropsOfControl\n >\n extends JsonFormsBaseRenderer<ControlElement>\n implements OnInit, OnDestroy\n{\n @Input() id: string;\n @Input() disabled: boolean;\n @Input() visible: boolean;\n\n form: FormControl;\n data: any;\n label: string;\n description: string;\n error: string | null;\n scopedSchema: JsonSchema;\n rootSchema: JsonSchema;\n enabled: boolean;\n hidden: boolean;\n propsPath: string;\n\n protected jsonFormsService = inject(JsonFormsAngularService);\n\n constructor() {\n super();\n this.form = new FormControl(\n {\n value: '',\n disabled: true,\n },\n {\n updateOn: 'change',\n validators: this.validator.bind(this),\n }\n );\n }\n\n getEventValue = (event: any) => event.value;\n\n onChange(ev: any) {\n this.jsonFormsService.updateCore(\n Actions.update(this.propsPath, () => this.getEventValue(ev))\n );\n this.triggerValidation();\n }\n\n shouldShowUnfocusedDescription(): boolean {\n const config = this.jsonFormsService.getConfig();\n const appliedUiSchemaOptions = merge({}, config, this.uischema.options);\n return !!appliedUiSchemaOptions.showUnfocusedDescription;\n }\n\n ngOnInit() {\n this.addSubscription(\n this.jsonFormsService.$state.subscribe({\n next: (state: JsonFormsState) => {\n const props = this.mapToProps(state);\n const {\n data,\n enabled,\n errors,\n label,\n required,\n schema,\n rootSchema,\n visible,\n path,\n config,\n } = props;\n this.label = computeLabel(\n label,\n required,\n config ? config.hideRequiredAsterisk : false\n );\n this.data = data;\n this.error = errors;\n this.enabled = enabled;\n this.isEnabled() ? this.form.enable() : this.form.disable();\n this.hidden = !visible;\n this.scopedSchema = schema;\n this.rootSchema = rootSchema;\n this.description = props.description ?? '';\n this.id = props.id;\n this.form.setValue(data);\n this.propsPath = path;\n this.mapAdditionalProps(props);\n },\n })\n );\n this.triggerValidation();\n }\n\n validator: ValidatorFn = (_c: AbstractControl): ValidationErrors | null => {\n return this.error ? { error: this.error } : null;\n };\n\n mapAdditionalProps(_props: Props) {\n // do nothing by default\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n Id.removeId(this.id);\n }\n\n isEnabled(): boolean {\n return this.enabled;\n }\n\n protected getOwnProps(): OwnPropsOfControl {\n const props: OwnPropsOfControl = {\n uischema: this.uischema,\n schema: this.schema,\n path: this.path,\n id: this.id,\n };\n if (this.disabled !== undefined) {\n props.enabled = !this.disabled;\n }\n if (this.visible !== undefined) {\n props.visible = this.visible;\n }\n return props;\n }\n\n protected abstract mapToProps(state: JsonFormsState): Props;\n\n protected triggerValidation() {\n // these cause the correct update of the error underline, seems to be\n // related to ionic-team/ionic#11640\n const config = this.jsonFormsService.getConfig();\n const appliedUiSchemaOptions = merge({}, config, this.uischema?.options);\n\n if (!appliedUiSchemaOptions.showErrorsOnTouch) {\n this.form.markAsTouched();\n }\n this.form.updateValueAndValidity();\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n arrayDefaultTranslations,\n ArrayTranslations,\n defaultJsonFormsI18nState,\n getArrayTranslations,\n JsonFormsState,\n mapStateToArrayControlProps,\n StatePropsOfArrayControl,\n} from '@jsonforms/core';\nimport type { OnDestroy, OnInit } from '@angular/core';\nimport { JsonFormsAbstractControl } from './abstract-control';\n\nexport class JsonFormsArrayControl\n extends JsonFormsAbstractControl<StatePropsOfArrayControl>\n implements OnInit, OnDestroy\n{\n protected mapToProps(\n state: JsonFormsState\n ): StatePropsOfArrayControl & { translations: ArrayTranslations } {\n const props = mapStateToArrayControlProps(state, this.getOwnProps());\n const t =\n state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;\n const translations = getArrayTranslations(\n t,\n arrayDefaultTranslations,\n props.i18nKeyPrefix,\n props.label\n );\n return { ...props, translations };\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n JsonFormsState,\n mapStateToControlProps,\n mapStateToControlWithDetailProps,\n StatePropsOfControl,\n StatePropsOfControlWithDetail,\n} from '@jsonforms/core';\nimport type { OnDestroy, OnInit } from '@angular/core';\nimport { JsonFormsAbstractControl } from './abstract-control';\n\nexport class JsonFormsControl\n extends JsonFormsAbstractControl<StatePropsOfControl>\n implements OnInit, OnDestroy\n{\n protected mapToProps(state: JsonFormsState): StatePropsOfControl {\n const props = mapStateToControlProps(state, this.getOwnProps());\n return { ...props };\n }\n}\n\nexport class JsonFormsControlWithDetail\n extends JsonFormsAbstractControl<StatePropsOfControlWithDetail>\n implements OnInit, OnDestroy\n{\n protected mapToProps(state: JsonFormsState): StatePropsOfControlWithDetail {\n const props = mapStateToControlWithDetailProps(state, this.getOwnProps());\n return { ...props };\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { Component } from '@angular/core';\n@Component({\n selector: 'unknown.renderer',\n template: 'No applicable renderer found!',\n})\nexport class UnknownRenderer {}\n","/*\n The MIT License\n\n Copyright (c) 2017-2019 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport maxBy from 'lodash/maxBy';\nimport {\n Directive,\n inject,\n Input,\n OnInit,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n Id,\n isControl,\n getConfig,\n JsonFormsProps,\n JsonFormsState,\n JsonSchema,\n mapStateToJsonFormsRendererProps,\n OwnPropsOfRenderer,\n StatePropsOfJsonFormsRenderer,\n UISchemaElement,\n} from '@jsonforms/core';\nimport { UnknownRenderer } from './unknown.component';\nimport { JsonFormsBaseRenderer } from './base.renderer';\nimport { JsonFormsControl } from './control';\nimport { JsonFormsAngularService } from './jsonforms.service';\n\nimport isEqual from 'lodash/isEqual';\nimport get from 'lodash/get';\n\nconst areEqual = (\n prevProps: StatePropsOfJsonFormsRenderer,\n nextProps: StatePropsOfJsonFormsRenderer\n) => {\n return (\n get(prevProps, 'renderers.length') === get(nextProps, 'renderers.length') &&\n get(prevProps, 'cells.length') === get(nextProps, 'cells.length') &&\n get(prevProps, 'uischemas.length') === get(nextProps, 'uischemas.length') &&\n get(prevProps, 'schema') === get(nextProps, 'schema') &&\n isEqual(get(prevProps, 'uischema'), get(nextProps, 'uischema')) &&\n get(prevProps, 'path') === get(nextProps, 'path')\n );\n};\n\n@Directive({\n selector: 'jsonforms-outlet',\n})\nexport class JsonFormsOutlet\n extends JsonFormsBaseRenderer<UISchemaElement>\n implements OnInit\n{\n private previousProps: StatePropsOfJsonFormsRenderer;\n\n private viewContainerRef = inject(ViewContainerRef);\n private jsonformsService = inject(JsonFormsAngularService);\n\n @Input()\n set renderProps(renderProps: OwnPropsOfRenderer) {\n this.path = renderProps.path;\n this.schema = renderProps.schema;\n this.uischema = renderProps.uischema;\n this.update(this.jsonformsService.getState());\n }\n\n ngOnInit(): void {\n this.addSubscription(\n this.jsonformsService.$state.subscribe({\n next: (state: JsonFormsState) => this.update(state),\n })\n );\n }\n\n update(state: JsonFormsState) {\n const props = mapStateToJsonFormsRendererProps(state, {\n schema: this.schema,\n uischema: this.uischema,\n path: this.path,\n });\n if (areEqual(this.previousProps, props)) {\n return;\n } else {\n this.previousProps = props;\n }\n const { renderers } = props as JsonFormsProps;\n const schema: JsonSchema = this.schema || props.schema;\n const uischema = this.uischema || props.uischema;\n const testerContext = {\n rootSchema: props.rootSchema,\n config: getConfig(state),\n };\n\n const renderer = maxBy(renderers, (r) =>\n r.tester(uischema, schema, testerContext)\n );\n let bestComponent: Type<any> = UnknownRenderer;\n if (\n renderer !== undefined &&\n renderer.tester(uischema, schema, testerContext) !== -1\n ) {\n bestComponent = renderer.renderer;\n }\n\n this.viewContainerRef.clear();\n const currentComponentRef =\n this.viewContainerRef.createComponent(bestComponent);\n\n if (currentComponentRef.instance instanceof JsonFormsBaseRenderer) {\n const instance =\n currentComponentRef.instance as JsonFormsBaseRenderer<UISchemaElement>;\n instance.uischema = uischema;\n instance.schema = schema;\n instance.path = this.path;\n if (instance instanceof JsonFormsControl) {\n const controlInstance = instance as JsonFormsControl;\n if (controlInstance.id === undefined) {\n const id = isControl(props.uischema)\n ? Id.createId(props.uischema.scope)\n : undefined;\n (instance as JsonFormsControl).id = id;\n }\n }\n }\n }\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { InjectionToken, Provider } from '@angular/core';\n\nexport interface JsonFormsAngularConfig {\n /**\n * When true, validation errors only appear after the user has interacted with the field.\n */\n showErrorsOnTouch?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Injection token for providing a global JSONForms config via Angular's DI system.\n * Config provided via this token acts as the base; the `config` @Input on the\n * `<jsonforms>` component takes precedence when both are supplied.\n */\nexport const JSONFORMS_CONFIG = new InjectionToken<JsonFormsAngularConfig>(\n 'JsonFormsConfig'\n);\n\n/**\n * Returns an Angular provider that sets the global JSONForms config.\n *\n * @example\n * // Standalone bootstrap (app.config.ts)\n * export const appConfig: ApplicationConfig = {\n * providers: [provideJsonFormsConfig({ showErrorsOnTouch: false })],\n * };\n */\nexport function provideJsonFormsConfig(\n config: JsonFormsAngularConfig\n): Provider {\n return { provide: JSONFORMS_CONFIG, useValue: config };\n}\n","/*\n The MIT License\n\n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport {\n Component,\n DoCheck,\n EventEmitter,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport {\n Actions,\n defaultMiddleware,\n JsonFormsI18nState,\n JsonFormsRendererRegistryEntry,\n JsonSchema,\n Middleware,\n UISchemaElement,\n UISchemaTester,\n ValidationMode,\n} from '@jsonforms/core';\nimport type Ajv from 'ajv';\nimport type { ErrorObject } from 'ajv';\nimport merge from 'lodash/merge';\nimport { Subscription } from 'rxjs';\nimport { JsonFormsOutlet } from './jsonforms.component';\nimport { JSONFORMS_CONFIG, JsonFormsAngularConfig } from './jsonforms.config';\nimport { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';\n\n// TODO Can this be rewritten to not use DoCheck and OnChanges?\n/* eslint-disable @angular-eslint/no-conflicting-lifecycle */\n@Component({\n selector: 'jsonforms',\n template: '<jsonforms-outlet></jsonforms-outlet>',\n providers: [JsonFormsAngularService],\n imports: [JsonFormsOutlet],\n})\nexport class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {\n @Input() uischema: UISchemaElement;\n @Input() schema: JsonSchema;\n @Input() data: any;\n @Input() renderers: JsonFormsRendererRegistryEntry[];\n @Input() uischemas: { tester: UISchemaTester; uischema: UISchemaElement }[];\n @Output() dataChange = new EventEmitter<any>();\n @Input() readonly: boolean;\n @Input() validationMode: ValidationMode;\n @Input() ajv: Ajv;\n @Input() config: JsonFormsAngularConfig;\n @Input() i18n: JsonFormsI18nState;\n @Input() additionalErrors: ErrorObject[];\n @Input() middleware: Middleware = defaultMiddleware;\n @Output() errors = new EventEmitter<ErrorObject[]>();\n\n private previousData: any;\n private previousErrors: ErrorObject[];\n subscription: Subscription;\n\n private initialized = false;\n oldI18N: JsonFormsI18nState;\n\n private jsonformsService = inject(JsonFormsAngularService);\n private providedConfig = inject(JSONFORMS_CONFIG, { optional: true });\n\n ngOnInit(): void {\n this.jsonformsService.init(\n {\n core: {\n data: this.data,\n uischema: this.uischema,\n schema: this.schema,\n ajv: this.ajv,\n validationMode: this.validationMode,\n additionalErrors: this.additionalErrors,\n },\n uischemas: this.uischemas,\n i18n: this.i18n,\n renderers: this.renderers,\n config: merge({}, this.providedConfig, this.config),\n readonly: this.readonly,\n },\n this.middleware\n );\n this.subscription = this.jsonformsService.$state.subscribe((state) => {\n const data = state?.jsonforms?.core?.data;\n const errors = state?.jsonforms?.core?.errors;\n if (this.previousData !== data) {\n this.previousData = data;\n this.dataChange.emit(data);\n }\n if (this.previousErrors !== errors) {\n this.previousErrors = errors;\n this.errors.emit(errors);\n }\n });\n this.oldI18N = this.i18n;\n this.initialized = true;\n }\n\n ngDoCheck(): void {\n // we can't use ngOnChanges as then nested i18n changes will not be detected\n // the update will result in a no-op when the parameters did not change\n if (\n this.oldI18N?.locale !== this.i18n?.locale ||\n this.oldI18N?.translate !== this.i18n?.translate ||\n this.oldI18N?.translateError !== this.i18n?.translateError\n ) {\n this.jsonformsService.updateI18n(\n Actions.updateI18n(\n this.oldI18N?.locale === this.i18n?.locale\n ? this.jsonformsService.getState().jsonforms.i18n.locale\n : this.i18n?.locale,\n this.oldI18N?.translate === this.i18n?.translate\n ? this.jsonformsService.getState().jsonforms.i18n.translate\n : this.i18n?.translate,\n this.oldI18N?.translateError === this.i18n?.translateError\n ? this.jsonformsService.getState().jsonforms.i18n.translateError\n : this.i18n?.translateError\n )\n );\n this.oldI18N = this.i18n;\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.initialized) {\n return;\n }\n const newData = changes.data;\n const newSchema = changes.schema;\n const newUiSchema = changes.uischema;\n const newRenderers = changes.renderers;\n const newUischemas = changes.uischemas;\n const newI18n = changes.i18n;\n const newReadonly = changes.readonly;\n const newValidationMode = changes.validationMode;\n const newAjv = changes.ajv;\n const newConfig = changes.config;\n const newAdditionalErrors = changes.additionalErrors;\n\n if (\n newData ||\n newSchema ||\n newUiSchema ||\n newValidationMode ||\n newAjv ||\n newAdditionalErrors\n ) {\n this.jsonformsService.updateCoreState(\n newData ? newData.currentValue : USE_STATE_VALUE,\n newSchema ? newSchema.currentValue : USE_STATE_VALUE,\n newUiSchema ? newUiSchema.currentValue : USE_STATE_VALUE,\n newAjv ? newAjv.currentValue : USE_STATE_VALUE,\n newValidationMode ? newValidationMode.currentValue : USE_STATE_VALUE,\n newAdditionalErrors ? newAdditionalErrors.currentValue : USE_STATE_VALUE\n );\n }\n\n if (newRenderers && !newRenderers.isFirstChange()) {\n this.jsonformsService.setRenderers(newRenderers.currentValue);\n }\n\n if (newUischemas && !newUischemas.isFirstChange()) {\n this.jsonformsService.setUiSchemas(newUischemas.currentValue);\n }\n\n if (newI18n && !newI18n.isFirstChange()) {\n this.jsonformsService.updateI18n(\n Actions.updateI18n(\n newI18n.currentValue?.locale,\n newI18n.currentValue?.translate,\n newI18n.currentValue?.translateError\n )\n );\n }\n\n if (newReadonly && !newReadonly.isFirstChange()) {\n this.jsonformsService.setReadonly(newReadonly.currentValue);\n }\n\n if (newConfig && !newConfig.isFirstChange()) {\n this.jsonformsService.updateConfig(\n Actions.setConfig(\n merge({}, this.providedConfig, newConfig.currentValue)\n )\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subscription.unsubscribe();\n }\n}\n","/*\n The MIT License\n \n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nimport { NgModule } from '@angular/core';\n\nimport { JsonForms } from './jsonforms-root.component';\nimport { JsonFormsOutlet } from './jsonforms.component';\nimport { UnknownRenderer } from './unknown.component';\n@NgModule({\n imports: [JsonFormsOutlet, UnknownRenderer, JsonForms],\n exports: [JsonFormsOutlet, JsonForms],\n})\nexport class JsonFormsModule {}\n","/*\n The MIT License\n\n Copyright (c) 2017-2020 EclipseSource Munich\n https://github.com/eclipsesource/jsonforms\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\nexport * from './abstract-control';\nexport * from './array-control';\nexport * from './base.renderer';\nexport * from './control';\nexport * from './jsonforms-root.component';\nexport * from './jsonforms.component';\nexport * from './jsonforms.config';\nexport * from './jsonforms.module';\nexport * from './jsonforms.service';\nexport * from './unknown.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBE;MAUW,qBAAqB,CAAA;AAGvB,IAAA,QAAQ;AACR,IAAA,MAAM;AACN,IAAA,IAAI;AACH,IAAA,aAAa,GAAiB,IAAI,YAAY,EAAE;AAEhD,IAAA,eAAe,CAAC,YAA2C,EAAA;AACnE,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AAC/B,YAAA,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5D;aAAO;AACL,YAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;QACtC;IACF;IAEU,WAAW,GAAA;QACnB,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB;IACH;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;IAClC;wGA1BW,qBAAqB,EAAA,IAAA,EA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ges, EventEmitter, SimpleChanges } from '@angular/core';
3
- import { UISchemaElement, JsonSchema, OwnPropsOfRenderer, JsonFormsSubStates, Middleware, JsonFormsState, RankedTester, JsonFormsRendererRegistryEntry, ValidationMode, I18nActions, CoreActions, UISchemaActions, UISchemaTester, SetConfigAction, StatePropsOfControl, ControlElement, OwnPropsOfControl, StatePropsOfControlWithDetail, StatePropsOfArrayControl, ArrayTranslations, JsonFormsI18nState } from '@jsonforms/core';
4
- import { Subscription, Observable } from 'rxjs';
2
+ import { OnDestroy, OnInit, InjectionToken, Provider, DoCheck, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
5
3
  import { FormControl, ValidatorFn } from '@angular/forms';
4
+ import { UISchemaElement, JsonSchema, OwnPropsOfRenderer, JsonFormsSubStates, Middleware, JsonFormsState, RankedTester, JsonFormsRendererRegistryEntry, ValidationMode, I18nActions, CoreActions, UISchemaActions, UISchemaTester, SetConfigAction, StatePropsOfControl, ControlElement, OwnPropsOfControl, StatePropsOfArrayControl, ArrayTranslations, StatePropsOfControlWithDetail, JsonFormsI18nState } from '@jsonforms/core';
5
+ import { Subscription, Observable } from 'rxjs';
6
6
  import Ajv, { ErrorObject } from 'ajv';
7
7
 
8
8
  declare class JsonFormsBaseRenderer<T extends UISchemaElement> implements OnDestroy {
@@ -96,34 +96,42 @@ declare abstract class JsonFormsAbstractControl<Props extends StatePropsOfContro
96
96
  static ɵcmp: i0.ɵɵComponentDeclaration<JsonFormsAbstractControl<any>, "ng-component", never, { "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; }, {}, never, never, true, never>;
97
97
  }
98
98
 
99
- declare class JsonFormsControl extends JsonFormsAbstractControl<StatePropsOfControl> implements OnInit, OnDestroy {
100
- protected mapToProps(state: JsonFormsState): StatePropsOfControl;
101
- }
102
- declare class JsonFormsControlWithDetail extends JsonFormsAbstractControl<StatePropsOfControlWithDetail> implements OnInit, OnDestroy {
103
- protected mapToProps(state: JsonFormsState): StatePropsOfControlWithDetail;
104
- }
105
-
106
99
  declare class JsonFormsArrayControl extends JsonFormsAbstractControl<StatePropsOfArrayControl> implements OnInit, OnDestroy {
107
100
  protected mapToProps(state: JsonFormsState): StatePropsOfArrayControl & {
108
101
  translations: ArrayTranslations;
109
102
  };
110
103
  }
111
104
 
112
- declare class JsonFormsOutlet extends JsonFormsBaseRenderer<UISchemaElement> implements OnInit {
113
- private previousProps;
114
- private viewContainerRef;
115
- private jsonformsService;
116
- set renderProps(renderProps: OwnPropsOfRenderer);
117
- ngOnInit(): void;
118
- update(state: JsonFormsState): void;
119
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsOutlet, never>;
120
- static ɵdir: i0.ɵɵDirectiveDeclaration<JsonFormsOutlet, "jsonforms-outlet", never, { "renderProps": { "alias": "renderProps"; "required": false; }; }, {}, never, never, true, never>;
105
+ declare class JsonFormsControl extends JsonFormsAbstractControl<StatePropsOfControl> implements OnInit, OnDestroy {
106
+ protected mapToProps(state: JsonFormsState): StatePropsOfControl;
107
+ }
108
+ declare class JsonFormsControlWithDetail extends JsonFormsAbstractControl<StatePropsOfControlWithDetail> implements OnInit, OnDestroy {
109
+ protected mapToProps(state: JsonFormsState): StatePropsOfControlWithDetail;
121
110
  }
122
111
 
123
- declare class UnknownRenderer {
124
- static ɵfac: i0.ɵɵFactoryDeclaration<UnknownRenderer, never>;
125
- static ɵcmp: i0.ɵɵComponentDeclaration<UnknownRenderer, "unknown.renderer", never, {}, {}, never, never, true, never>;
112
+ interface JsonFormsAngularConfig {
113
+ /**
114
+ * When true, validation errors only appear after the user has interacted with the field.
115
+ */
116
+ showErrorsOnTouch?: boolean;
117
+ [key: string]: unknown;
126
118
  }
119
+ /**
120
+ * Injection token for providing a global JSONForms config via Angular's DI system.
121
+ * Config provided via this token acts as the base; the `config` @Input on the
122
+ * `<jsonforms>` component takes precedence when both are supplied.
123
+ */
124
+ declare const JSONFORMS_CONFIG: InjectionToken<JsonFormsAngularConfig>;
125
+ /**
126
+ * Returns an Angular provider that sets the global JSONForms config.
127
+ *
128
+ * @example
129
+ * // Standalone bootstrap (app.config.ts)
130
+ * export const appConfig: ApplicationConfig = {
131
+ * providers: [provideJsonFormsConfig({ showErrorsOnTouch: false })],
132
+ * };
133
+ */
134
+ declare function provideJsonFormsConfig(config: JsonFormsAngularConfig): Provider;
127
135
 
128
136
  declare class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
129
137
  uischema: UISchemaElement;
@@ -138,7 +146,7 @@ declare class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
138
146
  readonly: boolean;
139
147
  validationMode: ValidationMode;
140
148
  ajv: Ajv;
141
- config: any;
149
+ config: JsonFormsAngularConfig;
142
150
  i18n: JsonFormsI18nState;
143
151
  additionalErrors: ErrorObject[];
144
152
  middleware: Middleware;
@@ -149,6 +157,7 @@ declare class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
149
157
  private initialized;
150
158
  oldI18N: JsonFormsI18nState;
151
159
  private jsonformsService;
160
+ private providedConfig;
152
161
  ngOnInit(): void;
153
162
  ngDoCheck(): void;
154
163
  ngOnChanges(changes: SimpleChanges): void;
@@ -157,11 +166,28 @@ declare class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
157
166
  static ɵcmp: i0.ɵɵComponentDeclaration<JsonForms, "jsonforms", never, { "uischema": { "alias": "uischema"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; "data": { "alias": "data"; "required": false; }; "renderers": { "alias": "renderers"; "required": false; }; "uischemas": { "alias": "uischemas"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "validationMode": { "alias": "validationMode"; "required": false; }; "ajv": { "alias": "ajv"; "required": false; }; "config": { "alias": "config"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "additionalErrors": { "alias": "additionalErrors"; "required": false; }; "middleware": { "alias": "middleware"; "required": false; }; }, { "dataChange": "dataChange"; "errors": "errors"; }, never, never, true, never>;
158
167
  }
159
168
 
169
+ declare class JsonFormsOutlet extends JsonFormsBaseRenderer<UISchemaElement> implements OnInit {
170
+ private previousProps;
171
+ private viewContainerRef;
172
+ private jsonformsService;
173
+ set renderProps(renderProps: OwnPropsOfRenderer);
174
+ ngOnInit(): void;
175
+ update(state: JsonFormsState): void;
176
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsOutlet, never>;
177
+ static ɵdir: i0.ɵɵDirectiveDeclaration<JsonFormsOutlet, "jsonforms-outlet", never, { "renderProps": { "alias": "renderProps"; "required": false; }; }, {}, never, never, true, never>;
178
+ }
179
+
180
+ declare class UnknownRenderer {
181
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnknownRenderer, never>;
182
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnknownRenderer, "unknown.renderer", never, {}, {}, never, never, true, never>;
183
+ }
184
+
160
185
  declare class JsonFormsModule {
161
186
  static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsModule, never>;
162
187
  static ɵmod: i0.ɵɵNgModuleDeclaration<JsonFormsModule, never, [typeof JsonFormsOutlet, typeof UnknownRenderer, typeof JsonForms], [typeof JsonFormsOutlet, typeof JsonForms]>;
163
188
  static ɵinj: i0.ɵɵInjectorDeclaration<JsonFormsModule>;
164
189
  }
165
190
 
166
- export { JsonForms, JsonFormsAbstractControl, JsonFormsAngularService, JsonFormsArrayControl, JsonFormsBaseRenderer, JsonFormsControl, JsonFormsControlWithDetail, JsonFormsModule, JsonFormsOutlet, USE_STATE_VALUE, UnknownRenderer };
191
+ export { JSONFORMS_CONFIG, JsonForms, JsonFormsAbstractControl, JsonFormsAngularService, JsonFormsArrayControl, JsonFormsBaseRenderer, JsonFormsControl, JsonFormsControlWithDetail, JsonFormsModule, JsonFormsOutlet, USE_STATE_VALUE, UnknownRenderer, provideJsonFormsConfig };
192
+ export type { JsonFormsAngularConfig };
167
193
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sources":["../src/library/base.renderer.ts","../src/library/jsonforms.service.ts","../src/library/abstract-control.ts","../src/library/control.ts","../src/library/array-control.ts","../src/library/jsonforms.component.ts","../src/library/unknown.component.ts","../src/library/jsonforms-root.component.ts","../src/library/jsonforms.module.ts"],"mappings":";;;;;;;AAgCA,cAAA,+CAC6C,sBAChC;;YAGM,UAAU;;AAE3B,6BAAyB,YAAY;4CAEG,YAAY,GAAG,YAAY;6BAQ1C,kBAAkB;AAQ3C;yCAxBW,qBAAqB;2CAArB,qBAAqB;AA2BjC;;ACJD,cAAA,eAAa;AACb,cAAA,uBAAa;;;;AAKX,wBACgB,kBAQb,eACW,UAA8B;AAwB5C,kBAAc,UAAU,CAAC,cAAc;AAOvC;;AAEG;AACH,+BACY,qBAAqB,CAAC,eAAe,WACvC,YAAY;AAItB,0BACY,qBAAqB,CAAC,eAAe,WACvC,YAAY;AAMtB;;AAEG;AACH,iCAA6B,8BAA8B;AAG3D,4BAAwB,8BAA8B;AAKtD;;AAEG;AACH,+BAA2B,YAAY;AAGvC,2BAAuB,YAAY;AAYnC,yCAAqC,cAAc;yBAU9B,WAAW;yBASX,WAAW;AAahC;;AAEG;6BACsB,eAAe;;gBAWjB,cAAc;kBAAY,eAAe;AAAE;2BAM3C,eAAe;AAOtC,0BAAsB,eAAe;AAkBrC,sBAAkB,UAAU;AAgB5B;;AAoBA;AAKA;AAKA,8BAA0B,UAAU;AAKpC,gBAAY,cAAc;AAI1B;AAIA;uCAKqB,eAAe,UAC1B,UAAU,UAAU,eAAe,YACjC,eAAe,UAAU,eAAe,OAC7C,GAAG,UAAU,eAAe,kBACjB,cAAc,UAAU,eAAe,oBACrC,WAAW,YAAY,eAAe;AA6B1D;AAGD;;AC1RD,uBAAA,wBAGsB,eACb,6BAEP,qBAAQ,CAAA,cAAsB,aAC9B,MAAA,EAAW,SAAQ;;;;UAMb,WAAW;;;;AAIjB;kBACc,UAAU;gBACZ,UAAU;;;;gCAKI,uBAAA;;;;AAyB1B;;eA8CW,WAAW;;;AAatB;6BAIyB,iBAAiB;yCAgBL,cAAc;AAEnD;yCA/HoB,wBAAwB;2CAAxB,wBAAwB;AAqI7C;;ACnJD,cAAA,gBAAa,iCACH,CAAA,gCACR,MAAA,EAAW,SAAQ;AAEnB,gCAA4B,cAAc,GAAG,mBAAmB;AAIjE;AAED,cAAA,0BAAa,iCACH,CAAA,0CACR,MAAA,EAAW,SAAQ;AAEnB,gCAA4B,cAAc,GAAG,6BAA6B;AAI3E;;AChBD,cAAA,qBAAa,iCACH,CAAA,qCACR,MAAA,EAAW,SAAQ;gCAGV,cAAc,GACpB,wBAAwB;sBAAmB,iBAAiB;AAAE;AAYlE;;ACaD,cAAA,wBAIE,qBAAQ,CAAA,eAAsB;;;;AAQ9B,iCAC6B,kBAAkB;AAO/C;kBAQc,cAAc;yCAzBjB,eAAe;2CAAf,eAAe;AA4E3B;;ACzHD,cAAA,eAIa;yCAAA,eAAe;2CAAf,eAAe;AAAG;;AC0B/B,cAAA,SAMa,mBAAqB,EAAA,iBAAkB,EAAE,SAAQ;cACzC,eAAe;YACjB,UAAU;;eAEP,8BAA8B;AACzC;gBAAqB,cAAc;kBAAY,eAAe;AAAE;AAC/D,gBAAU,YAAA;;oBAEK,cAAc;SACzB,GAAG;;UAEF,kBAAkB;sBACN,WAAW;gBACjB,UAAU;AACrB,YAAM,YAAA,CAAA,WAAA,SAAA,MAAA;;;kBAIF,YAAY;;aAGjB,kBAAkB;;AAI3B;AAmCA;AAyBA,yBAAqB,aAAa;AA+DlC;yCApJW,SAAS;2CAAT,SAAS;AAuJrB;;ACvLD,cAAA,eAIa;yCAAA,eAAe;0CAAf,eAAe,iBAAAA,eAAA,SAAAC,eAAA,SAAAC,SAAA,WAAAF,eAAA,SAAAE,SAAA;0CAAf,eAAe;AAAG;;;;","names":["i1.JsonFormsOutlet","i2.UnknownRenderer","i3.JsonForms"]}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/library/base.renderer.ts","../src/library/jsonforms.service.ts","../src/library/abstract-control.ts","../src/library/array-control.ts","../src/library/control.ts","../src/library/jsonforms.config.ts","../src/library/jsonforms-root.component.ts","../src/library/jsonforms.component.ts","../src/library/unknown.component.ts","../src/library/jsonforms.module.ts"],"mappings":";;;;;;;AAgCA,cAAA,+CAC6C,sBAChC;;YAGM,UAAU;;AAE3B,6BAAyB,YAAY;4CAEG,YAAY,GAAG,YAAY;6BAQ1C,kBAAkB;AAQ3C;yCAxBW,qBAAqB;2CAArB,qBAAqB;AA2BjC;;ACJD,cAAA,eAAa;AACb,cAAA,uBAAa;;;;AAKX,wBACgB,kBAQb,eACW,UAA8B;AAwB5C,kBAAc,UAAU,CAAC,cAAc;AAOvC;;AAEG;AACH,+BACY,qBAAqB,CAAC,eAAe,WACvC,YAAY;AAItB,0BACY,qBAAqB,CAAC,eAAe,WACvC,YAAY;AAMtB;;AAEG;AACH,iCAA6B,8BAA8B;AAG3D,4BAAwB,8BAA8B;AAKtD;;AAEG;AACH,+BAA2B,YAAY;AAGvC,2BAAuB,YAAY;AAYnC,yCAAqC,cAAc;yBAU9B,WAAW;yBASX,WAAW;AAahC;;AAEG;6BACsB,eAAe;;gBAWjB,cAAc;kBAAY,eAAe;AAAE;2BAM3C,eAAe;AAOtC,0BAAsB,eAAe;AAkBrC,sBAAkB,UAAU;AAgB5B;;AAoBA;AAKA;AAKA,8BAA0B,UAAU;AAKpC,gBAAY,cAAc;AAI1B;AAIA;uCAKqB,eAAe,UAC1B,UAAU,UAAU,eAAe,YACjC,eAAe,UAAU,eAAe,OAC7C,GAAG,UAAU,eAAe,kBACjB,cAAc,UAAU,eAAe,oBACrC,WAAW,YAAY,eAAe;AA6B1D;AAGD;;ACzRD,uBAAA,wBAGsB,eACb,6BAEP,qBAAQ,CAAA,cAAsB,aAC9B,MAAA,EAAW,SAAQ;;;;UAMb,WAAW;;;;AAIjB;kBACc,UAAU;gBACZ,UAAU;;;;gCAKI,uBAAA;;;;AAyB1B;;eA8CW,WAAW;;;AAatB;6BAIyB,iBAAiB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,eAAe;AAAG;;;;","names":["i1.JsonFormsOutlet","i2.UnknownRenderer","i3.JsonForms"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonforms/angular",
3
- "version": "3.8.0-alpha.2",
3
+ "version": "3.8.0",
4
4
  "description": "Angular module of JSON Forms",
5
5
  "repository": {
6
6
  "type": "git",
@@ -61,20 +61,20 @@
61
61
  "lodash": "^4.17.21"
62
62
  },
63
63
  "peerDependencies": {
64
- "@angular/core": "^20.0.0 || ^21.0.0 || ^22.0.0-rc.0",
65
- "@angular/forms": "^20.0.0 || ^21.0.0 || ^22.0.0-rc.0",
66
- "@jsonforms/core": "3.8.0-alpha.2",
64
+ "@angular/core": "^20.0.0 || ^21.0.0 || ^22.0.0",
65
+ "@angular/forms": "^20.0.0 || ^21.0.0 || ^22.0.0",
66
+ "@jsonforms/core": "3.8.0",
67
67
  "rxjs": "^6.6.0 || ^7.4.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@angular-eslint/eslint-plugin": "^20.0.0",
71
- "@angular-eslint/eslint-plugin-template": "^20.0.0",
72
- "@angular-eslint/schematics": "^20.0.0",
73
- "@angular-eslint/template-parser": "^20.0.0",
74
- "@angular/compiler": "^20.0.0",
75
- "@angular/compiler-cli": "^20.0.0",
76
- "@angular/core": "^20.0.0",
77
- "@angular/forms": "^20.0.0",
70
+ "@angular-eslint/eslint-plugin": "^20.7.0",
71
+ "@angular-eslint/eslint-plugin-template": "^20.7.0",
72
+ "@angular-eslint/schematics": "^20.7.0",
73
+ "@angular-eslint/template-parser": "^20.7.0",
74
+ "@angular/compiler": "^20.3.24",
75
+ "@angular/compiler-cli": "^20.3.24",
76
+ "@angular/core": "^20.3.24",
77
+ "@angular/forms": "^20.3.24",
78
78
  "@typescript-eslint/eslint-plugin": "^5.54.1",
79
79
  "@typescript-eslint/parser": "^5.54.1",
80
80
  "ava": "^6.1.2",
@@ -92,7 +92,7 @@
92
92
  "tslib": "^2.3.0",
93
93
  "typedoc": "~0.25.3",
94
94
  "typescript": "~5.8.3",
95
- "@jsonforms/core": "3.8.0-alpha.2"
95
+ "@jsonforms/core": "3.8.0"
96
96
  },
97
97
  "scripts": {
98
98
  "build": "node ./build-package.js",
@@ -22,27 +22,28 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
+ import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';
26
+ import {
27
+ AbstractControl,
28
+ FormControl,
29
+ ValidationErrors,
30
+ ValidatorFn,
31
+ } from '@angular/forms';
25
32
  import {
26
33
  Actions,
27
34
  computeLabel,
28
35
  ControlElement,
36
+ Id,
29
37
  JsonFormsState,
30
38
  JsonSchema,
31
39
  OwnPropsOfControl,
32
- removeId,
33
40
  StatePropsOfControl,
34
41
  } from '@jsonforms/core';
35
- import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core';
36
- import {
37
- AbstractControl,
38
- FormControl,
39
- ValidationErrors,
40
- ValidatorFn,
41
- } from '@angular/forms';
42
-
43
42
  import { JsonFormsBaseRenderer } from './base.renderer';
44
43
  import { JsonFormsAngularService } from './jsonforms.service';
44
+
45
45
  import merge from 'lodash/merge';
46
+
46
47
  @Component({
47
48
  template: '',
48
49
  })
@@ -148,7 +149,7 @@ export abstract class JsonFormsAbstractControl<
148
149
 
149
150
  ngOnDestroy() {
150
151
  super.ngOnDestroy();
151
- removeId(this.id);
152
+ Id.removeId(this.id);
152
153
  }
153
154
 
154
155
  isEnabled(): boolean {
@@ -176,7 +177,12 @@ export abstract class JsonFormsAbstractControl<
176
177
  protected triggerValidation() {
177
178
  // these cause the correct update of the error underline, seems to be
178
179
  // related to ionic-team/ionic#11640
179
- this.form.markAsTouched();
180
+ const config = this.jsonFormsService.getConfig();
181
+ const appliedUiSchemaOptions = merge({}, config, this.uischema?.options);
182
+
183
+ if (!appliedUiSchemaOptions.showErrorsOnTouch) {
184
+ this.form.markAsTouched();
185
+ }
180
186
  this.form.updateValueAndValidity();
181
187
  }
182
188
  }
@@ -1,19 +1,19 @@
1
1
  /*
2
2
  The MIT License
3
-
3
+
4
4
  Copyright (c) 2017-2020 EclipseSource Munich
5
5
  https://github.com/eclipsesource/jsonforms
6
-
6
+
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
9
9
  in the Software without restriction, including without limitation the rights
10
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
11
  copies of the Software, and to permit persons to whom the Software is
12
12
  furnished to do so, subject to the following conditions:
13
-
13
+
14
14
  The above copyright notice and this permission notice shall be included in
15
15
  all copies or substantial portions of the Software.
16
-
16
+
17
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
19
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -22,12 +22,13 @@
22
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  THE SOFTWARE.
24
24
  */
25
+ export * from './abstract-control';
26
+ export * from './array-control';
25
27
  export * from './base.renderer';
26
28
  export * from './control';
27
- export * from './array-control';
29
+ export * from './jsonforms-root.component';
28
30
  export * from './jsonforms.component';
31
+ export * from './jsonforms.config';
29
32
  export * from './jsonforms.module';
30
- export * from './unknown.component';
31
33
  export * from './jsonforms.service';
32
- export * from './jsonforms-root.component';
33
- export * from './abstract-control';
34
+ export * from './unknown.component';
@@ -36,6 +36,7 @@ import {
36
36
  } from '@angular/core';
37
37
  import {
38
38
  Actions,
39
+ defaultMiddleware,
39
40
  JsonFormsI18nState,
40
41
  JsonFormsRendererRegistryEntry,
41
42
  JsonSchema,
@@ -43,13 +44,14 @@ import {
43
44
  UISchemaElement,
44
45
  UISchemaTester,
45
46
  ValidationMode,
46
- defaultMiddleware,
47
47
  } from '@jsonforms/core';
48
48
  import type Ajv from 'ajv';
49
49
  import type { ErrorObject } from 'ajv';
50
- import { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';
50
+ import merge from 'lodash/merge';
51
51
  import { Subscription } from 'rxjs';
52
52
  import { JsonFormsOutlet } from './jsonforms.component';
53
+ import { JSONFORMS_CONFIG, JsonFormsAngularConfig } from './jsonforms.config';
54
+ import { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';
53
55
 
54
56
  // TODO Can this be rewritten to not use DoCheck and OnChanges?
55
57
  /* eslint-disable @angular-eslint/no-conflicting-lifecycle */
@@ -69,7 +71,7 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
69
71
  @Input() readonly: boolean;
70
72
  @Input() validationMode: ValidationMode;
71
73
  @Input() ajv: Ajv;
72
- @Input() config: any;
74
+ @Input() config: JsonFormsAngularConfig;
73
75
  @Input() i18n: JsonFormsI18nState;
74
76
  @Input() additionalErrors: ErrorObject[];
75
77
  @Input() middleware: Middleware = defaultMiddleware;
@@ -83,6 +85,7 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
83
85
  oldI18N: JsonFormsI18nState;
84
86
 
85
87
  private jsonformsService = inject(JsonFormsAngularService);
88
+ private providedConfig = inject(JSONFORMS_CONFIG, { optional: true });
86
89
 
87
90
  ngOnInit(): void {
88
91
  this.jsonformsService.init(
@@ -98,7 +101,7 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
98
101
  uischemas: this.uischemas,
99
102
  i18n: this.i18n,
100
103
  renderers: this.renderers,
101
- config: this.config,
104
+ config: merge({}, this.providedConfig, this.config),
102
105
  readonly: this.readonly,
103
106
  },
104
107
  this.middleware
@@ -202,7 +205,9 @@ export class JsonForms implements DoCheck, OnChanges, OnInit, OnDestroy {
202
205
 
203
206
  if (newConfig && !newConfig.isFirstChange()) {
204
207
  this.jsonformsService.updateConfig(
205
- Actions.setConfig(newConfig.currentValue)
208
+ Actions.setConfig(
209
+ merge({}, this.providedConfig, newConfig.currentValue)
210
+ )
206
211
  );
207
212
  }
208
213
  }
@@ -32,7 +32,7 @@ import {
32
32
  ViewContainerRef,
33
33
  } from '@angular/core';
34
34
  import {
35
- createId,
35
+ Id,
36
36
  isControl,
37
37
  getConfig,
38
38
  JsonFormsProps,
@@ -137,7 +137,7 @@ export class JsonFormsOutlet
137
137
  const controlInstance = instance as JsonFormsControl;
138
138
  if (controlInstance.id === undefined) {
139
139
  const id = isControl(props.uischema)
140
- ? createId(props.uischema.scope)
140
+ ? Id.createId(props.uischema.scope)
141
141
  : undefined;
142
142
  (instance as JsonFormsControl).id = id;
143
143
  }
@@ -0,0 +1,57 @@
1
+ /*
2
+ The MIT License
3
+
4
+ Copyright (c) 2017-2020 EclipseSource Munich
5
+ https://github.com/eclipsesource/jsonforms
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ import { InjectionToken, Provider } from '@angular/core';
26
+
27
+ export interface JsonFormsAngularConfig {
28
+ /**
29
+ * When true, validation errors only appear after the user has interacted with the field.
30
+ */
31
+ showErrorsOnTouch?: boolean;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ /**
36
+ * Injection token for providing a global JSONForms config via Angular's DI system.
37
+ * Config provided via this token acts as the base; the `config` @Input on the
38
+ * `<jsonforms>` component takes precedence when both are supplied.
39
+ */
40
+ export const JSONFORMS_CONFIG = new InjectionToken<JsonFormsAngularConfig>(
41
+ 'JsonFormsConfig'
42
+ );
43
+
44
+ /**
45
+ * Returns an Angular provider that sets the global JSONForms config.
46
+ *
47
+ * @example
48
+ * // Standalone bootstrap (app.config.ts)
49
+ * export const appConfig: ApplicationConfig = {
50
+ * providers: [provideJsonFormsConfig({ showErrorsOnTouch: false })],
51
+ * };
52
+ */
53
+ export function provideJsonFormsConfig(
54
+ config: JsonFormsAngularConfig
55
+ ): Provider {
56
+ return { provide: JSONFORMS_CONFIG, useValue: config };
57
+ }