@gravitee/ui-particles-angular 15.8.0 → 15.8.1-click-tag-35d619f

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.
@@ -1,6 +1,6 @@
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, ChangeDetectionStrategy, Optional, Self, ViewChild, Directive, Injector, Inject, forwardRef, ContentChildren, Injectable, Host, ContentChild, InjectionToken, inject, ViewContainerRef, signal, computed, Pipe, ViewEncapsulation } from '@angular/core';
3
+ import { EventEmitter, Component, HostBinding, Input, Output, HostListener, NgModule, ChangeDetectionStrategy, Optional, Self, ViewChild, Directive, Injector, Inject, forwardRef, ContentChildren, Injectable, Host, ContentChild, InjectionToken, inject, signal, effect, ViewContainerRef, computed, Pipe, ViewEncapsulation } from '@angular/core';
4
4
  import { of, Subject, fromEvent, ReplaySubject, merge, Observable, BehaviorSubject, timer } from 'rxjs';
5
5
  import { delay, tap, startWith, switchMap, map, distinctUntilChanged, takeUntil, filter, take, debounceTime, shareReplay, catchError, debounce } from 'rxjs/operators';
6
6
  import * as i1 from '@angular/common';
@@ -407,6 +407,7 @@ class GioFormTagsInputComponent {
407
407
  * called with `true` it will add the tag, otherwise it will just ignore it
408
408
  */
409
409
  this.tagValidationHook = undefined;
410
+ this.clickOnTag = new EventEmitter();
410
411
  /**
411
412
  * Set to true to force the chip to be part of the autocomplete options.
412
413
  */
@@ -537,12 +538,12 @@ class GioFormTagsInputComponent {
537
538
  }
538
539
  }
539
540
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GioFormTagsInputComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i1$3.FocusMonitor }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
540
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: GioFormTagsInputComponent, isStandalone: false, selector: "gio-form-tags-input", inputs: { ariaLabel: ["aria-label", "ariaLabel"], addOnBlur: "addOnBlur", tagValidationHook: "tagValidationHook", autocompleteOptions: "autocompleteOptions", displayValueWith: "displayValueWith", useAutocompleteOptionValueOnly: "useAutocompleteOptionValueOnly", placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { properties: { "id": "this.id", "class.floating": "this.shouldLabelFloat", "attr.aria-describedby": "this.describedBy" } }, providers: [
541
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: GioFormTagsInputComponent, isStandalone: false, selector: "gio-form-tags-input", inputs: { ariaLabel: ["aria-label", "ariaLabel"], addOnBlur: "addOnBlur", tagValidationHook: "tagValidationHook", autocompleteOptions: "autocompleteOptions", displayValueWith: "displayValueWith", useAutocompleteOptionValueOnly: "useAutocompleteOptionValueOnly", placeholder: "placeholder", required: "required", disabled: "disabled" }, outputs: { clickOnTag: "clickOnTag" }, host: { properties: { "id": "this.id", "class.floating": "this.shouldLabelFloat", "attr.aria-describedby": "this.describedBy" } }, providers: [
541
542
  {
542
543
  provide: MatFormFieldControl,
543
544
  useExisting: GioFormTagsInputComponent,
544
545
  },
545
- ], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2015 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<mat-chip-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip-row *ngFor=\"let tag of value\" [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\">\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n <input\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngIf=\"loading\" disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mdc-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i4.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: GioLoaderComponent, selector: "gio-loader" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
546
+ ], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true }], ngImport: i0, template: "<!--\n\n Copyright (C) 2015 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<mat-chip-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip-row\n *ngFor=\"let tag of value\"\n [removable]=\"!disabled\"\n (removed)=\"removeChipToFormControl(tag)\"\n [disabled]=\"disabled\"\n (click)=\"clickOnTag.emit(tag)\"\n >\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n <input\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngIf=\"loading\" disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mdc-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i4.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i4.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: GioLoaderComponent, selector: "gio-loader" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
546
547
  }
