@gravitee/ui-particles-angular 5.14.0-improve-json-schema-preview-57932da → 5.14.0-renovate-all-devdependencies-minor-patch-e52fed3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { trigger, transition, style, animate } from '@angular/animations';
2
2
  import * as i0 from '@angular/core';
3
3
  import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken } from '@angular/core';
4
- import { timer, Subject, fromEvent, of, BehaviorSubject, combineLatest, ReplaySubject } from 'rxjs';
4
+ import { timer, Subject, fromEvent, of, BehaviorSubject, ReplaySubject } from 'rxjs';
5
5
  import * as i1 from '@angular/material/card';
6
6
  import { MatCardModule } from '@angular/material/card';
7
7
  import * as i2 from '@angular/material/button';
@@ -2762,7 +2762,6 @@ class GioFormlyJsonSchemaService {
2762
2762
  return this.formlyJsonschema.toFieldConfig(jsonSchema, {
2763
2763
  map: (mappedField, mapSource) => {
2764
2764
  mappedField = this.uiTypeMap(mappedField, mapSource);
2765
- mappedField = this.formatMap(mappedField, mapSource);
2766
2765
  mappedField = this.bannerMap(mappedField, mapSource);
2767
2766
  mappedField = this.toggleMap(mappedField, mapSource);
2768
2767
  return mappedField;
@@ -2774,16 +2773,6 @@ class GioFormlyJsonSchemaService {
2774
2773
  mappedField.type = (_b = (_a = mapSource.gioConfig) === null || _a === void 0 ? void 0 : _a.uiType) !== null && _b !== void 0 ? _b : mappedField.type;
2775
2774
  return mappedField;
2776
2775
  }
2777
- formatMap(mappedField, mapSource) {
2778
- if (mapSource.type === 'string' && mapSource.format === 'text') {
2779
- mappedField.type = 'textarea';
2780
- mappedField.props = Object.assign(Object.assign({}, mappedField.props), { autosize: true });
2781
- }
2782
- else if (mapSource.type === 'string' && mapSource.format === 'password') {
2783
- mappedField.props = Object.assign(Object.assign({}, mappedField.props), { type: 'password' });
2784
- }
2785
- return mappedField;
2786
- }
2787
2776
  bannerMap(mappedField, mapSource) {
2788
2777
  var _a;
2789
2778
  mappedField.props = Object.assign(Object.assign({}, mappedField.props), (((_a = mapSource.gioConfig) === null || _a === void 0 ? void 0 : _a.banner) ? getBannerProperties(mapSource.gioConfig.banner) : {}));
@@ -2838,7 +2827,6 @@ class GioFormJsonSchemaComponent {
2838
2827
  this._onChange = () => ({});
2839
2828
  this._onTouched = () => ({});
2840
2829
  this.touched = false;
2841
- this.stateChanges$ = new Subject();
2842
2830
  if (ngControl) {
2843
2831
  // Setting the value accessor directly (instead of using
2844
2832
  // the providers `NG_VALUE_ACCESSOR`) to avoid running into a circular import.
@@ -2859,37 +2847,26 @@ class GioFormJsonSchemaComponent {
2859
2847
  }
2860
2848
  ngOnInit() {
2861
2849
  var _a, _b, _c;
2862
- // When the parent form is touched, mark all the sub formGroup as touched ony once
2850
+ // When the parent form is touched, mark all the sub formGroup as touched
2863
2851
  const parentControl = (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.parent;
2864
- (_c = parentControl === null || parentControl === void 0 ? void 0 : parentControl.statusChanges) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this.unsubscribe$), map(() => parentControl === null || parentControl === void 0 ? void 0 : parentControl.touched), filter(touched => touched === true), distinctUntilChanged()).subscribe(() => {
2865
- this.formGroup.markAllAsTouched();
2866
- this.stateChanges$.next();
2852
+ (_c = parentControl === null || parentControl === void 0 ? void 0 : parentControl.statusChanges) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this.unsubscribe$), map(() => parentControl === null || parentControl === void 0 ? void 0 : parentControl.touched), filter(touched => touched === true), tap(() => this.formGroup.markAllAsTouched())).subscribe();
2853
+ this.formGroup.statusChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(status => {
2854
+ var _a, _b, _c, _d;
2855
+ if (status === 'VALID') {
2856
+ (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.setErrors(null);
2857
+ }
2858
+ if (status === 'INVALID') {
2859
+ (_d = (_c = this.ngControl) === null || _c === void 0 ? void 0 : _c.control) === null || _d === void 0 ? void 0 : _d.setErrors({ invalid: true });
2860
+ }
2867
2861
  });
2868
2862
  // To simulate the behavior of classic form controls, emit value only when the form is touched
2869
2863
  // Allow to keep the formControl pristine until the user interact with it
2870
- combineLatest([this.formGroup.statusChanges, this.formGroup.valueChanges])
2864
+ this.formGroup.valueChanges
2871
2865
  .pipe(takeUntil(this.unsubscribe$),
2872
2866
  // Group all valueChanges events emit by formly in a single one
2873
- debounceTime(100))
2874
- .subscribe(() => {
2875
- this.stateChanges$.next();
2876
- });
2877
- this.stateChanges$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2878
- var _a, _b, _c, _d;
2879
- const { status, value, touched } = this.formGroup;
2880
- if (touched) {
2881
- this._onTouched();
2882
- this.touched = true;
2883
- }
2884
- if (this.touched) {
2885
- this._onChange(value);
2886
- if (status === 'VALID') {
2887
- (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.setErrors(null);
2888
- }
2889
- if (status === 'INVALID') {
2890
- (_d = (_c = this.ngControl) === null || _c === void 0 ? void 0 : _c.control) === null || _d === void 0 ? void 0 : _d.setErrors({ invalid: true });
2891
- }
2892
- }
2867
+ debounceTime(200), filter(() => this.touched))
2868
+ .subscribe(value => {
2869
+ this._onChange(value);
2893
2870
  });
2894
2871
  }
2895
2872
  ngOnDestroy() {
@@ -3355,7 +3332,7 @@ GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
3355
3332
  </div>
3356
3333
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3357
3334
  </div>
3358
- `, isInline: true, styles: [".wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"], components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3335
+ `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"], components: [{ type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: i1$4.FormlyField, selector: "formly-field", inputs: ["field"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3359
3336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, decorators: [{
3360
3337
  type: Component,
3361
3338
  args: [{ selector: 'gio-fjs-multi-schema-type', template: `
@@ -3367,7 +3344,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3367
3344
  </div>
3368
3345
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3369
3346
  </div>
3370
- `, styles: [".wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]
3347
+ `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__title{font-size:16px;font-weight:500;line-height:24px;font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:4px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]
3371
3348
  }] });
3372
3349
 
3373
3350
  /*
@@ -3505,74 +3482,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3505
3482
  `, styles: [".wrapper{display:flex;flex-direction:column;padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__header{display:flex}.wrapper__header__text{flex:1 1 auto}.wrapper__header__text__title{font:600 16px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:8px}.wrapper__header__collapse{flex:0 0 auto}.wrapper__header__collapse .collapse-open{transform:rotate(180deg);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__header__collapse .collapse-close{transform:rotate(0);transition:transform 225ms cubic-bezier(.4,0,.2,1)}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}\n"] }]
3506
3483
  }] });
3507
3484
 
3508
- /*
3509
- * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3510
- *
3511
- * Licensed under the Apache License, Version 2.0 (the "License");
3512
- * you may not use this file except in compliance with the License.
3513
- * You may obtain a copy of the License at
3514
- *
3515
- * http://www.apache.org/licenses/LICENSE-2.0
3516
- *
3517
- * Unless required by applicable law or agreed to in writing, software
3518
- * distributed under the License is distributed on an "AS IS" BASIS,
3519
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3520
- * See the License for the specific language governing permissions and
3521
- * limitations under the License.
3522
- */
3523
- class GioPasswordEyeWrapperComponent extends FieldWrapper {
3524
- constructor() {
3525
- super(...arguments);
3526
- this.hide = true;
3527
- }
3528
- ngAfterViewInit() {
3529
- if (this.matSuffix) {
3530
- this.props.suffix = this.matSuffix;
3531
- }
3532
- }
3533
- addonEyeClick($event) {
3534
- $event.stopPropagation();
3535
- this.hide = !this.hide;
3536
- this.props.type = this.hide ? 'password' : 'text';
3537
- }
3538
- }
3539
- GioPasswordEyeWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3540
- GioPasswordEyeWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioPasswordEyeWrapperComponent, selector: "gio-password-eye-wrapper", viewQueries: [{ propertyName: "matSuffix", first: true, predicate: ["matSuffix"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
3541
- <ng-container #fieldComponent></ng-container>
3542
-
3543
- <ng-template #matSuffix>
3544
- <span style="cursor: pointer" (click)="addonEyeClick($event)">
3545
- <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
3546
- </span>
3547
- </ng-template>
3548
- `, isInline: true, components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, decorators: [{
3550
- type: Component,
3551
- args: [{
3552
- selector: 'gio-password-eye-wrapper',
3553
- template: `
3554
- <ng-container #fieldComponent></ng-container>
3555
-
3556
- <ng-template #matSuffix>
3557
- <span style="cursor: pointer" (click)="addonEyeClick($event)">
3558
- <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
3559
- </span>
3560
- </ng-template>
3561
- `,
3562
- }]
3563
- }], propDecorators: { matSuffix: [{
3564
- type: ViewChild,
3565
- args: ['matSuffix', { static: true }]
3566
- }] } });
3567
- function passwordEyeExtension(field) {
3568
- if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-password-eye') !== -1)) {
3569
- return;
3570
- }
3571
- if (field.props.type === 'password') {
3572
- field.wrappers = [...(field.wrappers || []), 'gio-password-eye'];
3573
- }
3574
- }
3575
-
3576
3485
  /*
3577
3486
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3578
3487
  *
@@ -3598,8 +3507,7 @@ GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
3598
3507
  GioFjsArrayTypeComponent,
3599
3508
  GioFjsToggleTypeComponent,
3600
3509
  GioFjsHeadersTypeComponent,
3601
- GioFormFieldWrapperComponent,
3602
- GioPasswordEyeWrapperComponent], imports: [CommonModule,
3510
+ GioFormFieldWrapperComponent], imports: [CommonModule,
3603
3511
  A11yModule,
3604
3512
  ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
3605
3513
  GioIconsModule,
@@ -3627,10 +3535,7 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3627
3535
  { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3628
3536
  { name: 'const', message: constValidationMessage },
3629
3537
  ],
3630
- wrappers: [
3631
- { name: 'gio-with-banner', component: GioFormFieldWrapperComponent },
3632
- { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
3633
- ],
3538
+ wrappers: [{ name: 'gio-with-banner', component: GioFormFieldWrapperComponent }],
3634
3539
  types: [
3635
3540
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3636
3541
  { name: 'array', component: GioFjsArrayTypeComponent },
@@ -3645,10 +3550,7 @@ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
3645
3550
  component: GioFjsHeadersTypeComponent,
3646
3551
  },
3647
3552
  ],
3648
- extensions: [
3649
- { name: 'banner', extension: { onPopulate: bannerExtension } },
3650
- { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
3651
- ],
3553
+ extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3652
3554
  extras: {
3653
3555
  checkExpressionOn: 'changeDetectionCheck',
3654
3556
  },
@@ -3672,7 +3574,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3672
3574
  GioFjsToggleTypeComponent,
3673
3575
  GioFjsHeadersTypeComponent,
3674
3576
  GioFormFieldWrapperComponent,
3675
- GioPasswordEyeWrapperComponent,
3676
3577
  ],
3677
3578
  imports: [
3678
3579
  CommonModule,
@@ -3694,10 +3595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3694
3595
  { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3695
3596
  { name: 'const', message: constValidationMessage },
3696
3597
  ],
3697
- wrappers: [
3698
- { name: 'gio-with-banner', component: GioFormFieldWrapperComponent },
3699
- { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
3700
- ],
3598
+ wrappers: [{ name: 'gio-with-banner', component: GioFormFieldWrapperComponent }],
3701
3599
  types: [
3702
3600
  { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3703
3601
  { name: 'array', component: GioFjsArrayTypeComponent },
@@ -3712,10 +3610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3712
3610
  component: GioFjsHeadersTypeComponent,
3713
3611
  },
3714
3612
  ],
3715
- extensions: [
3716
- { name: 'banner', extension: { onPopulate: bannerExtension } },
3717
- { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
3718
- ],
3613
+ extensions: [{ name: 'banner', extension: { onPopulate: bannerExtension } }],
3719
3614
  extras: {
3720
3615
  checkExpressionOn: 'changeDetectionCheck',
3721
3616
  },
@@ -3755,17 +3650,17 @@ class GioFormFocusInvalidDirective {
3755
3650
  onFormSubmit() {
3756
3651
  const selector = '.ng-invalid[formControlName],input.ng-invalid,mat-select.ng-invalid,textarea.ng-invalid,.gio-ng-invalid';
3757
3652
  try {
3758
- // Mark all controls as touched to display errors
3759
- if (this.formGroupDirective) {
3760
- this.formGroupDirective.control.markAllAsTouched();
3761
- this.formGroupDirective.control.updateValueAndValidity();
3762
- }
3763
3653
  let invalidControl = this.renderer.selectRootElement(selector, true);
3764
3654
  // If the form is a GioFormJsonSchema, we need to focus the first invalid control inside
3765
3655
  if (invalidControl.tagName === 'GIO-FORM-JSON-SCHEMA') {
3766
3656
  invalidControl = invalidControl.querySelector(selector);
3767
3657
  }
3768
3658
  if (invalidControl) {
3659
+ // Mark all controls as touched to display errors
3660
+ if (this.formGroupDirective) {
3661
+ this.formGroupDirective.control.markAllAsTouched();
3662
+ this.formGroupDirective.control.updateValueAndValidity();
3663
+ }
3769
3664
  invalidControl.scrollIntoView({ behavior: 'smooth', block: 'center' });
3770
3665
  invalidControl.focus({ preventScroll: true });
3771
3666
  }