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