@ldw-framework/material-media 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,8 @@ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angu
8
8
  import * as i2 from '@angular/material/icon';
9
9
  import { MatIconModule } from '@angular/material/icon';
10
10
  import { LDuAnguBootTranslationPipe } from '@ldu-anguboot/i18n';
11
+ import { LDuAnguBootApiService } from '@ldu-anguboot/http';
12
+ import { firstValueFrom } from 'rxjs';
11
13
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
12
14
  import * as i1$1 from '@angular/forms';
13
15
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -15,8 +17,6 @@ import * as i3$1 from '@angular/material/form-field';
15
17
  import { MatFormFieldModule } from '@angular/material/form-field';
16
18
  import * as i4 from '@angular/material/input';
17
19
  import { MatInputModule } from '@angular/material/input';
18
- import { LDuAnguBootApiService } from '@ldu-anguboot/http';
19
- import { firstValueFrom } from 'rxjs';
20
20
 
21
21
  class LDwMaterialImageUploadDialogComponent {
22
22
  dialogRef = inject((MatDialogRef));
@@ -28,7 +28,7 @@ class LDwMaterialImageUploadDialogComponent {
28
28
  onCancelClick() {
29
29
  this.dialogRef.close(false);
30
30
  }
31
- onChange($event) {
31
+ onFileChange($event) {
32
32
  const files = $event?.target?.files;
33
33
  if (files?.[0]) {
34
34
  const picture = files[0];
@@ -54,32 +54,34 @@ class LDwMaterialImageUploadDialogComponent {
54
54
  }
55
55
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageUploadDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
56
56
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: LDwMaterialImageUploadDialogComponent, isStandalone: true, selector: "ldw-mat-image-upload-dialog", host: { classAttribute: "ldw-mat-image-upload-dialog" }, ngImport: i0, template: `
57
- <mat-dialog-actions>
58
- <h2>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>
59
- <button class="ldw-mat-image-uploader-save"
60
- matButton
61
- cdkFocusInitial
62
- (click)="onSaveClick()"
63
- >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>
64
- <button class="ldw-mat-image-uploader-cancel"
65
- matButton
66
- (click)="onCancelClick()"
67
- >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>
68
- </mat-dialog-actions>
57
+ <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>
69
58
  <mat-dialog-content>
70
59
  <input class="ldw-mat-image-uploader-hidden-input"
71
60
  #uploader type="file"
72
61
  [style.display]="'none'"
73
- (change)="onChange($event)"
62
+ (change)="onFileChange($event)"
74
63
  />
75
64
  <div class="ldw-mat-image-uploader--instance"
76
65
  [style.backgroundImage]="$backgroundImage"
77
66
  (keypress)="uploader.click()"
78
67
  (click)="uploader.click()"
79
- >@if ($noData) { <mat-icon>image</mat-icon> }
68
+ >@if ($noData) {
69
+ <mat-icon>image</mat-icon> }
80
70
  </div>
81
71
  </mat-dialog-content>
82
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "pipe", type: LDuAnguBootTranslationPipe, name: "i18n" }] });
72
+ <mat-dialog-actions>
73
+ <button
74
+ class="ldw-mat-image-uploader-save"
75
+ matButton
76
+ cdkFocusInitial
77
+ (click)="onSaveClick()"
78
+ >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>
79
+ <button class="ldw-mat-image-uploader-cancel"
80
+ matButton
81
+ (click)="onCancelClick()"
82
+ >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>
83
+ </mat-dialog-actions>
84
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "pipe", type: LDuAnguBootTranslationPipe, name: "i18n" }] });
83
85
  }
84
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageUploadDialogComponent, decorators: [{
85
87
  type: Component,
@@ -94,31 +96,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
94
96
  LDuAnguBootTranslationPipe,
95
97
  ],
96
98
  template: `
97
- <mat-dialog-actions>
98
- <h2>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>
99
- <button class="ldw-mat-image-uploader-save"
100
- matButton
101
- cdkFocusInitial
102
- (click)="onSaveClick()"
103
- >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>
104
- <button class="ldw-mat-image-uploader-cancel"
105
- matButton
106
- (click)="onCancelClick()"
107
- >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>
108
- </mat-dialog-actions>
99
+ <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>
109
100
  <mat-dialog-content>
110
101
  <input class="ldw-mat-image-uploader-hidden-input"
111
102
  #uploader type="file"
112
103
  [style.display]="'none'"
113
- (change)="onChange($event)"
104
+ (change)="onFileChange($event)"
114
105
  />
115
106
  <div class="ldw-mat-image-uploader--instance"
116
107
  [style.backgroundImage]="$backgroundImage"
117
108
  (keypress)="uploader.click()"
118
109
  (click)="uploader.click()"
119
- >@if ($noData) { <mat-icon>image</mat-icon> }
110
+ >@if ($noData) {
111
+ <mat-icon>image</mat-icon> }
120
112
  </div>
121
113
  </mat-dialog-content>
114
+ <mat-dialog-actions>
115
+ <button
116
+ class="ldw-mat-image-uploader-save"
117
+ matButton
118
+ cdkFocusInitial
119
+ (click)="onSaveClick()"
120
+ >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>
121
+ <button class="ldw-mat-image-uploader-cancel"
122
+ matButton
123
+ (click)="onCancelClick()"
124
+ >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>
125
+ </mat-dialog-actions>
122
126
  `
123
127
  }]
124
128
  }] });
@@ -129,17 +133,20 @@ class LDwMaterialMediaService {
129
133
  MEDIA_API$ = inject(LDW_MAT_MEDIA_API);
130
134
  lduApiService$ = inject(LDuAnguBootApiService);
131
135
  matDialog$ = inject(MatDialog);
132
- async uploadImage(uploadUrl, type = 'jpg', data) {
133
- const media = await firstValueFrom(this.matDialog.open(LDwMaterialImageUploadDialogComponent, {
134
- height: 'calc(100% - 1rem)',
135
- width: 'calc(100% - 1rem)',
136
- maxHeight: '100%',
137
- maxWidth: '100%',
136
+ async uploadImage(uploadUrl, uploadConfig, type = 'jpg', data) {
137
+ const config = {
138
+ height: uploadConfig?.height ?? 'calc(100% - 1rem)',
139
+ width: uploadConfig?.width ?? 'calc(100% - 1rem)',
140
+ maxHeight: uploadConfig?.maxHeight ?? '100%',
141
+ maxWidth: uploadConfig?.maxWidth ?? '100%',
142
+ panelClass: 'ldw-mat-image-upload-dialog-panel',
138
143
  data: {
144
+ imgAlt: data?.imgAlt,
139
145
  imgSrc: data?.imgSrc,
140
146
  imgBase64: data?.imgBase64,
141
147
  },
142
- }).afterClosed());
148
+ };
149
+ const media = await firstValueFrom(this.matDialog.open(LDwMaterialImageUploadDialogComponent, config).afterClosed());
143
150
  if (media?.imgBase64) {
144
151
  const response = await firstValueFrom(this.apiService.PUT(uploadUrl, media));
145
152
  if (response?.id) {
@@ -155,8 +162,41 @@ class LDwMaterialMediaService {
155
162
  }
156
163
  return null;
157
164
  }
158
- async clearImage(api) {
159
- return firstValueFrom(this.apiService.DELETE(`${api}`));
165
+ async deleteImage(deleteUrl) {
166
+ return firstValueFrom(this.apiService.DELETE(`${deleteUrl}`));
167
+ }
168
+ async getGallery(galleryUrl) {
169
+ return firstValueFrom(this.apiService.GET(`${galleryUrl}`));
170
+ }
171
+ openGallery(galleryUrl, galleryConfig) {
172
+ const config = {
173
+ height: galleryConfig?.height ?? 'calc(100% - 1rem)',
174
+ width: galleryConfig?.width ?? 'calc(100% - 1rem)',
175
+ maxHeight: galleryConfig?.maxHeight ?? '100%',
176
+ maxWidth: galleryConfig?.maxWidth ?? '100%',
177
+ panelClass: 'ldw-mat-image-gallery-dialog-panel',
178
+ data: { galleryUrl },
179
+ };
180
+ return this.matDialog.open(LDwMaterialImageGalleryDialogComponent, config);
181
+ }
182
+ async uploadGallery(galleryUrl, imgBase64, type = 'jpg') {
183
+ if (imgBase64) {
184
+ const response = await firstValueFrom(this.apiService.PUT(galleryUrl, { imgBase64 }));
185
+ if (response?.id) {
186
+ switch (type) {
187
+ case 'jpg':
188
+ return this.apiService.url(`${this.ENV.url}/${response.id}.jpg?t=${Date.now()}`);
189
+ case 'png':
190
+ return this.apiService.url(`${this.ENV.url}/${response.id}.png?t=${Date.now()}`);
191
+ default:
192
+ break;
193
+ }
194
+ }
195
+ }
196
+ return null;
197
+ }
198
+ async deleteGallery(galleryUrl) {
199
+ return firstValueFrom(this.apiService.DELETE(`${galleryUrl}`));
160
200
  }
161
201
  get ENV() { return this.MEDIA_API$; }
162
202
  get apiService() { return this.lduApiService$; }
@@ -169,6 +209,156 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
169
209
  args: [{ providedIn: 'root' }]
170
210
  }] });
171
211
 
212
+ class LDwMaterialImageGalleryDialogComponent {
213
+ service = inject(LDwMaterialMediaService);
214
+ cdr = inject(ChangeDetectorRef);
215
+ dialogRef = inject((MatDialogRef));
216
+ data = inject(MAT_DIALOG_DATA);
217
+ gallery = [];
218
+ ngOnInit() {
219
+ this.load();
220
+ }
221
+ onSaveClick() {
222
+ this.dialogRef.close(true);
223
+ }
224
+ onCancelClick() {
225
+ this.dialogRef.close(false);
226
+ }
227
+ onFileChange($event) {
228
+ const files = $event?.target?.files;
229
+ if (files?.[0]) {
230
+ const picture = files[0];
231
+ const reader = new FileReader();
232
+ reader.readAsDataURL(picture);
233
+ reader.onload = () => {
234
+ const imgBase64 = reader.result.toString();
235
+ this.service.uploadGallery(this.data.galleryUrl, imgBase64).then(() => this.load());
236
+ };
237
+ }
238
+ }
239
+ onViewClick(imgBase64) {
240
+ if (imgBase64) {
241
+ const base64Data = imgBase64.split(',')[1] || imgBase64;
242
+ const byteCharacters = atob(base64Data);
243
+ const byteNumbers = new Array(byteCharacters.length);
244
+ for (let i = 0; i < byteCharacters.length; i++) {
245
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
246
+ }
247
+ const byteArray = new Uint8Array(byteNumbers);
248
+ const blob = new Blob([byteArray], { type: 'image/jpg' });
249
+ const url = URL.createObjectURL(blob);
250
+ window.open(url, '_blank');
251
+ }
252
+ }
253
+ onDeleteClick(id) {
254
+ this.service.deleteGallery(`${this.data.galleryUrl}/${id}`).then(() => this.load());
255
+ }
256
+ async load() {
257
+ const response = await this.service.getGallery(this.data.galleryUrl);
258
+ this.gallery = response;
259
+ this.cdr.detectChanges();
260
+ }
261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
262
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: LDwMaterialImageGalleryDialogComponent, isStandalone: true, selector: "ldw-mat-image-gallery-dialog", host: { classAttribute: "ldw-mat-image-gallery-dialog" }, ngImport: i0, template: `
263
+ <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.title' | i18n }}</h2>
264
+ <mat-dialog-content>
265
+ <input class="ldw-mat-image-gallery-hidden-input"
266
+ #uploader type="file"
267
+ [style.display]="'none'"
268
+ (change)="onFileChange($event)"
269
+ />
270
+ <div class="ldw-mat-image-gallery--instance">
271
+ <div class="ldw-mat-image-gallery-item ldw-mat-image-gallery-item--upload"
272
+ (keypress)="uploader.click()"
273
+ (click)="uploader.click()"
274
+ ><mat-icon>add</mat-icon>
275
+ </div>
276
+ @for (image of gallery; track image.id)
277
+ {
278
+ <div class="ldw-mat-image-gallery-item">
279
+ <a [href]="image.imgSrc" target="_blank"
280
+ (click)="onViewClick(image.imgSrc)"
281
+ ><img [src]="image.imgSrc" [alt]="image.imgAlt" />
282
+ </a>
283
+ <mat-icon
284
+ (keypress)="onDeleteClick(image.id)"
285
+ (click)="onDeleteClick(image.id)"
286
+ >delete</mat-icon>
287
+ </div>
288
+ }
289
+ </div>
290
+ </mat-dialog-content>
291
+ <mat-dialog-actions>
292
+ <button
293
+ class="ldw-mat-image-gallery-save"
294
+ matButton
295
+ (click)="onSaveClick()"
296
+ >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnSave' | i18n }}</button>
297
+ <button
298
+ class="ldw-mat-image-gallery-cancel"
299
+ matButton
300
+ (click)="onCancelClick()"
301
+ >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnCancel' | i18n }}</button>
302
+ </mat-dialog-actions>
303
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "pipe", type: LDuAnguBootTranslationPipe, name: "i18n" }] });
304
+ }
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryDialogComponent, decorators: [{
306
+ type: Component,
307
+ args: [{
308
+ selector: 'ldw-mat-image-gallery-dialog',
309
+ host: { class: 'ldw-mat-image-gallery-dialog' },
310
+ imports: [
311
+ CommonModule,
312
+ MatButtonModule,
313
+ MatIconModule,
314
+ MatDialogModule,
315
+ LDuAnguBootTranslationPipe,
316
+ ],
317
+ template: `
318
+ <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.title' | i18n }}</h2>
319
+ <mat-dialog-content>
320
+ <input class="ldw-mat-image-gallery-hidden-input"
321
+ #uploader type="file"
322
+ [style.display]="'none'"
323
+ (change)="onFileChange($event)"
324
+ />
325
+ <div class="ldw-mat-image-gallery--instance">
326
+ <div class="ldw-mat-image-gallery-item ldw-mat-image-gallery-item--upload"
327
+ (keypress)="uploader.click()"
328
+ (click)="uploader.click()"
329
+ ><mat-icon>add</mat-icon>
330
+ </div>
331
+ @for (image of gallery; track image.id)
332
+ {
333
+ <div class="ldw-mat-image-gallery-item">
334
+ <a [href]="image.imgSrc" target="_blank"
335
+ (click)="onViewClick(image.imgSrc)"
336
+ ><img [src]="image.imgSrc" [alt]="image.imgAlt" />
337
+ </a>
338
+ <mat-icon
339
+ (keypress)="onDeleteClick(image.id)"
340
+ (click)="onDeleteClick(image.id)"
341
+ >delete</mat-icon>
342
+ </div>
343
+ }
344
+ </div>
345
+ </mat-dialog-content>
346
+ <mat-dialog-actions>
347
+ <button
348
+ class="ldw-mat-image-gallery-save"
349
+ matButton
350
+ (click)="onSaveClick()"
351
+ >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnSave' | i18n }}</button>
352
+ <button
353
+ class="ldw-mat-image-gallery-cancel"
354
+ matButton
355
+ (click)="onCancelClick()"
356
+ >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnCancel' | i18n }}</button>
357
+ </mat-dialog-actions>
358
+ `
359
+ }]
360
+ }] });
361
+
172
362
  class LDwMaterialImageUploaderComponent {
173
363
  service = inject(LDwMaterialMediaService);
174
364
  readonly$ = false;
@@ -195,7 +385,7 @@ class LDwMaterialImageUploaderComponent {
195
385
  }
196
386
  async onDeleteClick() {
197
387
  if (this.api) {
198
- await this.service.clearImage(this.api);
388
+ await this.service.deleteImage(this.api);
199
389
  }
200
390
  this.control.setValue(null);
201
391
  }
@@ -328,6 +518,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
328
518
  type: Input
329
519
  }] } });
