ng-easycommerce 1.1.4 → 1.1.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.
- package/README.md +4 -0
- package/bundles/ng-easycommerce.umd.js +43 -15
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/blocks-ec/block-banner-boxes-ec/block-banner-boxes-ec.component.js +2 -2
- package/esm2015/lib/ec-component/blocks-ec/block-banner-full-ec/block-banner-full-ec.component.js +2 -2
- package/esm2015/lib/ec-directive/add-action-redirect.directive.js +23 -3
- package/esm2015/lib/interfaces/block.js +1 -1
- package/esm2015/lib/services/blocks/blocks.service.js +20 -12
- package/esm5/lib/ec-component/blocks-ec/block-banner-boxes-ec/block-banner-boxes-ec.component.js +2 -2
- package/esm5/lib/ec-component/blocks-ec/block-banner-full-ec/block-banner-full-ec.component.js +2 -2
- package/esm5/lib/ec-directive/add-action-redirect.directive.js +23 -3
- package/esm5/lib/interfaces/block.js +1 -1
- package/esm5/lib/services/blocks/blocks.service.js +20 -12
- package/fesm2015/ng-easycommerce.js +43 -15
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +43 -15
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/interfaces/block.d.ts +1 -1
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -8220,17 +8220,25 @@ var BlocksService = /** @class */ (function () {
|
|
|
8220
8220
|
? banner.translations[_this.consts.getLocale()].mobileImageName
|
|
8221
8221
|
: banner.translations[_this.consts.getLocale()].imageName); };
|
|
8222
8222
|
this.formUrl = function (banner) {
|
|
8223
|
-
var
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8223
|
+
var _a, _b, _c, _d;
|
|
8224
|
+
if (!banner)
|
|
8225
|
+
return '/';
|
|
8226
|
+
var type = String(banner.redirectionType || '').toLowerCase();
|
|
8227
|
+
var element = type === 'attribute'
|
|
8228
|
+
? 'attributes'
|
|
8229
|
+
: type === 'taxon' || type === 'category'
|
|
8230
|
+
? 'categories'
|
|
8231
|
+
: null;
|
|
8232
|
+
if (!element)
|
|
8233
|
+
return '/';
|
|
8234
|
+
var associations = element === 'categories' ? banner.taxons : banner.attributes;
|
|
8235
|
+
if (!Array.isArray(associations) || associations.length !== 1)
|
|
8236
|
+
return '/';
|
|
8237
|
+
var association = associations[0];
|
|
8238
|
+
var slug = ((_a = association) === null || _a === void 0 ? void 0 : _a.slug) || ((_d = (_c = (_b = association) === null || _b === void 0 ? void 0 : _b.translations) === null || _c === void 0 ? void 0 : _c[_this.consts.getLocale()]) === null || _d === void 0 ? void 0 : _d.slug);
|
|
8239
|
+
return typeof slug === 'string' && slug.trim()
|
|
8240
|
+
? '/collection/' + element + '/' + encodeURIComponent(slug.trim())
|
|
8241
|
+
: '/';
|
|
8234
8242
|
};
|
|
8235
8243
|
this.sendResponse = function (response_obj) {
|
|
8236
8244
|
return _this.connection.post(_this.contactFormResponseAPI(), _this.prepareData(response_obj));
|
|
@@ -9329,7 +9337,7 @@ var BlockBannerBoxesEcComponent = /** @class */ (function (_super) {
|
|
|
9329
9337
|
BlockBannerBoxesEcComponent = __decorate$J([
|
|
9330
9338
|
Component({
|
|
9331
9339
|
selector: 'app-block-banner-boxes-ec',
|
|
9332
|
-
template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid'\" *ngIf=\"banners.length\"\n [style.background-color]=\"meta.styles?.backgroundColor\"\n [style.background-image]=\"meta.styles?.backgroundImage ? 'url(' + consts.mediaUrl() + meta.styles?.backgroundImage +')' : 'inherit'\">\n\n\n <div class=\"block-boxes\">\n <div class=\"row\" *ngIf=\"meta.name\">\n <div class=\"col-12 mt-4\">\n <h2 class=\"font-weight-normal font-gd\">\n <span>{{meta.name}}</span>\n </h2>\n </div>\n </div>\n\n <!-- Si es formato fijo -->\n <ng-container *ngIf=\"meta.styles && meta.styles.carrousel == false ; else carrousel\">\n\n <div class=\"banner-content\">\n\n <div class=\"row g-0\">\n <div [class]=\"'item '+ ' col-md-6 ' + ' col-lg-' + (12/banners.length) \"\n *ngFor=\"let banner of banners; let i = index\" [id]=\"i\">\n <img class=\"img-fluid\" [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n <
|
|
9340
|
+
template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid'\" *ngIf=\"banners.length\"\n [style.background-color]=\"meta.styles?.backgroundColor\"\n [style.background-image]=\"meta.styles?.backgroundImage ? 'url(' + consts.mediaUrl() + meta.styles?.backgroundImage +')' : 'inherit'\">\n\n\n <div class=\"block-boxes\">\n <div class=\"row\" *ngIf=\"meta.name\">\n <div class=\"col-12 mt-4\">\n <h2 class=\"font-weight-normal font-gd\">\n <span>{{meta.name}}</span>\n </h2>\n </div>\n </div>\n\n <!-- Si es formato fijo -->\n <ng-container *ngIf=\"meta.styles && meta.styles.carrousel == false ; else carrousel\">\n\n <div class=\"banner-content\">\n\n <div class=\"row g-0\">\n <div [class]=\"'item '+ ' col-md-6 ' + ' col-lg-' + (12/banners.length) \"\n *ngFor=\"let banner of banners; let i = index\" [id]=\"i\">\n <a [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\" class=\"d-block\">\n <img class=\"img-fluid\" [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </a>\n <a [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\" class=\"position-absolute d-block w-100 top-0 start-0 h-100\">\n <h2 [class]=\"'item-title px-2 item-position-vertical-'+ (banner.styles?.description?.position)\" \n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000'\">\n {{banner.title}}\n </h2>\n <p *ngIf=\"banner.subtitle\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle item-position-vertical-' + (banner.styles?.description?.position)\">\n {{banner.subtitle}}\n </p>\n <div [class]=\"'item-position-vertical-' + (banner.styles?.button?.position)\">\n <span *ngIf=\"banner.styles?.button?.text\"\n [class]=\"'item-button btn btn-light'\">\n {{banner.styles.button.text}}\n </span>\n </div>\n </a>\n </div>\n\n </div>\n </div>\n\n </ng-container>\n\n <!-- Si es Carrousel -->\n <ng-template #carrousel>\n\n\n <!-- carrousel mobile -->\n <ng-container *ngIf=\"consts.mobile(); else carrouselNormal\">\n <div class=\"banner-content mobile carrousel\">\n\n <div class=\"row my-2\">\n\n <div class=\"col-12 item-carrousel\" *ngFor=\"let banner of banners; let i = index\" [id]=\"i\">\n <a [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\">\n <img class=\"img-fluid\" [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n <div class=\"position-absolute w-100 top-0 start-0 h-100\">\n <h2 *ngIf=\"banner.title\" [class]=\"'item-title-fullpx-2 item-position-vertical-'+ (banner.styles?.description?.position)\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#fff' \">\n {{banner.title}}\n </h2>\n <p *ngIf=\"banner.subtitle\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle item-position-vertical-' + (banner.styles?.description?.position)\">\n {{banner.subtitle}}\n </p>\n <div [class]=\"'item-position-vertical-' + (banner.styles?.button?.position)\">\n <span *ngIf=\"banner.styles?.button?.text\"\n [class]=\"'item-button btn btn-light'\">\n {{banner.styles.button.text}}\n </span>\n </div>\n </div>\n </a>\n\n </div>\n\n </div>\n </div>\n </ng-container>\n\n <!-- carrousel desktop -->\n <ng-template #carrouselNormal>\n\n <owl-carousel-o [options]=\"options\">\n <ng-template carouselSlide *ngFor=\"let banner of banners; let i = index\" [id]=\"i\">\n\n <div class=\"banner-content carrousel\">\n <a [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\" class=\"d-block\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </a>\n <a [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\" class=\"position-absolute d-block w-100 top-0 start-0 h-100\">\n <h2 *ngIf=\"banner.title\" \n [class]=\"'item-title-full px-2 item-position-vertical-'+ (banner.styles?.description?.position)\"\n style=\"color:#fff\">\n {{banner.title}}\n </h2>\n <p *ngIf=\"banner.subtitle\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle-full item-position-vertical-' + (banner.styles?.description?.position)\">\n {{banner.subtitle}}\n </p>\n <div [class]=\"'item-position-vertical-' + (banner.styles?.button?.position)\">\n <span *ngIf=\"banner.styles?.button?.text\"\n [style.background-color]=\"(banner.styles?.button?.color) ? banner.styles?.button?.color : '#fff' \"\n [class]=\"'item-button-full btn btn-light'\">\n {{banner.styles.button.text}}\n </span>\n </div>\n </a>\n </div>\n <!-- <div *ngIf=\"!banner.url; else externalUrl\" class=\"item-carrousel\">\n <a [routerLink]=\"formUrl(banner)\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\"></a>\n </div>\n <ng-template #externalUrl>\n <div class=\"item-carrousel\">\n <a href=\"{{banner.url}}\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n <div class=\"bottom-left\">\n {{banner.title}}\n </div>\n\n </a>\n </div>\n </ng-template> -->\n </ng-template>\n </owl-carousel-o>\n\n </ng-template>\n\n </ng-template>\n </div>\n</section>\n",
|
|
9333
9341
|
styles: [".item{position:relative}.item-title{top:30%}.item-title-full{top:50%}.item-subtitle-full{top:60%}.item-subtitle{top:40%}.item-button{top:60%}.item-button.item-position-vertical-center{left:50%;transform:translate(-50%)}.item-button.item-position-vertical-left{left:10%}.item-button.item-position-vertical-right{right:5%;transform:translate(-50%)}.item-button-full{top:70%}.item-button-full.item-position-vertical-center{left:50%;transform:translate(-50%)}.item-button-full.item-position-vertical-left{left:10%}.item-button-full.item-position-vertical-right{right:5%;transform:translate(-50%)}.item-position-vertical-left{text-align:left}.item-position-vertical-center{text-align:center}.item-position-vertical-right{text-align:right}h2.item-title-full::after{content:none}"]
|
|
9334
9342
|
})
|
|
9335
9343
|
], BlockBannerBoxesEcComponent);
|
|
@@ -9460,7 +9468,7 @@ var BlockBannerFullEcComponent = /** @class */ (function (_super) {
|
|
|
9460
9468
|
BlockBannerFullEcComponent = __decorate$K([
|
|
9461
9469
|
Component({
|
|
9462
9470
|
selector: 'app-block-banner-full-ec',
|
|
9463
|
-
template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid px-0'\" *ngIf=\"banners.length\"\n [style.background-color]=\"meta.styles?.backgroundColor\"\n [style.background-image]=\"meta.styles?.backgroundImage ? 'url(' + consts.mediaUrl() + meta.styles?.backgroundImage +')' : 'inherit'\">\n\n\n <!-- si es formato fijo -->\n <ng-container *ngIf=\"banners.length == 1;else carrousel \">\n\n <div class=\"row justify-content-center\">\n <!-- banner sin boton -->\n <a *ngIf=\"!banners[0].styles?.button?.text; else fullwithButton\"
|
|
9471
|
+
template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid px-0'\" *ngIf=\"banners.length\"\n [style.background-color]=\"meta.styles?.backgroundColor\"\n [style.background-image]=\"meta.styles?.backgroundImage ? 'url(' + consts.mediaUrl() + meta.styles?.backgroundImage +')' : 'inherit'\">\n\n\n <!-- si es formato fijo -->\n <ng-container *ngIf=\"banners.length == 1;else carrousel \">\n\n <div class=\"row justify-content-center\">\n <!-- banner sin boton -->\n <a *ngIf=\"!banners[0].styles?.button?.text; else fullwithButton\" [ecAddActionRedirect]=\"banners[0]\" [isTransparent]=\"false\">\n <div class=\"item col-12\">\n <img class=\"img-fluid\" [src]=\"consts.mediaBannerUrl() + getImage(banners[0])\" alt=\"\">\n <div class=\"position-absolute w-100 h-100 start-0 top-0\">\n <h2 *ngIf=\"banners[0].title\" [class]=\"'item-title-full px-2 item-position-vertical-' + (banners[0].styles?.description?.position)\"\n [style.color]=\"(banners[0].styles?.description?.color) ? banners[0].styles?.description?.color : '#fff' \">\n {{banners[0].title}}\n </h2>\n <p *ngIf=\"banners[0].subtitle\"\n [style.color]=\"(banners[0].styles?.description?.color) ? banners[0].styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle-full item-position-vertical-' + (banners[0].styles?.description?.position)\">\n {{banners[0].subtitle}}\n </p>\n </div>\n </div>\n </a>\n\n <!-- banner fijo con boton -->\n <ng-template #fullwithButton>\n <div class=\"item col-12\">\n <img class=\"img-fluid\" [src]=\"consts.mediaBannerUrl() + getImage(banners[0])\" alt=\"\">\n <div class=\"position-absolute w-100 h-100 start-0 top-0\">\n <h2 *ngIf=\"banners[0].title\" [class]=\"'item-title-full px-2 item-position-vertical-' + (banners[0].styles?.description?.position)\"\n [style.color]=\"(banners[0].styles?.description?.color) ? banners[0].styles?.description?.color : '#000' \">\n {{banners[0].title}}\n </h2>\n <p *ngIf=\"banners[0].subtitle\"\n [style.color]=\"(banners[0].styles?.description?.color) ? banners[0].styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle-full item-position-vertical-' + (banners[0].styles?.description?.position)\">\n {{banners[0].subtitle}}\n </p>\n <div [class]=\"'item-position-vertical-' + (banners[0].styles?.button?.position)\">\n <a *ngIf=\"banners[0].styles?.button?.text\" [ecAddActionRedirect]=\"banners[0]\" [isTransparent]=\"false\"\n [class]=\"'item-button-full btn btn-light '\">\n {{banners[0].styles.button.text}}\n </a>\n </div>\n </div>\n </div>\n\n </ng-template>\n </div>\n </ng-container>\n\n\n <!-- si es carrousel -->\n <ng-template #carrousel>\n\n <owl-carousel-o [options]=\"options\">\n <ng-template carouselSlide *ngFor=\"let banner of banners\" [id]=\"banner.id\">\n\n <!-- banner sin boton -->\n <div class=\"item\" *ngIf=\"!banner.styles?.button?.text; else carrouselwithButton\">\n <a *ngIf=\"banner.url || formUrl(banner) !== '/'; else onlyImage\" [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </a>\n <ng-template #onlyImage>\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </ng-template>\n </div>\n\n <!-- banner con boton -->\n <ng-template #carrouselwithButton>\n <div class=\"item\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n <div class=\"position-absolute w-100 h-100 start-0 top-0\">\n <h2 *ngIf=\"banner.title\"\n [class]=\"'item-title-full px-2 item-position-vertical-'+ (banner.styles?.description?.position)\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000' \">\n {{banner.title}}\n </h2>\n <p *ngIf=\"banner.subtitle\"\n [style.color]=\"(banner.styles?.description?.color) ? banner.styles?.description?.color : '#000' \"\n [class]=\"'px-4 item-subtitle-full item-position-vertical-' + (banner.styles?.description?.position)\">\n {{banner.subtitle}}\n </p>\n <div [class]=\"'item-position-vertical-' + (banner.styles?.button?.position)\">\n <a *ngIf=\"banner.styles?.button?.text\" [ecAddActionRedirect]=\"banner\" [isTransparent]=\"false\"\n [class]=\"'item-button-full btn btn-light'\">\n {{banner.styles.button.text}}\n </a>\n </div>\n </div>\n <!-- <a *ngIf=\"!banner.url && (formUrl(banner) != '/')\" [routerLink]=\"formUrl(banner)\"\n class=\"btn btn-outline-light rounded-0 py-3 px-4 btn-conoce btn-caption-banner\">\n Conocé Mas</a>\n <a *ngIf=\"banner.url\" href=\"{{banner.url}}\"\n class=\"btn btn-outline-light rounded-0 py-3 px-4 btn-conoce btn-caption-banner\">\n Conocé Mas</a> -->\n </div>\n </ng-template>\n\n\n <!-- <div class=\"item\">\n <a *ngIf=\"banner.url; else onlyImage\" href=\"{{banner.url}}\">\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </a>\n <ng-template #onlyImage>\n <img [src]=\"consts.mediaBannerUrl() + getImage(banner)\" alt=\"\">\n </ng-template>\n <div class=\"carousel-caption d-block\">\n <a *ngIf=\"!banner.url && (formUrl(banner) != '/')\" [routerLink]=\"formUrl(banner)\"\n class=\"btn btn-outline-light rounded-0 py-3 px-4 btn-conoce btn-caption-banner\">\n Conocé Mas</a>\n <a *ngIf=\"banner.url\" href=\"{{banner.url}}\"\n class=\"btn btn-outline-light rounded-0 py-3 px-4 btn-conoce btn-caption-banner\">\n Conocé Mas</a>\n </div>\n </div> -->\n </ng-template>\n </owl-carousel-o>\n </ng-template>\n</section>\n",
|
|
9464
9472
|
styles: [".owl-theme .owl-nav{background:0 0!important}.item{position:relative}.item-title{top:30%}.item-title-full{top:50%}.item-subtitle-full{top:60%}.item-subtitle{top:40%}.item-button{top:60%}.item-button.item-position-vertical-center{left:50%;transform:translate(-50%)}.item-button.item-position-vertical-left{left:10%}.item-button.item-position-vertical-right{right:5%;transform:translate(-50%)}.item-button-full{top:70%}.item-button-full.item-position-vertical-center{left:50%;transform:translate(-50%)}.item-button-full.item-position-vertical-left{left:10%}.item-button-full.item-position-vertical-right{right:5%;transform:translate(-50%)}.item-position-vertical-left{text-align:left}.item-position-vertical-center{text-align:center}.item-position-vertical-right{text-align:right}h2.item-title-full::after{content:none}"]
|
|
9465
9473
|
})
|
|
9466
9474
|
], BlockBannerFullEcComponent);
|
|
@@ -27184,7 +27192,7 @@ var AddActionRedirectDirective = /** @class */ (function () {
|
|
|
27184
27192
|
AddActionRedirectDirective.prototype.ngOnInit = function () { };
|
|
27185
27193
|
AddActionRedirectDirective.prototype.ngOnChanges = function (changes) {
|
|
27186
27194
|
var _this = this;
|
|
27187
|
-
var _a;
|
|
27195
|
+
var _a, _b, _c;
|
|
27188
27196
|
var element = this.elementRef.nativeElement;
|
|
27189
27197
|
var target = this.targetManaged ? this.originalTarget : element.getAttribute('target');
|
|
27190
27198
|
var rel = this.relManaged ? this.originalRel : element.getAttribute('rel');
|
|
@@ -27207,7 +27215,27 @@ var AddActionRedirectDirective = /** @class */ (function () {
|
|
|
27207
27215
|
console.log('add class directive -> ', error);
|
|
27208
27216
|
}
|
|
27209
27217
|
});
|
|
27210
|
-
|
|
27218
|
+
var configuredUrl = typeof ((_b = this.banner) === null || _b === void 0 ? void 0 : _b.url) === 'string' ? this.banner.url.trim() : '';
|
|
27219
|
+
var type = typeof ((_c = this.banner) === null || _c === void 0 ? void 0 : _c.redirectionType) === 'string'
|
|
27220
|
+
? this.banner.redirectionType.toLowerCase()
|
|
27221
|
+
: '';
|
|
27222
|
+
var hasConfiguredDestination = false;
|
|
27223
|
+
if (type === 'url') {
|
|
27224
|
+
this.redirectUrl = configuredUrl;
|
|
27225
|
+
hasConfiguredDestination = !!configuredUrl;
|
|
27226
|
+
}
|
|
27227
|
+
else if (type === 'attribute' || type === 'taxon' || type === 'category') {
|
|
27228
|
+
this.redirectUrl = this.blocksService.formUrl(this.banner);
|
|
27229
|
+
}
|
|
27230
|
+
else {
|
|
27231
|
+
// Keep the previous URL-first behavior for legacy payloads without a type.
|
|
27232
|
+
this.redirectUrl = configuredUrl || this.blocksService.formUrl(this.banner);
|
|
27233
|
+
hasConfiguredDestination = !!configuredUrl;
|
|
27234
|
+
}
|
|
27235
|
+
if (!this.redirectUrl || (this.redirectUrl === '/' && !hasConfiguredDestination)) {
|
|
27236
|
+
this.renderer.removeAttribute(element, 'href');
|
|
27237
|
+
return;
|
|
27238
|
+
}
|
|
27211
27239
|
var accessibleLabel = this.getAccessibleLabel();
|
|
27212
27240
|
if (accessibleLabel) {
|
|
27213
27241
|
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-label', accessibleLabel);
|