@shival99/z-ui 2.0.18 → 2.0.20

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.
Files changed (31) hide show
  1. package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +1 -1
  2. package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
  3. package/fesm2022/shival99-z-ui-components-z-calendar.mjs +1 -1
  4. package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
  5. package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +1 -1
  6. package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -1
  7. package/fesm2022/shival99-z-ui-components-z-editor.mjs +27 -7
  8. package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
  9. package/fesm2022/shival99-z-ui-components-z-filter.mjs +1 -1
  10. package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
  11. package/fesm2022/shival99-z-ui-components-z-gallery.mjs +102 -40
  12. package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
  13. package/fesm2022/shival99-z-ui-components-z-input.mjs +1 -1
  14. package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
  15. package/fesm2022/shival99-z-ui-components-z-menu.mjs +2 -2
  16. package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
  17. package/fesm2022/shival99-z-ui-components-z-popover.mjs +20 -6
  18. package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
  19. package/fesm2022/shival99-z-ui-components-z-select.mjs +1 -1
  20. package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
  21. package/fesm2022/shival99-z-ui-components-z-table.mjs +7 -3
  22. package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
  23. package/fesm2022/shival99-z-ui-components-z-tabs.mjs +1 -1
  24. package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
  25. package/package.json +1 -1
  26. package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
  27. package/types/shival99-z-ui-components-z-editor.d.ts +4 -1
  28. package/types/shival99-z-ui-components-z-gallery.d.ts +16 -4
  29. package/types/shival99-z-ui-components-z-popover.d.ts +6 -2
  30. package/types/shival99-z-ui-components-z-select.d.ts +1 -1
  31. package/types/shival99-z-ui-components-z-table.d.ts +2 -1
@@ -13,7 +13,6 @@ import { zMergeClasses } from '@shival99/z-ui/utils';
13
13
  import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
14
14
  import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
15
15
  import { DomSanitizer } from '@angular/platform-browser';
16
- import { ZSafeResourceUrlPipe } from '@shival99/z-ui/pipes';
17
16
  import { cva } from 'class-variance-authority';
18
17
  import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
19
18
  import { ComponentPortal } from '@angular/cdk/portal';
