@gravitee/ui-particles-angular 5.13.0 → 5.14.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/esm2020/lib/gio-form-json-schema/model/GioJsonSchema.mjs +1 -1
- package/esm2020/lib/gio-form-json-schema/type-component/object-type.component.mjs +2 -2
- package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.component.mjs +172 -0
- package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.harness.mjs +63 -0
- package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.module.mjs +58 -0
- package/esm2020/lib/gio-monaco-editor/gio-monaco-editor.testing.component.mjs +55 -0
- package/esm2020/lib/gio-monaco-editor/models/GioMonacoEditorConfig.mjs +18 -0
- package/esm2020/lib/gio-monaco-editor/models/MonacoEditorTheme.mjs +2 -0
- package/esm2020/lib/gio-monaco-editor/services/gio-language-json.service.mjs +71 -0
- package/esm2020/lib/gio-monaco-editor/services/gio-monaco-editor.service.mjs +67 -0
- package/esm2020/lib/public-api.mjs +4 -1
- package/fesm2015/gravitee-ui-particles-angular.mjs +464 -6
- package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-particles-angular.mjs +476 -6
- package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-form-json-schema/model/GioJsonSchema.d.ts +17 -11
- package/lib/gio-monaco-editor/gio-monaco-editor.component.d.ts +45 -0
- package/lib/gio-monaco-editor/gio-monaco-editor.harness.d.ts +16 -0
- package/lib/gio-monaco-editor/gio-monaco-editor.module.d.ts +18 -0
- package/lib/gio-monaco-editor/gio-monaco-editor.testing.component.d.ts +12 -0
- package/lib/gio-monaco-editor/models/GioMonacoEditorConfig.d.ts +6 -0
- package/lib/gio-monaco-editor/models/MonacoEditorTheme.d.ts +1 -0
- package/lib/gio-monaco-editor/services/gio-language-json.service.d.ts +17 -0
- package/lib/gio-monaco-editor/services/gio-monaco-editor.service.d.ts +18 -0
- package/lib/public-api.d.ts +3 -0
- package/package.json +1 -1
|
@@ -49,4 +49,7 @@ export * from './gio-form-slide-toogle/gio-form-slide-toggle.module';
|
|
|
49
49
|
export * from './gio-form-slide-toogle/gio-form-label.directive';
|
|
50
50
|
export * from './gio-form-focus-first-invalid/gio-form-focus-first-invalid.directive';
|
|
51
51
|
export * from './gio-form-focus-first-invalid/gio-form-focus-first-invalid.module';
|
|
52
|
-
|
|
52
|
+
export * from './gio-monaco-editor/gio-monaco-editor.component';
|
|
53
|
+
export * from './gio-monaco-editor/gio-monaco-editor.module';
|
|
54
|
+
export * from './gio-monaco-editor/gio-monaco-editor.harness';
|
|
55
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3VpLXBhcnRpY2xlcy1hbmd1bGFyL3NyYy9saWIvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7R0FjRztBQUNIOztHQUVHO0FBRUgsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMscUNBQXFDLENBQUM7QUFFcEQsY0FBYyxxREFBcUQsQ0FBQztBQUNwRSxjQUFjLGtEQUFrRCxDQUFDO0FBQ2pFLGNBQWMsbURBQW1ELENBQUM7QUFFbEUsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLGdDQUFnQyxDQUFDO0FBRS9DLGNBQWMsbURBQW1ELENBQUM7QUFDbEUsY0FBYyxnREFBZ0QsQ0FBQztBQUMvRCxjQUFjLGlEQUFpRCxDQUFDO0FBRWhFLGNBQWMsNkVBQTZFLENBQUM7QUFDNUYsY0FBYywwRUFBMEUsQ0FBQztBQUN6RixjQUFjLDJFQUEyR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ZpcnN0LWludmFsaWQubW9kdWxlJztcblxuZXhwb3J0ICogZnJvbSAnLi9naW8tbW9uYWNvLWVkaXRvci9naW8tbW9uYWNvLWVkaXRvci5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9naW8tbW9uYWNvLWVkaXRvci9naW8tbW9uYWNvLWVkaXRvci5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9naW8tbW9uYWNvLWVkaXRvci9naW8tbW9uYWNvLWVkaXRvci5oYXJuZXNzJztcbiJdfQ==
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild } from '@angular/core';
|
|
4
|
-
import { timer, Subject, fromEvent, of, BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, Optional, Self, ViewChild, Directive, Inject, forwardRef, ChangeDetectionStrategy, Injectable, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken } from '@angular/core';
|
|
4
|
+
import { timer, Subject, fromEvent, of, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/material/card';
|
|
6
6
|
import { MatCardModule } from '@angular/material/card';
|
|
7
7
|
import * as i2 from '@angular/material/button';
|
|
@@ -13,7 +13,7 @@ import { ComponentHarness, HarnessPredicate, parallel, TestKey } from '@angular/
|
|
|
13
13
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
14
14
|
import * as i3$1 from '@angular/material/form-field';
|
|
15
15
|
import { MatFormFieldControl, MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
|
|
16
|
-
import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set } from 'lodash';
|
|
16
|
+
import { isEmpty, toLower, dropRight, isNil, isArray, remove, isObject, cloneDeep, set, uniqueId } from 'lodash';
|
|
17
17
|
import { startWith, map, distinctUntilChanged, tap, debounce, takeUntil, delay, filter, switchMap } from 'rxjs/operators';
|
|
18
18
|
import * as i7 from '@angular/forms';
|
|
19
19
|
import { FormsModule, FormArray, FormGroup, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
@@ -50,6 +50,7 @@ import { FieldType, FieldArrayType, FieldWrapper, FormlyModule } from '@ngx-form
|
|
|
50
50
|
import { FormlyMaterialModule } from '@ngx-formly/material';
|
|
51
51
|
import * as i3$2 from '@angular/material/slide-toggle';
|
|
52
52
|
import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
53
|
+
import { TestBed } from '@angular/core/testing';
|
|
53
54
|
|
|
54
55
|
/*
|
|
55
56
|
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
@@ -3108,7 +3109,7 @@ GioFjsObjectTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
3108
3109
|
<formly-field *ngFor="let f of field.fieldGroup" class="wrapper__fields__field" [field]="f"></formly-field>
|
|
3109
3110
|
</div>
|
|
3110
3111
|
</div>
|
|
3111
|
-
`, 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: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"] }] });
|
|
3112
|
+
`, 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"] }] });
|
|
3112
3113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioFjsObjectTypeComponent, decorators: [{
|
|
3113
3114
|
type: Component,
|
|
3114
3115
|
args: [{ selector: 'gio-fjs-object-type', template: `
|
|
@@ -3122,7 +3123,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3122
3123
|
<formly-field *ngFor="let f of field.fieldGroup" class="wrapper__fields__field" [field]="f"></formly-field>
|
|
3123
3124
|
</div>
|
|
3124
3125
|
</div>
|
|
3125
|
-
`, 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: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"] }]
|
|
3126
|
+
`, 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"] }]
|
|
3126
3127
|
}] });
|
|
3127
3128
|
|
|
3128
3129
|
/*
|
|
@@ -3711,6 +3712,463 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3711
3712
|
}]
|
|
3712
3713
|
}] });
|
|
3713
3714
|
|
|
3715
|
+
/*
|
|
3716
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3717
|
+
*
|
|
3718
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3719
|
+
* you may not use this file except in compliance with the License.
|
|
3720
|
+
* You may obtain a copy of the License at
|
|
3721
|
+
*
|
|
3722
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3723
|
+
*
|
|
3724
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3725
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3726
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3727
|
+
* See the License for the specific language governing permissions and
|
|
3728
|
+
* limitations under the License.
|
|
3729
|
+
*/
|
|
3730
|
+
const GIO_MONACO_EDITOR_CONFIG = new InjectionToken('gio-monaco-editor-config');
|
|
3731
|
+
|
|
3732
|
+
/*
|
|
3733
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3734
|
+
*
|
|
3735
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3736
|
+
* you may not use this file except in compliance with the License.
|
|
3737
|
+
* You may obtain a copy of the License at
|
|
3738
|
+
*
|
|
3739
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3740
|
+
*
|
|
3741
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3742
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3743
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3744
|
+
* See the License for the specific language governing permissions and
|
|
3745
|
+
* limitations under the License.
|
|
3746
|
+
*/
|
|
3747
|
+
class GioMonacoEditorService {
|
|
3748
|
+
constructor() {
|
|
3749
|
+
this.loaded$ = new ReplaySubject(1);
|
|
3750
|
+
this.loaded = false;
|
|
3751
|
+
}
|
|
3752
|
+
loadEditor() {
|
|
3753
|
+
if (this.loaded) {
|
|
3754
|
+
// Already loaded, do nothing.
|
|
3755
|
+
return Promise.resolve();
|
|
3756
|
+
}
|
|
3757
|
+
this.loaded = true;
|
|
3758
|
+
return new Promise(resolve => {
|
|
3759
|
+
// Monaco is already loaded
|
|
3760
|
+
if (typeof window.monaco === 'object') {
|
|
3761
|
+
resolve();
|
|
3762
|
+
return;
|
|
3763
|
+
}
|
|
3764
|
+
const onGotAmdLoader = () => {
|
|
3765
|
+
// Load Monaco
|
|
3766
|
+
window.require.config({ paths: { vs: 'assets/monaco-editor/min/vs' } });
|
|
3767
|
+
window.require(['vs/editor/editor.main'], () => {
|
|
3768
|
+
resolve();
|
|
3769
|
+
});
|
|
3770
|
+
};
|
|
3771
|
+
// Load AMD loader if necessary
|
|
3772
|
+
if (!window.require) {
|
|
3773
|
+
const loaderScript = document.createElement('script');
|
|
3774
|
+
loaderScript.type = 'text/javascript';
|
|
3775
|
+
loaderScript.src = 'assets/monaco-editor/min/vs/loader.js';
|
|
3776
|
+
loaderScript.addEventListener('load', onGotAmdLoader);
|
|
3777
|
+
document.body.appendChild(loaderScript);
|
|
3778
|
+
}
|
|
3779
|
+
else {
|
|
3780
|
+
onGotAmdLoader();
|
|
3781
|
+
}
|
|
3782
|
+
}).then(() => {
|
|
3783
|
+
this.loaded$.next({ monaco: window.monaco });
|
|
3784
|
+
});
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
GioMonacoEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3788
|
+
GioMonacoEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, providedIn: 'root' });
|
|
3789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorService, decorators: [{
|
|
3790
|
+
type: Injectable,
|
|
3791
|
+
args: [{
|
|
3792
|
+
providedIn: 'root',
|
|
3793
|
+
}]
|
|
3794
|
+
}] });
|
|
3795
|
+
|
|
3796
|
+
/*
|
|
3797
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3798
|
+
*
|
|
3799
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3800
|
+
* you may not use this file except in compliance with the License.
|
|
3801
|
+
* You may obtain a copy of the License at
|
|
3802
|
+
*
|
|
3803
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3804
|
+
*
|
|
3805
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3806
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3807
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3808
|
+
* See the License for the specific language governing permissions and
|
|
3809
|
+
* limitations under the License.
|
|
3810
|
+
*/
|
|
3811
|
+
class GioLanguageJsonService {
|
|
3812
|
+
constructor(codeEditorService) {
|
|
3813
|
+
this.unsubscribe$ = new Subject();
|
|
3814
|
+
codeEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(event => {
|
|
3815
|
+
this.setup(event.monaco);
|
|
3816
|
+
});
|
|
3817
|
+
}
|
|
3818
|
+
ngOnDestroy() {
|
|
3819
|
+
this.unsubscribe$.next();
|
|
3820
|
+
this.unsubscribe$.complete();
|
|
3821
|
+
}
|
|
3822
|
+
setup(monaco) {
|
|
3823
|
+
if (!monaco) {
|
|
3824
|
+
throw new Error('Monaco is not loaded');
|
|
3825
|
+
}
|
|
3826
|
+
this.monaco = monaco;
|
|
3827
|
+
const defaults = monaco.languages.json.jsonDefaults;
|
|
3828
|
+
defaults.setDiagnosticsOptions({
|
|
3829
|
+
validate: true,
|
|
3830
|
+
allowComments: true,
|
|
3831
|
+
});
|
|
3832
|
+
}
|
|
3833
|
+
addSchemas(id, definitions = []) {
|
|
3834
|
+
if (!this.monaco) {
|
|
3835
|
+
throw new Error('Monaco is not loaded');
|
|
3836
|
+
}
|
|
3837
|
+
const defaults = this.monaco.languages.json.jsonDefaults;
|
|
3838
|
+
const options = defaults.diagnosticsOptions;
|
|
3839
|
+
let schemas = definitions.map(({ uri, schema }) => ({
|
|
3840
|
+
uri,
|
|
3841
|
+
schema,
|
|
3842
|
+
fileMatch: [id || '*.json'],
|
|
3843
|
+
}));
|
|
3844
|
+
if (options && options.schemas && options.schemas.length > 0) {
|
|
3845
|
+
schemas = [...options.schemas, ...schemas];
|
|
3846
|
+
}
|
|
3847
|
+
defaults.setDiagnosticsOptions(Object.assign(Object.assign({}, options), { schemas: schemas }));
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
GioLanguageJsonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, deps: [{ token: GioMonacoEditorService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3851
|
+
GioLanguageJsonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, providedIn: 'root' });
|
|
3852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLanguageJsonService, decorators: [{
|
|
3853
|
+
type: Injectable,
|
|
3854
|
+
args: [{
|
|
3855
|
+
providedIn: 'root',
|
|
3856
|
+
}]
|
|
3857
|
+
}], ctorParameters: function () { return [{ type: GioMonacoEditorService }]; } });
|
|
3858
|
+
|
|
3859
|
+
/*
|
|
3860
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
3861
|
+
*
|
|
3862
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3863
|
+
* you may not use this file except in compliance with the License.
|
|
3864
|
+
* You may obtain a copy of the License at
|
|
3865
|
+
*
|
|
3866
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3867
|
+
*
|
|
3868
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3869
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3870
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3871
|
+
* See the License for the specific language governing permissions and
|
|
3872
|
+
* limitations under the License.
|
|
3873
|
+
*/
|
|
3874
|
+
class GioMonacoEditorComponent {
|
|
3875
|
+
constructor(config, monacoEditorService, languageJsonService, hostElement, changeDetectorRef, ngZone) {
|
|
3876
|
+
this.config = config;
|
|
3877
|
+
this.monacoEditorService = monacoEditorService;
|
|
3878
|
+
this.languageJsonService = languageJsonService;
|
|
3879
|
+
this.hostElement = hostElement;
|
|
3880
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
3881
|
+
this.ngZone = ngZone;
|
|
3882
|
+
this.options = {};
|
|
3883
|
+
this.id = uniqueId('gio-monaco-editor-');
|
|
3884
|
+
this.loading = true;
|
|
3885
|
+
this.defaultOptions = {
|
|
3886
|
+
contextmenu: false,
|
|
3887
|
+
minimap: {
|
|
3888
|
+
enabled: true,
|
|
3889
|
+
},
|
|
3890
|
+
automaticLayout: true,
|
|
3891
|
+
scrollBeyondLastLine: false,
|
|
3892
|
+
};
|
|
3893
|
+
this.value = '';
|
|
3894
|
+
this.readOnly = false;
|
|
3895
|
+
this._onChange = () => ({});
|
|
3896
|
+
this._onTouched = () => ({});
|
|
3897
|
+
this.unsubscribe$ = new Subject();
|
|
3898
|
+
this.monacoEditorService.loadEditor();
|
|
3899
|
+
}
|
|
3900
|
+
ngAfterViewInit() {
|
|
3901
|
+
// Wait until monaco editor is available
|
|
3902
|
+
this.monacoEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(({ monaco }) => {
|
|
3903
|
+
this.setupEditor(monaco);
|
|
3904
|
+
this.loading = false;
|
|
3905
|
+
this.changeDetectorRef.detectChanges();
|
|
3906
|
+
});
|
|
3907
|
+
}
|
|
3908
|
+
ngOnDestroy() {
|
|
3909
|
+
if (this.standaloneCodeEditor) {
|
|
3910
|
+
this.standaloneCodeEditor.dispose();
|
|
3911
|
+
this.standaloneCodeEditor = undefined;
|
|
3912
|
+
}
|
|
3913
|
+
if (this.textModel) {
|
|
3914
|
+
this.textModel.dispose();
|
|
3915
|
+
this.textModel = undefined;
|
|
3916
|
+
}
|
|
3917
|
+
this.unsubscribe$.next();
|
|
3918
|
+
this.unsubscribe$.complete();
|
|
3919
|
+
}
|
|
3920
|
+
// From ControlValueAccessor interface
|
|
3921
|
+
writeValue(_value) {
|
|
3922
|
+
if (_value) {
|
|
3923
|
+
this.value = _value;
|
|
3924
|
+
}
|
|
3925
|
+
if (this.textModel) {
|
|
3926
|
+
this.textModel.setValue(this.value);
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
// From ControlValueAccessor interface
|
|
3930
|
+
registerOnChange(fn) {
|
|
3931
|
+
this._onChange = fn;
|
|
3932
|
+
}
|
|
3933
|
+
// From ControlValueAccessor interface
|
|
3934
|
+
registerOnTouched(fn) {
|
|
3935
|
+
this._onTouched = fn;
|
|
3936
|
+
}
|
|
3937
|
+
// From ControlValueAccessor interface
|
|
3938
|
+
setDisabledState(isDisabled) {
|
|
3939
|
+
this.readOnly = isDisabled;
|
|
3940
|
+
}
|
|
3941
|
+
setupEditor(monaco) {
|
|
3942
|
+
var _a, _b, _c, _d, _e;
|
|
3943
|
+
if (!this.hostElement) {
|
|
3944
|
+
throw new Error('No editor ref found.');
|
|
3945
|
+
}
|
|
3946
|
+
const domElement = this.hostElement.nativeElement;
|
|
3947
|
+
const settings = {
|
|
3948
|
+
value: this.value,
|
|
3949
|
+
language: (_b = (_a = this.languageConfig) === null || _a === void 0 ? void 0 : _a.language) !== null && _b !== void 0 ? _b : 'text',
|
|
3950
|
+
uri: `code-${uniqueId()}`,
|
|
3951
|
+
};
|
|
3952
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3953
|
+
this.textModel = monaco.editor.createModel(settings.value, settings.language, monaco.Uri.parse(settings.uri));
|
|
3954
|
+
});
|
|
3955
|
+
const options = Object.assign({}, this.defaultOptions, this.options, {
|
|
3956
|
+
readOnly: this.readOnly,
|
|
3957
|
+
theme: (_c = this.config.theme) !== null && _c !== void 0 ? _c : 'vs',
|
|
3958
|
+
model: this.textModel,
|
|
3959
|
+
});
|
|
3960
|
+
this.standaloneCodeEditor = monaco.editor.create(domElement, Object.assign({}, options));
|
|
3961
|
+
(_d = this.textModel) === null || _d === void 0 ? void 0 : _d.onDidChangeContent(() => {
|
|
3962
|
+
var _a;
|
|
3963
|
+
const newValue = (_a = this.textModel) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
3964
|
+
this.ngZone.run(() => {
|
|
3965
|
+
newValue && this._onChange(newValue);
|
|
3966
|
+
this._onTouched();
|
|
3967
|
+
});
|
|
3968
|
+
});
|
|
3969
|
+
(_e = this.standaloneCodeEditor) === null || _e === void 0 ? void 0 : _e.onDidBlurEditorWidget(() => {
|
|
3970
|
+
this.ngZone.run(() => {
|
|
3971
|
+
this._onTouched();
|
|
3972
|
+
});
|
|
3973
|
+
});
|
|
3974
|
+
this.setupLanguage(settings.uri, this.languageConfig);
|
|
3975
|
+
}
|
|
3976
|
+
setupLanguage(uri, languageConfig) {
|
|
3977
|
+
if (!languageConfig) {
|
|
3978
|
+
return;
|
|
3979
|
+
}
|
|
3980
|
+
const { language } = languageConfig;
|
|
3981
|
+
if (language) {
|
|
3982
|
+
const lang = language.toLowerCase();
|
|
3983
|
+
switch (lang) {
|
|
3984
|
+
case 'json':
|
|
3985
|
+
if (languageConfig.schemas) {
|
|
3986
|
+
this.languageJsonService.addSchemas(uri, languageConfig.schemas);
|
|
3987
|
+
}
|
|
3988
|
+
break;
|
|
3989
|
+
default:
|
|
3990
|
+
break;
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
GioMonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, deps: [{ token: GIO_MONACO_EDITOR_CONFIG }, { token: GioMonacoEditorService }, { token: GioLanguageJsonService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3996
|
+
GioMonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorComponent, selector: "gio-monaco-editor", inputs: { languageConfig: "languageConfig", options: "options" }, providers: [
|
|
3997
|
+
{
|
|
3998
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3999
|
+
useExisting: forwardRef(() => GioMonacoEditorComponent),
|
|
4000
|
+
multi: true,
|
|
4001
|
+
},
|
|
4002
|
+
], ngImport: i0, template: ` <div *ngIf="loading">Loading...</div>`, isInline: true, styles: [":host{display:block;height:100%;min-height:150px}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorComponent, decorators: [{
|
|
4004
|
+
type: Component,
|
|
4005
|
+
args: [{ selector: 'gio-monaco-editor', template: ` <div *ngIf="loading">Loading...</div>`, providers: [
|
|
4006
|
+
{
|
|
4007
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4008
|
+
useExisting: forwardRef(() => GioMonacoEditorComponent),
|
|
4009
|
+
multi: true,
|
|
4010
|
+
},
|
|
4011
|
+
], styles: [":host{display:block;height:100%;min-height:150px}\n"] }]
|
|
4012
|
+
}], ctorParameters: function () {
|
|
4013
|
+
return [{ type: undefined, decorators: [{
|
|
4014
|
+
type: Inject,
|
|
4015
|
+
args: [GIO_MONACO_EDITOR_CONFIG]
|
|
4016
|
+
}] }, { type: GioMonacoEditorService }, { type: GioLanguageJsonService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }];
|
|
4017
|
+
}, propDecorators: { languageConfig: [{
|
|
4018
|
+
type: Input
|
|
4019
|
+
}], options: [{
|
|
4020
|
+
type: Input
|
|
4021
|
+
}] } });
|
|
4022
|
+
|
|
4023
|
+
/*
|
|
4024
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
4025
|
+
*
|
|
4026
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4027
|
+
* you may not use this file except in compliance with the License.
|
|
4028
|
+
* You may obtain a copy of the License at
|
|
4029
|
+
*
|
|
4030
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4031
|
+
*
|
|
4032
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4033
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4034
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4035
|
+
* See the License for the specific language governing permissions and
|
|
4036
|
+
* limitations under the License.
|
|
4037
|
+
*/
|
|
4038
|
+
class GioMonacoEditorModule {
|
|
4039
|
+
static forRoot(config) {
|
|
4040
|
+
return {
|
|
4041
|
+
ngModule: GioMonacoEditorModule,
|
|
4042
|
+
providers: [
|
|
4043
|
+
{
|
|
4044
|
+
provide: GIO_MONACO_EDITOR_CONFIG,
|
|
4045
|
+
useValue: config,
|
|
4046
|
+
},
|
|
4047
|
+
],
|
|
4048
|
+
};
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
GioMonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4052
|
+
GioMonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, declarations: [GioMonacoEditorComponent], imports: [CommonModule, HttpClientModule, ReactiveFormsModule], exports: [GioMonacoEditorComponent] });
|
|
4053
|
+
GioMonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, providers: [
|
|
4054
|
+
{
|
|
4055
|
+
provide: GIO_MONACO_EDITOR_CONFIG,
|
|
4056
|
+
useValue: {},
|
|
4057
|
+
},
|
|
4058
|
+
], imports: [[CommonModule, HttpClientModule, ReactiveFormsModule]] });
|
|
4059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorModule, decorators: [{
|
|
4060
|
+
type: NgModule,
|
|
4061
|
+
args: [{
|
|
4062
|
+
imports: [CommonModule, HttpClientModule, ReactiveFormsModule],
|
|
4063
|
+
declarations: [GioMonacoEditorComponent],
|
|
4064
|
+
exports: [GioMonacoEditorComponent],
|
|
4065
|
+
providers: [
|
|
4066
|
+
{
|
|
4067
|
+
provide: GIO_MONACO_EDITOR_CONFIG,
|
|
4068
|
+
useValue: {},
|
|
4069
|
+
},
|
|
4070
|
+
],
|
|
4071
|
+
}]
|
|
4072
|
+
}] });
|
|
4073
|
+
|
|
4074
|
+
/*
|
|
4075
|
+
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
4076
|
+
*
|
|
4077
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4078
|
+
* you may not use this file except in compliance with the License.
|
|
4079
|
+
* You may obtain a copy of the License at
|
|
4080
|
+
*
|
|
4081
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4082
|
+
*
|
|
4083
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4084
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4085
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4086
|
+
* See the License for the specific language governing permissions and
|
|
4087
|
+
* limitations under the License.
|
|
4088
|
+
*/
|
|
4089
|
+
/**
|
|
4090
|
+
* This component is used to test the GioMonacoEditorComponent.
|
|
4091
|
+
* This component simulates monaco editor with a simple input.
|
|
4092
|
+
*/
|
|
4093
|
+
class GioMonacoEditorTestingComponent extends GioMonacoEditorComponent {
|
|
4094
|
+
get getValue() {
|
|
4095
|
+
return this.value;
|
|
4096
|
+
}
|
|
4097
|
+
changeValue(value) {
|
|
4098
|
+
this._onTouched();
|
|
4099
|
+
this._onChange(value);
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
GioMonacoEditorTestingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4103
|
+
GioMonacoEditorTestingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioMonacoEditorTestingComponent, selector: "gio-monaco-editor", providers: [
|
|
4104
|
+
{
|
|
4105
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4106
|
+
useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
|
|
4107
|
+
multi: true,
|
|
4108
|
+
},
|
|
4109
|
+
], usesInheritance: true, ngImport: i0, template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />', isInline: true });
|
|
4110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioMonacoEditorTestingComponent, decorators: [{
|
|
4111
|
+
type: Component,
|
|
4112
|
+
args: [{
|
|
4113
|
+
selector: 'gio-monaco-editor',
|
|
4114
|
+
template: '<input type="text" [value]="getValue" (input)="changeValue($any($event).target?.value)" />',
|
|
4115
|
+
providers: [
|
|
4116
|
+
{
|
|
4117
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4118
|
+
useExisting: forwardRef(() => GioMonacoEditorTestingComponent),
|
|
4119
|
+
multi: true,
|
|
4120
|
+
},
|
|
4121
|
+
],
|
|
4122
|
+
}]
|
|
4123
|
+
}] });
|
|
4124
|
+
|
|
4125
|
+
// Hack to replace the default gio-monaco-editor component with fake one for testing purpose.
|
|
4126
|
+
try {
|
|
4127
|
+
TestBed.overrideModule(GioMonacoEditorModule, {
|
|
4128
|
+
remove: {
|
|
4129
|
+
declarations: [GioMonacoEditorComponent],
|
|
4130
|
+
exports: [GioMonacoEditorComponent],
|
|
4131
|
+
},
|
|
4132
|
+
add: {
|
|
4133
|
+
declarations: [GioMonacoEditorTestingComponent],
|
|
4134
|
+
exports: [GioMonacoEditorTestingComponent],
|
|
4135
|
+
},
|
|
4136
|
+
});
|
|
4137
|
+
}
|
|
4138
|
+
catch (e) {
|
|
4139
|
+
// Do nothing
|
|
4140
|
+
}
|
|
4141
|
+
class GioMonacoEditorHarness extends ComponentHarness {
|
|
4142
|
+
constructor() {
|
|
4143
|
+
super(...arguments);
|
|
4144
|
+
this.getInputEl = this.locatorFor('input');
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* Gets a `HarnessPredicate` that can be used to search for a `GioMonacoEditorHarness` that meets
|
|
4148
|
+
* certain criteria.
|
|
4149
|
+
*
|
|
4150
|
+
* @param options Options for filtering which input instances are considered a match.
|
|
4151
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
4152
|
+
*/
|
|
4153
|
+
static with(options = {}) {
|
|
4154
|
+
return new HarnessPredicate(GioMonacoEditorHarness, options);
|
|
4155
|
+
}
|
|
4156
|
+
setValue(value) {
|
|
4157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4158
|
+
const inputEl = yield this.getInputEl();
|
|
4159
|
+
yield inputEl.clear();
|
|
4160
|
+
yield inputEl.sendKeys(value);
|
|
4161
|
+
});
|
|
4162
|
+
}
|
|
4163
|
+
getValue() {
|
|
4164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4165
|
+
const inputEl = yield this.getInputEl();
|
|
4166
|
+
return inputEl.getProperty('value');
|
|
4167
|
+
});
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
GioMonacoEditorHarness.hostSelector = 'gio-monaco-editor';
|
|
4171
|
+
|
|
3714
4172
|
/*
|
|
3715
4173
|
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
|
|
3716
4174
|
*
|
|
@@ -3747,5 +4205,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3747
4205
|
* Generated bundle index. Do not edit.
|
|
3748
4206
|
*/
|
|
3749
4207
|
|
|
3750
|
-
export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
|
|
4208
|
+
export { GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorHarness, GioMonacoEditorModule, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
|
|
3751
4209
|
//# sourceMappingURL=gravitee-ui-particles-angular.mjs.map
|