@gravitee/ui-particles-angular 5.20.1-json-schema-code-editor-569d110 → 5.20.1-sprite-icons-documentation-35a477d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.module.mjs +6 -27
  2. package/esm2020/lib/gio-form-json-schema/gio-formly-json-schema.service.mjs +1 -4
  3. package/esm2020/lib/gio-form-json-schema/model/GioJsonSchema.mjs +1 -1
  4. package/esm2020/lib/gio-form-json-schema/wrappers/gio-form-field-wrapper.component.mjs +28 -0
  5. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +28 -26
  6. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.module.mjs +4 -5
  7. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.testing.component.mjs +17 -3
  8. package/esm2020/lib/gio-monaco-editor/services/gio-language-json.service.mjs +1 -2
  9. package/esm2020/lib/public-api.mjs +1 -2
  10. package/fesm2015/gravitee-ui-particles-angular.mjs +625 -832
  11. package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
  12. package/fesm2020/gravitee-ui-particles-angular.mjs +817 -1017
  13. package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
  14. package/lib/gio-form-json-schema/gio-form-json-schema.module.d.ts +13 -16
  15. package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +1 -4
  16. package/lib/gio-form-json-schema/wrappers/gio-form-field-wrapper.component.d.ts +6 -0
  17. package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +8 -9
  18. package/lib/gio-monaco-editor/gio-monaco-editor.module.d.ts +4 -5
  19. package/lib/gio-monaco-editor/services/gio-language-json.service.d.ts +0 -1
  20. package/lib/public-api.d.ts +0 -1
  21. package/package.json +1 -1
  22. package/esm2020/lib/gio-form-json-schema/type-component/code-editor-type.component.mjs +0 -58
  23. package/esm2020/lib/gio-form-json-schema/wrappers/gio-banner-wrapper.component.mjs +0 -28
  24. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor-form-field.directive.mjs +0 -149
  25. package/lib/gio-form-json-schema/type-component/code-editor-type.component.d.ts +0 -13
  26. package/lib/gio-form-json-schema/wrappers/gio-banner-wrapper.component.d.ts +0 -6
  27. package/lib/gio-monaco-editor/gio-monaco-editor-form-field.directive.d.ts +0 -45
@@ -12,7 +12,7 @@ import { ComponentHarness, HarnessPredicate, parallel, TestKey } from '@angular/
12
12
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
13
13
  import * as i3$1 from '@angular/material/form-field';
14
14
  import { MatFormFieldControl, MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
15
- import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, uniqueId, set } from 'lodash';
15
+ import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set, uniqueId } from 'lodash';
16
16
  import { startWith, map, distinctUntilChanged, tap, debounce, takeUntil, delay, filter, switchMap, debounceTime } from 'rxjs/operators';
17
17
  import * as i7 from '@angular/forms';
18
18
  import { FormsModule, FormArray, FormGroup, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, NgControl } from '@angular/forms';
@@ -46,7 +46,7 @@ import { toSvg } from 'jdenticon';
46
46
  import * as i1$3 from '@ngx-formly/core/json-schema';
47
47
  import * as i1$4 from '@ngx-formly/core';
48
48
  import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-formly/core';
49
- import { FieldType as FieldType$1, FormlyMaterialModule } from '@ngx-formly/material';
49
+ import { FormlyMaterialModule } from '@ngx-formly/material';
50
50
  import * as i3$2 from '@angular/material/slide-toggle';
51
51
  import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
52
52
  import { TestBed } from '@angular/core/testing';
@@ -2861,9 +2861,6 @@ class GioFormlyJsonSchemaService {
2861
2861
  type: 'password',
2862
2862
  };
2863
2863
  }
2864
- else if (mapSource.type === 'string' && mapSource.format === 'gio-code-editor') {
2865
- mappedField.type = 'gio-code-editor';
2866
- }
2867
2864
  return mappedField;
2868
2865
  }
2869
2866
  bannerMap(mappedField, mapSource) {
@@ -3179,7 +3176,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3179
3176
  * See the License for the specific language governing permissions and
3180
3177
  * limitations under the License.
3181
3178
  */
3182
- const GIO_MONACO_EDITOR_CONFIG = new InjectionToken('gio-monaco-editor-config');
3179
+ class GioFjsNullTypeComponent extends FieldType {
3180
+ }
3181
+ GioFjsNullTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3182
+ GioFjsNullTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsNullTypeComponent, selector: "gio-fjs-null-type", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
3183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, decorators: [{
3184
+ type: Component,
3185
+ args: [{
3186
+ selector: 'gio-fjs-null-type',
3187
+ template: ``,
3188
+ }]
3189
+ }] });
3183
3190
 
3184
3191
  /*
3185
3192
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -3196,53 +3203,39 @@ const GIO_MONACO_EDITOR_CONFIG = new InjectionToken('gio-monaco-editor-config');
3196
3203
  * See the License for the specific language governing permissions and
3197
3204
  * limitations under the License.
3198
3205
  */
