@sam-senior/photo 1.2.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,407 +0,0 @@
1
- import { __read } from 'tslib';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { Component, ViewChild, EventEmitter, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
4
- import { ConfirmDialogModule } from 'primeng/confirmdialog';
5
- import { PanelModule } from 'primeng/panel';
6
- import { ImageCropperService, ImageCropperModule, StepsModule, ObjectCardModule, ButtonModule, TileModule, LoadingStateModule } from '@seniorsistemas/angular-components';
7
- import { DialogModule } from 'primeng/dialog';
8
- import { PhotoCaptureService, PhotoCaptureModule } from '@sam-senior/photo-capture';
9
-
10
- /**
11
- * @fileoverview added by tsickle
12
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
- */
14
-
15
- /**
16
- * @fileoverview added by tsickle
17
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
18
- */
19
- var PhotoComponent = /** @class */ (function () {
20
- function PhotoComponent(imageCropperService, photoCaptureService) {
21
- this.imageCropperService = imageCropperService;
22
- this.photoCaptureService = photoCaptureService;
23
- this.key = 'key';
24
- this.actionIconClass = 'fa fa-camera';
25
- this.photoSize = 'medium';
26
- this.maxPhotoSize = 1;
27
- this.photoWidth = 670;
28
- this.photoHeight = 400;
29
- this.canPhotoUpload = true;
30
- this.canPhotoCapture = true;
31
- this.cropperTitle = "Recortar";
32
- this.cropperActionCancel = "Cancelar";
33
- this.cropperActionCrop = "Recortar";
34
- this.cameraDialogLabel = "Captura";
35
- this.cameraDialogCaptureLabel = "Capturar";
36
- this.selectPhotoTypeLabel = "Selecionar imagem";
37
- this.selectUploadTypeLabel = "Upload";
38
- this.selectUploadTypeDescription = "Selecione uma imagem do seu computador";
39
- this.selectCaptureTypeLabel = "Capturar";
40
- this.selectCaptureTypeLabelDescription = "Capture uma imagem do seu dispositivo";
41
- this.dialogCancelLabel = "Cancelar";
42
- this.photoCrop = new EventEmitter();
43
- this.openCamera = new EventEmitter();
44
- this.closeCamera = new EventEmitter();
45
- this.cameraError = new EventEmitter();
46
- this.invalidPhotoSize = new EventEmitter();
47
- this.isLoading = new EventEmitter();
48
- this.cameraDialog = false;
49
- this.selectPhotoType = false;
50
- this.onChange = (/**
51
- * @param {?} _
52
- * @return {?}
53
- */
54
- function (_) { });
55
- this.onTouched = (/**
56
- * @return {?}
57
- */
58
- function () { });
59
- }
60
- /**
61
- * @return {?}
62
- */
63
- PhotoComponent.prototype.changePhoto = /**
64
- * @return {?}
65
- */
66
- function () {
67
- if (this.canPhotoCapture && this.canPhotoUpload) {
68
- this.selectPhotoType = true;
69
- }
70
- else if (this.canPhotoCapture) {
71
- this.onOpenCamera();
72
- }
73
- else if (this.canPhotoUpload) {
74
- this.onOpenUpload();
75
- }
76
- };
77
- /**
78
- * @param {?} fn
79
- * @return {?}
80
- */
81
- PhotoComponent.prototype.registerOnChange = /**
82
- * @param {?} fn
83
- * @return {?}
84
- */
85
- function (fn) {
86
- this.onChange = fn;
87
- };
88
- /**
89
- * @param {?} fn
90
- * @return {?}
91
- */
92
- PhotoComponent.prototype.registerOnTouched = /**
93
- * @param {?} fn
94
- * @return {?}
95
- */
96
- function (fn) {
97
- this.onTouched = fn;
98
- };
99
- /**
100
- * @param {?} value
101
- * @return {?}
102
- */
103
- PhotoComponent.prototype.writeValue = /**
104
- * @param {?} value
105
- * @return {?}
106
- */
107
- function (value) {
108
- this.photo = value;
109
- };
110
- /**
111
- * @return {?}
112
- */
113
- PhotoComponent.prototype.onOpenCamera = /**
114
- * @return {?}
115
- */
116
- function () {
117
- this.closeSelectPhotoType();
118
- this.cameraDialog = true;
119
- this.photoCaptureService.setKey(this.key);
120
- this.photoCaptureService.start();
121
- this.openCamera.emit();
122
- };
123
- /**
124
- * @return {?}
125
- */
126
- PhotoComponent.prototype.closeSelectPhotoType = /**
127
- * @return {?}
128
- */
129
- function () {
130
- this.selectPhotoType = false;
131
- };
132
- /**
133
- * @return {?}
134
- */
135
- PhotoComponent.prototype.onOpenUpload = /**
136
- * @return {?}
137
- */
138
- function () {
139
- this.closeSelectPhotoType();
140
- ((/** @type {?} */ (this.imageInput.nativeElement))).value = null;
141
- ((/** @type {?} */ (this.imageInput.nativeElement))).click();
142
- };
143
- /**
144
- * @param {?} event
145
- * @return {?}
146
- */
147
- PhotoComponent.prototype.photoSelected = /**
148
- * @param {?} event
149
- * @return {?}
150
- */
151
- function (event) {
152
- var _a = __read(event.srcElement.files, 1), file = _a[0];
153
- this.photoRender(file);
154
- };
155
- /**
156
- * @return {?}
157
- */
158
- PhotoComponent.prototype.onCloseCamera = /**
159
- * @return {?}
160
- */
161
- function () {
162
- this.cameraDialog = false;
163
- this.photoCaptureService.stop();
164
- this.closeCamera.emit();
165
- };
166
- /**
167
- * @return {?}
168
- */
169
- PhotoComponent.prototype.onPhotoCapture = /**
170
- * @return {?}
171
- */
172
- function () {
173
- this.isLoading.emit(true);
174
- this.photoCaptureService.setKey(this.key);
175
- this.photoCaptureService.takePhoto();
176
- };
177
- /**
178
- * @param {?} photo
179
- * @return {?}
180
- */
181
- PhotoComponent.prototype.onPhotoTake = /**
182
- * @param {?} photo
183
- * @return {?}
184
- */
185
- function (photo) {
186
- if (this.photoCaptureService.getKey() === this.key) {
187
- this.photoRender(photo.blob);
188
- this.onCloseCamera();
189
- }
190
- };
191
- /**
192
- * @param {?} error
193
- * @return {?}
194
- */
195
- PhotoComponent.prototype.onCameraError = /**
196
- * @param {?} error
197
- * @return {?}
198
- */
199
- function (error) {
200
- if (this.photoCaptureService.getKey() === this.key) {
201
- this.onCloseCamera();
202
- this.cameraError.emit(error);
203
- }
204
- };
205
- /**
206
- * @private
207
- * @param {?} file
208
- * @return {?}
209
- */
210
- PhotoComponent.prototype.photoRender = /**
211
- * @private
212
- * @param {?} file
213
- * @return {?}
214
- */
215
- function (file) {
216
- var _this = this;
217
- if (file) {
218
- /** @type {?} */
219
- var fileReader = new FileReader();
220
- fileReader.onloadend =
221
- (/**
222
- * @param {?} photoRender
223
- * @return {?}
224
- */
225
- function (photoRender) { return _this.photoChopper(photoRender); });
226
- fileReader.readAsDataURL(file);
227
- }
228
- };
229
- /**
230
- * @private
231
- * @param {?} photoRender
232
- * @return {?}
233
- */
234
- PhotoComponent.prototype.photoChopper = /**
235
- * @private
236
- * @param {?} photoRender
237
- * @return {?}
238
- */
239
- function (photoRender) {
240
- var _this = this;
241
- this.imageCropperService.show({
242
- imageSource: photoRender.target.result,
243
- croppedCanvas: (/**
244
- * @param {?} imageCanvas
245
- * @return {?}
246
- */
247
- function (imageCanvas) {
248
- imageCanvas.toBlob((/**
249
- * @param {?} blob
250
- * @return {?}
251
- */
252
- function (blob) {
253
- _this.setPhotoContent(imageCanvas.toDataURL(), blob);
254
- _this.onCreateBlob();
255
- }));
256
- }),
257
- header: this.cropperTitle,
258
- emptyStateActionLabel: this.cropperActionCancel,
259
- allowSelectAnother: false,
260
- allowRemove: false,
261
- cropLabel: this.cropperActionCrop,
262
- rounded: true,
263
- aspectRatio: 3 / 4
264
- });
265
- this.isLoading.emit(false);
266
- };
267
- /**
268
- * @private
269
- * @return {?}
270
- */
271
- PhotoComponent.prototype.onCreateBlob = /**
272
- * @private
273
- * @return {?}
274
- */
275
- function () {
276
- if (this.getMaxSizeInBites() > this.photoContent.blob.size) {
277
- this.photoCrop.emit(this.photoContent);
278
- this.photo = this.photoContent.image;
279
- this.onChange(this.photo);
280
- }
281
- else {
282
- this.invalidPhotoSize.emit();
283
- }
284
- };
285
- /**
286
- * @private
287
- * @return {?}
288
- */
289
- PhotoComponent.prototype.getMaxSizeInBites = /**
290
- * @private
291
- * @return {?}
292
- */
293
- function () {
294
- return (this.maxPhotoSize * 1000) * 1000;
295
- };
296
- /**
297
- * @private
298
- * @param {?} imageUri
299
- * @param {?} imageBlob
300
- * @return {?}
301
- */
302
- PhotoComponent.prototype.setPhotoContent = /**
303
- * @private
304
- * @param {?} imageUri
305
- * @param {?} imageBlob
306
- * @return {?}
307
- */
308
- function (imageUri, imageBlob) {
309
- this.photoContent = {
310
- image: imageUri,
311
- blob: imageBlob
312
- };
313
- };
314
- PhotoComponent.decorators = [
315
- { type: Component, args: [{
316
- selector: 'sam-photo',
317
- template: "<input #imageInput type=\"file\" class=\"photo__input-file--hidden\" (change)=\"photoSelected($event)\" accept=\"image/*\">\r\n<s-thumbnail [size]=\"photoSize\" iconClass=\"fa fa-user\" (click)=\"changePhoto()\"\r\n [hasAction]=\"canPhotoUpload || canPhotoCapture\" [imageSource]=\"photo\" [actionIconClass]=\"actionIconClass\">\r\n</s-thumbnail>\r\n\r\n<p-dialog styleClass=\"photo-capture-custom\" [(visible)]=\"cameraDialog\" [header]=\"cameraDialogLabel\"\r\n [style]=\"{width: '700px'}\" appendTo='body' [modal]=\"true\">\r\n <sam-photo-capture [width]=\"photoWidth\" [height]=\"photoHeight\" (photoTake)=\"onPhotoTake($event)\"\r\n (error)=\"onCameraError($event)\"></sam-photo-capture>\r\n <p-footer>\r\n <s-button id=\"takePhotoBtn\" priority=\"primary\" [label]=\"cameraDialogCaptureLabel\" (click)=\"onPhotoCapture()\">\r\n </s-button>\r\n <s-button id=\"cancelBtn\" priority=\"link\" [label]=\"dialogCancelLabel\" (click)=\"onCloseCamera()\"></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"selectPhotoType\" [header]=\"selectPhotoTypeLabel\" [style]=\"{width: '400px'}\" appendTo='body' [modal]=\"true\"\r\n [closable]=\"false\">\r\n <s-tile [label]=\"selectUploadTypeLabel\" [description]=\"selectUploadTypeDescription\" iconClass=\"fa fa-upload\"\r\n (click)=\"onOpenUpload()\"></s-tile>\r\n <br>\r\n <s-tile [label]=\"selectCaptureTypeLabel\" [description]=\"selectCaptureTypeLabelDescription\" iconClass=\"fa fa-camera\"\r\n (click)=\"onOpenCamera()\"></s-tile>\r\n <p-footer>\r\n <s-button id=\"cancelBtn\" priority=\"link\" [label]=\"dialogCancelLabel\" (click)=\"closeSelectPhotoType()\"></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n",
318
- providers: [
319
- {
320
- provide: NG_VALUE_ACCESSOR,
321
- useExisting: PhotoComponent,
322
- multi: true
323
- }
324
- ],
325
- encapsulation: ViewEncapsulation.None,
326
- styles: [".photo__input-file--hidden{position:fixed;top:-100em}.select-photo-type-container{display:flex;flex-direction:row;align-items:center;justify-content:center}.select-photo-type-item{color:gray;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.select-photo-type-item:nth-child(1){border-right:1px solid #ccc}.select-photo-type-item i{font-size:80px;margin-left:40px;margin-right:40px}.select-photo-type-item span{margin-top:10px}"]
327
- }] }
328
- ];
329
- /** @nocollapse */
330
- PhotoComponent.ctorParameters = function () { return [
331
- { type: ImageCropperService },
332
- { type: PhotoCaptureService }
333
- ]; };
334
- PhotoComponent.propDecorators = {
335
- imageInput: [{ type: ViewChild, args: ["imageInput",] }],
336
- key: [{ type: Input }],
337
- photo: [{ type: Input }],
338
- actionIconClass: [{ type: Input }],
339
- photoSize: [{ type: Input }],
340
- maxPhotoSize: [{ type: Input }],
341
- photoWidth: [{ type: Input }],
342
- photoHeight: [{ type: Input }],
343
- canPhotoUpload: [{ type: Input }],
344
- canPhotoCapture: [{ type: Input }],
345
- cropperTitle: [{ type: Input }],
346
- cropperActionCancel: [{ type: Input }],
347
- cropperActionCrop: [{ type: Input }],
348
- cameraDialogLabel: [{ type: Input }],
349
- cameraDialogCaptureLabel: [{ type: Input }],
350
- selectPhotoTypeLabel: [{ type: Input }],
351
- selectUploadTypeLabel: [{ type: Input }],
352
- selectUploadTypeDescription: [{ type: Input }],
353
- selectCaptureTypeLabel: [{ type: Input }],
354
- selectCaptureTypeLabelDescription: [{ type: Input }],
355
- dialogCancelLabel: [{ type: Input }],
356
- photoCrop: [{ type: Output }],
357
- openCamera: [{ type: Output }],
358
- closeCamera: [{ type: Output }],
359
- cameraError: [{ type: Output }],
360
- invalidPhotoSize: [{ type: Output }],
361
- isLoading: [{ type: Output }]
362
- };
363
- return PhotoComponent;
364
- }());
365
-
366
- /**
367
- * @fileoverview added by tsickle
368
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
369
- */
370
- var PhotoModule = /** @class */ (function () {
371
- function PhotoModule() {
372
- }
373
- PhotoModule.decorators = [
374
- { type: NgModule, args: [{
375
- declarations: [PhotoComponent],
376
- imports: [
377
- PanelModule,
378
- DialogModule,
379
- StepsModule,
380
- ObjectCardModule,
381
- ImageCropperModule,
382
- ConfirmDialogModule,
383
- PhotoCaptureModule,
384
- ButtonModule,
385
- TileModule,
386
- LoadingStateModule
387
- ],
388
- providers: [ImageCropperService],
389
- exports: [PhotoComponent]
390
- },] }
391
- ];
392
- return PhotoModule;
393
- }());
394
-
395
- /**
396
- * @fileoverview added by tsickle
397
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
398
- */
399
-
400
- /**
401
- * @fileoverview added by tsickle
402
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
403
- */
404
-
405
- export { PhotoComponent, PhotoModule };
406
-
407
- //# sourceMappingURL=sam-senior-photo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sam-senior-photo.js.map","sources":["ng://@sam-senior/photo/lib/photo.component.ts","ng://@sam-senior/photo/lib/photo.module.ts"],"sourcesContent":["import { Component, ViewChild, EventEmitter, ElementRef, ViewEncapsulation, OnInit } from '@angular/core';\r\nimport { Input } from '@angular/core';\r\nimport { Output } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { ImageCropperService } from '@seniorsistemas/angular-components';\r\nimport { PhotoCaptureService } from '@sam-senior/photo-capture';\r\n\r\nimport { PhotoModel } from './photo.model';\r\n\r\n@Component({\r\n selector: 'sam-photo',\r\n templateUrl: './photo.component.html',\r\n styleUrls: ['./photo.component.css'],\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: PhotoComponent,\r\n multi: true\r\n }\r\n ],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class PhotoComponent implements ControlValueAccessor {\r\n @ViewChild(`imageInput`) imageInput: ElementRef;\r\n\r\n @Input() key = 'key';\r\n @Input() photo: string;\r\n @Input() actionIconClass = 'fa fa-camera';\r\n @Input() photoSize = 'medium';\r\n @Input() maxPhotoSize = 1;\r\n @Input() photoWidth = 670;\r\n @Input() photoHeight = 400;\r\n @Input() canPhotoUpload = true;\r\n @Input() canPhotoCapture = true;\r\n\r\n @Input() cropperTitle = `Recortar`;\r\n @Input() cropperActionCancel = `Cancelar`;\r\n @Input() cropperActionCrop = `Recortar`;\r\n\r\n @Input() cameraDialogLabel = `Captura`;\r\n @Input() cameraDialogCaptureLabel = `Capturar`;\r\n @Input() selectPhotoTypeLabel = `Selecionar imagem`;\r\n @Input() selectUploadTypeLabel = `Upload`;\r\n @Input() selectUploadTypeDescription = `Selecione uma imagem do seu computador`;\r\n @Input() selectCaptureTypeLabel = `Capturar`;\r\n @Input() selectCaptureTypeLabelDescription = `Capture uma imagem do seu dispositivo`;\r\n @Input() dialogCancelLabel = `Cancelar`;\r\n\r\n @Output() photoCrop = new EventEmitter();\r\n @Output() openCamera = new EventEmitter();\r\n @Output() closeCamera = new EventEmitter();\r\n @Output() cameraError = new EventEmitter();\r\n @Output() invalidPhotoSize = new EventEmitter();\r\n @Output() isLoading = new EventEmitter();\r\n\r\n public photoContent: PhotoModel;\r\n public cameraDialog = false;\r\n public selectPhotoType = false;\r\n\r\n private onChange = (_: any) => { };\r\n private onTouched = () => { };\r\n\r\n constructor(\r\n private imageCropperService: ImageCropperService,\r\n private photoCaptureService: PhotoCaptureService\r\n ) { }\r\n\r\n public changePhoto() {\r\n if (this.canPhotoCapture && this.canPhotoUpload) {\r\n this.selectPhotoType = true;\r\n } else if (this.canPhotoCapture) {\r\n this.onOpenCamera();\r\n } else if (this.canPhotoUpload) {\r\n this.onOpenUpload();\r\n }\r\n }\r\n\r\n public registerOnChange(fn: (_: any) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n public registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n public writeValue(value: any) {\r\n this.photo = value;\r\n }\r\n\r\n public onOpenCamera() {\r\n this.closeSelectPhotoType();\r\n this.cameraDialog = true;\r\n this.photoCaptureService.setKey(this.key);\r\n this.photoCaptureService.start();\r\n this.openCamera.emit();\r\n }\r\n\r\n public closeSelectPhotoType() {\r\n this.selectPhotoType = false;\r\n }\r\n\r\n public onOpenUpload() {\r\n this.closeSelectPhotoType();\r\n (this.imageInput.nativeElement as HTMLInputElement).value = null;\r\n (this.imageInput.nativeElement as HTMLInputElement).click();\r\n }\r\n\r\n public photoSelected(event: any) {\r\n const [file] = event.srcElement.files;\r\n this.photoRender(file);\r\n }\r\n\r\n public onCloseCamera() {\r\n this.cameraDialog = false;\r\n this.photoCaptureService.stop();\r\n this.closeCamera.emit();\r\n }\r\n\r\n public onPhotoCapture() {\r\n this.isLoading.emit(true);\r\n this.photoCaptureService.setKey(this.key);\r\n this.photoCaptureService.takePhoto();\r\n }\r\n\r\n public onPhotoTake(photo) {\r\n if (this.photoCaptureService.getKey() === this.key) {\r\n this.photoRender(photo.blob);\r\n this.onCloseCamera();\r\n }\r\n }\r\n\r\n public onCameraError(error) {\r\n if (this.photoCaptureService.getKey() === this.key) {\r\n this.onCloseCamera();\r\n this.cameraError.emit(error);\r\n }\r\n }\r\n\r\n private photoRender(file) {\r\n if (file) {\r\n const fileReader = new FileReader();\r\n fileReader.onloadend =\r\n photoRender => this.photoChopper(photoRender);\r\n fileReader.readAsDataURL(file);\r\n }\r\n }\r\n\r\n private photoChopper(photoRender) {\r\n this.imageCropperService.show({\r\n imageSource: photoRender.target.result,\r\n croppedCanvas: imageCanvas => {\r\n imageCanvas.toBlob(blob => {\r\n this.setPhotoContent(imageCanvas.toDataURL(), blob);\r\n this.onCreateBlob();\r\n });\r\n },\r\n header: this.cropperTitle,\r\n emptyStateActionLabel: this.cropperActionCancel,\r\n allowSelectAnother: false,\r\n allowRemove: false,\r\n cropLabel: this.cropperActionCrop,\r\n rounded: true,\r\n aspectRatio: 3 / 4\r\n });\r\n this.isLoading.emit(false);\r\n }\r\n\r\n private onCreateBlob() {\r\n if (this.getMaxSizeInBites() > this.photoContent.blob.size) {\r\n this.photoCrop.emit(this.photoContent);\r\n this.photo = this.photoContent.image;\r\n this.onChange(this.photo);\r\n } else {\r\n this.invalidPhotoSize.emit();\r\n }\r\n }\r\n\r\n private getMaxSizeInBites() {\r\n return (this.maxPhotoSize * 1000) * 1000;\r\n }\r\n\r\n private setPhotoContent(imageUri, imageBlob) {\r\n this.photoContent = {\r\n image: imageUri,\r\n blob: imageBlob\r\n };\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { ConfirmDialogModule } from 'primeng/confirmdialog';\r\nimport { PanelModule } from 'primeng/panel';\r\nimport {\r\n ImageCropperModule,\r\n StepsModule,\r\n ObjectCardModule,\r\n ButtonModule,\r\n TileModule,\r\n ImageCropperService,\r\n LoadingStateModule\r\n} from '@seniorsistemas/angular-components';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { PhotoCaptureModule } from '@sam-senior/photo-capture';\r\n\r\nimport { PhotoComponent } from './photo.component';\r\n\r\n@NgModule({\r\n declarations: [PhotoComponent],\r\n imports: [\r\n PanelModule,\r\n DialogModule,\r\n StepsModule,\r\n ObjectCardModule,\r\n ImageCropperModule,\r\n ConfirmDialogModule,\r\n PhotoCaptureModule,\r\n ButtonModule,\r\n TileModule,\r\n LoadingStateModule\r\n ],\r\n providers: [ImageCropperService],\r\n exports: [PhotoComponent]\r\n})\r\nexport class PhotoModule { }\r\n"],"names":[],"mappings":";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AChB,CAAC;KACH;;gBAjLF,SAAS,SAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,0rDAAqC;oBAErC,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,cAAc;4BAC3B,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;;iBACtC;;;;gBAjBQ,mBAAmB;gBACnB,mBAAmB;;;6BAkBzB,SAAS,SAAC,YAAY;sBAEtB,KAAK;wBACL,KAAK;kCACL,KAAK;4BACL,KAAK;+BACL,KAAK;6BACL,KAAK;8BACL,KAAK;iCACL,KAAK;kCACL,KAAK;+BAEL,KAAK;sCACL,KAAK;oCACL,KAAK;oCAEL,KAAK;2CACL,KAAK;uCACL,KAAK;wCACL,KAAK;8CACL,KAAK;yCACL,KAAK;oDACL,KAAK;oCACL,KAAK;4BAEL,MAAM;6BACN,MAAM;8BACN,MAAM;8BACN,MAAM;mCACN,MAAM;4BACN,MAAM;;IAuIT,qBAAC;CAnLD;;;;;;ACTA;IAiBA;KAiB4B;;gBAjB3B,QAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;oBAC9B,OAAO,EAAE;wBACP,WAAW;wBACX,YAAY;wBACZ,WAAW;wBACX,gBAAgB;wBAChB,kBAAkB;wBAClB,mBAAmB;wBACnB,kBAAkB;wBAClB,YAAY;wBACZ,UAAU;wBACV,kBAAkB;qBACnB;oBACD,SAAS,EAAE,CAAC,mBAAmB,CAAC;oBAChC,OAAO,EAAE,CAAC,cAAc,CAAC;iBAC1B;;IAC0B,kBAAC;CAjB5B;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"metadata":{"PhotoModel":{"__symbolic":"interface"},"PhotoComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"sam-photo","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":15,"character":15},"useExisting":{"__symbolic":"reference","name":"PhotoComponent"},"multi":true}],"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":20,"character":17},"member":"None"},"template":"<input #imageInput type=\"file\" class=\"photo__input-file--hidden\" (change)=\"photoSelected($event)\" accept=\"image/*\">\r\n<s-thumbnail [size]=\"photoSize\" iconClass=\"fa fa-user\" (click)=\"changePhoto()\"\r\n [hasAction]=\"canPhotoUpload || canPhotoCapture\" [imageSource]=\"photo\" [actionIconClass]=\"actionIconClass\">\r\n</s-thumbnail>\r\n\r\n<p-dialog styleClass=\"photo-capture-custom\" [(visible)]=\"cameraDialog\" [header]=\"cameraDialogLabel\"\r\n [style]=\"{width: '700px'}\" appendTo='body' [modal]=\"true\">\r\n <sam-photo-capture [width]=\"photoWidth\" [height]=\"photoHeight\" (photoTake)=\"onPhotoTake($event)\"\r\n (error)=\"onCameraError($event)\"></sam-photo-capture>\r\n <p-footer>\r\n <s-button id=\"takePhotoBtn\" priority=\"primary\" [label]=\"cameraDialogCaptureLabel\" (click)=\"onPhotoCapture()\">\r\n </s-button>\r\n <s-button id=\"cancelBtn\" priority=\"link\" [label]=\"dialogCancelLabel\" (click)=\"onCloseCamera()\"></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n\r\n<p-dialog [(visible)]=\"selectPhotoType\" [header]=\"selectPhotoTypeLabel\" [style]=\"{width: '400px'}\" appendTo='body' [modal]=\"true\"\r\n [closable]=\"false\">\r\n <s-tile [label]=\"selectUploadTypeLabel\" [description]=\"selectUploadTypeDescription\" iconClass=\"fa fa-upload\"\r\n (click)=\"onOpenUpload()\"></s-tile>\r\n <br>\r\n <s-tile [label]=\"selectCaptureTypeLabel\" [description]=\"selectCaptureTypeLabelDescription\" iconClass=\"fa fa-camera\"\r\n (click)=\"onOpenCamera()\"></s-tile>\r\n <p-footer>\r\n <s-button id=\"cancelBtn\" priority=\"link\" [label]=\"dialogCancelLabel\" (click)=\"closeSelectPhotoType()\"></s-button>\r\n </p-footer>\r\n</p-dialog>\r\n","styles":[".photo__input-file--hidden{position:fixed;top:-100em}.select-photo-type-container{display:flex;flex-direction:row;align-items:center;justify-content:center}.select-photo-type-item{color:gray;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.select-photo-type-item:nth-child(1){border-right:1px solid #ccc}.select-photo-type-item i{font-size:80px;margin-left:40px;margin-right:40px}.select-photo-type-item span{margin-top:10px}"]}]}],"members":{"imageInput":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":23,"character":3},"arguments":["imageInput"]}]}],"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"photo":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"actionIconClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"photoSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}}]}],"maxPhotoSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"photoWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"photoHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"canPhotoUpload":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"canPhotoCapture":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"cropperTitle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"cropperActionCancel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"cropperActionCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"cameraDialogLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}}]}],"cameraDialogCaptureLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"selectPhotoTypeLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"selectUploadTypeLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"selectUploadTypeDescription":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"selectCaptureTypeLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"selectCaptureTypeLabelDescription":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"dialogCancelLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"photoCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":48,"character":3}}]}],"openCamera":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"closeCamera":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":50,"character":3}}]}],"cameraError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":3}}]}],"invalidPhotoSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"isLoading":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":53,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"ImageCropperService","line":63,"character":33},{"__symbolic":"reference","module":"@sam-senior/photo-capture","name":"PhotoCaptureService","line":64,"character":33}]}],"changePhoto":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onOpenCamera":[{"__symbolic":"method"}],"closeSelectPhotoType":[{"__symbolic":"method"}],"onOpenUpload":[{"__symbolic":"method"}],"photoSelected":[{"__symbolic":"method"}],"onCloseCamera":[{"__symbolic":"method"}],"onPhotoCapture":[{"__symbolic":"method"}],"onPhotoTake":[{"__symbolic":"method"}],"onCameraError":[{"__symbolic":"method"}],"photoRender":[{"__symbolic":"method"}],"photoChopper":[{"__symbolic":"method"}],"onCreateBlob":[{"__symbolic":"method"}],"getMaxSizeInBites":[{"__symbolic":"method"}],"setPhotoContent":[{"__symbolic":"method"}]}},"PhotoModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":17,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"PhotoComponent"}],"imports":[{"__symbolic":"reference","module":"primeng/panel","name":"PanelModule","line":20,"character":4},{"__symbolic":"reference","module":"primeng/dialog","name":"DialogModule","line":21,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"StepsModule","line":22,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"ObjectCardModule","line":23,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"ImageCropperModule","line":24,"character":4},{"__symbolic":"reference","module":"primeng/confirmdialog","name":"ConfirmDialogModule","line":25,"character":4},{"__symbolic":"reference","module":"@sam-senior/photo-capture","name":"PhotoCaptureModule","line":26,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"ButtonModule","line":27,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"TileModule","line":28,"character":4},{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"LoadingStateModule","line":29,"character":4}],"providers":[{"__symbolic":"reference","module":"@seniorsistemas/angular-components","name":"ImageCropperService","line":31,"character":14}],"exports":[{"__symbolic":"reference","name":"PhotoComponent"}]}]}],"members":{}}},"origins":{"PhotoModel":"./lib/photo.model","PhotoComponent":"./lib/photo.component","PhotoModule":"./lib/photo.module"},"importAs":"@sam-senior/photo"}