330
520
 
521
+ const components$1 = [
522
+ LDwMaterialImageGalleryDialogComponent,
523
+ ];
524
+ class LDwMaterialImageGalleryModule {
525
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
526
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryModule, imports: [LDwMaterialImageGalleryDialogComponent], exports: [LDwMaterialImageGalleryDialogComponent] });
527
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryModule, imports: [components$1] });
528
+ }
529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LDwMaterialImageGalleryModule, decorators: [{
530
+ type: NgModule,
531
+ args: [{
532
+ imports: [...components$1],
533
+ exports: [...components$1]
534
+ }]
535
+ }] });
536
+
331
537
  const components = [
332
538
  LDwMaterialImageUploadDialogComponent,
333
539
  LDwMaterialImageUploaderComponent,
@@ -351,5 +557,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
351
557
  * Generated bundle index. Do not edit.
352
558
  */
353
559
 
354
- export { LDW_MAT_MEDIA_API, LDwMaterialImageUploadDialogComponent, LDwMaterialImageUploaderComponent, LDwMaterialImageUploaderModule, LDwMaterialMediaService };
560
+ export { LDW_MAT_MEDIA_API, LDwMaterialImageGalleryDialogComponent, LDwMaterialImageGalleryModule, LDwMaterialImageUploadDialogComponent, LDwMaterialImageUploaderComponent, LDwMaterialImageUploaderModule, LDwMaterialMediaService };
355
561
  //# sourceMappingURL=ldw-framework-material-media.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ldw-framework-material-media.mjs","sources":["../../../lib/src/components/ldw-mat-image-upload-dialog.component.ts","../../../lib/src/config/ldw-mat-media.config.ts","../../../lib/src/services/ldw-mat-media.service.ts","../../../lib/src/components/ldw-mat-image-uploader.component.ts","../../../lib/src/modules/ldw-mat-image-uploader.module.ts","../../../lib/src/ldw-framework-material-media.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { LDuAnguBootTranslationPipe } from '@ldu-anguboot/i18n';\nimport { LDwMaterialMediaModel } from '../models/ldw-mat-media.model';\n\n@Component({\n selector: 'ldw-mat-image-upload-dialog',\n host: { class: 'ldw-mat-image-upload-dialog' },\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n LDuAnguBootTranslationPipe,\n ],\n template: `\n <mat-dialog-actions>\n <h2>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>\n <button class=\"ldw-mat-image-uploader-save\"\n matButton\n cdkFocusInitial\n (click)=\"onSaveClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>\n <button class=\"ldw-mat-image-uploader-cancel\"\n matButton\n (click)=\"onCancelClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>\n </mat-dialog-actions>\n <mat-dialog-content>\n <input class=\"ldw-mat-image-uploader-hidden-input\"\n #uploader type=\"file\"\n [style.display]=\"'none'\"\n (change)=\"onChange($event)\"\n />\n <div class=\"ldw-mat-image-uploader--instance\"\n [style.backgroundImage]=\"$backgroundImage\"\n (keypress)=\"uploader.click()\"\n (click)=\"uploader.click()\"\n >@if ($noData) { <mat-icon>image</mat-icon> }\n </div>\n </mat-dialog-content>\n`})\nexport class LDwMaterialImageUploadDialogComponent {\n\n readonly dialogRef = inject(MatDialogRef<LDwMaterialImageUploadDialogComponent>);\n\n readonly data = inject<LDwMaterialMediaModel>(MAT_DIALOG_DATA);\n\n readonly cdr = inject(ChangeDetectorRef);\n\n onSaveClick() {\n this.dialogRef.close(this.data);\n }\n\n onCancelClick() {\n this.dialogRef.close(false);\n }\n\n onChange($event: any) {\n const files = $event?.target?.files;\n if (files?.[0]) {\n const picture = files[0];\n const reader = new FileReader();\n reader.readAsDataURL(picture);\n reader.onload = () => {\n this.data.imgBase64 = (reader.result as string).toString();\n this.cdr.detectChanges();\n };\n }\n }\n\n get $backgroundImage() {\n if (this.data.imgBase64) {\n return 'url(' + this.data.imgBase64 + ')';\n }\n if (this.data.imgSrc) {\n return 'url(' + this.data.imgSrc + ')';\n }\n return '';\n }\n\n get $noData() {\n return !this.data?.imgBase64 && !this.data?.imgSrc;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const LDW_MAT_MEDIA_API = new InjectionToken<{\n url: string;\n}>('LDW_MAT_MEDIA_API');\n","import { inject, Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { LDuAnguBootApiService } from '@ldu-anguboot/http';\nimport { firstValueFrom } from 'rxjs';\nimport { LDwMaterialImageUploadDialogComponent } from '../components/ldw-mat-image-upload-dialog.component';\nimport { LDW_MAT_MEDIA_API } from '../config/ldw-mat-media.config';\nimport { LDwMaterialMediaModel } from '../models/ldw-mat-media.model';\n\n@Injectable({ providedIn: 'root' })\nexport class LDwMaterialMediaService {\n\n private readonly MEDIA_API$ = inject(LDW_MAT_MEDIA_API);\n\n private readonly lduApiService$ = inject(LDuAnguBootApiService);\n\n private readonly matDialog$ = inject(MatDialog);\n\n async uploadImage(uploadUrl: string, type: 'jpg' | 'png' = 'jpg', data?: LDwMaterialMediaModel) {\n const media = await firstValueFrom(this.matDialog.open(LDwMaterialImageUploadDialogComponent, {\n height: 'calc(100% - 1rem)',\n width: 'calc(100% - 1rem)',\n maxHeight: '100%',\n maxWidth: '100%',\n data: {\n imgSrc: data?.imgSrc,\n imgBase64: data?.imgBase64,\n },\n }).afterClosed());\n if (media?.imgBase64) {\n const response = await firstValueFrom(this.apiService.PUT<LDwMaterialMediaModel>(uploadUrl, media));\n if (response?.id) {\n switch (type) {\n case 'jpg':\n return this.apiService.url(`${this.ENV.url}/${response.id}.jpg?t=${Date.now()}`);\n case 'png':\n return this.apiService.url(`${this.ENV.url}/${response.id}.png?t=${Date.now()}`);\n default:\n break;\n }\n }\n }\n return null;\n }\n\n async clearImage(api: string) {\n return firstValueFrom(this.apiService.DELETE(`${api}`));\n }\n\n get ENV() { return this.MEDIA_API$; }\n\n get apiService() { return this.lduApiService$; }\n\n get matDialog() { return this.matDialog$; }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { CommonModule } from '@angular/common';\nimport { Component, inject, Input } from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { LDwMaterialMediaService } from '../services/ldw-mat-media.service';\n\n@Component({\n selector: 'ldw-mat-image-uploader',\n host: { class: 'ldw-mat-image-uploader' },\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n ],\n template: `\n <form\n [formGroup]=\"formParent\"\n novalidate\n ><mat-form-field\n [appearance]=\"appearance\"\n ><mat-label\n [innerHTML]=\"label\" />\n <input matInput\n [name]=\"name\"\n [formControlName]=\"formParentControlName\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n />\n @if (dimensions)\n {\n <mat-hint>{{ dimensions }}.{{ type }}</mat-hint>\n }\n <div matSuffix>\n @if (control.value)\n {\n <a matIconButton\n [href]=\"control.value\"\n target=\"_blank\"\n ><mat-icon>visibility</mat-icon>\n </a>\n }\n <button matIconButton\n (click)=\"onUploadClick()\"\n ><mat-icon>add_photo_alternate</mat-icon>\n </button>\n <button matIconButton\n (click)=\"onDeleteClick()\"\n ><mat-icon>delete</mat-icon>\n </button>\n </div>\n <ng-content/>\n </mat-form-field>\n </form>\n`})\nexport class LDwMaterialImageUploaderComponent {\n\n protected readonly service = inject(LDwMaterialMediaService);\n\n protected readonly$: string | boolean = false;\n\n protected required$: string | boolean = false;\n\n @Input({ required: true })\n formParent: FormGroup = new FormGroup({\n value: new FormControl<string | null | undefined>(null, [])\n });\n\n @Input({ required: true })\n formParentControlName = 'value';\n\n @Input({ required: true })\n label = 'Value';\n\n @Input()\n appearance: 'fill' | 'outline' = 'outline';\n\n @Input()\n name = 'value';\n\n @Input()\n type: 'jpg' | 'png' = 'jpg';\n\n @Input()\n dimensions: string | null | undefined;\n\n @Input()\n api: string | null | undefined;\n\n @Input()\n set readonly(v) { this.readonly$ = coerceBooleanProperty(v); }\n\n @Input()\n set required(v) { this.required$ = coerceBooleanProperty(v); }\n\n async onUploadClick() {\n if (this.api) {\n const mediaUrl = await this.service.uploadImage(`${this.api}`);\n if (mediaUrl) {\n this.control.setValue(mediaUrl);\n }\n }\n }\n\n async onDeleteClick() {\n if (this.api) {\n await this.service.clearImage(this.api);\n }\n this.control.setValue(null);\n }\n\n get readonly() { return this.readonly$; };\n\n get required() { return this.required$; };\n\n get control() {\n return this.formParent?.get(this.formParentControlName) as FormControl<string | null | undefined>;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { LDwMaterialImageUploadDialogComponent } from '../components/ldw-mat-image-upload-dialog.component';\nimport { LDwMaterialImageUploaderComponent } from '../components/ldw-mat-image-uploader.component';\n\nconst components = [\n LDwMaterialImageUploadDialogComponent,\n LDwMaterialImageUploaderComponent,\n];\n\n@NgModule({\n imports: [...components],\n exports: [...components]\n})\nexport class LDwMaterialImageUploaderModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;MA6Ca,qCAAqC,CAAA;AAErC,IAAA,SAAS,GAAG,MAAM,EAAC,YAAmD,EAAC;AAEvE,IAAA,IAAI,GAAG,MAAM,CAAwB,eAAe,CAAC;AAErD,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAExC,WAAW,GAAA;QACP,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACnC;IAEA,aAAa,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/B;AAEA,IAAA,QAAQ,CAAC,MAAW,EAAA;AAChB,QAAA,MAAM,KAAK,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK;AACnC,QAAA,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;AACZ,YAAA,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;AACxB,YAAA,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;AAC/B,YAAA,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7B,YAAA,MAAM,CAAC,MAAM,GAAG,MAAK;gBACjB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAI,MAAM,CAAC,MAAiB,CAAC,QAAQ,EAAE;AA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AAqC;YACrC,iCAAiC,CAAA,EAAA,CAAA;AAOxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAH1B,UAAU,CAAA,EAAA,CAAA;;2FAGd,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAJ1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU;AAC1B,iBAAA;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"ldw-framework-material-media.mjs","sources":["../../../lib/src/components/ldw-mat-image-upload-dialog.component.ts","../../../lib/src/config/ldw-mat-media.config.ts","../../../lib/src/services/ldw-mat-media.service.ts","../../../lib/src/components/ldw-mat-image-gallery-dialog.component.ts","../../../lib/src/components/ldw-mat-image-uploader.component.ts","../../../lib/src/modules/ldw-mat-image-gallery.module.ts","../../../lib/src/modules/ldw-mat-image-uploader.module.ts","../../../lib/src/ldw-framework-material-media.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { LDuAnguBootTranslationPipe } from '@ldu-anguboot/i18n';\nimport { LDwMaterialMediaModel } from '../models/ldw-mat-media.model';\n\n@Component({\n selector: 'ldw-mat-image-upload-dialog',\n host: { class: 'ldw-mat-image-upload-dialog' },\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n LDuAnguBootTranslationPipe,\n ],\n template: `\n <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.title' | i18n }}</h2>\n <mat-dialog-content>\n <input class=\"ldw-mat-image-uploader-hidden-input\"\n #uploader type=\"file\"\n [style.display]=\"'none'\"\n (change)=\"onFileChange($event)\"\n />\n <div class=\"ldw-mat-image-uploader--instance\"\n [style.backgroundImage]=\"$backgroundImage\"\n (keypress)=\"uploader.click()\"\n (click)=\"uploader.click()\"\n >@if ($noData) {\n <mat-icon>image</mat-icon> }\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n class=\"ldw-mat-image-uploader-save\"\n matButton\n cdkFocusInitial\n (click)=\"onSaveClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnSave' | i18n }}</button>\n <button class=\"ldw-mat-image-uploader-cancel\"\n matButton\n (click)=\"onCancelClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_UPLOAD_DIALOG.btnCancel' | i18n }}</button>\n </mat-dialog-actions>\n`})\nexport class LDwMaterialImageUploadDialogComponent {\n\n readonly dialogRef = inject(MatDialogRef<LDwMaterialImageUploadDialogComponent>);\n\n readonly data = inject<LDwMaterialMediaModel>(MAT_DIALOG_DATA);\n\n readonly cdr = inject(ChangeDetectorRef);\n\n onSaveClick() {\n this.dialogRef.close(this.data);\n }\n\n onCancelClick() {\n this.dialogRef.close(false);\n }\n\n onFileChange($event: any) {\n const files = $event?.target?.files;\n if (files?.[0]) {\n const picture = files[0];\n const reader = new FileReader();\n reader.readAsDataURL(picture);\n reader.onload = () => {\n this.data.imgBase64 = (reader.result as string).toString();\n this.cdr.detectChanges();\n };\n }\n }\n\n get $backgroundImage() {\n if (this.data.imgBase64) {\n return 'url(' + this.data.imgBase64 + ')';\n }\n if (this.data.imgSrc) {\n return 'url(' + this.data.imgSrc + ')';\n }\n return '';\n }\n\n get $noData() {\n return !this.data?.imgBase64 && !this.data?.imgSrc;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const LDW_MAT_MEDIA_API = new InjectionToken<{\n url: string;\n}>('LDW_MAT_MEDIA_API');\n","import { inject, Injectable } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { LDuAnguBootApiService } from '@ldu-anguboot/http';\nimport { firstValueFrom } from 'rxjs';\nimport { LDwMaterialImageGalleryDialogComponent } from '../components/ldw-mat-image-gallery-dialog.component';\nimport { LDwMaterialImageUploadDialogComponent } from '../components/ldw-mat-image-upload-dialog.component';\nimport { LDW_MAT_MEDIA_API } from '../config/ldw-mat-media.config';\nimport { LDwMaterialMediaModel } from '../models/ldw-mat-media.model';\n\n@Injectable({ providedIn: 'root' })\nexport class LDwMaterialMediaService {\n\n private readonly MEDIA_API$ = inject(LDW_MAT_MEDIA_API);\n\n private readonly lduApiService$ = inject(LDuAnguBootApiService);\n\n private readonly matDialog$ = inject(MatDialog);\n\n async uploadImage(uploadUrl: string, uploadConfig?: {\n height?: string;\n width?: string;\n maxHeight?: string;\n maxWidth?: string;\n }, type: 'jpg' | 'png' = 'jpg', data?: LDwMaterialMediaModel) {\n const config = {\n height: uploadConfig?.height ?? 'calc(100% - 1rem)',\n width: uploadConfig?.width ?? 'calc(100% - 1rem)',\n maxHeight: uploadConfig?.maxHeight ?? '100%',\n maxWidth: uploadConfig?.maxWidth ?? '100%',\n panelClass: 'ldw-mat-image-upload-dialog-panel',\n data: {\n imgAlt: data?.imgAlt,\n imgSrc: data?.imgSrc,\n imgBase64: data?.imgBase64,\n },\n };\n const media = await firstValueFrom(this.matDialog.open(LDwMaterialImageUploadDialogComponent, config).afterClosed());\n if (media?.imgBase64) {\n const response = await firstValueFrom(this.apiService.PUT<LDwMaterialMediaModel>(uploadUrl, media));\n if (response?.id) {\n switch (type) {\n case 'jpg':\n return this.apiService.url(`${this.ENV.url}/${response.id}.jpg?t=${Date.now()}`);\n case 'png':\n return this.apiService.url(`${this.ENV.url}/${response.id}.png?t=${Date.now()}`);\n default:\n break;\n }\n }\n }\n return null;\n }\n\n async deleteImage(deleteUrl: string) {\n return firstValueFrom(this.apiService.DELETE(`${deleteUrl}`));\n }\n\n async getGallery(galleryUrl: string) {\n return firstValueFrom(this.apiService.GET(`${galleryUrl}`));\n }\n\n openGallery(galleryUrl: string, galleryConfig?: {\n height?: string;\n width?: string;\n maxHeight?: string;\n maxWidth?: string;\n }) {\n const config = {\n height: galleryConfig?.height ?? 'calc(100% - 1rem)',\n width: galleryConfig?.width ?? 'calc(100% - 1rem)',\n maxHeight: galleryConfig?.maxHeight ?? '100%',\n maxWidth: galleryConfig?.maxWidth ?? '100%',\n panelClass: 'ldw-mat-image-gallery-dialog-panel',\n data: { galleryUrl },\n };\n return this.matDialog.open(LDwMaterialImageGalleryDialogComponent, config);\n }\n\n async uploadGallery(galleryUrl: string, imgBase64: string | null | undefined, type: 'jpg' | 'png' = 'jpg') {\n if (imgBase64) {\n const response = await firstValueFrom(this.apiService.PUT<LDwMaterialMediaModel>(galleryUrl, { imgBase64 }));\n if (response?.id) {\n switch (type) {\n case 'jpg':\n return this.apiService.url(`${this.ENV.url}/${response.id}.jpg?t=${Date.now()}`);\n case 'png':\n return this.apiService.url(`${this.ENV.url}/${response.id}.png?t=${Date.now()}`);\n default:\n break;\n }\n }\n }\n return null;\n }\n\n async deleteGallery(galleryUrl: string) {\n return firstValueFrom(this.apiService.DELETE(`${galleryUrl}`));\n }\n\n get ENV() { return this.MEDIA_API$; }\n\n get apiService() { return this.lduApiService$; }\n\n get matDialog() { return this.matDialog$; }\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { LDuAnguBootTranslationPipe } from '@ldu-anguboot/i18n';\nimport { LDwMaterialGalleryModel, LDwMaterialMediaModel } from '../models/ldw-mat-media.model';\nimport { LDwMaterialMediaService } from '../services/ldw-mat-media.service';\n\n@Component({\n selector: 'ldw-mat-image-gallery-dialog',\n host: { class: 'ldw-mat-image-gallery-dialog' },\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n LDuAnguBootTranslationPipe,\n ],\n template: `\n <h2 mat-dialog-title>{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.title' | i18n }}</h2>\n <mat-dialog-content>\n <input class=\"ldw-mat-image-gallery-hidden-input\"\n #uploader type=\"file\"\n [style.display]=\"'none'\"\n (change)=\"onFileChange($event)\"\n />\n <div class=\"ldw-mat-image-gallery--instance\">\n <div class=\"ldw-mat-image-gallery-item ldw-mat-image-gallery-item--upload\"\n (keypress)=\"uploader.click()\"\n (click)=\"uploader.click()\"\n ><mat-icon>add</mat-icon>\n </div>\n @for (image of gallery; track image.id)\n {\n <div class=\"ldw-mat-image-gallery-item\">\n <a [href]=\"image.imgSrc\" target=\"_blank\"\n (click)=\"onViewClick(image.imgSrc)\"\n ><img [src]=\"image.imgSrc\" [alt]=\"image.imgAlt\" />\n </a>\n <mat-icon\n (keypress)=\"onDeleteClick(image.id)\"\n (click)=\"onDeleteClick(image.id)\"\n >delete</mat-icon>\n </div>\n }\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n class=\"ldw-mat-image-gallery-save\"\n matButton\n (click)=\"onSaveClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnSave' | i18n }}</button>\n <button\n class=\"ldw-mat-image-gallery-cancel\"\n matButton\n (click)=\"onCancelClick()\"\n >{{ 'LDU_ANGUBOOT_IMG_GALLERY_DIALOG.btnCancel' | i18n }}</button>\n </mat-dialog-actions>\n`})\nexport class LDwMaterialImageGalleryDialogComponent implements OnInit {\n\n protected readonly service = inject(LDwMaterialMediaService);\n\n protected readonly cdr = inject(ChangeDetectorRef);\n\n readonly dialogRef = inject(MatDialogRef<LDwMaterialImageGalleryDialogComponent>);\n\n readonly data = inject<LDwMaterialGalleryModel>(MAT_DIALOG_DATA);\n\n gallery: LDwMaterialMediaModel[] = [];\n\n ngOnInit() {\n this.load();\n }\n\n onSaveClick() {\n this.dialogRef.close(true);\n }\n\n onCancelClick() {\n this.dialogRef.close(false);\n }\n\n onFileChange($event: any) {\n const files = $event?.target?.files;\n if (files?.[0]) {\n const picture = files[0];\n const reader = new FileReader();\n reader.readAsDataURL(picture);\n reader.onload = () => {\n const imgBase64 = (reader.result as string).toString();\n this.service.uploadGallery(this.data.galleryUrl, imgBase64).then(() => this.load());\n };\n }\n }\n\n onViewClick(imgBase64: string | null | undefined) {\n if (imgBase64) {\n const base64Data = imgBase64.split(',')[1] || imgBase64;\n const byteCharacters = atob(base64Data);\n const byteNumbers = new Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n const byteArray = new Uint8Array(byteNumbers);\n const blob = new Blob([byteArray], { type: 'image/jpg' });\n const url = URL.createObjectURL(blob);\n window.open(url, '_blank');\n }\n }\n\n onDeleteClick(id: number | null | undefined) {\n this.service.deleteGallery(`${this.data.galleryUrl}/${id}`).then(() => this.load());\n }\n\n protected async load() {\n const response = await this.service.getGallery(this.data.galleryUrl);\n this.gallery = response as LDwMaterialMediaModel[];\n this.cdr.detectChanges();\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { CommonModule } from '@angular/common';\nimport { Component, inject, Input } from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { LDwMaterialMediaService } from '../services/ldw-mat-media.service';\n\n@Component({\n selector: 'ldw-mat-image-uploader',\n host: { class: 'ldw-mat-image-uploader' },\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n ],\n template: `\n <form\n [formGroup]=\"formParent\"\n novalidate\n ><mat-form-field\n [appearance]=\"appearance\"\n ><mat-label\n [innerHTML]=\"label\" />\n <input matInput\n [name]=\"name\"\n [formControlName]=\"formParentControlName\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n />\n @if (dimensions)\n {\n <mat-hint>{{ dimensions }}.{{ type }}</mat-hint>\n }\n <div matSuffix>\n @if (control.value)\n {\n <a matIconButton\n [href]=\"control.value\"\n target=\"_blank\"\n ><mat-icon>visibility</mat-icon>\n </a>\n }\n <button matIconButton\n (click)=\"onUploadClick()\"\n ><mat-icon>add_photo_alternate</mat-icon>\n </button>\n <button matIconButton\n (click)=\"onDeleteClick()\"\n ><mat-icon>delete</mat-icon>\n </button>\n </div>\n <ng-content/>\n </mat-form-field>\n </form>\n`})\nexport class LDwMaterialImageUploaderComponent {\n\n protected readonly service = inject(LDwMaterialMediaService);\n\n protected readonly$: string | boolean = false;\n\n protected required$: string | boolean = false;\n\n @Input({ required: true })\n formParent: FormGroup = new FormGroup({\n value: new FormControl<string | null | undefined>(null, [])\n });\n\n @Input({ required: true })\n formParentControlName = 'value';\n\n @Input({ required: true })\n label = 'Value';\n\n @Input()\n appearance: 'fill' | 'outline' = 'outline';\n\n @Input()\n name = 'value';\n\n @Input()\n type: 'jpg' | 'png' = 'jpg';\n\n @Input()\n dimensions: string | null | undefined;\n\n @Input()\n api: string | null | undefined;\n\n @Input()\n set readonly(v) { this.readonly$ = coerceBooleanProperty(v); }\n\n @Input()\n set required(v) { this.required$ = coerceBooleanProperty(v); }\n\n async onUploadClick() {\n if (this.api) {\n const mediaUrl = await this.service.uploadImage(`${this.api}`);\n if (mediaUrl) {\n this.control.setValue(mediaUrl);\n }\n }\n }\n\n async onDeleteClick() {\n if (this.api) {\n await this.service.deleteImage(this.api);\n }\n this.control.setValue(null);\n }\n\n get readonly() { return this.readonly$; };\n\n get required() { return this.required$; };\n\n get control() {\n return this.formParent?.get(this.formParentControlName) as FormControl<string | null | undefined>;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { LDwMaterialImageGalleryDialogComponent } from '../components/ldw-mat-image-gallery-dialog.component';\n\nconst components = [\n LDwMaterialImageGalleryDialogComponent,\n];\n\n@NgModule({\n imports: [...components],\n exports: [...components]\n})\nexport class LDwMaterialImageGalleryModule { }\n","import { NgModule } from '@angular/core';\nimport { LDwMaterialImageUploadDialogComponent } from '../components/ldw-mat-image-upload-dialog.component';\nimport { LDwMaterialImageUploaderComponent } from '../components/ldw-mat-image-uploader.component';\n\nconst components = [\n LDwMaterialImageUploadDialogComponent,\n LDwMaterialImageUploaderComponent,\n];\n\n@NgModule({\n imports: [...components],\n exports: [...components]\n})\nexport class LDwMaterialImageUploaderModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3","i5","components"],"mappings":";;;;;;;;;;;;;;;;;;;;MA+Ca,qCAAqC,CAAA;AAErC,IAAA,SAAS,GAAG,MAAM,EAAC,YAAmD,EAAC;AAEvE,IAAA,IAAI,GAAG,MAAM,CAAwB,eAAe,CAAC;AAErD,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAExC,WAAW,GAAA;QACP,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACnC;IAEA,aAAa,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/B;AAEA,IAAA,YAAY,CAAC,MAAW,EAAA;AACpB,QAAA,MAAM,KAAK,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK;AACnC,QAAA,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;AACZ,YAAA,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;AACxB,YAAA,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE;AAC/B,YAAA,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7B,YAAA,MAAM,CAAC,MAAM,GAAG,MAAK;gBACjB,IAAI,CAAC,IAAI,CAAC,SAAS,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,EAAA,8BAA8B,YARvC,qCAAqC;AACrC,YAAA,iCAAiC,aADjC,qCAAqC;YACrC,iCAAiC,CAAA,EAAA,CAAA;AAOxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAH1B,UAAU,CAAA,EAAA,CAAA;;2FAGd,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAJ1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AACxB,oBAAA,OAAO,EAAE,CAAC,GAAG,UAAU;AAC1B,iBAAA;;;ACZD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldw-framework/material-media",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^21.0.0",
6
6
  "@angular/common": "^21.0.0",
@@ -1,3 +1,15 @@
1
+ .ldw-mat-image-upload-dialog-panel,
2
+ .ldw-mat-image-gallery-dialog-panel {
3
+
4
+ .mat-mdc-dialog-surface {
5
+ border-radius: 0px !important;
6
+ }
7
+
8
+ .mat-mdc-dialog-content {
9
+ max-height: 100%;
10
+ }
11
+ }
12
+
1
13
  .ldw-mat-image-upload-dialog {
2
14
 
3
15
  .ldw-mat-image-uploader--instance {
@@ -27,16 +39,78 @@
27
39
  opacity: 0.925;
28
40
  }
29
41
  }
42
+ }
43
+
44
+ .ldw-mat-image-gallery-dialog {
45
+
46
+ .ldw-mat-image-gallery--instance {
47
+ background-color: #eaeaea;
48
+ background-position: center;
49
+ background-repeat: no-repeat;
50
+ background-size: contain;
51
+ border-width: 1px;
52
+ border-style: dotted;
53
+ border-color: inherit;
54
+ height: calc(100% - 2px);
55
+ width: calc(100% - 2px);
56
+ position: relative;
57
+ display: flex;
58
+ flex-direction: row;
59
+ flex-wrap: wrap;
60
+ justify-content: flex-start;
61
+ overflow: auto;
62
+
63
+ .ldw-mat-image-gallery-item {
64
+ position: relative;
65
+ width: calc(33% - 2rem);
66
+ height: calc(33% - 2rem);
67
+ margin: 1rem;
68
+
69
+ img {
70
+ width: 100%;
71
+ height: 100%;
72
+ }
73
+
74
+ mat-icon {
75
+ display: none;
76
+ position: absolute;
77
+ top: 1rem;
78
+ right: 1rem;
79
+ background-color: white;
80
+ border-radius: 50%;
81
+ padding: 1rem;
82
+ }
83
+
84
+ &:hover {
85
+ cursor: pointer;
30
86
 
31
- .mat-mdc-dialog-actions {
32
- h2 {
33
- margin-right: auto;
87
+ img {
88
+ opacity: 0.5;
89
+ }
90
+
91
+ mat-icon {
92
+ display: block;
93
+ }
94
+ }
34
95
  }
35
- }
36
96
 
37
- .mat-mdc-dialog-content {
38
- max-height: 100%;
39
- padding-top: 0px !important;
40
- margin-bottom: 2rem;
97
+ .ldw-mat-image-gallery-item--upload {
98
+ background-color: white;
99
+
100
+ mat-icon {
101
+ display: block;
102
+ position: absolute;
103
+ top: 50%;
104
+ left: 50%;
105
+ transform: translate(-50%, -50%);
106
+ border-radius: 0;
107
+ }
108
+ }
41
109
  }
110
+ }
111
+
112
+ .ldw-mat-image-uploader {
113
+ width: 100%;
114
+ margin-left: 8px;
115
+ margin-right: -8px;
42
116
  }
@@ -1,34 +1,40 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ChangeDetectorRef, InjectionToken } from '@angular/core';
3
- import { MatDialogRef, MatDialog } from '@angular/material/dialog';
4
- import { FormGroup, FormControl } from '@angular/forms';
2
+ import { OnInit, ChangeDetectorRef, InjectionToken } from '@angular/core';
3
+ import * as _angular_material_dialog from '@angular/material/dialog';
4
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
5
5
  import { LDuAnguBootApiService } from '@ldu-anguboot/http';
6
+ import { FormGroup, FormControl } from '@angular/forms';
6
7
 
7
8
  interface LDwMaterialMediaModel {
8
9
  id?: number;
10
+ imgAlt?: string;
9
11
  imgSrc?: string;
10
12
  imgBase64?: string;
11
13
  }
12
-
13
- declare class LDwMaterialImageUploadDialogComponent {
14
- readonly dialogRef: MatDialogRef<any, any>;
15
- readonly data: LDwMaterialMediaModel;
16
- readonly cdr: ChangeDetectorRef;
17
- onSaveClick(): void;
18
- onCancelClick(): void;
19
- onChange($event: any): void;
20
- get $backgroundImage(): string;
21
- get $noData(): boolean;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<LDwMaterialImageUploadDialogComponent, never>;
23
- static ɵcmp: i0.ɵɵComponentDeclaration<LDwMaterialImageUploadDialogComponent, "ldw-mat-image-upload-dialog", never, {}, {}, never, never, true, never>;
14
+ interface LDwMaterialGalleryModel {
15
+ galleryUrl: string;
24
16
  }
25
17
 
26
18
  declare class LDwMaterialMediaService {
27
19
  private readonly MEDIA_API$;
28
20
  private readonly lduApiService$;
29
21
  private readonly matDialog$;
30
- uploadImage(uploadUrl: string, type?: 'jpg' | 'png', data?: LDwMaterialMediaModel): Promise<string | null>;
31
- clearImage(api: string): Promise<unknown>;
22
+ uploadImage(uploadUrl: string, uploadConfig?: {
23
+ height?: string;
24
+ width?: string;
25
+ maxHeight?: string;
26
+ maxWidth?: string;
27
+ }, type?: 'jpg' | 'png', data?: LDwMaterialMediaModel): Promise<string | null>;
28
+ deleteImage(deleteUrl: string): Promise<unknown>;
29
+ getGallery(galleryUrl: string): Promise<unknown>;
30
+ openGallery(galleryUrl: string, galleryConfig?: {
31
+ height?: string;
32
+ width?: string;
33
+ maxHeight?: string;
34
+ maxWidth?: string;
35
+ }): _angular_material_dialog.MatDialogRef<LDwMaterialImageGalleryDialogComponent, any>;
36
+ uploadGallery(galleryUrl: string, imgBase64: string | null | undefined, type?: 'jpg' | 'png'): Promise<string | null>;
37
+ deleteGallery(galleryUrl: string): Promise<unknown>;
32
38
  get ENV(): {
33
39
  url: string;
34
40
  };
@@ -38,6 +44,36 @@ declare class LDwMaterialMediaService {
38
44
  static ɵprov: i0.ɵɵInjectableDeclaration<LDwMaterialMediaService>;
39
45
  }
40
46
 
47
+ declare class LDwMaterialImageGalleryDialogComponent implements OnInit {
48
+ protected readonly service: LDwMaterialMediaService;
49
+ protected readonly cdr: ChangeDetectorRef;
50
+ readonly dialogRef: MatDialogRef<any, any>;
51
+ readonly data: LDwMaterialGalleryModel;
52
+ gallery: LDwMaterialMediaModel[];
53
+ ngOnInit(): void;
54
+ onSaveClick(): void;
55
+ onCancelClick(): void;
56
+ onFileChange($event: any): void;
57
+ onViewClick(imgBase64: string | null | undefined): void;
58
+ onDeleteClick(id: number | null | undefined): void;
59
+ protected load(): Promise<void>;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<LDwMaterialImageGalleryDialogComponent, never>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<LDwMaterialImageGalleryDialogComponent, "ldw-mat-image-gallery-dialog", never, {}, {}, never, never, true, never>;
62
+ }
63
+
64
+ declare class LDwMaterialImageUploadDialogComponent {
65
+ readonly dialogRef: MatDialogRef<any, any>;
66
+ readonly data: LDwMaterialMediaModel;
67
+ readonly cdr: ChangeDetectorRef;
68
+ onSaveClick(): void;
69
+ onCancelClick(): void;
70
+ onFileChange($event: any): void;
71
+ get $backgroundImage(): string;
72
+ get $noData(): boolean;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<LDwMaterialImageUploadDialogComponent, never>;
74
+ static ɵcmp: i0.ɵɵComponentDeclaration<LDwMaterialImageUploadDialogComponent, "ldw-mat-image-upload-dialog", never, {}, {}, never, never, true, never>;
75
+ }
76
+
41
77
  declare class LDwMaterialImageUploaderComponent {
42
78
  protected readonly service: LDwMaterialMediaService;
43
79
  protected readonly$: string | boolean;
@@ -65,11 +101,17 @@ declare const LDW_MAT_MEDIA_API: InjectionToken<{
65
101
  url: string;
66
102
  }>;
67
103
 
104
+ declare class LDwMaterialImageGalleryModule {
105
+ static ɵfac: i0.ɵɵFactoryDeclaration<LDwMaterialImageGalleryModule, never>;
106
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LDwMaterialImageGalleryModule, never, [typeof LDwMaterialImageGalleryDialogComponent], [typeof LDwMaterialImageGalleryDialogComponent]>;
107
+ static ɵinj: i0.ɵɵInjectorDeclaration<LDwMaterialImageGalleryModule>;
108
+ }
109
+
68
110
  declare class LDwMaterialImageUploaderModule {
69
111
  static ɵfac: i0.ɵɵFactoryDeclaration<LDwMaterialImageUploaderModule, never>;
70
112
  static ɵmod: i0.ɵɵNgModuleDeclaration<LDwMaterialImageUploaderModule, never, [typeof LDwMaterialImageUploadDialogComponent, typeof LDwMaterialImageUploaderComponent], [typeof LDwMaterialImageUploadDialogComponent, typeof LDwMaterialImageUploaderComponent]>;
71
113
  static ɵinj: i0.ɵɵInjectorDeclaration<LDwMaterialImageUploaderModule>;
72
114
  }
73
115
 
74
- export { LDW_MAT_MEDIA_API, LDwMaterialImageUploadDialogComponent, LDwMaterialImageUploaderComponent, LDwMaterialImageUploaderModule, LDwMaterialMediaService };
75
- export type { LDwMaterialMediaModel };
116
+ export { LDW_MAT_MEDIA_API, LDwMaterialImageGalleryDialogComponent, LDwMaterialImageGalleryModule, LDwMaterialImageUploadDialogComponent, LDwMaterialImageUploaderComponent, LDwMaterialImageUploaderModule, LDwMaterialMediaService };
117
+ export type { LDwMaterialGalleryModel, LDwMaterialMediaModel };