@pepperi-addons/ngx-lib 0.2.51-beta.0 → 0.2.51-beta.5

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.
@@ -2739,11 +2739,16 @@
2739
2739
  var maxRow = Math.max.apply(Math, __spreadArray([], __read(_this.uiControl.ControlFields.map(function (f) {
2740
2740
  return f.Layout.Y + f.Layout.Height;
2741
2741
  }))));
2742
+ console.log("maxRow - " + maxRow);
2742
2743
  // * 16 convert rem to pixel
2743
2744
  var cardRowsHeight = _this.customizationService.calculateCardRowsHeight(maxRow) * 16;
2744
- var rowSpanToAdd = (childrenCount * (cardRowsHeight + 16)); // + 16 is the 1rem margin outside card.
2745
- formRowHeight +
2746
- rowsToAdd;
2745
+ console.log("cardRowsHeight - " + cardRowsHeight);
2746
+ // + 16 is the 1rem margin outside card.
2747
+ var rowSpanToAdd = (childrenCount * (cardRowsHeight + 16));
2748
+ // formRowHeight +
2749
+ // rowsToAdd;
2750
+ console.log("childrenCount - " + childrenCount);
2751
+ console.log("rowSpanToAdd - " + rowSpanToAdd);
2747
2752
  _this.field.rowSpan = rowSpanToAdd;
2748
2753
  }
2749
2754
  else {
@@ -3076,6 +3081,97 @@
3076
3081
  { type: ngxLib.PepHttpService }
3077
3082
  ]; };
3078
3083
 
