@cuby-ui/core 0.0.624 → 0.0.625
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,8 +1,9 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { OnInit } from '@angular/core';
|
|
2
3
|
import { CuiEditorComponent } from '../../editor.component';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CuiEditorReadonlyComponent {
|
|
5
|
-
|
|
5
|
+
export declare class CuiEditorReadonlyComponent implements OnInit {
|
|
6
|
+
private readonly injector;
|
|
6
7
|
protected readonly editorConfig: import("@angular/core").Signal<{
|
|
7
8
|
tools?: import("@cuby-ui/core").CuiTools;
|
|
8
9
|
readOnly: boolean;
|
|
@@ -19,9 +20,10 @@ export declare class CuiEditorReadonlyComponent {
|
|
|
19
20
|
readonly config: import("@angular/core").InputSignal<import("@cuby-ui/core").CuiEditorConfig>;
|
|
20
21
|
readonly buttonTemplate: import("@angular/core").InputSignal<TemplateRef<unknown>>;
|
|
21
22
|
readonly shortHeight: import("@angular/core").InputSignal<number>;
|
|
22
|
-
|
|
23
|
+
readonly isShowMore: import("@angular/core").ModelSignal<boolean>;
|
|
24
|
+
ngOnInit(): void;
|
|
23
25
|
protected onShow(editor: CuiEditorComponent): void;
|
|
24
|
-
private
|
|
26
|
+
private initEditorExpansion;
|
|
25
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<CuiEditorReadonlyComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CuiEditorReadonlyComponent, "cui-editor-readonly", never, { "editorId": { "alias": "editorId"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "buttonTemplate": { "alias": "buttonTemplate"; "required": true; "isSignal": true; }; "shortHeight": { "alias": "shortHeight"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CuiEditorReadonlyComponent, "cui-editor-readonly", never, { "editorId": { "alias": "editorId"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "buttonTemplate": { "alias": "buttonTemplate"; "required": true; "isSignal": true; }; "shortHeight": { "alias": "shortHeight"; "required": false; "isSignal": true; }; "isShowMore": { "alias": "isShowMore"; "required": false; "isSignal": true; }; }, { "isShowMore": "isShowMoreChange"; }, never, never, true, never>;
|
|
27
29
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, computed, effect, input,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, effect, inject, Injector, input, model, viewChild } from '@angular/core';
|
|
3
3
|
import { CuiElementDirective } from '@cuby-ui/cdk';
|
|
4
4
|
import { CuiEditorComponent } from '../../editor.component';
|
|
5
5
|
import { EditorResizeObserverDirective } from './editor-resize-observer.directive';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export class CuiEditorReadonlyComponent {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.
|
|
9
|
+
this.injector = inject(Injector);
|
|
10
10
|
this.editorConfig = computed(() => ({ readOnly: true, withoutPreload: true, ...this.config() }));
|
|
11
11
|
this.DEFAULT_SHORT_HEIGHT = 68;
|
|
12
12
|
this.editor = viewChild.required('editor');
|
|
@@ -14,23 +14,33 @@ export class CuiEditorReadonlyComponent {
|
|
|
14
14
|
this.config = input.required();
|
|
15
15
|
this.buttonTemplate = input.required();
|
|
16
16
|
this.shortHeight = input(this.DEFAULT_SHORT_HEIGHT);
|
|
17
|
-
this.
|
|
17
|
+
this.isShowMore = model(false);
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.initEditorExpansion();
|
|
18
21
|
}
|
|
19
22
|
onShow(editor) {
|
|
20
23
|
editor.editorElement.scrollTo(0, 0);
|
|
21
24
|
this.isShowMore.update((prev) => !prev);
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
initEditorExpansion() {
|
|
27
|
+
let previousEditorId = this.editorId();
|
|
28
|
+
let wasExpanded = this.isShowMore();
|
|
24
29
|
effect(() => {
|
|
25
|
-
this.editorId();
|
|
26
|
-
this.isShowMore
|
|
27
|
-
|
|
30
|
+
const editorId = this.editorId();
|
|
31
|
+
const isExpanded = this.isShowMore();
|
|
32
|
+
if (editorId !== previousEditorId && isExpanded === wasExpanded) {
|
|
33
|
+
this.isShowMore.set(false);
|
|
34
|
+
}
|
|
35
|
+
previousEditorId = editorId;
|
|
36
|
+
wasExpanded = this.isShowMore();
|
|
37
|
+
}, { injector: this.injector, allowSignalWrites: true });
|
|
28
38
|
}
|
|
29
39
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiEditorReadonlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EditorResizeObserverDirective, selector: "[editorResizeObserver]", inputs: ["target", "shortHeight"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null }, isShowMore: { classPropertyName: "isShowMore", publicName: "isShowMore", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isShowMore: "isShowMoreChange" }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EditorResizeObserverDirective, selector: "[editorResizeObserver]", inputs: ["target", "shortHeight"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
31
41
|
}
|
|
32
42
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiEditorReadonlyComponent, decorators: [{
|
|
33
43
|
type: Component,
|
|
34
44
|
args: [{ selector: 'cui-editor-readonly', standalone: true, imports: [CuiEditorComponent, NgTemplateOutlet, EditorResizeObserverDirective, CuiElementDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"] }]
|
|
35
|
-
}]
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
}] });
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdG9yLXJlYWRvbmx5LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvcmUvZWRpdG9yL3dpZGdldHMvZWRpdG9yLXJlYWRvbmx5L2VkaXRvci1yZWFkb25seS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlL2VkaXRvci93aWRnZXRzL2VkaXRvci1yZWFk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ZmVjdChcclxuICAgICAgICAgICAgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZWRpdG9ySWQgPSB0aGlzLmVkaXRvcklkKCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpc0V4cGFuZGVkID0gdGhpcy5pc1Nob3dNb3JlKCk7XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKGVkaXRvcklkICE9PSBwcmV2aW91c0VkaXRvcklkICYmIGlzRXhwYW5kZWQgPT09IHdhc0V4cGFuZGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pc1Nob3dNb3JlLnNldChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgcHJldmlvdXNFZGl0b3JJZCA9IGVkaXRvcklkO1xyXG4gICAgICAgICAgICAgICAgd2FzRXhwYW5kZWQgPSB0aGlzLmlzU2hvd01vcmUoKTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgeyBpbmplY3RvcjogdGhpcy5pbmplY3RvciwgYWxsb3dTaWduYWxXcml0ZXM6IHRydWUgfVxyXG4gICAgICAgICk7XHJcbiAgICB9XHJcbn1cclxuIiwiPGN1aS1lZGl0b3JcclxuICAgIGN1aUVsZW1lbnRcclxuICAgICNlZGl0b3JFbGVtZW50PVwiZWxlbWVudFJlZlwiXHJcbiAgICAjZWRpdG9yQ29tcG9uZW50XHJcbiAgICBjbGFzcz1cImVkaXRvclwiXHJcbiAgICBbY2xhc3MuZWRpdG9yX29wZW5lZF09XCJpc1Nob3dNb3JlKClcIlxyXG4gICAgW2VkaXRvckFwaUlkXT1cImVkaXRvcklkKClcIlxyXG4gICAgW2NvbmZpZ109XCJlZGl0b3JDb25maWcoKVwiXHJcbi8+XHJcblxyXG48bmctdGVtcGxhdGVcclxuICAgIFtlZGl0b3JSZXNpemVPYnNlcnZlcl1cclxuICAgIFt0YXJnZXRdPVwiZWRpdG9yRWxlbWVudC5uYXRpdmVFbGVtZW50XCJcclxuICAgIFtzaG9ydEhlaWdodF09XCJzaG9ydEhlaWdodCgpXCJcclxuPlxyXG4gICAgPGJ1dHRvblxyXG4gICAgICAgIGNsYXNzPVwiYy1idXR0b25cIlxyXG4gICAgICAgIChjbGljayk9XCJvblNob3coZWRpdG9yQ29tcG9uZW50KVwiXHJcbiAgICA+XHJcbiAgICAgICAgPG5nLWNvbnRhaW5lclxyXG4gICAgICAgICAgICBbbmdUZW1wbGF0ZU91dGxldF09XCJidXR0b25UZW1wbGF0ZSgpXCJcclxuICAgICAgICAgICAgW25nVGVtcGxhdGVPdXRsZXRDb250ZXh0XT1cInsgJGltcGxpY2l0OiBpc1Nob3dNb3JlIH1cIlxyXG4gICAgICAgID48L25nLWNvbnRhaW5lcj5cclxuICAgIDwvYnV0dG9uPlxyXG48L25nLXRlbXBsYXRlPlxyXG4iXX0=
|
|
@@ -9659,7 +9659,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
9659
9659
|
|
|
9660
9660
|
class CuiEditorReadonlyComponent {
|
|
9661
9661
|
constructor() {
|
|
9662
|
-
this.
|
|
9662
|
+
this.injector = inject(Injector);
|
|
9663
9663
|
this.editorConfig = computed(() => ({ readOnly: true, withoutPreload: true, ...this.config() }));
|
|
9664
9664
|
this.DEFAULT_SHORT_HEIGHT = 68;
|
|
9665
9665
|
this.editor = viewChild.required('editor');
|
|
@@ -9667,25 +9667,35 @@ class CuiEditorReadonlyComponent {
|
|
|
9667
9667
|
this.config = input.required();
|
|
9668
9668
|
this.buttonTemplate = input.required();
|
|
9669
9669
|
this.shortHeight = input(this.DEFAULT_SHORT_HEIGHT);
|
|
9670
|
-
this.
|
|
9670
|
+
this.isShowMore = model(false);
|
|
9671
|
+
}
|
|
9672
|
+
ngOnInit() {
|
|
9673
|
+
this.initEditorExpansion();
|
|
9671
9674
|
}
|
|
9672
9675
|
onShow(editor) {
|
|
9673
9676
|
editor.editorElement.scrollTo(0, 0);
|
|
9674
9677
|
this.isShowMore.update((prev) => !prev);
|
|
9675
9678
|
}
|
|
9676
|
-
|
|
9679
|
+
initEditorExpansion() {
|
|
9680
|
+
let previousEditorId = this.editorId();
|
|
9681
|
+
let wasExpanded = this.isShowMore();
|
|
9677
9682
|
effect(() => {
|
|
9678
|
-
this.editorId();
|
|
9679
|
-
this.isShowMore
|
|
9680
|
-
|
|
9683
|
+
const editorId = this.editorId();
|
|
9684
|
+
const isExpanded = this.isShowMore();
|
|
9685
|
+
if (editorId !== previousEditorId && isExpanded === wasExpanded) {
|
|
9686
|
+
this.isShowMore.set(false);
|
|
9687
|
+
}
|
|
9688
|
+
previousEditorId = editorId;
|
|
9689
|
+
wasExpanded = this.isShowMore();
|
|
9690
|
+
}, { injector: this.injector, allowSignalWrites: true });
|
|
9681
9691
|
}
|
|
9682
9692
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiEditorReadonlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9683
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EditorResizeObserverDirective, selector: "[editorResizeObserver]", inputs: ["target", "shortHeight"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9693
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null }, isShowMore: { classPropertyName: "isShowMore", publicName: "isShowMore", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isShowMore: "isShowMoreChange" }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty", "editorReady"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: EditorResizeObserverDirective, selector: "[editorResizeObserver]", inputs: ["target", "shortHeight"] }, { kind: "directive", type: CuiElementDirective, selector: "[cuiElement]", exportAs: ["elementRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9684
9694
|
}
|
|
9685
9695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CuiEditorReadonlyComponent, decorators: [{
|
|
9686
9696
|
type: Component,
|
|
9687
9697
|
args: [{ selector: 'cui-editor-readonly', standalone: true, imports: [CuiEditorComponent, NgTemplateOutlet, EditorResizeObserverDirective, CuiElementDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-editor\r\n cuiElement\r\n #editorElement=\"elementRef\"\r\n #editorComponent\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n\r\n<ng-template\r\n [editorResizeObserver]\r\n [target]=\"editorElement.nativeElement\"\r\n [shortHeight]=\"shortHeight()\"\r\n>\r\n <button\r\n class=\"c-button\"\r\n (click)=\"onShow(editorComponent)\"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"buttonTemplate()\"\r\n [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"\r\n ></ng-container>\r\n </button>\r\n</ng-template>\r\n", styles: [":host{--height: 69px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"] }]
|
|
9688
|
-
}]
|
|
9698
|
+
}] });
|
|
9689
9699
|
|
|
9690
9700
|
class CuiEditorModalComponent {
|
|
9691
9701
|
constructor() {
|