@pepperi-addons/ngx-lib 0.2.51-beta.7 → 0.2.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/bundles/pepperi-addons-ngx-lib-form.umd.js +188 -3313
  2. package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
  3. package/bundles/pepperi-addons-ngx-lib-image.umd.js +133 -72
  4. package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
  5. package/bundles/pepperi-addons-ngx-lib-slider.umd.js +15 -4
  6. package/bundles/pepperi-addons-ngx-lib-slider.umd.js.map +1 -1
  7. package/bundles/pepperi-addons-ngx-lib.umd.js +5 -1
  8. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  9. package/core/common/model/wapi.model.d.ts +2 -0
  10. package/core/customization/customization.model.d.ts +1 -0
  11. package/esm2015/core/common/model/wapi.model.js +1 -1
  12. package/esm2015/core/customization/customization.model.js +5 -1
  13. package/esm2015/form/field-generator.component.js +16 -10
  14. package/esm2015/form/form.component.js +53 -84
  15. package/esm2015/form/internal-carusel.component.js +39 -3147
  16. package/esm2015/form/internal-carusel.service.js +13 -13
  17. package/esm2015/form/internal-page.component.js +7 -7
  18. package/esm2015/image/image.component.js +20 -36
  19. package/esm2015/image/image.module.js +3 -1
  20. package/esm2015/image/image.service.js +55 -0
  21. package/esm2015/image/public-api.js +2 -1
  22. package/esm2015/slider/slider.component.js +16 -5
  23. package/fesm2015/pepperi-addons-ngx-lib-form.js +123 -3257
  24. package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
  25. package/fesm2015/pepperi-addons-ngx-lib-image.js +73 -36
  26. package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
  27. package/fesm2015/pepperi-addons-ngx-lib-slider.js +15 -4
  28. package/fesm2015/pepperi-addons-ngx-lib-slider.js.map +1 -1
  29. package/fesm2015/pepperi-addons-ngx-lib.js +4 -0
  30. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  31. package/form/field-generator.component.d.ts +7 -5
  32. package/form/form.component.d.ts +10 -4
  33. package/form/internal-carusel.component.d.ts +5 -3
  34. package/form/internal-carusel.service.d.ts +2 -7
  35. package/form/internal-page.component.d.ts +2 -2
  36. package/form/pepperi-addons-ngx-lib-form.metadata.json +1 -1
  37. package/image/image.component.d.ts +5 -5
  38. package/image/image.service.d.ts +11 -0
  39. package/image/pepperi-addons-ngx-lib-image.metadata.json +1 -1
  40. package/image/public-api.d.ts +1 -0
  41. package/package.json +1 -1
  42. package/pepperi-addons-ngx-lib.metadata.json +1 -1
  43. package/slider/pepperi-addons-ngx-lib-slider.metadata.json +1 -1
  44. package/slider/slider.component.d.ts +2 -0
  45. package/src/core/style/base/typography.scss +28 -0
@@ -2,13 +2,87 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material/form-field'), require('@angular/material/icon'), require('@pepperi-addons/ngx-lib'), require('@pepperi-addons/ngx-lib/icon'), require('@pepperi-addons/ngx-lib/field-title'), require('@pepperi-addons/ngx-lib/files-uploader'), require('@pepperi-addons/ngx-lib/images-filmstrip'), require('@ngx-translate/core'), require('@pepperi-addons/ngx-lib/dialog')) :
3
3
  typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib/image', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/material/core', '@angular/material/form-field', '@angular/material/icon', '@pepperi-addons/ngx-lib', '@pepperi-addons/ngx-lib/icon', '@pepperi-addons/ngx-lib/field-title', '@pepperi-addons/ngx-lib/files-uploader', '@pepperi-addons/ngx-lib/images-filmstrip', '@ngx-translate/core', '@pepperi-addons/ngx-lib/dialog'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = global['pepperi-addons']['ngx-lib'] || {}, global['pepperi-addons']['ngx-lib'].image = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.material.core, global.ng.material.formField, global.ng.material.icon, global['pepperi-addons']['ngx-lib'], global['pepperi-addons']['ngx-lib'].icon, global['pepperi-addons']['ngx-lib']['field-title'], global['pepperi-addons']['ngx-lib']['files-uploader'], global['pepperi-addons']['ngx-lib']['images-filmstrip'], global.translate, global['pepperi-addons']['ngx-lib'].dialog));
