@gravitee/ui-particles-angular 5.20.1 → 5.21.0

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