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

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 (28) hide show
  1. package/bundles/pepperi-addons-ngx-lib-form.umd.js +103 -194
  2. package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
  3. package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +1 -1
  4. package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js.map +1 -1
  5. package/bundles/pepperi-addons-ngx-lib-textbox.umd.js +1 -1
  6. package/bundles/pepperi-addons-ngx-lib-textbox.umd.js.map +1 -1
  7. package/bundles/pepperi-addons-ngx-lib.umd.js +1 -4
  8. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  9. package/core/customization/customization.model.d.ts +2 -2
  10. package/esm2015/core/customization/customization.model.js +2 -5
  11. package/esm2015/form/form.component.js +3 -4
  12. package/esm2015/form/internal-carusel.component.js +3145 -110
  13. package/esm2015/form/internal-page.component.js +8 -4
  14. package/esm2015/smart-filters/common/model/base-filter-component.js +2 -2
  15. package/esm2015/textbox/textbox.component.js +2 -2
  16. package/fesm2015/pepperi-addons-ngx-lib-form.js +97 -187
  17. package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
  18. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1 -1
  19. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js.map +1 -1
  20. package/fesm2015/pepperi-addons-ngx-lib-textbox.js +1 -1
  21. package/fesm2015/pepperi-addons-ngx-lib-textbox.js.map +1 -1
  22. package/fesm2015/pepperi-addons-ngx-lib.js +1 -4
  23. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  24. package/form/internal-carusel.component.d.ts +8 -18
  25. package/form/pepperi-addons-ngx-lib-form.metadata.json +1 -1
  26. package/package.json +1 -1
  27. package/esm2015/form/internal-carusel.temp-data.js +0 -3129
  28. package/form/internal-carusel.temp-data.d.ts +0 -62
@@ -658,9 +658,8 @@
658
658
  }
659
659
  case ngxLib.FIELD_TYPE.RelatedObjectsCards: {
660
660
  options.rowSpan = controlField.Layout.Height;
661
- // options.objectId = objectId;
662
- // options.parentId = parentId;
663
- // options.searchCode = searchCode;
661
+ options.searchCode = searchCode;
662
+ options.pageInfo = dataField.UIPageInfo;
664
663
  customField = new ngxLib.PepInternalCaruselField(options);
665
664
  break;
666
665
  }
@@ -2741,13 +2740,17 @@
2741
2740
  }))));
2742
2741
  // * 16 convert rem to pixel
2743
2742
  var cardRowsHeight = _this.customizationService.calculateCardRowsHeight(maxRow) * 16;
2743
+ // maxRow * 24 + 60 - 24 for each row in card + 60 for the padding of each card.
2744
+ // const rowSpanToAdd = Math.floor(childrenCount * ((cardRowsHeight + 56) / formRowHeight) + rowsToAdd);
2744
2745
  // + 16 is the 1rem margin outside card.
2745
- var rowSpanToAdd = (childrenCount * (cardRowsHeight + 16));
2746
- // formRowHeight +
2747
- // rowsToAdd;
2746
+ var rowSpanToAdd = (childrenCount * (cardRowsHeight + 16)) /
2747
+ formRowHeight +
2748
+ rowsToAdd;
2748
2749
  _this.field.rowSpan = rowSpanToAdd;
2749
2750
  }
2750
2751
  else {
2752
+ // const tableRowsHeight = this.customizationService.calculateTableRowsHeight(childrenCount) * 16;
2753
+ // this.field.rowSpan = Math.ceil((tableRowsHeight + (rowsToAdd * 40)) / formRowHeight);
2751
2754
  // * 16 convert rem to pixel
2752
2755
  var rowsToAddHeight = _this.customizationService.calculateTableRowsHeight(rowsToAdd, false) * 16;
2753
2756
  var tableRowsHeight = _this.customizationService.calculateTableRowsHeight(childrenCount) * 16;
@@ -3077,6 +3080,100 @@
3077
3080
  { type: ngxLib.PepHttpService }
3078
3081
  ]; };
3079
3082
 
