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