@@ -130,15 +129,15 @@ const getFileCategory = (file) => {
130
129
  if (type === 'application/pdf' || ext === 'pdf') {
131
130
  return 'pdf';
132
131
  }
133
- if (type.includes('word') || type.includes('document') || WORD_EXTENSIONS.includes(ext)) {
134
- return 'word';
135
- }
136
132
  if (type.includes('excel') || type.includes('spreadsheet') || EXCEL_EXTENSIONS.includes(ext)) {
137
133
  return 'excel';
138
134
  }
139
135
  if (type.includes('powerpoint') || type.includes('presentation') || POWERPOINT_EXTENSIONS.includes(ext)) {
140
136
  return 'powerpoint';
141
137
  }
138
+ if (type.includes('word') || type.includes('wordprocessingml') || WORD_EXTENSIONS.includes(ext)) {
139
+ return 'word';
140
+ }
142
141
  if (type.startsWith('video/') || VIDEO_EXTENSIONS.includes(ext)) {
143
142
  return 'video';
144
143
  }
@@ -386,7 +385,7 @@ class ZGalleryItemComponent {
386
385
  </div>
387
386
 
388
387
  <div class="p-3">
389
- <p class="text-foreground truncate text-sm leading-none font-semibold" z-tooltip [zContent]="file().name">
388
+ <p class="text-foreground truncate text-sm leading-normal font-semibold" z-tooltip [zContent]="file().name">
390
389
  {{ file().name }}
391
390
  </p>
392
391
  @if (formattedDate()) {
@@ -611,7 +610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
611
610
  </div>
612
611
 
613
612
  <div class="p-3">
614
- <p class="text-foreground truncate text-sm leading-none font-semibold" z-tooltip [zContent]="file().name">
613
+ <p class="text-foreground truncate text-sm leading-normal font-semibold" z-tooltip [zContent]="file().name">
615
614
  {{ file().name }}
616
615
  </p>
617
616
  @if (formattedDate()) {
@@ -727,6 +726,7 @@ class ZGalleryPreviewComponent {
727
726
  file = input.required(...(ngDevMode ? [{ debugName: "file" }] : []));
728
727
  files = input([], ...(ngDevMode ? [{ debugName: "files" }] : []));
729
728
  zShowRemove = input(false, ...(ngDevMode ? [{ debugName: "zShowRemove" }] : []));
729
+ zTrustedResourceOrigins = input([], ...(ngDevMode ? [{ debugName: "zTrustedResourceOrigins" }] : []));
730
730
  zOnClose = output();
731
731
  zOnDownload = output();
732
732
  zOnNavigate = output();
@@ -781,8 +781,9 @@ class ZGalleryPreviewComponent {
781
781
  await this._loadText(url);
782
782
  }
783
783
  }
784
- catch {
785
- this.conversionError.set('Failed to load file content');
784
+ catch (error) {
785
+ const message = error instanceof Error ? error.message : 'Failed to load file content';
786
+ this.conversionError.set(message);
786
787
  }
787
788
  finally {
788
789
  this.isConverting.set(false);
@@ -791,15 +792,19 @@ class ZGalleryPreviewComponent {
791
792
  }
792
793
  async _loadDocx(url) {
793
794
  const response = await fetch(url);
795
+ this._assertSuccessfulResponse(response);
794
796
  const arrayBuffer = await response.arrayBuffer();
795
- const mammoth = await import('mammoth');
797
+ const mammothModule = await import('mammoth');
798
+ const mammoth = mammothModule.default ?? mammothModule;
796
799
  const result = await mammoth.convertToHtml({ arrayBuffer });
797
800
  this.docHtmlContent.set(this._sanitizer.bypassSecurityTrustHtml(result.value));
798
801
  }
799
802
  async _loadExcel(url) {
800
803
  const response = await fetch(url);
804
+ this._assertSuccessfulResponse(response);
801
805
  const arrayBuffer = await response.arrayBuffer();
802
- const XLSX = await import('xlsx');
806
+ const xlsxModule = await import('xlsx');
807
+ const XLSX = xlsxModule.default ?? xlsxModule;
803
808
  const workbook = XLSX.read(arrayBuffer);
804
809
  const firstSheet = workbook.Sheets[workbook.SheetNames[0]];
805
810
  const html = XLSX.utils.sheet_to_html(firstSheet);
@@ -807,9 +812,15 @@ class ZGalleryPreviewComponent {
807
812
  }
808
813
  async _loadText(url) {
809
814
  const response = await fetch(url);
815
+ this._assertSuccessfulResponse(response);
810
816
  const text = await response.text();
811
817
  this.textContent.set(text);
812
818
  }
819
+ _assertSuccessfulResponse(response) {
820
+ if (!response.ok) {
821
+ throw new Error(`Failed to fetch file: ${response.status}`);
822
+ }
823
+ }
813
824
  _completeLoading() {
814
825
  const elapsed = Date.now() - this._loadingStartTime;
815
826
  const remaining = this._minLoadingTime - elapsed;
@@ -828,6 +839,16 @@ class ZGalleryPreviewComponent {
828
839
  hasNext = computed(() => this.currentIndex() < this.files().length - 1, ...(ngDevMode ? [{ debugName: "hasNext" }] : []));
829
840
  isImageFile = computed(() => isImage(this.file()), ...(ngDevMode ? [{ debugName: "isImageFile" }] : []));
830
841
  isPdf = computed(() => getFileCategory(this.file()) === 'pdf', ...(ngDevMode ? [{ debugName: "isPdf" }] : []));
842
+ safePdfUrl = computed(() => {
843
+ const { url } = this.file();
844
+ if (!url) {
845
+ return null;
846
+ }
847
+ if (!this._isAllowedResourceUrl(url)) {
848
+ return null;
849
+ }
850
+ return this._sanitizer.bypassSecurityTrustResourceUrl(url);
851
+ }, ...(ngDevMode ? [{ debugName: "safePdfUrl" }] : []));
831
852
  isVideo = computed(() => getFileCategory(this.file()) === 'video', ...(ngDevMode ? [{ debugName: "isVideo" }] : []));
832
853
  isWordFile = computed(() => getFileCategory(this.file()) === 'word', ...(ngDevMode ? [{ debugName: "isWordFile" }] : []));
833
854
  isExcelFile = computed(() => getFileCategory(this.file()) === 'excel', ...(ngDevMode ? [{ debugName: "isExcelFile" }] : []));
@@ -842,6 +863,31 @@ class ZGalleryPreviewComponent {
842
863
  const zoom = this.zoomed() ? 'scale(1.5)' : 'scale(1)';
843
864
  return `rotate(${rot}deg) ${zoom}`;
844
865
  }, ...(ngDevMode ? [{ debugName: "imageTransform" }] : []));
866
+ _isAllowedResourceUrl(url) {
867
+ const currentOrigin = globalThis.location?.origin;
868
+ const baseUrl = currentOrigin ?? 'http://localhost';
869
+ try {
870
+ const parsedUrl = new URL(url, baseUrl);
871
+ if (parsedUrl.protocol === 'blob:') {
872
+ return parsedUrl.origin === baseUrl;
873
+ }
874
+ return parsedUrl.origin === baseUrl || this._trustedOrigins().has(parsedUrl.origin);
875
+ }
876
+ catch {
877
+ return false;
878
+ }
879
+ }
880
+ _trustedOrigins = computed(() => new Set(this.zTrustedResourceOrigins()
881
+ .map(origin => this._normalizeOrigin(origin))
882
+ .filter((origin) => Boolean(origin))), ...(ngDevMode ? [{ debugName: "_trustedOrigins" }] : []));
883
+ _normalizeOrigin(origin) {
884
+ try {
885
+ return new URL(origin).origin;
886
+ }
887
+ catch {
888
+ return null;
889
+ }
890
+ }
845
891
  fileIcon = computed(() => {
846
892
  const category = getFileCategory(this.file());
847
893
  const iconMap = {
@@ -930,7 +976,7 @@ class ZGalleryPreviewComponent {
930
976
  }
931
977
  }
932
978
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
933
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZGalleryPreviewComponent, isStandalone: true, selector: "z-gallery-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, zShowRemove: { classPropertyName: "zShowRemove", publicName: "zShowRemove", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnClose: "zOnClose", zOnDownload: "zOnDownload", zOnNavigate: "zOnNavigate", zOnRemove: "zOnRemove" }, host: { listeners: { "document:keydown": "onKeyDown($event)" }, classAttribute: "z-gallery-preview z-[9999]" }, ngImport: i0, template: `
979
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZGalleryPreviewComponent, isStandalone: true, selector: "z-gallery-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, zShowRemove: { classPropertyName: "zShowRemove", publicName: "zShowRemove", isSignal: true, isRequired: false, transformFunction: null }, zTrustedResourceOrigins: { classPropertyName: "zTrustedResourceOrigins", publicName: "zTrustedResourceOrigins", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnClose: "zOnClose", zOnDownload: "zOnDownload", zOnNavigate: "zOnNavigate", zOnRemove: "zOnRemove" }, host: { listeners: { "document:keydown": "onKeyDown($event)" }, classAttribute: "z-gallery-preview z-[9999]" }, ngImport: i0, template: `
934
980
  <div
935
981
  class="animate-in fade-in fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm duration-200"
936
982
  (click)="onBackdropClick($event)"
@@ -1060,17 +1106,19 @@ class ZGalleryPreviewComponent {
1060
1106
  (click)="toggleZoom()"
1061
1107
  />
1062
1108
  </div>
1063
- } @else if (isPdf()) {
1109
+ } @else if (isPdf() && safePdfUrl()) {
1064
1110
  <div class="relative h-[75vh] w-[85vw]">
1065
1111
  @if (isLoading()) {
1066
1112
  <z-skeleton class="absolute inset-0 rounded-lg" />
1067
1113
  }
1068
1114
  <iframe
1069
- [src]="file().url | zSafeResourceUrl"
1115
+ [src]="safePdfUrl()"
1070
1116
  class="absolute inset-0 size-full rounded-lg bg-white shadow-2xl transition-opacity duration-300"
1071
1117
  [class.opacity-0]="isLoading()"
1072
1118
  [class.opacity-100]="!isLoading()"
1073
1119
  frameborder="0"
1120
+ sandbox
1121
+ referrerpolicy="no-referrer"
1074
1122
  (load)="onPdfLoad()"
1075
1123
  ></iframe>
1076
1124
  </div>
@@ -1109,7 +1157,7 @@ class ZGalleryPreviewComponent {
1109
1157
  </div>
1110
1158
  } @else if (docHtmlContent()) {
1111
1159
  <div
1112
- class="absolute inset-0 overflow-auto rounded-lg bg-white p-8 shadow-2xl"
1160
+ class="absolute inset-0 overflow-auto rounded-lg bg-white p-8 text-gray-950 shadow-2xl"
1113
1161
  [innerHTML]="docHtmlContent()"
1114
1162
  ></div>
1115
1163
  }
@@ -1131,7 +1179,7 @@ class ZGalleryPreviewComponent {
1131
1179
  </div>
1132
1180
  } @else if (docHtmlContent()) {
1133
1181
  <div
1134
- class="absolute inset-0 overflow-auto rounded-lg bg-white p-4 shadow-2xl"
1182
+ class="absolute inset-0 overflow-auto rounded-lg bg-white p-4 text-gray-950 shadow-2xl"
1135
1183
  [innerHTML]="docHtmlContent()"
1136
1184
  ></div>
1137
1185
  }
@@ -1182,20 +1230,13 @@ class ZGalleryPreviewComponent {
1182
1230
  </div>
1183
1231
  </div>
1184
1232
  </div>
1185
- `, isInline: true, dependencies: [{ kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTooltipPosition", "zTrigger", "zTooltipTrigger", "zTooltipType", "zTooltipSize", "zClass", "zTooltipClass", "zShowDelay", "zTooltipShowDelay", "zHideDelay", "zTooltipHideDelay", "zArrow", "zTooltipArrow", "zDisabled", "zTooltipDisabled", "zOffset", "zTooltipOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "pipe", type: ZSafeResourceUrlPipe, name: "zSafeResourceUrl" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1233
+ `, isInline: true, dependencies: [{ kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTooltipPosition", "zTrigger", "zTooltipTrigger", "zTooltipType", "zTooltipSize", "zClass", "zTooltipClass", "zShowDelay", "zTooltipShowDelay", "zHideDelay", "zTooltipHideDelay", "zArrow", "zTooltipArrow", "zDisabled", "zTooltipDisabled", "zOffset", "zTooltipOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1186
1234
  }
1187
1235
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryPreviewComponent, decorators: [{
1188
1236
  type: Component,
1189
1237
  args: [{
1190
1238
  selector: 'z-gallery-preview',
1191
- imports: [
1192
- ZButtonComponent,
1193
- ZIconComponent,
1194
- ZSkeletonComponent,
1195
- ZTooltipDirective,
1196
- ZSafeResourceUrlPipe,
1197
- TranslatePipe,
1198
- ],
1239
+ imports: [ZButtonComponent, ZIconComponent, ZSkeletonComponent, ZTooltipDirective, TranslatePipe],
1199
1240
  standalone: true,
1200
1241
  template: `
1201
1242
  <div
@@ -1327,17 +1368,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1327
1368
  (click)="toggleZoom()"
1328
1369
  />
1329
1370
  </div>
1330
- } @else if (isPdf()) {
1371
+ } @else if (isPdf() && safePdfUrl()) {
1331
1372
  <div class="relative h-[75vh] w-[85vw]">
1332
1373
  @if (isLoading()) {
1333
1374
  <z-skeleton class="absolute inset-0 rounded-lg" />
1334
1375
  }
1335
1376
  <iframe
1336
- [src]="file().url | zSafeResourceUrl"
1377
+ [src]="safePdfUrl()"
1337
1378
  class="absolute inset-0 size-full rounded-lg bg-white shadow-2xl transition-opacity duration-300"
1338
1379
  [class.opacity-0]="isLoading()"
1339
1380
  [class.opacity-100]="!isLoading()"
1340
1381
  frameborder="0"
1382
+ sandbox
1383
+ referrerpolicy="no-referrer"
1341
1384
  (load)="onPdfLoad()"
1342
1385
  ></iframe>
1343
1386
  </div>
@@ -1376,7 +1419,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1376
1419
  </div>
1377
1420
  } @else if (docHtmlContent()) {
1378
1421
  <div
1379
- class="absolute inset-0 overflow-auto rounded-lg bg-white p-8 shadow-2xl"
1422
+ class="absolute inset-0 overflow-auto rounded-lg bg-white p-8 text-gray-950 shadow-2xl"
1380
1423
  [innerHTML]="docHtmlContent()"
1381
1424
  ></div>
1382
1425
  }
@@ -1398,7 +1441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1398
1441
  </div>
1399
1442
  } @else if (docHtmlContent()) {
1400
1443
  <div
1401
- class="absolute inset-0 overflow-auto rounded-lg bg-white p-4 shadow-2xl"
1444
+ class="absolute inset-0 overflow-auto rounded-lg bg-white p-4 text-gray-950 shadow-2xl"
1402
1445
  [innerHTML]="docHtmlContent()"
1403
1446
  ></div>
1404
1447
  }
@@ -1457,7 +1500,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1457
1500
  '(document:keydown)': 'onKeyDown($event)',
1458
1501
  },
1459
1502
  }]
1460
- }], ctorParameters: () => [], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], zShowRemove: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowRemove", required: false }] }], zOnClose: [{ type: i0.Output, args: ["zOnClose"] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnNavigate: [{ type: i0.Output, args: ["zOnNavigate"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }] } });
1503
+ }], ctorParameters: () => [], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], zShowRemove: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowRemove", required: false }] }], zTrustedResourceOrigins: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTrustedResourceOrigins", required: false }] }], zOnClose: [{ type: i0.Output, args: ["zOnClose"] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnNavigate: [{ type: i0.Output, args: ["zOnNavigate"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }] } });
1461
1504
 
1462
1505
  const zGalleryVariants = cva('z-gallery', {
1463
1506
  variants: {
@@ -1528,12 +1571,15 @@ class ZGalleryComponent {
1528
1571
  zMode = model('grid', ...(ngDevMode ? [{ debugName: "zMode" }] : []));
1529
1572
  zSize = input('default', ...(ngDevMode ? [{ debugName: "zSize" }] : []));
1530
1573
  zColumns = input(4, ...(ngDevMode ? [{ debugName: "zColumns" }] : []));
1574
+ zItemWidth = input(null, ...(ngDevMode ? [{ debugName: "zItemWidth" }] : []));
1531
1575
  zShowDownload = input(true, ...(ngDevMode ? [{ debugName: "zShowDownload" }] : []));
1532
1576
  zShowPreview = input(true, ...(ngDevMode ? [{ debugName: "zShowPreview" }] : []));
1533
1577
  zShowRemove = input(false, ...(ngDevMode ? [{ debugName: "zShowRemove" }] : []));
1578
+ zTrustedResourceOrigins = input([], ...(ngDevMode ? [{ debugName: "zTrustedResourceOrigins" }] : []));
1534
1579
  zShowModeToggle = input(true, ...(ngDevMode ? [{ debugName: "zShowModeToggle" }] : []));
1535
1580
  zShowSearch = input(false, ...(ngDevMode ? [{ debugName: "zShowSearch" }] : []));
1536
1581
  zServerSearch = input(false, ...(ngDevMode ? [{ debugName: "zServerSearch" }] : []));
1582
+ zSearchDebounce = input(300, ...(ngDevMode ? [{ debugName: "zSearchDebounce" }] : []));
1537
1583
  zSearchPlaceholder = input('Search files...', ...(ngDevMode ? [{ debugName: "zSearchPlaceholder" }] : []));
1538
1584
  zToggleSize = input('default', ...(ngDevMode ? [{ debugName: "zToggleSize" }] : []));
1539
1585
  zTitle = input('', ...(ngDevMode ? [{ debugName: "zTitle" }] : []));
@@ -1552,12 +1598,16 @@ class ZGalleryComponent {
1552
1598
  zOnAction = output();
1553
1599
  modeIndex = signal(0, ...(ngDevMode ? [{ debugName: "modeIndex" }] : []));
1554
1600
  previewFile = signal(null, ...(ngDevMode ? [{ debugName: "previewFile" }] : []));
1601
+ searchInputQuery = signal('', ...(ngDevMode ? [{ debugName: "searchInputQuery" }] : []));
1555
1602
  searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : []));
1556
1603
  currentMode = computed(() => {
1557
1604
  const index = this.modeIndex();
1558
1605
  return index === 1 ? 'list' : 'grid';
1559
1606
  }, ...(ngDevMode ? [{ debugName: "currentMode" }] : []));
1560
1607
  gridColumnsClass = computed(() => {
1608
+ if (this.zItemWidth()) {
1609
+ return 'justify-start';
1610
+ }
1561
1611
  const cols = this.zColumns();
1562
1612
  switch (cols) {
1563
1613
  case 1:
@@ -1576,6 +1626,10 @@ class ZGalleryComponent {
1576
1626
  return `grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-${cols}`;
1577
1627
  }
1578
1628
  }, ...(ngDevMode ? [{ debugName: "gridColumnsClass" }] : []));
1629
+ gridTemplateColumns = computed(() => {
1630
+ const itemWidth = this.zItemWidth();
1631
+ return itemWidth ? `repeat(auto-fill, minmax(${itemWidth}, ${itemWidth}))` : null;
1632
+ }, ...(ngDevMode ? [{ debugName: "gridTemplateColumns" }] : []));
1579
1633
  containerClasses = computed(() => zMergeClasses(zGalleryVariants({ zSize: this.zSize() }), this.zClass()), ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
1580
1634
  showHeader = computed(() => this.zTitle() || this.zShowSearch() || (this.zShowModeToggle() && this.zFiles().length > 0), ...(ngDevMode ? [{ debugName: "showHeader" }] : []));
1581
1635
  toggleIconSize = computed(() => {
@@ -1638,8 +1692,9 @@ class ZGalleryComponent {
1638
1692
  });
1639
1693
  }
1640
1694
  onSearchChange(query) {
1641
- this.searchQuery.set(query);
1642
- this.zSearchChange.emit(query);
1695
+ const normalizedQuery = String(query ?? '');
1696
+ this.searchQuery.set(normalizedQuery);
1697
+ this.zSearchChange.emit(normalizedQuery);
1643
1698
  }
1644
1699
  onDownload(file) {
1645
1700
  this.zOnDownload.emit(file);
@@ -1730,7 +1785,7 @@ class ZGalleryComponent {
1730
1785
  selectedFiles.forEach(file => this.onDownload(file));
1731
1786
  }
1732
1787
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1733
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZGalleryComponent, isStandalone: true, selector: "z-gallery", inputs: { zFiles: { classPropertyName: "zFiles", publicName: "zFiles", isSignal: true, isRequired: false, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zColumns: { classPropertyName: "zColumns", publicName: "zColumns", isSignal: true, isRequired: false, transformFunction: null }, zShowDownload: { classPropertyName: "zShowDownload", publicName: "zShowDownload", isSignal: true, isRequired: false, transformFunction: null }, zShowPreview: { classPropertyName: "zShowPreview", publicName: "zShowPreview", isSignal: true, isRequired: false, transformFunction: null }, zShowRemove: { classPropertyName: "zShowRemove", publicName: "zShowRemove", isSignal: true, isRequired: false, transformFunction: null }, zShowModeToggle: { classPropertyName: "zShowModeToggle", publicName: "zShowModeToggle", isSignal: true, isRequired: false, transformFunction: null }, zShowSearch: { classPropertyName: "zShowSearch", publicName: "zShowSearch", isSignal: true, isRequired: false, transformFunction: null }, zServerSearch: { classPropertyName: "zServerSearch", publicName: "zServerSearch", isSignal: true, isRequired: false, transformFunction: null }, zSearchPlaceholder: { classPropertyName: "zSearchPlaceholder", publicName: "zSearchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, zToggleSize: { classPropertyName: "zToggleSize", publicName: "zToggleSize", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zEmptyText: { classPropertyName: "zEmptyText", publicName: "zEmptyText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyIcon: { classPropertyName: "zEmptyIcon", publicName: "zEmptyIcon", isSignal: true, isRequired: false, transformFunction: null }, zClass: { classPropertyName: "zClass", publicName: "zClass", isSignal: true, isRequired: false, transformFunction: null }, zSelectable: { classPropertyName: "zSelectable", publicName: "zSelectable", isSignal: true, isRequired: false, transformFunction: null }, zSelectedFiles: { classPropertyName: "zSelectedFiles", publicName: "zSelectedFiles", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zMode: "zModeChange", zSelectedFiles: "zSelectedFilesChange", zOnDownload: "zOnDownload", zOnPreview: "zOnPreview", zOnRemove: "zOnRemove", zModeChange: "zModeChange", zSearchChange: "zSearchChange", zControl: "zControl", zSelectionChange: "zSelectionChange", zOnAction: "zOnAction" }, host: { classAttribute: "z-gallery block" }, exportAs: ["zGallery"], ngImport: i0, template: `
1788
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZGalleryComponent, isStandalone: true, selector: "z-gallery", inputs: { zFiles: { classPropertyName: "zFiles", publicName: "zFiles", isSignal: true, isRequired: false, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zColumns: { classPropertyName: "zColumns", publicName: "zColumns", isSignal: true, isRequired: false, transformFunction: null }, zItemWidth: { classPropertyName: "zItemWidth", publicName: "zItemWidth", isSignal: true, isRequired: false, transformFunction: null }, zShowDownload: { classPropertyName: "zShowDownload", publicName: "zShowDownload", isSignal: true, isRequired: false, transformFunction: null }, zShowPreview: { classPropertyName: "zShowPreview", publicName: "zShowPreview", isSignal: true, isRequired: false, transformFunction: null }, zShowRemove: { classPropertyName: "zShowRemove", publicName: "zShowRemove", isSignal: true, isRequired: false, transformFunction: null }, zTrustedResourceOrigins: { classPropertyName: "zTrustedResourceOrigins", publicName: "zTrustedResourceOrigins", isSignal: true, isRequired: false, transformFunction: null }, zShowModeToggle: { classPropertyName: "zShowModeToggle", publicName: "zShowModeToggle", isSignal: true, isRequired: false, transformFunction: null }, zShowSearch: { classPropertyName: "zShowSearch", publicName: "zShowSearch", isSignal: true, isRequired: false, transformFunction: null }, zServerSearch: { classPropertyName: "zServerSearch", publicName: "zServerSearch", isSignal: true, isRequired: false, transformFunction: null }, zSearchDebounce: { classPropertyName: "zSearchDebounce", publicName: "zSearchDebounce", isSignal: true, isRequired: false, transformFunction: null }, zSearchPlaceholder: { classPropertyName: "zSearchPlaceholder", publicName: "zSearchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, zToggleSize: { classPropertyName: "zToggleSize", publicName: "zToggleSize", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zEmptyText: { classPropertyName: "zEmptyText", publicName: "zEmptyText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyIcon: { classPropertyName: "zEmptyIcon", publicName: "zEmptyIcon", isSignal: true, isRequired: false, transformFunction: null }, zClass: { classPropertyName: "zClass", publicName: "zClass", isSignal: true, isRequired: false, transformFunction: null }, zSelectable: { classPropertyName: "zSelectable", publicName: "zSelectable", isSignal: true, isRequired: false, transformFunction: null }, zSelectedFiles: { classPropertyName: "zSelectedFiles", publicName: "zSelectedFiles", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zMode: "zModeChange", zSelectedFiles: "zSelectedFilesChange", zOnDownload: "zOnDownload", zOnPreview: "zOnPreview", zOnRemove: "zOnRemove", zModeChange: "zModeChange", zSearchChange: "zSearchChange", zControl: "zControl", zSelectionChange: "zSelectionChange", zOnAction: "zOnAction" }, host: { classAttribute: "z-gallery block" }, exportAs: ["zGallery"], ngImport: i0, template: `
1734
1789
  <div [class]="containerClasses()">
1735
1790
  @if (showHeader()) {
1736
1791
  <div class="mb-4 flex flex-wrap items-center justify-between gap-3">
@@ -1744,8 +1799,10 @@ class ZGalleryComponent {
1744
1799
  zSearch
1745
1800
  [zSize]="searchInputSize()"
1746
1801
  [zPlaceholder]="zSearchPlaceholder() || ('i18n_z_ui_gallery_search_placeholder' | translate)"
1747
- [ngModel]="searchQuery()"
1748
- (ngModelChange)="onSearchChange($event)"
1802
+ [zDebounce]="zSearchDebounce()"
1803
+ [ngModel]="searchInputQuery()"
1804
+ (ngModelChange)="searchInputQuery.set($event)"
1805
+ (zOnSearch)="onSearchChange($event)"
1749
1806
  class="w-64"
1750
1807
  />
1751
1808
  }
@@ -1820,7 +1877,7 @@ class ZGalleryComponent {
1820
1877
 
1821
1878
  @if (filteredFiles().length > 0) {
1822
1879
  @if (currentMode() === 'grid') {
1823
- <div class="grid gap-4" [class]="gridColumnsClass()">
1880
+ <div class="grid gap-4" [class]="gridColumnsClass()" [style.gridTemplateColumns]="gridTemplateColumns()">
1824
1881
  @for (file of filteredFiles(); track file.id) {
1825
1882
  <z-gallery-item
1826
1883
  [file]="file"
@@ -1873,6 +1930,7 @@ class ZGalleryComponent {
1873
1930
  [file]="previewFile()!"
1874
1931
  [files]="filteredFiles()"
1875
1932
  [zShowRemove]="zShowRemove()"
1933
+ [zTrustedResourceOrigins]="zTrustedResourceOrigins()"
1876
1934
  (zOnClose)="closePreview()"
1877
1935
  (zOnDownload)="onDownload($event)"
1878
1936
  (zOnNavigate)="onNavigatePreview($event)"
@@ -1880,7 +1938,7 @@ class ZGalleryComponent {
1880
1938
  />
1881
1939
  }
1882
1940
  </div>
1883
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZGalleryItemComponent, selector: "z-gallery-item", inputs: ["file", "zMode", "zSize", "zShowDownload", "zShowPreview", "zShowRemove", "zSelectable", "zSelected"], outputs: ["zOnDownload", "zOnPreview", "zOnRemove", "zOnSelect"] }, { kind: "component", type: ZGalleryPreviewComponent, selector: "z-gallery-preview", inputs: ["file", "files", "zShowRemove"], outputs: ["zOnClose", "zOnDownload", "zOnNavigate", "zOnRemove"] }, { kind: "component", type: ZButtonGroupComponent, selector: "z-button-group", inputs: ["zClass", "zOrientation", "zActive"], outputs: ["zActiveChange"], exportAs: ["zButtonGroup"] }, { kind: "directive", type: ZButtonGroupItemDirective, selector: "[z-button-group-item]", exportAs: ["zButtonGroupItem"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZCheckboxComponent, selector: "z-checkbox", inputs: ["class", "zType", "zSize", "zLabel", "zText", "zDisabled", "zIndeterminate", "zValue", "zOptions", "zOrientation", "zCheckAll", "zCheckAllText", "zChecked", "zGroupValue"], outputs: ["zChange", "zGroupChange", "zOnBlur", "zOnFocus", "zControl", "zEvent", "zCheckedChange", "zGroupValueChange"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZEmptyComponent, selector: "z-empty", inputs: ["class", "zType", "zIcon", "zIconSize", "zSize", "zMessage", "zDescription"] }, { kind: "component", type: ZInputComponent, selector: "z-input", inputs: ["class", "zType", "zSize", "zAlign", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zPrefix", "zSuffix", "zMin", "zMax", "zStep", "zShowArrows", "zMask", "zDecimalPlaces", "zAllowNegative", "zThousandSeparator", "zDecimalMarker", "zValidators", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zShowPasswordToggle", "zSearch", "zDebounce", "zAutofocus", "zAutoComplete", "zAllowClear", "zAutoSizeContent", "zRows", "zResize", "zMaxLength", "zAutoSuggest", "zColorConfig"], outputs: ["zOnSearch", "zOnChange", "zOnBlur", "zOnFocus", "zOnKeydown", "zOnEnter", "zOnColorCollapse", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1941
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZGalleryItemComponent, selector: "z-gallery-item", inputs: ["file", "zMode", "zSize", "zShowDownload", "zShowPreview", "zShowRemove", "zSelectable", "zSelected"], outputs: ["zOnDownload", "zOnPreview", "zOnRemove", "zOnSelect"] }, { kind: "component", type: ZGalleryPreviewComponent, selector: "z-gallery-preview", inputs: ["file", "files", "zShowRemove", "zTrustedResourceOrigins"], outputs: ["zOnClose", "zOnDownload", "zOnNavigate", "zOnRemove"] }, { kind: "component", type: ZButtonGroupComponent, selector: "z-button-group", inputs: ["zClass", "zOrientation", "zActive"], outputs: ["zActiveChange"], exportAs: ["zButtonGroup"] }, { kind: "directive", type: ZButtonGroupItemDirective, selector: "[z-button-group-item]", exportAs: ["zButtonGroupItem"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZCheckboxComponent, selector: "z-checkbox", inputs: ["class", "zType", "zSize", "zLabel", "zText", "zDisabled", "zIndeterminate", "zValue", "zOptions", "zOrientation", "zCheckAll", "zCheckAllText", "zChecked", "zGroupValue"], outputs: ["zChange", "zGroupChange", "zOnBlur", "zOnFocus", "zControl", "zEvent", "zCheckedChange", "zGroupValueChange"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZEmptyComponent, selector: "z-empty", inputs: ["class", "zType", "zIcon", "zIconSize", "zSize", "zMessage", "zDescription"] }, { kind: "component", type: ZInputComponent, selector: "z-input", inputs: ["class", "zType", "zSize", "zAlign", "zLabel", "zLabelClass", "zPlaceholder", "zRequired", "zDisabled", "zReadonly", "zPrefix", "zSuffix", "zMin", "zMax", "zStep", "zShowArrows", "zMask", "zDecimalPlaces", "zAllowNegative", "zThousandSeparator", "zDecimalMarker", "zValidators", "zAsyncValidators", "zAsyncDebounce", "zAsyncValidateOn", "zShowPasswordToggle", "zSearch", "zDebounce", "zAutofocus", "zAutoComplete", "zAllowClear", "zAutoSizeContent", "zRows", "zResize", "zMaxLength", "zAutoSuggest", "zColorConfig"], outputs: ["zOnSearch", "zOnChange", "zOnBlur", "zOnFocus", "zOnKeydown", "zOnEnter", "zOnColorCollapse", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1884
1942
  }
1885
1943
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZGalleryComponent, decorators: [{
1886
1944
  type: Component,
@@ -1914,8 +1972,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1914
1972
  zSearch
1915
1973
  [zSize]="searchInputSize()"
1916
1974
  [zPlaceholder]="zSearchPlaceholder() || ('i18n_z_ui_gallery_search_placeholder' | translate)"
1917
- [ngModel]="searchQuery()"
1918
- (ngModelChange)="onSearchChange($event)"
1975
+ [zDebounce]="zSearchDebounce()"
1976
+ [ngModel]="searchInputQuery()"
1977
+ (ngModelChange)="searchInputQuery.set($event)"
1978
+ (zOnSearch)="onSearchChange($event)"
1919
1979
  class="w-64"
1920
1980
  />
1921
1981
  }
@@ -1990,7 +2050,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1990
2050
 
1991
2051
  @if (filteredFiles().length > 0) {
1992
2052
  @if (currentMode() === 'grid') {
1993
- <div class="grid gap-4" [class]="gridColumnsClass()">
2053
+ <div class="grid gap-4" [class]="gridColumnsClass()" [style.gridTemplateColumns]="gridTemplateColumns()">
1994
2054
  @for (file of filteredFiles(); track file.id) {
1995
2055
  <z-gallery-item
1996
2056
  [file]="file"
@@ -2043,6 +2103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
2043
2103
  [file]="previewFile()!"
2044
2104
  [files]="filteredFiles()"
2045
2105
  [zShowRemove]="zShowRemove()"
2106
+ [zTrustedResourceOrigins]="zTrustedResourceOrigins()"
2046
2107
  (zOnClose)="closePreview()"
2047
2108
  (zOnDownload)="onDownload($event)"
2048
2109
  (zOnNavigate)="onNavigatePreview($event)"
@@ -2058,7 +2119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
2058
2119
  },
2059
2120
  exportAs: 'zGallery',
2060
2121
  }]
2061
- }], propDecorators: { zFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFiles", required: false }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }, { type: i0.Output, args: ["zModeChange"] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColumns", required: false }] }], zShowDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowDownload", required: false }] }], zShowPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowPreview", required: false }] }], zShowRemove: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowRemove", required: false }] }], zShowModeToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowModeToggle", required: false }] }], zShowSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowSearch", required: false }] }], zServerSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zServerSearch", required: false }] }], zSearchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearchPlaceholder", required: false }] }], zToggleSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zToggleSize", required: false }] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zEmptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyText", required: false }] }], zEmptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyIcon", required: false }] }], zClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClass", required: false }] }], zSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectable", required: false }] }], zSelectedFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectedFiles", required: false }] }, { type: i0.Output, args: ["zSelectedFilesChange"] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnPreview: [{ type: i0.Output, args: ["zOnPreview"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }], zModeChange: [{ type: i0.Output, args: ["zModeChange"] }], zSearchChange: [{ type: i0.Output, args: ["zSearchChange"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zSelectionChange: [{ type: i0.Output, args: ["zSelectionChange"] }], zOnAction: [{ type: i0.Output, args: ["zOnAction"] }] } });
2122
+ }], propDecorators: { zFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFiles", required: false }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }, { type: i0.Output, args: ["zModeChange"] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "zColumns", required: false }] }], zItemWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "zItemWidth", required: false }] }], zShowDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowDownload", required: false }] }], zShowPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowPreview", required: false }] }], zShowRemove: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowRemove", required: false }] }], zTrustedResourceOrigins: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTrustedResourceOrigins", required: false }] }], zShowModeToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowModeToggle", required: false }] }], zShowSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowSearch", required: false }] }], zServerSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zServerSearch", required: false }] }], zSearchDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearchDebounce", required: false }] }], zSearchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearchPlaceholder", required: false }] }], zToggleSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zToggleSize", required: false }] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zEmptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyText", required: false }] }], zEmptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyIcon", required: false }] }], zClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClass", required: false }] }], zSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectable", required: false }] }], zSelectedFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectedFiles", required: false }] }, { type: i0.Output, args: ["zSelectedFilesChange"] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnPreview: [{ type: i0.Output, args: ["zOnPreview"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }], zModeChange: [{ type: i0.Output, args: ["zModeChange"] }], zSearchChange: [{ type: i0.Output, args: ["zSearchChange"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zSelectionChange: [{ type: i0.Output, args: ["zSelectionChange"] }], zOnAction: [{ type: i0.Output, args: ["zOnAction"] }] } });
2062
2123
 
2063
2124
  class ZGalleryFileIconComponent {
2064
2125
  file = input.required(...(ngDevMode ? [{ debugName: "file" }] : []));
@@ -2189,6 +2250,7 @@ class ZGalleryPreviewService {
2189
2250
  componentRef.setInput('file', previewOptions.file);
2190
2251
  componentRef.setInput('files', previewOptions.files);
2191
2252
  componentRef.setInput('zShowRemove', previewOptions.zShowRemove ?? false);
2253
+ componentRef.setInput('zTrustedResourceOrigins', previewOptions.zTrustedResourceOrigins ?? []);
2192
2254
  componentRef.instance.zOnClose.subscribe(() => {
2193
2255
  previewOptions.zOnClose?.();
2194
2256
  previewRef.close();