@cuby-ui/core 0.0.614 → 0.0.615
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.
|
@@ -11,7 +11,8 @@ export declare class EditorAttachesToolComponent extends EditorToolComponent {
|
|
|
11
11
|
set title(value: string);
|
|
12
12
|
readonly fileClicked: EventEmitter<CuiFileData>;
|
|
13
13
|
protected get isShowLoadButton(): boolean;
|
|
14
|
-
protected
|
|
14
|
+
protected onFileContainerClick(event: MouseEvent): void;
|
|
15
|
+
protected onFileClick(event: MouseEvent): void;
|
|
15
16
|
protected onPreventEnter(event: KeyboardEvent): void;
|
|
16
17
|
private checkKey;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditorAttachesToolComponent, never>;
|
|
@@ -27,7 +27,14 @@ export class EditorAttachesToolComponent extends EditorToolComponent {
|
|
|
27
27
|
get isShowLoadButton() {
|
|
28
28
|
return !this.file && !this.isCaptionShown && !this.isLoading;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
onFileContainerClick(event) {
|
|
31
|
+
if (!this.readOnly) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.onFileClick(event);
|
|
35
|
+
}
|
|
36
|
+
onFileClick(event) {
|
|
37
|
+
event.stopPropagation();
|
|
31
38
|
this.fileClicked.emit(this.file);
|
|
32
39
|
}
|
|
33
40
|
onPreventEnter(event) {
|
|
@@ -41,13 +48,13 @@ export class EditorAttachesToolComponent extends EditorToolComponent {
|
|
|
41
48
|
return event.key !== 'Enter';
|
|
42
49
|
}
|
|
43
50
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorAttachesToolComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EditorAttachesToolComponent, isStandalone: true, selector: "ng-component", inputs: { file: "file", title: "title" }, outputs: { fileClicked: "fileClicked" }, host: { properties: { "class._hidden": "isShowLoadButton" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick()\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"], dependencies: [{ kind: "pipe", type: FileSizePipe, name: "fileSize" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiFileIconComponent, selector: "cui-file-icon", inputs: ["extension", "color"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: i1.CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
51
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EditorAttachesToolComponent, isStandalone: true, selector: "ng-component", inputs: { file: "file", title: "title" }, outputs: { fileClicked: "fileClicked" }, host: { properties: { "class._hidden": "isShowLoadButton" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n (click)=\"onFileContainerClick($event)\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick($event)\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"], dependencies: [{ kind: "pipe", type: FileSizePipe, name: "fileSize" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiFileIconComponent, selector: "cui-file-icon", inputs: ["extension", "color"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: i1.CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
52
|
}
|
|
46
53
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorAttachesToolComponent, decorators: [{
|
|
47
54
|
type: Component,
|
|
48
55
|
args: [{ standalone: true, imports: [FileSizePipe, FormsModule, NgIf, TranslocoDirective, CuiFileIconComponent, CuiSvgModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
49
56
|
'[class._hidden]': 'isShowLoadButton'
|
|
50
|
-
}, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick()\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"] }]
|
|
57
|
+
}, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n (click)=\"onFileContainerClick($event)\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick($event)\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"] }]
|
|
51
58
|
}], propDecorators: { file: [{
|
|
52
59
|
type: Input,
|
|
53
60
|
args: [{ required: true }]
|
|
@@ -57,4 +64,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
57
64
|
}], fileClicked: [{
|
|
58
65
|
type: Output
|
|
59
66
|
}] } });
|
|
60
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWRpdG9yLWF0dGFjaGVzLXRvb2wuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZS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h0aGlzLmZpbGUpO1xyXG4gICAgfVxyXG5cclxuICAgIHByb3RlY3RlZCBvblByZXZlbnRFbnRlcihldmVudDogS2V5Ym9hcmRFdmVudCk6IHZvaWQge1xyXG4gICAgICAgIGlmICh0aGlzLmNoZWNrS2V5KGV2ZW50KSkge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgY2hlY2tLZXkoZXZlbnQ6IEtleWJvYXJkRXZlbnQpOiBib29sZWFuIHtcclxuICAgICAgICByZXR1cm4gZXZlbnQua2V5ICE9PSAnRW50ZXInO1xyXG4gICAgfVxyXG59XHJcbiIsIjxuZy1jb250YWluZXIgKm5nSWY9XCIhaXNMb2FkaW5nOyBlbHNlIHByZWxvYWRlclwiPlxyXG4gICAgPG5nLWNvbnRhaW5lciAqdHJhbnNsb2NvPVwibGV0IHRcIj5cclxuICAgICAgICA8ZGl2XHJcbiAgICAgICAgICAgICpuZ0lmPVwiZmlsZTsgZWxzZSBidXR0b25UZW1wbGF0ZVwiXHJcbiAgICAgICAgICAgIGNsYXNzPVwiZmlsZVwiXHJcbiAgICAgICAgICAgIChjbGljayk9XCJvbkZpbGVDb250YWluZXJDbGljaygkZXZlbnQpXCJcclxuICAgICAgICA+XHJcbiAgICAgICAgICAgIDxjdWktZmlsZS1pY29uXHJcbiAgICAgICAgICAgICAgICAqbmdJZj1cImZpbGUuZXh0ZW5zaW9uXCJcclxuICAgICAgICAgICAgICAgIFtleHRlbnNpb25dPVwiZmlsZS5leHRlbnNpb25cIlxyXG4gICAgICAgICAgICA+PC9jdWktZmlsZS1pY29uPlxyXG5cclxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImluZm9cIj5cclxuICAgICAgICAgICAgICAgIDxkaXZcclxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInRpdGxlXCJcclxuICAgICAgICAgICAgICAgICAgICBhdHRyLmRhdGEtcGxhY2Vob2xkZXI9XCJ7eyB0KCdGSUxFX1RJVExFJykgfX0uLi5cIlxyXG4gICAgICAgICAgICAgICAgICAgIFtpbm5lckhUTUxdPVwidGl0bGVcIlxyXG4gICAgICAgICAgICAgICAgICAgIFthdHRyLmNvbnRlbnRlZGl0YWJsZV09XCIhcmVhZE9ubHlcIlxyXG4gICAgICAgICAgICAgICAgICAgIChwYXN0ZSk9XCJvblRpdGxlUGFzdGUoJGV2ZW50KVwiXHJcbiAgICAgICAgICAgICAgICAgICAgKGtleWRvd24pPVwib25QcmV2ZW50RW50ZXIoJGV2ZW50KVwiXHJcbiAgICAgICAgICAgICAgICAgICAgKGtleXVwKT1cIm9uVGl0bGVDaGFuZ2UoJGV2ZW50KVwiXHJcbiAgICAgICAgICAgICAgICA+PC9kaXY+XHJcbiAgICAgICAgICAgICAgICA8ZGl2XHJcbiAgICAgICAgICAgICAgICAgICAgKm5nSWY9XCJmaWxlLnNpemU7IGxldCBzaXplXCJcclxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInNpemVcIlxyXG4gICAgICAgICAgICAgICAgPlxyXG4gICAgICAgICAgICAgICAgICAgIHt7IHNpemUgfCBmaWxlU2l6ZSB9fVxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgICAgICA8YVxyXG4gICAgICAgICAgICAgICAgY2xhc3M9XCJkb3dubG9hZFwiXHJcbiAgICAgICAgICAgICAgICAoY2xpY2spPVwib25GaWxlQ2xpY2soJGV2ZW50KVwiXHJcbiAgICAgICAgICAgID5cclxuICAgICAgICAgICAgICAgIDxjdWktc3ZnXHJcbiAgICAgICAgICAgICAgICAgICAgaWNvbj1cImN1aUljb25DaGV2cm9uUmlnaHRTbVwiXHJcbiAgICAgICAgICAgICAgICAgICAgY29sb3I9XCJ2YXIoLS1jdWktYmFzZS01MDApXCJcclxuICAgICAgICAgICAgICAgIC8+XHJcbiAgICAgICAgICAgIDwvYT5cclxuICAgICAgICA8L2Rpdj5cclxuICAgICAgICA8bmctdGVtcGxhdGUgI2J1dHRvblRlbXBsYXRlPlxyXG4gICAgICAgICAgICA8YnV0dG9uXHJcbiAgICAgICAgICAgICAgICBbY2xhc3NdPVwiWydzZWxlY3QtYnRuJywgdGhpcy5hcGkuc3R5bGVzLmJ1dHRvbl1cIlxyXG4gICAgICAgICAgICAgICAgKGNsaWNrKT1cIm9uU2VsZWN0RmlsZSgpXCJcclxuICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIlxyXG4gICAgICAgICAgICA+XHJcbiAgICAgICAgICAgICAgICA8Y3VpLXN2ZyBpY29uPVwiY3VpSWNvblBhcGVyY2xpcFNtXCIgLz5cclxuICAgICAgICAgICAgICAgICZuYnNwO3t7IGJ1dHRvbkNvbnRlbnQgfX1cclxuICAgICAgICAgICAgPC9idXR0b24+XHJcbiAgICAgICAgPC9uZy10ZW1wbGF0ZT5cclxuICAgIDwvbmctY29udGFpbmVyPlxyXG48L25nLWNvbnRhaW5lcj5cclxuXHJcbjxuZy10ZW1wbGF0ZSAjcHJlbG9hZGVyPlxyXG4gICAgPGRpdiBjbGFzcz1cIndyYXBwZXJcIj5cclxuICAgICAgICA8ZGl2IGNsYXNzPVwicHJlbG9hZGVyXCI+PC9kaXY+XHJcbiAgICA8L2Rpdj5cclxuPC9uZy10ZW1wbGF0ZT5cclxuIl19
|
|
@@ -7120,7 +7120,14 @@ class EditorAttachesToolComponent extends EditorToolComponent {
|
|
|
7120
7120
|
get isShowLoadButton() {
|
|
7121
7121
|
return !this.file && !this.isCaptionShown && !this.isLoading;
|
|
7122
7122
|
}
|
|
7123
|
-
|
|
7123
|
+
onFileContainerClick(event) {
|
|
7124
|
+
if (!this.readOnly) {
|
|
7125
|
+
return;
|
|
7126
|
+
}
|
|
7127
|
+
this.onFileClick(event);
|
|
7128
|
+
}
|
|
7129
|
+
onFileClick(event) {
|
|
7130
|
+
event.stopPropagation();
|
|
7124
7131
|
this.fileClicked.emit(this.file);
|
|
7125
7132
|
}
|
|
7126
7133
|
onPreventEnter(event) {
|
|
@@ -7134,13 +7141,13 @@ class EditorAttachesToolComponent extends EditorToolComponent {
|
|
|
7134
7141
|
return event.key !== 'Enter';
|
|
7135
7142
|
}
|
|
7136
7143
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorAttachesToolComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
7137
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EditorAttachesToolComponent, isStandalone: true, selector: "ng-component", inputs: { file: "file", title: "title" }, outputs: { fileClicked: "fileClicked" }, host: { properties: { "class._hidden": "isShowLoadButton" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick()\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"], dependencies: [{ kind: "pipe", type: FileSizePipe, name: "fileSize" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiFileIconComponent, selector: "cui-file-icon", inputs: ["extension", "color"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EditorAttachesToolComponent, isStandalone: true, selector: "ng-component", inputs: { file: "file", title: "title" }, outputs: { fileClicked: "fileClicked" }, host: { properties: { "class._hidden": "isShowLoadButton" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n (click)=\"onFileContainerClick($event)\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick($event)\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"], dependencies: [{ kind: "pipe", type: FileSizePipe, name: "fileSize" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiFileIconComponent, selector: "cui-file-icon", inputs: ["extension", "color"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7138
7145
|
}
|
|
7139
7146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorAttachesToolComponent, decorators: [{
|
|
7140
7147
|
type: Component,
|
|
7141
7148
|
args: [{ standalone: true, imports: [FileSizePipe, FormsModule, NgIf, TranslocoDirective, CuiFileIconComponent, CuiSvgModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
7142
7149
|
'[class._hidden]': 'isShowLoadButton'
|
|
7143
|
-
}, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick()\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"] }]
|
|
7150
|
+
}, template: "<ng-container *ngIf=\"!isLoading; else preloader\">\r\n <ng-container *transloco=\"let t\">\r\n <div\r\n *ngIf=\"file; else buttonTemplate\"\r\n class=\"file\"\r\n (click)=\"onFileContainerClick($event)\"\r\n >\r\n <cui-file-icon\r\n *ngIf=\"file.extension\"\r\n [extension]=\"file.extension\"\r\n ></cui-file-icon>\r\n\r\n <div class=\"info\">\r\n <div\r\n class=\"title\"\r\n attr.data-placeholder=\"{{ t('FILE_TITLE') }}...\"\r\n [innerHTML]=\"title\"\r\n [attr.contenteditable]=\"!readOnly\"\r\n (paste)=\"onTitlePaste($event)\"\r\n (keydown)=\"onPreventEnter($event)\"\r\n (keyup)=\"onTitleChange($event)\"\r\n ></div>\r\n <div\r\n *ngIf=\"file.size; let size\"\r\n class=\"size\"\r\n >\r\n {{ size | fileSize }}\r\n </div>\r\n </div>\r\n <a\r\n class=\"download\"\r\n (click)=\"onFileClick($event)\"\r\n >\r\n <cui-svg\r\n icon=\"cuiIconChevronRightSm\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n </a>\r\n </div>\r\n <ng-template #buttonTemplate>\r\n <button\r\n [class]=\"['select-btn', this.api.styles.button]\"\r\n (click)=\"onSelectFile()\"\r\n type=\"button\"\r\n >\r\n <cui-svg icon=\"cuiIconPaperclipSm\" />\r\n {{ buttonContent }}\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<ng-template #preloader>\r\n <div class=\"wrapper\">\r\n <div class=\"preloader\"></div>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{padding-top:4px;padding-bottom:4px;font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font);display:block}:host._hidden{display:none}:host ::ng-deep .icon path{stroke:none}.file{display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:space-between;padding:4px 12px;border-radius:8px;border:1px solid var(--cui-base-200);background-color:var(--cui-base-10)}.info{display:flex;flex-direction:column;gap:2px;flex-grow:1;width:0;word-wrap:break-word}.extension{display:flex;flex-direction:row;gap:0;align-items:flex-end;justify-content:flex-start;padding:6px 2px;font-weight:500;font-size:12px;line-height:14px;border-radius:8px;width:35px;height:35px;color:var(--cui-gray-0)}.size{font-weight:400;font-size:13px;line-height:16px;color:var(--cui-base-500)}.download{padding:6px;flex-shrink:0;margin-left:auto;border-radius:8px;color:var(--cui-base-0)}.wrapper{display:flex;flex-direction:column;gap:0;margin-bottom:10px;border-radius:8px;border:1px solid var(--cui-base-200);min-height:50px;background-color:var(--cui-base-0);overflow:hidden}.wrapper._loaded{min-height:auto}.preloader{width:30px;height:30px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-position:center center}@keyframes preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preloader:after{content:\"\";position:absolute;z-index:3;width:30px;height:30px;border-radius:50%;border:2px solid var(--cui-base-200);border-top-color:var(--cui-blue-600);left:50%;top:50%;margin-top:-15px;margin-left:-15px;animation:preloader-spin 2s infinite linear;box-sizing:border-box}.title{font-weight:400;font-size:14px;line-height:20px;outline:none}.title[data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:var(--cui-base-400)}.select-btn{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:center;width:100%}\n"] }]
|
|
7144
7151
|
}], propDecorators: { file: [{
|
|
7145
7152
|
type: Input,
|
|
7146
7153
|
args: [{ required: true }]
|