@gravitee/ui-particles-angular 5.11.0 → 5.12.0-monaco-editor-762fa6b

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 (34) hide show
  1. package/esm2020/lib/gio-confirm-and-validate-dialog/gio-confirm-and-validate-dialog.module.mjs +2 -2
  2. package/esm2020/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive.mjs +61 -0
  3. package/esm2020/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.module.mjs +31 -0
  4. package/esm2020/lib/gio-form-json-schema/gio-form-json-schema.component.mjs +7 -2
  5. package/esm2020/lib/gio-form-json-schema/model/GioJsonSchema.mjs +1 -1
  6. package/esm2020/lib/gio-form-json-schema/type-component/array-type.component.mjs +9 -9
  7. package/esm2020/lib/gio-form-json-schema/type-component/multischema-type.component.mjs +3 -3
  8. package/esm2020/lib/gio-form-json-schema/type-component/object-type.component.mjs +3 -3
  9. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +172 -0
  10. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.harness.mjs +63 -0
  11. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.module.mjs +58 -0
  12. package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.testing.component.mjs +55 -0
  13. package/esm2020/lib/gio-monaco-editor/models/GioMonacoEditorConfig.mjs +18 -0
  14. package/esm2020/lib/gio-monaco-editor/models/MonacoEditorTheme.mjs +2 -0
  15. package/esm2020/lib/gio-monaco-editor/services/gio-language-json.service.mjs +71 -0
  16. package/esm2020/lib/gio-monaco-editor/services/gio-monaco-editor.service.mjs +67 -0
  17. package/esm2020/lib/public-api.mjs +6 -1
  18. package/fesm2015/gravitee-ui-particles-angular.mjs +566 -16
  19. package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
  20. package/fesm2020/gravitee-ui-particles-angular.mjs +577 -16
  21. package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
  22. package/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive.d.ts +11 -0
  23. package/lib/gio-form-focus-first-invalid/gio-form-focus-first-invalid.module.d.ts +7 -0
  24. package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +17 -11
  25. package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +45 -0
  26. package/lib/gio-monaco-editor/gio-monaco-editor.harness.d.ts +16 -0
  27. package/lib/gio-monaco-editor/gio-monaco-editor.module.d.ts +18 -0
  28. package/lib/gio-monaco-editor/gio-monaco-editor.testing.component.d.ts +12 -0
  29. package/lib/gio-monaco-editor/models/GioMonacoEditorConfig.d.ts +6 -0
  30. package/lib/gio-monaco-editor/models/MonacoEditorTheme.d.ts +1 -0
  31. package/lib/gio-monaco-editor/services/gio-language-json.service.d.ts +17 -0
  32. package/lib/gio-monaco-editor/services/gio-monaco-editor.service.d.ts +18 -0
  33. package/lib/public-api.d.ts +5 -0
  34. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { trigger, transition, style, animate } from '@angular/animations';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild } from '@angular/core';
4
- import { timer, Subject, fromEvent, of, BehaviorSubject } from 'rxjs';
3
+ import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken } from '@angular/core';
4
+ import { timer, Subject, fromEvent, of, BehaviorSubject, ReplaySubject } from 'rxjs';
5
5
  import * as i1 from '@angular/material/card';
6
6
  import { MatCardModule } from '@angular/material/card';
7
7
  import * as i2 from '@angular/material/button';
@@ -13,7 +13,7 @@ import { ComponentHarness, HarnessPredicate, parallel, TestKey } from '@angular/
13
13
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
14
14
  import * as i3$1 from '@angular/material/form-field';
15
15
  import { MatFormFieldControl, MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
16
- import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set } from 'lodash';
16
+ import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set, uniqueId } from 'lodash';
17
17
  import { startWith, map, distinctUntilChanged, tap, debounce, takeUntil, delay, filter, switchMap } from 'rxjs/operators';
18
18
  import * as i7 from '@angular/forms';
19
19
  import { FormsModule, FormArray, FormGroup, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, NgControl } from '@angular/forms';
@@ -50,6 +50,7 @@ import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-form
50
50
  import { FormlyMaterialModule } from '@ngx-formly/material';
51
51
  import * as i3$2 from '@angular/material/slide-toggle';