3199
- class GioMonacoEditorService {
3200
- constructor() {
3201
- this.loaded$ = new ReplaySubject(1);
3202
- this.loaded = false;
3203
- }
3204
- loadEditor() {
3205
- if (this.loaded) {
3206
- // Already loaded, do nothing.
3207
- return Promise.resolve();
3208
- }
3209
- this.loaded = true;
3210
- return new Promise(resolve => {
3211
- // Monaco is already loaded
3212
- if (typeof window.monaco === 'object') {
3213
- resolve();
3214
- return;
3215
- }
3216
- const onGotAmdLoader = () => {
3217
- // Load Monaco
3218
- window.require.config({ paths: { vs: 'assets/monaco-editor/min/vs' } });
3219
- window.require(['vs/editor/editor.main'], () => {
3220
- resolve();
3221
- });
3222
- };
3223
- // Load AMD loader if necessary
3224
- if (!window.require) {
3225
- const loaderScript = document.createElement('script');
3226
- loaderScript.type = 'text/javascript';
3227
- loaderScript.src = 'assets/monaco-editor/min/vs/loader.js';
3228
- loaderScript.addEventListener('load', onGotAmdLoader);
3229
- document.body.appendChild(loaderScript);
3230
- }
3231
- else {
3232
- onGotAmdLoader();
3233
- }
3234
- }).then(() => {
3235
- this.loaded$.next({ monaco: window.monaco });
3236
- });
3237
- }
3206
+ class GioFjsObjectTypeComponent extends FieldType {
3238
3207
  }
3239
- GioMonacoEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3240
- GioMonacoEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, providedIn: 'root' });
3241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, decorators: [{
3242
- type: Injectable,
3243
- args: [{
3244
- providedIn: 'root',
3245
- }]
3208
+ GioFjsObjectTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3209
+ GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsObjectTypeComponent, selector: "gio-fjs-object-type", usesInheritance: true, ngImport: i0, template: `
3210
+ <div class="wrapper">
3211
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3212
+ <p *ngIf="to.description">{{ to.description }}</p>
3213
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3214
+ <formly-validation-message [field]="field"></formly-validation-message>
3215
+ </div>
3216
+ <div class="wrapper__fields">
3217
+ <ng-container *ngFor="let f of field.fieldGroup">
3218
+ <formly-field *ngIf="f.type" class="wrapper__fields__field" [field]="f"></formly-field>
3219
+ </ng-container>
3220
+ </div>
3221
+ </div>
3222
+ `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields:has(> .wrapper__fields__field:only-child):has(> .wrapper__fields__field:empty){display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){display:block;margin-top:8px}\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"] }] });
3223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, decorators: [{
3224
+ type: Component,
3225
+ args: [{ selector: 'gio-fjs-object-type', template: `
3226
+ <div class="wrapper">
3227
+ <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3228
+ <p *ngIf="to.description">{{ to.description }}</p>
3229
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3230
+ <formly-validation-message [field]="field"></formly-validation-message>
3231
+ </div>
3232
+ <div class="wrapper__fields">
3233
+ <ng-container *ngFor="let f of field.fieldGroup">
3234
+ <formly-field *ngIf="f.type" class="wrapper__fields__field" [field]="f"></formly-field>
3235
+ </ng-container>
3236
+ </div>
3237
+ </div>
3238
+ `, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields:has(> .wrapper__fields__field:only-child):has(> .wrapper__fields__field:empty){display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){display:block;margin-top:8px}\n"] }]
3246
3239
  }] });
3247
3240
 
3248
3241
  /*
@@ -3260,57 +3253,118 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3260
3253
  * See the License for the specific language governing permissions and
3261
3254
  * limitations under the License.
3262
3255
  */
3263
- class GioLanguageJsonService {
3264
- constructor(codeEditorService) {
3265
- this.codeEditorService = codeEditorService;
3266
- this.unsubscribe$ = new Subject();
3267
- codeEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(event => {
3268
- this.setup(event.monaco);
3269
- });
3270
- }
3271
- ngOnDestroy() {
3272
- this.unsubscribe$.next();
3273
- this.unsubscribe$.complete();
3274
- }
3275
- setup(monaco) {
3276
- if (!monaco) {
3277
- throw new Error('Monaco is not loaded');
3278
- }
3279
- this.monaco = monaco;
3280
- const defaults = monaco.languages.json.jsonDefaults;
3281
- defaults.setDiagnosticsOptions({
3282
- validate: true,
3283
- allowComments: true,
3284
- });
3285
- }
3286
- addSchemas(id, definitions = []) {
3287
- if (!this.monaco) {
3288
- throw new Error('Monaco is not loaded');
3289
- }
3290
- const defaults = this.monaco.languages.json.jsonDefaults;
3291
- const options = defaults.diagnosticsOptions;
3292
- let schemas = definitions.map(({ uri, schema }) => ({
3293
- uri,
3294
- schema,
3295
- fileMatch: [id || '*.json'],
3296
- }));
3297
- if (options && options.schemas && options.schemas.length > 0) {
3298
- schemas = [...options.schemas, ...schemas];
3299
- }
3300
- defaults.setDiagnosticsOptions({
3301
- ...options,
3302
- schemas: schemas,
3303
- });
3256
+ class GioFjsArrayTypeComponent extends FieldArrayType {
3257
+ constructor() {
3258
+ super(...arguments);
3259
+ this.collapse = false;
3304
3260
  }
3305
3261
  }
3306
- GioLanguageJsonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, deps: [{ token: GioMonacoEditorService }], target: i0.ɵɵFactoryTarget.Injectable });
3307
- GioLanguageJsonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, providedIn: 'root' });
3308
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, decorators: [{
3309
- type: Injectable,
3310
- args: [{
3311
- providedIn: 'root',
3312
- }]
3313
- }], ctorParameters: function () { return [{ type: GioMonacoEditorService }]; } });
3262
+ GioFjsArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3263
+ GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsArrayTypeComponent, selector: "gio-fjs-array-type", usesInheritance: true, ngImport: i0, template: `
3264
+ <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3265
+ <div class="wrapper__header">
3266
+ <div class="wrapper__header__text">
3267
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3268
+ <p *ngIf="to.description">{{ to.description }}</p>
3269
+ </div>
3270
+ <div class="wrapper__header__collapse">
3271
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3272
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3273
+ </button>
3274
+ </div>
3275
+ </div>
3276
+
3277
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3278
+ <formly-validation-message [field]="field"></formly-validation-message>
3279
+ </div>
3280
+
3281
+ <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3282
+ <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3283
+ <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3284
+ <div class="wrapper__rows__row__remove">
3285
+ <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3286
+ <mat-icon svgIcon="gio:cancel"></mat-icon>
3287
+ </button>
3288
+ </div>
3289
+ </div>
3290
+
3291
+ <div>
3292
+ <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3293
+ </div>
3294
+ </div>
3295
+ </div>
3296
+ `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper.error{border-color:#ec4899}.wrapper:empty{display:none}.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}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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"] }] });
3297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, decorators: [{
3298
+ type: Component,
3299
+ args: [{ selector: 'gio-fjs-array-type', template: `
3300
+ <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3301
+ <div class="wrapper__header">
3302
+ <div class="wrapper__header__text">
3303
+ <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
3304
+ <p *ngIf="to.description">{{ to.description }}</p>
3305
+ </div>
3306
+ <div class="wrapper__header__collapse">
3307
+ <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
3308
+ <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
3309
+ </button>
3310
+ </div>
3311
+ </div>
3312
+
3313
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3314
+ <formly-validation-message [field]="field"></formly-validation-message>
3315
+ </div>
3316
+
3317
+ <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3318
+ <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3319
+ <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3320
+ <div class="wrapper__rows__row__remove">
3321
+ <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3322
+ <mat-icon svgIcon="gio:cancel"></mat-icon>
3323
+ </button>
3324
+ </div>
3325
+ </div>
3326
+
3327
+ <div>
3328
+ <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3329
+ </div>
3330
+ </div>
3331
+ </div>
3332
+ `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper.error{border-color:#ec4899}.wrapper:empty{display:none}.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}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"] }]
3333
+ }] });
3334
+
3335
+ function minItemsValidationMessage(error, field) {
3336
+ return `Should NOT have fewer than ${field.props?.minItems} items`;
3337
+ }
3338
+ function maxItemsValidationMessage(error, field) {
3339
+ return `Should NOT have more than ${field.props?.maxItems} items`;
3340
+ }
3341
+ function minLengthValidationMessage(error, field) {
3342
+ return `Should NOT be shorter than ${field.props?.minLength} characters`;
3343
+ }
3344
+ function maxLengthValidationMessage(error, field) {
3345
+ return `Should NOT be longer than ${field.props?.maxLength} characters`;
3346
+ }
3347
+ function minValidationMessage(error, field) {
3348
+ return `Should be >= ${field.props?.min}`;
3349
+ }
3350
+ function maxValidationMessage(error, field) {
3351
+ return `Should be <= ${field.props?.max}`;
3352
+ }
3353
+ function multipleOfValidationMessage(error, field) {
3354
+ return `Should be multiple of ${field.props?.step}`;
3355
+ }
3356
+ function exclusiveMinimumValidationMessage(error, field) {
3357
+ return `Should be > ${field.props?.step}`;
3358
+ }
3359
+ function exclusiveMaximumValidationMessage(error, field) {
3360
+ return `Should be < ${field.props?.step}`;
3361
+ }
3362
+ function constValidationMessage(error, field) {
3363
+ return `Should be equal to constant "${field.props?.const}"`;
3364
+ }
3365
+ function typeValidationMessage({ schemaType }) {
3366
+ return `Should be "${schemaType[0]}".`;
3367
+ }
3314
3368
 
3315
3369
  /*
3316
3370
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -3327,294 +3381,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3327
3381
  * See the License for the specific language governing permissions and
3328
3382
  * limitations under the License.
3329
3383
  */
3330
- class GioMonacoEditorComponent {
3331
- constructor(hostElement, config, monacoEditorService, languageJsonService, changeDetectorRef, ngZone, ngControl) {
3332
- this.hostElement = hostElement;
3333
- this.config = config;
3334
- this.monacoEditorService = monacoEditorService;
3335
- this.languageJsonService = languageJsonService;
3336
- this.changeDetectorRef = changeDetectorRef;
3337
- this.ngZone = ngZone;
3338
- this.ngControl = ngControl;
3339
- this.options = {};
3340
- this.loaded$ = new ReplaySubject(1);
3341
- this.defaultOptions = {
3342
- contextmenu: false,
3343
- minimap: {
3344
- enabled: true,
3345
- },
3346
- automaticLayout: true,
3347
- scrollBeyondLastLine: false,
3348
- };
3349
- this.value = '';
3350
- this.readOnly = false;
3351
- this._onChange = () => ({});
3352
- this._onTouched = () => ({});
3353
- this.unsubscribe$ = new Subject();
3354
- if (this.ngControl) {
3355
- // Set the value accessor directly (instead of providing
3356
- // NG_VALUE_ACCESSOR) to avoid running into a circular import
3357
- this.ngControl.valueAccessor = this;
3358
- }
3359
- this.monacoEditorService.loadEditor();
3360
- }
3361
- ngAfterViewInit() {
3362
- // Wait until monaco editor is available
3363
- this.monacoEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(({ monaco }) => {
3364
- this.setupEditor(monaco);
3365
- this.loaded$.next(false);
3366
- this.changeDetectorRef.detectChanges();
3367
- });
3368
- }
3369
- ngOnDestroy() {
3370
- if (this.standaloneCodeEditor) {
3371
- this.standaloneCodeEditor.dispose();
3372
- this.standaloneCodeEditor = undefined;
3373
- }
3374
- if (this.textModel) {
3375
- this.textModel.dispose();
3376
- this.textModel = undefined;
3377
- }
3378
- this.unsubscribe$.next();
3379
- this.unsubscribe$.complete();
3380
- }
3381
- // From ControlValueAccessor interface
3382
- writeValue(_value) {
3383
- if (_value) {
3384
- this.value = _value;
3385
- }
3386
- if (this.textModel) {
3387
- this.textModel.setValue(this.value);
3388
- }
3389
- }
3390
- // From ControlValueAccessor interface
3391
- registerOnChange(fn) {
3392
- this._onChange = fn;
3393
- }
3394
- // From ControlValueAccessor interface
3395
- registerOnTouched(fn) {
3396
- this._onTouched = fn;
3397
- }
3398
- // From ControlValueAccessor interface
3399
- setDisabledState(isDisabled) {
3400
- this.readOnly = isDisabled;
3401
- }
3402
- setupEditor(monaco) {
3403
- if (!this.hostElement) {
3404
- throw new Error('No editor ref found.');
3405
- }
3406
- const domElement = this.hostElement.nativeElement;
3407
- const settings = {
3408
- value: this.value,
3409
- language: this.languageConfig?.language ?? 'text',
3410
- uri: `code-${uniqueId()}`,
3411
- };
3412
- this.ngZone.runOutsideAngular(() => {
3413
- this.textModel = monaco.editor.createModel(settings.value, settings.language, monaco.Uri.parse(settings.uri));
3414
- });
3415
- const options = Object.assign({}, this.defaultOptions, this.options, {
3416
- readOnly: this.readOnly,
3417
- theme: this.config.theme ?? 'vs',
3418
- model: this.textModel,
3419
- });
3420
- this.standaloneCodeEditor = monaco.editor.create(domElement, {
3421
- ...options,
3422
- });
3423
- this.textModel?.onDidChangeContent(() => {
3424
- const newValue = this.textModel?.getValue();
3425
- this.ngZone.run(() => {
3426
- this.value = newValue ?? '';
3427
- this._onChange(newValue ?? '');
3428
- this._onTouched();
3429
- });
3430
- });
3431
- this.standaloneCodeEditor?.onDidBlurEditorWidget(() => {
3432
- this.ngZone.run(() => {
3433
- this._onTouched();
3434
- });
3435
- });
3436
- this.setupLanguage(settings.uri, this.languageConfig);
3437
- }
3438
- setupLanguage(uri, languageConfig) {
3439
- if (!languageConfig) {
3440
- return;
3441
- }
3442
- const { language } = languageConfig;
3443
- if (language) {
3444
- const lang = language.toLowerCase();
3445
- switch (lang) {
3446
- case 'json':
3447
- if (languageConfig.schemas) {
3448
- this.languageJsonService.addSchemas(uri, languageConfig.schemas);
3449
- }
3450
- break;
3451
- default:
3452
- break;
3453
- }
3454
- }
3455
- }
3384
+ class GioFormFieldWrapperComponent extends FieldWrapper {
3456
3385
  }
3457
- GioMonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, deps: [{ token: i0.ElementRef }, { token: GIO_MONACO_EDITOR_CONFIG }, { token: GioMonacoEditorService }, { token: GioLanguageJsonService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i7.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
3458
- GioMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorComponent, selector: "gio-monaco-editor", inputs: { languageConfig: "languageConfig", options: "options" }, ngImport: i0, template: ` <div *ngIf="loaded$ | async">Loading...</div>`, isInline: true, styles: [":host{display:block;height:100%;min-height:150px;transition:opacity .2s ease-out}:host-context(.hidden){opacity:0}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i2$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
3459
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, decorators: [{
3386
+ GioFormFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFieldWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3387
+ GioFormFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFieldWrapperComponent, selector: "gio-form-field-wrapper", usesInheritance: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"wrapper\">\n <div class=\"banner\">\n <div class=\"banner__icon\"><mat-icon svgIcon=\"gio:info\"></mat-icon></div>\n <div>\n <div class=\"banner__title\" [innerHTML]=\"props.bannerTitle\"></div>\n <div class=\"banner__text\" [innerHTML]=\"props.bannerText\"></div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: [".wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;border-radius:8px;margin-bottom:8px;background:#e7e8ef;gap:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"], components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFieldWrapperComponent, decorators: [{
3460
3389
  type: Component,
3461
- args: [{ selector: 'gio-monaco-editor', template: ` <div *ngIf="loaded$ | async">Loading...</div>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;height:100%;min-height:150px;transition:opacity .2s ease-out}:host-context(.hidden){opacity:0}\n"] }]
3462
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
3463
- type: Inject,
3464
- args: [GIO_MONACO_EDITOR_CONFIG]
3465
- }] }, { type: GioMonacoEditorService }, { type: GioLanguageJsonService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i7.NgControl, decorators: [{
3466
- type: Optional
3467
- }, {
3468
- type: Self
3469
- }] }]; }, propDecorators: { languageConfig: [{
3470
- type: Input
3471
- }], options: [{
3472
- type: Input
3473
- }] } });
3390
+ args: [{ selector: 'gio-form-field-wrapper', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"wrapper\">\n <div class=\"banner\">\n <div class=\"banner__icon\"><mat-icon svgIcon=\"gio:info\"></mat-icon></div>\n <div>\n <div class=\"banner__title\" [innerHTML]=\"props.bannerTitle\"></div>\n <div class=\"banner__text\" [innerHTML]=\"props.bannerText\"></div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: [".wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;border-radius:8px;margin-bottom:8px;background:#e7e8ef;gap:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"] }]
3391
+ }] });
3474
3392
 
3475
- class GioMonacoEditorFormFieldDirective {
3476
- constructor(elementRef, focusMonitor, renderer, changeDetectorRef, hostGioMonacoEditorComponent) {
3477
- this.elementRef = elementRef;
3478
- this.focusMonitor = focusMonitor;
3479
- this.renderer = renderer;
3480
- this.changeDetectorRef = changeDetectorRef;
3481
- this.hostGioMonacoEditorComponent = hostGioMonacoEditorComponent;
3482
- this.stateChanges = new Subject();
3483
- this.id = `gio-monaco-editor-${GioMonacoEditorFormFieldDirective.nextId++}`;
3484
- this.userAriaDescribedBy = '';
3485
- this.ngControl = null;
3486
- this.focused = false;
3487
- this.errorState = false;
3488
- this.controlType = 'gio-monaco-editor';
3489
- // autofilled?: boolean | undefined;
3490
- this._placeholder = '';
3491
- this._required = false;
3492
- this._disabled = false;
3493
- this.maxHeight = 500;
3494
- this.unsubscribe$ = new Subject();
3495
- }
3496
- get value() {
3497
- return this.hostGioMonacoEditorComponent?.value ?? null;
3498
- }
3499
- set placeholder(placeholder) {
3500
- this._placeholder = placeholder;
3501
- this.stateChanges.next();
3502
- }
3503
- get placeholder() {
3504
- return this._placeholder;
3505
- }
3506
- set required(required) {
3507
- this._required = coerceBooleanProperty(required);
3508
- this.stateChanges.next();
3509
- }
3510
- get required() {
3511
- return this._required;
3512
- }
3513
- set disabled(disabled) {
3514
- this._disabled = coerceBooleanProperty(disabled);
3515
- if (this.focused) {
3516
- this.focused = false;
3517
- this.stateChanges.next();
3518
- }
3519
- }
3520
- get disabled() {
3521
- if (this.ngControl && this.ngControl.disabled !== null) {
3522
- return this.ngControl.disabled;
3523
- }
3524
- return this._disabled;
3525
- }
3526
- get empty() {
3527
- return !this.value;
3528
- }
3529
- get shouldLabelFloat() {
3530
- return this.focused || !this.empty;
3531
- }
3532
- get shouldHideEditor() {
3533
- return !this.shouldLabelFloat;
3534
- }
3535
- ngOnInit() {
3536
- this.stateChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(() => this.changeDetectorRef.markForCheck());
3537
- this.focusMonitor
3538
- .monitor(this.elementRef.nativeElement, true)
3539
- .pipe(takeUntil(this.unsubscribe$))
3540
- .subscribe(origin => {
3541
- this.focused = !!origin;
3542
- this.stateChanges.next();
3543
- });
3544
- this.ngControl = this.hostGioMonacoEditorComponent?.ngControl;
3545
- this.hostGioMonacoEditorComponent.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
3546
- // Auto resize editor
3547
- this.hostGioMonacoEditorComponent.standaloneCodeEditor?.onDidContentSizeChange(() => {
3548
- const height = Math.min(this.hostGioMonacoEditorComponent.standaloneCodeEditor?.getContentHeight() ?? this.maxHeight, this.maxHeight);
3549
- this.renderer.setStyle(this.elementRef.nativeElement, 'height', `${height}px`);
3550
- this.hostGioMonacoEditorComponent.standaloneCodeEditor?.layout();
3551
- this.stateChanges.next();
3552
- });
3553
- });
3554
- }
3555
- ngDoCheck() {
3556
- if (this.ngControl) {
3557
- this.errorState = !!this.ngControl.invalid && !!this.ngControl.touched;
3558
- this.stateChanges.next();
3559
- }
3560
- }
3561
- ngOnDestroy() {
3562
- this.unsubscribe$.next();
3563
- this.unsubscribe$.complete();
3564
- this.focusMonitor.stopMonitoring(this.elementRef.nativeElement);
3565
- }
3566
- setDescribedByIds(ids) {
3567
- this.userAriaDescribedBy = ids.join(' ');
3393
+ function bannerExtension(field) {
3394
+ if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-with-banner') !== -1)) {
3395
+ return;
3568
3396
  }
3569
- onContainerClick(_event) {
3570
- if (!this.focused) {
3571
- this.hostGioMonacoEditorComponent.standaloneCodeEditor?.focus();
3572
- }
3397
+ if (field.props.bannerTitle || field.props.bannerText) {
3398
+ // WARNING: 'gio-with-banner' must be placed before field wrappers in order to put banner before mat-form-field if exists
3399
+ field.wrappers = ['gio-with-banner', ...(field.wrappers || [])];
3573
3400
  }
3574
3401
  }
3575
- GioMonacoEditorFormFieldDirective.nextId = 0;
3576
- GioMonacoEditorFormFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorFormFieldDirective, deps: [{ token: i0.ElementRef }, { token: i2$2.FocusMonitor }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: GioMonacoEditorComponent, host: true, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
3577
- GioMonacoEditorFormFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorFormFieldDirective, selector: "[gioMonacoEditorFormField]", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { properties: { "id": "this.id", "attr.aria-describedBy": "this.userAriaDescribedBy", "class.hidden": "this.shouldHideEditor" } }, providers: [
3578
- {
3579
- provide: MatFormFieldControl,
3580
- useExisting: forwardRef(() => GioMonacoEditorFormFieldDirective),
3581
- },
3582
- ], ngImport: i0 });
3583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorFormFieldDirective, decorators: [{
3584
- type: Directive,
3585
- args: [{
3586
- selector: '[gioMonacoEditorFormField]',
3587
- providers: [
3588
- {
3589
- provide: MatFormFieldControl,
3590
- useExisting: forwardRef(() => GioMonacoEditorFormFieldDirective),
3591
- },
3592
- ],
3593
- }]
3594
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$2.FocusMonitor }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: GioMonacoEditorComponent, decorators: [{
3595
- type: Host
3596
- }, {
3597
- type: Self
3598
- }, {
3599
- type: Optional
3600
- }] }]; }, propDecorators: { id: [{
3601
- type: HostBinding
3602
- }], userAriaDescribedBy: [{
3603
- type: HostBinding,
3604
- args: ['attr.aria-describedBy']
3605
- }], placeholder: [{
3606
- type: Input
3607
- }], required: [{
3608
- type: Input
3609
- }], disabled: [{
3610
- type: Input
3611
- }], shouldHideEditor: [{
3612
- type: HostBinding,
3613
- args: ['class.hidden']
3614
- }] } });
3615
3402
 
3616
3403
  /*
3617
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3404
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3618
3405
  *
3619
3406
  * Licensed under the Apache License, Version 2.0 (the "License");
3620
3407
  * you may not use this file except in compliance with the License.
@@ -3628,40 +3415,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3628
3415
  * See the License for the specific language governing permissions and
3629
3416
  * limitations under the License.
3630
3417
  */
3631
- class GioMonacoEditorModule {
3632
- static forRoot(config) {
3633
- return {
3634
- ngModule: GioMonacoEditorModule,
3635
- providers: [
3636
- {
3637
- provide: GIO_MONACO_EDITOR_CONFIG,
3638
- useValue: config,
3639
- },
3640
- ],
3641
- };
3418
+ class GioFjsMultiSchemaTypeComponent extends FieldType {
3419
+ ngOnInit() {
3420
+ set(this.field, 'fieldGroup[0].props.appearance', 'fill');
3421
+ set(this.field, 'fieldGroup[0].props.label', 'Select option');
3642
3422
  }
3643
3423
  }
3644
- GioMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3645
- GioMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, declarations: [GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective], imports: [CommonModule, HttpClientModule, ReactiveFormsModule], exports: [GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective] });
3646
- GioMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, providers: [
3647
- {
3648
- provide: GIO_MONACO_EDITOR_CONFIG,
3649
- useValue: {},
3650
- },
3651
- ], imports: [[CommonModule, HttpClientModule, ReactiveFormsModule]] });
3652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, decorators: [{
3653
- type: NgModule,
3654
- args: [{
3655
- imports: [CommonModule, HttpClientModule, ReactiveFormsModule],
3656
- declarations: [GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective],
3657
- exports: [GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective],
3658
- providers: [
3659
- {
3660
- provide: GIO_MONACO_EDITOR_CONFIG,
3661
- useValue: {},
3662
- },
3663
- ],
3664
- }]
3424
+ GioFjsMultiSchemaTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3425
+ GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsMultiSchemaTypeComponent, selector: "gio-fjs-multi-schema-type", usesInheritance: true, ngImport: i0, template: `
3426
+ <div class="wrapper">
3427
+ <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3428
+ <p *ngIf="props.description">{{ props.description }}</p>
3429
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3430
+ <formly-validation-message [field]="field"></formly-validation-message>
3431
+ </div>
3432
+ <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3433
+ </div>
3434
+ `, 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"] }] });
3435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, decorators: [{
3436
+ type: Component,
3437
+ args: [{ selector: 'gio-fjs-multi-schema-type', template: `
3438
+ <div class="wrapper">
3439
+ <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3440
+ <p *ngIf="props.description">{{ props.description }}</p>
3441
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3442
+ <formly-validation-message [field]="field"></formly-validation-message>
3443
+ </div>
3444
+ <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3445
+ </div>
3446
+ `, 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"] }]
3665
3447
  }] });
3666
3448
 
3667
3449
  /*
@@ -3679,15 +3461,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3679
3461
  * See the License for the specific language governing permissions and
3680
3462
  * limitations under the License.
3681
3463
  */
3682
- class GioFjsNullTypeComponent extends FieldType {
3464
+ class GioFjsToggleTypeComponent extends FieldType {
3683
3465
  }
3684
- GioFjsNullTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3685
- GioFjsNullTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsNullTypeComponent, selector: "gio-fjs-null-type", usesInheritance: true, ngImport: i0, template: ``, isInline: true });
3686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsNullTypeComponent, decorators: [{
3466
+ GioFjsToggleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3467
+ GioFjsToggleTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsToggleTypeComponent, selector: "gio-fjs-toggle-type", usesInheritance: true, ngImport: i0, template: `
3468
+ <gio-form-slide-toggle>
3469
+ <gio-form-label>{{ props.label }}</gio-form-label>
3470
+ {{ props.description }}
3471
+ <mat-slide-toggle
3472
+ gioFormSlideToggle
3473
+ [id]="id"
3474
+ [formControl]="formControl"
3475
+ [formlyAttributes]="field"
3476
+ [tabIndex]="props.tabindex"
3477
+ ></mat-slide-toggle>
3478
+ </gio-form-slide-toggle>
3479
+ `, isInline: true, components: [{ type: GioFormSlideToggleComponent, selector: "gio-form-slide-toggle", inputs: ["appearance"] }, { type: GioFormLabelComponent, selector: "gio-form-label" }, { type: i3$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }] });
3480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, decorators: [{
3687
3481
  type: Component,
3688
3482
  args: [{
3689
- selector: 'gio-fjs-null-type',
3690
- template: ``,
3483
+ selector: 'gio-fjs-toggle-type',
3484
+ template: `
3485
+ <gio-form-slide-toggle>
3486
+ <gio-form-label>{{ props.label }}</gio-form-label>
3487
+ {{ props.description }}
3488
+ <mat-slide-toggle
3489
+ gioFormSlideToggle
3490
+ [id]="id"
3491
+ [formControl]="formControl"
3492
+ [formlyAttributes]="field"
3493
+ [tabIndex]="props.tabindex"
3494
+ ></mat-slide-toggle>
3495
+ </gio-form-slide-toggle>
3496
+ `,
3691
3497
  }]
3692
3498
  }] });
3693
3499
 
@@ -3706,65 +3512,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3706
3512
  * See the License for the specific language governing permissions and
3707
3513
  * limitations under the License.
3708
3514
  */
3709
- class GioFjsObjectTypeComponent extends FieldType {
3710
- }
3711
- GioFjsObjectTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3712
- GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsObjectTypeComponent, selector: "gio-fjs-object-type", usesInheritance: true, ngImport: i0, template: `
3713
- <div class="wrapper">
3714
- <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3715
- <p *ngIf="to.description">{{ to.description }}</p>
3716
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3717
- <formly-validation-message [field]="field"></formly-validation-message>
3718
- </div>
3719
- <div class="wrapper__fields">
3720
- <ng-container *ngFor="let f of field.fieldGroup">
3721
- <formly-field *ngIf="f.type" class="wrapper__fields__field" [field]="f"></formly-field>
3722
- </ng-container>
3723
- </div>
3724
- </div>
3725
- `, isInline: true, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields:has(> .wrapper__fields__field:only-child):has(> .wrapper__fields__field:empty){display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){display:block;margin-top:8px}\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"] }] });
3726
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, decorators: [{
3727
- type: Component,
3728
- args: [{ selector: 'gio-fjs-object-type', template: `
3729
- <div class="wrapper">
3730
- <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3731
- <p *ngIf="to.description">{{ to.description }}</p>
3732
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3733
- <formly-validation-message [field]="field"></formly-validation-message>
3734
- </div>
3735
- <div class="wrapper__fields">
3736
- <ng-container *ngFor="let f of field.fieldGroup">
3737
- <formly-field *ngIf="f.type" class="wrapper__fields__field" [field]="f"></formly-field>
3738
- </ng-container>
3739
- </div>
3740
- </div>
3741
- `, styles: [".wrapper{display:flex;flex-direction:column}.wrapper__title{font:600 18px/24px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;margin-bottom:16px}.wrapper:empty{display:none}.wrapper__error{font:400 12px/16px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal;color:#ec4899}.wrapper__fields{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper__fields:empty{display:none}.wrapper__fields:has(> .wrapper__fields__field:only-child):has(> .wrapper__fields__field:empty){display:none}.wrapper__fields__field:empty{display:none}.wrapper__fields__field+.wrapper__fields__field:not(:empty){display:block;margin-top:8px}\n"] }]
3742
- }] });
3743
-
3744
- /*
3745
- * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3746
- *
3747
- * Licensed under the Apache License, Version 2.0 (the "License");
3748
- * you may not use this file except in compliance with the License.
3749
- * You may obtain a copy of the License at
3750
- *
3751
- * http://www.apache.org/licenses/LICENSE-2.0
3752
- *
3753
- * Unless required by applicable law or agreed to in writing, software
3754
- * distributed under the License is distributed on an "AS IS" BASIS,
3755
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3756
- * See the License for the specific language governing permissions and
3757
- * limitations under the License.
3758
- */
3759
- class GioFjsArrayTypeComponent extends FieldArrayType {
3515
+ class GioFjsHeadersTypeComponent extends FieldType {
3760
3516
  constructor() {
3761
3517
  super(...arguments);
3518
+ this.defaultOptions = {
3519
+ props: {
3520
+ outputConfig: {
3521
+ keyName: 'name',
3522
+ valueName: 'value',
3523
+ },
3524
+ },
3525
+ };
3762
3526
  this.collapse = false;
3763
3527
  }
3528
+ get map() {
3529
+ return (headers) => [...(headers ?? [])].map(header => {
3530
+ return {
3531
+ [this.props.outputConfig.keyName]: header.key,
3532
+ [this.props.outputConfig.valueName]: header.value,
3533
+ };
3534
+ });
3535
+ }
3764
3536
  }
3765
- GioFjsArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3766
- GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsArrayTypeComponent, selector: "gio-fjs-array-type", usesInheritance: true, ngImport: i0, template: `
3767
- <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3537
+ GioFjsHeadersTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3538
+ GioFjsHeadersTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsHeadersTypeComponent, selector: "gio-fjs-headers-type", usesInheritance: true, ngImport: i0, template: `
3539
+ <div class="wrapper">
3768
3540
  <div class="wrapper__header">
3769
3541
  <div class="wrapper__header__text">
3770
3542
  <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
@@ -3776,31 +3548,18 @@ GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
3776
3548
  </button>
3777
3549
  </div>
3778
3550
  </div>
3779
-
3780
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3551
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3781
3552
  <formly-validation-message [field]="field"></formly-validation-message>
3782
3553
  </div>
3783
-
3784
- <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3785
- <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3786
- <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3787
- <div class="wrapper__rows__row__remove">
3788
- <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3789
- <mat-icon svgIcon="gio:cancel"></mat-icon>
3790
- </button>
3791
- </div>
3792
- </div>
3793
-
3794
- <div>
3795
- <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3796
- </div>
3554
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3555
+ <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
3797
3556
  </div>
3798
3557
  </div>
3799
- `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper.error{border-color:#ec4899}.wrapper:empty{display:none}.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}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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"] }] });
3800
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, decorators: [{
3558
+ `, isInline: true, 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"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: ["adaptOutputFn"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
3559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, decorators: [{
3801
3560
  type: Component,
3802
- args: [{ selector: 'gio-fjs-array-type', template: `
3803
- <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3561
+ args: [{ selector: 'gio-fjs-headers-type', template: `
3562
+ <div class="wrapper">
3804
3563
  <div class="wrapper__header">
3805
3564
  <div class="wrapper__header__text">
3806
3565
  <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
@@ -3812,63 +3571,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3812
3571
  </button>
3813
3572
  </div>
3814
3573
  </div>
3815
-
3816
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3574
+ <div class="wrapper__error" *ngIf="showError && formControl.errors">
3817
3575
  <formly-validation-message [field]="field"></formly-validation-message>
3818
3576
  </div>
3819
-
3820
- <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3821
- <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3822
- <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3823
- <div class="wrapper__rows__row__remove">
3824
- <button type="button" mat-icon-button aria-label="Remove" (click)="remove(i)">
3825
- <mat-icon svgIcon="gio:cancel"></mat-icon>
3826
- </button>
3827
- </div>
3828
- </div>
3829
-
3830
- <div>
3831
- <button type="button" mat-stroked-button aria-label="Add" (click)="add()"><mat-icon svgIcon="gio:plus"></mat-icon> Add</button>
3832
- </div>
3577
+ <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3578
+ <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
3833
3579
  </div>
3834
3580
  </div>
3835
- `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.wrapper.error{border-color:#ec4899}.wrapper:empty{display:none}.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}.wrapper__rows__row{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.wrapper__rows__row+.wrapper__rows__row{padding-top:3px;border-top:1px solid #d3d5dc;margin-top:4px}.wrapper__rows__row__field{flex:1 1 auto}.wrapper__rows__row__remove{flex:0 0 auto}\n"] }]
3581
+ `, 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"] }]
3836
3582
  }] });
3837
3583
 
3838
- function minItemsValidationMessage(error, field) {
3839
- return `Should NOT have fewer than ${field.props?.minItems} items`;
3840
- }
3841
- function maxItemsValidationMessage(error, field) {
3842
- return `Should NOT have more than ${field.props?.maxItems} items`;
3843
- }
3844
- function minLengthValidationMessage(error, field) {
3845
- return `Should NOT be shorter than ${field.props?.minLength} characters`;
3846
- }
3847
- function maxLengthValidationMessage(error, field) {
3848
- return `Should NOT be longer than ${field.props?.maxLength} characters`;
3849
- }
3850
- function minValidationMessage(error, field) {
3851
- return `Should be >= ${field.props?.min}`;
3852
- }
3853
- function maxValidationMessage(error, field) {
3854
- return `Should be <= ${field.props?.max}`;
3855
- }
3856
- function multipleOfValidationMessage(error, field) {
3857
- return `Should be multiple of ${field.props?.step}`;
3858
- }
3859
- function exclusiveMinimumValidationMessage(error, field) {
3860
- return `Should be > ${field.props?.step}`;
3861
- }
3862
- function exclusiveMaximumValidationMessage(error, field) {
3863
- return `Should be < ${field.props?.step}`;
3864
- }
3865
- function constValidationMessage(error, field) {
3866
- return `Should be equal to constant "${field.props?.const}"`;
3867
- }
3868
- function typeValidationMessage({ schemaType }) {
3869
- return `Should be "${schemaType[0]}".`;
3870
- }
3871
-
3872
3584
  /*
3873
3585
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3874
3586
  *
@@ -3884,27 +3596,61 @@ function typeValidationMessage({ schemaType }) {
3884
3596
  * See the License for the specific language governing permissions and
3885
3597
  * limitations under the License.
3886
3598
  */
3887
- class GioBannerWrapperComponent extends FieldWrapper {
3599
+ class GioPasswordEyeWrapperComponent extends FieldWrapper {
3600
+ constructor() {
3601
+ super(...arguments);
3602
+ this.hide = true;
3603
+ }
3604
+ ngAfterViewInit() {
3605
+ if (this.matSuffix) {
3606
+ this.props.suffix = this.matSuffix;
3607
+ }
3608
+ }
3609
+ addonEyeClick($event) {
3610
+ $event.stopPropagation();
3611
+ this.hide = !this.hide;
3612
+ this.props.type = this.hide ? 'password' : 'text';
3613
+ }
3888
3614
  }
3889
- GioBannerWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBannerWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3890
- GioBannerWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioBannerWrapperComponent, selector: "gio-banner-wrapper", usesInheritance: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"wrapper\">\n <div class=\"banner\">\n <div class=\"banner__icon\"><mat-icon svgIcon=\"gio:info\"></mat-icon></div>\n <div>\n <div class=\"banner__title\" [innerHTML]=\"props.bannerTitle\"></div>\n <div class=\"banner__text\" [innerHTML]=\"props.bannerText\"></div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: ["::ng-deep gio-banner-wrapper ul{padding-inline-start:0}.wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;border-radius:8px;margin-bottom:8px;background:#e7e8ef;gap:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"], components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3891
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBannerWrapperComponent, decorators: [{
3615
+ GioPasswordEyeWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3616
+ 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: `
3617
+ <ng-container #fieldComponent></ng-container>
3618
+
3619
+ <ng-template #matSuffix>
3620
+ <span style="cursor: pointer" (click)="addonEyeClick($event)">
3621
+ <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
3622
+ </span>
3623
+ </ng-template>
3624
+ `, isInline: true, components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
3625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, decorators: [{
3892
3626
  type: Component,
3893
- args: [{ selector: 'gio-banner-wrapper', template: "<!--\n\n Copyright (C) 2023 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"wrapper\">\n <div class=\"banner\">\n <div class=\"banner__icon\"><mat-icon svgIcon=\"gio:info\"></mat-icon></div>\n <div>\n <div class=\"banner__title\" [innerHTML]=\"props.bannerTitle\"></div>\n <div class=\"banner__text\" [innerHTML]=\"props.bannerText\"></div>\n </div>\n </div>\n <ng-container #fieldComponent></ng-container>\n</div>\n", styles: ["::ng-deep gio-banner-wrapper ul{padding-inline-start:0}.wrapper{padding:8px 0}.banner{display:flex;flex-direction:row;align-items:flex-start;padding:8px;border-radius:8px;margin-bottom:8px;background:#e7e8ef;gap:8px}.banner__icon{padding-top:2px}.banner__icon mat-icon{width:16px;height:16px;color:#6c59bd}.banner__title{font:600 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px}.banner__text{font:400 14px/20px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:.4px;color:#606274}\n"] }]
3894
- }] });
3627
+ args: [{
3628
+ selector: 'gio-password-eye-wrapper',
3629
+ template: `
3630
+ <ng-container #fieldComponent></ng-container>
3895
3631
 
3896
- function bannerExtension(field) {
3897
- if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-with-banner') !== -1)) {
3632
+ <ng-template #matSuffix>
3633
+ <span style="cursor: pointer" (click)="addonEyeClick($event)">
3634
+ <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
3635
+ </span>
3636
+ </ng-template>
3637
+ `,
3638
+ }]
3639
+ }], propDecorators: { matSuffix: [{
3640
+ type: ViewChild,
3641
+ args: ['matSuffix', { static: true }]
3642
+ }] } });
3643
+ function passwordEyeExtension(field) {
3644
+ if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-password-eye') !== -1)) {
3898
3645
  return;
3899
3646
  }
3900
- if (field.props.bannerTitle || field.props.bannerText) {
3901
- // WARNING: 'gio-with-banner' must be placed before field wrappers in order to put banner before mat-form-field if exists
3902
- field.wrappers = ['gio-with-banner', ...(field.wrappers || [])];
3647
+ if (field.props.type === 'password') {
3648
+ field.wrappers = [...(field.wrappers || []), 'gio-password-eye'];
3903
3649
  }
3904
3650
  }
3905
3651
 
3906
3652
  /*
3907
- * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3653
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3908
3654
  *
3909
3655
  * Licensed under the Apache License, Version 2.0 (the "License");
3910
3656
  * you may not use this file except in compliance with the License.
@@ -3918,35 +3664,148 @@ function bannerExtension(field) {
3918
3664
  * See the License for the specific language governing permissions and
3919
3665
  * limitations under the License.
3920
3666
  */
3921
- class GioFjsMultiSchemaTypeComponent extends FieldType {
3922
- ngOnInit() {
3923
- set(this.field, 'fieldGroup[0].props.appearance', 'fill');
3924
- set(this.field, 'fieldGroup[0].props.label', 'Select option');
3925
- }
3667
+ class GioFormJsonSchemaModule {
3926
3668
  }
3927
- GioFjsMultiSchemaTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3928
- GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsMultiSchemaTypeComponent, selector: "gio-fjs-multi-schema-type", usesInheritance: true, ngImport: i0, template: `
3929
- <div class="wrapper">
3930
- <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3931
- <p *ngIf="props.description">{{ props.description }}</p>
3932
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3933
- <formly-validation-message [field]="field"></formly-validation-message>
3934
- </div>
3935
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3936
- </div>
3937
- `, 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"] }] });
3938
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsMultiSchemaTypeComponent, decorators: [{
3939
- type: Component,
3940
- args: [{ selector: 'gio-fjs-multi-schema-type', template: `
3941
- <div class="wrapper">
3942
- <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3943
- <p *ngIf="props.description">{{ props.description }}</p>
3944
- <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3945
- <formly-validation-message [field]="field"></formly-validation-message>
3946
- </div>
3947
- <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
3948
- </div>
3949
- `, 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"] }]
3669
+ GioFormJsonSchemaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3670
+ GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, declarations: [GioFormJsonSchemaComponent,
3671
+ GioFjsNullTypeComponent,
3672
+ GioFjsObjectTypeComponent,
3673
+ GioFjsMultiSchemaTypeComponent,
3674
+ GioFjsArrayTypeComponent,
3675
+ GioFjsToggleTypeComponent,
3676
+ GioFjsHeadersTypeComponent,
3677
+ GioFormFieldWrapperComponent,
3678
+ GioPasswordEyeWrapperComponent], imports: [CommonModule,
3679
+ A11yModule,
3680
+ ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
3681
+ GioIconsModule,
3682
+ GioFormSlideToggleModule,
3683
+ GioFormHeadersModule,
3684
+ MatSlideToggleModule,
3685
+ MatButtonModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
3686
+ GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, providers: [GioFormlyJsonSchemaService], imports: [[
3687
+ CommonModule,
3688
+ A11yModule,
3689
+ ReactiveFormsModule,
3690
+ FormlyModule.forRoot({
3691
+ validationMessages: [
3692
+ { name: 'required', message: 'This field is required' },
3693
+ { name: 'type', message: typeValidationMessage },
3694
+ { name: 'minLength', message: minLengthValidationMessage },
3695
+ { name: 'maxLength', message: maxLengthValidationMessage },
3696
+ { name: 'min', message: minValidationMessage },
3697
+ { name: 'max', message: maxValidationMessage },
3698
+ { name: 'multipleOf', message: multipleOfValidationMessage },
3699
+ { name: 'exclusiveMinimum', message: exclusiveMinimumValidationMessage },
3700
+ { name: 'exclusiveMaximum', message: exclusiveMaximumValidationMessage },
3701
+ { name: 'minItems', message: minItemsValidationMessage },
3702
+ { name: 'maxItems', message: maxItemsValidationMessage },
3703
+ { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3704
+ { name: 'const', message: constValidationMessage },
3705
+ ],
3706
+ wrappers: [
3707
+ { name: 'gio-with-banner', component: GioFormFieldWrapperComponent },
3708
+ { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
3709
+ ],
3710
+ types: [
3711
+ { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3712
+ { name: 'array', component: GioFjsArrayTypeComponent },
3713
+ { name: 'object', component: GioFjsObjectTypeComponent },
3714
+ { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3715
+ {
3716
+ name: 'toggle',
3717
+ component: GioFjsToggleTypeComponent,
3718
+ },
3719
+ {
3720
+ name: 'gio-headers-array',
3721
+ component: GioFjsHeadersTypeComponent,
3722
+ },
3723
+ ],
3724
+ extensions: [
3725
+ { name: 'banner', extension: { onPopulate: bannerExtension } },
3726
+ { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
3727
+ ],
3728
+ extras: {
3729
+ checkExpressionOn: 'changeDetectionCheck',
3730
+ },
3731
+ }),
3732
+ FormlyMaterialModule,
3733
+ GioIconsModule,
3734
+ GioFormSlideToggleModule,
3735
+ GioFormHeadersModule,
3736
+ MatSlideToggleModule,
3737
+ MatButtonModule,
3738
+ ], FormlyModule] });
3739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, decorators: [{
3740
+ type: NgModule,
3741
+ args: [{
3742
+ declarations: [
3743
+ GioFormJsonSchemaComponent,
3744
+ GioFjsNullTypeComponent,
3745
+ GioFjsObjectTypeComponent,
3746
+ GioFjsMultiSchemaTypeComponent,
3747
+ GioFjsArrayTypeComponent,
3748
+ GioFjsToggleTypeComponent,
3749
+ GioFjsHeadersTypeComponent,
3750
+ GioFormFieldWrapperComponent,
3751
+ GioPasswordEyeWrapperComponent,
3752
+ ],
3753
+ imports: [
3754
+ CommonModule,
3755
+ A11yModule,
3756
+ ReactiveFormsModule,
3757
+ FormlyModule.forRoot({
3758
+ validationMessages: [
3759
+ { name: 'required', message: 'This field is required' },
3760
+ { name: 'type', message: typeValidationMessage },
3761
+ { name: 'minLength', message: minLengthValidationMessage },
3762
+ { name: 'maxLength', message: maxLengthValidationMessage },
3763
+ { name: 'min', message: minValidationMessage },
3764
+ { name: 'max', message: maxValidationMessage },
3765
+ { name: 'multipleOf', message: multipleOfValidationMessage },
3766
+ { name: 'exclusiveMinimum', message: exclusiveMinimumValidationMessage },
3767
+ { name: 'exclusiveMaximum', message: exclusiveMaximumValidationMessage },
3768
+ { name: 'minItems', message: minItemsValidationMessage },
3769
+ { name: 'maxItems', message: maxItemsValidationMessage },
3770
+ { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
3771
+ { name: 'const', message: constValidationMessage },
3772
+ ],
3773
+ wrappers: [
3774
+ { name: 'gio-with-banner', component: GioFormFieldWrapperComponent },
3775
+ { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
3776
+ ],
3777
+ types: [
3778
+ { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
3779
+ { name: 'array', component: GioFjsArrayTypeComponent },
3780
+ { name: 'object', component: GioFjsObjectTypeComponent },
3781
+ { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
3782
+ {
3783
+ name: 'toggle',
3784
+ component: GioFjsToggleTypeComponent,
3785
+ },
3786
+ {
3787
+ name: 'gio-headers-array',
3788
+ component: GioFjsHeadersTypeComponent,
3789
+ },
3790
+ ],
3791
+ extensions: [
3792
+ { name: 'banner', extension: { onPopulate: bannerExtension } },
3793
+ { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
3794
+ ],
3795
+ extras: {
3796
+ checkExpressionOn: 'changeDetectionCheck',
3797
+ },
3798
+ }),
3799
+ FormlyMaterialModule,
3800
+ GioIconsModule,
3801
+ GioFormSlideToggleModule,
3802
+ GioFormHeadersModule,
3803
+ MatSlideToggleModule,
3804
+ MatButtonModule,
3805
+ ],
3806
+ exports: [GioFormJsonSchemaComponent, FormlyModule],
3807
+ providers: [GioFormlyJsonSchemaService],
3808
+ }]
3950
3809
  }] });
3951
3810
 
3952
3811
  /*
@@ -3964,44 +3823,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3964
3823
  * See the License for the specific language governing permissions and
3965
3824
  * limitations under the License.
3966
3825
  */
3967
- class GioFjsToggleTypeComponent extends FieldType {
3968
- }
3969
- GioFjsToggleTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3970
- GioFjsToggleTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsToggleTypeComponent, selector: "gio-fjs-toggle-type", usesInheritance: true, ngImport: i0, template: `
3971
- <gio-form-slide-toggle>
3972
- <gio-form-label>{{ props.label }}</gio-form-label>
3973
- {{ props.description }}
3974
- <mat-slide-toggle
3975
- gioFormSlideToggle
3976
- [id]="id"
3977
- [formControl]="formControl"
3978
- [formlyAttributes]="field"
3979
- [tabIndex]="props.tabindex"
3980
- ></mat-slide-toggle>
3981
- </gio-form-slide-toggle>
3982
- `, isInline: true, components: [{ type: GioFormSlideToggleComponent, selector: "gio-form-slide-toggle", inputs: ["appearance"] }, { type: GioFormLabelComponent, selector: "gio-form-label" }, { type: i3$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], directives: [{ type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i1$4.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }] });
3983
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsToggleTypeComponent, decorators: [{
3984
- type: Component,
3985
- args: [{
3986
- selector: 'gio-fjs-toggle-type',
3987
- template: `
3988
- <gio-form-slide-toggle>
3989
- <gio-form-label>{{ props.label }}</gio-form-label>
3990
- {{ props.description }}
3991
- <mat-slide-toggle
3992
- gioFormSlideToggle
3993
- [id]="id"
3994
- [formControl]="formControl"
3995
- [formlyAttributes]="field"
3996
- [tabIndex]="props.tabindex"
3997
- ></mat-slide-toggle>
3998
- </gio-form-slide-toggle>
3999
- `,
4000
- }]
4001
- }] });
4002
3826
 
4003
3827
  /*
4004
- * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3828
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4005
3829
  *
4006
3830
  * Licensed under the Apache License, Version 2.0 (the "License");
4007
3831
  * you may not use this file except in compliance with the License.
@@ -4015,77 +3839,83 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4015
3839
  * See the License for the specific language governing permissions and
4016
3840
  * limitations under the License.
4017
3841
  */
4018
- class GioFjsHeadersTypeComponent extends FieldType {
4019
- constructor() {
4020
- super(...arguments);
4021
- this.defaultOptions = {
4022
- props: {
4023
- outputConfig: {
4024
- keyName: 'name',
4025
- valueName: 'value',
4026
- },
4027
- },
4028
- };
4029
- this.collapse = false;
3842
+ class GioBaseFormFocusInvalidDirective {
3843
+ constructor(hostElement, formGroupDirective) {
3844
+ this.hostElement = hostElement;
3845
+ this.formGroupDirective = formGroupDirective;
4030
3846
  }
4031
- get map() {
4032
- return (headers) => [...(headers ?? [])].map(header => {
4033
- return {
4034
- [this.props.outputConfig.keyName]: header.key,
4035
- [this.props.outputConfig.valueName]: header.value,
4036
- };
4037
- });
3847
+ focusOnFirstInvalid() {
3848
+ const selector = '.ng-invalid[formControlName],input.ng-invalid,mat-select.ng-invalid,textarea.ng-invalid,.gio-ng-invalid';
3849
+ try {
3850
+ // Mark all controls as touched to display errors
3851
+ if (this.formGroupDirective) {
3852
+ this.formGroupDirective.control.markAllAsTouched();
3853
+ this.formGroupDirective.control.updateValueAndValidity();
3854
+ }
3855
+ const parentForm = this.hostElement.nativeElement.closest('form');
3856
+ const invalidFieldElements = parentForm?.querySelectorAll(selector);
3857
+ const invalidControl = this.getFirstInvalidControl(invalidFieldElements);
3858
+ if (invalidControl) {
3859
+ invalidControl.scrollIntoView({ behavior: 'smooth', block: 'center' });
3860
+ invalidControl.focus({ preventScroll: true });
3861
+ }
3862
+ }
3863
+ catch (error) {
3864
+ // Best effort. If the focus doesn't work it's not very important
3865
+ // 🧪 Useful to avoid som error in tests
3866
+ }
3867
+ }
3868
+ getFirstInvalidControl(invalidFieldElements, index = 0) {
3869
+ let invalidControl = invalidFieldElements?.item(index);
3870
+ const hasIgnoreAttribute = invalidControl?.attributes?.getNamedItem(GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR);
3871
+ if (hasIgnoreAttribute) {
3872
+ invalidControl = this.getFirstInvalidControl(invalidFieldElements, index + 1);
3873
+ }
3874
+ return invalidControl;
4038
3875
  }
4039
3876
  }
4040
- GioFjsHeadersTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4041
- GioFjsHeadersTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsHeadersTypeComponent, selector: "gio-fjs-headers-type", usesInheritance: true, ngImport: i0, template: `
4042
- <div class="wrapper">
4043
- <div class="wrapper__header">
4044
- <div class="wrapper__header__text">
4045
- <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
4046
- <p *ngIf="to.description">{{ to.description }}</p>
4047
- </div>
4048
- <div class="wrapper__header__collapse">
4049
- <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
4050
- <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
4051
- </button>
4052
- </div>
4053
- </div>
4054
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
4055
- <formly-validation-message [field]="field"></formly-validation-message>
4056
- </div>
4057
- <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
4058
- <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
4059
- </div>
4060
- </div>
4061
- `, isInline: true, 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"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i1$4.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }, { type: GioFormHeadersComponent, selector: "gio-form-headers", inputs: ["adaptOutputFn"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
4062
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsHeadersTypeComponent, decorators: [{
4063
- type: Component,
4064
- args: [{ selector: 'gio-fjs-headers-type', template: `
4065
- <div class="wrapper">
4066
- <div class="wrapper__header">
4067
- <div class="wrapper__header__text">
4068
- <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
4069
- <p *ngIf="to.description">{{ to.description }}</p>
4070
- </div>
4071
- <div class="wrapper__header__collapse">
4072
- <button type="button" mat-icon-button aria-label="Collapse" (click)="collapse = !collapse">
4073
- <mat-icon [class.collapse-open]="collapse" [class.collapse-close]="!collapse" svgIcon="gio:nav-arrow-down"></mat-icon>
4074
- </button>
4075
- </div>
4076
- </div>
4077
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
4078
- <formly-validation-message [field]="field"></formly-validation-message>
4079
- </div>
4080
- <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
4081
- <gio-form-headers [adaptOutputFn]="map" [formControl]="formControl"></gio-form-headers>
4082
- </div>
4083
- </div>
4084
- `, 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"] }]
4085
- }] });
3877
+ GioBaseFormFocusInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, deps: [{ token: i0.ElementRef }, { token: i7.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3878
+ GioBaseFormFocusInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioBaseFormFocusInvalidDirective, ngImport: i0 });
3879
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, decorators: [{
3880
+ type: Directive
3881
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i7.FormGroupDirective, decorators: [{
3882
+ type: Optional
3883
+ }] }]; } });
3884
+ class GioFormFocusInvalidFormDirective extends GioBaseFormFocusInvalidDirective {
3885
+ onFormSubmit() {
3886
+ this.focusOnFirstInvalid();
3887
+ }
3888
+ }
3889
+ GioFormFocusInvalidFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3890
+ GioFormFocusInvalidFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFocusInvalidFormDirective, selector: "form[gioFormFocusInvalid]", host: { listeners: { "submit": "onFormSubmit()" } }, usesInheritance: true, ngImport: i0 });
3891
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, decorators: [{
3892
+ type: Directive,
3893
+ args: [{
3894
+ selector: 'form[gioFormFocusInvalid]',
3895
+ }]
3896
+ }], propDecorators: { onFormSubmit: [{
3897
+ type: HostListener,
3898
+ args: ['submit']
3899
+ }] } });
3900
+ class GioButtonFocusInvalidButtonDirective extends GioBaseFormFocusInvalidDirective {
3901
+ onClick() {
3902
+ this.focusOnFirstInvalid();
3903
+ }
3904
+ }
3905
+ GioButtonFocusInvalidButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3906
+ GioButtonFocusInvalidButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioButtonFocusInvalidButtonDirective, selector: "button[gioFormFocusInvalid]", host: { listeners: { "click": "onClick()" } }, usesInheritance: true, ngImport: i0 });
3907
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, decorators: [{
3908
+ type: Directive,
3909
+ args: [{
3910
+ selector: 'button[gioFormFocusInvalid]',
3911
+ }]
3912
+ }], propDecorators: { onClick: [{
3913
+ type: HostListener,
3914
+ args: ['click']
3915
+ }] } });
4086
3916
 
4087
3917
  /*
4088
- * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3918
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4089
3919
  *
4090
3920
  * Licensed under the Apache License, Version 2.0 (the "License");
4091
3921
  * you may not use this file except in compliance with the License.
@@ -4099,58 +3929,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4099
3929
  * See the License for the specific language governing permissions and
4100
3930
  * limitations under the License.
4101
3931
  */
4102
- class GioPasswordEyeWrapperComponent extends FieldWrapper {
4103
- constructor() {
4104
- super(...arguments);
4105
- this.hide = true;
4106
- }
4107
- ngAfterViewInit() {
4108
- if (this.matSuffix) {
4109
- this.props.suffix = this.matSuffix;
4110
- }
4111
- }
4112
- addonEyeClick($event) {
4113
- $event.stopPropagation();
4114
- this.hide = !this.hide;
4115
- this.props.type = this.hide ? 'password' : 'text';
4116
- }
4117
- }
4118
- GioPasswordEyeWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4119
- 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: `
4120
- <ng-container #fieldComponent></ng-container>
4121
-
4122
- <ng-template #matSuffix>
4123
- <span style="cursor: pointer" (click)="addonEyeClick($event)">
4124
- <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
4125
- </span>
4126
- </ng-template>
4127
- `, isInline: true, components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
4128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioPasswordEyeWrapperComponent, decorators: [{
4129
- type: Component,
4130
- args: [{
4131
- selector: 'gio-password-eye-wrapper',
4132
- template: `
4133
- <ng-container #fieldComponent></ng-container>
4134
-
4135
- <ng-template #matSuffix>
4136
- <span style="cursor: pointer" (click)="addonEyeClick($event)">
4137
- <mat-icon [svgIcon]="hide ? 'gio:eye-empty' : 'gio:eye-off'"></mat-icon>
4138
- </span>
4139
- </ng-template>
4140
- `,
4141
- }]
4142
- }], propDecorators: { matSuffix: [{
4143
- type: ViewChild,
4144
- args: ['matSuffix', { static: true }]
4145
- }] } });
4146
- function passwordEyeExtension(field) {
4147
- if (!field.props || (field.wrappers && field.wrappers.indexOf('gio-password-eye') !== -1)) {
4148
- return;
4149
- }
4150
- if (field.props.type === 'password') {
4151
- field.wrappers = [...(field.wrappers || []), 'gio-password-eye'];
4152
- }
3932
+ class GioFormFocusInvalidModule {
4153
3933
  }
3934
+ GioFormFocusInvalidModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3935
+ GioFormFocusInvalidModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective], exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective] });
3936
+ GioFormFocusInvalidModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule });
3937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, decorators: [{
3938
+ type: NgModule,
3939
+ args: [{
3940
+ declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
3941
+ exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
3942
+ }]
3943
+ }] });
4154
3944
 
4155
3945
  /*
4156
3946
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -4167,45 +3957,74 @@ function passwordEyeExtension(field) {
4167
3957
  * See the License for the specific language governing permissions and
4168
3958
  * limitations under the License.
4169
3959
  */
4170
- class GioFjsCodeEditorTypeComponent extends FieldType$1 {
4171
- ngOnInit() {
4172
- this.languageConfig = undefined;
3960
+ const GIO_MONACO_EDITOR_CONFIG = new InjectionToken('gio-monaco-editor-config');
3961
+
3962
+ /*
3963
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3964
+ *
3965
+ * Licensed under the Apache License, Version 2.0 (the "License");
3966
+ * you may not use this file except in compliance with the License.
3967
+ * You may obtain a copy of the License at
3968
+ *
3969
+ * http://www.apache.org/licenses/LICENSE-2.0
3970
+ *
3971
+ * Unless required by applicable law or agreed to in writing, software
3972
+ * distributed under the License is distributed on an "AS IS" BASIS,
3973
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3974
+ * See the License for the specific language governing permissions and
3975
+ * limitations under the License.
3976
+ */
3977
+ class GioMonacoEditorService {
3978
+ constructor() {
3979
+ this.loaded$ = new ReplaySubject(1);
3980
+ this.loaded = false;
3981
+ }
3982
+ loadEditor() {
3983
+ if (this.loaded) {
3984
+ // Already loaded, do nothing.
3985
+ return Promise.resolve();
3986
+ }
3987
+ this.loaded = true;
3988
+ return new Promise(resolve => {
3989
+ // Monaco is already loaded
3990
+ if (typeof window.monaco === 'object') {
3991
+ resolve();
3992
+ return;
3993
+ }
3994
+ const onGotAmdLoader = () => {
3995
+ // Load Monaco
3996
+ window.require.config({ paths: { vs: 'assets/monaco-editor/min/vs' } });
3997
+ window.require(['vs/editor/editor.main'], () => {
3998
+ resolve();
3999
+ });
4000
+ };
4001
+ // Load AMD loader if necessary
4002
+ if (!window.require) {
4003
+ const loaderScript = document.createElement('script');
4004
+ loaderScript.type = 'text/javascript';
4005
+ loaderScript.src = 'assets/monaco-editor/min/vs/loader.js';
4006
+ loaderScript.addEventListener('load', onGotAmdLoader);
4007
+ document.body.appendChild(loaderScript);
4008
+ }
4009
+ else {
4010
+ onGotAmdLoader();
4011
+ }
4012
+ }).then(() => {
4013
+ this.loaded$.next({ monaco: window.monaco });
4014
+ });
4173
4015
  }
4174
4016
  }
4175
- GioFjsCodeEditorTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsCodeEditorTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4176
- GioFjsCodeEditorTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsCodeEditorTypeComponent, selector: "gio-fjs-code-editor-type", usesInheritance: true, ngImport: i0, template: `
4177
- <gio-monaco-editor
4178
- gioMonacoEditorFormField
4179
- ngDefaultControl
4180
- [formControl]="formControl"
4181
- [languageConfig]="languageConfig"
4182
- ></gio-monaco-editor>
4183
- `, isInline: true, styles: ["gio-monaco-editor{min-height:38px}\n"], components: [{ type: GioMonacoEditorComponent, selector: "gio-monaco-editor", inputs: ["languageConfig", "options"] }], directives: [{ type: GioMonacoEditorFormFieldDirective, selector: "[gioMonacoEditorFormField]", inputs: ["placeholder", "required", "disabled"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsCodeEditorTypeComponent, decorators: [{
4185
- type: Component,
4017
+ GioMonacoEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4018
+ GioMonacoEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, providedIn: 'root' });
4019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, decorators: [{
4020
+ type: Injectable,
4186
4021
  args: [{
4187
- selector: 'gio-fjs-code-editor-type',
4188
- template: `
4189
- <gio-monaco-editor
4190
- gioMonacoEditorFormField
4191
- ngDefaultControl
4192
- [formControl]="formControl"
4193
- [languageConfig]="languageConfig"
4194
- ></gio-monaco-editor>
4195
- `,
4196
- styles: [
4197
- `
4198
- gio-monaco-editor {
4199
- min-height: 38px;
4200
- }
4201
- `,
4202
- ],
4203
- changeDetection: ChangeDetectionStrategy.OnPush,
4022
+ providedIn: 'root',
4204
4023
  }]
4205
4024
  }] });
4206
4025
 
4207
4026
  /*
4208
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4027
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
4209
4028
  *
4210
4029
  * Licensed under the Apache License, Version 2.0 (the "License");
4211
4030
  * you may not use this file except in compliance with the License.
@@ -4219,167 +4038,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4219
4038
  * See the License for the specific language governing permissions and
4220
4039
  * limitations under the License.
4221
4040
  */
4222
- class GioFormJsonSchemaModule {
4223
- }
4224
- GioFormJsonSchemaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4225
- GioFormJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, declarations: [GioFormJsonSchemaComponent,
4226
- GioFjsNullTypeComponent,
4227
- GioFjsObjectTypeComponent,
4228
- GioFjsMultiSchemaTypeComponent,
4229
- GioFjsArrayTypeComponent,
4230
- GioFjsToggleTypeComponent,
4231
- GioFjsHeadersTypeComponent,
4232
- GioFjsCodeEditorTypeComponent,
4233
- GioBannerWrapperComponent,
4234
- GioPasswordEyeWrapperComponent], imports: [CommonModule,
4235
- A11yModule,
4236
- ReactiveFormsModule, i1$4.FormlyModule, FormlyMaterialModule,
4237
- MatInputModule,
4238
- GioIconsModule,
4239
- GioFormSlideToggleModule,
4240
- GioFormHeadersModule,
4241
- GioMonacoEditorModule,
4242
- MatSlideToggleModule,
4243
- MatButtonModule], exports: [GioFormJsonSchemaComponent, FormlyModule] });
4244
- GioFormJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, providers: [GioFormlyJsonSchemaService], imports: [[
4245
- CommonModule,
4246
- A11yModule,
4247
- ReactiveFormsModule,
4248
- FormlyModule.forRoot({
4249
- validationMessages: [
4250
- { name: 'required', message: 'This field is required' },
4251
- { name: 'type', message: typeValidationMessage },
4252
- { name: 'minLength', message: minLengthValidationMessage },
4253
- { name: 'maxLength', message: maxLengthValidationMessage },
4254
- { name: 'min', message: minValidationMessage },
4255
- { name: 'max', message: maxValidationMessage },
4256
- { name: 'multipleOf', message: multipleOfValidationMessage },
4257
- { name: 'exclusiveMinimum', message: exclusiveMinimumValidationMessage },
4258
- { name: 'exclusiveMaximum', message: exclusiveMaximumValidationMessage },
4259
- { name: 'minItems', message: minItemsValidationMessage },
4260
- { name: 'maxItems', message: maxItemsValidationMessage },
4261
- { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
4262
- { name: 'const', message: constValidationMessage },
4263
- ],
4264
- wrappers: [
4265
- { name: 'gio-with-banner', component: GioBannerWrapperComponent },
4266
- { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
4267
- ],
4268
- types: [
4269
- { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
4270
- { name: 'array', component: GioFjsArrayTypeComponent },
4271
- { name: 'object', component: GioFjsObjectTypeComponent },
4272
- { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
4273
- {
4274
- name: 'toggle',
4275
- component: GioFjsToggleTypeComponent,
4276
- },
4277
- {
4278
- name: 'gio-code-editor',
4279
- component: GioFjsCodeEditorTypeComponent,
4280
- wrappers: ['form-field'],
4281
- },
4282
- {
4283
- name: 'gio-headers-array',
4284
- component: GioFjsHeadersTypeComponent,
4285
- },
4286
- ],
4287
- extensions: [
4288
- { name: 'banner', extension: { onPopulate: bannerExtension } },
4289
- { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
4290
- ],
4291
- extras: {
4292
- checkExpressionOn: 'changeDetectionCheck',
4293
- },
4294
- }),
4295
- FormlyMaterialModule,
4296
- MatInputModule,
4297
- GioIconsModule,
4298
- GioFormSlideToggleModule,
4299
- GioFormHeadersModule,
4300
- GioMonacoEditorModule,
4301
- MatSlideToggleModule,
4302
- MatButtonModule,
4303
- ], FormlyModule] });
4304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormJsonSchemaModule, decorators: [{
4305
- type: NgModule,
4306
- args: [{
4307
- declarations: [
4308
- GioFormJsonSchemaComponent,
4309
- GioFjsNullTypeComponent,
4310
- GioFjsObjectTypeComponent,
4311
- GioFjsMultiSchemaTypeComponent,
4312
- GioFjsArrayTypeComponent,
4313
- GioFjsToggleTypeComponent,
4314
- GioFjsHeadersTypeComponent,
4315
- GioFjsCodeEditorTypeComponent,
4316
- GioBannerWrapperComponent,
4317
- GioPasswordEyeWrapperComponent,
4318
- ],
4319
- imports: [
4320
- CommonModule,
4321
- A11yModule,
4322
- ReactiveFormsModule,
4323
- FormlyModule.forRoot({
4324
- validationMessages: [
4325
- { name: 'required', message: 'This field is required' },
4326
- { name: 'type', message: typeValidationMessage },
4327
- { name: 'minLength', message: minLengthValidationMessage },
4328
- { name: 'maxLength', message: maxLengthValidationMessage },
4329
- { name: 'min', message: minValidationMessage },
4330
- { name: 'max', message: maxValidationMessage },
4331
- { name: 'multipleOf', message: multipleOfValidationMessage },
4332
- { name: 'exclusiveMinimum', message: exclusiveMinimumValidationMessage },
4333
- { name: 'exclusiveMaximum', message: exclusiveMaximumValidationMessage },
4334
- { name: 'minItems', message: minItemsValidationMessage },
4335
- { name: 'maxItems', message: maxItemsValidationMessage },
4336
- { name: 'uniqueItems', message: 'Should NOT have duplicate items' },
4337
- { name: 'const', message: constValidationMessage },
4338
- ],
4339
- wrappers: [
4340
- { name: 'gio-with-banner', component: GioBannerWrapperComponent },
4341
- { name: 'gio-password-eye', component: GioPasswordEyeWrapperComponent },
4342
- ],
4343
- types: [
4344
- { name: 'null', component: GioFjsNullTypeComponent, wrappers: ['form-field'] },
4345
- { name: 'array', component: GioFjsArrayTypeComponent },
4346
- { name: 'object', component: GioFjsObjectTypeComponent },
4347
- { name: 'multischema', component: GioFjsMultiSchemaTypeComponent },
4348
- {
4349
- name: 'toggle',
4350
- component: GioFjsToggleTypeComponent,
4351
- },
4352
- {
4353
- name: 'gio-code-editor',
4354
- component: GioFjsCodeEditorTypeComponent,
4355
- wrappers: ['form-field'],
4356
- },
4357
- {
4358
- name: 'gio-headers-array',
4359
- component: GioFjsHeadersTypeComponent,
4360
- },
4361
- ],
4362
- extensions: [
4363
- { name: 'banner', extension: { onPopulate: bannerExtension } },
4364
- { name: 'password-eye', extension: { onPopulate: passwordEyeExtension } },
4365
- ],
4366
- extras: {
4367
- checkExpressionOn: 'changeDetectionCheck',
4368
- },
4369
- }),
4370
- FormlyMaterialModule,
4371
- MatInputModule,
4372
- GioIconsModule,
4373
- GioFormSlideToggleModule,
4374
- GioFormHeadersModule,
4375
- GioMonacoEditorModule,
4376
- MatSlideToggleModule,
4377
- MatButtonModule,
4378
- ],
4379
- exports: [GioFormJsonSchemaComponent, FormlyModule],
4380
- providers: [GioFormlyJsonSchemaService],
4041
+ class GioLanguageJsonService {
4042
+ constructor(codeEditorService) {
4043
+ this.unsubscribe$ = new Subject();
4044
+ codeEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(event => {
4045
+ this.setup(event.monaco);
4046
+ });
4047
+ }
4048
+ ngOnDestroy() {
4049
+ this.unsubscribe$.next();
4050
+ this.unsubscribe$.complete();
4051
+ }
4052
+ setup(monaco) {
4053
+ if (!monaco) {
4054
+ throw new Error('Monaco is not loaded');
4055
+ }
4056
+ this.monaco = monaco;
4057
+ const defaults = monaco.languages.json.jsonDefaults;
4058
+ defaults.setDiagnosticsOptions({
4059
+ validate: true,
4060
+ allowComments: true,
4061
+ });
4062
+ }
4063
+ addSchemas(id, definitions = []) {
4064
+ if (!this.monaco) {
4065
+ throw new Error('Monaco is not loaded');
4066
+ }
4067
+ const defaults = this.monaco.languages.json.jsonDefaults;
4068
+ const options = defaults.diagnosticsOptions;
4069
+ let schemas = definitions.map(({ uri, schema }) => ({
4070
+ uri,
4071
+ schema,
4072
+ fileMatch: [id || '*.json'],
4073
+ }));
4074
+ if (options && options.schemas && options.schemas.length > 0) {
4075
+ schemas = [...options.schemas, ...schemas];
4076
+ }
4077
+ defaults.setDiagnosticsOptions({
4078
+ ...options,
4079
+ schemas: schemas,
4080
+ });
4081
+ }
4082
+ }
4083
+ GioLanguageJsonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, deps: [{ token: GioMonacoEditorService }], target: i0.ɵɵFactoryTarget.Injectable });
4084
+ GioLanguageJsonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, providedIn: 'root' });
4085
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, decorators: [{
4086
+ type: Injectable,
4087
+ args: [{
4088
+ providedIn: 'root',
4381
4089
  }]
4382
- }] });
4090
+ }], ctorParameters: function () { return [{ type: GioMonacoEditorService }]; } });
4383
4091
 
4384
4092
  /*
4385
4093
  * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
@@ -4396,95 +4104,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4396
4104
  * See the License for the specific language governing permissions and
4397
4105
  * limitations under the License.
4398
4106
  */
4399
-
4400
- /*
4401
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4402
- *
4403
- * Licensed under the Apache License, Version 2.0 (the "License");
4404
- * you may not use this file except in compliance with the License.
4405
- * You may obtain a copy of the License at
4406
- *
4407
- * http://www.apache.org/licenses/LICENSE-2.0
4408
- *
4409
- * Unless required by applicable law or agreed to in writing, software
4410
- * distributed under the License is distributed on an "AS IS" BASIS,
4411
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4412
- * See the License for the specific language governing permissions and
4413
- * limitations under the License.
4414
- */
4415
- class GioBaseFormFocusInvalidDirective {
4416
- constructor(hostElement, formGroupDirective) {
4107
+ class GioMonacoEditorComponent {
4108
+ constructor(config, monacoEditorService, languageJsonService, hostElement, changeDetectorRef, ngZone) {
4109
+ this.config = config;
4110
+ this.monacoEditorService = monacoEditorService;
4111
+ this.languageJsonService = languageJsonService;
4417
4112
  this.hostElement = hostElement;
4418
- this.formGroupDirective = formGroupDirective;
4113
+ this.changeDetectorRef = changeDetectorRef;
4114
+ this.ngZone = ngZone;
4115
+ this.options = {};
4116
+ this.id = uniqueId('gio-monaco-editor-');
4117
+ this.loading = true;
4118
+ this.defaultOptions = {
4119
+ contextmenu: false,
4120
+ minimap: {
4121
+ enabled: true,
4122
+ },
4123
+ automaticLayout: true,
4124
+ scrollBeyondLastLine: false,
4125
+ };
4126
+ this.value = '';
4127
+ this.readOnly = false;
4128
+ this._onChange = () => ({});
4129
+ this._onTouched = () => ({});
4130
+ this.unsubscribe$ = new Subject();
4131
+ this.monacoEditorService.loadEditor();
4419
4132
  }
4420
- focusOnFirstInvalid() {
4421
- const selector = '.ng-invalid[formControlName],input.ng-invalid,mat-select.ng-invalid,textarea.ng-invalid,.gio-ng-invalid';
4422
- try {
4423
- // Mark all controls as touched to display errors
4424
- if (this.formGroupDirective) {
4425
- this.formGroupDirective.control.markAllAsTouched();
4426
- this.formGroupDirective.control.updateValueAndValidity();
4427
- }
4428
- const parentForm = this.hostElement.nativeElement.closest('form');
4429
- const invalidFieldElements = parentForm?.querySelectorAll(selector);
4430
- const invalidControl = this.getFirstInvalidControl(invalidFieldElements);
4431
- if (invalidControl) {
4432
- invalidControl.scrollIntoView({ behavior: 'smooth', block: 'center' });
4433
- invalidControl.focus({ preventScroll: true });
4434
- }
4133
+ ngAfterViewInit() {
4134
+ // Wait until monaco editor is available
4135
+ this.monacoEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(({ monaco }) => {
4136
+ this.setupEditor(monaco);
4137
+ this.loading = false;
4138
+ this.changeDetectorRef.detectChanges();
4139
+ });
4140
+ }
4141
+ ngOnDestroy() {
4142
+ if (this.standaloneCodeEditor) {
4143
+ this.standaloneCodeEditor.dispose();
4144
+ this.standaloneCodeEditor = undefined;
4435
4145
  }
4436
- catch (error) {
4437
- // Best effort. If the focus doesn't work it's not very important
4438
- // 🧪 Useful to avoid som error in tests
4146
+ if (this.textModel) {
4147
+ this.textModel.dispose();
4148
+ this.textModel = undefined;
4439
4149
  }
4150
+ this.unsubscribe$.next();
4151
+ this.unsubscribe$.complete();
4440
4152
  }
4441
- getFirstInvalidControl(invalidFieldElements, index = 0) {
4442
- let invalidControl = invalidFieldElements?.item(index);
4443
- const hasIgnoreAttribute = invalidControl?.attributes?.getNamedItem(GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR);
4444
- if (hasIgnoreAttribute) {
4445
- invalidControl = this.getFirstInvalidControl(invalidFieldElements, index + 1);
4153
+ // From ControlValueAccessor interface
4154
+ writeValue(_value) {
4155
+ if (_value) {
4156
+ this.value = _value;
4157
+ }
4158
+ if (this.textModel) {
4159
+ this.textModel.setValue(this.value);
4446
4160
  }
4447
- return invalidControl;
4448
4161
  }
4449
- }
4450
- GioBaseFormFocusInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, deps: [{ token: i0.ElementRef }, { token: i7.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
4451
- GioBaseFormFocusInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioBaseFormFocusInvalidDirective, ngImport: i0 });
4452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioBaseFormFocusInvalidDirective, decorators: [{
4453
- type: Directive
4454
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i7.FormGroupDirective, decorators: [{
4455
- type: Optional
4456
- }] }]; } });
4457
- class GioFormFocusInvalidFormDirective extends GioBaseFormFocusInvalidDirective {
4458
- onFormSubmit() {
4459
- this.focusOnFirstInvalid();
4162
+ // From ControlValueAccessor interface
4163
+ registerOnChange(fn) {
4164
+ this._onChange = fn;
4460
4165
  }
4461
- }
4462
- GioFormFocusInvalidFormDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
4463
- GioFormFocusInvalidFormDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFocusInvalidFormDirective, selector: "form[gioFormFocusInvalid]", host: { listeners: { "submit": "onFormSubmit()" } }, usesInheritance: true, ngImport: i0 });
4464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidFormDirective, decorators: [{
4465
- type: Directive,
4466
- args: [{
4467
- selector: 'form[gioFormFocusInvalid]',
4468
- }]
4469
- }], propDecorators: { onFormSubmit: [{
4470
- type: HostListener,
4471
- args: ['submit']
4472
- }] } });
4473
- class GioButtonFocusInvalidButtonDirective extends GioBaseFormFocusInvalidDirective {
4474
- onClick() {
4475
- this.focusOnFirstInvalid();
4166
+ // From ControlValueAccessor interface
4167
+ registerOnTouched(fn) {
4168
+ this._onTouched = fn;
4169
+ }
4170
+ // From ControlValueAccessor interface
4171
+ setDisabledState(isDisabled) {
4172
+ this.readOnly = isDisabled;
4173
+ }
4174
+ setupEditor(monaco) {
4175
+ if (!this.hostElement) {
4176
+ throw new Error('No editor ref found.');
4177
+ }
4178
+ const domElement = this.hostElement.nativeElement;
4179
+ const settings = {
4180
+ value: this.value,
4181
+ language: this.languageConfig?.language ?? 'text',
4182
+ uri: `code-${uniqueId()}`,
4183
+ };
4184
+ this.ngZone.runOutsideAngular(() => {
4185
+ this.textModel = monaco.editor.createModel(settings.value, settings.language, monaco.Uri.parse(settings.uri));
4186
+ });
4187
+ const options = Object.assign({}, this.defaultOptions, this.options, {
4188
+ readOnly: this.readOnly,
4189
+ theme: this.config.theme ?? 'vs',
4190
+ model: this.textModel,
4191
+ });
4192
+ this.standaloneCodeEditor = monaco.editor.create(domElement, {
4193
+ ...options,
4194
+ });
4195
+ this.textModel?.onDidChangeContent(() => {
4196
+ const newValue = this.textModel?.getValue();
4197
+ this.ngZone.run(() => {
4198
+ newValue && this._onChange(newValue);
4199
+ this._onTouched();
4200
+ });
4201
+ });
4202
+ this.standaloneCodeEditor?.onDidBlurEditorWidget(() => {
4203
+ this.ngZone.run(() => {
4204
+ this._onTouched();
4205
+ });
4206
+ });
4207
+ this.setupLanguage(settings.uri, this.languageConfig);
4208
+ }
4209
+ setupLanguage(uri, languageConfig) {
4210
+ if (!languageConfig) {
4211
+ return;
4212
+ }
4213
+ const { language } = languageConfig;
4214
+ if (language) {
4215
+ const lang = language.toLowerCase();
4216
+ switch (lang) {
4217
+ case 'json':
4218
+ if (languageConfig.schemas) {
4219
+ this.languageJsonService.addSchemas(uri, languageConfig.schemas);
4220
+ }
4221
+ break;
4222
+ default:
4223
+ break;
4224
+ }
4225
+ }
4476
4226
  }
4477
4227
  }
4478
- GioButtonFocusInvalidButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
4479
- GioButtonFocusInvalidButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioButtonFocusInvalidButtonDirective, selector: "button[gioFormFocusInvalid]", host: { listeners: { "click": "onClick()" } }, usesInheritance: true, ngImport: i0 });
4480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioButtonFocusInvalidButtonDirective, decorators: [{
4481
- type: Directive,
4482
- args: [{
4483
- selector: 'button[gioFormFocusInvalid]',
4484
- }]
4485
- }], propDecorators: { onClick: [{
4486
- type: HostListener,
4487
- args: ['click']
4228
+ GioMonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, deps: [{ token: GIO_MONACO_EDITOR_CONFIG }, { token: GioMonacoEditorService }, { token: GioLanguageJsonService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
4229
+ GioMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorComponent, selector: "gio-monaco-editor", inputs: { languageConfig: "languageConfig", options: "options" }, providers: [
4230
+ {
4231
+ provide: NG_VALUE_ACCESSOR,
4232
+ useExisting: forwardRef(() => GioMonacoEditorComponent),
4233
+ multi: true,
4234
+ },
4235
+ ], ngImport: i0, template: ` <div *ngIf="loading">Loading...</div>`, isInline: true, styles: [":host{display:block;height:100%;min-height:150px}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
4236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, decorators: [{
4237
+ type: Component,
4238
+ args: [{ selector: 'gio-monaco-editor', template: ` <div *ngIf="loading">Loading...</div>`, providers: [
4239
+ {
4240
+ provide: NG_VALUE_ACCESSOR,
4241
+ useExisting: forwardRef(() => GioMonacoEditorComponent),
4242
+ multi: true,
4243
+ },
4244
+ ], styles: [":host{display:block;height:100%;min-height:150px}\n"] }]
4245
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4246
+ type: Inject,
4247
+ args: [GIO_MONACO_EDITOR_CONFIG]
4248
+ }] }, { type: GioMonacoEditorService }, { type: GioLanguageJsonService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { languageConfig: [{
4249
+ type: Input
4250
+ }], options: [{
4251
+ type: Input
4488
4252
  }] } });
4489
4253
 
4490
4254
  /*
@@ -4502,16 +4266,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4502
4266
  * See the License for the specific language governing permissions and
4503
4267
  * limitations under the License.
4504
4268
  */
4505
- class GioFormFocusInvalidModule {
4269
+ class GioMonacoEditorModule {
4270
+ static forRoot(config) {
4271
+ return {
4272
+ ngModule: GioMonacoEditorModule,
4273
+ providers: [
4274
+ {
4275
+ provide: GIO_MONACO_EDITOR_CONFIG,
4276
+ useValue: config,
4277
+ },
4278
+ ],
4279
+ };
4280
+ }
4506
4281
  }
4507
- GioFormFocusInvalidModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4508
- GioFormFocusInvalidModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective], exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective] });
4509
- GioFormFocusInvalidModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule });
4510
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, decorators: [{
4282
+ GioMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4283
+ GioMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, declarations: [GioMonacoEditorComponent], imports: [CommonModule, HttpClientModule, ReactiveFormsModule], exports: [GioMonacoEditorComponent] });
4284
+ GioMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, providers: [
4285
+ {
4286
+ provide: GIO_MONACO_EDITOR_CONFIG,
4287
+ useValue: {},
4288
+ },
4289
+ ], imports: [[CommonModule, HttpClientModule, ReactiveFormsModule]] });
4290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, decorators: [{
4511
4291
  type: NgModule,
4512
4292
  args: [{
4513
- declarations: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
4514
- exports: [GioFormFocusInvalidFormDirective, GioButtonFocusInvalidButtonDirective, GioFormFocusInvalidIgnoreDirective],
4293
+ imports: [CommonModule, HttpClientModule, ReactiveFormsModule],
4294
+ declarations: [GioMonacoEditorComponent],
4295
+ exports: [GioMonacoEditorComponent],
4296
+ providers: [
4297
+ {
4298
+ provide: GIO_MONACO_EDITOR_CONFIG,
4299
+ useValue: {},
4300
+ },
4301
+ ],
4515
4302
  }]
4516
4303
  }] });
4517
4304
 
@@ -4544,12 +4331,25 @@ class GioMonacoEditorTestingComponent extends GioMonacoEditorComponent {
4544
4331
  }
4545
4332
  }
4546
4333
  GioMonacoEditorTestingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4547
- GioMonacoEditorTestingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorTestingComponent, selector: "gio-monaco-editor", usesInheritance: true, ngImport: i0, template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />', isInline: true });
4334
+ GioMonacoEditorTestingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorTestingComponent, selector: "gio-monaco-editor", providers: [
4335
+ {
4336
+ provide: NG_VALUE_ACCESSOR,
4337
+ useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
4338
+ multi: true,
4339
+ },
4340
+ ], usesInheritance: true, ngImport: i0, template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />', isInline: true });
4548
4341
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, decorators: [{
4549
4342
  type: Component,
4550
4343
  args: [{
4551
4344
  selector: 'gio-monaco-editor',
4552
4345
  template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />',
4346
+ providers: [
4347
+ {
4348
+ provide: NG_VALUE_ACCESSOR,
4349
+ useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
4350
+ multi: true,
4351
+ },
4352
+ ],
4553
4353
  }]
4554
4354
  }] });
4555
4355
 
@@ -4700,5 +4500,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
4700
4500
  * Generated bundle index. Do not edit.
4701
4501
  */
4702
4502
 
4703
- export { GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR, GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBaseFormFocusInvalidDirective, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioButtonFocusInvalidButtonDirective, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidFormDirective, GioFormFocusInvalidIgnoreDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioLoaderComponent, GioLoaderModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective, GioMonacoEditorHarness, GioMonacoEditorModule, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
4503
+ export { GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR, GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBaseFormFocusInvalidDirective, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioButtonFocusInvalidButtonDirective, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidFormDirective, GioFormFocusInvalidIgnoreDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioLoaderComponent, GioLoaderModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorHarness, GioMonacoEditorModule, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
4704
4504
  //# sourceMappingURL=gravitee-ui-particles-angular.mjs.map