5
- }(this, (function (exports, core, common, forms, core$2, formField, icon$1, ngxLib, icon, fieldTitle, filesUploader, imagesFilmstrip, core$1, dialog) { 'use strict';
5
+ }(this, (function (exports, i0, common, forms, core$1, formField, icon$1, i2, icon, fieldTitle, filesUploader, imagesFilmstrip, core, i1) { 'use strict';
6
6
 
7
- var PepImageComponent = /** @class */ (function () {
8
- function PepImageComponent(dialogService, customizationService, fileService, renderer, element, translate) {
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () {
17
+ return e[k];
18
+ }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n['default'] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
30
+
31
+ var PepImageService = /** @class */ (function () {
32
+ function PepImageService(dialogService, customizationService, fileService) {
9
33
  this.dialogService = dialogService;
10
34
  this.customizationService = customizationService;
11
35
  this.fileService = fileService;
36
+ }
37
+ PepImageService.prototype.openImageDialog = function (imageSrc, options, title) {
38
+ if (title === void 0) { title = ''; }
39
+ var arr = [imageSrc].concat((options || []).map(function (opt) { return opt.value; }));
40
+ var imagesValue = arr.join(';');
41
+ // Show image in modal.
42
+ var config = this.dialogService.getDialogConfig({}, 'inline');
43
+ config.maxWidth = '75vw';
44
+ config.height = '95vh';
45
+ this.dialogService.openDialog(imagesFilmstrip.PepImagesFilmstripComponent, {
46
+ currIndex: 0,
47
+ key: new Date().getDate(),
48
+ value: imagesValue,
49
+ label: title,
50
+ uid: '',
51
+ showThumbnails: arr.length > 1,
52
+ }, config);
53
+ };
54
+ PepImageService.prototype.openFromURI = function (event) {
55
+ if (event) {
56
+ var fileStrArr = event.fileStr.split(';');
57
+ if (fileStrArr.length === 2) {
58
+ var win = window.open('', '_blank');
59
+ var contentType = fileStrArr[0].split(':')[1];
60
+ var base64 = fileStrArr[1].split(',')[1];
61
+ var blob = this.fileService.convertFromb64toBlob(base64, contentType);
62
+ var url = URL.createObjectURL(blob);
63
+ win.location.href = url;
64
+ }
65
+ }
66
+ };
67
+ return PepImageService;
68
+ }());
69
+ PepImageService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepImageService_Factory() { return new PepImageService(i0__namespace.ɵɵinject(i1__namespace.PepDialogService), i0__namespace.ɵɵinject(i2__namespace.PepCustomizationService), i0__namespace.ɵɵinject(i2__namespace.PepFileService)); }, token: PepImageService, providedIn: "root" });
70
+ PepImageService.decorators = [
71
+ { type: i0.Injectable, args: [{
72
+ providedIn: 'root',
73
+ },] }
74
+ ];
75
+ PepImageService.ctorParameters = function () { return [
76
+ { type: i1.PepDialogService },
77
+ { type: i2.PepCustomizationService },
78
+ { type: i2.PepFileService }
79
+ ]; };
80
+
81
+ var PepImageComponent = /** @class */ (function () {
82
+ function PepImageComponent(imageService, customizationService, fileService, renderer, element, translate) {
83
+ this.imageService = imageService;
84
+ this.customizationService = customizationService;
85
+ this.fileService = fileService;
12
86
  this.renderer = renderer;
13
87
  this.element = element;
14
88
  this.translate = translate;
@@ -21,7 +95,7 @@
21
95
  this.mandatory = false;
22
96
  this.disabled = false;
23
97
  this.readonly = false;
24
- this.xAlignment = ngxLib.DEFAULT_HORIZONTAL_ALIGNMENT;
98
+ this.xAlignment = i2.DEFAULT_HORIZONTAL_ALIGNMENT;
25
99
  this._rowSpan = 1;
26
100
  this.indicatorsField = null;
27
101
  this.menuField = null;
@@ -35,8 +109,8 @@
35
109
  this.isActive = false;
36
110
  this.sizeLimitMB = 5;
37
111
  this.acceptImagesType = 'bmp,jpg,jpeg,png,gif'; // "image/bmp, image/jpg, image/jpeg, image/png, image/tif, image/tiff";
38
- this.fileChange = new core.EventEmitter();
39
- this.elementClick = new core.EventEmitter();
112
+ this.fileChange = new i0.EventEmitter();
113
+ this.elementClick = new i0.EventEmitter();
40
114
  this.fieldHeight = '';
41
115
  this.standAlone = false;
42
116
  this.dataURI = null;
@@ -84,14 +158,14 @@
84
158
  this.standAlone = true;
85
159
  this.setFieldHeight();
86
160
  this.setDefaultForm();
87
- this.renderer.addClass(this.element.nativeElement, ngxLib.PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME);
161
+ this.renderer.addClass(this.element.nativeElement, i2.PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME);
88
162
  }
89
163
  };
90
164
  PepImageComponent.prototype.setFieldHeight = function () {
91
165
  this.fieldHeight = this.customizationService.calculateFieldHeight(this.layoutType, this.rowSpan, this.standAlone);
92
166
  };
93
167
  PepImageComponent.prototype.setDefaultForm = function () {
94
- var pepField = new ngxLib.PepImageField({
168
+ var pepField = new i2.PepImageField({
95
169
  key: this.key,
96
170
  value: this.src,
97
171
  mandatory: this.mandatory,
@@ -156,7 +230,6 @@
156
230
  this.src.indexOf('no-image') > -1) {
157
231
  hasParentImage = false;
158
232
  }
159
- this.openImageModal(hasParentImage);
160
233
  this.elementClick.emit(event);
161
234
  };
162
235
  PepImageComponent.prototype.itemImageClick = function (event) {
@@ -169,80 +242,66 @@
169
242
  (nextElementSRC && nextElementSRC.src.indexOf('no-image') > -1)) {
170
243
  hasParentImage = false;
171
244
  }
172
- this.openImageModal(hasParentImage);
173
- };
174
- PepImageComponent.prototype.openImageModal = function (hasParentImage) {
175
- if (this.dataURI) {
176
- var fileStrArr = this.dataURI.fileStr.split(';');
177
- if (fileStrArr.length === 2) {
178
- var win = window.open('', '_blank');
179
- var contentType = fileStrArr[0].split(':')[1];
180
- var base64 = fileStrArr[1].split(',')[1];
181
- var blob = this.fileService.convertFromb64toBlob(base64, contentType);
182
- var url = URL.createObjectURL(blob);
183
- win.location.href = url;
245
+ // this.openImageModal(hasParentImage);
246
+ // if (this.dataURI) {
247
+ // this.imageService.openFromURI(this.dataURI);
248
+ // } else {
249
+ // this.imageService.openImageDialog(this.srcLarge || this.src, this.options, this.label);
250
+ // }
251
+ this.elementClick.emit({
252
+ key: this.key,
253
+ controlType: this.controlType,
254
+ eventWhich: event.which,
255
+ otherData: {
256
+ imageSrc: this.srcLarge || this.src,
257
+ options: this.options,
258
+ title: this.label
184
259
  }
185
- }
186
- else {
187
- var arr = [this.srcLarge || this.src].concat((this.options || []).map(function (opt) { return opt.value; }));
188
- var imagesValue = arr.join(';');
189
- // Show image in modal.
190
- var config = this.dialogService.getDialogConfig({}, 'inline');
191
- config.maxWidth = '75vw';
192
- config.height = '95vh';
193
- this.dialogService.openDialog(imagesFilmstrip.PepImagesFilmstripComponent, {
194
- currIndex: 0,
195
- key: this.key,
196
- value: imagesValue,
197
- label: this.label,
198
- uid: this.uid,
199
- showThumbnails: arr.length > 1,
200
- }, config);
201
- }
260
+ });
202
261
  };
203
262
  return PepImageComponent;
204
263
  }());
205
264
  PepImageComponent.MENU_CLICKED = '[MenuClicked]';
206
265
  PepImageComponent.decorators = [
207
- { type: core.Component, args: [{
266
+ { type: i0.Component, args: [{
208
267
  selector: 'pep-image',
209
268
  template: "<ng-container [formGroup]=\"form\">\n <ng-container>\n <ng-template #readonlyTemplate>\n <div class=\"img-wrapper\" [ngClass]=\"{\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\">\n <img [id]=\"key\" [style.max-height]=\"fieldHeight\" class=\"pep-report-file\" [alt]=\"label\" [src]=\"src\"\n (click)=\"itemImageClick($event)\" (error)=\"errorHandler($event)\" (load)=\"onImageLoad($event)\" />\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"layoutType === 'form'\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n <ng-container *ngIf=\"disabled || readonly; then disabledTemplate; else editableTemplate\"></ng-container>\n <ng-template #disabledTemplate>\n <div class=\"pep-file body-sm\" [style.height]=\"fieldHeight\" [ngClass]=\"{'one-row': rowSpan == 1}\">\n <ng-container *ngTemplateOutlet=\"readonlyTemplate\"></ng-container>\n </div>\n </ng-template>\n <ng-template #editableTemplate>\n <div class=\"pep-file-container image-container\" [ngClass]=\"{ 'one-row': rowSpan == 1}\">\n <pep-files-uploader [id]=\"key\" [key]=\"key\" [fieldHeight]=\"fieldHeight\" [layoutType]=\"layoutType\"\n [standAlone]=\"standAlone\" [src]=\"srcLarge || src\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [xAlignment]=\"xAlignment\" [rowSpan]=\"rowSpan\" [controlType]=\"controlType\"\n [form]=\"form\" [acceptedExtensions]=\"acceptImagesType\" (fileChange)=\"onFileChanged($event)\"\n (elementClick)=\"onFileClicked($event)\" [sizeLimitMB]=\"sizeLimitMB\">\n </pep-files-uploader>\n </div>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngTemplateOutlet=\"readonlyTemplate\"></ng-container>\n <!-- <div class=\"img-wrapper\"\n [ngClass]=\"{\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\">\n <img [id]=\"key\" [style.max-height]=\"fieldHeight\" class=\"pep-report-file\" [alt]=\"label\" [src]=\"src\"\n (click)=\"itemImageClick($event)\" (error)=\"errorHandler($event)\" />\n </div> -->\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngTemplateOutlet=\"readonlyTemplate\"></ng-container>\n <!-- <div class=\"img-wrapper\" [ngClass]=\"{\n 'left-alignment': xAlignment == 'left',\n 'right-alignment': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\">\n <img [id]=\"key\" [style.max-height]=\"fieldHeight\" class=\"pep-report-file pep-report-img\"\n [ngClass]=\"['text-align-' + xAlignment]\" [alt]=\"label\" [src]=\"src\" (click)=\"itemImageClick($event)\"\n (error)=\"errorHandler($event)\" (load)=\"onImageLoad($event)\" />\n </div> -->\n </ng-container>\n </ng-container>\n\n <!-- Menu -->\n <ng-container *ngIf=\"menuField\">\n <button [id]=\"key\" (click)=\"onMenuClick($event)\" class=\"floating-field pep-button icon-button weak invert\"\n [ngClass]=\"{\n bottom: menuField?.Layout?.YAlignment == '2',\n top: menuField?.Layout?.YAlignment == '1',\n left: menuField?.Layout?.XAlignment == '1',\n right: menuField?.Layout?.XAlignment == '2'\n }\">\n <mat-icon>\n <pep-icon name=\"system_menu\"></pep-icon>\n </mat-icon>\n </button>\n </ng-container>\n\n <!-- Campaign -->\n <ng-container *ngIf=\"hasCampaignField && hasCampaignField?.FormattedValue\">\n <span [id]=\"key\" class=\"campaign floating-field\" title=\"{{ hasCampaignField?.FormattedValue }}\" [ngClass]=\"{\n bottom: hasCampaignField?.Layout?.YAlignment == '2',\n top: hasCampaignField?.Layout?.YAlignment == '1',\n left: hasCampaignField?.Layout?.XAlignment == '1',\n right: hasCampaignField?.Layout?.XAlignment == '2'\n }\">\n <mat-icon class=\"has-active-campaign\">\n <pep-icon name=\"system_bolt\"></pep-icon>\n </mat-icon>\n </span>\n </ng-container>\n\n <!-- Indicators -->\n <ng-container *ngIf=\"indicatorsField && indicatorsField?.FormattedValue != ''\">\n <span [id]=\"key\" class=\"indicators-container floating-field\" [ngClass]=\"{\n bottom: indicatorsField?.Layout?.YAlignment == '2',\n top: indicatorsField?.Layout?.YAlignment == '1',\n left: indicatorsField?.Layout?.XAlignment == '1',\n right: indicatorsField?.Layout?.XAlignment == '2'\n }\">\n <mat-icon>\n <ng-container *ngFor=\"let value of indicatorsField?.FormattedValue?.split(';')\">\n <pep-icon class=\"pull-left flip\" name=\"indicator_dot_placeholder\" [fill]=\"value\"></pep-icon>\n </ng-container>\n <ng-container *ngIf=\"indicatorsField?.FormattedValue?.split(';').length < 4\">\n <pep-icon class=\"pull-left flip\" name=\"indicator_dot_placeholder\"></pep-icon>\n </ng-container>\n </mat-icon>\n </span>\n </ng-container>\n</ng-container>",
210
- changeDetection: core.ChangeDetectionStrategy.OnPush,
269
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
211
270
  styles: [":host{width:100%;height:inherit;display:grid}:host>*{align-self:center}.img-wrapper{display:flex;align-items:center;height:100%;max-width:100%}.img-wrapper.left-alignment{justify-content:flex-start}.img-wrapper.center-alignment{justify-content:center}.img-wrapper.right-alignment{justify-content:flex-end}.img-wrapper img{max-width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.pep-file-container,.pepperi-file-container{height:100%}.pep-file-container .img-wrapper,.pepperi-file-container .img-wrapper{height:calc(100% - 1.5rem)}.pep-file-container img,.pepperi-file-container img{cursor:pointer}.indicators-container{padding:0!important}.indicators-container mat-icon{height:100%;width:100%;padding:.4rem}.indicators-container mat-icon pep-icon{height:.75rem!important;width:.75rem!important;margin:.05rem}.floating-field{width:2.5rem;height:2.5rem;border-radius:.25rem;border-radius:var(--pep-border-radius-md,.25rem);padding:.5rem;cursor:pointer;position:absolute!important}.top{top:0}.bottom{bottom:0}.left{left:0}.right{right:0}"]
212
271
  },] }
213
272
  ];
214
273
  PepImageComponent.ctorParameters = function () { return [
215
- { type: dialog.PepDialogService },
216
- { type: ngxLib.PepCustomizationService },
217
- { type: ngxLib.PepFileService },
218
- { type: core.Renderer2 },
219
- { type: core.ElementRef },
220
- { type: core$1.TranslateService }
274
+ { type: PepImageService },
275
+ { type: i2.PepCustomizationService },
276
+ { type: i2.PepFileService },
277
+ { type: i0.Renderer2 },
278
+ { type: i0.ElementRef },
279
+ { type: core.TranslateService }
221
280
  ]; };
222
281
  PepImageComponent.propDecorators = {
223
- key: [{ type: core.Input }],
224
- srcLarge: [{ type: core.Input }],
225
- src: [{ type: core.Input }],
226
- options: [{ type: core.Input }],
227
- label: [{ type: core.Input }],
228
- mandatory: [{ type: core.Input }],
229
- disabled: [{ type: core.Input }],
230
- readonly: [{ type: core.Input }],
231
- xAlignment: [{ type: core.Input }],
232
- rowSpan: [{ type: core.Input }],
233
- indicatorsField: [{ type: core.Input }],
234
- menuField: [{ type: core.Input }],
235
- hasCampaignField: [{ type: core.Input }],
236
- visible: [{ type: core.Input }],
237
- form: [{ type: core.Input }],
238
- uid: [{ type: core.Input }],
239
- showTitle: [{ type: core.Input }],
240
- layoutType: [{ type: core.Input }],
241
- isActive: [{ type: core.Input }],
242
- sizeLimitMB: [{ type: core.Input }],
243
- acceptImagesType: [{ type: core.Input }],
244
- fileChange: [{ type: core.Output }],
245
- elementClick: [{ type: core.Output }]
282
+ key: [{ type: i0.Input }],
283
+ srcLarge: [{ type: i0.Input }],
284
+ src: [{ type: i0.Input }],
285
+ options: [{ type: i0.Input }],
286
+ label: [{ type: i0.Input }],
287
+ mandatory: [{ type: i0.Input }],
288
+ disabled: [{ type: i0.Input }],
289
+ readonly: [{ type: i0.Input }],
290
+ xAlignment: [{ type: i0.Input }],
291
+ rowSpan: [{ type: i0.Input }],
292
+ indicatorsField: [{ type: i0.Input }],
293
+ menuField: [{ type: i0.Input }],
294
+ hasCampaignField: [{ type: i0.Input }],
295
+ visible: [{ type: i0.Input }],
296
+ form: [{ type: i0.Input }],
297
+ uid: [{ type: i0.Input }],
298
+ showTitle: [{ type: i0.Input }],
299
+ layoutType: [{ type: i0.Input }],
300
+ isActive: [{ type: i0.Input }],
301
+ sizeLimitMB: [{ type: i0.Input }],
302
+ acceptImagesType: [{ type: i0.Input }],
303
+ fileChange: [{ type: i0.Output }],
304
+ elementClick: [{ type: i0.Output }]
246
305
  };
247
306
 
248
307
  var PepImageModule = /** @class */ (function () {
@@ -257,16 +316,16 @@
257
316
  return PepImageModule;
258
317
  }());
259
318
  PepImageModule.decorators = [
260
- { type: core.NgModule, args: [{
319
+ { type: i0.NgModule, args: [{
261
320
  imports: [
262
321
  common.CommonModule,
263
322
  forms.ReactiveFormsModule,
264
323
  // Material modules,
265
- core$2.MatCommonModule,
324
+ core$1.MatCommonModule,
266
325
  formField.MatFormFieldModule,
267
326
  icon$1.MatIconModule,
268
327
  // ngx-lib modules
269
- ngxLib.PepNgxLibModule,
328
+ i2.PepNgxLibModule,
270
329
  icon.PepIconModule,
271
330
  fieldTitle.PepFieldTitleModule,
272
331
  imagesFilmstrip.PepImagesFilmstripModule,
@@ -275,6 +334,7 @@
275
334
  exports: [PepImageComponent],
276
335
  declarations: [PepImageComponent],
277
336
  entryComponents: [imagesFilmstrip.PepImagesFilmstripComponent],
337
+ providers: [PepImageService]
278
338
  },] }
279
339
  ];
280
340
  PepImageModule.ctorParameters = function () { return [
@@ -291,6 +351,7 @@
291
351
 
292
352
  exports.PepImageComponent = PepImageComponent;
293
353
  exports.PepImageModule = PepImageModule;
354
+ exports.PepImageService = PepImageService;
294
355
 
295
356
  Object.defineProperty(exports, '__esModule', { value: true });
296
357
 
@@ -1 +1 @@
1
- {"version":3,"file":"pepperi-addons-ngx-lib-image.umd.js","sources":["../../../projects/ngx-lib/image/image.component.ts","../../../projects/ngx-lib/image/image.module.ts","../../../projects/ngx-lib/image/public-api.ts","../../../projects/ngx-lib/image/pepperi-addons-ngx-lib-image.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n ElementRef,\n OnDestroy,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n IPepOption,\n PepImageField,\n} from '@pepperi-addons/ngx-lib';\n\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\nimport { PepImagesFilmstripComponent } from '@pepperi-addons/ngx-lib/images-filmstrip';\nimport { pepIconNoImage2 } from '@pepperi-addons/ngx-lib/icon';\n\n@Component({\n selector: 'pep-image',\n templateUrl: './image.component.html',\n styleUrls: ['./image.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepImageComponent implements OnChanges, OnInit, OnDestroy {\n public static MENU_CLICKED = '[MenuClicked]';\n\n @Input() key = '';\n @Input() srcLarge = '';\n @Input() src = '';\n @Input() options: IPepOption[] = [];\n @Input() label = '';\n // @Input() type = 'image';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() indicatorsField: any = null;\n @Input() menuField: any = null;\n @Input() hasCampaignField: any = null;\n\n private _visible = true;\n @Input()\n set visible(visible: boolean) {\n this._visible = visible;\n if (visible) {\n this.renderer.removeClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n } else {\n this.renderer.addClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n\n controlType = 'image';\n\n @Input() form: FormGroup = null;\n @Input() uid = '';\n @Input() showTitle = true;\n\n private _layoutType: PepLayoutType = 'form';\n @Input()\n set layoutType(value: PepLayoutType) {\n this._layoutType = value;\n this.setFieldHeight();\n }\n get layoutType(): PepLayoutType {\n return this._layoutType;\n }\n\n @Input() isActive = false;\n @Input() sizeLimitMB = 5;\n @Input() acceptImagesType = 'bmp,jpg,jpeg,png,gif'; // \"image/bmp, image/jpg, image/jpeg, image/png, image/tif, image/tiff\";\n\n @Output()\n fileChange: EventEmitter<any> = new EventEmitter<any>();\n\n @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n\n constructor(\n private dialogService: PepDialogService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService\n ) { }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n this.setFieldHeight();\n this.setDefaultForm();\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n\n private setFieldHeight(): void {\n this.fieldHeight = this.customizationService.calculateFieldHeight(\n this.layoutType,\n this.rowSpan,\n this.standAlone\n );\n }\n\n private setDefaultForm(): void {\n const pepField = new PepImageField({\n key: this.key,\n value: this.src,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n });\n this.form = this.customizationService.getDefaultFromGroup(pepField);\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src?.currentValue?.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n errorHandler(event: any): void {\n event.target.src = this.fileService.getSvgAsImageSrc(\n pepIconNoImage2.data\n );\n event.target.title = this.translate.instant('IMAGE.NO_IMAGE');\n }\n\n onImageLoad(event: any): void {\n event.target.style.visibility = 'visible';\n event.target.title =\n event.target.title.length === 0\n ? this.translate.instant('IMAGE.CLICK_TO_ENLARGE')\n : event.target.title;\n }\n\n onMenuClick(event: any): void {\n this.elementClick.emit({\n key: this.key,\n value: PepImageComponent.MENU_CLICKED,\n controlType: this.controlType,\n eventWhich: event.which,\n });\n }\n\n onFileChanged(fileData: any): void {\n this.dataURI = fileData;\n this.src = this.srcLarge =\n this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\n\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.dataURI ? this.dataURI.fileExt : ''\n );\n // this.valueChange.emit({\n // key: this.key,\n // value,\n // });\n\n this.fileChange.emit(fileData);\n // this.fileChange.emit(value.length > 0 ? JSON.parse(value) : value);\n }\n\n objectIdIsNotEmpty(): boolean {\n return this.uid?.length > 0 && this.uid !== '0';\n }\n\n onFileClicked(event: IPepFieldClickEvent): void {\n let hasParentImage = true;\n if (\n // this.objectIdIsNotEmpty() &&\n this.src &&\n this.src.indexOf('no-image') > -1\n ) {\n hasParentImage = false;\n }\n\n this.openImageModal(hasParentImage);\n this.elementClick.emit(event);\n }\n\n itemImageClick(event: any): void {\n let hasParentImage = true;\n const elemTarget = event.target || event.srcElement;\n const nextElement = elemTarget.nextElementSibling || null;\n const imageSRC = elemTarget.src || null;\n const nextElementSRC =\n nextElement && nextElement.src ? nextElement.src : null;\n\n if (\n (imageSRC && imageSRC.indexOf('no-image') > -1) ||\n (nextElementSRC && nextElementSRC.src.indexOf('no-image') > -1)\n ) {\n hasParentImage = false;\n }\n\n this.openImageModal(hasParentImage);\n }\n\n openImageModal(hasParentImage: boolean): void {\n if (this.dataURI) {\n const fileStrArr = this.dataURI.fileStr.split(';');\n if (fileStrArr.length === 2) {\n const win = window.open('', '_blank');\n const contentType = fileStrArr[0].split(':')[1];\n const base64 = fileStrArr[1].split(',')[1];\n const blob = this.fileService.convertFromb64toBlob(\n base64,\n contentType\n );\n const url = URL.createObjectURL(blob);\n win.location.href = url;\n }\n } else {\n const arr = [this.srcLarge || this.src].concat(\n (this.options || []).map((opt) => opt.value)\n );\n const imagesValue = arr.join(';');\n\n // Show image in modal.\n const config = this.dialogService.getDialogConfig({}, 'inline');\n config.maxWidth = '75vw';\n config.height = '95vh';\n\n this.dialogService.openDialog(\n PepImagesFilmstripComponent,\n {\n currIndex: 0,\n key: this.key,\n value: imagesValue,\n label: this.label,\n uid: this.uid,\n showThumbnails: arr.length > 1,\n },\n config\n );\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport {\n PepImagesFilmstripModule,\n PepImagesFilmstripComponent,\n} from '@pepperi-addons/ngx-lib/images-filmstrip';\n\nimport { PepImageComponent } from './image.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatFormFieldModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepImagesFilmstripModule,\n PepFilesUploaderModule,\n ],\n exports: [PepImageComponent],\n declarations: [PepImageComponent],\n entryComponents: [PepImagesFilmstripComponent],\n})\nexport class PepImageModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/image\n */\nexport * from './image.module';\nexport * from './image.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepCustomizationService","PepImageField","pepIconNoImage2","PepImagesFilmstripComponent","Component","ChangeDetectionStrategy","PepDialogService","PepFileService","Renderer2","ElementRef","TranslateService","Input","Output","pepIconSystemMenu","pepIconSystemBolt","pepIconIndicatorDotPlaceholder","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepImagesFilmstripModule","PepFilesUploaderModule","PepIconRegistry"],"mappings":";;;;;;;QAmHI,2BACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B,EAC3B,QAAmB,EACnB,OAAmB,EACnB,SAA2B;YAL3B,kBAAa,GAAb,aAAa,CAAkB;YAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;YAC7C,gBAAW,GAAX,WAAW,CAAgB;YAC3B,aAAQ,GAAR,QAAQ,CAAW;YACnB,YAAO,GAAP,OAAO,CAAY;YACnB,cAAS,GAAT,SAAS,CAAkB;YAjF9B,QAAG,GAAG,EAAE,CAAC;YACT,aAAQ,GAAG,EAAE,CAAC;YACd,QAAG,GAAG,EAAE,CAAC;YACT,YAAO,GAAiB,EAAE,CAAC;YAC3B,UAAK,GAAG,EAAE,CAAC;;YAEX,cAAS,GAAG,KAAK,CAAC;YAClB,aAAQ,GAAG,KAAK,CAAC;YACjB,aAAQ,GAAG,KAAK,CAAC;YACjB,eAAU,GAA2BA,mCAA4B,CAAC;YAEnE,aAAQ,GAAG,CAAC,CAAC;YAUZ,oBAAe,GAAQ,IAAI,CAAC;YAC5B,cAAS,GAAQ,IAAI,CAAC;YACtB,qBAAgB,GAAQ,IAAI,CAAC;YAE9B,aAAQ,GAAG,IAAI,CAAC;YAoBxB,gBAAW,GAAG,OAAO,CAAC;YAEb,SAAI,GAAc,IAAI,CAAC;YACvB,QAAG,GAAG,EAAE,CAAC;YACT,cAAS,GAAG,IAAI,CAAC;YAElB,gBAAW,GAAkB,MAAM,CAAC;YAUnC,aAAQ,GAAG,KAAK,CAAC;YACjB,gBAAW,GAAG,CAAC,CAAC;YAChB,qBAAgB,GAAG,sBAAsB,CAAC;YAGnD,eA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B;gBAFvBO,qBAAc;gBANdC,cAAS;gBAFTC,eAAU;gBAMLC,uBAAgB;;;sBAyBpBC,UAAK;2BACLA,UAAK;sBACLA,UAAK;0BACLA,UAAK;wBACLA,UAAK;4BAELA,UAAK;2BACLA,UAAK;2BACLA,UAAK;6BACLA,UAAK;0BAGLA,UAAK;kCASLA,UAAK;4BACLA,UAAK;mCACLA,UAAK;0BAGLA,UAAK;uBAqBLA,UAAK;sBACLA,UAAK;4BACLA,UAAK;6BAGLA,UAAK;2BASLA,UAAK;8BACLA,UAAK;mCACLA,UAAK;6BAELC,WAAM;+BAGNA,WAAM;;;;QC/DP,wBAAoB,eAAgC;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;gBAC/BC,sBAAiB;gBACjBC,sBAAiB;gBACjBC,mCAA8B;aACjC,CAAC,CAAC;SACN;;;;gBA1BJC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;wBAClBC,oBAAa;;wBAEbC,sBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;wBACnBC,wCAAwB;wBACxBC,oCAAsB;qBACzB;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,eAAe,EAAE,CAACvB,2CAA2B,CAAC;iBACjD;;;gBAhCGwB,oBAAe;;;ICXnB;;;;ICAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"pepperi-addons-ngx-lib-image.umd.js","sources":["../../../projects/ngx-lib/image/image.service.ts","../../../projects/ngx-lib/image/image.component.ts","../../../projects/ngx-lib/image/image.module.ts","../../../projects/ngx-lib/image/public-api.ts","../../../projects/ngx-lib/image/pepperi-addons-ngx-lib-image.ts"],"sourcesContent":["import { Injectable, TemplateRef } from '@angular/core';\r\nimport {\r\n PepFileService,\r\n PepCustomizationService,\r\n IPepOption,\r\n} from '@pepperi-addons/ngx-lib';\r\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\r\nimport { PepImagesFilmstripComponent } from '@pepperi-addons/ngx-lib/images-filmstrip';\r\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PepImageService {\r\n constructor(\r\n private dialogService: PepDialogService,\r\n private customizationService: PepCustomizationService,\r\n private fileService: PepFileService,\r\n ) { }\r\n\r\n openImageDialog(imageSrc: string, options: IPepOption[], title: string = ''): void {\r\n const arr = [imageSrc].concat(\r\n (options || []).map((opt) => opt.value)\r\n );\r\n const imagesValue = arr.join(';');\r\n\r\n // Show image in modal.\r\n const config = this.dialogService.getDialogConfig({}, 'inline');\r\n config.maxWidth = '75vw';\r\n config.height = '95vh';\r\n\r\n this.dialogService.openDialog(\r\n PepImagesFilmstripComponent,\r\n {\r\n currIndex: 0,\r\n key: new Date().getDate(),\r\n value: imagesValue,\r\n label: title,\r\n uid: '',\r\n showThumbnails: arr.length > 1,\r\n },\r\n config\r\n );\r\n }\r\n\r\n openFromURI(event: IPepFileChangeEvent) {\r\n if (event) {\r\n const fileStrArr = event.fileStr.split(';');\r\n if (fileStrArr.length === 2) {\r\n const win = window.open('', '_blank');\r\n const contentType = fileStrArr[0].split(':')[1];\r\n const base64 = fileStrArr[1].split(',')[1];\r\n const blob = this.fileService.convertFromb64toBlob(\r\n base64,\r\n contentType\r\n );\r\n const url = URL.createObjectURL(blob);\r\n win.location.href = url;\r\n }\r\n }\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n ElementRef,\n OnDestroy,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n IPepOption,\n PepImageField,\n} from '@pepperi-addons/ngx-lib';\n\nimport { pepIconNoImage2 } from '@pepperi-addons/ngx-lib/icon';\nimport { PepImageService } from './image.service';\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\n\n@Component({\n selector: 'pep-image',\n templateUrl: './image.component.html',\n styleUrls: ['./image.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepImageComponent implements OnChanges, OnInit, OnDestroy {\n public static MENU_CLICKED = '[MenuClicked]';\n\n @Input() key = '';\n @Input() srcLarge = '';\n @Input() src = '';\n @Input() options: IPepOption[] = [];\n @Input() label = '';\n // @Input() type = 'image';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() indicatorsField: any = null;\n @Input() menuField: any = null;\n @Input() hasCampaignField: any = null;\n\n private _visible = true;\n @Input()\n set visible(visible: boolean) {\n this._visible = visible;\n if (visible) {\n this.renderer.removeClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n } else {\n this.renderer.addClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n\n controlType = 'image';\n\n @Input() form: FormGroup = null;\n @Input() uid = '';\n @Input() showTitle = true;\n\n private _layoutType: PepLayoutType = 'form';\n @Input()\n set layoutType(value: PepLayoutType) {\n this._layoutType = value;\n this.setFieldHeight();\n }\n get layoutType(): PepLayoutType {\n return this._layoutType;\n }\n\n @Input() isActive = false;\n @Input() sizeLimitMB = 5;\n @Input() acceptImagesType = 'bmp,jpg,jpeg,png,gif'; // \"image/bmp, image/jpg, image/jpeg, image/png, image/tif, image/tiff\";\n\n @Output()\n fileChange: EventEmitter<any> = new EventEmitter<any>();\n\n @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n\n constructor(\n private imageService: PepImageService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService\n ) { }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n this.setFieldHeight();\n this.setDefaultForm();\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n\n private setFieldHeight(): void {\n this.fieldHeight = this.customizationService.calculateFieldHeight(\n this.layoutType,\n this.rowSpan,\n this.standAlone\n );\n }\n\n private setDefaultForm(): void {\n const pepField = new PepImageField({\n key: this.key,\n value: this.src,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n });\n this.form = this.customizationService.getDefaultFromGroup(pepField);\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src?.currentValue?.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n errorHandler(event: any): void {\n event.target.src = this.fileService.getSvgAsImageSrc(\n pepIconNoImage2.data\n );\n event.target.title = this.translate.instant('IMAGE.NO_IMAGE');\n }\n\n onImageLoad(event: any): void {\n event.target.style.visibility = 'visible';\n event.target.title =\n event.target.title.length === 0\n ? this.translate.instant('IMAGE.CLICK_TO_ENLARGE')\n : event.target.title;\n }\n\n onMenuClick(event: any): void {\n this.elementClick.emit({\n key: this.key,\n value: PepImageComponent.MENU_CLICKED,\n controlType: this.controlType,\n eventWhich: event.which,\n });\n }\n\n onFileChanged(fileData: IPepFileChangeEvent): void {\n this.dataURI = fileData;\n this.src = this.srcLarge =\n this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\n\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.dataURI ? this.dataURI.fileExt : ''\n );\n // this.valueChange.emit({\n // key: this.key,\n // value,\n // });\n\n this.fileChange.emit(fileData);\n // this.fileChange.emit(value.length > 0 ? JSON.parse(value) : value);\n }\n\n objectIdIsNotEmpty(): boolean {\n return this.uid?.length > 0 && this.uid !== '0';\n }\n\n onFileClicked(event: IPepFieldClickEvent): void {\n let hasParentImage = true;\n if (\n // this.objectIdIsNotEmpty() &&\n this.src &&\n this.src.indexOf('no-image') > -1\n ) {\n hasParentImage = false;\n }\n\n this.elementClick.emit(event);\n }\n\n itemImageClick(event: any): void {\n let hasParentImage = true;\n const elemTarget = event.target || event.srcElement;\n const nextElement = elemTarget.nextElementSibling || null;\n const imageSRC = elemTarget.src || null;\n const nextElementSRC =\n nextElement && nextElement.src ? nextElement.src : null;\n\n if (\n (imageSRC && imageSRC.indexOf('no-image') > -1) ||\n (nextElementSRC && nextElementSRC.src.indexOf('no-image') > -1)\n ) {\n hasParentImage = false;\n }\n\n // this.openImageModal(hasParentImage);\n // if (this.dataURI) {\n // this.imageService.openFromURI(this.dataURI);\n // } else {\n // this.imageService.openImageDialog(this.srcLarge || this.src, this.options, this.label);\n // }\n\n this.elementClick.emit({\n key: this.key,\n controlType: this.controlType,\n eventWhich: event.which,\n otherData: {\n imageSrc: this.srcLarge || this.src,\n options: this.options,\n title: this.label\n }\n });\n }\n\n // openImageModal(hasParentImage: boolean): void {\n // if (this.dataURI) {\n // const fileStrArr = this.dataURI.fileStr.split(';');\n // if (fileStrArr.length === 2) {\n // const win = window.open('', '_blank');\n // const contentType = fileStrArr[0].split(':')[1];\n // const base64 = fileStrArr[1].split(',')[1];\n // const blob = this.fileService.convertFromb64toBlob(\n // base64,\n // contentType\n // );\n // const url = URL.createObjectURL(blob);\n // win.location.href = url;\n // }\n // } else {\n // const arr = [this.srcLarge || this.src].concat(\n // (this.options || []).map((opt) => opt.value)\n // );\n // const imagesValue = arr.join(';');\n\n // // Show image in modal.\n // const config = this.dialogService.getDialogConfig({}, 'inline');\n // config.maxWidth = '75vw';\n // config.height = '95vh';\n\n // this.dialogService.openDialog(\n // PepImagesFilmstripComponent,\n // {\n // currIndex: 0,\n // key: this.key,\n // value: imagesValue,\n // label: this.label,\n // uid: this.uid,\n // showThumbnails: arr.length > 1,\n // },\n // config\n // );\n // }\n // }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport {\n PepImagesFilmstripModule,\n PepImagesFilmstripComponent,\n} from '@pepperi-addons/ngx-lib/images-filmstrip';\n\nimport { PepImageComponent } from './image.component';\nimport { PepImageService } from './image.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatFormFieldModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepImagesFilmstripModule,\n PepFilesUploaderModule,\n ],\n exports: [PepImageComponent],\n declarations: [PepImageComponent],\n entryComponents: [PepImagesFilmstripComponent],\n providers: [PepImageService]\n})\nexport class PepImageModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/image\n */\nexport * from './image.module';\nexport * from './image.component';\nexport * from './image.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["PepImagesFilmstripComponent","Injectable","PepDialogService","PepCustomizationService","PepFileService","DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepImageField","pepIconNoImage2","Component","ChangeDetectionStrategy","Renderer2","ElementRef","TranslateService","Input","Output","pepIconSystemMenu","pepIconSystemBolt","pepIconIndicatorDotPlaceholder","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepImagesFilmstripModule","PepFilesUploaderModule","PepIconRegistry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAcI,yBACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B;YAF3B,kBAAa,GAAb,aAAa,CAAkB;YAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;YAC7C,gBAAW,GAAX,WAAW,CAAgB;SAClC;QAEL,yCAAe,GAAf,UAAgB,QAAgB,EAAE,OAAqB,EAAE,KAAkB;YAAlB,sBAAA,EAAA,UAAkB;YACvE,IAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CACzB,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,KAAK,GAAA,CAAC,CAC1C,CAAC;YACF,IAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YAGlC,IAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;YACzB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;YAEvB,IAAI,CAAC,aAAa,CAAC,UAAU,CACzBA,2CAA2B,EAC3B;gBACI,SAAS,EAAE,CA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,CAAC,aAAa,CAAC;gBAC/BC,sBAAiB;gBACjBC,sBAAiB;gBACjBC,mCAA8B;aACjC,CAAC,CAAC;SACN;;;;gBA3BJC,WAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;wBAClBC,oBAAa;;wBAEbC,kBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;wBACnBC,wCAAwB;wBACxBC,oCAAsB;qBACzB;oBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,eAAe,EAAE,CAAC7B,2CAA2B,CAAC;oBAC9C,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC/B;;;gBAlCG8B,oBAAe;;;ICXnB;;;;ICAA;;;;;;;;;;;;;;"}
@@ -26,6 +26,7 @@
26
26
  this.maxValue = NaN;
27
27
  this._value = null;
28
28
  this.valueChange = new core.EventEmitter();
29
+ this.inputChange = new core.EventEmitter();
29
30
  this.xAlignment = ngxLib.DEFAULT_HORIZONTAL_ALIGNMENT;
30
31
  this.sliderWrapper = null;
31
32
  }
@@ -57,13 +58,19 @@
57
58
  configurable: true
58
59
  });
59
60
  PepSliderComponent.prototype.setBackground = function () {
60
- var _a;
61
+ var _a, _b;
61
62
  // Get the wrapper for set the background.
62
63
  if (!this.sliderWrapper) {
63
64
  this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');
64
65
  }
65
66
  if (this.sliderWrapper) {
66
- this.renderer.setStyle(this.sliderWrapper, 'background', ((_a = this.background) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.background : '#ccc');
67
+ this.renderer.setStyle(this.sliderWrapper, 'background', ((_a = this.background) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.background : '');
68
+ if (((_b = this.background) === null || _b === void 0 ? void 0 : _b.length) > 0) {
69
+ this.renderer.removeClass(this.sliderWrapper, 'background-color-dimmed');
70
+ }
71
+ else {
72
+ this.renderer.addClass(this.sliderWrapper, 'background-color-dimmed');
73
+ }
67
74
  }
68
75
  };
69
76
  PepSliderComponent.prototype.ngOnInit = function () {
@@ -73,12 +80,15 @@
73
80
  PepSliderComponent.prototype.onValueChange = function (event) {
74
81
  this.valueChange.emit(event.value);
75
82
  };
83
+ PepSliderComponent.prototype.onInputChange = function (event) {
84
+ this.inputChange.emit(event.value);
85
+ };
76
86
  return PepSliderComponent;
77
87
  }());
78
88
  PepSliderComponent.decorators = [
79
89
  { type: core.Component, args: [{
80
90
  selector: 'pep-slider',
81
- template: "<div class=\"pep-slider-container\">\n <pep-field-title [label]=\"label\" [disabled]=\"disabled\" [hint]=\"hint\" [xAlignment]=\"xAlignment\">\n </pep-field-title>\n <mat-slider [min]=\"minValue\" [max]=\"maxValue\" [step]=\"step\" [value]=\"value\" [disabled]=\"disabled\" [title]=\"value\"\n (change)=\"onValueChange($event)\">\n </mat-slider>\n</div>",
91
+ template: "<div class=\"pep-slider-container\">\n <pep-field-title [label]=\"label\" [disabled]=\"disabled\" [hint]=\"hint\" [xAlignment]=\"xAlignment\">\n </pep-field-title>\n <mat-slider [min]=\"minValue\" [max]=\"maxValue\" [step]=\"step\" [value]=\"value\" [disabled]=\"disabled\" [title]=\"value\"\n (change)=\"onValueChange($event)\" (input)=\"onInputChange($event)\">\n </mat-slider>\n</div>",
82
92
  styles: [""]
83
93
  },] }
84
94
  ];
@@ -96,7 +106,8 @@
96
106
  minValue: [{ type: core.Input }],
97
107
  maxValue: [{ type: core.Input }],
98
108
  value: [{ type: core.Input }],
99
- valueChange: [{ type: core.Output }]
109
+ valueChange: [{ type: core.Output }],
110
+ inputChange: [{ type: core.Output }]
100
111
  };
101
112
 
102
113
  var PepSliderModule = /** @class */ (function () {
@@ -1 +1 @@
1
- {"version":3,"file":"pepperi-addons-ngx-lib-slider.umd.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value = null;\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n }\n get value(): string {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background?.length > 0 ? this.background : '#ccc');\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","DEFAULT_HORIZONTAL_ALIGNMENT","Component","Renderer2","ElementRef","PepLayoutService","Input","Output","NgModule","CommonModule","MatCommonModule","MatSliderModule","PepNgxLibModule","PepFieldTitleModule"],"mappings":";;;;;;IAaA;;;;;;;;;QAuDI,4BAAoB,QAAmB,EAAU,OAAmB,EAAU,gBAAkC;YAA5F,aAAQ,GAAR,QAAQ,CAAW;YAAU,YAAO,GAAP,OAAO,CAAY;YAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;YAzCvG,UAAK,GAAG,EAAE,CAAC;YACX,aAAQ,GAAG,KAAK,CAAC;YACjB,SAAI,GAAG,EAAE,CAAC;YAEX,gBAAW,GAAG,EAAE,CAAC;YAchB,SAAI,GAAG,CAAC,CAAC;YACT,aAAQ,GAAG,GAAG,CAAC;YACf,aAAQ,GAAG,GAAG,CAAC;YAEhB,WAAM,GAAG,IAAI,CAAC;YActB,gBAAW,GAAyB,IAAIA,iBAAY,EAAU,CAAC;YAE/D,eAAU,GAA2BC,mCAA4B,CAAC;YAClE,kBAAa,GAAQ,IAAI,CAAC;SAE2F;QApCrH,sBACI,0CAAU;iBAQd;gBACI,OAAO,IAAI,CAAC,WAAW,CAAC;aAC3B;iBAXD,UACe,UAAkB;gBAC7B,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;2BACLA,UAAK;2BACLA,UAAK;wBAGLA,UAAK;8BAYLC,WAAM;;;;QCvCX;;;;;gBAbCC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;;wBAEZC,sBAAe;wBACfC,sBAAe;;wBAEfC,sBAAe;wBACfC,8BAAmB;qBACtB;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,YAAY,EAAE,CAAC,kBAAkB,CAAC;iBACrC;;;ICtBD;;;;ICAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"pepperi-addons-ngx-lib-slider.umd.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value = null;\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n }\n get value(): string {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n @Output()\n inputChange: EventEmitter<string> = new EventEmitter<string>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background?.length > 0 ? this.background : '');\n\n if (this.background?.length > 0) {\n this.renderer.removeClass(this.sliderWrapper, 'background-color-dimmed');\n } else {\n this.renderer.addClass(this.sliderWrapper, 'background-color-dimmed');\n }\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n\n onInputChange(event) {\n this.inputChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","DEFAULT_HORIZONTAL_ALIGNMENT","Component","Renderer2","ElementRef","PepLayoutService","Input","Output","NgModule","CommonModule","MatCommonModule","MatSliderModule","PepNgxLibModule","PepFieldTitleModule"],"mappings":";;;;;;IAaA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Ae;;wBAEfC,sBAAe;wBACfC,8BAAmB;qBACtB;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,YAAY,EAAE,CAAC,kBAAkB,CAAC;iBACrC;;;ICtBD;;;;ICAA;;;;;;;;;;;;;"}
@@ -3785,9 +3785,13 @@
3785
3785
  _this.controlType = 'internalCarusel';
3786
3786
  _this.searchCode = '';
3787
3787
  _this.searchCode = options.searchCode || '';
3788
- _this.pageInfo = options.pageInfo;
3788
+ _this.update(options);
3789
3789
  return _this;
3790
3790
  }
3791
+ PepInternalCaruselField.prototype.update = function (options) {
3792
+ _super.prototype.update.call(this, options);
3793
+ this.pageInfo = options.pageInfo;
3794
+ };
3791
3795
  return PepInternalCaruselField;
3792
3796
  }(PepFieldBase));
3793
3797
  var PepInternalMenuField = /** @class */ (function (_super) {