@shival99/z-ui 1.7.2 → 1.7.3
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.
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +304 -24
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-icon.mjs +3 -1
- package/fesm2022/shival99-z-ui-components-z-icon.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +12 -3
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +8 -8
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +6 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +4 -4
- package/types/shival99-z-ui-components-z-breadcrumb.d.ts +2 -2
- package/types/shival99-z-ui-components-z-button.d.ts +1 -1
- package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +1 -1
- package/types/shival99-z-ui-components-z-empty.d.ts +2 -2
- package/types/shival99-z-ui-components-z-filter.d.ts +1 -1
- package/types/shival99-z-ui-components-z-gallery.d.ts +50 -5
- package/types/shival99-z-ui-components-z-icon.d.ts +3 -1
- package/types/shival99-z-ui-components-z-select.d.ts +2 -2
|
@@ -5,6 +5,7 @@ import { FormsModule } from '@angular/forms';
|
|
|
5
5
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
6
6
|
import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
|
|
7
7
|
import { ZButtonGroupComponent, ZButtonGroupItemDirective } from '@shival99/z-ui/components/z-button-group';
|
|
8
|
+
import { ZCheckboxComponent } from '@shival99/z-ui/components/z-checkbox';
|
|
8
9
|
import { ZEmptyComponent } from '@shival99/z-ui/components/z-empty';
|
|
9
10
|
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
10
11
|
import { ZInputComponent } from '@shival99/z-ui/components/z-input';
|
|
@@ -175,9 +176,12 @@ class ZGalleryItemComponent {
|
|
|
175
176
|
zShowDownload = input(true, ...(ngDevMode ? [{ debugName: "zShowDownload" }] : []));
|
|
176
177
|
zShowPreview = input(true, ...(ngDevMode ? [{ debugName: "zShowPreview" }] : []));
|
|
177
178
|
zShowRemove = input(false, ...(ngDevMode ? [{ debugName: "zShowRemove" }] : []));
|
|
179
|
+
zSelectable = input(false, ...(ngDevMode ? [{ debugName: "zSelectable" }] : []));
|
|
180
|
+
zSelected = input(false, ...(ngDevMode ? [{ debugName: "zSelected" }] : []));
|
|
178
181
|
zOnDownload = output();
|
|
179
182
|
zOnPreview = output();
|
|
180
183
|
zOnRemove = output();
|
|
184
|
+
zOnSelect = output();
|
|
181
185
|
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
182
186
|
formattedSize = computed(() => formatFileSize(this.file().size), ...(ngDevMode ? [{ debugName: "formattedSize" }] : []));
|
|
183
187
|
category = computed(() => getFileCategory(this.file()), ...(ngDevMode ? [{ debugName: "category" }] : []));
|
|
@@ -209,18 +213,49 @@ class ZGalleryItemComponent {
|
|
|
209
213
|
this.zOnPreview.emit(this.file());
|
|
210
214
|
}
|
|
211
215
|
}
|
|
216
|
+
onItemClick() {
|
|
217
|
+
if (this.zSelectable()) {
|
|
218
|
+
this.zOnSelect.emit(this.file());
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.onPreview();
|
|
222
|
+
}
|
|
212
223
|
onRemove(event) {
|
|
213
224
|
event.stopPropagation();
|
|
214
225
|
this.zOnRemove.emit(this.file());
|
|
215
226
|
}
|
|
227
|
+
onSelectClick(event) {
|
|
228
|
+
event.stopPropagation();
|
|
229
|
+
this.zOnSelect.emit(this.file());
|
|
230
|
+
}
|
|
216
231
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZGalleryItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZGalleryItemComponent, isStandalone: true, selector: "z-gallery-item", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", 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 } }, outputs: { zOnDownload: "zOnDownload", zOnPreview: "zOnPreview", zOnRemove: "zOnRemove" }, host: { classAttribute: "z-gallery-item block" }, ngImport: i0, template: `
|
|
232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: ZGalleryItemComponent, isStandalone: true, selector: "z-gallery-item", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", 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 }, zSelectable: { classPropertyName: "zSelectable", publicName: "zSelectable", isSignal: true, isRequired: false, transformFunction: null }, zSelected: { classPropertyName: "zSelected", publicName: "zSelected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnDownload: "zOnDownload", zOnPreview: "zOnPreview", zOnRemove: "zOnRemove", zOnSelect: "zOnSelect" }, host: { classAttribute: "z-gallery-item block" }, ngImport: i0, template: `
|
|
218
233
|
@if (zMode() === 'grid') {
|
|
219
234
|
<div
|
|
220
|
-
class="group
|
|
221
|
-
|
|
235
|
+
class="group relative cursor-pointer rounded-xl border transition-all duration-200 hover:shadow-md"
|
|
236
|
+
[class.border-border]="!zSelected()"
|
|
237
|
+
[class.bg-card]="!zSelected()"
|
|
238
|
+
[class.shadow-sm]="!zSelected()"
|
|
239
|
+
[class.hover:border-primary/30]="!zSelected()"
|
|
240
|
+
[class.border-primary/40]="zSelected()"
|
|
241
|
+
[class.bg-primary/5]="zSelected()"
|
|
242
|
+
[class.shadow-primary/15]="zSelected()"
|
|
243
|
+
[class.shadow-md]="zSelected()"
|
|
244
|
+
(click)="onItemClick()"
|
|
222
245
|
>
|
|
223
|
-
|
|
246
|
+
@if (zSelectable()) {
|
|
247
|
+
<div
|
|
248
|
+
class="bg-primary shadow-card absolute -top-2 -right-2 z-10 flex size-6 items-center justify-center rounded-full transition-all duration-150"
|
|
249
|
+
[class.scale-100]="zSelected()"
|
|
250
|
+
[class.opacity-100]="zSelected()"
|
|
251
|
+
[class.scale-0]="!zSelected()"
|
|
252
|
+
[class.opacity-0]="!zSelected()"
|
|
253
|
+
>
|
|
254
|
+
<i z-icon zType="lucideCheck" zSize="14" class="text-primary-foreground"></i>
|
|
255
|
+
</div>
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
<div class="relative aspect-square overflow-hidden rounded-t-xl">
|
|
224
259
|
@if (isImage()) {
|
|
225
260
|
@if (isLoading()) {
|
|
226
261
|
<z-skeleton class="absolute inset-0" />
|
|
@@ -304,9 +339,26 @@ class ZGalleryItemComponent {
|
|
|
304
339
|
</div>
|
|
305
340
|
} @else {
|
|
306
341
|
<div
|
|
307
|
-
class="group
|
|
308
|
-
|
|
342
|
+
class="group flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 shadow-sm transition-all duration-150 hover:shadow-md"
|
|
343
|
+
[class.border-border]="!zSelected()"
|
|
344
|
+
[class.bg-card]="!zSelected()"
|
|
345
|
+
[class.hover:border-primary/30]="!zSelected()"
|
|
346
|
+
[class.border-primary/40]="zSelected()"
|
|
347
|
+
[class.bg-primary/5]="zSelected()"
|
|
348
|
+
(click)="onItemClick()"
|
|
309
349
|
>
|
|
350
|
+
@if (zSelectable()) {
|
|
351
|
+
<div
|
|
352
|
+
class="bg-primary -ml-1 flex size-5 shrink-0 items-center justify-center rounded-full transition-all duration-150"
|
|
353
|
+
[class.scale-100]="zSelected()"
|
|
354
|
+
[class.opacity-100]="zSelected()"
|
|
355
|
+
[class.scale-0]="!zSelected()"
|
|
356
|
+
[class.opacity-0]="!zSelected()"
|
|
357
|
+
>
|
|
358
|
+
<i z-icon zType="lucideCheck" zSize="12" class="text-primary-foreground"></i>
|
|
359
|
+
</div>
|
|
360
|
+
}
|
|
361
|
+
|
|
310
362
|
<div class="flex size-10 shrink-0 items-center justify-center rounded-lg" [class]="categoryStyle().bg">
|
|
311
363
|
@if (isImage() && (file().thumbnailUrl || file().url)) {
|
|
312
364
|
<img
|
|
@@ -381,10 +433,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
381
433
|
template: `
|
|
382
434
|
@if (zMode() === 'grid') {
|
|
383
435
|
<div
|
|
384
|
-
class="group
|
|
385
|
-
|
|
436
|
+
class="group relative cursor-pointer rounded-xl border transition-all duration-200 hover:shadow-md"
|
|
437
|
+
[class.border-border]="!zSelected()"
|
|
438
|
+
[class.bg-card]="!zSelected()"
|
|
439
|
+
[class.shadow-sm]="!zSelected()"
|
|
440
|
+
[class.hover:border-primary/30]="!zSelected()"
|
|
441
|
+
[class.border-primary/40]="zSelected()"
|
|
442
|
+
[class.bg-primary/5]="zSelected()"
|
|
443
|
+
[class.shadow-primary/15]="zSelected()"
|
|
444
|
+
[class.shadow-md]="zSelected()"
|
|
445
|
+
(click)="onItemClick()"
|
|
386
446
|
>
|
|
387
|
-
|
|
447
|
+
@if (zSelectable()) {
|
|
448
|
+
<div
|
|
449
|
+
class="bg-primary shadow-card absolute -top-2 -right-2 z-10 flex size-6 items-center justify-center rounded-full transition-all duration-150"
|
|
450
|
+
[class.scale-100]="zSelected()"
|
|
451
|
+
[class.opacity-100]="zSelected()"
|
|
452
|
+
[class.scale-0]="!zSelected()"
|
|
453
|
+
[class.opacity-0]="!zSelected()"
|
|
454
|
+
>
|
|
455
|
+
<i z-icon zType="lucideCheck" zSize="14" class="text-primary-foreground"></i>
|
|
456
|
+
</div>
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
<div class="relative aspect-square overflow-hidden rounded-t-xl">
|
|
388
460
|
@if (isImage()) {
|
|
389
461
|
@if (isLoading()) {
|
|
390
462
|
<z-skeleton class="absolute inset-0" />
|
|
@@ -468,9 +540,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
468
540
|
</div>
|
|
469
541
|
} @else {
|
|
470
542
|
<div
|
|
471
|
-
class="group
|
|
472
|
-
|
|
543
|
+
class="group flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 shadow-sm transition-all duration-150 hover:shadow-md"
|
|
544
|
+
[class.border-border]="!zSelected()"
|
|
545
|
+
[class.bg-card]="!zSelected()"
|
|
546
|
+
[class.hover:border-primary/30]="!zSelected()"
|
|
547
|
+
[class.border-primary/40]="zSelected()"
|
|
548
|
+
[class.bg-primary/5]="zSelected()"
|
|
549
|
+
(click)="onItemClick()"
|
|
473
550
|
>
|
|
551
|
+
@if (zSelectable()) {
|
|
552
|
+
<div
|
|
553
|
+
class="bg-primary -ml-1 flex size-5 shrink-0 items-center justify-center rounded-full transition-all duration-150"
|
|
554
|
+
[class.scale-100]="zSelected()"
|
|
555
|
+
[class.opacity-100]="zSelected()"
|
|
556
|
+
[class.scale-0]="!zSelected()"
|
|
557
|
+
[class.opacity-0]="!zSelected()"
|
|
558
|
+
>
|
|
559
|
+
<i z-icon zType="lucideCheck" zSize="12" class="text-primary-foreground"></i>
|
|
560
|
+
</div>
|
|
561
|
+
}
|
|
562
|
+
|
|
474
563
|
<div class="flex size-10 shrink-0 items-center justify-center rounded-lg" [class]="categoryStyle().bg">
|
|
475
564
|
@if (isImage() && (file().thumbnailUrl || file().url)) {
|
|
476
565
|
<img
|
|
@@ -541,7 +630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
541
630
|
class: 'z-gallery-item block',
|
|
542
631
|
},
|
|
543
632
|
}]
|
|
544
|
-
}], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", 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 }] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnPreview: [{ type: i0.Output, args: ["zOnPreview"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }] } });
|
|
633
|
+
}], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", 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 }] }], zSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectable", required: false }] }], zSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelected", required: false }] }], zOnDownload: [{ type: i0.Output, args: ["zOnDownload"] }], zOnPreview: [{ type: i0.Output, args: ["zOnPreview"] }], zOnRemove: [{ type: i0.Output, args: ["zOnRemove"] }], zOnSelect: [{ type: i0.Output, args: ["zOnSelect"] }] } });
|
|
545
634
|
|
|
546
635
|
class ZGalleryPreviewComponent {
|
|
547
636
|
file = input.required(...(ngDevMode ? [{ debugName: "file" }] : []));
|
|
@@ -574,10 +663,9 @@ class ZGalleryPreviewComponent {
|
|
|
574
663
|
const remaining = this._minLoadingTime - elapsed;
|
|
575
664
|
if (remaining > 0) {
|
|
576
665
|
setTimeout(() => this.isLoading.set(false), remaining);
|
|
666
|
+
return;
|
|
577
667
|
}
|
|
578
|
-
|
|
579
|
-
this.isLoading.set(false);
|
|
580
|
-
}
|
|
668
|
+
this.isLoading.set(false);
|
|
581
669
|
}
|
|
582
670
|
currentIndex = computed(() => {
|
|
583
671
|
const allFiles = this.files();
|
|
@@ -725,7 +813,7 @@ class ZGalleryPreviewComponent {
|
|
|
725
813
|
|
|
726
814
|
<div class="flex h-full w-full flex-col items-center" (click)="$event.stopPropagation()">
|
|
727
815
|
<div
|
|
728
|
-
class="dark
|
|
816
|
+
class="dark:!border-border absolute top-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-[6px] border !border-transparent bg-black/60 px-4 py-2 text-sm text-white backdrop-blur-sm dark:border"
|
|
729
817
|
>
|
|
730
818
|
<div>
|
|
731
819
|
<span class="max-w-[200px] truncate font-medium">{{ file().name }}</span>
|
|
@@ -748,7 +836,7 @@ class ZGalleryPreviewComponent {
|
|
|
748
836
|
[zContent]="'i18n_z_ui_gallery_rotate_left' | translate"
|
|
749
837
|
(click)="rotateLeft()"
|
|
750
838
|
>
|
|
751
|
-
<i z-icon zType="
|
|
839
|
+
<i z-icon zType="lucideUndo" zSize="14"></i>
|
|
752
840
|
</button>
|
|
753
841
|
<button
|
|
754
842
|
z-button
|
|
@@ -760,7 +848,7 @@ class ZGalleryPreviewComponent {
|
|
|
760
848
|
[zContent]="'i18n_z_ui_gallery_rotate_right' | translate"
|
|
761
849
|
(click)="rotateRight()"
|
|
762
850
|
>
|
|
763
|
-
<i z-icon zType="
|
|
851
|
+
<i z-icon zType="lucideRedo" zSize="14"></i>
|
|
764
852
|
</button>
|
|
765
853
|
}
|
|
766
854
|
|
|
@@ -925,7 +1013,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
925
1013
|
|
|
926
1014
|
<div class="flex h-full w-full flex-col items-center" (click)="$event.stopPropagation()">
|
|
927
1015
|
<div
|
|
928
|
-
class="dark
|
|
1016
|
+
class="dark:!border-border absolute top-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-[6px] border !border-transparent bg-black/60 px-4 py-2 text-sm text-white backdrop-blur-sm dark:border"
|
|
929
1017
|
>
|
|
930
1018
|
<div>
|
|
931
1019
|
<span class="max-w-[200px] truncate font-medium">{{ file().name }}</span>
|
|
@@ -948,7 +1036,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
948
1036
|
[zContent]="'i18n_z_ui_gallery_rotate_left' | translate"
|
|
949
1037
|
(click)="rotateLeft()"
|
|
950
1038
|
>
|
|
951
|
-
<i z-icon zType="
|
|
1039
|
+
<i z-icon zType="lucideUndo" zSize="14"></i>
|
|
952
1040
|
</button>
|
|
953
1041
|
<button
|
|
954
1042
|
z-button
|
|
@@ -960,7 +1048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
960
1048
|
[zContent]="'i18n_z_ui_gallery_rotate_right' | translate"
|
|
961
1049
|
(click)="rotateRight()"
|
|
962
1050
|
>
|
|
963
|
-
<i z-icon zType="
|
|
1051
|
+
<i z-icon zType="lucideRedo" zSize="14"></i>
|
|
964
1052
|
</button>
|
|
965
1053
|
}
|
|
966
1054
|
|
|
@@ -1160,12 +1248,16 @@ class ZGalleryComponent {
|
|
|
1160
1248
|
zEmptyText = input('No files', ...(ngDevMode ? [{ debugName: "zEmptyText" }] : []));
|
|
1161
1249
|
zEmptyIcon = input('lucideImage', ...(ngDevMode ? [{ debugName: "zEmptyIcon" }] : []));
|
|
1162
1250
|
zClass = input('', ...(ngDevMode ? [{ debugName: "zClass" }] : []));
|
|
1251
|
+
zSelectable = input(false, ...(ngDevMode ? [{ debugName: "zSelectable" }] : []));
|
|
1252
|
+
zSelectedFiles = model([], ...(ngDevMode ? [{ debugName: "zSelectedFiles" }] : []));
|
|
1163
1253
|
zOnDownload = output();
|
|
1164
1254
|
zOnPreview = output();
|
|
1165
1255
|
zOnRemove = output();
|
|
1166
1256
|
zModeChange = output();
|
|
1167
1257
|
zSearchChange = output();
|
|
1168
1258
|
zControl = output();
|
|
1259
|
+
zSelectionChange = output();
|
|
1260
|
+
zOnAction = output();
|
|
1169
1261
|
modeIndex = signal(0, ...(ngDevMode ? [{ debugName: "modeIndex" }] : []));
|
|
1170
1262
|
previewFile = signal(null, ...(ngDevMode ? [{ debugName: "previewFile" }] : []));
|
|
1171
1263
|
searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : []));
|
|
@@ -1207,6 +1299,19 @@ class ZGalleryComponent {
|
|
|
1207
1299
|
}
|
|
1208
1300
|
return files.filter(file => file.name.toLowerCase().includes(query));
|
|
1209
1301
|
}, ...(ngDevMode ? [{ debugName: "filteredFiles" }] : []));
|
|
1302
|
+
selectedIds = computed(() => new Set(this.zSelectedFiles().map(f => f.id)), ...(ngDevMode ? [{ debugName: "selectedIds" }] : []));
|
|
1303
|
+
isAllSelected = computed(() => {
|
|
1304
|
+
const files = this.filteredFiles();
|
|
1305
|
+
const selectedIds = this.selectedIds();
|
|
1306
|
+
return files.length > 0 && files.every(f => selectedIds.has(f.id));
|
|
1307
|
+
}, ...(ngDevMode ? [{ debugName: "isAllSelected" }] : []));
|
|
1308
|
+
isIndeterminate = computed(() => {
|
|
1309
|
+
const files = this.filteredFiles();
|
|
1310
|
+
const selectedIds = this.selectedIds();
|
|
1311
|
+
const selectedCount = files.filter(f => selectedIds.has(f.id)).length;
|
|
1312
|
+
return selectedCount > 0 && selectedCount < files.length;
|
|
1313
|
+
}, ...(ngDevMode ? [{ debugName: "isIndeterminate" }] : []));
|
|
1314
|
+
selectedCount = computed(() => this.zSelectedFiles().length, ...(ngDevMode ? [{ debugName: "selectedCount" }] : []));
|
|
1210
1315
|
ngAfterViewInit() {
|
|
1211
1316
|
this.zControl.emit({
|
|
1212
1317
|
setMode: mode => {
|
|
@@ -1218,6 +1323,11 @@ class ZGalleryComponent {
|
|
|
1218
1323
|
getFiles: () => this.zFiles(),
|
|
1219
1324
|
openPreview: file => this.previewFile.set(file),
|
|
1220
1325
|
closePreview: () => this.previewFile.set(null),
|
|
1326
|
+
selectAll: () => this.selectAll(),
|
|
1327
|
+
deselectAll: () => this.deselectAll(),
|
|
1328
|
+
toggleSelection: file => this.toggleSelection(file),
|
|
1329
|
+
getSelectedFiles: () => this.zSelectedFiles(),
|
|
1330
|
+
isSelected: file => this.isFileSelected(file),
|
|
1221
1331
|
});
|
|
1222
1332
|
}
|
|
1223
1333
|
onSearchChange(query) {
|
|
@@ -1263,8 +1373,57 @@ class ZGalleryComponent {
|
|
|
1263
1373
|
}
|
|
1264
1374
|
this.previewFile.set(allFiles[currentIndex - 1]);
|
|
1265
1375
|
}
|
|
1376
|
+
isFileSelected(file) {
|
|
1377
|
+
return this.selectedIds().has(file.id);
|
|
1378
|
+
}
|
|
1379
|
+
toggleSelection(file) {
|
|
1380
|
+
const currentSelected = this.zSelectedFiles();
|
|
1381
|
+
const isSelected = this.isFileSelected(file);
|
|
1382
|
+
const newSelected = isSelected ? currentSelected.filter(f => f.id !== file.id) : [...currentSelected, file];
|
|
1383
|
+
this.zOnAction.emit({ type: isSelected ? 'deselect' : 'select', file });
|
|
1384
|
+
this.zSelectedFiles.set(newSelected);
|
|
1385
|
+
this.zSelectionChange.emit({
|
|
1386
|
+
selectedFiles: newSelected,
|
|
1387
|
+
addedFiles: isSelected ? undefined : [file],
|
|
1388
|
+
removedFiles: isSelected ? [file] : undefined,
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
selectAll() {
|
|
1392
|
+
const files = this.filteredFiles();
|
|
1393
|
+
this.zSelectedFiles.set([...files]);
|
|
1394
|
+
this.zOnAction.emit({ type: 'select-all', files });
|
|
1395
|
+
this.zSelectionChange.emit({
|
|
1396
|
+
selectedFiles: files,
|
|
1397
|
+
addedFiles: files,
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
deselectAll() {
|
|
1401
|
+
const previousSelected = this.zSelectedFiles();
|
|
1402
|
+
this.zSelectedFiles.set([]);
|
|
1403
|
+
this.zOnAction.emit({ type: 'deselect-all', files: previousSelected });
|
|
1404
|
+
this.zSelectionChange.emit({
|
|
1405
|
+
selectedFiles: [],
|
|
1406
|
+
removedFiles: previousSelected,
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
toggleSelectAll() {
|
|
1410
|
+
if (this.isAllSelected()) {
|
|
1411
|
+
this.deselectAll();
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
this.selectAll();
|
|
1415
|
+
}
|
|
1416
|
+
onBulkDelete() {
|
|
1417
|
+
const selectedFiles = this.zSelectedFiles();
|
|
1418
|
+
this.zOnAction.emit({ type: 'delete', files: selectedFiles });
|
|
1419
|
+
}
|
|
1420
|
+
onBulkDownload() {
|
|
1421
|
+
const selectedFiles = this.zSelectedFiles();
|
|
1422
|
+
this.zOnAction.emit({ type: 'download', files: selectedFiles });
|
|
1423
|
+
selectedFiles.forEach(file => this.onDownload(file));
|
|
1424
|
+
}
|
|
1266
1425
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZGalleryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1267
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", 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 } }, outputs: { zMode: "zModeChange", zOnDownload: "zOnDownload", zOnPreview: "zOnPreview", zOnRemove: "zOnRemove", zModeChange: "zModeChange", zSearchChange: "zSearchChange", zControl: "zControl" }, host: { classAttribute: "z-gallery block" }, exportAs: ["zGallery"], ngImport: i0, template: `
|
|
1426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", 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: `
|
|
1268
1427
|
<div [class]="containerClasses()">
|
|
1269
1428
|
@if (showHeader()) {
|
|
1270
1429
|
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
|
|
@@ -1298,6 +1457,60 @@ class ZGalleryComponent {
|
|
|
1298
1457
|
</div>
|
|
1299
1458
|
}
|
|
1300
1459
|
|
|
1460
|
+
@if (zSelectable() && filteredFiles().length > 0) {
|
|
1461
|
+
<div
|
|
1462
|
+
class="bg-muted/30 shadow-card dark:!border-border mb-4 flex h-11 items-center justify-between gap-3 rounded-[6px] border border-transparent px-3"
|
|
1463
|
+
>
|
|
1464
|
+
<div class="flex items-center gap-3">
|
|
1465
|
+
<z-checkbox
|
|
1466
|
+
[zChecked]="isAllSelected()"
|
|
1467
|
+
[zIndeterminate]="isIndeterminate()"
|
|
1468
|
+
(zChange)="toggleSelectAll()"
|
|
1469
|
+
zSize="sm"
|
|
1470
|
+
/>
|
|
1471
|
+
<span class="text-muted-foreground text-sm">
|
|
1472
|
+
@if (selectedCount() > 0) {
|
|
1473
|
+
{{ selectedCount() }} {{ 'i18n_z_ui_gallery_selected' | translate }}
|
|
1474
|
+
} @else {
|
|
1475
|
+
{{ 'i18n_z_ui_gallery_select_all' | translate }}
|
|
1476
|
+
}
|
|
1477
|
+
</span>
|
|
1478
|
+
</div>
|
|
1479
|
+
|
|
1480
|
+
@if (selectedCount() > 0) {
|
|
1481
|
+
<div class="flex items-center gap-1">
|
|
1482
|
+
@if (zShowDownload()) {
|
|
1483
|
+
<button
|
|
1484
|
+
z-button
|
|
1485
|
+
zType="ghost"
|
|
1486
|
+
zSize="xs"
|
|
1487
|
+
(click)="onBulkDownload()"
|
|
1488
|
+
class="text-muted-foreground hover:text-foreground"
|
|
1489
|
+
>
|
|
1490
|
+
<i z-icon zType="lucideDownload" zSize="14"></i>
|
|
1491
|
+
<span class="ml-1">{{ 'i18n_z_ui_gallery_download' | translate }}</span>
|
|
1492
|
+
</button>
|
|
1493
|
+
}
|
|
1494
|
+
@if (zShowRemove()) {
|
|
1495
|
+
<button
|
|
1496
|
+
z-button
|
|
1497
|
+
zType="ghost"
|
|
1498
|
+
zSize="xs"
|
|
1499
|
+
(click)="onBulkDelete()"
|
|
1500
|
+
class="text-destructive hover:text-destructive"
|
|
1501
|
+
>
|
|
1502
|
+
<i z-icon zType="lucideTrash2" zSize="14"></i>
|
|
1503
|
+
<span class="ml-1">{{ 'i18n_z_ui_gallery_delete' | translate }}</span>
|
|
1504
|
+
</button>
|
|
1505
|
+
}
|
|
1506
|
+
<button z-button zType="ghost" zSize="xs" (click)="deselectAll()">
|
|
1507
|
+
<i z-icon zType="lucideX" zSize="14"></i>
|
|
1508
|
+
</button>
|
|
1509
|
+
</div>
|
|
1510
|
+
}
|
|
1511
|
+
</div>
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1301
1514
|
@if (filteredFiles().length > 0) {
|
|
1302
1515
|
@if (currentMode() === 'grid') {
|
|
1303
1516
|
<div class="grid gap-4" [style.grid-template-columns]="gridColumns()">
|
|
@@ -1309,9 +1522,12 @@ class ZGalleryComponent {
|
|
|
1309
1522
|
[zShowDownload]="zShowDownload()"
|
|
1310
1523
|
[zShowPreview]="zShowPreview()"
|
|
1311
1524
|
[zShowRemove]="zShowRemove()"
|
|
1525
|
+
[zSelectable]="zSelectable()"
|
|
1526
|
+
[zSelected]="isFileSelected(file)"
|
|
1312
1527
|
(zOnDownload)="onDownload($event)"
|
|
1313
1528
|
(zOnPreview)="onPreview($event)"
|
|
1314
1529
|
(zOnRemove)="onRemove($event)"
|
|
1530
|
+
(zOnSelect)="toggleSelection($event)"
|
|
1315
1531
|
/>
|
|
1316
1532
|
}
|
|
1317
1533
|
</div>
|
|
@@ -1325,9 +1541,12 @@ class ZGalleryComponent {
|
|
|
1325
1541
|
[zShowDownload]="zShowDownload()"
|
|
1326
1542
|
[zShowPreview]="zShowPreview()"
|
|
1327
1543
|
[zShowRemove]="zShowRemove()"
|
|
1544
|
+
[zSelectable]="zSelectable()"
|
|
1545
|
+
[zSelected]="isFileSelected(file)"
|
|
1328
1546
|
(zOnDownload)="onDownload($event)"
|
|
1329
1547
|
(zOnPreview)="onPreview($event)"
|
|
1330
1548
|
(zOnRemove)="onRemove($event)"
|
|
1549
|
+
(zOnSelect)="toggleSelection($event)"
|
|
1331
1550
|
/>
|
|
1332
1551
|
}
|
|
1333
1552
|
</div>
|
|
@@ -1354,7 +1573,7 @@ class ZGalleryComponent {
|
|
|
1354
1573
|
/>
|
|
1355
1574
|
}
|
|
1356
1575
|
</div>
|
|
1357
|
-
`, 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"], outputs: ["zOnDownload", "zOnPreview", "zOnRemove"] }, { 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", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "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", "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"], outputs: ["zOnSearch", "zOnChange", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1576
|
+
`, 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", "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", "zControl", "zEvent", "zCheckedChange", "zGroupValueChange"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "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", "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"], outputs: ["zOnSearch", "zOnChange", "zControl", "zEvent"], exportAs: ["zInput"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1358
1577
|
}
|
|
1359
1578
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZGalleryComponent, decorators: [{
|
|
1360
1579
|
type: Component,
|
|
@@ -1368,6 +1587,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1368
1587
|
ZButtonGroupComponent,
|
|
1369
1588
|
ZButtonGroupItemDirective,
|
|
1370
1589
|
ZButtonComponent,
|
|
1590
|
+
ZCheckboxComponent,
|
|
1371
1591
|
ZIconComponent,
|
|
1372
1592
|
ZEmptyComponent,
|
|
1373
1593
|
ZInputComponent,
|
|
@@ -1407,6 +1627,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1407
1627
|
</div>
|
|
1408
1628
|
}
|
|
1409
1629
|
|
|
1630
|
+
@if (zSelectable() && filteredFiles().length > 0) {
|
|
1631
|
+
<div
|
|
1632
|
+
class="bg-muted/30 shadow-card dark:!border-border mb-4 flex h-11 items-center justify-between gap-3 rounded-[6px] border border-transparent px-3"
|
|
1633
|
+
>
|
|
1634
|
+
<div class="flex items-center gap-3">
|
|
1635
|
+
<z-checkbox
|
|
1636
|
+
[zChecked]="isAllSelected()"
|
|
1637
|
+
[zIndeterminate]="isIndeterminate()"
|
|
1638
|
+
(zChange)="toggleSelectAll()"
|
|
1639
|
+
zSize="sm"
|
|
1640
|
+
/>
|
|
1641
|
+
<span class="text-muted-foreground text-sm">
|
|
1642
|
+
@if (selectedCount() > 0) {
|
|
1643
|
+
{{ selectedCount() }} {{ 'i18n_z_ui_gallery_selected' | translate }}
|
|
1644
|
+
} @else {
|
|
1645
|
+
{{ 'i18n_z_ui_gallery_select_all' | translate }}
|
|
1646
|
+
}
|
|
1647
|
+
</span>
|
|
1648
|
+
</div>
|
|
1649
|
+
|
|
1650
|
+
@if (selectedCount() > 0) {
|
|
1651
|
+
<div class="flex items-center gap-1">
|
|
1652
|
+
@if (zShowDownload()) {
|
|
1653
|
+
<button
|
|
1654
|
+
z-button
|
|
1655
|
+
zType="ghost"
|
|
1656
|
+
zSize="xs"
|
|
1657
|
+
(click)="onBulkDownload()"
|
|
1658
|
+
class="text-muted-foreground hover:text-foreground"
|
|
1659
|
+
>
|
|
1660
|
+
<i z-icon zType="lucideDownload" zSize="14"></i>
|
|
1661
|
+
<span class="ml-1">{{ 'i18n_z_ui_gallery_download' | translate }}</span>
|
|
1662
|
+
</button>
|
|
1663
|
+
}
|
|
1664
|
+
@if (zShowRemove()) {
|
|
1665
|
+
<button
|
|
1666
|
+
z-button
|
|
1667
|
+
zType="ghost"
|
|
1668
|
+
zSize="xs"
|
|
1669
|
+
(click)="onBulkDelete()"
|
|
1670
|
+
class="text-destructive hover:text-destructive"
|
|
1671
|
+
>
|
|
1672
|
+
<i z-icon zType="lucideTrash2" zSize="14"></i>
|
|
1673
|
+
<span class="ml-1">{{ 'i18n_z_ui_gallery_delete' | translate }}</span>
|
|
1674
|
+
</button>
|
|
1675
|
+
}
|
|
1676
|
+
<button z-button zType="ghost" zSize="xs" (click)="deselectAll()">
|
|
1677
|
+
<i z-icon zType="lucideX" zSize="14"></i>
|
|
1678
|
+
</button>
|
|
1679
|
+
</div>
|
|
1680
|
+
}
|
|
1681
|
+
</div>
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1410
1684
|
@if (filteredFiles().length > 0) {
|
|
1411
1685
|
@if (currentMode() === 'grid') {
|
|
1412
1686
|
<div class="grid gap-4" [style.grid-template-columns]="gridColumns()">
|
|
@@ -1418,9 +1692,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1418
1692
|
[zShowDownload]="zShowDownload()"
|
|
1419
1693
|
[zShowPreview]="zShowPreview()"
|
|
1420
1694
|
[zShowRemove]="zShowRemove()"
|
|
1695
|
+
[zSelectable]="zSelectable()"
|
|
1696
|
+
[zSelected]="isFileSelected(file)"
|
|
1421
1697
|
(zOnDownload)="onDownload($event)"
|
|
1422
1698
|
(zOnPreview)="onPreview($event)"
|
|
1423
1699
|
(zOnRemove)="onRemove($event)"
|
|
1700
|
+
(zOnSelect)="toggleSelection($event)"
|
|
1424
1701
|
/>
|
|
1425
1702
|
}
|
|
1426
1703
|
</div>
|
|
@@ -1434,9 +1711,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1434
1711
|
[zShowDownload]="zShowDownload()"
|
|
1435
1712
|
[zShowPreview]="zShowPreview()"
|
|
1436
1713
|
[zShowRemove]="zShowRemove()"
|
|
1714
|
+
[zSelectable]="zSelectable()"
|
|
1715
|
+
[zSelected]="isFileSelected(file)"
|
|
1437
1716
|
(zOnDownload)="onDownload($event)"
|
|
1438
1717
|
(zOnPreview)="onPreview($event)"
|
|
1439
1718
|
(zOnRemove)="onRemove($event)"
|
|
1719
|
+
(zOnSelect)="toggleSelection($event)"
|
|
1440
1720
|
/>
|
|
1441
1721
|
}
|
|
1442
1722
|
</div>
|
|
@@ -1471,7 +1751,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1471
1751
|
},
|
|
1472
1752
|
exportAs: 'zGallery',
|
|
1473
1753
|
}]
|
|
1474
|
-
}], 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 }] }], 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"] }] } });
|
|
1754
|
+
}], 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"] }] } });
|
|
1475
1755
|
|
|
1476
1756
|
class ZGalleryFileIconComponent {
|
|
1477
1757
|
file = input.required(...(ngDevMode ? [{ debugName: "file" }] : []));
|