3084
+ var PepInternalCaruselComponent = /** @class */ (function () {
3085
+ function PepInternalCaruselComponent(fb, layoutService, internalCaruselService) {
3086
+ this.fb = fb;
3087
+ this.layoutService = layoutService;
3088
+ this.internalCaruselService = internalCaruselService;
3089
+ this.layoutType = 'form';
3090
+ this.formValueChange = new core.EventEmitter();
3091
+ this.formFieldClick = new core.EventEmitter();
3092
+ this._items = null;
3093
+ this.layout = null;
3094
+ this.duration = 1000;
3095
+ this.itemsToMove = 3;
3096
+ this.prevDisabled = false;
3097
+ this.nextDisabled = false;
3098
+ this.PepScreenSizeType = ngxLib.PepScreenSizeType;
3099
+ }
3100
+ Object.defineProperty(PepInternalCaruselComponent.prototype, "items", {
3101
+ get: function () {
3102
+ return this._items;
3103
+ },
3104
+ set: function (value) {
3105
+ this._items = value;
3106
+ // this.moveTo(0);
3107
+ },
3108
+ enumerable: false,
3109
+ configurable: true
3110
+ });
3111
+ PepInternalCaruselComponent.prototype.ngOnInit = function () {
3112
+ // this.internalCaruselService.initCarusel(
3113
+ // this.field.objectId,
3114
+ // this.field.searchCode,
3115
+ // (caruselItems: any) => {
3116
+ this.layout = TempRelatedItems.UIControl;
3117
+ this.items = TempRelatedItems.Rows;
3118
+ // }
3119
+ // );
3120
+ };
3121
+ PepInternalCaruselComponent.prototype.ngAfterViewInit = function () {
3122
+ var _this = this;
3123
+ this.layoutService.onResize$.subscribe(function (size) {
3124
+ _this.screenSize = size;
3125
+ });
3126
+ };
3127
+ PepInternalCaruselComponent.prototype.onCustomizeObjectChanged = function (customizeObjectChangedData) {
3128
+ this.formValueChange.emit(customizeObjectChangedData);
3129
+ };
3130
+ PepInternalCaruselComponent.prototype.onCustomizeFieldClick = function (fieldClickEvent) {
3131
+ this.formFieldClick.emit(fieldClickEvent);
3132
+ };
3133
+ PepInternalCaruselComponent.prototype.moveLeft = function () {
3134
+ var indexToMove = Math.max(this.carousel.currIndex - this.itemsToMove, 0);
3135
+ this.moveTo(indexToMove);
3136
+ };
3137
+ PepInternalCaruselComponent.prototype.moveRight = function () {
3138
+ var indexToMove = Math.min(this.carousel.currIndex + this.itemsToMove, this.items.length);
3139
+ this.moveTo(indexToMove);
3140
+ };
3141
+ PepInternalCaruselComponent.prototype.moveTo = function (index) {
3142
+ if (this.carousel) {
3143
+ this.carousel.moveTo(index);
3144
+ }
3145
+ };
3146
+ PepInternalCaruselComponent.prototype.onReachesLeftBound = function (event) {
3147
+ this.prevDisabled = event;
3148
+ };
3149
+ PepInternalCaruselComponent.prototype.onReachesRightBound = function (event) {
3150
+ this.nextDisabled = event;
3151
+ };
3152
+ return PepInternalCaruselComponent;
3153
+ }());
3154
+ PepInternalCaruselComponent.decorators = [
3155
+ { type: core.Component, args: [{
3156
+ selector: 'pep-internal-carusel',
3157
+ template: "<div class=\"carousel-container\">\n <ng-container *ngIf=\"items?.length > 0; then carouselBlock; else emptyBlock\"></ng-container>\n <ng-template #emptyBlock>\n <!-- No items -->\n </ng-template>\n <ng-template #carouselBlock>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_left_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"prevDisabled\" (click)=\"moveLeft()\" class=\"carousel-arrow start-arrow\">\n </pep-button>\n <pep-carousel #carousel [xWheelEnabled]=\"false\" [snapDuration]=\"duration\"\n (reachesLeftBound)=\"onReachesLeftBound($event)\" (reachesRightBound)=\"onReachesRightBound($event)\">\n <ng-container *ngFor=\"let item of items\">\n <pep-form pepCarouselItem [layout]=\"layout\" [data]=\"item\" [layoutType]=\"'card'\" class=\"card-view \"\n (valueChange)=\"onCustomizeObjectChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\">\n </pep-form>\n </ng-container>\n </pep-carousel>\n <pep-button *ngIf=\"screenSize <= PepScreenSizeType.SM\" [iconName]=\"'arrow_right_alt'\" [styleType]=\"'regular'\"\n [disabled]=\"nextDisabled\" (click)=\"moveRight()\" class=\"carousel-arrow end-arrow\">\n </pep-button>\n </ng-template>\n</div>",
3158
+ providers: [PepInternalCaruselService],
3159
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3160
+ styles: [".carousel-container{position:relative;margin:0;display:grid}.carousel-container .carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.carousel-container .carousel-arrow.start-arrow{left:0}.carousel-container .carousel-arrow.end-arrow{right:0}.carousel-container ::ng-deep.carousel-content .card-view{padding:.5rem 0!important;padding:var(--pep-spacing-sm,.5rem) 0!important}.carousel-container ::ng-deep.carousel-content .card-view:first-child{-webkit-padding-start:.5rem!important;padding-inline-start:.5rem!important;-webkit-padding-start:var(--pep-spacing-sm,.5rem)!important;padding-inline-start:var(--pep-spacing-sm,.5rem)!important}.carousel-container ::ng-deep.carousel-content .card-view:last-child{-webkit-padding-end:.5rem!important;padding-inline-end:.5rem!important;-webkit-padding-end:var(--pep-spacing-sm,.5rem)!important;padding-inline-end:var(--pep-spacing-sm,.5rem)!important}"]
3161
+ },] }
3162
+ ];
3163
+ PepInternalCaruselComponent.ctorParameters = function () { return [
3164
+ { type: forms.FormBuilder },
3165
+ { type: ngxLib.PepLayoutService },
3166
+ { type: PepInternalCaruselService }
3167
+ ]; };
3168
+ PepInternalCaruselComponent.propDecorators = {
3169
+ carousel: [{ type: core.ViewChild, args: ['carousel', { read: carousel.PepCarouselComponent },] }],
3170
+ field: [{ type: core.Input }],
3171
+ layoutType: [{ type: core.Input }],
3172
+ formValueChange: [{ type: core.Output }],
3173
+ formFieldClick: [{ type: core.Output }]
3174
+ };
3079
3175
  var TempRelatedItems = {
3080
3176
  "Rows": [
3081
3177
  {
@@ -6205,193 +6301,6 @@
6205
6301
  }
6206
6302
  };
6207
6303
 
6208
- // type PepListCarouselSizeType = 'xs' | 'sm' | 'md';
6209
- var PepInternalCaruselComponent = /** @class */ (function () {
6210
- function PepInternalCaruselComponent(fb, layoutService, internalCaruselService, customizationService, elementRef, changeDetectorRef) {
6211
- this.fb = fb;
6212
- this.layoutService = layoutService;
6213
- this.internalCaruselService = internalCaruselService;
6214
- this.customizationService = customizationService;
6215
- this.elementRef = elementRef;
6216
- this.changeDetectorRef = changeDetectorRef;
6217
- this.controlType = 'internalCarusel';
6218
- this.layoutType = 'form';
6219
- this.formValueChange = new core.EventEmitter();
6220
- this.formFieldClick = new core.EventEmitter();
6221
- this._items = null;
6222
- this.duration = 1000;
6223
- this.layout = null;
6224
- this.itemsToMove = 3;
6225
- this.lockItemInnerEvents = true;
6226
- this.hideArrowsInSmallScreen = true;
6227
- this.prevDisabled = false;
6228
- this.nextDisabled = false;
6229
- this.PepScreenSizeType = ngxLib.PepScreenSizeType;
6230
- this.defaultRowSpan = -1;
6231
- }
6232
- Object.defineProperty(PepInternalCaruselComponent.prototype, "items", {
6233
- get: function () {
6234
- return this._items;
6235
- },
6236
- set: function (value) {
6237
- this._items = value;
6238
- this.moveTo(0);
6239
- },
6240
- enumerable: false,
6241
- configurable: true
6242
- });
6243
- PepInternalCaruselComponent.prototype.fillData = function () {
6244
- var _this = this;
6245
- setTimeout(function () {
6246
- var childrenCount = _this.items
6247
- ? _this.items.length
6248
- : 0;
6249
- var formRowHeight = _this.customizationService.calculateFormFieldHeight() * 16; // convert rem to pixel
6250
- // Set the default only if not set yet.
6251
- if (_this.defaultRowSpan === -1) {
6252
- _this.defaultRowSpan = _this.field.rowSpan;
6253
- }
6254
- var maxRow = Math.max.apply(Math, __spreadArray([], __read(_this.layout.ControlFields.map(function (f) {
6255
- return f.Layout.Y + f.Layout.Height;
6256
- }))));
6257
- // * 16 convert rem to pixel
6258
- var cardRowsHeight = _this.customizationService.calculateCardRowsHeight(maxRow) * 16;
6259
- var rowSpanToAdd = (childrenCount * (cardRowsHeight + 16)); // + 16 is the 1rem margin outside card.
6260
- formRowHeight;
6261
- _this.field.rowSpan = rowSpanToAdd;
6262
- }, 0);
6263
- this.changeDetectorRef.markForCheck();
6264
- };
6265
- PepInternalCaruselComponent.prototype.ngOnInit = function () {
6266
- // this.internalCaruselService.initCarusel(
6267
- // this.field.objectId,
6268
- // this.field.searchCode,
6269
- // (caruselItems: any) => {
6270
- this.layout = TempRelatedItems.UIControl;
6271
- this.items = TempRelatedItems.Rows;
6272
- this.fillData();
6273
- // }
6274
- // );
6275
- };
6276
- PepInternalCaruselComponent.prototype.ngAfterViewInit = function () {
6277
- var _this = this;
6278
- this.layoutService.onResize$.subscribe(function (size) {
6279
- _this.screenSize = size;
6280
- });
6281
- };
6282
- PepInternalCaruselComponent.prototype.ngOnDestroy = function () {
6283
- //
6284
- };
6285
- // updateChanges(elementToUpdate: any): void {
6286
- // // Update memory data
6287
- // for (let index = 0; index < this.caruselData.Rows.length; index++) {
6288
- // if (this.caruselData.Rows[index].UID === elementToUpdate.UID) {
6289
- // this.caruselData.Rows[index] = elementToUpdate;
6290
- // }
6291
- // }
6292
- // }
6293
- // setValueCallback(id: any, res: any): void {
6294
- // if (res.Rows.length === 1) {
6295
- // const field = res.Rows[0].Fields.find((f) => f.ApiName === 'ObjectMenu');
6296
- // if (field) {
6297
- // // HACK : Until "Enabled" returns from the server, we set PepMenu to be
6298
- // // Disabled in cart on regular items and not campign items.
6299
- // field.Enabled = true;
6300
- // }
6301
- // this.updateChanges(res.Rows[0]);
6302
- // }
6303
- // this.valueChange.emit(res);
6304
- // this.changeDetectorRef.markForCheck();
6305
- // }
6306
- PepInternalCaruselComponent.prototype.onCustomizeObjectChanged = function (customizeObjectChangedData) {
6307
- // this.internalCaruselService.childValueChanged(
6308
- // customizeObjectChangedData.id,
6309
- // customizeObjectChangedData.key,
6310
- // customizeObjectChangedData.value,
6311
- // (res: any) => {
6312
- // this.setValueCallback(customizeObjectChangedData.id, res);
6313
- // }
6314
- // );
6315
- this.formValueChange.emit(customizeObjectChangedData);
6316
- };
6317
- PepInternalCaruselComponent.prototype.onCustomizeFieldClick = function (fieldClickEvent) {
6318
- var handledEvent = false;
6319
- // // For the new custom form, the plus and minus events transform in the IPepFormFieldValueChangeEvent
6320
- // if (fieldClickEvent.controlType === 'qs') {
6321
- // if (fieldClickEvent.value === PepQuantitySelectorComponent.PLUS) {
6322
- // handledEvent = true;
6323
- // this.internalCaruselService.childPlusClick(
6324
- // fieldClickEvent.id,
6325
- // fieldClickEvent.key,
6326
- // (res: any) => {
6327
- // this.setValueCallback(fieldClickEvent.id, res);
6328
- // }
6329
- // );
6330
- // } else if (
6331
- // fieldClickEvent.value === PepQuantitySelectorComponent.MINUS
6332
- // ) {
6333
- // handledEvent = true;
6334
- // this.internalCaruselService.childMinusClick(
6335
- // fieldClickEvent.id,
6336
- // fieldClickEvent.key,
6337
- // (res: any) => {
6338
- // this.setValueCallback(fieldClickEvent.id, res);
6339
- // }
6340
- // );
6341
- // }
6342
- // }
6343
- if (!handledEvent) {
6344
- this.formFieldClick.emit(fieldClickEvent);
6345
- }
6346
- };
6347
- PepInternalCaruselComponent.prototype.moveLeft = function () {
6348
- // this.carousel.moveLeft();
6349
- var indexToMove = Math.max(this.carousel.currIndex - this.itemsToMove, 0);
6350
- this.moveTo(indexToMove);
6351
- };
6352
- PepInternalCaruselComponent.prototype.moveRight = function () {
6353
- // this.carousel.moveRight();
6354
- var indexToMove = Math.min(this.carousel.currIndex + this.itemsToMove, this.items.length);
6355
- this.moveTo(indexToMove);
6356
- };
6357
- PepInternalCaruselComponent.prototype.moveTo = function (index) {
6358
- if (this.carousel) {
6359
- this.carousel.moveTo(index);
6360
- }
6361
- };
6362
- PepInternalCaruselComponent.prototype.onReachesLeftBound = function (event) {
6363
- this.prevDisabled = event;
6364
- };
6365
- PepInternalCaruselComponent.prototype.onReachesRightBound = function (event) {
6366
- this.nextDisabled = event;
6367
- };
6368
- return PepInternalCaruselComponent;
6369
- }());
6370
- PepInternalCaruselComponent.decorators = [
6371
- { type: core.Component, args: [{
6372
- selector: 'pep-internal-carusel',
6373
- template: "<div class=\"carousel-container\">\n <ng-container *ngIf=\"items?.length > 0; then carouselBlock; else emptyBlock\"></ng-container>\n <ng-template #emptyBlock>\n <!-- No items -->\n </ng-template>\n <ng-template #carouselBlock>\n <pep-button *ngIf=\"!(hideArrowsInSmallScreen && screenSize > PepScreenSizeType.SM)\"\n [iconName]=\"'arrow_left_alt'\" [styleType]=\"'regular'\" [disabled]=\"prevDisabled\" (click)=\"moveLeft()\"\n class=\"carousel-arrow start-arrow\">\n </pep-button>\n <pep-carousel #carousel [xWheelEnabled]=\"false\" [snapDuration]=\"duration\"\n (reachesLeftBound)=\"onReachesLeftBound($event)\" (reachesRightBound)=\"onReachesRightBound($event)\">\n <ng-container *ngFor=\"let item of items\">\n <pep-form pepCarouselItem [layout]=\"layout\" [data]=\"item\" [layoutType]=\"'card'\" class=\"card-view \"\n (valueChange)=\"onCustomizeObjectChanged($event)\" (fieldClick)=\"onCustomizeFieldClick($event)\">\n </pep-form>\n </ng-container>\n </pep-carousel>\n <pep-button *ngIf=\"!(hideArrowsInSmallScreen && screenSize > PepScreenSizeType.SM)\"\n [iconName]=\"'arrow_right_alt'\" [styleType]=\"'regular'\" [disabled]=\"nextDisabled\" (click)=\"moveRight()\"\n class=\"carousel-arrow end-arrow\">\n </pep-button>\n </ng-template>\n</div>",
6374
- providers: [PepInternalCaruselService],
6375
- changeDetection: core.ChangeDetectionStrategy.OnPush,
6376
- styles: [".carousel-container{position:relative;margin:0 calc(.5rem * -1);margin:0 calc(var(--pep-spacing-sm, .5rem) * -1);display:grid}.carousel-container .carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.carousel-container .carousel-arrow.start-arrow{left:0}.carousel-container .carousel-arrow.end-arrow{right:0}.carousel-container ::ng-deep.carousel-content .card-view{padding:.5rem 0!important;padding:var(--pep-spacing-sm,.5rem) 0!important}.carousel-container ::ng-deep.carousel-content .card-view:first-child{-webkit-padding-start:.5rem!important;padding-inline-start:.5rem!important;-webkit-padding-start:var(--pep-spacing-sm,.5rem)!important;padding-inline-start:var(--pep-spacing-sm,.5rem)!important}.carousel-container ::ng-deep.carousel-content .card-view:last-child{-webkit-padding-end:.5rem!important;padding-inline-end:.5rem!important;-webkit-padding-end:var(--pep-spacing-sm,.5rem)!important;padding-inline-end:var(--pep-spacing-sm,.5rem)!important}"]
6377
- },] }
6378
- ];
6379
- PepInternalCaruselComponent.ctorParameters = function () { return [
6380
- { type: forms.FormBuilder },
6381
- { type: ngxLib.PepLayoutService },
6382
- { type: PepInternalCaruselService },
6383
- { type: ngxLib.PepCustomizationService },
6384
- { type: core.ElementRef },
6385
- { type: core.ChangeDetectorRef }
6386
- ]; };
6387
- PepInternalCaruselComponent.propDecorators = {
6388
- field: [{ type: core.Input }],
6389
- layoutType: [{ type: core.Input }],
6390
- formValueChange: [{ type: core.Output }],
6391
- formFieldClick: [{ type: core.Output }],
6392
- carousel: [{ type: core.ViewChild, args: ['carousel', { read: carousel.PepCarouselComponent },] }]
6393
- };
6394
-
6395
6304
  var pepComponentsModules = [
6396
6305
  address.PepAddressModule,
6397
6306
  attachment.PepAttachmentModule,