52
52
  import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
53
+ import { TestBed } from '@angular/core/testing';
53
54
 
54
55
  /*
55
56
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
@@ -2844,6 +2845,10 @@ class GioFormJsonSchemaComponent {
2844
2845
  }
2845
2846
  }
2846
2847
  ngOnInit() {
2848
+ var _a, _b, _c;
2849
+ // When the parent form is touched, mark all the sub formGroup as touched
2850
+ const parentControl = (_b = (_a = this.ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.parent;
2851
+ (_c = parentControl === null || parentControl === void 0 ? void 0 : parentControl.statusChanges) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this.unsubscribe$), map(() => parentControl === null || parentControl === void 0 ? void 0 : parentControl.touched), filter(touched => touched === true), tap(() => this.formGroup.markAllAsTouched())).subscribe();
2847
2852
  this.formGroup.statusChanges.pipe(takeUntil(this.unsubscribe$)).subscribe(status => {
2848
2853
  var _a, _b, _c, _d;
2849
2854
  if (status === 'VALID') {
@@ -3097,7 +3102,7 @@ GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
3097
3102
  <div class="wrapper">
3098
3103
  <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3099
3104
  <p *ngIf="to.description">{{ to.description }}</p>
3100
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3105
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3101
3106
  <formly-validation-message [field]="field"></formly-validation-message>
3102
3107
  </div>
3103
3108
  <div class="wrapper__fields">
@@ -3111,7 +3116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3111
3116
  <div class="wrapper">
3112
3117
  <div class="wrapper__title" *ngIf="to.label">{{ to.label }}</div>
3113
3118
  <p *ngIf="to.description">{{ to.description }}</p>
3114
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3119
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3115
3120
  <formly-validation-message [field]="field"></formly-validation-message>
3116
3121
  </div>
3117
3122
  <div class="wrapper__fields">
@@ -3144,7 +3149,7 @@ class GioFjsArrayTypeComponent extends FieldArrayType {
3144
3149
  }
3145
3150
  GioFjsArrayTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3146
3151
  GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioFjsArrayTypeComponent, selector: "gio-fjs-array-type", usesInheritance: true, ngImport: i0, template: `
3147
- <div class="wrapper">
3152
+ <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3148
3153
  <div class="wrapper__header">
3149
3154
  <div class="wrapper__header__text">
3150
3155
  <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
@@ -3157,11 +3162,11 @@ GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
3157
3162
  </div>
3158
3163
  </div>
3159
3164
 
3160
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3165
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3161
3166
  <formly-validation-message [field]="field"></formly-validation-message>
3162
3167
  </div>
3163
3168
 
3164
- <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3169
+ <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3165
3170
  <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3166
3171
  <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3167
3172
  <div class="wrapper__rows__row__remove">
@@ -3176,11 +3181,11 @@ GioFjsArrayTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
3176
3181
  </div>
3177
3182
  </div>
3178
3183
  </div>
3179
- `, isInline: true, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.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"] }] });
3184
+ `, 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"] }] });
3180
3185
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsArrayTypeComponent, decorators: [{
3181
3186
  type: Component,
3182
3187
  args: [{ selector: 'gio-fjs-array-type', template: `
3183
- <div class="wrapper">
3188
+ <div class="wrapper" [class.error]="formControl.touched && formControl.invalid">
3184
3189
  <div class="wrapper__header">
3185
3190
  <div class="wrapper__header__text">
3186
3191
  <div class="wrapper__header__text__title" *ngIf="to.label">{{ to.label }}</div>
@@ -3193,11 +3198,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3193
3198
  </div>
3194
3199
  </div>
3195
3200
 
3196
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3201
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3197
3202
  <formly-validation-message [field]="field"></formly-validation-message>
3198
3203
  </div>
3199
3204
 
3200
- <div *ngIf="!collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3205
+ <div [hidden]="collapse" class="wrapper__rows" [class.collapse-open]="collapse" [class.collapse-close]="!collapse">
3201
3206
  <div *ngFor="let field of field.fieldGroup; let i = index" class="wrapper__rows__row">
3202
3207
  <formly-field class="wrapper__rows__row__field" [field]="field"></formly-field>
3203
3208
  <div class="wrapper__rows__row__remove">
@@ -3212,7 +3217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3212
3217
  </div>
3213
3218
  </div>
3214
3219
  </div>
3215
- `, styles: [".wrapper{padding:8px;border:1px solid #d3d5dc;border-radius:8px}.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"] }]
3220
+ `, 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"] }]
3216
3221
  }] });
3217
3222
 
3218
3223
  function minItemsValidationMessage(error, field) {
@@ -3319,7 +3324,7 @@ GioFjsMultiSchemaTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
3319
3324
  <div class="wrapper">
3320
3325
  <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3321
3326
  <p *ngIf="props.description">{{ props.description }}</p>
3322
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3327
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3323
3328
  <formly-validation-message [field]="field"></formly-validation-message>
3324
3329
  </div>
3325
3330
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
@@ -3331,7 +3336,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3331
3336
  <div class="wrapper">
3332
3337
  <div class="wrapper__title" *ngIf="props.label">{{ props.label }}</div>
3333
3338
  <p *ngIf="props.description">{{ props.description }}</p>
3334
- <div class="wrapper__error" *ngIf="showError && formControl.errors">
3339
+ <div class="wrapper__error gio-ng-invalid" *ngIf="showError && formControl.errors">
3335
3340
  <formly-validation-message [field]="field"></formly-validation-message>
3336
3341
  </div>
3337
3342
  <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>
@@ -3619,6 +3624,551 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3619
3624
  }]
3620
3625
  }] });
3621
3626
 
3627
+ /*
3628
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3629
+ *
3630
+ * Licensed under the Apache License, Version 2.0 (the "License");
3631
+ * you may not use this file except in compliance with the License.
3632
+ * You may obtain a copy of the License at
3633
+ *
3634
+ * http://www.apache.org/licenses/LICENSE-2.0
3635
+ *
3636
+ * Unless required by applicable law or agreed to in writing, software
3637
+ * distributed under the License is distributed on an "AS IS" BASIS,
3638
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3639
+ * See the License for the specific language governing permissions and
3640
+ * limitations under the License.
3641
+ */
3642
+ class GioFormFocusInvalidDirective {
3643
+ constructor(renderer, formGroupDirective) {
3644
+ this.renderer = renderer;
3645
+ this.formGroupDirective = formGroupDirective;
3646
+ }
3647
+ onFormSubmit() {
3648
+ const selector = '.ng-invalid[formControlName],input.ng-invalid,mat-select.ng-invalid,textarea.ng-invalid,.gio-ng-invalid';
3649
+ try {
3650
+ let invalidControl = this.renderer.selectRootElement(selector, true);
3651
+ // If the form is a GioFormJsonSchema, we need to focus the first invalid control inside
3652
+ if (invalidControl.tagName === 'GIO-FORM-JSON-SCHEMA') {
3653
+ invalidControl = invalidControl.querySelector(selector);
3654
+ }
3655
+ if (invalidControl) {
3656
+ // Mark all controls as touched to display errors
3657
+ if (this.formGroupDirective) {
3658
+ this.formGroupDirective.control.markAllAsTouched();
3659
+ this.formGroupDirective.control.updateValueAndValidity();
3660
+ }
3661
+ invalidControl.scrollIntoView({ behavior: 'smooth', block: 'center' });
3662
+ invalidControl.focus({ preventScroll: true });
3663
+ }
3664
+ }
3665
+ catch (error) {
3666
+ // Best effort. If the focus doesn't work it's not very important
3667
+ // 🧪 Useful to avoid som error in tests
3668
+ }
3669
+ }
3670
+ }
3671
+ GioFormFocusInvalidDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidDirective, deps: [{ token: i0.Renderer2 }, { token: i7.FormGroupDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3672
+ GioFormFocusInvalidDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioFormFocusInvalidDirective, selector: "form[gioFormFocusInvalid]", host: { listeners: { "submit": "onFormSubmit()" } }, ngImport: i0 });
3673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidDirective, decorators: [{
3674
+ type: Directive,
3675
+ args: [{
3676
+ selector: 'form[gioFormFocusInvalid]',
3677
+ }]
3678
+ }], ctorParameters: function () {
3679
+ return [{ type: i0.Renderer2 }, { type: i7.FormGroupDirective, decorators: [{
3680
+ type: Optional
3681
+ }] }];
3682
+ }, propDecorators: { onFormSubmit: [{
3683
+ type: HostListener,
3684
+ args: ['submit']
3685
+ }] } });
3686
+
3687
+ /*
3688
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3689
+ *
3690
+ * Licensed under the Apache License, Version 2.0 (the "License");
3691
+ * you may not use this file except in compliance with the License.
3692
+ * You may obtain a copy of the License at
3693
+ *
3694
+ * http://www.apache.org/licenses/LICENSE-2.0
3695
+ *
3696
+ * Unless required by applicable law or agreed to in writing, software
3697
+ * distributed under the License is distributed on an "AS IS" BASIS,
3698
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3699
+ * See the License for the specific language governing permissions and
3700
+ * limitations under the License.
3701
+ */
3702
+ class GioFormFocusInvalidModule {
3703
+ }
3704
+ GioFormFocusInvalidModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3705
+ GioFormFocusInvalidModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, declarations: [GioFormFocusInvalidDirective], exports: [GioFormFocusInvalidDirective] });
3706
+ GioFormFocusInvalidModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule });
3707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFormFocusInvalidModule, decorators: [{
3708
+ type: NgModule,
3709
+ args: [{
3710
+ declarations: [GioFormFocusInvalidDirective],
3711
+ exports: [GioFormFocusInvalidDirective],
3712
+ }]
3713
+ }] });
3714
+
3715
+ /*
3716
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3717
+ *
3718
+ * Licensed under the Apache License, Version 2.0 (the "License");
3719
+ * you may not use this file except in compliance with the License.
3720
+ * You may obtain a copy of the License at
3721
+ *
3722
+ * http://www.apache.org/licenses/LICENSE-2.0
3723
+ *
3724
+ * Unless required by applicable law or agreed to in writing, software
3725
+ * distributed under the License is distributed on an "AS IS" BASIS,
3726
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3727
+ * See the License for the specific language governing permissions and
3728
+ * limitations under the License.
3729
+ */
3730
+ const GIO_MONACO_EDITOR_CONFIG = new InjectionToken('gio-monaco-editor-config');
3731
+
3732
+ /*
3733
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3734
+ *
3735
+ * Licensed under the Apache License, Version 2.0 (the "License");
3736
+ * you may not use this file except in compliance with the License.
3737
+ * You may obtain a copy of the License at
3738
+ *
3739
+ * http://www.apache.org/licenses/LICENSE-2.0
3740
+ *
3741
+ * Unless required by applicable law or agreed to in writing, software
3742
+ * distributed under the License is distributed on an "AS IS" BASIS,
3743
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3744
+ * See the License for the specific language governing permissions and
3745
+ * limitations under the License.
3746
+ */
3747
+ class GioMonacoEditorService {
3748
+ constructor() {
3749
+ this.loaded$ = new ReplaySubject(1);
3750
+ this.loaded = false;
3751
+ }
3752
+ loadEditor() {
3753
+ if (this.loaded) {
3754
+ // Already loaded, do nothing.
3755
+ return Promise.resolve();
3756
+ }
3757
+ this.loaded = true;
3758
+ return new Promise(resolve => {
3759
+ // Monaco is already loaded
3760
+ if (typeof window.monaco === 'object') {
3761
+ resolve();
3762
+ return;
3763
+ }
3764
+ const onGotAmdLoader = () => {
3765
+ // Load Monaco
3766
+ window.require.config({ paths: { vs: 'assets/monaco-editor/min/vs' } });
3767
+ window.require(['vs/editor/editor.main'], () => {
3768
+ resolve();
3769
+ });
3770
+ };
3771
+ // Load AMD loader if necessary
3772
+ if (!window.require) {
3773
+ const loaderScript = document.createElement('script');
3774
+ loaderScript.type = 'text/javascript';
3775
+ loaderScript.src = 'assets/monaco-editor/min/vs/loader.js';
3776
+ loaderScript.addEventListener('load', onGotAmdLoader);
3777
+ document.body.appendChild(loaderScript);
3778
+ }
3779
+ else {
3780
+ onGotAmdLoader();
3781
+ }
3782
+ }).then(() => {
3783
+ this.loaded$.next({ monaco: window.monaco });
3784
+ });
3785
+ }
3786
+ }
3787
+ GioMonacoEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3788
+ GioMonacoEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, providedIn: 'root' });
3789
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, decorators: [{
3790
+ type: Injectable,
3791
+ args: [{
3792
+ providedIn: 'root',
3793
+ }]
3794
+ }] });
3795
+
3796
+ /*
3797
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3798
+ *
3799
+ * Licensed under the Apache License, Version 2.0 (the "License");
3800
+ * you may not use this file except in compliance with the License.
3801
+ * You may obtain a copy of the License at
3802
+ *
3803
+ * http://www.apache.org/licenses/LICENSE-2.0
3804
+ *
3805
+ * Unless required by applicable law or agreed to in writing, software
3806
+ * distributed under the License is distributed on an "AS IS" BASIS,
3807
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3808
+ * See the License for the specific language governing permissions and
3809
+ * limitations under the License.
3810
+ */
3811
+ class GioLanguageJsonService {
3812
+ constructor(codeEditorService) {
3813
+ this.unsubscribe$ = new Subject();
3814
+ codeEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(event => {
3815
+ this.setup(event.monaco);
3816
+ });
3817
+ }
3818
+ ngOnDestroy() {
3819
+ this.unsubscribe$.next();
3820
+ this.unsubscribe$.complete();
3821
+ }
3822
+ setup(monaco) {
3823
+ if (!monaco) {
3824
+ throw new Error('Monaco is not loaded');
3825
+ }
3826
+ this.monaco = monaco;
3827
+ const defaults = monaco.languages.json.jsonDefaults;
3828
+ defaults.setDiagnosticsOptions({
3829
+ validate: true,
3830
+ allowComments: true,
3831
+ });
3832
+ }
3833
+ addSchemas(id, definitions = []) {
3834
+ if (!this.monaco) {
3835
+ throw new Error('Monaco is not loaded');
3836
+ }
3837
+ const defaults = this.monaco.languages.json.jsonDefaults;
3838
+ const options = defaults.diagnosticsOptions;
3839
+ let schemas = definitions.map(({ uri, schema }) => ({
3840
+ uri,
3841
+ schema,
3842
+ fileMatch: [id || '*.json'],
3843
+ }));
3844
+ if (options && options.schemas && options.schemas.length > 0) {
3845
+ schemas = [...options.schemas, ...schemas];
3846
+ }
3847
+ defaults.setDiagnosticsOptions(Object.assign(Object.assign({}, options), { schemas: schemas }));
3848
+ }
3849
+ }
3850
+ GioLanguageJsonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, deps: [{ token: GioMonacoEditorService }], target: i0.ɵɵFactoryTarget.Injectable });
3851
+ GioLanguageJsonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, providedIn: 'root' });
3852
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, decorators: [{
3853
+ type: Injectable,
3854
+ args: [{
3855
+ providedIn: 'root',
3856
+ }]
3857
+ }], ctorParameters: function () { return [{ type: GioMonacoEditorService }]; } });
3858
+
3859
+ /*
3860
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
3861
+ *
3862
+ * Licensed under the Apache License, Version 2.0 (the "License");
3863
+ * you may not use this file except in compliance with the License.
3864
+ * You may obtain a copy of the License at
3865
+ *
3866
+ * http://www.apache.org/licenses/LICENSE-2.0
3867
+ *
3868
+ * Unless required by applicable law or agreed to in writing, software
3869
+ * distributed under the License is distributed on an "AS IS" BASIS,
3870
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3871
+ * See the License for the specific language governing permissions and
3872
+ * limitations under the License.
3873
+ */
3874
+ class GioMonacoEditorComponent {
3875
+ constructor(config, monacoEditorService, languageJsonService, hostElement, changeDetectorRef, ngZone) {
3876
+ this.config = config;
3877
+ this.monacoEditorService = monacoEditorService;
3878
+ this.languageJsonService = languageJsonService;
3879
+ this.hostElement = hostElement;
3880
+ this.changeDetectorRef = changeDetectorRef;
3881
+ this.ngZone = ngZone;
3882
+ this.options = {};
3883
+ this.id = uniqueId('gio-monaco-editor-');
3884
+ this.loading = true;
3885
+ this.defaultOptions = {
3886
+ contextmenu: false,
3887
+ minimap: {
3888
+ enabled: true,
3889
+ },
3890
+ automaticLayout: true,
3891
+ scrollBeyondLastLine: false,
3892
+ };
3893
+ this.value = '';
3894
+ this.readOnly = false;
3895
+ this._onChange = () => ({});
3896
+ this._onTouched = () => ({});
3897
+ this.unsubscribe$ = new Subject();
3898
+ this.monacoEditorService.loadEditor();
3899
+ }
3900
+ ngAfterViewInit() {
3901
+ // Wait until monaco editor is available
3902
+ this.monacoEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(({ monaco }) => {
3903
+ this.setupEditor(monaco);
3904
+ this.loading = false;
3905
+ this.changeDetectorRef.detectChanges();
3906
+ });
3907
+ }
3908
+ ngOnDestroy() {
3909
+ if (this.standaloneCodeEditor) {
3910
+ this.standaloneCodeEditor.dispose();
3911
+ this.standaloneCodeEditor = undefined;
3912
+ }
3913
+ if (this.textModel) {
3914
+ this.textModel.dispose();
3915
+ this.textModel = undefined;
3916
+ }
3917
+ this.unsubscribe$.next();
3918
+ this.unsubscribe$.complete();
3919
+ }
3920
+ // From ControlValueAccessor interface
3921
+ writeValue(_value) {
3922
+ if (_value) {
3923
+ this.value = _value;
3924
+ }
3925
+ if (this.textModel) {
3926
+ this.textModel.setValue(this.value);
3927
+ }
3928
+ }
3929
+ // From ControlValueAccessor interface
3930
+ registerOnChange(fn) {
3931
+ this._onChange = fn;
3932
+ }
3933
+ // From ControlValueAccessor interface
3934
+ registerOnTouched(fn) {
3935
+ this._onTouched = fn;
3936
+ }
3937
+ // From ControlValueAccessor interface
3938
+ setDisabledState(isDisabled) {
3939
+ this.readOnly = isDisabled;
3940
+ }
3941
+ setupEditor(monaco) {
3942
+ var _a, _b, _c, _d, _e;
3943
+ if (!this.hostElement) {
3944
+ throw new Error('No editor ref found.');
3945
+ }
3946
+ const domElement = this.hostElement.nativeElement;
3947
+ const settings = {
3948
+ value: this.value,
3949
+ language: (_b = (_a = this.languageConfig) === null || _a === void 0 ? void 0 : _a.language) !== null && _b !== void 0 ? _b : 'text',
3950
+ uri: `code-${uniqueId()}`,
3951
+ };
3952
+ this.ngZone.runOutsideAngular(() => {
3953
+ this.textModel = monaco.editor.createModel(settings.value, settings.language, monaco.Uri.parse(settings.uri));
3954
+ });
3955
+ const options = Object.assign({}, this.defaultOptions, this.options, {
3956
+ readOnly: this.readOnly,
3957
+ theme: (_c = this.config.theme) !== null && _c !== void 0 ? _c : 'vs',
3958
+ model: this.textModel,
3959
+ });
3960
+ this.standaloneCodeEditor = monaco.editor.create(domElement, Object.assign({}, options));
3961
+ (_d = this.textModel) === null || _d === void 0 ? void 0 : _d.onDidChangeContent(() => {
3962
+ var _a;
3963
+ const newValue = (_a = this.textModel) === null || _a === void 0 ? void 0 : _a.getValue();
3964
+ this.ngZone.run(() => {
3965
+ newValue && this._onChange(newValue);
3966
+ this._onTouched();
3967
+ });
3968
+ });
3969
+ (_e = this.standaloneCodeEditor) === null || _e === void 0 ? void 0 : _e.onDidBlurEditorWidget(() => {
3970
+ this.ngZone.run(() => {
3971
+ this._onTouched();
3972
+ });
3973
+ });
3974
+ this.setupLanguage(settings.uri, this.languageConfig);
3975
+ }
3976
+ setupLanguage(uri, languageConfig) {
3977
+ if (!languageConfig) {
3978
+ return;
3979
+ }
3980
+ const { language } = languageConfig;
3981
+ if (language) {
3982
+ const lang = language.toLowerCase();
3983
+ switch (lang) {
3984
+ case 'json':
3985
+ if (languageConfig.schemas) {
3986
+ this.languageJsonService.addSchemas(uri, languageConfig.schemas);
3987
+ }
3988
+ break;
3989
+ default:
3990
+ break;
3991
+ }
3992
+ }
3993
+ }
3994
+ }
3995
+ 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 });
3996
+ GioMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorComponent, selector: "gio-monaco-editor", inputs: { languageConfig: "languageConfig", options: "options" }, providers: [
3997
+ {
3998
+ provide: NG_VALUE_ACCESSOR,
3999
+ useExisting: forwardRef(() => GioMonacoEditorComponent),
4000
+ multi: true,
4001
+ },
4002
+ ], 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"] }] });
4003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, decorators: [{
4004
+ type: Component,
4005
+ args: [{ selector: 'gio-monaco-editor', template: ` <div *ngIf="loading">Loading...</div>`, providers: [
4006
+ {
4007
+ provide: NG_VALUE_ACCESSOR,
4008
+ useExisting: forwardRef(() => GioMonacoEditorComponent),
4009
+ multi: true,
4010
+ },
4011
+ ], styles: [":host{display:block;height:100%;min-height:150px}\n"] }]
4012
+ }], ctorParameters: function () {
4013
+ return [{ type: undefined, decorators: [{
4014
+ type: Inject,
4015
+ args: [GIO_MONACO_EDITOR_CONFIG]
4016
+ }] }, { type: GioMonacoEditorService }, { type: GioLanguageJsonService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }];
4017
+ }, propDecorators: { languageConfig: [{
4018
+ type: Input
4019
+ }], options: [{
4020
+ type: Input
4021
+ }] } });
4022
+
4023
+ /*
4024
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
4025
+ *
4026
+ * Licensed under the Apache License, Version 2.0 (the "License");
4027
+ * you may not use this file except in compliance with the License.
4028
+ * You may obtain a copy of the License at
4029
+ *
4030
+ * http://www.apache.org/licenses/LICENSE-2.0
4031
+ *
4032
+ * Unless required by applicable law or agreed to in writing, software
4033
+ * distributed under the License is distributed on an "AS IS" BASIS,
4034
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4035
+ * See the License for the specific language governing permissions and
4036
+ * limitations under the License.
4037
+ */
4038
+ class GioMonacoEditorModule {
4039
+ static forRoot(config) {
4040
+ return {
4041
+ ngModule: GioMonacoEditorModule,
4042
+ providers: [
4043
+ {
4044
+ provide: GIO_MONACO_EDITOR_CONFIG,
4045
+ useValue: config,
4046
+ },
4047
+ ],
4048
+ };
4049
+ }
4050
+ }
4051
+ GioMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4052
+ GioMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, declarations: [GioMonacoEditorComponent], imports: [CommonModule, HttpClientModule, ReactiveFormsModule], exports: [GioMonacoEditorComponent] });
4053
+ GioMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, providers: [
4054
+ {
4055
+ provide: GIO_MONACO_EDITOR_CONFIG,
4056
+ useValue: {},
4057
+ },
4058
+ ], imports: [[CommonModule, HttpClientModule, ReactiveFormsModule]] });
4059
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, decorators: [{
4060
+ type: NgModule,
4061
+ args: [{
4062
+ imports: [CommonModule, HttpClientModule, ReactiveFormsModule],
4063
+ declarations: [GioMonacoEditorComponent],
4064
+ exports: [GioMonacoEditorComponent],
4065
+ providers: [
4066
+ {
4067
+ provide: GIO_MONACO_EDITOR_CONFIG,
4068
+ useValue: {},
4069
+ },
4070
+ ],
4071
+ }]
4072
+ }] });
4073
+
4074
+ /*
4075
+ * Copyright (C) 2023 The Gravitee team (http://gravitee.io)
4076
+ *
4077
+ * Licensed under the Apache License, Version 2.0 (the "License");
4078
+ * you may not use this file except in compliance with the License.
4079
+ * You may obtain a copy of the License at
4080
+ *
4081
+ * http://www.apache.org/licenses/LICENSE-2.0
4082
+ *
4083
+ * Unless required by applicable law or agreed to in writing, software
4084
+ * distributed under the License is distributed on an "AS IS" BASIS,
4085
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4086
+ * See the License for the specific language governing permissions and
4087
+ * limitations under the License.
4088
+ */
4089
+ /**
4090
+ * This component is used to test the GioMonacoEditorComponent.
4091
+ * This component simulates monaco editor with a simple input.
4092
+ */
4093
+ class GioMonacoEditorTestingComponent extends GioMonacoEditorComponent {
4094
+ get getValue() {
4095
+ return this.value;
4096
+ }
4097
+ changeValue(value) {
4098
+ this._onTouched();
4099
+ this._onChange(value);
4100
+ }
4101
+ }
4102
+ GioMonacoEditorTestingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4103
+ GioMonacoEditorTestingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorTestingComponent, selector: "gio-monaco-editor", providers: [
4104
+ {
4105
+ provide: NG_VALUE_ACCESSOR,
4106
+ useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
4107
+ multi: true,
4108
+ },
4109
+ ], usesInheritance: true, ngImport: i0, template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />', isInline: true });
4110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, decorators: [{
4111
+ type: Component,
4112
+ args: [{
4113
+ selector: 'gio-monaco-editor',
4114
+ template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />',
4115
+ providers: [
4116
+ {
4117
+ provide: NG_VALUE_ACCESSOR,
4118
+ useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
4119
+ multi: true,
4120
+ },
4121
+ ],
4122
+ }]
4123
+ }] });
4124
+
4125
+ // Hack to replace the default gio-monaco-editor component with fake one for testing purpose.
4126
+ try {
4127
+ TestBed.overrideModule(GioMonacoEditorModule, {
4128
+ remove: {
4129
+ declarations: [GioMonacoEditorComponent],
4130
+ exports: [GioMonacoEditorComponent],
4131
+ },
4132
+ add: {
4133
+ declarations: [GioMonacoEditorTestingComponent],
4134
+ exports: [GioMonacoEditorTestingComponent],
4135
+ },
4136
+ });
4137
+ }
4138
+ catch (e) {
4139
+ // Do nothing
4140
+ }
4141
+ class GioMonacoEditorHarness extends ComponentHarness {
4142
+ constructor() {
4143
+ super(...arguments);
4144
+ this.getInputEl = this.locatorFor('input');
4145
+ }
4146
+ /**
4147
+ * Gets a `HarnessPredicate` that can be used to search for a `GioMonacoEditorHarness` that meets
4148
+ * certain criteria.
4149
+ *
4150
+ * @param options Options for filtering which input instances are considered a match.
4151
+ * @return a `HarnessPredicate` configured with the given options.
4152
+ */
4153
+ static with(options = {}) {
4154
+ return new HarnessPredicate(GioMonacoEditorHarness, options);
4155
+ }
4156
+ setValue(value) {
4157
+ return __awaiter(this, void 0, void 0, function* () {
4158
+ const inputEl = yield this.getInputEl();
4159
+ yield inputEl.clear();
4160
+ yield inputEl.sendKeys(value);
4161
+ });
4162
+ }
4163
+ getValue() {
4164
+ return __awaiter(this, void 0, void 0, function* () {
4165
+ const inputEl = yield this.getInputEl();
4166
+ return inputEl.getProperty('value');
4167
+ });
4168
+ }
4169
+ }
4170
+ GioMonacoEditorHarness.hostSelector = 'gio-monaco-editor';
4171
+
3622
4172
  /*
3623
4173
  * Copyright (C) 2021 The Gravitee team (http://gravitee.io)
3624
4174
  *
@@ -3655,5 +4205,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
3655
4205
  * Generated bundle index. Do not edit.
3656
4206
  */
3657
4207
 
3658
- export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
4208
+ export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, 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 };
3659
4209
  //# sourceMappingURL=gravitee-ui-particles-angular.mjs.map