547
548
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GioFormTagsInputComponent, decorators: [{
548
549
  type: Component,
@@ -551,7 +552,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
551
552
  provide: MatFormFieldControl,
552
553
  useExisting: GioFormTagsInputComponent,
553
554
  },
554
- ], standalone: false, template: "<!--\n\n Copyright (C) 2015 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<mat-chip-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip-row *ngFor=\"let tag of value\" [removable]=\"!disabled\" (removed)=\"removeChipToFormControl(tag)\" [disabled]=\"disabled\">\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n <input\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngIf=\"loading\" disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mdc-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"] }]
555
+ ], standalone: false, template: "<!--\n\n Copyright (C) 2015 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<mat-chip-grid #tagChipList [attr.aria-label]=\"ariaLabel\" multiple [disabled]=\"disabled\">\n <mat-chip-row\n *ngFor=\"let tag of value\"\n [removable]=\"!disabled\"\n (removed)=\"removeChipToFormControl(tag)\"\n [disabled]=\"disabled\"\n (click)=\"clickOnTag.emit(tag)\"\n >\n {{ _displayValueWith ? (_displayValueWith(tag) | async) : tag }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip-row>\n <input\n #tagInput\n [matAutocompleteDisabled]=\"!_autocompleteOptions || disabled\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"placeholder\"\n [matChipInputFor]=\"tagChipList\"\n [matChipInputAddOnBlur]=\"addOnBlur\"\n (matChipInputTokenEnd)=\"onMatChipTokenEnd()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onAutocompleteSelect($event)\">\n <mat-option *ngIf=\"loading\" disabled id=\"loader\">\n <div class=\"loader-option\"><gio-loader></gio-loader></div>\n </mat-option>\n <mat-option *ngFor=\"let option of autocompleteFilteredOptions$ | async\" [value]=\"option.value\">\n {{ option.label }}\n </mat-option>\n </mat-autocomplete>\n</mat-chip-grid>\n", styles: ["::ng-deep gio-form-tags-input .mat-mdc-standard-chip{height:unset!important;min-height:var(--mdc-chip-container-height)}::ng-deep gio-form-tags-input .mat-mdc-standard-chip .mdc-evolution-chip__text-label{white-space:normal}.loader-option{display:flex}.loader-option gio-loader{width:24px}\n"] }]
555
556
  }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
556
557
  type: Optional