3083
+ var PepInternalCaruselComponent = /** @class */ (function () {
3084
+ function PepInternalCaruselComponent(fb, layoutService, internalCaruselService) {
3085
+ this.fb = fb;
3086
+ this.layoutService = layoutService;
3087
+ this.internalCaruselService = internalCaruselService;
3088
+ this.layoutType = 'form';
3089
+ this.formValueChange = new core.EventEmitter();
3090
+ this.formFieldClick = new core.EventEmitter();
3091
+ this._items = null;
3092
+ this.layout = null;
3093
+ this.duration = 1000;
3094
+ this.itemsToMove = 3;
3095
+ this.prevDisabled = false;
3096
+ this.nextDisabled = false;
3097
+ this.PepScreenSizeType = ngxLib.PepScreenSizeType;
3098
+ }
3099
+ Object.defineProperty(PepInternalCaruselComponent.prototype, "items", {
3100
+ get: function () {
3101
+ return this._items;
3102
+ },
3103
+ set: function (value) {
3104
+ this._items = value;
3105
+ // this.moveTo(0);
3106
+ },
3107
+ enumerable: false,
3108
+ configurable: true
3109
+ });
3110
+ PepInternalCaruselComponent.prototype.ngOnInit = function () {
3111
+ // this.internalCaruselService.initCarusel(
3112
+ // this.field.objectId,
3113
+ // this.field.searchCode,
3114
+ // (caruselItems: any) => {
3115
+ var caruselField = this.field;
3116
+ if (caruselField) {
3117
+ this.layout = caruselField.pageInfo.UIControl;
3118
+ this.items = caruselField.pageInfo.Rows;
3119
+ }
3120
+ // }
3121
+ // );
3122
+ };
3123
+ PepInternalCaruselComponent.prototype.ngAfterViewInit = function () {
3124
+ var _this = this;
3125
+ this.layoutService.onResize$.subscribe(function (size) {
3126
+ _this.screenSize = size;
3127
+ });
3128
+ };
3129
+ PepInternalCaruselComponent.prototype.onCustomizeObjectChanged = function (customizeObjectChangedData) {
3130
+ this.formValueChange.emit(customizeObjectChangedData);
3131
+ };
3132
+ PepInternalCaruselComponent.prototype.onCustomizeFieldClick = function (fieldClickEvent) {
3133
+ this.formFieldClick.emit(fieldClickEvent);
3134
+ };
3135
+ PepInternalCaruselComponent.prototype.moveLeft = function () {
3136
+ var indexToMove = Math.max(this.carousel.currIndex - this.itemsToMove, 0);
3137
+ this.moveTo(indexToMove);
3138
+ };
3139
+ PepInternalCaruselComponent.prototype.moveRight = function () {
3140
+ var indexToMove = Math.min(this.carousel.currIndex + this.itemsToMove, this.items.length);
3141
+ this.moveTo(indexToMove);
3142
+ };
3143
+ PepInternalCaruselComponent.prototype.moveTo = function (index) {
3144
+ if (this.carousel) {
3145
+ this.carousel.moveTo(index);
3146
+ }
3147
+ };
3148
+ PepInternalCaruselComponent.prototype.onReachesLeftBound = function (event) {
3149
+ this.prevDisabled = event;
3150
+ };
3151
+ PepInternalCaruselComponent.prototype.onReachesRightBound = function (event) {
3152
+ this.nextDisabled = event;
3153
+ };
3154
+ return PepInternalCaruselComponent;
3155
+ }());
3156
+ PepInternalCaruselComponent.decorators = [
3157
+ { type: core.Component, args: [{
3158
+ selector: 'pep-internal-carusel',
3159
+ 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>",
3160
+ providers: [PepInternalCaruselService],
3161
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
3162
+ 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}"]
3163
+ },] }
3164
+ ];
3165
+ PepInternalCaruselComponent.ctorParameters = function () { return [
3166
+ { type: forms.FormBuilder },
3167
+ { type: ngxLib.PepLayoutService },
3168
+ { type: PepInternalCaruselService }
3169
+ ]; };
3170
+ PepInternalCaruselComponent.propDecorators = {
3171
+ carousel: [{ type: core.ViewChild, args: ['carousel', { read: carousel.PepCarouselComponent },] }],
3172
+ field: [{ type: core.Input }],
3173
+ layoutType: [{ type: core.Input }],
3174
+ formValueChange: [{ type: core.Output }],
3175
+ formFieldClick: [{ type: core.Output }]
3176
+ };
3080
3177
  var TempRelatedItems = {
3081
3178
  "Rows": [
3082
3179
  {
@@ -6206,194 +6303,6 @@
6206
6303
  }
6207
6304
  };
6208
6305
 
6209
- // type PepListCarouselSizeType = 'xs' | 'sm' | 'md';
6210
- var PepInternalCaruselComponent = /** @class */ (function () {
6211
- function PepInternalCaruselComponent(fb, layoutService, internalCaruselService, customizationService, elementRef, changeDetectorRef) {
6212
- this.fb = fb;
6213
- this.layoutService = layoutService;
6214
- this.internalCaruselService = internalCaruselService;
6215
- this.customizationService = customizationService;
6216
- this.elementRef = elementRef;
6217
- this.changeDetectorRef = changeDetectorRef;
6218
- this.controlType = 'internalCarusel';
6219
- this.layoutType = 'form';
6220
- this.formValueChange = new core.EventEmitter();
6221
- this.formFieldClick = new core.EventEmitter();
6222
- this._items = null;
6223
- this.duration = 1000;
6224
- this.layout = null;
6225
- this.itemsToMove = 3;
6226
- this.lockItemInnerEvents = true;
6227
- this.hideArrowsInSmallScreen = true;
6228
- this.prevDisabled = false;
6229
- this.nextDisabled = false;
6230
- this.PepScreenSizeType = ngxLib.PepScreenSizeType;
6231
- this.defaultRowSpan = -1;
6232
- }
6233
- Object.defineProperty(PepInternalCaruselComponent.prototype, "items", {
6234
- get: function () {
6235
- return this._items;
6236
- },
6237
- set: function (value) {
6238
- this._items = value;
6239
- this.moveTo(0);
6240
- },
6241
- enumerable: false,
6242
- configurable: true
6243
- });
6244
- PepInternalCaruselComponent.prototype.fillData = function () {
6245
- var _this = this;
6246
- setTimeout(function () {
6247
- // const childrenCount = this.items
6248
- // ? this.items.length
6249
- // : 0;
6250
- // convert rem to pixel
6251
- var formRowHeight = _this.customizationService.calculateFormFieldHeight() * 16;
6252
- // Set the default only if not set yet.
6253
- if (_this.defaultRowSpan === -1) {
6254
- _this.defaultRowSpan = _this.field.rowSpan;
6255
- }
6256
- var maxRow = Math.max.apply(Math, __spreadArray([], __read(_this.layout.ControlFields.map(function (f) {
6257
- return f.Layout.Y + f.Layout.Height;
6258
- }))));
6259
- // * 16 convert rem to pixel
6260
- var cardRowsHeight = _this.customizationService.calculateCardRowsHeight(maxRow) * 16;
6261
- // + 16 is the 1rem margin outside card.
6262
- var rowSpanToAdd = (cardRowsHeight + 16);
6263
- _this.field.rowSpan = rowSpanToAdd;
6264
- }, 0);
6265
- this.changeDetectorRef.markForCheck();
6266
- };
6267
- PepInternalCaruselComponent.prototype.ngOnInit = function () {
6268
- // this.internalCaruselService.initCarusel(
6269
- // this.field.objectId,
6270
- // this.field.searchCode,
6271
- // (caruselItems: any) => {
6272
- this.layout = TempRelatedItems.UIControl;
6273
- this.items = TempRelatedItems.Rows;
6274
- // this.fillData();
6275
- // }
6276
- // );
6277
- };
6278
- PepInternalCaruselComponent.prototype.ngAfterViewInit = function () {
6279
- var _this = this;
6280
- this.layoutService.onResize$.subscribe(function (size) {
6281
- _this.screenSize = size;
6282
- });
6283
- };
6284
- PepInternalCaruselComponent.prototype.ngOnDestroy = function () {
6285
- //
6286
- };
6287
- // updateChanges(elementToUpdate: any): void {
6288
- // // Update memory data
6289
- // for (let index = 0; index < this.caruselData.Rows.length; index++) {
6290
- // if (this.caruselData.Rows[index].UID === elementToUpdate.UID) {
6291
- // this.caruselData.Rows[index] = elementToUpdate;
6292
- // }
6293
- // }
6294
- // }
6295
- // setValueCallback(id: any, res: any): void {
6296
- // if (res.Rows.length === 1) {
6297
- // const field = res.Rows[0].Fields.find((f) => f.ApiName === 'ObjectMenu');
6298
- // if (field) {
6299
- // // HACK : Until "Enabled" returns from the server, we set PepMenu to be
6300
- // // Disabled in cart on regular items and not campign items.
6301
- // field.Enabled = true;
6302
- // }
6303
- // this.updateChanges(res.Rows[0]);
6304
- // }
6305
- // this.valueChange.emit(res);
6306
- // this.changeDetectorRef.markForCheck();
6307
- // }
6308
- PepInternalCaruselComponent.prototype.onCustomizeObjectChanged = function (customizeObjectChangedData) {
6309
- // this.internalCaruselService.childValueChanged(
6310
- // customizeObjectChangedData.id,
6311
- // customizeObjectChangedData.key,
6312
- // customizeObjectChangedData.value,
6313
- // (res: any) => {
6314
- // this.setValueCallback(customizeObjectChangedData.id, res);
6315
- // }
6316
- // );
6317
- this.formValueChange.emit(customizeObjectChangedData);
6318
- };
6319
- PepInternalCaruselComponent.prototype.onCustomizeFieldClick = function (fieldClickEvent) {
6320
- var handledEvent = false;
6321
- // // For the new custom form, the plus and minus events transform in the IPepFormFieldValueChangeEvent
6322
- // if (fieldClickEvent.controlType === 'qs') {
6323
- // if (fieldClickEvent.value === PepQuantitySelectorComponent.PLUS) {
6324
- // handledEvent = true;
6325
- // this.internalCaruselService.childPlusClick(
6326
- // fieldClickEvent.id,
6327
- // fieldClickEvent.key,
6328
- // (res: any) => {
6329
- // this.setValueCallback(fieldClickEvent.id, res);
6330
- // }
6331
- // );
6332
- // } else if (
6333
- // fieldClickEvent.value === PepQuantitySelectorComponent.MINUS
6334
- // ) {
6335
- // handledEvent = true;
6336
- // this.internalCaruselService.childMinusClick(
6337
- // fieldClickEvent.id,
6338
- // fieldClickEvent.key,
6339
- // (res: any) => {
6340
- // this.setValueCallback(fieldClickEvent.id, res);
6341
- // }
6342
- // );
6343
- // }
6344
- // }
6345
- if (!handledEvent) {
6346
- this.formFieldClick.emit(fieldClickEvent);
6347
- }
6348
- };
6349
- PepInternalCaruselComponent.prototype.moveLeft = function () {
6350
- // this.carousel.moveLeft();
6351
- var indexToMove = Math.max(this.carousel.currIndex - this.itemsToMove, 0);
6352
- this.moveTo(indexToMove);
6353
- };
6354
- PepInternalCaruselComponent.prototype.moveRight = function () {
6355
- // this.carousel.moveRight();
6356
- var indexToMove = Math.min(this.carousel.currIndex + this.itemsToMove, this.items.length);
6357
- this.moveTo(indexToMove);
6358
- };
6359
- PepInternalCaruselComponent.prototype.moveTo = function (index) {
6360
- if (this.carousel) {
6361
- this.carousel.moveTo(index);
6362
- }
6363
- };
6364
- PepInternalCaruselComponent.prototype.onReachesLeftBound = function (event) {
6365
- this.prevDisabled = event;
6366
- };
6367
- PepInternalCaruselComponent.prototype.onReachesRightBound = function (event) {
6368
- this.nextDisabled = event;
6369
- };
6370
- return PepInternalCaruselComponent;
6371
- }());
6372
- PepInternalCaruselComponent.decorators = [
6373
- { type: core.Component, args: [{
6374
- selector: 'pep-internal-carusel',
6375
- 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>",
6376
- providers: [PepInternalCaruselService],
6377
- changeDetection: core.ChangeDetectionStrategy.OnPush,
6378
- 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}"]
6379
- },] }
6380
- ];
6381
- PepInternalCaruselComponent.ctorParameters = function () { return [
6382
- { type: forms.FormBuilder },
6383
- { type: ngxLib.PepLayoutService },
6384
- { type: PepInternalCaruselService },
6385
- { type: ngxLib.PepCustomizationService },
6386
- { type: core.ElementRef },
6387
- { type: core.ChangeDetectorRef }
6388
- ]; };
6389
- PepInternalCaruselComponent.propDecorators = {
6390
- field: [{ type: core.Input }],
6391
- layoutType: [{ type: core.Input }],
6392
- formValueChange: [{ type: core.Output }],
6393
- formFieldClick: [{ type: core.Output }],
6394
- carousel: [{ type: core.ViewChild, args: ['carousel', { read: carousel.PepCarouselComponent },] }]
6395
- };
6396
-
6397
6306
  var pepComponentsModules = [
6398
6307
  address.PepAddressModule,
6399
6308
  attachment.PepAttachmentModule,