@libs-ui/components-preview-file 0.2.348-8 → 0.2.350-1

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,26 +1,37 @@
1
1
  import { AsyncPipe } from '@angular/common';
2
- import { ChangeDetectionStrategy, Component, input, output, signal } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, computed, Inject, input, model, Optional, output, signal, untracked } from '@angular/core';
3
+ import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
3
4
  import { LibsUiComponentsModalComponent } from '@libs-ui/components-modal';
5
+ import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
4
6
  import { LibsUiComponentsSkeletonComponent } from '@libs-ui/components-skeleton';
7
+ import { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';
8
+ import { LibsUiPipesCheckFileExtensionPipe } from '@libs-ui/pipes-check-file-extension';
5
9
  import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
10
+ import { LINK_IMAGE_ERROR_TOKEN_INJECT } from '@libs-ui/utils';
6
11
  import * as i0 from "@angular/core";
7
12
  export class LibsUiComponentsPreviewFileComponent {
13
+ linkImageError;
8
14
  loading = signal(true);
9
- urlFile = signal('');
10
- zIndex = input();
11
- data = input();
12
- outClose = output();
13
- ngOnInit() {
14
- if (!this.data() || (!this.data()?.url && !this.data()?.origin_url)) {
15
- return;
15
+ fileView = computed(() => {
16
+ const file = this.data()[this.index()];
17
+ if (!file) {
18
+ return null;
16
19
  }
17
- const mimeType = this.data()?.mimetype || this.data()?.file?.type;
18
- const url = this.data()?.url || this.data()?.origin_url;
20
+ untracked(() => this.loading.set(true));
21
+ const mimeType = file.mimetype || file.file?.type;
22
+ const url = file.url || file.origin_url;
19
23
  if (mimeType && this.mineTypeMicroSoftSupport().includes(mimeType)) {
20
- this.urlFile.set(`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}`);
21
- return;
24
+ return { ...file, urlFile: `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}` };
22
25
  }
23
- this.urlFile.set(`https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true`);
26
+ return { ...file, urlFile: `https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true` };
27
+ });
28
+ zIndex = input();
29
+ index = model.required();
30
+ data = input.required();
31
+ buttons = input();
32
+ outClose = output();
33
+ constructor(linkImageError) {
34
+ this.linkImageError = linkImageError;
24
35
  }
25
36
  async handlerOnLoad() {
26
37
  this.loading.set(false);
@@ -45,11 +56,37 @@ export class LibsUiComponentsPreviewFileComponent {
45
56
  'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
46
57
  ];
47
58
  }
48
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
49
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewFileComponent, isStandalone: true, selector: "libs_ui-components-preview_file", inputs: { zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClose: "outClose" }, ngImport: i0, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [title]=\"data()?.name\"\n [headerConfig]=\"{ ignoreHeaderTheme: true }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between\">\n <div class=\"w-full relative mx-[24px] h-[16px]\">\n <div class=\"flex w-full libs-ui-font-h4s absolute\">\n <!-- <libs_ui-components-popover [type]=\"'text'\"\n [config]=\"{zIndex: zIndex()}\">\n {{ 'i18n_edit_file_name' | translate:{file_name: nameFile()} }}\n </libs_ui-components-popover> -->\n </div>\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex\">\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"urlFile() | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\"></libs_ui-components-skeleton>\n }\n </div>\n</libs_ui-components-modal>\n", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LibsUiComponentsModalComponent, selector: "libs_ui-components-modal", inputs: ["show", "mode", "isBackdropTransparent", "isBackgroundTransparentModal", "isSizeBackdropByWidthHeightInput", "hasShadowBoxWhenHiddenBackDropTransparent", "classIncludeModalWrapper", "zIndex", "width", "height", "maxWidth", "maxHeight", "minWidth", "isFullScreen", "disable", "ignoreCommunicateMicroEvent", "escapeKeyboardCloseModal", "headerConfig", "bodyConfig", "footerConfig", "buttonsFooter", "title", "titleUseXssFilter", "titleUseTooltip", "titleUseInnerText"], outputs: ["showChange", "widthChange", "heightChange", "maxWidthChange", "maxHeightChange", "minWidthChange", "disableChange", "buttonsFooterChange", "outScrollContent", "outEvent", "outFunctionControl"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "component", type: LibsUiComponentsSkeletonComponent, selector: "libs_ui-components-skeleton", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
59
+ handlerPrev() {
60
+ this.index.update((value) => value - 1);
61
+ }
62
+ handlerNext() {
63
+ this.index.update((value) => value + 1);
64
+ }
65
+ async handlerImageError(event) {
66
+ if (!this.linkImageError) {
67
+ return;
68
+ }
69
+ event.target.src = this.linkImageError;
70
+ }
71
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, deps: [{ token: LINK_IMAGE_ERROR_TOKEN_INJECT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
72
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewFileComponent, isStandalone: true, selector: "libs_ui-components-preview_file", inputs: { zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, buttons: { classPropertyName: "buttons", publicName: "buttons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", outClose: "outClose" }, ngImport: i0, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [headerConfig]=\"{ ignoreHeaderTheme: true, classButtonCloseInclude: '!mr-[24px]' }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between min-w-0\">\n <div class=\"w-full ml-[24px] mr-[8px] flex justify-between items-center min-w-0 gap-[16px]\">\n <div class=\"w-2/8 flex-1\"></div>\n <div class=\"flex libs-ui-font-h4s min-w-0 w-4/8 justify-center flex-1\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [config]=\"{ zIndex: zIndex() }\">\n {{ fileView()?.name }}\n </libs_ui-components-popover>\n </div>\n @if (buttons()?.length) {\n <div class=\"flex gap-[8px] items-center w-2/8 justify-end flex-1\">\n @for (button of buttons(); track button.key) {\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-third'\"\n [label]=\"button.label || ''\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [iconOnlyType]=\"button.iconOnlyType || false\"\n [classInclude]=\"button.classInclude || '!py-[4px] !px-[12px]'\"\n (outClick)=\"button.action?.(index())\" />\n }\n <div class=\"h-[12px] libs-ui-border-left-general\"></div>\n </div>\n }\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex rounded-b-[8px] overflow-hidden relative\">\n @if (index() > 0) {\n <div class=\"absolute top-[50%] left-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right rotate-180 before:!text-[20px]'\"\n (outClick)=\"handlerPrev()\" />\n </div>\n }\n @if (fileView(); as fileView) {\n @if (fileView | LibsUiPipesCheckFileExtensionPipe: 'image') {\n <div class=\"w-full h-full relative flex items-center justify-center\">\n @if (fileView.url || fileView.origin_url; as url) {\n <img\n [src]=\"url\"\n alt=\"\"\n class=\"max-w-full max-h-full object-contain\"\n (load)=\"handlerOnLoad()\"\n (error)=\"handlerImageError($event)\" />\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n }\n </div>\n } @else {\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"fileView.urlFile | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\" />\n }\n }\n @if (index() < data().length - 1) {\n <div class=\"absolute top-[50%] right-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right before:!text-[20px]'\"\n (outClick)=\"handlerNext()\" />\n </div>\n }\n }\n </div>\n</libs_ui-components-modal>\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LibsUiComponentsModalComponent, selector: "libs_ui-components-modal", inputs: ["show", "mode", "isBackdropTransparent", "isBackgroundTransparentModal", "isSizeBackdropByWidthHeightInput", "hasShadowBoxWhenHiddenBackDropTransparent", "classIncludeModalWrapper", "zIndex", "width", "height", "maxWidth", "maxHeight", "minWidth", "isFullScreen", "disable", "ignoreCommunicateMicroEvent", "escapeKeyboardCloseModal", "headerConfig", "bodyConfig", "footerConfig", "buttonsFooter", "title", "titleUseXssFilter", "titleUseTooltip", "titleUseInnerText"], outputs: ["showChange", "widthChange", "heightChange", "maxWidthChange", "maxHeightChange", "minWidthChange", "disableChange", "buttonsFooterChange", "outScrollContent", "outEvent", "outFunctionControl"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "component", type: LibsUiComponentsSkeletonComponent, selector: "libs_ui-components-skeleton", inputs: ["config"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "pipe", type: LibsUiPipesCheckFileExtensionPipe, name: "LibsUiPipesCheckFileExtensionPipe" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
50
73
  }
51
74
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, decorators: [{
52
75
  type: Component,
53
- args: [{ selector: 'libs_ui-components-preview_file', standalone: true, imports: [AsyncPipe, LibsUiComponentsModalComponent, LibsUiPipesSecurityTrustPipe, LibsUiComponentsSkeletonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [title]=\"data()?.name\"\n [headerConfig]=\"{ ignoreHeaderTheme: true }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between\">\n <div class=\"w-full relative mx-[24px] h-[16px]\">\n <div class=\"flex w-full libs-ui-font-h4s absolute\">\n <!-- <libs_ui-components-popover [type]=\"'text'\"\n [config]=\"{zIndex: zIndex()}\">\n {{ 'i18n_edit_file_name' | translate:{file_name: nameFile()} }}\n </libs_ui-components-popover> -->\n </div>\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex\">\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"urlFile() | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\"></libs_ui-components-skeleton>\n }\n </div>\n</libs_ui-components-modal>\n" }]
54
- }] });
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJldmlldy1maWxlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMtdWkvY29tcG9uZW50cy9wcmV2aWV3LWZpbGUvc3JjL3ByZXZpZXctZmlsZS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvcHJldmlldy1maWxlL3NyYy9wcmV2aWV3LWZpbGUuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzVDLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbEcsT0FBTyxFQUFFLDhCQUE4QixFQUFvQixNQUFNLDJCQUEyQixDQUFDO0FBQzdGLE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRWpGLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLCtCQUErQixDQUFDOztBQVU3RSxNQUFNLE9BQU8sb0NBQW9DO0lBQ3JDLE9BQU8sR0FBRyxNQUFNLENBQ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CJcbiAgICAgICAgICBbY29uZmlnXT1cInt6SW5kZXg6IHpJbmRleCgpfVwiPlxuICAgICAgICAgIHt7ICdpMThuX2VkaXRfZmlsZV9uYW1lJyB8IHRyYW5zbGF0ZTp7ZmlsZV9uYW1lOiBuYW1lRmlsZSgpfSB9fVxuICAgICAgICA8L2xpYnNfdWktY29tcG9uZW50cy1wb3BvdmVyPiAtLT5cbiAgICAgIDwvZGl2PlxuICAgIDwvZGl2PlxuICA8L2Rpdj5cbiAgPGRpdiBjbGFzcz1cImxpYnMtdWktbW9kYWwtYm9keS1jdXN0b20gaC1mdWxsIHctZnVsbCBmbGV4XCI+XG4gICAgPGlmcmFtZVxuICAgICAgaWQ9XCJnb29nbGVcIlxuICAgICAgW2NsYXNzLmhpZGRlbl09XCJsb2FkaW5nKClcIlxuICAgICAgW3NyY109XCJ1cmxGaWxlKCkgfCBMaWJzVWlQaXBlc1NlY3VyaXR5VHJ1c3RQaXBlOiAncmVzb3VyY2VVcmwnIHwgYXN5bmNcIlxuICAgICAgd2lkdGg9XCIxMDAlXCJcbiAgICAgIGhlaWdodD1cIjEwMCVcIlxuICAgICAgZnJhbWVib3JkZXI9XCIwXCJcbiAgICAgIGFsbG93ZnVsbHNjcmVlbj1cImFsbG93ZnVsbHNjcmVlblwiXG4gICAgICAobG9hZCk9XCJoYW5kbGVyT25Mb2FkKClcIj48L2lmcmFtZT5cblxuICAgIEBpZiAobG9hZGluZygpKSB7XG4gICAgICA8bGlic191aS1jb21wb25lbnRzLXNrZWxldG9uIFtjbGFzc109XCIndy1mdWxsIGgtZnVsbCdcIj48L2xpYnNfdWktY29tcG9uZW50cy1za2VsZXRvbj5cbiAgICB9XG4gIDwvZGl2PlxuPC9saWJzX3VpLWNvbXBvbmVudHMtbW9kYWw+XG4iXX0=
76
+ args: [{ selector: 'libs_ui-components-preview_file', standalone: true, imports: [
77
+ AsyncPipe,
78
+ LibsUiComponentsModalComponent,
79
+ LibsUiPipesSecurityTrustPipe,
80
+ LibsUiComponentsSkeletonComponent,
81
+ LibsUiComponentsPopoverComponent,
82
+ LibsUiComponentsButtonsButtonComponent,
83
+ LibsUiPipesCheckFileExtensionPipe,
84
+ LibsUiComponentsSpinnerComponent,
85
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [headerConfig]=\"{ ignoreHeaderTheme: true, classButtonCloseInclude: '!mr-[24px]' }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between min-w-0\">\n <div class=\"w-full ml-[24px] mr-[8px] flex justify-between items-center min-w-0 gap-[16px]\">\n <div class=\"w-2/8 flex-1\"></div>\n <div class=\"flex libs-ui-font-h4s min-w-0 w-4/8 justify-center flex-1\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [config]=\"{ zIndex: zIndex() }\">\n {{ fileView()?.name }}\n </libs_ui-components-popover>\n </div>\n @if (buttons()?.length) {\n <div class=\"flex gap-[8px] items-center w-2/8 justify-end flex-1\">\n @for (button of buttons(); track button.key) {\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-third'\"\n [label]=\"button.label || ''\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [iconOnlyType]=\"button.iconOnlyType || false\"\n [classInclude]=\"button.classInclude || '!py-[4px] !px-[12px]'\"\n (outClick)=\"button.action?.(index())\" />\n }\n <div class=\"h-[12px] libs-ui-border-left-general\"></div>\n </div>\n }\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex rounded-b-[8px] overflow-hidden relative\">\n @if (index() > 0) {\n <div class=\"absolute top-[50%] left-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right rotate-180 before:!text-[20px]'\"\n (outClick)=\"handlerPrev()\" />\n </div>\n }\n @if (fileView(); as fileView) {\n @if (fileView | LibsUiPipesCheckFileExtensionPipe: 'image') {\n <div class=\"w-full h-full relative flex items-center justify-center\">\n @if (fileView.url || fileView.origin_url; as url) {\n <img\n [src]=\"url\"\n alt=\"\"\n class=\"max-w-full max-h-full object-contain\"\n (load)=\"handlerOnLoad()\"\n (error)=\"handlerImageError($event)\" />\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n }\n </div>\n } @else {\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"fileView.urlFile | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\" />\n }\n }\n @if (index() < data().length - 1) {\n <div class=\"absolute top-[50%] right-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right before:!text-[20px]'\"\n (outClick)=\"handlerNext()\" />\n </div>\n }\n }\n </div>\n</libs_ui-components-modal>\n" }]
86
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
87
+ type: Optional
88
+ }, {
89
+ type: Inject,
90
+ args: [LINK_IMAGE_ERROR_TOKEN_INJECT]
91
+ }] }] });
92
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJldmlldy1maWxlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2Vz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vbmVudHMtbW9kYWw+XG4iXX0=
@@ -1,27 +1,38 @@
1
1
  import { AsyncPipe } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { signal, input, output, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { signal, computed, untracked, input, model, output, Optional, Inject, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
4
5
  import { LibsUiComponentsModalComponent } from '@libs-ui/components-modal';
6
+ import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
5
7
  import { LibsUiComponentsSkeletonComponent } from '@libs-ui/components-skeleton';
8
+ import { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';
9
+ import { LibsUiPipesCheckFileExtensionPipe } from '@libs-ui/pipes-check-file-extension';
6
10
  import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
11
+ import { LINK_IMAGE_ERROR_TOKEN_INJECT } from '@libs-ui/utils';
7
12
 
8
13
  class LibsUiComponentsPreviewFileComponent {
14
+ linkImageError;
9
15
  loading = signal(true);
10
- urlFile = signal('');
11
- zIndex = input();
12
- data = input();
13
- outClose = output();
14
- ngOnInit() {
15
- if (!this.data() || (!this.data()?.url && !this.data()?.origin_url)) {
16
- return;
16
+ fileView = computed(() => {
17
+ const file = this.data()[this.index()];
18
+ if (!file) {
19
+ return null;
17
20
  }
18
- const mimeType = this.data()?.mimetype || this.data()?.file?.type;
19
- const url = this.data()?.url || this.data()?.origin_url;
21
+ untracked(() => this.loading.set(true));
22
+ const mimeType = file.mimetype || file.file?.type;
23
+ const url = file.url || file.origin_url;
20
24
  if (mimeType && this.mineTypeMicroSoftSupport().includes(mimeType)) {
21
- this.urlFile.set(`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}`);
22
- return;
25
+ return { ...file, urlFile: `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}` };
23
26
  }
24
- this.urlFile.set(`https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true`);
27
+ return { ...file, urlFile: `https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true` };
28
+ });
29
+ zIndex = input();
30
+ index = model.required();
31
+ data = input.required();
32
+ buttons = input();
33
+ outClose = output();
34
+ constructor(linkImageError) {
35
+ this.linkImageError = linkImageError;
25
36
  }
26
37
  async handlerOnLoad() {
27
38
  this.loading.set(false);
@@ -46,13 +57,39 @@ class LibsUiComponentsPreviewFileComponent {
46
57
  'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
47
58
  ];
48
59
  }
49
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewFileComponent, isStandalone: true, selector: "libs_ui-components-preview_file", inputs: { zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outClose: "outClose" }, ngImport: i0, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [title]=\"data()?.name\"\n [headerConfig]=\"{ ignoreHeaderTheme: true }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between\">\n <div class=\"w-full relative mx-[24px] h-[16px]\">\n <div class=\"flex w-full libs-ui-font-h4s absolute\">\n <!-- <libs_ui-components-popover [type]=\"'text'\"\n [config]=\"{zIndex: zIndex()}\">\n {{ 'i18n_edit_file_name' | translate:{file_name: nameFile()} }}\n </libs_ui-components-popover> -->\n </div>\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex\">\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"urlFile() | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\"></libs_ui-components-skeleton>\n }\n </div>\n</libs_ui-components-modal>\n", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LibsUiComponentsModalComponent, selector: "libs_ui-components-modal", inputs: ["show", "mode", "isBackdropTransparent", "isBackgroundTransparentModal", "isSizeBackdropByWidthHeightInput", "hasShadowBoxWhenHiddenBackDropTransparent", "classIncludeModalWrapper", "zIndex", "width", "height", "maxWidth", "maxHeight", "minWidth", "isFullScreen", "disable", "ignoreCommunicateMicroEvent", "escapeKeyboardCloseModal", "headerConfig", "bodyConfig", "footerConfig", "buttonsFooter", "title", "titleUseXssFilter", "titleUseTooltip", "titleUseInnerText"], outputs: ["showChange", "widthChange", "heightChange", "maxWidthChange", "maxHeightChange", "minWidthChange", "disableChange", "buttonsFooterChange", "outScrollContent", "outEvent", "outFunctionControl"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "component", type: LibsUiComponentsSkeletonComponent, selector: "libs_ui-components-skeleton", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
60
+ handlerPrev() {
61
+ this.index.update((value) => value - 1);
62
+ }
63
+ handlerNext() {
64
+ this.index.update((value) => value + 1);
65
+ }
66
+ async handlerImageError(event) {
67
+ if (!this.linkImageError) {
68
+ return;
69
+ }
70
+ event.target.src = this.linkImageError;
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, deps: [{ token: LINK_IMAGE_ERROR_TOKEN_INJECT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
73
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LibsUiComponentsPreviewFileComponent, isStandalone: true, selector: "libs_ui-components-preview_file", inputs: { zIndex: { classPropertyName: "zIndex", publicName: "zIndex", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, buttons: { classPropertyName: "buttons", publicName: "buttons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", outClose: "outClose" }, ngImport: i0, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [headerConfig]=\"{ ignoreHeaderTheme: true, classButtonCloseInclude: '!mr-[24px]' }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between min-w-0\">\n <div class=\"w-full ml-[24px] mr-[8px] flex justify-between items-center min-w-0 gap-[16px]\">\n <div class=\"w-2/8 flex-1\"></div>\n <div class=\"flex libs-ui-font-h4s min-w-0 w-4/8 justify-center flex-1\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [config]=\"{ zIndex: zIndex() }\">\n {{ fileView()?.name }}\n </libs_ui-components-popover>\n </div>\n @if (buttons()?.length) {\n <div class=\"flex gap-[8px] items-center w-2/8 justify-end flex-1\">\n @for (button of buttons(); track button.key) {\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-third'\"\n [label]=\"button.label || ''\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [iconOnlyType]=\"button.iconOnlyType || false\"\n [classInclude]=\"button.classInclude || '!py-[4px] !px-[12px]'\"\n (outClick)=\"button.action?.(index())\" />\n }\n <div class=\"h-[12px] libs-ui-border-left-general\"></div>\n </div>\n }\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex rounded-b-[8px] overflow-hidden relative\">\n @if (index() > 0) {\n <div class=\"absolute top-[50%] left-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right rotate-180 before:!text-[20px]'\"\n (outClick)=\"handlerPrev()\" />\n </div>\n }\n @if (fileView(); as fileView) {\n @if (fileView | LibsUiPipesCheckFileExtensionPipe: 'image') {\n <div class=\"w-full h-full relative flex items-center justify-center\">\n @if (fileView.url || fileView.origin_url; as url) {\n <img\n [src]=\"url\"\n alt=\"\"\n class=\"max-w-full max-h-full object-contain\"\n (load)=\"handlerOnLoad()\"\n (error)=\"handlerImageError($event)\" />\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n }\n </div>\n } @else {\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"fileView.urlFile | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\" />\n }\n }\n @if (index() < data().length - 1) {\n <div class=\"absolute top-[50%] right-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right before:!text-[20px]'\"\n (outClick)=\"handlerNext()\" />\n </div>\n }\n }\n </div>\n</libs_ui-components-modal>\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LibsUiComponentsModalComponent, selector: "libs_ui-components-modal", inputs: ["show", "mode", "isBackdropTransparent", "isBackgroundTransparentModal", "isSizeBackdropByWidthHeightInput", "hasShadowBoxWhenHiddenBackDropTransparent", "classIncludeModalWrapper", "zIndex", "width", "height", "maxWidth", "maxHeight", "minWidth", "isFullScreen", "disable", "ignoreCommunicateMicroEvent", "escapeKeyboardCloseModal", "headerConfig", "bodyConfig", "footerConfig", "buttonsFooter", "title", "titleUseXssFilter", "titleUseTooltip", "titleUseInnerText"], outputs: ["showChange", "widthChange", "heightChange", "maxWidthChange", "maxHeightChange", "minWidthChange", "disableChange", "buttonsFooterChange", "outScrollContent", "outEvent", "outFunctionControl"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "component", type: LibsUiComponentsSkeletonComponent, selector: "libs_ui-components-skeleton", inputs: ["config"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive", "isHandlerEnterDocumentClickButton"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }, { kind: "pipe", type: LibsUiPipesCheckFileExtensionPipe, name: "LibsUiPipesCheckFileExtensionPipe" }, { kind: "component", type: LibsUiComponentsSpinnerComponent, selector: "libs_ui-components-spinner", inputs: ["type", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
51
74
  }
52
75
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LibsUiComponentsPreviewFileComponent, decorators: [{
53
76
  type: Component,
54
- args: [{ selector: 'libs_ui-components-preview_file', standalone: true, imports: [AsyncPipe, LibsUiComponentsModalComponent, LibsUiPipesSecurityTrustPipe, LibsUiComponentsSkeletonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [title]=\"data()?.name\"\n [headerConfig]=\"{ ignoreHeaderTheme: true }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between\">\n <div class=\"w-full relative mx-[24px] h-[16px]\">\n <div class=\"flex w-full libs-ui-font-h4s absolute\">\n <!-- <libs_ui-components-popover [type]=\"'text'\"\n [config]=\"{zIndex: zIndex()}\">\n {{ 'i18n_edit_file_name' | translate:{file_name: nameFile()} }}\n </libs_ui-components-popover> -->\n </div>\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex\">\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"urlFile() | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\"></libs_ui-components-skeleton>\n }\n </div>\n</libs_ui-components-modal>\n" }]
55
- }] });
77
+ args: [{ selector: 'libs_ui-components-preview_file', standalone: true, imports: [
78
+ AsyncPipe,
79
+ LibsUiComponentsModalComponent,
80
+ LibsUiPipesSecurityTrustPipe,
81
+ LibsUiComponentsSkeletonComponent,
82
+ LibsUiComponentsPopoverComponent,
83
+ LibsUiComponentsButtonsButtonComponent,
84
+ LibsUiPipesCheckFileExtensionPipe,
85
+ LibsUiComponentsSpinnerComponent,
86
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [headerConfig]=\"{ ignoreHeaderTheme: true, classButtonCloseInclude: '!mr-[24px]' }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between min-w-0\">\n <div class=\"w-full ml-[24px] mr-[8px] flex justify-between items-center min-w-0 gap-[16px]\">\n <div class=\"w-2/8 flex-1\"></div>\n <div class=\"flex libs-ui-font-h4s min-w-0 w-4/8 justify-center flex-1\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [config]=\"{ zIndex: zIndex() }\">\n {{ fileView()?.name }}\n </libs_ui-components-popover>\n </div>\n @if (buttons()?.length) {\n <div class=\"flex gap-[8px] items-center w-2/8 justify-end flex-1\">\n @for (button of buttons(); track button.key) {\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-third'\"\n [label]=\"button.label || ''\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [iconOnlyType]=\"button.iconOnlyType || false\"\n [classInclude]=\"button.classInclude || '!py-[4px] !px-[12px]'\"\n (outClick)=\"button.action?.(index())\" />\n }\n <div class=\"h-[12px] libs-ui-border-left-general\"></div>\n </div>\n }\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex rounded-b-[8px] overflow-hidden relative\">\n @if (index() > 0) {\n <div class=\"absolute top-[50%] left-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right rotate-180 before:!text-[20px]'\"\n (outClick)=\"handlerPrev()\" />\n </div>\n }\n @if (fileView(); as fileView) {\n @if (fileView | LibsUiPipesCheckFileExtensionPipe: 'image') {\n <div class=\"w-full h-full relative flex items-center justify-center\">\n @if (fileView.url || fileView.origin_url; as url) {\n <img\n [src]=\"url\"\n alt=\"\"\n class=\"max-w-full max-h-full object-contain\"\n (load)=\"handlerOnLoad()\"\n (error)=\"handlerImageError($event)\" />\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n }\n </div>\n } @else {\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"fileView.urlFile | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\" />\n }\n }\n @if (index() < data().length - 1) {\n <div class=\"absolute top-[50%] right-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right before:!text-[20px]'\"\n (outClick)=\"handlerNext()\" />\n </div>\n }\n }\n </div>\n</libs_ui-components-modal>\n" }]
87
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
88
+ type: Optional
89
+ }, {
90
+ type: Inject,
91
+ args: [LINK_IMAGE_ERROR_TOKEN_INJECT]
92
+ }] }] });
56
93
 
57
94
  /**
58
95
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"libs-ui-components-preview-file.mjs","sources":["../../../../../libs-ui/components/preview-file/src/preview-file.component.ts","../../../../../libs-ui/components/preview-file/src/preview-file.component.html","../../../../../libs-ui/components/preview-file/src/libs-ui-components-preview-file.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, OnInit, output, signal } from '@angular/core';\nimport { LibsUiComponentsModalComponent, TYPE_MODAL_EVENT } from '@libs-ui/components-modal';\nimport { LibsUiComponentsSkeletonComponent } from '@libs-ui/components-skeleton';\nimport { IFile } from '@libs-ui/interfaces-types';\nimport { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-preview_file',\n templateUrl: './preview-file.component.html',\n styleUrl: './preview-file.component.scss',\n standalone: true,\n imports: [AsyncPipe, LibsUiComponentsModalComponent, LibsUiPipesSecurityTrustPipe, LibsUiComponentsSkeletonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LibsUiComponentsPreviewFileComponent implements OnInit {\n protected loading = signal(true);\n protected urlFile = signal<string>('');\n\n readonly zIndex = input<number>();\n readonly data = input<IFile>();\n\n readonly outClose = output<void>();\n\n ngOnInit() {\n if (!this.data() || (!this.data()?.url && !this.data()?.origin_url)) {\n return;\n }\n const mimeType = this.data()?.mimetype || this.data()?.file?.type;\n const url = this.data()?.url || this.data()?.origin_url;\n if (mimeType && this.mineTypeMicroSoftSupport().includes(mimeType)) {\n this.urlFile.set(`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}`);\n return;\n }\n this.urlFile.set(`https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true`);\n }\n\n protected async handlerOnLoad() {\n this.loading.set(false);\n }\n\n protected async handlerClose(type: TYPE_MODAL_EVENT) {\n if (type === 'close') {\n this.outClose.emit();\n }\n }\n\n private mineTypeMicroSoftSupport() {\n return [\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel.sheet.macroEnabled.12',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'application/vnd.ms-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n ];\n }\n}\n","<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [title]=\"data()?.name\"\n [headerConfig]=\"{ ignoreHeaderTheme: true }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between\">\n <div class=\"w-full relative mx-[24px] h-[16px]\">\n <div class=\"flex w-full libs-ui-font-h4s absolute\">\n <!-- <libs_ui-components-popover [type]=\"'text'\"\n [config]=\"{zIndex: zIndex()}\">\n {{ 'i18n_edit_file_name' | translate:{file_name: nameFile()} }}\n </libs_ui-components-popover> -->\n </div>\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex\">\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"urlFile() | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\"></libs_ui-components-skeleton>\n }\n </div>\n</libs_ui-components-modal>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAea,oCAAoC,CAAA;AACrC,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;AACtB,IAAA,OAAO,GAAG,MAAM,CAAS,EAAE,CAAC;IAE7B,MAAM,GAAG,KAAK,EAAU;IACxB,IAAI,GAAG,KAAK,EAAS;IAErB,QAAQ,GAAG,MAAM,EAAQ;IAElC,QAAQ,GAAA;QACN,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,EAAE;YACnE;QACF;AACA,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI;AACjE,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,UAAU;AACvD,QAAA,IAAI,QAAQ,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAClE,YAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA,mDAAA,EAAsD,kBAAkB,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA,CAAE,CAAC;YACvG;QACF;AACA,QAAA,IAAI,CAAC,OAAO,CAAC,GAA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ui/components/preview-file/src/preview-file.component.html","../../../../../libs-ui/components/preview-file/src/libs-ui-components-preview-file.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, Inject, input, model, Optional, output, signal, untracked } from '@angular/core';\nimport { IButton, LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';\nimport { LibsUiComponentsModalComponent, TYPE_MODAL_EVENT } from '@libs-ui/components-modal';\nimport { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';\nimport { LibsUiComponentsSkeletonComponent } from '@libs-ui/components-skeleton';\nimport { LibsUiComponentsSpinnerComponent } from '@libs-ui/components-spinner';\nimport { IEvent, IFile } from '@libs-ui/interfaces-types';\nimport { LibsUiPipesCheckFileExtensionPipe } from '@libs-ui/pipes-check-file-extension';\nimport { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';\nimport { LINK_IMAGE_ERROR_TOKEN_INJECT } from '@libs-ui/utils';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-preview_file',\n templateUrl: './preview-file.component.html',\n standalone: true,\n imports: [\n AsyncPipe,\n LibsUiComponentsModalComponent,\n LibsUiPipesSecurityTrustPipe,\n LibsUiComponentsSkeletonComponent,\n LibsUiComponentsPopoverComponent,\n LibsUiComponentsButtonsButtonComponent,\n LibsUiPipesCheckFileExtensionPipe,\n LibsUiComponentsSpinnerComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LibsUiComponentsPreviewFileComponent {\n protected loading = signal(true);\n protected fileView = computed(() => {\n const file = this.data()[this.index()];\n\n if (!file) {\n return null;\n }\n untracked(() => this.loading.set(true));\n const mimeType = file.mimetype || file.file?.type;\n const url = file.url || file.origin_url;\n\n if (mimeType && this.mineTypeMicroSoftSupport().includes(mimeType)) {\n return { ...file, urlFile: `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(url || '')}` };\n }\n\n return { ...file, urlFile: `https://docs.google.com/a/umd.edu/viewer?url=${encodeURIComponent(url || '')}&embedded=true` };\n });\n\n readonly zIndex = input<number>();\n readonly index = model.required<number>();\n readonly data = input.required<IFile[]>();\n readonly buttons = input<IButton[]>();\n\n readonly outClose = output<void>();\n\n constructor(@Optional() @Inject(LINK_IMAGE_ERROR_TOKEN_INJECT) private linkImageError: string) {}\n\n protected async handlerOnLoad() {\n this.loading.set(false);\n }\n\n protected async handlerClose(type: TYPE_MODAL_EVENT) {\n if (type === 'close') {\n this.outClose.emit();\n }\n }\n\n private mineTypeMicroSoftSupport() {\n return [\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel.sheet.macroEnabled.12',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'application/vnd.ms-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n ];\n }\n\n protected handlerPrev() {\n this.index.update((value) => value - 1);\n }\n\n protected handlerNext() {\n this.index.update((value) => value + 1);\n }\n\n protected async handlerImageError(event: Event) {\n if (!this.linkImageError) {\n return;\n }\n (event as IEvent).target.src = this.linkImageError;\n }\n}\n","<libs_ui-components-modal\n [minWidth]=\"'1200px'\"\n [headerConfig]=\"{ ignoreHeaderTheme: true, classButtonCloseInclude: '!mr-[24px]' }\"\n [bodyConfig]=\"{ classInclude: '!p-0', scrollOverlayOptions: { scrollX: 'hidden', scrollY: 'hidden' } }\"\n [footerConfig]=\"{ hidden: true }\"\n [zIndex]=\"zIndex()\"\n [buttonsFooter]=\"[]\"\n [mode]=\"'center'\"\n (outEvent)=\"handlerClose($event)\">\n <div class=\"libs-ui-modal-header-custom w-full flex items-center justify-between min-w-0\">\n <div class=\"w-full ml-[24px] mr-[8px] flex justify-between items-center min-w-0 gap-[16px]\">\n <div class=\"w-2/8 flex-1\"></div>\n <div class=\"flex libs-ui-font-h4s min-w-0 w-4/8 justify-center flex-1\">\n <libs_ui-components-popover\n [type]=\"'text'\"\n [config]=\"{ zIndex: zIndex() }\">\n {{ fileView()?.name }}\n </libs_ui-components-popover>\n </div>\n @if (buttons()?.length) {\n <div class=\"flex gap-[8px] items-center w-2/8 justify-end flex-1\">\n @for (button of buttons(); track button.key) {\n <libs_ui-components-buttons-button\n [type]=\"button.type || 'button-third'\"\n [label]=\"button.label || ''\"\n [classIconLeft]=\"button.classIconLeft || ''\"\n [iconOnlyType]=\"button.iconOnlyType || false\"\n [classInclude]=\"button.classInclude || '!py-[4px] !px-[12px]'\"\n (outClick)=\"button.action?.(index())\" />\n }\n <div class=\"h-[12px] libs-ui-border-left-general\"></div>\n </div>\n }\n </div>\n </div>\n <div class=\"libs-ui-modal-body-custom h-full w-full flex rounded-b-[8px] overflow-hidden relative\">\n @if (index() > 0) {\n <div class=\"absolute top-[50%] left-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right rotate-180 before:!text-[20px]'\"\n (outClick)=\"handlerPrev()\" />\n </div>\n }\n @if (fileView(); as fileView) {\n @if (fileView | LibsUiPipesCheckFileExtensionPipe: 'image') {\n <div class=\"w-full h-full relative flex items-center justify-center\">\n @if (fileView.url || fileView.origin_url; as url) {\n <img\n [src]=\"url\"\n alt=\"\"\n class=\"max-w-full max-h-full object-contain\"\n (load)=\"handlerOnLoad()\"\n (error)=\"handlerImageError($event)\" />\n @if (loading()) {\n <libs_ui-components-spinner [size]=\"'medium'\" />\n }\n }\n </div>\n } @else {\n <iframe\n id=\"google\"\n [class.hidden]=\"loading()\"\n [src]=\"fileView.urlFile | LibsUiPipesSecurityTrustPipe: 'resourceUrl' | async\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen=\"allowfullscreen\"\n (load)=\"handlerOnLoad()\"></iframe>\n @if (loading()) {\n <libs_ui-components-skeleton [class]=\"'w-full h-full'\" />\n }\n }\n @if (index() < data().length - 1) {\n <div class=\"absolute top-[50%] right-[24px] transform -translate-y-[50%]\">\n <libs_ui-components-buttons-button\n [type]=\"'button-outline'\"\n [iconOnlyType]=\"true\"\n [classInclude]=\"'!p-[11px] !rounded-[8px]'\"\n [classIconLeft]=\"'libs-ui-icon-chevron-right before:!text-[20px]'\"\n (outClick)=\"handlerNext()\" />\n </div>\n }\n }\n </div>\n</libs_ui-components-modal>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MA6Ba,oCAAoC,CAAA;AA0BwB,IAAA,cAAA;AAzB7D,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;AACtB,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;AACjC,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,IAAI;QACb;AACA,QAAA,SAAS,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU;AAEvC,QAAA,IAAI,QAAQ,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AAClE,YAAA,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAA,mDAAA,EAAsD,kBAAkB,CAAC,G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,EAAA,OAAA,EACP;wBACP,SAAS;wBACT,8BAA8B;wBAC9B,4BAA4B;wBAC5B,iCAAiC;wBACjC,gCAAgC;wBAChC,sCAAsC;wBACtC,iCAAiC;wBACjC,gCAAgC;qBACjC,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,stHAAA,EAAA;;0BA4BlC;;0BAAY,MAAM;2BAAC,6BAA6B;;;AEvD/D;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@libs-ui/components-preview-file",
3
- "version": "0.2.348-8",
3
+ "version": "0.2.350-1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
7
- "@libs-ui/components-modal": "0.2.348-8",
8
- "@libs-ui/components-skeleton": "0.2.348-8",
9
- "@libs-ui/interfaces-types": "0.2.348-8",
10
- "@libs-ui/pipes-security-trust": "0.2.348-8"
7
+ "@libs-ui/components-modal": "0.2.350-1",
8
+ "@libs-ui/components-skeleton": "0.2.350-1",
9
+ "@libs-ui/interfaces-types": "0.2.350-1",
10
+ "@libs-ui/pipes-security-trust": "0.2.350-1"
11
11
  },
12
12
  "sideEffects": false,
13
13
  "module": "fesm2022/libs-ui-components-preview-file.mjs",
@@ -1,17 +1,38 @@
1
- import { OnInit } from '@angular/core';
1
+ import { IButton } from '@libs-ui/components-buttons-button';
2
2
  import { TYPE_MODAL_EVENT } from '@libs-ui/components-modal';
3
3
  import { IFile } from '@libs-ui/interfaces-types';
4
4
  import * as i0 from "@angular/core";
5
- export declare class LibsUiComponentsPreviewFileComponent implements OnInit {
5
+ export declare class LibsUiComponentsPreviewFileComponent {
6
+ private linkImageError;
6
7
  protected loading: import("@angular/core").WritableSignal<boolean>;
7
- protected urlFile: import("@angular/core").WritableSignal<string>;
8
+ protected fileView: import("@angular/core").Signal<{
9
+ urlFile: string;
10
+ id?: string;
11
+ name?: string;
12
+ file?: File;
13
+ size?: string;
14
+ isUploading?: boolean;
15
+ percentUploading?: number;
16
+ isUpdate?: boolean;
17
+ url?: string;
18
+ origin_url?: string;
19
+ mimetype?: string;
20
+ type?: import("@libs-ui/interfaces-types").TYPE_FILE;
21
+ error?: string;
22
+ isAvatar?: boolean;
23
+ } | null>;
8
24
  readonly zIndex: import("@angular/core").InputSignal<number | undefined>;
9
- readonly data: import("@angular/core").InputSignal<IFile | undefined>;
25
+ readonly index: import("@angular/core").ModelSignal<number>;
26
+ readonly data: import("@angular/core").InputSignal<IFile[]>;
27
+ readonly buttons: import("@angular/core").InputSignal<IButton[] | undefined>;
10
28
  readonly outClose: import("@angular/core").OutputEmitterRef<void>;
11
- ngOnInit(): void;
29
+ constructor(linkImageError: string);
12
30
  protected handlerOnLoad(): Promise<void>;
13
31
  protected handlerClose(type: TYPE_MODAL_EVENT): Promise<void>;
14
32
  private mineTypeMicroSoftSupport;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsPreviewFileComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsPreviewFileComponent, "libs_ui-components-preview_file", never, { "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, { "outClose": "outClose"; }, never, never, true, never>;
33
+ protected handlerPrev(): void;
34
+ protected handlerNext(): void;
35
+ protected handlerImageError(event: Event): Promise<void>;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsPreviewFileComponent, [{ optional: true; }]>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsPreviewFileComponent, "libs_ui-components-preview_file", never, { "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "buttons": { "alias": "buttons"; "required": false; "isSignal": true; }; }, { "index": "indexChange"; "outClose": "outClose"; }, never, never, true, never>;
17
38
  }