557
558
  }, {
@@ -565,6 +566,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
565
566
  type: Input
566
567
  }], autocompleteOptions: [{
567
568
  type: Input
569
+ }], clickOnTag: [{
570
+ type: Output
568
571
  }], displayValueWith: [{
569
572
  type: Input
570
573
  }], useAutocompleteOptionValueOnly: [{
@@ -3622,6 +3625,10 @@ class GioMonacoEditorComponent {
3622
3625
  this.value = '';
3623
3626
  this.readOnly = false;
3624
3627
  this.toDisposes = [];
3628
+ this.isMonacoEditorReady = signal({
3629
+ isSetup: false,
3630
+ hasFirstValue: false,
3631
+ });
3625
3632
  this._onChange = () => ({});
3626
3633
  this._onTouched = () => ({});
3627
3634
  this.unsubscribe$ = new Subject();
@@ -3631,11 +3638,22 @@ class GioMonacoEditorComponent {
3631
3638
  this.ngControl.valueAccessor = this;
3632
3639
  }
3633
3640
  this.monacoEditorService.loadEditor();
3641
+ effect(() => {
3642
+ const { isSetup, hasFirstValue } = this.isMonacoEditorReady();
3643
+ if (isSetup && hasFirstValue) {
3644
+ if (this.textModel) {
3645
+ this.textModel.setValue(this.value);
3646
+ }
3647
+ this.updateModelLanguage();
3648
+ this.autoformatValue();
3649
+ }
3650
+ });
3634
3651
  }
3635
3652
  ngAfterViewInit() {
3636
3653
  // Wait until monaco editor is available
3637
3654
  this.monacoEditorService.loaded$.pipe(takeUntil(this.unsubscribe$)).subscribe(({ monaco }) => {
3638
3655
  this.setupEditor(monaco);
3656
+ this.isMonacoEditorReady.update(({ hasFirstValue }) => ({ isSetup: true, hasFirstValue }));
3639
3657
  this.loaded$.next(false);
3640
3658
  this.changeDetectorRef.detectChanges();
3641
3659
  });
@@ -3657,9 +3675,7 @@ class GioMonacoEditorComponent {
3657
3675
  writeValue(_value) {
3658
3676
  if (_value) {
3659
3677
  this.value = isString(_value) ? _value : JSON.stringify(_value);
3660
- }
3661
- if (this.textModel) {
3662
- this.textModel.setValue(this.value);
3678
+ this.isMonacoEditorReady.update(({ isSetup }) => ({ isSetup, hasFirstValue: true }));
3663
3679
  }
3664
3680
  }
3665
3681
  // From ControlValueAccessor interface
@@ -3703,11 +3719,6 @@ class GioMonacoEditorComponent {
3703
3719
  this.standaloneCodeEditor = monaco.editor.create(domElement, {
3704
3720
  ...options,
3705
3721
  });
3706
- if (!this.disableAutoFormat) {
3707
- setTimeout(() => {
3708
- this.standaloneCodeEditor?.getAction('editor.action.formatDocument')?.run();
3709
- }, 80);
3710
- }
3711
3722
  if (this.singleLineMode) {
3712
3723
  this.standaloneCodeEditor?.addAction({
3713
3724
  id: 'custom.action',
@@ -3818,6 +3829,27 @@ class GioMonacoEditorComponent {
3818
3829
  break;
3819
3830
  }
3820
3831
  }
3832
+ updateModelLanguage() {
3833
+ const languageId = this.languageConfig?.language ?? (isJsonString(this.value) ? 'json' : 'plaintext');
3834
+ if (this.textModel && window.monaco) {
3835
+ window.monaco.editor.setModelLanguage(this.textModel, languageId);
3836
+ }
3837
+ }
3838
+ autoformatValue() {
3839
+ if (!this.disableAutoFormat) {
3840
+ setTimeout(() => {
3841
+ const previousReadOnlyState = this.options.readOnly || this.readOnly;
3842
+ this.standaloneCodeEditor?.updateOptions({ readOnly: false });
3843
+ this.standaloneCodeEditor
3844
+ ?.getAction('editor.action.formatDocument')
3845
+ ?.run()
3846
+ .finally(() => {
3847
+ this.standaloneCodeEditor?.updateOptions({ readOnly: previousReadOnlyState });
3848
+ this.changeDetectorRef.detectChanges();
3849
+ });
3850
+ }, 80);
3851
+ }
3852
+ }
3821
3853
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GioMonacoEditorComponent, deps: [{ token: i0.ElementRef }, { token: GIO_MONACO_EDITOR_CONFIG }, { token: GioMonacoEditorService }, { token: GioLanguageJsonService }, { token: GioLanguageElService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
3822
3854
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: GioMonacoEditorComponent, isStandalone: false, selector: "gio-monaco-editor", inputs: { languageConfig: "languageConfig", options: "options", disableMiniMap: "disableMiniMap", disableAutoFormat: "disableAutoFormat", singleLineMode: "singleLineMode" }, host: { properties: { "class.single-line": "this.singleLineMode" } }, ngImport: i0, template: ` <div *ngIf="loaded$ | async">Loading...</div>`, isInline: true, styles: [":host{display:block;height:100%;min-height:150px;pointer-events:auto;transition:opacity .2s ease-out}:host.single-line{display:flex;height:24px;min-height:24px;align-items:center}:host-context(.hidden){opacity:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3823
3855
  }
@@ -4013,23 +4045,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
4013
4045
  * limitations under the License.
4014
4046
  */
4015
4047
  class GioMonacoClipboardCopyComponent {
4048
+ constructor() {
4049
+ this.monacoEditor = null;
4050
+ }
4016
4051
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GioMonacoClipboardCopyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4017
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: GioMonacoClipboardCopyComponent, isStandalone: false, selector: "[gioMonacoClipboardCopy]", ngImport: i0, template: `
4052
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.4", type: GioMonacoClipboardCopyComponent, isStandalone: false, selector: "[gioMonacoClipboardCopy]", queries: [{ propertyName: "monacoEditor", first: true, predicate: GioMonacoEditorComponent, descendants: true }], ngImport: i0, template: `
4018
4053
  <div class="editor-wrapper">
4019
4054
  <ng-content></ng-content>
4020
- <gio-clipboard-copy-icon class="copy-btn"></gio-clipboard-copy-icon>
4055
+ <gio-clipboard-copy-icon class="copy-btn" [contentToCopy]="monacoEditor?.value ?? ''"></gio-clipboard-copy-icon>
4021
4056
  </div>
4022
- `, isInline: true, styles: [".editor-wrapper{position:relative;overflow:auto;min-height:420px;flex:1 1 50%}.copy-btn{position:absolute;top:8px;right:8px}\n"], dependencies: [{ kind: "component", type: GioClipboardCopyIconComponent, selector: "gio-clipboard-copy-icon" }] }); }
4057
+ `, isInline: true, styles: [".editor-wrapper{position:relative;overflow:auto;flex:1 1 50%}.copy-btn{position:absolute;z-index:10;top:8px;right:8px}\n"], dependencies: [{ kind: "component", type: GioClipboardCopyIconComponent, selector: "gio-clipboard-copy-icon" }] }); }
4023
4058
  }
4024
4059
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GioMonacoClipboardCopyComponent, decorators: [{
4025
4060
  type: Component,
4026
4061
  args: [{ selector: '[gioMonacoClipboardCopy]', template: `
4027
4062
  <div class="editor-wrapper">
4028
4063
  <ng-content></ng-content>
4029
- <gio-clipboard-copy-icon class="copy-btn"></gio-clipboard-copy-icon>
4064
+ <gio-clipboard-copy-icon class="copy-btn" [contentToCopy]="monacoEditor?.value ?? ''"></gio-clipboard-copy-icon>
4030
4065
  </div>
4031
- `, standalone: false, styles: [".editor-wrapper{position:relative;overflow:auto;min-height:420px;flex:1 1 50%}.copy-btn{position:absolute;top:8px;right:8px}\n"] }]
4032
- }] });
4066
+ `, standalone: false, styles: [".editor-wrapper{position:relative;overflow:auto;flex:1 1 50%}.copy-btn{position:absolute;z-index:10;top:8px;right:8px}\n"] }]
4067
+ }], propDecorators: { monacoEditor: [{
4068
+ type: ContentChild,
4069
+ args: [GioMonacoEditorComponent, { static: false }]
4070
+ }] } });
4033
4071
 
4034
4072
  /*
4035
4073
  * Copyright (C) 2015 The Gravitee team (http://gravitee.io)