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