ng-easycommerce-v18 0.0.9 → 0.1.1
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/assets/ec-i18n/es.json +13 -1
- package/esm2022/lib/api/connection.service.mjs +6 -2
- package/esm2022/lib/constants/core.constants.service.mjs +2 -1
- package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +4 -1
- package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +11 -6
- package/esm2022/lib/ec-components/blocks-ec/block-form-contact-ec/block-form-contact-ec.component.mjs +5 -3
- package/esm2022/lib/ec-components/breadcrumb-ec/breadcrumb-ec.component.mjs +3 -2
- package/esm2022/lib/ec-components/cart-ec/cart-ec.component.mjs +13 -1
- package/esm2022/lib/ec-components/collection-ec/collection-ec.component.mjs +2 -2
- package/esm2022/lib/ec-components/coupon-ec/coupon-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/faqs-ec/faqs-ec.component.mjs +35 -0
- package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +11 -2
- package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +10 -8
- package/esm2022/lib/ec-components/index.mjs +6 -4
- package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +7 -1
- package/esm2022/lib/ec-components/related-products-ec/related-products-ec.component.mjs +43 -72
- package/esm2022/lib/ec-components/reviews-ec/reviews-ec.component.mjs +76 -0
- package/esm2022/lib/ec-components/reviews-form-ec/reviews-form-ec.component.mjs +135 -0
- package/esm2022/lib/ec-components/section-container-ec/section-container-ec.component.mjs +75 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/index.mjs +6 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-email-ec/share-email-ec.component.mjs +17 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-facebook-ec/share-facebook-ec.component.mjs +17 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-pinterest-ec/share-pinterest-ec.component.mjs +17 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-twitter-ec/share-twitter-ec.component.mjs +17 -0
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-whatsapp-ec/share-whatsapp-ec.component.mjs +17 -0
- package/esm2022/lib/ec-components/share-ec/share-ec.component.mjs +124 -0
- package/esm2022/lib/ec-components/sidebar-ec/sidebar-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/rating-ec/rating-ec.component.mjs +74 -0
- package/esm2022/lib/ec-services/auth.service.mjs +3 -3
- package/esm2022/lib/ec-services/cart.service.mjs +16 -1
- package/esm2022/lib/ec-services/filters.service.mjs +28 -13
- package/esm2022/lib/ec-services/options.service.mjs +30 -5
- package/esm2022/lib/ec-services/pagination.service.mjs +12 -5
- package/esm2022/lib/ec-services/products.service.mjs +4 -10
- package/esm2022/lib/ec-services/re-captcha.service.mjs +2 -2
- package/esm2022/lib/ec-services/reviews.service.mjs +98 -0
- package/esm2022/lib/interfaces/faqs.mjs +2 -0
- package/esm2022/lib/interfaces/filter.mjs +1 -1
- package/esm2022/lib/interfaces/index.mjs +2 -1
- package/fesm2022/ng-easycommerce-v18.mjs +830 -134
- package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
- package/lib/api/connection.service.d.ts +1 -0
- package/lib/constants/core.constants.service.d.ts +1 -0
- package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +1 -0
- package/lib/ec-components/blocks-ec/block-form-contact-ec/block-form-contact-ec.component.d.ts +1 -0
- package/lib/ec-components/cart-ec/cart-ec.component.d.ts +3 -0
- package/lib/ec-components/faqs-ec/faqs-ec.component.d.ts +14 -0
- package/lib/ec-components/filters-ec/filters-ec.component.d.ts +3 -0
- package/lib/ec-components/header-ec/header-ec.component.d.ts +1 -1
- package/lib/ec-components/index.d.ts +5 -0
- package/lib/ec-components/product-detail-ec/product-detail-ec.component.d.ts +2 -0
- package/lib/ec-components/related-products-ec/related-products-ec.component.d.ts +21 -24
- package/lib/ec-components/reviews-ec/reviews-ec.component.d.ts +34 -0
- package/lib/ec-components/reviews-form-ec/reviews-form-ec.component.d.ts +64 -0
- package/lib/ec-components/section-container-ec/section-container-ec.component.d.ts +22 -0
- package/lib/ec-components/share-ec/share-buttons-ec/index.d.ts +5 -0
- package/lib/ec-components/share-ec/share-buttons-ec/share-email-ec/share-email-ec.component.d.ts +6 -0
- package/lib/ec-components/share-ec/share-buttons-ec/share-facebook-ec/share-facebook-ec.component.d.ts +6 -0
- package/lib/ec-components/share-ec/share-buttons-ec/share-pinterest-ec/share-pinterest-ec.component.d.ts +6 -0
- package/lib/ec-components/share-ec/share-buttons-ec/share-twitter-ec/share-twitter-ec.component.d.ts +6 -0
- package/lib/ec-components/share-ec/share-buttons-ec/share-whatsapp-ec/share-whatsapp-ec.component.d.ts +6 -0
- package/lib/ec-components/share-ec/share-ec.component.d.ts +27 -0
- package/lib/ec-components/widgets-ec/rating-ec/rating-ec.component.d.ts +31 -0
- package/lib/ec-services/cart.service.d.ts +1 -0
- package/lib/ec-services/filters.service.d.ts +3 -1
- package/lib/ec-services/options.service.d.ts +10 -5
- package/lib/ec-services/pagination.service.d.ts +1 -0
- package/lib/ec-services/products.service.d.ts +1 -1
- package/lib/ec-services/reviews.service.d.ts +74 -0
- package/lib/interfaces/faqs.d.ts +12 -0
- package/lib/interfaces/filter.d.ts +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, ChangeDetectorRef, HostListener, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, EventEmitter, Output, forwardRef, afterRender, ViewChild, Injector, Directive, Inject } from '@angular/core';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, ChangeDetectorRef, HostListener, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, EventEmitter, Output, forwardRef, afterRender, ViewChild, Injector, Renderer2, Directive, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { isPlatformBrowser, DOCUMENT, AsyncPipe, CommonModule, TitleCasePipe, JsonPipe, UpperCasePipe, Location } from '@angular/common';
|
|
5
|
-
import { take, BehaviorSubject, shareReplay, map, catchError, of, filter, ReplaySubject, firstValueFrom, concatMap, switchMap, combineLatest
|
|
6
|
-
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
import { take, BehaviorSubject, shareReplay, map, catchError, of, filter, ReplaySubject, firstValueFrom, concatMap, throwError, switchMap, combineLatest } from 'rxjs';
|
|
6
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
7
7
|
import * as i1$1 from '@ngx-translate/core';
|
|
8
8
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
9
9
|
import { CookieService } from 'ngx-cookie-service';
|
|
@@ -22,7 +22,6 @@ import * as i1$2 from 'ng-recaptcha-2';
|
|
|
22
22
|
import { RecaptchaModule } from 'ng-recaptcha-2';
|
|
23
23
|
import { InfiniteScrollDirective } from 'ngx-infinite-scroll';
|
|
24
24
|
import * as he from 'he';
|
|
25
|
-
import { take as take$1 } from 'rxjs/operators';
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* Token para el provider de enviroment
|
|
@@ -168,6 +167,10 @@ class ConnectionService {
|
|
|
168
167
|
getWithFullUrl(fullurl) {
|
|
169
168
|
return this._http.get(fullurl);
|
|
170
169
|
}
|
|
170
|
+
getHTML(api) {
|
|
171
|
+
let httpHeaders = new HttpHeaders({ Accept: 'text/plain, text/html' });
|
|
172
|
+
return this._http.get(this.url + api, { responseType: 'text', headers: httpHeaders }).pipe(take(1));
|
|
173
|
+
}
|
|
171
174
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
172
175
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ConnectionService, providedIn: 'root' });
|
|
173
176
|
}
|
|
@@ -184,6 +187,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
184
187
|
* @class CoreConstantsService
|
|
185
188
|
*/
|
|
186
189
|
class CoreConstantsService {
|
|
190
|
+
searchValue = '';
|
|
187
191
|
/**
|
|
188
192
|
* Servicio que contiene las constantes usadas para la API
|
|
189
193
|
*/
|
|
@@ -439,6 +443,10 @@ class OptionsService {
|
|
|
439
443
|
*/
|
|
440
444
|
attributesApi(filter = '') { return `${this.SHOP_CHANNEL_API}product-search/attributes/?locale=${this.apiConstants.LOCALE}&limit=1&page=1${filter}`; }
|
|
441
445
|
;
|
|
446
|
+
faqsApi() { return 'cms/' + this.apiConstants.CHANNEL + '/faq'; }
|
|
447
|
+
;
|
|
448
|
+
pageContentByCodeApi = (code) => this.cmsBase() + '/' + this.constants.getChannel() + '/page/' + code;
|
|
449
|
+
cmsBase = () => 'cms/' + this.apiConstants.LOCALE;
|
|
442
450
|
constructor() { }
|
|
443
451
|
/**
|
|
444
452
|
* Obtiene las categorias del backend. Y los mapea para que sea mas amigable el manejo como menú.
|
|
@@ -495,10 +503,10 @@ class OptionsService {
|
|
|
495
503
|
}
|
|
496
504
|
return value.toLowerCase().replace(/\s+/g, '-').replace(/[^\w\-]+/g, '');
|
|
497
505
|
} /**
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
506
|
+
* Elimina los acentos
|
|
507
|
+
* @param str
|
|
508
|
+
* @returns
|
|
509
|
+
*/
|
|
502
510
|
removeAccents(str) {
|
|
503
511
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
504
512
|
}
|
|
@@ -650,6 +658,27 @@ class OptionsService {
|
|
|
650
658
|
}
|
|
651
659
|
return result;
|
|
652
660
|
};
|
|
661
|
+
getSectionContentByLink = (link) => this.connection.getHTML(this.pageContentByCodeApi(link)).pipe(map(html => html.split('</head>')[html.split('</head>').length - 1]), catchError(e => of(false)));
|
|
662
|
+
getFAQ() {
|
|
663
|
+
return this.connection.get(this.faqsApi()).pipe(map(response => {
|
|
664
|
+
let result = [];
|
|
665
|
+
response.forEach((response_faq) => {
|
|
666
|
+
let faqs = {
|
|
667
|
+
code: response_faq.code,
|
|
668
|
+
position: response_faq.position,
|
|
669
|
+
title: response_faq.translations[this.apiConstants.LOCALE].topic,
|
|
670
|
+
questions: response_faq.frequentlyAskedQuestions.map((asked_question) => ({
|
|
671
|
+
code: asked_question.code,
|
|
672
|
+
position: asked_question.position,
|
|
673
|
+
question: asked_question.translations[this.apiConstants.LOCALE] ? asked_question.translations[this.apiConstants.LOCALE].question : '',
|
|
674
|
+
answer: asked_question.translations[this.apiConstants.LOCALE] ? asked_question.translations[this.apiConstants.LOCALE].answer : '',
|
|
675
|
+
}))
|
|
676
|
+
};
|
|
677
|
+
result.push(faqs);
|
|
678
|
+
});
|
|
679
|
+
return result;
|
|
680
|
+
}));
|
|
681
|
+
}
|
|
653
682
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
654
683
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OptionsService, providedIn: 'root' });
|
|
655
684
|
}
|
|
@@ -2234,7 +2263,7 @@ class ReCaptchaService {
|
|
|
2234
2263
|
params$ = this._paramsService.getParameters();
|
|
2235
2264
|
params;
|
|
2236
2265
|
urlBaseFormat = '';
|
|
2237
|
-
testing = "
|
|
2266
|
+
testing = "easycommerce";
|
|
2238
2267
|
productionEnvironment = false;
|
|
2239
2268
|
recaptchaSiteKeysUrl = './assets/recaptcha/recaptcha-site-keys.json';
|
|
2240
2269
|
recaptchaSitesUrl = './assets/recaptcha/recaptcha-sites.json';
|
|
@@ -3063,7 +3092,7 @@ class AuthService {
|
|
|
3063
3092
|
return 'error';
|
|
3064
3093
|
}), catchError((error) => {
|
|
3065
3094
|
this._loggingInSubject.next(false);
|
|
3066
|
-
return
|
|
3095
|
+
return throwError(() => error); // <-- Propaga el error real
|
|
3067
3096
|
}));
|
|
3068
3097
|
}
|
|
3069
3098
|
/**
|
|
@@ -3427,6 +3456,7 @@ class FiltersService {
|
|
|
3427
3456
|
type: '',
|
|
3428
3457
|
limit: 0
|
|
3429
3458
|
};
|
|
3459
|
+
_filtersInitialized = false;
|
|
3430
3460
|
constructor() {
|
|
3431
3461
|
//this._defaultFilters = this._consts.getDefaultFilters()
|
|
3432
3462
|
}
|
|
@@ -3449,6 +3479,7 @@ class FiltersService {
|
|
|
3449
3479
|
const extra = filter.toUrlParams();
|
|
3450
3480
|
extra.split('=')[1] != '' ? extra_params += extra : null;
|
|
3451
3481
|
});
|
|
3482
|
+
console.log("extra_params", search_value);
|
|
3452
3483
|
if (search_value)
|
|
3453
3484
|
extra_params += ('&criteria[search][type]=contains&criteria[search][value]=' + search_value);
|
|
3454
3485
|
//console.log("extra_params",extra_params);
|
|
@@ -3467,7 +3498,7 @@ class FiltersService {
|
|
|
3467
3498
|
this._paginationSettings = paginationSettings;
|
|
3468
3499
|
return change;
|
|
3469
3500
|
}
|
|
3470
|
-
setFilters(paginationSettings) {
|
|
3501
|
+
setFilters(paginationSettings, search_value) {
|
|
3471
3502
|
this._paginationSettings = paginationSettings;
|
|
3472
3503
|
let final_filters = [];
|
|
3473
3504
|
if (this._optionsFilters?.includes('all'))
|
|
@@ -3482,22 +3513,35 @@ class FiltersService {
|
|
|
3482
3513
|
});
|
|
3483
3514
|
this._filtersSubject.next(final_filters);
|
|
3484
3515
|
}
|
|
3516
|
+
getFilters(paginationSettings) {
|
|
3517
|
+
if (this._filtersInitialized)
|
|
3518
|
+
return;
|
|
3519
|
+
this._filtersInitialized = true;
|
|
3520
|
+
const settings = paginationSettings || this._paginationSettings;
|
|
3521
|
+
let final_filters = [];
|
|
3522
|
+
if (this._optionsFilters?.includes('all'))
|
|
3523
|
+
this._optionsFilters = ['attributes', 'categories', 'dynamics', 'sort'];
|
|
3524
|
+
runInInjectionContext(this.environmentInjector, () => {
|
|
3525
|
+
const filterFactory = new FilterFactory();
|
|
3526
|
+
this._optionsFilters?.forEach(filter => final_filters.push(filterFactory.create(filter, settings)));
|
|
3527
|
+
});
|
|
3528
|
+
this._defaultFilters?.forEach(filterDefault => {
|
|
3529
|
+
let filter = final_filters.find(filter => filter.type() == filterDefault.filter_type);
|
|
3530
|
+
filter && filterDefault.codes.forEach(value => filter.setSelected(value));
|
|
3531
|
+
});
|
|
3532
|
+
return final_filters;
|
|
3533
|
+
}
|
|
3485
3534
|
getSpecificFilters(types) {
|
|
3486
3535
|
const filters = this._filtersSubject.value.filter(filter => types.includes(filter.type()));
|
|
3487
3536
|
return filters;
|
|
3488
3537
|
}
|
|
3489
3538
|
setFilterSelected(filterObj, filterElem) {
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
let index = final_filters.findIndex(filter => filter.type() == filterObj.type());
|
|
3497
|
-
final_filters[index].setSelected(filterElem, filterElem.value || filterElem.code);
|
|
3498
|
-
console.log(index, final_filters);
|
|
3499
|
-
this._filtersSubject.next(final_filters);
|
|
3500
|
-
}
|
|
3539
|
+
let final_filters = this._filtersSubject.value;
|
|
3540
|
+
let index = final_filters.findIndex(filter => filter.type() == filterObj.type());
|
|
3541
|
+
final_filters[index].setSelected(filterElem, filterElem.value || filterElem.code);
|
|
3542
|
+
console.log(index, final_filters);
|
|
3543
|
+
this._filtersSubject.next(final_filters);
|
|
3544
|
+
// }
|
|
3501
3545
|
}
|
|
3502
3546
|
updateFilters(paginationFilters) {
|
|
3503
3547
|
const claves = Object.keys(paginationFilters);
|
|
@@ -3535,9 +3579,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3535
3579
|
class PaginationService {
|
|
3536
3580
|
_connectionService = inject(ConnectionService);
|
|
3537
3581
|
_filtersService = inject(FiltersService);
|
|
3538
|
-
|
|
3582
|
+
_constants = inject(CoreConstantsService);
|
|
3583
|
+
paginationData$ = this._filtersService.filters$.pipe(shareReplay(1), filter(filters => filters && filters.length > 0), switchMap((filters) => {
|
|
3539
3584
|
const url = this.buildUrl(filters);
|
|
3540
|
-
console.log("pag", url);
|
|
3541
3585
|
return this.getData(url);
|
|
3542
3586
|
}));
|
|
3543
3587
|
_dataPagination = signal({
|
|
@@ -3666,7 +3710,13 @@ class PaginationService {
|
|
|
3666
3710
|
* @returns
|
|
3667
3711
|
*/
|
|
3668
3712
|
buildUrl(filters) {
|
|
3669
|
-
|
|
3713
|
+
console.log('entra aqui');
|
|
3714
|
+
if (this._constants.searchValue) {
|
|
3715
|
+
return this._filtersService.generateFinalApi(this._constants.searchValue);
|
|
3716
|
+
}
|
|
3717
|
+
else {
|
|
3718
|
+
return this._filtersService.generateFinalApi();
|
|
3719
|
+
}
|
|
3670
3720
|
}
|
|
3671
3721
|
/**
|
|
3672
3722
|
* Devuelve un observable de los productos que devolvio la última página obtenida.
|
|
@@ -3840,15 +3890,9 @@ class ProductsService {
|
|
|
3840
3890
|
getObjectWithVariant = () => {
|
|
3841
3891
|
return this._consts.getParamsProductsWithUniqueVariant();
|
|
3842
3892
|
};
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
// if (priceRangeFilter) {
|
|
3847
|
-
// (priceRangeFilter as PriceRangeFilter).updatePrices(min, max);
|
|
3848
|
-
// this.filtersSubject.next(final_filters);
|
|
3849
|
-
// }
|
|
3850
|
-
// }
|
|
3851
|
-
getRelatedProducts = (key) => this._connection.get(this.relatedProductsApi(key));
|
|
3893
|
+
getRelatedProducts(product_id) {
|
|
3894
|
+
return this._connection.get(this.relatedProductsApi(product_id));
|
|
3895
|
+
}
|
|
3852
3896
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3853
3897
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductsService, providedIn: 'root' });
|
|
3854
3898
|
}
|
|
@@ -4383,6 +4427,21 @@ class CartService {
|
|
|
4383
4427
|
}
|
|
4384
4428
|
getCreditAmount = () => this._balanceCustomerSubject.pipe(map((balanceCustomer) => balanceCustomer?.creditAmount ?? null));
|
|
4385
4429
|
getRemainingCredits = () => this._balanceCustomerSubject.pipe(map((balanceCustomer) => balanceCustomer?.remainingCredits));
|
|
4430
|
+
hasSufficientCreditsForCartTotal = () => {
|
|
4431
|
+
if (this._balanceCustomerSubject.value.creditAmount === null) {
|
|
4432
|
+
return true;
|
|
4433
|
+
}
|
|
4434
|
+
if (this._balanceCustomerSubject.value.remainingCredits === undefined) {
|
|
4435
|
+
return false;
|
|
4436
|
+
}
|
|
4437
|
+
const cartTotal = this._cartSubject.value?.totals?.total;
|
|
4438
|
+
const creditAmount = this._balanceCustomerSubject.value?.creditAmount;
|
|
4439
|
+
if (cartTotal !== undefined && creditAmount !== undefined && cartTotal > creditAmount) {
|
|
4440
|
+
this._toastService.show('not-enough-credits');
|
|
4441
|
+
return false;
|
|
4442
|
+
}
|
|
4443
|
+
return true;
|
|
4444
|
+
};
|
|
4386
4445
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4387
4446
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartService, providedIn: 'root' });
|
|
4388
4447
|
}
|
|
@@ -5383,6 +5442,7 @@ class MenuEcComponent {
|
|
|
5383
5442
|
optionsService = inject(OptionsService);
|
|
5384
5443
|
parametersService = inject(ParametersService);
|
|
5385
5444
|
_authService = inject(AuthService);
|
|
5445
|
+
_toastService = inject(ToastService);
|
|
5386
5446
|
/**
|
|
5387
5447
|
* Constantes del core.
|
|
5388
5448
|
*/
|
|
@@ -5452,6 +5512,7 @@ class MenuEcComponent {
|
|
|
5452
5512
|
}
|
|
5453
5513
|
logout() {
|
|
5454
5514
|
this._authService.logout();
|
|
5515
|
+
this._toastService.show('logout-success');
|
|
5455
5516
|
}
|
|
5456
5517
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5457
5518
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MenuEcComponent, isStandalone: true, selector: "lib-footer-ec", ngImport: i0, template: '<p>Menu and Footer Helper Component</p>', isInline: true });
|
|
@@ -5638,19 +5699,19 @@ class HeaderEcComponent extends MenuEcComponent {
|
|
|
5638
5699
|
return urlTransparent;
|
|
5639
5700
|
};
|
|
5640
5701
|
getCollectionSearch = () => {
|
|
5641
|
-
|
|
5642
|
-
|
|
5702
|
+
this.coreConstantsService.searchValue = this.searchValue;
|
|
5703
|
+
this.router.navigateByUrl('/collection?search=' + this.searchValue);
|
|
5643
5704
|
};
|
|
5644
5705
|
setSearchValue = (event, afterSearch, ...args) => {
|
|
5645
5706
|
const target = event.target;
|
|
5646
5707
|
if (target) {
|
|
5647
5708
|
this.searchValue = target.value;
|
|
5648
5709
|
}
|
|
5649
|
-
if (event.key === 'Enter') {
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
}
|
|
5710
|
+
// if (event.key === 'Enter') {
|
|
5711
|
+
// this.getCollectionSearch();
|
|
5712
|
+
if (afterSearch) {
|
|
5713
|
+
afterSearch(...args);
|
|
5714
|
+
// }
|
|
5654
5715
|
}
|
|
5655
5716
|
};
|
|
5656
5717
|
borrarInput(inputId) {
|
|
@@ -5670,6 +5731,8 @@ class HeaderEcComponent extends MenuEcComponent {
|
|
|
5670
5731
|
});
|
|
5671
5732
|
}
|
|
5672
5733
|
this.searchValue = '';
|
|
5734
|
+
this.coreConstantsService.searchValue = '';
|
|
5735
|
+
this.getCollectionSearch();
|
|
5673
5736
|
}
|
|
5674
5737
|
setupMobileMenu() {
|
|
5675
5738
|
console.log('setupMobileMenu called');
|
|
@@ -6617,6 +6680,7 @@ class BlockFormContactEcComponent extends BlockEcComponent {
|
|
|
6617
6680
|
_router = inject(Router);
|
|
6618
6681
|
form_data = new FormData();
|
|
6619
6682
|
loading = false;
|
|
6683
|
+
sender = false;
|
|
6620
6684
|
form = signal(this._formBuilder.group({
|
|
6621
6685
|
name: ['', []],
|
|
6622
6686
|
email: ['', Validators.required],
|
|
@@ -6660,6 +6724,7 @@ class BlockFormContactEcComponent extends BlockEcComponent {
|
|
|
6660
6724
|
sendValue(key) {
|
|
6661
6725
|
try {
|
|
6662
6726
|
let keysearch = key[0].toUpperCase() + key.slice(1).toLowerCase();
|
|
6727
|
+
this.sender = true;
|
|
6663
6728
|
return this.block && this.block['send' + keysearch] || false;
|
|
6664
6729
|
}
|
|
6665
6730
|
catch (error) {
|
|
@@ -6668,11 +6733,11 @@ class BlockFormContactEcComponent extends BlockEcComponent {
|
|
|
6668
6733
|
}
|
|
6669
6734
|
}
|
|
6670
6735
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BlockFormContactEcComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6671
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: BlockFormContactEcComponent, isStandalone: true, selector: "app-block-form-contact-ec", inputs: { block: "block", success_message: "success_message", redirect: "redirect", subject: "subject" }, usesInheritance: true, ngImport: i0, template: "@if(block){\r\n<div [class]=\"trimClassBlock(block.code) + ' container-fluid'\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-12\">\r\n <div class=\"row w-100 m-auto\">\r\n <h5>{{block.name || 'Dejanos tu consulta'}}</h5>\r\n <p class=\"w-100\">{{ block.description || 'Completa el siguiente formulario y responderemos tu consulta a la brevedad' }}</p>\r\n </div>\r\n <form [formGroup]=\"form()\" (submit)=\"onSubmit($event)\" class=\"position-relative\" ><!-- (submit)=\"toastCompleteForm($event)\" -->\r\n @if(block.sendName){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"nombre\">Nombre</label>\r\n <input formControlName=\"name\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"nombre\" placeholder=\"Nombre\">\r\n </div>\r\n }\r\n @if(block.sendEmail){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"mail\">Email</label>\r\n <input formControlName=\"email\" type=\"email\"\r\n class=\"form-control form-control-sm required\" id=\"mail\" placeholder=\"Email\">\r\n </div>\r\n }\r\n @if(block.sendTelephone){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"telefono\">Tel\u00E9fono</label>\r\n <input formControlName=\"telephone\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"telefono\" placeholder=\"Tel\u00E9fono\">\r\n </div>\r\n }\r\n @if(block.sendSubject){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"subject\">Asunto</label>\r\n <input formControlName=\"subject\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"subject\" placeholder=\"Asunto\">\r\n </div>\r\n }\r\n @if(block.sendBody){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"mensaje\">Mensaje</label>\r\n <textarea formControlName=\"body\" name=\"mensaje\" id=\"mensaje \" cols=\"30\"\r\n rows=\"5\" placeholder=\"Dejanos tu mensaje\"\r\n class=\"form-control form-control-sm required\"></textarea>\r\n </div>\r\n }\r\n <div class=\"boxContenidoCapcha mb-3\">\r\n <div class=\"contenedorCaptcha\">\r\n <re-captcha-ec formControlName=\"recaptcha\"></re-captcha-ec>\r\n </div>\r\n </div>\r\n\r\n <button type=\"submit\" class=\"btn btn-dark text-uppercase px-5\"\r\n [disabled]=\"form().invalid\">ENVIAR</button>\r\n @if(loading){\r\n <app-loading-section-ec
|
|
6736
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: BlockFormContactEcComponent, isStandalone: true, selector: "app-block-form-contact-ec", inputs: { block: "block", success_message: "success_message", redirect: "redirect", subject: "subject" }, usesInheritance: true, ngImport: i0, template: "@if(block){\r\n<div [class]=\"trimClassBlock(block.code) + ' container-fluid'\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-12\">\r\n <div class=\"row w-100 m-auto\">\r\n <h5>{{block.name || 'Dejanos tu consulta'}}</h5>\r\n <p class=\"w-100\">{{ block.description || 'Completa el siguiente formulario y responderemos tu consulta a la brevedad' }}</p>\r\n </div>\r\n <form [formGroup]=\"form()\" (submit)=\"onSubmit($event)\" class=\"position-relative\" ><!-- (submit)=\"toastCompleteForm($event)\" -->\r\n @if(block.sendName){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"nombre\">Nombre</label>\r\n <input formControlName=\"name\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"nombre\" placeholder=\"Nombre\">\r\n </div>\r\n }\r\n @if(block.sendEmail){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"mail\">Email</label>\r\n <input formControlName=\"email\" type=\"email\"\r\n class=\"form-control form-control-sm required\" id=\"mail\" placeholder=\"Email\">\r\n </div>\r\n }\r\n @if(block.sendTelephone){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"telefono\">Tel\u00E9fono</label>\r\n <input formControlName=\"telephone\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"telefono\" placeholder=\"Tel\u00E9fono\">\r\n </div>\r\n }\r\n @if(block.sendSubject){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"subject\">Asunto</label>\r\n <input formControlName=\"subject\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"subject\" placeholder=\"Asunto\">\r\n </div>\r\n }\r\n @if(block.sendBody){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"mensaje\">Mensaje</label>\r\n <textarea formControlName=\"body\" name=\"mensaje\" id=\"mensaje \" cols=\"30\"\r\n rows=\"5\" placeholder=\"Dejanos tu mensaje\"\r\n class=\"form-control form-control-sm required\"></textarea>\r\n </div>\r\n }\r\n <div class=\"boxContenidoCapcha mb-3 mt-1\">\r\n <div class=\"contenedorCaptcha\">\r\n <re-captcha-ec formControlName=\"recaptcha\"></re-captcha-ec>\r\n </div>\r\n </div>\r\n\r\n <button type=\"submit\" class=\"btn btn-dark text-uppercase px-5\"\r\n [disabled]=\"form().invalid\">ENVIAR</button>\r\n @if(loading){\r\n <app-loading-section-ec/>\r\n }\r\n </form>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: LoadingSectionEcComponent, selector: "app-loading-section-ec" }, { kind: "component", type: ReCaptchaEcComponent, selector: "re-captcha-ec", inputs: ["siteKey"] }] });
|
|
6672
6737
|
}
|
|
6673
6738
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BlockFormContactEcComponent, decorators: [{
|
|
6674
6739
|
type: Component,
|
|
6675
|
-
args: [{ selector: 'app-block-form-contact-ec', standalone: true, imports: [ReactiveFormsModule, LoadingSectionEcComponent, ReCaptchaEcComponent], template: "@if(block){\r\n<div [class]=\"trimClassBlock(block.code) + ' container-fluid'\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-12\">\r\n <div class=\"row w-100 m-auto\">\r\n <h5>{{block.name || 'Dejanos tu consulta'}}</h5>\r\n <p class=\"w-100\">{{ block.description || 'Completa el siguiente formulario y responderemos tu consulta a la brevedad' }}</p>\r\n </div>\r\n <form [formGroup]=\"form()\" (submit)=\"onSubmit($event)\" class=\"position-relative\" ><!-- (submit)=\"toastCompleteForm($event)\" -->\r\n @if(block.sendName){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"nombre\">Nombre</label>\r\n <input formControlName=\"name\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"nombre\" placeholder=\"Nombre\">\r\n </div>\r\n }\r\n @if(block.sendEmail){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"mail\">Email</label>\r\n <input formControlName=\"email\" type=\"email\"\r\n class=\"form-control form-control-sm required\" id=\"mail\" placeholder=\"Email\">\r\n </div>\r\n }\r\n @if(block.sendTelephone){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"telefono\">Tel\u00E9fono</label>\r\n <input formControlName=\"telephone\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"telefono\" placeholder=\"Tel\u00E9fono\">\r\n </div>\r\n }\r\n @if(block.sendSubject){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"subject\">Asunto</label>\r\n <input formControlName=\"subject\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"subject\" placeholder=\"Asunto\">\r\n </div>\r\n }\r\n @if(block.sendBody){\r\n <div class=\"form-group\">\r\n <label class=\"sr-only\" for=\"mensaje\">Mensaje</label>\r\n <textarea formControlName=\"body\" name=\"mensaje\" id=\"mensaje \" cols=\"30\"\r\n rows=\"5\" placeholder=\"Dejanos tu mensaje\"\r\n class=\"form-control form-control-sm required\"></textarea>\r\n </div>\r\n }\r\n <div class=\"boxContenidoCapcha mb-3\">\r\n <div class=\"contenedorCaptcha\">\r\n <re-captcha-ec formControlName=\"recaptcha\"></re-captcha-ec>\r\n </div>\r\n </div>\r\n\r\n <button type=\"submit\" class=\"btn btn-dark text-uppercase px-5\"\r\n [disabled]=\"form().invalid\">ENVIAR</button>\r\n @if(loading){\r\n <app-loading-section-ec
|
|
6740
|
+
args: [{ selector: 'app-block-form-contact-ec', standalone: true, imports: [ReactiveFormsModule, LoadingSectionEcComponent, ReCaptchaEcComponent], template: "@if(block){\r\n<div [class]=\"trimClassBlock(block.code) + ' container-fluid'\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-12\">\r\n <div class=\"row w-100 m-auto\">\r\n <h5>{{block.name || 'Dejanos tu consulta'}}</h5>\r\n <p class=\"w-100\">{{ block.description || 'Completa el siguiente formulario y responderemos tu consulta a la brevedad' }}</p>\r\n </div>\r\n <form [formGroup]=\"form()\" (submit)=\"onSubmit($event)\" class=\"position-relative\" ><!-- (submit)=\"toastCompleteForm($event)\" -->\r\n @if(block.sendName){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"nombre\">Nombre</label>\r\n <input formControlName=\"name\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"nombre\" placeholder=\"Nombre\">\r\n </div>\r\n }\r\n @if(block.sendEmail){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"mail\">Email</label>\r\n <input formControlName=\"email\" type=\"email\"\r\n class=\"form-control form-control-sm required\" id=\"mail\" placeholder=\"Email\">\r\n </div>\r\n }\r\n @if(block.sendTelephone){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"telefono\">Tel\u00E9fono</label>\r\n <input formControlName=\"telephone\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"telefono\" placeholder=\"Tel\u00E9fono\">\r\n </div>\r\n }\r\n @if(block.sendSubject){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"subject\">Asunto</label>\r\n <input formControlName=\"subject\" type=\"text\"\r\n class=\"form-control form-control-sm required\" id=\"subject\" placeholder=\"Asunto\">\r\n </div>\r\n }\r\n @if(block.sendBody){\r\n <div class=\"form-group mt-1\">\r\n <label class=\"sr-only\" for=\"mensaje\">Mensaje</label>\r\n <textarea formControlName=\"body\" name=\"mensaje\" id=\"mensaje \" cols=\"30\"\r\n rows=\"5\" placeholder=\"Dejanos tu mensaje\"\r\n class=\"form-control form-control-sm required\"></textarea>\r\n </div>\r\n }\r\n <div class=\"boxContenidoCapcha mb-3 mt-1\">\r\n <div class=\"contenedorCaptcha\">\r\n <re-captcha-ec formControlName=\"recaptcha\"></re-captcha-ec>\r\n </div>\r\n </div>\r\n\r\n <button type=\"submit\" class=\"btn btn-dark text-uppercase px-5\"\r\n [disabled]=\"form().invalid\">ENVIAR</button>\r\n @if(loading){\r\n <app-loading-section-ec/>\r\n }\r\n </form>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n}" }]
|
|
6676
6741
|
}], propDecorators: { block: [{
|
|
6677
6742
|
type: Input,
|
|
6678
6743
|
args: [{ required: true }]
|
|
@@ -6816,7 +6881,7 @@ class CollectionEcComponent {
|
|
|
6816
6881
|
value: params['value'] || null
|
|
6817
6882
|
};
|
|
6818
6883
|
//console.log(ready,"actualizar")
|
|
6819
|
-
console.log(
|
|
6884
|
+
console.log(paginationSettings);
|
|
6820
6885
|
/* console.log(paginationSettings) */
|
|
6821
6886
|
// console.log('params',queryParams["search"])
|
|
6822
6887
|
this._productsService.getProductsForFilter(paginationSettings, queryParams["search"]);
|
|
@@ -6912,19 +6977,24 @@ class LoginFormEcComponent {
|
|
|
6912
6977
|
return;
|
|
6913
6978
|
}
|
|
6914
6979
|
firstValueFrom(this._authService.login(this.loginForm().value, withRoles)).then((res) => {
|
|
6915
|
-
console.log(res);
|
|
6916
6980
|
if (res == 'ok') {
|
|
6917
6981
|
this.ready.emit(this.loginForm().value.username);
|
|
6982
|
+
this._toastService.show('login-success');
|
|
6918
6983
|
this.loggedIn = true;
|
|
6919
6984
|
this.redirect && this.redirectHome();
|
|
6920
6985
|
}
|
|
6921
|
-
else {
|
|
6922
|
-
|
|
6923
|
-
this._toastService.error('invalid-credentials');
|
|
6924
|
-
}
|
|
6986
|
+
else if (res == 'error') {
|
|
6987
|
+
this._toastService.error('login-error');
|
|
6925
6988
|
}
|
|
6926
6989
|
this.loading = false;
|
|
6927
6990
|
}, (err) => {
|
|
6991
|
+
// Manejo de error 401
|
|
6992
|
+
if (err?.status === 401) {
|
|
6993
|
+
this._toastService.show('invalid-credentials');
|
|
6994
|
+
}
|
|
6995
|
+
else {
|
|
6996
|
+
this._toastService.error('login-error');
|
|
6997
|
+
}
|
|
6928
6998
|
this.loading = false;
|
|
6929
6999
|
});
|
|
6930
7000
|
}
|
|
@@ -7274,6 +7344,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7274
7344
|
|
|
7275
7345
|
class FiltersEcComponent {
|
|
7276
7346
|
_filtersService = inject(FiltersService);
|
|
7347
|
+
_productsService = inject(ProductsService);
|
|
7348
|
+
_constants = inject(CoreConstantsService);
|
|
7349
|
+
router = inject(Router);
|
|
7277
7350
|
filters = [];
|
|
7278
7351
|
filter$ = this._filtersService.filters$;
|
|
7279
7352
|
setSelect;
|
|
@@ -7314,7 +7387,10 @@ class FiltersEcComponent {
|
|
|
7314
7387
|
console.log("Setting selected filter:", filter);
|
|
7315
7388
|
console.log("Setting selected element:", selected);
|
|
7316
7389
|
try {
|
|
7317
|
-
this._filtersService.setFilterSelected(filter, selected);
|
|
7390
|
+
// this._filtersService.setFilterSelected(filter, selected);
|
|
7391
|
+
if (selected.path) {
|
|
7392
|
+
this.router.navigate([selected.path]);
|
|
7393
|
+
}
|
|
7318
7394
|
}
|
|
7319
7395
|
catch (error) {
|
|
7320
7396
|
console.error("Error while setting selected filter:", error);
|
|
@@ -7430,6 +7506,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7430
7506
|
}] } });
|
|
7431
7507
|
|
|
7432
7508
|
class ProductDetailEcComponent {
|
|
7509
|
+
_optionsService = inject(OptionsService);
|
|
7433
7510
|
_productDetailService = inject(ProductDetailService);
|
|
7434
7511
|
_productService = inject(ProductsService);
|
|
7435
7512
|
_activedRoute = inject(ActivatedRoute);
|
|
@@ -7450,6 +7527,7 @@ class ProductDetailEcComponent {
|
|
|
7450
7527
|
showReviews = false;
|
|
7451
7528
|
reset = false;
|
|
7452
7529
|
success = false;
|
|
7530
|
+
categories = [];
|
|
7453
7531
|
quantity = signal(1);
|
|
7454
7532
|
parameters$ = this.parametersService.getParameters();
|
|
7455
7533
|
hasParams = this.parametersService.hasParams;
|
|
@@ -7465,6 +7543,9 @@ class ProductDetailEcComponent {
|
|
|
7465
7543
|
this.injector.get(ChannelService).channel$.subscribe(channel => {
|
|
7466
7544
|
this.showReviews = channel.showReviews;
|
|
7467
7545
|
});
|
|
7546
|
+
this._optionsService.getCategories().subscribe(res => {
|
|
7547
|
+
this.categories = res;
|
|
7548
|
+
});
|
|
7468
7549
|
}
|
|
7469
7550
|
ngOnInit() {
|
|
7470
7551
|
this.product$.subscribe(product => {
|
|
@@ -7572,11 +7653,12 @@ class BreadcrumbEcComponent {
|
|
|
7572
7653
|
}
|
|
7573
7654
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbEcComponent, decorators: [{
|
|
7574
7655
|
type: Component,
|
|
7575
|
-
args: [{ selector: 'app-breadcrumb-ec', standalone: true, imports: [RouterLink, RouterLinkActive, TitleCasePipe, TranslateModule], template: "<nav aria-label=\"breadcrumb\">\r\n <ol class=\"breadcrumb\">\r\n <li class=\"breadcrumb-item\"><a routerLink=\"/home\">Home</a></li>\r\n @for (crumb of breadcrumb; track $index) {\r\n @if(breadcrumb.length === $index+1){\r\n <li class=\"breadcrumb-item active\" aria-current=\"page\">\r\n {{\r\n crumb.title | translate | titlecase\r\n }}\r\n </li>\r\n }@else {\r\n <li class=\"breadcrumb-item\">\r\n <a [routerLink]=\"'/'+crumb.path\">{{\r\n crumb.title | translate | titlecase\r\n }}</a>\r\n </li>\r\n }\r\n }\r\n </ol>\r\n</nav>" }]
|
|
7656
|
+
args: [{ selector: 'app-breadcrumb-ec', standalone: true, imports: [RouterLink, RouterLinkActive, TitleCasePipe, TranslateModule, JsonPipe], template: "<nav aria-label=\"breadcrumb\">\r\n <ol class=\"breadcrumb\">\r\n <li class=\"breadcrumb-item\"><a routerLink=\"/home\">Home</a></li>\r\n @for (crumb of breadcrumb; track $index) {\r\n @if(breadcrumb.length === $index+1){\r\n <li class=\"breadcrumb-item active\" aria-current=\"page\">\r\n {{\r\n crumb.title | translate | titlecase\r\n }}\r\n </li>\r\n }@else {\r\n <li class=\"breadcrumb-item\">\r\n <a [routerLink]=\"'/'+crumb.path\">{{\r\n crumb.title | translate | titlecase\r\n }}</a>\r\n </li>\r\n }\r\n }\r\n </ol>\r\n</nav>" }]
|
|
7576
7657
|
}], ctorParameters: () => [] });
|
|
7577
7658
|
|
|
7578
7659
|
class CartEcComponent {
|
|
7579
7660
|
_cartService = inject(CartService);
|
|
7661
|
+
router = inject(Router);
|
|
7580
7662
|
cartItems$ = this._cartService.cartItems$;
|
|
7581
7663
|
subTotalAmount$ = this._cartService.getSubTotalAmount();
|
|
7582
7664
|
totalPromotionAmount$ = this._cartService.getTotalPromotionAmount();
|
|
@@ -7587,6 +7669,16 @@ class CartEcComponent {
|
|
|
7587
7669
|
removeCoupon() {
|
|
7588
7670
|
this._cartService.removeCoupon();
|
|
7589
7671
|
}
|
|
7672
|
+
redirectCheckout() {
|
|
7673
|
+
if (this._cartService.hasSufficientCreditsForCartTotal()) {
|
|
7674
|
+
this.router.navigateByUrl(`/checkout`);
|
|
7675
|
+
return true;
|
|
7676
|
+
}
|
|
7677
|
+
else {
|
|
7678
|
+
console.warn("No se puede redirigir al checkout debido a una validación fallida.");
|
|
7679
|
+
return false;
|
|
7680
|
+
}
|
|
7681
|
+
}
|
|
7590
7682
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7591
7683
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: CartEcComponent, isStandalone: true, selector: "lib-cart-ec", ngImport: i0, template: "<p>cart-ec works!</p>\r\n", styles: [""] });
|
|
7592
7684
|
}
|
|
@@ -7726,11 +7818,11 @@ class CouponEcComponent {
|
|
|
7726
7818
|
this._cartService.removeCoupon();
|
|
7727
7819
|
}
|
|
7728
7820
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CouponEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7729
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CouponEcComponent, isStandalone: true, selector: "app-coupon-ec", ngImport: i0, template: "<div class=\"border-bottom
|
|
7821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CouponEcComponent, isStandalone: true, selector: "app-coupon-ec", ngImport: i0, template: "<div class=\"border border-bottom card p-2\">\r\n <p class=\"w-100 mb-1\">C\u00F3digo de descuento</p>\r\n \r\n @if(coupon$ | async; as coupon){\r\n <div class=\"d-flex justify-content-between align-items-center px-1\">\r\n <p class=\"m-0\">{{coupon.code | uppercase}}</p>\r\n <button class=\"btn\" (click)=\"removeCoupon()\"><i class=\"bi bi-trash\"></i></button>\r\n </div>\r\n }@else {\r\n <form class=\"campo d-flex align-items-center\">\r\n <input type='text' class=\"elcampo\" [(ngModel)]=\"couponValue\" name=\"coupon_value\" />\r\n <input type='button' value='VALIDAR' class=\"btn btn-primary btnSend py-1\"\r\n (click)=\" addCoupon()\" />\r\n </form> \r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }] });
|
|
7730
7822
|
}
|
|
7731
7823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CouponEcComponent, decorators: [{
|
|
7732
7824
|
type: Component,
|
|
7733
|
-
args: [{ selector: 'app-coupon-ec', standalone: true, imports: [
|
|
7825
|
+
args: [{ selector: 'app-coupon-ec', standalone: true, imports: [AsyncPipe, FormsModule, UpperCasePipe], template: "<div class=\"border border-bottom card p-2\">\r\n <p class=\"w-100 mb-1\">C\u00F3digo de descuento</p>\r\n \r\n @if(coupon$ | async; as coupon){\r\n <div class=\"d-flex justify-content-between align-items-center px-1\">\r\n <p class=\"m-0\">{{coupon.code | uppercase}}</p>\r\n <button class=\"btn\" (click)=\"removeCoupon()\"><i class=\"bi bi-trash\"></i></button>\r\n </div>\r\n }@else {\r\n <form class=\"campo d-flex align-items-center\">\r\n <input type='text' class=\"elcampo\" [(ngModel)]=\"couponValue\" name=\"coupon_value\" />\r\n <input type='button' value='VALIDAR' class=\"btn btn-primary btnSend py-1\"\r\n (click)=\" addCoupon()\" />\r\n </form> \r\n }\r\n</div>" }]
|
|
7734
7826
|
}] });
|
|
7735
7827
|
|
|
7736
7828
|
class DataformEcComponent {
|
|
@@ -8761,45 +8853,35 @@ class SidebarEcComponent {
|
|
|
8761
8853
|
throw new Error('Method not implemented.');
|
|
8762
8854
|
}
|
|
8763
8855
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SidebarEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8764
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SidebarEcComponent, isStandalone: true, selector: "app-sidebar-ec", ngImport: i0, template: "<div class=\"nav nav-sidebar py-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi pedido</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column
|
|
8856
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SidebarEcComponent, isStandalone: true, selector: "app-sidebar-ec", ngImport: i0, template: "<div class=\"nav nav-sidebar py-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi pedido</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column mb-4 items border-bottom\">\r\n @for(item of items; track $index; let i = $index){\r\n <div class=\"productoCarrito mt-1 mb-2 w-100\">\r\n <app-cart-item-ec [inSidebar]=\"true\" [item]=\"item\"></app-cart-item-ec>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mt-2 \">\r\n <p class=\"fw-bold\">Subtotal</p>\r\n <p class=\"fw-700\">{{ (subTotalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"mx-4 bordeBot py-2\">\r\n <app-coupon-ec></app-coupon-ec>\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2 mt-2\">\r\n <p class=\"fw-bold\">Descuentos:</p>\r\n <p>{{ (totalPromotionAmount$ | async) |ecCurrencySymbol }}</p>\r\n </div>\r\n\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2 pt-2\">\r\n <!-- @if(this._cartService.cart.source.value.couponCode){\r\n <a class=\"quitar-cupon text-dark\" role=\"button\"\r\n (click)=\"removeCoupon()\">(Quitar cup\u00F3n)</a>\r\n } -->\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mb-3 mt-2\">\r\n <p class=\"fw-bold h5\">TOTAL</p>\r\n <p class=\"fw-bold h5\">{{(totalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"d-flex flex-column mx-4 justify-content-between mb-3\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <a [routerLink]=\"['/cart']\" class=\"btn btnPedido mb-2\">FINALIZAR PEDIDO</a>\r\n <a [routerLink]=\"['/collection']\" class=\"btn btnSeguir mb-3\">SEGUIR COMPRANDO</a>\r\n </div>\r\n\r\n\r\n } @else {\r\n <div class=\"container-lg px-lg-0 px-md-4 my-5\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <h5 class=\"text-center mb-sm-4 text-uppercase\"> \u00B7 Su carrito se\r\n encuentra vac\u00EDo \u00B7 </h5>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n}", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: CouponEcComponent, selector: "app-coupon-ec" }, { kind: "component", type: CartItemEcComponent, selector: "app-cart-item-ec", inputs: ["item", "inSidebar"] }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }] });
|
|
8765
8857
|
}
|
|
8766
8858
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SidebarEcComponent, decorators: [{
|
|
8767
8859
|
type: Component,
|
|
8768
|
-
args: [{ selector: 'app-sidebar-ec', standalone: true, imports: [RouterLink, AsyncPipe, CouponEcComponent, CartItemEcComponent, EcCurrencySymbolPipe], template: "<div class=\"nav nav-sidebar py-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi pedido</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column
|
|
8860
|
+
args: [{ selector: 'app-sidebar-ec', standalone: true, imports: [RouterLink, AsyncPipe, CouponEcComponent, CartItemEcComponent, EcCurrencySymbolPipe, CouponEcComponent], template: "<div class=\"nav nav-sidebar py-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi pedido</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column mb-4 items border-bottom\">\r\n @for(item of items; track $index; let i = $index){\r\n <div class=\"productoCarrito mt-1 mb-2 w-100\">\r\n <app-cart-item-ec [inSidebar]=\"true\" [item]=\"item\"></app-cart-item-ec>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mt-2 \">\r\n <p class=\"fw-bold\">Subtotal</p>\r\n <p class=\"fw-700\">{{ (subTotalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"mx-4 bordeBot py-2\">\r\n <app-coupon-ec></app-coupon-ec>\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2 mt-2\">\r\n <p class=\"fw-bold\">Descuentos:</p>\r\n <p>{{ (totalPromotionAmount$ | async) |ecCurrencySymbol }}</p>\r\n </div>\r\n\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2 pt-2\">\r\n <!-- @if(this._cartService.cart.source.value.couponCode){\r\n <a class=\"quitar-cupon text-dark\" role=\"button\"\r\n (click)=\"removeCoupon()\">(Quitar cup\u00F3n)</a>\r\n } -->\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mb-3 mt-2\">\r\n <p class=\"fw-bold h5\">TOTAL</p>\r\n <p class=\"fw-bold h5\">{{(totalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"d-flex flex-column mx-4 justify-content-between mb-3\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <a [routerLink]=\"['/cart']\" class=\"btn btnPedido mb-2\">FINALIZAR PEDIDO</a>\r\n <a [routerLink]=\"['/collection']\" class=\"btn btnSeguir mb-3\">SEGUIR COMPRANDO</a>\r\n </div>\r\n\r\n\r\n } @else {\r\n <div class=\"container-lg px-lg-0 px-md-4 my-5\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <h5 class=\"text-center mb-sm-4 text-uppercase\"> \u00B7 Su carrito se\r\n encuentra vac\u00EDo \u00B7 </h5>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n}" }]
|
|
8769
8861
|
}] });
|
|
8770
8862
|
|
|
8771
|
-
class
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
ecOnInit = (params = {}) => {
|
|
8776
|
-
};
|
|
8777
|
-
ecOnConstruct = (params = {}) => {
|
|
8778
|
-
};
|
|
8779
|
-
hasParams = (params, searched) => params && params != null && params.find(param => param['code']?.toLowerCase().includes(searched.toLowerCase())) !== undefined;
|
|
8780
|
-
navigateOnRouter(router, url) {
|
|
8781
|
-
router.navigateByUrl(`/${url}`);
|
|
8782
|
-
}
|
|
8783
|
-
}
|
|
8784
|
-
|
|
8785
|
-
class RelatedProductsEcComponent extends ComponentHelper {
|
|
8786
|
-
productsService;
|
|
8787
|
-
analyticsService;
|
|
8788
|
-
consts;
|
|
8789
|
-
router;
|
|
8863
|
+
class RelatedProductsEcComponent {
|
|
8864
|
+
_productsService = inject(ProductsService);
|
|
8865
|
+
_analyticsService = inject(AnalyticsService);
|
|
8866
|
+
_router = inject(Router);
|
|
8790
8867
|
/**
|
|
8791
|
-
|
|
8792
|
-
|
|
8868
|
+
* Signal utlizado para guarda el contenedor del carrusel
|
|
8869
|
+
*/
|
|
8793
8870
|
swiperElement = signal(null);
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8871
|
+
/**
|
|
8872
|
+
* Input que recibe un template para el producto.
|
|
8873
|
+
*/
|
|
8874
|
+
appProduct;
|
|
8875
|
+
productID;
|
|
8797
8876
|
document;
|
|
8798
|
-
|
|
8877
|
+
platformId = inject(PLATFORM_ID);
|
|
8878
|
+
_relatedProductsSubject = new BehaviorSubject([]);
|
|
8879
|
+
relatedProducts$ = this._relatedProductsSubject.asObservable();
|
|
8799
8880
|
keywordsToCompare = ['compare', 'comparar', 'comparacion', 'comparación', 'compared'];
|
|
8800
|
-
|
|
8881
|
+
swiperRelatedOptions = () => {
|
|
8801
8882
|
return {
|
|
8802
8883
|
navigation: true,
|
|
8884
|
+
loop: true,
|
|
8803
8885
|
breakpoints: {
|
|
8804
8886
|
0: {
|
|
8805
8887
|
slidesPerView: 1
|
|
@@ -8819,33 +8901,30 @@ class RelatedProductsEcComponent extends ComponentHelper {
|
|
|
8819
8901
|
}
|
|
8820
8902
|
};
|
|
8821
8903
|
};
|
|
8822
|
-
constructor(
|
|
8823
|
-
super();
|
|
8824
|
-
this.productsService = productsService;
|
|
8825
|
-
this.analyticsService = analyticsService;
|
|
8826
|
-
this.consts = consts;
|
|
8827
|
-
this.router = router;
|
|
8904
|
+
constructor() {
|
|
8828
8905
|
if (isPlatformBrowser(this.platformId)) {
|
|
8829
8906
|
this.document = document;
|
|
8830
8907
|
}
|
|
8831
8908
|
afterNextRender(() => {
|
|
8832
|
-
const swiperElemConstructor = this.document?.querySelector('#
|
|
8909
|
+
const swiperElemConstructor = this.document?.querySelector('#relatedProductsSwiper');
|
|
8910
|
+
console.log('swiperElemConstructor', swiperElemConstructor);
|
|
8833
8911
|
if (swiperElemConstructor) {
|
|
8834
|
-
Object.assign(swiperElemConstructor, this.
|
|
8912
|
+
Object.assign(swiperElemConstructor, this.swiperRelatedOptions());
|
|
8835
8913
|
this.swiperElement.set(swiperElemConstructor);
|
|
8836
8914
|
this.swiperElement()?.initialize();
|
|
8837
8915
|
}
|
|
8838
8916
|
});
|
|
8839
|
-
this.ecOnConstruct();
|
|
8840
8917
|
}
|
|
8841
8918
|
ngOnInit() {
|
|
8842
|
-
|
|
8843
|
-
this.
|
|
8919
|
+
console.log(this.productID);
|
|
8920
|
+
this.load(this.productID);
|
|
8844
8921
|
}
|
|
8845
8922
|
load(product_id) {
|
|
8846
|
-
this.
|
|
8847
|
-
|
|
8848
|
-
res.
|
|
8923
|
+
this._productsService.getRelatedProducts(product_id).pipe(take(1)).subscribe(res => {
|
|
8924
|
+
console.log('response', res);
|
|
8925
|
+
const relatedProducts = res.filter((elem) => !this.includeKeyword(elem.title.toLowerCase()));
|
|
8926
|
+
this._relatedProductsSubject.next(relatedProducts);
|
|
8927
|
+
res.map((products) => this._analyticsService.callEvent('view_item_list', { products: products.items, item_list_name: products.title || 'Related Products', item_list_id: products.id || 'related-products' }));
|
|
8849
8928
|
});
|
|
8850
8929
|
}
|
|
8851
8930
|
includeKeyword = (word) => {
|
|
@@ -8855,52 +8934,669 @@ class RelatedProductsEcComponent extends ComponentHelper {
|
|
|
8855
8934
|
});
|
|
8856
8935
|
return result;
|
|
8857
8936
|
};
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
items: 4,
|
|
8887
|
-
nav: true,
|
|
8937
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RelatedProductsEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8938
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RelatedProductsEcComponent, isStandalone: true, selector: "app-related-products-ec", inputs: { appProduct: "appProduct", productID: "productID" }, ngImport: i0, template: "\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
8939
|
+
}
|
|
8940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RelatedProductsEcComponent, decorators: [{
|
|
8941
|
+
type: Component,
|
|
8942
|
+
args: [{ selector: 'app-related-products-ec', standalone: true, imports: [AsyncPipe, ProductEcComponent, CommonModule], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "\r\n" }]
|
|
8943
|
+
}], ctorParameters: () => [], propDecorators: { appProduct: [{
|
|
8944
|
+
type: Input
|
|
8945
|
+
}], productID: [{
|
|
8946
|
+
type: Input,
|
|
8947
|
+
args: [{
|
|
8948
|
+
required: true
|
|
8949
|
+
}]
|
|
8950
|
+
}] } });
|
|
8951
|
+
|
|
8952
|
+
class FaqsEcComponent {
|
|
8953
|
+
_toastService = inject(ToastService);
|
|
8954
|
+
_optionsService = inject(OptionsService);
|
|
8955
|
+
_faqsSubject = new BehaviorSubject([]);
|
|
8956
|
+
faqs$ = this._faqsSubject.asObservable();
|
|
8957
|
+
empty_faqs = false;
|
|
8958
|
+
ngOnInit() {
|
|
8959
|
+
firstValueFrom(this._optionsService.getFAQ()).then(faqs => {
|
|
8960
|
+
if (faqs.length > 0) {
|
|
8961
|
+
this._faqsSubject.next(faqs);
|
|
8962
|
+
}
|
|
8963
|
+
else {
|
|
8964
|
+
this.empty_faqs = true;
|
|
8888
8965
|
}
|
|
8966
|
+
}, error => {
|
|
8967
|
+
console.log(error);
|
|
8968
|
+
this._toastService.show('No fue posible encontrar la sección solicitada');
|
|
8969
|
+
}).catch(err => this._toastService.show('empty-faqs'));
|
|
8970
|
+
}
|
|
8971
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FaqsEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8972
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FaqsEcComponent, isStandalone: true, selector: "app-faqs-ec", ngImport: i0, template: "<section class=\"formulario container py-2\">\r\n@if(faqs$ | async; as faqs){\r\n @if(!empty_faqs){\r\n <div class=\"d-flex align-items-start row\">\r\n <div class=\"nav flex-column nav-pills me-3 col-2\" id=\"v-pills-tab\" role=\"tablist\" aria-orientation=\"vertical\">\r\n @for(faq of faqs; track $index; let i = $index){\r\n <button [class]=\"'nav-link '+(i==0 ? 'active': '')\" [id]=\"'v-pills-'+faq.code+'-tab'\" data-bs-toggle=\"pill\" [attr.data-bs-target]=\"'#v-pills-'+faq.code\" type=\"button\" role=\"tab\" [attr.aria-controls]=\"'v-pills-'+faq.code\" [attr.aria-selected]=\"(i==0)\">{{faq.title}}</button>\r\n }\r\n </div>\r\n <div class=\"tab-content col-9\" id=\"v-pills-tabContent\">\r\n @for(faq of faqs; track $index; let i = $index){\r\n <div [class]=\"'tab-pane fade '+(i==0 ? 'show active' : '')\" [id]=\"'v-pills-'+faq.code\" role=\"tabpanel\" [attr.aria-labelledby]=\"'v-pills-'+faq.code+'-tab'\" tabindex=\"0\">\r\n <div class=\"accordion\" id=\"accordionFaqs\">\r\n @for(item of faq.questions; track $index; let i = $index){\r\n <div class=\"accordion-item\">\r\n <h2 class=\"accordion-header\">\r\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\"\r\n [attr.data-bs-target]=\"'#collapse-'+i\" aria-expanded=\"false\" [attr.aria-controls]=\"'collapse-'+i\">\r\n {{item.question}}\r\n </button>\r\n </h2>\r\n <div [id]=\"'collapse-'+i\" class=\"accordion-collapse collapse\" data-bs-parent=\"#accordionFaqs\">\r\n <div class=\"accordion-body\">\r\n <p>{{item.answer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }@else {\r\n <div class=\"d-flex justify-content-center\">\r\n {{ 'empty_faqs' | translate }}\r\n </div>\r\n }\r\n}@else {\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 align-items-center\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center my-5\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n</section>", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
8973
|
+
}
|
|
8974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FaqsEcComponent, decorators: [{
|
|
8975
|
+
type: Component,
|
|
8976
|
+
args: [{ selector: 'app-faqs-ec', standalone: true, imports: [AsyncPipe, LoadingFullEcComponent, TranslateModule], template: "<section class=\"formulario container py-2\">\r\n@if(faqs$ | async; as faqs){\r\n @if(!empty_faqs){\r\n <div class=\"d-flex align-items-start row\">\r\n <div class=\"nav flex-column nav-pills me-3 col-2\" id=\"v-pills-tab\" role=\"tablist\" aria-orientation=\"vertical\">\r\n @for(faq of faqs; track $index; let i = $index){\r\n <button [class]=\"'nav-link '+(i==0 ? 'active': '')\" [id]=\"'v-pills-'+faq.code+'-tab'\" data-bs-toggle=\"pill\" [attr.data-bs-target]=\"'#v-pills-'+faq.code\" type=\"button\" role=\"tab\" [attr.aria-controls]=\"'v-pills-'+faq.code\" [attr.aria-selected]=\"(i==0)\">{{faq.title}}</button>\r\n }\r\n </div>\r\n <div class=\"tab-content col-9\" id=\"v-pills-tabContent\">\r\n @for(faq of faqs; track $index; let i = $index){\r\n <div [class]=\"'tab-pane fade '+(i==0 ? 'show active' : '')\" [id]=\"'v-pills-'+faq.code\" role=\"tabpanel\" [attr.aria-labelledby]=\"'v-pills-'+faq.code+'-tab'\" tabindex=\"0\">\r\n <div class=\"accordion\" id=\"accordionFaqs\">\r\n @for(item of faq.questions; track $index; let i = $index){\r\n <div class=\"accordion-item\">\r\n <h2 class=\"accordion-header\">\r\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\"\r\n [attr.data-bs-target]=\"'#collapse-'+i\" aria-expanded=\"false\" [attr.aria-controls]=\"'collapse-'+i\">\r\n {{item.question}}\r\n </button>\r\n </h2>\r\n <div [id]=\"'collapse-'+i\" class=\"accordion-collapse collapse\" data-bs-parent=\"#accordionFaqs\">\r\n <div class=\"accordion-body\">\r\n <p>{{item.answer}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }@else {\r\n <div class=\"d-flex justify-content-center\">\r\n {{ 'empty_faqs' | translate }}\r\n </div>\r\n }\r\n}@else {\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 align-items-center\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center my-5\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n</section>" }]
|
|
8977
|
+
}] });
|
|
8978
|
+
|
|
8979
|
+
class ShareFacebookEcComponent {
|
|
8980
|
+
shareLink;
|
|
8981
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareFacebookEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8982
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ShareFacebookEcComponent, isStandalone: true, selector: "app-share-facebook-ec", inputs: { shareLink: "shareLink" }, ngImport: i0, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Compartir en Facebook\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-facebook\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M18.56 31.36V17.28h4.48l.64-5.12h-5.12v-3.2c0-1.28.64-2.56 2.56-2.56h2.56V1.28H19.2c-3.84 0-7.04 2.56-7.04 7.04v3.84H7.68v5.12h4.48v14.08h6.4z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Compartir</span>\r\n</a>", styles: [""] });
|
|
8983
|
+
}
|
|
8984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareFacebookEcComponent, decorators: [{
|
|
8985
|
+
type: Component,
|
|
8986
|
+
args: [{ selector: 'app-share-facebook-ec', standalone: true, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Compartir en Facebook\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-facebook\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M18.56 31.36V17.28h4.48l.64-5.12h-5.12v-3.2c0-1.28.64-2.56 2.56-2.56h2.56V1.28H19.2c-3.84 0-7.04 2.56-7.04 7.04v3.84H7.68v5.12h4.48v14.08h6.4z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Compartir</span>\r\n</a>" }]
|
|
8987
|
+
}], propDecorators: { shareLink: [{
|
|
8988
|
+
type: Input,
|
|
8989
|
+
args: [{
|
|
8990
|
+
required: true,
|
|
8991
|
+
}]
|
|
8992
|
+
}] } });
|
|
8993
|
+
|
|
8994
|
+
class ShareTwitterEcComponent {
|
|
8995
|
+
shareLink;
|
|
8996
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareTwitterEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8997
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ShareTwitterEcComponent, isStandalone: true, selector: "app-share-twitter-ec", inputs: { shareLink: "shareLink" }, ngImport: i0, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Tuitear en Twitter\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-twitter\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M31.281 6.733q-1.304 1.924-3.13 3.26 0 .13.033.408t.033.408q0 2.543-.75 5.086t-2.282 4.858-3.635 4.108-5.053 2.869-6.341 1.076q-5.282 0-9.65-2.836.913.065 1.5.065 4.401 0 7.857-2.673-2.054-.033-3.668-1.255t-2.266-3.146q.554.13 1.206.13.88 0 1.663-.261-2.184-.456-3.619-2.184t-1.435-3.977v-.065q1.239.652 2.836.717-1.271-.848-2.021-2.233t-.75-2.983q0-1.63.815-3.195 2.38 2.967 5.754 4.678t7.319 1.907q-.228-.815-.228-1.434 0-2.608 1.858-4.45t4.532-1.842q1.304 0 2.51.522t2.054 1.467q2.152-.424 4.01-1.532-.685 2.217-2.771 3.488 1.989-.261 3.619-.978z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Tuitear</span>\r\n</a>", styles: [""] });
|
|
8998
|
+
}
|
|
8999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareTwitterEcComponent, decorators: [{
|
|
9000
|
+
type: Component,
|
|
9001
|
+
args: [{ selector: 'app-share-twitter-ec', standalone: true, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Tuitear en Twitter\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-twitter\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M31.281 6.733q-1.304 1.924-3.13 3.26 0 .13.033.408t.033.408q0 2.543-.75 5.086t-2.282 4.858-3.635 4.108-5.053 2.869-6.341 1.076q-5.282 0-9.65-2.836.913.065 1.5.065 4.401 0 7.857-2.673-2.054-.033-3.668-1.255t-2.266-3.146q.554.13 1.206.13.88 0 1.663-.261-2.184-.456-3.619-2.184t-1.435-3.977v-.065q1.239.652 2.836.717-1.271-.848-2.021-2.233t-.75-2.983q0-1.63.815-3.195 2.38 2.967 5.754 4.678t7.319 1.907q-.228-.815-.228-1.434 0-2.608 1.858-4.45t4.532-1.842q1.304 0 2.51.522t2.054 1.467q2.152-.424 4.01-1.532-.685 2.217-2.771 3.488 1.989-.261 3.619-.978z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Tuitear</span>\r\n</a>" }]
|
|
9002
|
+
}], propDecorators: { shareLink: [{
|
|
9003
|
+
type: Input,
|
|
9004
|
+
args: [{
|
|
9005
|
+
required: true,
|
|
9006
|
+
}]
|
|
9007
|
+
}] } });
|
|
9008
|
+
|
|
9009
|
+
class SharePinterestEcComponent {
|
|
9010
|
+
shareLink;
|
|
9011
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SharePinterestEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9012
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SharePinterestEcComponent, isStandalone: true, selector: "app-share-pinterest-ec", inputs: { shareLink: "shareLink" }, ngImport: i0, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Pinear en Pinterest\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-pinterest\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M27.52 9.6c-.64-5.76-6.4-8.32-12.8-7.68-4.48.64-9.6 4.48-9.6 10.24 0 3.2.64 5.76 3.84 6.4 1.28-2.56-.64-3.2-.64-4.48-1.28-7.04 8.32-12.16 13.44-7.04 3.2 3.84 1.28 14.08-4.48 13.44-5.12-1.28 2.56-9.6-1.92-11.52-3.2-1.28-5.12 4.48-3.84 7.04-1.28 4.48-3.2 8.96-1.92 15.36 2.56-1.92 3.84-5.76 4.48-9.6 1.28.64 1.92 1.92 3.84 1.92 6.4-.64 10.24-7.68 9.6-14.08z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Hacer pin</span>\r\n</a>", styles: [""] });
|
|
9013
|
+
}
|
|
9014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SharePinterestEcComponent, decorators: [{
|
|
9015
|
+
type: Component,
|
|
9016
|
+
args: [{ selector: 'app-share-pinterest-ec', standalone: true, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Pinear en Pinterest\">\r\n <svg aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" class=\"icon icon-pinterest\" viewBox=\"0 0 32 32\">\r\n <path fill=\"#444\"\r\n d=\"M27.52 9.6c-.64-5.76-6.4-8.32-12.8-7.68-4.48.64-9.6 4.48-9.6 10.24 0 3.2.64 5.76 3.84 6.4 1.28-2.56-.64-3.2-.64-4.48-1.28-7.04 8.32-12.16 13.44-7.04 3.2 3.84 1.28 14.08-4.48 13.44-5.12-1.28 2.56-9.6-1.92-11.52-3.2-1.28-5.12 4.48-3.84 7.04-1.28 4.48-3.2 8.96-1.92 15.36 2.56-1.92 3.84-5.76 4.48-9.6 1.28.64 1.92 1.92 3.84 1.92 6.4-.64 10.24-7.68 9.6-14.08z\">\r\n </path>\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Hacer pin</span>\r\n</a>" }]
|
|
9017
|
+
}], propDecorators: { shareLink: [{
|
|
9018
|
+
type: Input,
|
|
9019
|
+
args: [{
|
|
9020
|
+
required: true,
|
|
9021
|
+
}]
|
|
9022
|
+
}] } });
|
|
9023
|
+
|
|
9024
|
+
class ShareWhatsappEcComponent {
|
|
9025
|
+
shareLink;
|
|
9026
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareWhatsappEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9027
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ShareWhatsappEcComponent, isStandalone: true, selector: "app-share-whatsapp-ec", inputs: { shareLink: "shareLink" }, ngImport: i0, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Whatsapp\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" fill=\"currentColor\"\r\n class=\"bi bi-whatsapp\" viewBox=\"0 0 16 16\">\r\n <path\r\n d=\"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z\" />\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Whatsapp</span>\r\n</a>\r\n", styles: [""] });
|
|
9028
|
+
}
|
|
9029
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareWhatsappEcComponent, decorators: [{
|
|
9030
|
+
type: Component,
|
|
9031
|
+
args: [{ selector: 'app-share-whatsapp-ec', standalone: true, imports: [], template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Whatsapp\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" fill=\"currentColor\"\r\n class=\"bi bi-whatsapp\" viewBox=\"0 0 16 16\">\r\n <path\r\n d=\"M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z\" />\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Whatsapp</span>\r\n</a>\r\n" }]
|
|
9032
|
+
}], propDecorators: { shareLink: [{
|
|
9033
|
+
type: Input,
|
|
9034
|
+
args: [{
|
|
9035
|
+
required: true,
|
|
9036
|
+
}]
|
|
9037
|
+
}] } });
|
|
9038
|
+
|
|
9039
|
+
class ShareEmailEcComponent {
|
|
9040
|
+
shareLink;
|
|
9041
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareEmailEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9042
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ShareEmailEcComponent, isStandalone: true, selector: "app-share-email-ec", inputs: { shareLink: "shareLink" }, ngImport: i0, template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Email\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" fill=\"currentColor\"\r\n class=\"bi bi-envelope-fill\" viewBox=\"0 0 16 16\">\r\n <path\r\n d=\"M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z\" />\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Email</span>\r\n</a>", styles: [""] });
|
|
9043
|
+
}
|
|
9044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareEmailEcComponent, decorators: [{
|
|
9045
|
+
type: Component,
|
|
9046
|
+
args: [{ selector: 'app-share-email-ec', standalone: true, imports: [], template: "<a target=\"_blank\" [href]=\"shareLink\" class=\"social-sharing__link\" title=\"Email\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\" focusable=\"false\" role=\"presentation\" fill=\"currentColor\"\r\n class=\"bi bi-envelope-fill\" viewBox=\"0 0 16 16\">\r\n <path\r\n d=\"M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z\" />\r\n </svg>\r\n <span class=\"social-sharing__title\" aria-hidden=\"true\">Email</span>\r\n</a>" }]
|
|
9047
|
+
}], propDecorators: { shareLink: [{
|
|
9048
|
+
type: Input,
|
|
9049
|
+
args: [{
|
|
9050
|
+
required: true,
|
|
9051
|
+
}]
|
|
9052
|
+
}] } });
|
|
9053
|
+
|
|
9054
|
+
class ShareEcComponent {
|
|
9055
|
+
_paramsService = inject(ParametersService);
|
|
9056
|
+
_meta = inject(Meta);
|
|
9057
|
+
_renderer = inject(Renderer2);
|
|
9058
|
+
_title = inject(Title);
|
|
9059
|
+
_constants = inject(CoreConstantsService);
|
|
9060
|
+
product;
|
|
9061
|
+
url = '';
|
|
9062
|
+
mediaimg = '';
|
|
9063
|
+
description = '';
|
|
9064
|
+
params;
|
|
9065
|
+
hasParams = this._paramsService.hasParams;
|
|
9066
|
+
platformId = inject(PLATFORM_ID);
|
|
9067
|
+
window;
|
|
9068
|
+
constructor() {
|
|
9069
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
9070
|
+
this.window = window;
|
|
9071
|
+
}
|
|
9072
|
+
}
|
|
9073
|
+
ngOnInit() {
|
|
9074
|
+
this.url = this.window?.location.href;
|
|
9075
|
+
this.mediaimg = this.product.picturesdefault && this.product.picturesdefault[0] || '';
|
|
9076
|
+
this.description = this.product.name || '';
|
|
9077
|
+
if (this.description) {
|
|
9078
|
+
this._meta.addTags([
|
|
9079
|
+
{
|
|
9080
|
+
name: "description",
|
|
9081
|
+
content: this.description
|
|
9082
|
+
},
|
|
9083
|
+
{
|
|
9084
|
+
property: "og:site_name",
|
|
9085
|
+
content: this._title.getTitle()
|
|
9086
|
+
},
|
|
9087
|
+
{
|
|
9088
|
+
property: "og:url",
|
|
9089
|
+
content: this.url
|
|
9090
|
+
},
|
|
9091
|
+
{
|
|
9092
|
+
property: "og:title",
|
|
9093
|
+
content: this.description
|
|
9094
|
+
},
|
|
9095
|
+
{
|
|
9096
|
+
property: "og:type",
|
|
9097
|
+
content: 'product'
|
|
9098
|
+
},
|
|
9099
|
+
{
|
|
9100
|
+
property: "og:price:amount",
|
|
9101
|
+
content: this.product.price
|
|
9102
|
+
},
|
|
9103
|
+
{
|
|
9104
|
+
property: "og:price:currency",
|
|
9105
|
+
content: this._constants.currency.code
|
|
9106
|
+
},
|
|
9107
|
+
{
|
|
9108
|
+
property: "og:image",
|
|
9109
|
+
content: this._constants.mediaUrl() + this.mediaimg
|
|
9110
|
+
},
|
|
9111
|
+
{
|
|
9112
|
+
property: "og:image:secure_url",
|
|
9113
|
+
content: this._constants.mediaUrl() + this.mediaimg
|
|
9114
|
+
},
|
|
9115
|
+
{
|
|
9116
|
+
property: "witter:site",
|
|
9117
|
+
content: '@'
|
|
9118
|
+
},
|
|
9119
|
+
{
|
|
9120
|
+
property: "twitter:card",
|
|
9121
|
+
content: 'summary_large_image'
|
|
9122
|
+
},
|
|
9123
|
+
{
|
|
9124
|
+
property: "twitter:title",
|
|
9125
|
+
content: this.description
|
|
9126
|
+
},
|
|
9127
|
+
{
|
|
9128
|
+
property: "twitter:description",
|
|
9129
|
+
content: this.description
|
|
9130
|
+
}
|
|
9131
|
+
], true);
|
|
8889
9132
|
}
|
|
9133
|
+
this._paramsService.getParameters().subscribe(res => {
|
|
9134
|
+
this.params = res != null ? res?.filter(elem => elem.code.includes('share')) : [];
|
|
9135
|
+
});
|
|
9136
|
+
}
|
|
9137
|
+
toShareFacebook = () => {
|
|
9138
|
+
return `https://www.facebook.com/share.php?u=${this.url}`;
|
|
9139
|
+
};
|
|
9140
|
+
toShareTwitter = () => {
|
|
9141
|
+
return `https://twitter.com/share?text=${this.description}&url=${this.url}`;
|
|
9142
|
+
};
|
|
9143
|
+
toSharePinterest = () => {
|
|
9144
|
+
return `https://pinterest.com/pin/create/button/?url=${this.url}&media=${this._constants.mediaUrl() + this.mediaimg}&description=${this.description}`;
|
|
9145
|
+
};
|
|
9146
|
+
toShareWhatsapp = (wsp) => {
|
|
9147
|
+
return `https://wa.me/${wsp.value}?text=Me%20interesa%20este%20producto.%20${this.url}`;
|
|
9148
|
+
};
|
|
9149
|
+
toShareEmail = (mail) => {
|
|
9150
|
+
return `mailto:${mail.value}?subject=Consulta%20sobre%20el%20producto:%20${this.description}&body=Artículo:%20${this.url}`;
|
|
8890
9151
|
};
|
|
8891
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
8892
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
9152
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9153
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ShareEcComponent, isStandalone: true, selector: "app-share-ec", inputs: { product: "product" }, ngImport: i0, template: "<div class=\"w-100 d-flex justify-content-around\">\r\n @if(params && params.length > 0){ \r\n @if(hasParams(params, 'facebook')){\r\n <app-share-facebook-ec [shareLink]=\"toShareFacebook()\" />\r\n }\r\n @if(hasParams(params, 'twitter')){\r\n <app-share-twitter-ec [shareLink]=\"toShareTwitter()\" />\r\n }\r\n @if(hasParams(params, 'pinterest')){\r\n <app-share-pinterest-ec [shareLink]=\"toSharePinterest()\" />\r\n }\r\n @if(hasParams(params, 'whatsapp'); as wsp){\r\n <app-share-whatsapp-ec [shareLink]=\"toShareWhatsapp(wsp)\" />\r\n }\r\n @if(hasParams(params, 'email'); as email){\r\n <app-share-email-ec [shareLink]=\"toShareEmail(email)\" />\r\n }\r\n } @else {\r\n <!-- VISTA DEFAULT CON LINKS QUE NO REQUIEREN PARAMETROS-->\r\n <app-share-facebook-ec [shareLink]=\"toShareFacebook()\" />\r\n \r\n <app-share-twitter-ec [shareLink]=\"toShareTwitter()\" />\r\n\r\n <app-share-pinterest-ec [shareLink]=\"toSharePinterest()\" />\r\n }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "component", type: ShareFacebookEcComponent, selector: "app-share-facebook-ec", inputs: ["shareLink"] }, { kind: "component", type: ShareTwitterEcComponent, selector: "app-share-twitter-ec", inputs: ["shareLink"] }, { kind: "component", type: SharePinterestEcComponent, selector: "app-share-pinterest-ec", inputs: ["shareLink"] }, { kind: "component", type: ShareWhatsappEcComponent, selector: "app-share-whatsapp-ec", inputs: ["shareLink"] }, { kind: "component", type: ShareEmailEcComponent, selector: "app-share-email-ec", inputs: ["shareLink"] }] });
|
|
8893
9154
|
}
|
|
8894
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
9155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ShareEcComponent, decorators: [{
|
|
9156
|
+
type: Component,
|
|
9157
|
+
args: [{ selector: 'app-share-ec', standalone: true, imports: [
|
|
9158
|
+
ShareFacebookEcComponent,
|
|
9159
|
+
ShareTwitterEcComponent,
|
|
9160
|
+
SharePinterestEcComponent,
|
|
9161
|
+
ShareWhatsappEcComponent,
|
|
9162
|
+
ShareEmailEcComponent
|
|
9163
|
+
], template: "<div class=\"w-100 d-flex justify-content-around\">\r\n @if(params && params.length > 0){ \r\n @if(hasParams(params, 'facebook')){\r\n <app-share-facebook-ec [shareLink]=\"toShareFacebook()\" />\r\n }\r\n @if(hasParams(params, 'twitter')){\r\n <app-share-twitter-ec [shareLink]=\"toShareTwitter()\" />\r\n }\r\n @if(hasParams(params, 'pinterest')){\r\n <app-share-pinterest-ec [shareLink]=\"toSharePinterest()\" />\r\n }\r\n @if(hasParams(params, 'whatsapp'); as wsp){\r\n <app-share-whatsapp-ec [shareLink]=\"toShareWhatsapp(wsp)\" />\r\n }\r\n @if(hasParams(params, 'email'); as email){\r\n <app-share-email-ec [shareLink]=\"toShareEmail(email)\" />\r\n }\r\n } @else {\r\n <!-- VISTA DEFAULT CON LINKS QUE NO REQUIEREN PARAMETROS-->\r\n <app-share-facebook-ec [shareLink]=\"toShareFacebook()\" />\r\n \r\n <app-share-twitter-ec [shareLink]=\"toShareTwitter()\" />\r\n\r\n <app-share-pinterest-ec [shareLink]=\"toSharePinterest()\" />\r\n }\r\n</div>\r\n" }]
|
|
9164
|
+
}], ctorParameters: () => [], propDecorators: { product: [{
|
|
9165
|
+
type: Input,
|
|
9166
|
+
args: [{
|
|
9167
|
+
required: true,
|
|
9168
|
+
}]
|
|
9169
|
+
}] } });
|
|
9170
|
+
|
|
9171
|
+
class ComponentHelper {
|
|
9172
|
+
constructor() {
|
|
9173
|
+
this.ecOnConstruct();
|
|
9174
|
+
}
|
|
9175
|
+
ecOnInit = (params = {}) => {
|
|
9176
|
+
};
|
|
9177
|
+
ecOnConstruct = (params = {}) => {
|
|
9178
|
+
};
|
|
9179
|
+
hasParams = (params, searched) => params && params != null && params.find(param => param['code']?.toLowerCase().includes(searched.toLowerCase())) !== undefined;
|
|
9180
|
+
navigateOnRouter(router, url) {
|
|
9181
|
+
router.navigateByUrl(`/${url}`);
|
|
9182
|
+
}
|
|
9183
|
+
}
|
|
9184
|
+
|
|
9185
|
+
class RatingEcComponent extends ComponentHelper {
|
|
9186
|
+
template;
|
|
9187
|
+
type = 'stars';
|
|
9188
|
+
ratingValue = 0;
|
|
9189
|
+
score = [0, 0, 0, 0, 0];
|
|
9190
|
+
ngOnInit() {
|
|
9191
|
+
this.ratingValue ? this.processRatingValue(this.ratingValue) : null;
|
|
9192
|
+
}
|
|
9193
|
+
/**
|
|
9194
|
+
* @description recibe el valor de rating para procesarlo y posteriormente
|
|
9195
|
+
* llenar el arreglo de score.
|
|
9196
|
+
* @param value
|
|
9197
|
+
*/
|
|
9198
|
+
processRatingValue = (value) => {
|
|
9199
|
+
value = this.roundToHalf(value);
|
|
9200
|
+
if ((value % 1) == 0) {
|
|
9201
|
+
this.fillScore(value);
|
|
9202
|
+
}
|
|
9203
|
+
else {
|
|
9204
|
+
this.fillScore(value, true);
|
|
9205
|
+
}
|
|
9206
|
+
this.ratingValue = value;
|
|
9207
|
+
};
|
|
9208
|
+
/**
|
|
9209
|
+
* @description Rellena el array con valor 1 hasta donde indique el campo value.
|
|
9210
|
+
* agregar 0.5 si el valor de withDecimal es true.
|
|
9211
|
+
* @param value cantidad de casillas de arreglos que debe llenar
|
|
9212
|
+
* @param withDecimal true => se agrega 0.5 en la posicion posterior a la que marco value
|
|
9213
|
+
*/
|
|
9214
|
+
fillScore = (value, withDecimal = false) => {
|
|
9215
|
+
for (let index = 0; index < value; index++) {
|
|
9216
|
+
this.score[index] = 1;
|
|
9217
|
+
}
|
|
9218
|
+
withDecimal ? this.score[parseInt(value.toString().split('.')[0])] = 0.5 : null;
|
|
9219
|
+
//console.log(this.score, parseInt(value.toString().split('.')[0]))
|
|
9220
|
+
};
|
|
9221
|
+
/**
|
|
9222
|
+
* @description Metodo que redondea un numero a entero o decimal con 0.5.
|
|
9223
|
+
* @param value Valor a redondear
|
|
9224
|
+
* @returns
|
|
9225
|
+
*/
|
|
9226
|
+
roundToHalf = (value) => {
|
|
9227
|
+
var converted = parseFloat(value.toString()); // Make sure we have a number
|
|
9228
|
+
var decimal = (converted - parseInt(converted.toString(), 10));
|
|
9229
|
+
decimal = Math.round(decimal * 10);
|
|
9230
|
+
if (decimal == 5) {
|
|
9231
|
+
return (parseInt(converted.toString(), 10) + 0.5);
|
|
9232
|
+
}
|
|
9233
|
+
if ((decimal < 3) || (decimal > 7)) {
|
|
9234
|
+
return Math.round(converted);
|
|
9235
|
+
}
|
|
9236
|
+
else {
|
|
9237
|
+
return (parseInt(converted.toString(), 10) + 0.5);
|
|
9238
|
+
}
|
|
9239
|
+
};
|
|
9240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RatingEcComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9241
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: RatingEcComponent, isStandalone: true, selector: "app-rating-ec", inputs: { template: "template", type: "type", ratingValue: "ratingValue" }, usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\r\n <ng-template #stars let-score=\"score\">\r\n @for (value of score; track $index) {\r\n @switch (value) {\r\n @case (1) {\r\n <i class=\"me-1 bi bi-star-fill text-warning star\"></i> \r\n }\r\n @case (0.5) {\r\n <i class=\"me-1 bi bi-star-half text-warning star\"></i>\r\n } \r\n @default {\r\n <i class=\"me-1 bi bi-star text-muted star\"></i>\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <ng-container *ngSwitchCase=\"'stars'\"\r\n [ngTemplateOutlet]=\"template ? template : stars\"\r\n [ngTemplateOutletContext]=\"{score:score, ratingValue:ratingValue}\">\r\n </ng-container>\r\n</ng-container> \r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
|
|
9242
|
+
}
|
|
9243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RatingEcComponent, decorators: [{
|
|
9244
|
+
type: Component,
|
|
9245
|
+
args: [{ selector: 'app-rating-ec', standalone: true, imports: [CommonModule], template: "<ng-container [ngSwitch]=\"type\">\r\n <ng-template #stars let-score=\"score\">\r\n @for (value of score; track $index) {\r\n @switch (value) {\r\n @case (1) {\r\n <i class=\"me-1 bi bi-star-fill text-warning star\"></i> \r\n }\r\n @case (0.5) {\r\n <i class=\"me-1 bi bi-star-half text-warning star\"></i>\r\n } \r\n @default {\r\n <i class=\"me-1 bi bi-star text-muted star\"></i>\r\n }\r\n }\r\n }\r\n </ng-template>\r\n <ng-container *ngSwitchCase=\"'stars'\"\r\n [ngTemplateOutlet]=\"template ? template : stars\"\r\n [ngTemplateOutletContext]=\"{score:score, ratingValue:ratingValue}\">\r\n </ng-container>\r\n</ng-container> \r\n" }]
|
|
9246
|
+
}], propDecorators: { template: [{
|
|
9247
|
+
type: Input
|
|
9248
|
+
}], type: [{
|
|
9249
|
+
type: Input
|
|
9250
|
+
}], ratingValue: [{
|
|
9251
|
+
type: Input
|
|
9252
|
+
}] } });
|
|
9253
|
+
|
|
9254
|
+
class ReviewsService {
|
|
9255
|
+
connection;
|
|
9256
|
+
constants;
|
|
9257
|
+
pagination;
|
|
9258
|
+
reviewsSubject = new BehaviorSubject({});
|
|
9259
|
+
reviews$ = this.reviewsSubject.asObservable();
|
|
9260
|
+
//--Api--
|
|
9261
|
+
reviewsByCodeApi = (code) => 'shop-api/' + this.constants.getChannel() + '/products/by-code/' + code + '/reviews';
|
|
9262
|
+
reviewsBySlugApi = (slug) => 'shop-api/' + this.constants.getChannel() + '/products/by-slug/' + slug + '/reviews';
|
|
9263
|
+
constructor(connection, constants, pagination) {
|
|
9264
|
+
this.connection = connection;
|
|
9265
|
+
this.constants = constants;
|
|
9266
|
+
this.pagination = pagination;
|
|
9267
|
+
}
|
|
9268
|
+
/**
|
|
9269
|
+
* @description obtiene las reviews por el codigo del producto.
|
|
9270
|
+
* @param code codigo del producto
|
|
9271
|
+
* @returns
|
|
9272
|
+
*/
|
|
9273
|
+
getReviewsByCode = (code) => this.connection.get(this.reviewsByCodeApi(code)).toPromise().then(res => this.updateReviews(res));
|
|
9274
|
+
/**
|
|
9275
|
+
* @description actualiza las reviews por codigo
|
|
9276
|
+
* @param code codigo del producto
|
|
9277
|
+
* @returns
|
|
9278
|
+
*/
|
|
9279
|
+
updateReviewsByCode = (code) => this.getReviewsByCode(code);
|
|
9280
|
+
/**
|
|
9281
|
+
* @description actualiza las reviews
|
|
9282
|
+
* @param res
|
|
9283
|
+
* @returns
|
|
9284
|
+
*/
|
|
9285
|
+
updateReviews = (res) => this.reviewsSubject.next(res);
|
|
9286
|
+
/**
|
|
9287
|
+
* @description obtiene las reviews utilizando las url del atributo links de las reviews.
|
|
9288
|
+
* @param action self(defecto) | next | first | last
|
|
9289
|
+
* @returns
|
|
9290
|
+
*/
|
|
9291
|
+
getReviews = (action = 'self') => this.connection.get(this.generateFinalApi(action)).toPromise().then(res => this.updateReviews(res));
|
|
9292
|
+
/**
|
|
9293
|
+
* @description obtiene las reviews de una pagina en especial.
|
|
9294
|
+
* @param code codigo del producto
|
|
9295
|
+
* @param page número de pagina
|
|
9296
|
+
* @param limit cantidad limite de paginas
|
|
9297
|
+
* @returns
|
|
9298
|
+
*/
|
|
9299
|
+
getReviewsByPage = (code, page, limit) => this.connection.get(this.generateFinalApiWithPage(code, page, limit)).toPromise().then(res => this.updateReviews(res));
|
|
9300
|
+
/**
|
|
9301
|
+
* @description genera una url que sera utiliza como endpoint para pedir las reviews utilizando los datos
|
|
9302
|
+
* que viene en el atributo links.
|
|
9303
|
+
* 'next' => utiliza el atributo next de links
|
|
9304
|
+
* 'first' => utiliza el atributo first de links
|
|
9305
|
+
* 'last' => utiliza el atributo last de links
|
|
9306
|
+
* default => cualquier otro caso, utiliza el atributo self de links.
|
|
9307
|
+
* @param action next | first | last
|
|
9308
|
+
* @returns
|
|
9309
|
+
*/
|
|
9310
|
+
generateFinalApi = (action) => {
|
|
9311
|
+
switch (action) {
|
|
9312
|
+
case 'next':
|
|
9313
|
+
return this.formatUrl(this.reviewsSubject.getValue().links.next);
|
|
9314
|
+
case 'first':
|
|
9315
|
+
return this.formatUrl(this.reviewsSubject.getValue().links.first);
|
|
9316
|
+
case 'last':
|
|
9317
|
+
return this.formatUrl(this.reviewsSubject.getValue().links.last);
|
|
9318
|
+
default:
|
|
9319
|
+
return this.formatUrl(this.reviewsSubject.getValue().links.self);
|
|
9320
|
+
}
|
|
9321
|
+
};
|
|
9322
|
+
/**
|
|
9323
|
+
* @description obtiene las reviews de una pagina en especifico
|
|
9324
|
+
* @param code codigo del producto
|
|
9325
|
+
* @param page numero de pagina
|
|
9326
|
+
* @param limit cantidad limite de paginas
|
|
9327
|
+
* @returns
|
|
9328
|
+
*/
|
|
9329
|
+
generateFinalApiWithPage = (code, page, limit) => this.reviewsByCodeApi(code) + '?page=' + page + '&limit=' + limit;
|
|
9330
|
+
/**
|
|
9331
|
+
* @description formatea la url que sera utilizada de endpoint para obtener las reviews
|
|
9332
|
+
* @param url
|
|
9333
|
+
* @returns
|
|
9334
|
+
*/
|
|
9335
|
+
formatUrl = (url) => url.slice(1);
|
|
9336
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsService, deps: [{ token: ConnectionService }, { token: CoreConstantsService }, { token: PaginationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9337
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsService, providedIn: 'root' });
|
|
9338
|
+
}
|
|
9339
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsService, decorators: [{
|
|
9340
|
+
type: Injectable,
|
|
9341
|
+
args: [{
|
|
9342
|
+
providedIn: 'root'
|
|
9343
|
+
}]
|
|
9344
|
+
}], ctorParameters: () => [{ type: ConnectionService }, { type: CoreConstantsService }, { type: PaginationService }] });
|
|
9345
|
+
|
|
9346
|
+
class ReviewsEcComponent extends ComponentHelper {
|
|
9347
|
+
reviewsService;
|
|
9348
|
+
consts;
|
|
9349
|
+
/**
|
|
9350
|
+
* @description producto del cual se obtendran las reviews.
|
|
9351
|
+
*/
|
|
9352
|
+
product;
|
|
9353
|
+
reviews;
|
|
9354
|
+
constructor(reviewsService, consts) {
|
|
9355
|
+
super();
|
|
9356
|
+
this.reviewsService = reviewsService;
|
|
9357
|
+
this.consts = consts;
|
|
9358
|
+
this.reviewsService.reviews$.subscribe(res => this.reviews = res);
|
|
9359
|
+
this.ecOnConstruct();
|
|
9360
|
+
}
|
|
9361
|
+
ngOnInit() {
|
|
9362
|
+
this.reviewsService.getReviewsByCode(this.product.id);
|
|
9363
|
+
this.ecOnInit();
|
|
9364
|
+
}
|
|
9365
|
+
next = () => {
|
|
9366
|
+
this.reviewsService.getReviews('next');
|
|
9367
|
+
};
|
|
9368
|
+
last = () => {
|
|
9369
|
+
this.reviewsService.getReviews('last');
|
|
9370
|
+
};
|
|
9371
|
+
first = () => {
|
|
9372
|
+
this.reviewsService.getReviews('first');
|
|
9373
|
+
};
|
|
9374
|
+
self = () => {
|
|
9375
|
+
this.reviewsService.getReviews();
|
|
9376
|
+
};
|
|
9377
|
+
/**
|
|
9378
|
+
* @description genera un arreglo con tamaño igual a la cantidad de paginas que tiene la review.
|
|
9379
|
+
* @returns {number[]} un arreglo cuyo contendio es un entero que indica el numero de pagina.
|
|
9380
|
+
*/
|
|
9381
|
+
getPages = () => {
|
|
9382
|
+
let pages = [];
|
|
9383
|
+
for (let index = 0; index < this.reviews.pages; index++) {
|
|
9384
|
+
pages.push(index + 1);
|
|
9385
|
+
}
|
|
9386
|
+
return pages;
|
|
9387
|
+
};
|
|
9388
|
+
/**
|
|
9389
|
+
* @description actualiza las reviews con el contenido asociado a la pagina pasada por parametro
|
|
9390
|
+
* @param page
|
|
9391
|
+
*/
|
|
9392
|
+
goPage = (page) => {
|
|
9393
|
+
this.reviewsService.getReviewsByPage(this.product.id, page, this.reviews.limit);
|
|
9394
|
+
};
|
|
9395
|
+
getAuthorName(email) {
|
|
9396
|
+
if (!email || email.indexOf('@') === -1) {
|
|
9397
|
+
return '';
|
|
9398
|
+
}
|
|
9399
|
+
return email.split('@')[0];
|
|
9400
|
+
}
|
|
9401
|
+
getStarArray(rating) {
|
|
9402
|
+
return Array(5).fill(0);
|
|
9403
|
+
}
|
|
9404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsEcComponent, deps: [{ token: ReviewsService }, { token: CoreConstantsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9405
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ReviewsEcComponent, isStandalone: true, selector: "app-reviews-ec", inputs: { product: "product" }, usesInheritance: true, ngImport: i0, template: "<div class=\"row px-3\">\r\n <div class=\"col-12 pb-2 pb-md-0\">\r\n <div class=\"row w-100\">\r\n <div class=\"col-12 col-md-6\">\r\n <h4 class=\"mb-0 pt-2 pb-1\">{{\"product-review\" | translate}}</h4>\r\n <small class=\"pb-2 escribir\" data-bs-toggle=\"modal\" href=\"#modalReview\">\r\n {{\"write-a-review\" | translate}}\r\n <i class=\"bi bi-pencil-square\"></i>\r\n </small>\r\n </div>\r\n <div class=\"col-12 col-md-6 d-flex align-items-center justify-content-start justify-content-md-end\">\r\n <div class=\"puntaje d-flex\">\r\n <ng-template #number let-ratingValue=\"ratingValue\">\r\n <p class=\"puntos mb-0\">\r\n {{ratingValue}}\r\n </p>\r\n </ng-template>\r\n <app-rating-ec [ratingValue]=\"product.rating\" [template]=\"number\"></app-rating-ec>\r\n <div class=\"ms-2\">\r\n <div class=\"stars mb-1\">\r\n <app-rating-ec [ratingValue]=\"product.rating\"></app-rating-ec>\r\n </div>\r\n <small><strong>{{reviews.total}} {{\"reviews\" | translate}}</strong></small>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <hr>\r\n\r\n <div class=\"tab-content mt-4\" id=\"myTabContent\">\r\n <div class=\"row g-5\">\r\n @for (item of reviews.items; track $index) {\r\n <div class=\"col-12 col-sm-6 col-md-4\">\r\n <div class=\"row\">\r\n <div class=\"col-9 col-sm-10\">\r\n <div class=\"ranking\">\r\n <app-rating-ec [ratingValue]=\"item.rating\"></app-rating-ec>\r\n </div>\r\n <h4 class=\"text-uppercase\">{{item.title}}</h4>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"ususario\">\r\n <i class=\"bi bi-person-fill\"></i> {{ getAuthorName(item.author) }}\r\n </div>\r\n </div>\r\n <div class=\"resenia mt-2\">\r\n <p style=\"font-size: 14px;\"> {{item.comment}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n }\r\n @if (getPages() && getPages().length > 1) {\r\n <nav aria-label=\"Page navigation example\">\r\n <ul class=\"pagination custom-pagination\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"first()\" aria-label=\"Previous\">\r\n <span aria-hidden=\"true\">«</span>\r\n </a>\r\n </li>\r\n @for (page of getPages(); track $index) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"goPage(page)\">{{ page }}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"next()\" aria-label=\"Next\">\r\n <span aria-hidden=\"true\">»</span>\r\n </a>\r\n </li>\r\n </ul>\r\n </nav>\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n</div>", styles: [".custom-pagination{display:flex;justify-content:center;list-style:none;padding:0;margin-top:20px}.custom-pagination .page-item{margin:0 5px}.custom-pagination .page-link{color:#131716;background-color:#f3f3f3;border:1px solid #ccc;padding:8px 12px;border-radius:5px;text-decoration:none;transition:background-color .3s ease}.custom-pagination .page-link:hover{background-color:#0b0c0c;color:#fff}.custom-pagination .page-item.active .page-link{background-color:#131716;color:#fff;font-weight:700}.cursor-pointer{cursor:pointer}\n"], dependencies: [{ kind: "component", type: RatingEcComponent, selector: "app-rating-ec", inputs: ["template", "type", "ratingValue"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
9406
|
+
}
|
|
9407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsEcComponent, decorators: [{
|
|
8895
9408
|
type: Component,
|
|
8896
|
-
args: [{ selector: 'app-
|
|
8897
|
-
}], ctorParameters: () => [{ type:
|
|
9409
|
+
args: [{ selector: 'app-reviews-ec', standalone: true, imports: [RatingEcComponent, TranslateModule], template: "<div class=\"row px-3\">\r\n <div class=\"col-12 pb-2 pb-md-0\">\r\n <div class=\"row w-100\">\r\n <div class=\"col-12 col-md-6\">\r\n <h4 class=\"mb-0 pt-2 pb-1\">{{\"product-review\" | translate}}</h4>\r\n <small class=\"pb-2 escribir\" data-bs-toggle=\"modal\" href=\"#modalReview\">\r\n {{\"write-a-review\" | translate}}\r\n <i class=\"bi bi-pencil-square\"></i>\r\n </small>\r\n </div>\r\n <div class=\"col-12 col-md-6 d-flex align-items-center justify-content-start justify-content-md-end\">\r\n <div class=\"puntaje d-flex\">\r\n <ng-template #number let-ratingValue=\"ratingValue\">\r\n <p class=\"puntos mb-0\">\r\n {{ratingValue}}\r\n </p>\r\n </ng-template>\r\n <app-rating-ec [ratingValue]=\"product.rating\" [template]=\"number\"></app-rating-ec>\r\n <div class=\"ms-2\">\r\n <div class=\"stars mb-1\">\r\n <app-rating-ec [ratingValue]=\"product.rating\"></app-rating-ec>\r\n </div>\r\n <small><strong>{{reviews.total}} {{\"reviews\" | translate}}</strong></small>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <hr>\r\n\r\n <div class=\"tab-content mt-4\" id=\"myTabContent\">\r\n <div class=\"row g-5\">\r\n @for (item of reviews.items; track $index) {\r\n <div class=\"col-12 col-sm-6 col-md-4\">\r\n <div class=\"row\">\r\n <div class=\"col-9 col-sm-10\">\r\n <div class=\"ranking\">\r\n <app-rating-ec [ratingValue]=\"item.rating\"></app-rating-ec>\r\n </div>\r\n <h4 class=\"text-uppercase\">{{item.title}}</h4>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"ususario\">\r\n <i class=\"bi bi-person-fill\"></i> {{ getAuthorName(item.author) }}\r\n </div>\r\n </div>\r\n <div class=\"resenia mt-2\">\r\n <p style=\"font-size: 14px;\"> {{item.comment}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n }\r\n @if (getPages() && getPages().length > 1) {\r\n <nav aria-label=\"Page navigation example\">\r\n <ul class=\"pagination custom-pagination\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"first()\" aria-label=\"Previous\">\r\n <span aria-hidden=\"true\">«</span>\r\n </a>\r\n </li>\r\n @for (page of getPages(); track $index) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"goPage(page)\">{{ page }}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link cursor-pointer\" (click)=\"next()\" aria-label=\"Next\">\r\n <span aria-hidden=\"true\">»</span>\r\n </a>\r\n </li>\r\n </ul>\r\n </nav>\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n</div>", styles: [".custom-pagination{display:flex;justify-content:center;list-style:none;padding:0;margin-top:20px}.custom-pagination .page-item{margin:0 5px}.custom-pagination .page-link{color:#131716;background-color:#f3f3f3;border:1px solid #ccc;padding:8px 12px;border-radius:5px;text-decoration:none;transition:background-color .3s ease}.custom-pagination .page-link:hover{background-color:#0b0c0c;color:#fff}.custom-pagination .page-item.active .page-link{background-color:#131716;color:#fff;font-weight:700}.cursor-pointer{cursor:pointer}\n"] }]
|
|
9410
|
+
}], ctorParameters: () => [{ type: ReviewsService }, { type: CoreConstantsService }], propDecorators: { product: [{
|
|
8898
9411
|
type: Input
|
|
8899
9412
|
}] } });
|
|
8900
9413
|
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
9414
|
+
class ReviewsFormEcComponent extends ComponentHelper {
|
|
9415
|
+
toastrService;
|
|
9416
|
+
router;
|
|
9417
|
+
consts;
|
|
9418
|
+
formBuilder;
|
|
9419
|
+
productService;
|
|
9420
|
+
authService;
|
|
9421
|
+
reviewsService;
|
|
9422
|
+
/**
|
|
9423
|
+
* @description producto al que se le va a agregar la reseña.
|
|
9424
|
+
*/
|
|
9425
|
+
product;
|
|
9426
|
+
/**
|
|
9427
|
+
* @description para controlar si esta logueado.
|
|
9428
|
+
*/
|
|
9429
|
+
withAuthenticated = true;
|
|
9430
|
+
/**
|
|
9431
|
+
* @description número maximo de valor de puntuación
|
|
9432
|
+
*/
|
|
9433
|
+
max = 5;
|
|
9434
|
+
/**
|
|
9435
|
+
* @description para indicar cuando se termino la operación de consulta.
|
|
9436
|
+
*/
|
|
9437
|
+
ready = new EventEmitter();
|
|
9438
|
+
reviews_form;
|
|
9439
|
+
loading = false;
|
|
9440
|
+
form_data = new FormData();
|
|
9441
|
+
limit = [];
|
|
9442
|
+
constructor(toastrService, router, consts, formBuilder, productService, authService, reviewsService) {
|
|
9443
|
+
super();
|
|
9444
|
+
this.toastrService = toastrService;
|
|
9445
|
+
this.router = router;
|
|
9446
|
+
this.consts = consts;
|
|
9447
|
+
this.formBuilder = formBuilder;
|
|
9448
|
+
this.productService = productService;
|
|
9449
|
+
this.authService = authService;
|
|
9450
|
+
this.reviewsService = reviewsService;
|
|
9451
|
+
this.reviews_form = formBuilder.group({
|
|
9452
|
+
title: ['', Validators.required],
|
|
9453
|
+
comment: ['', Validators.required],
|
|
9454
|
+
rating: [0, Validators.required],
|
|
9455
|
+
email: ['', this.withAuthenticated ? [] : [Validators.required, Validators.email]],
|
|
9456
|
+
//attachment: [''],
|
|
9457
|
+
});
|
|
9458
|
+
this.ecOnConstruct(); // Removed as the method does not exist
|
|
9459
|
+
}
|
|
9460
|
+
ngOnInit() {
|
|
9461
|
+
for (let index = 0; index < this.max; index++) {
|
|
9462
|
+
this.limit.push(index + 1);
|
|
9463
|
+
}
|
|
9464
|
+
}
|
|
9465
|
+
/**
|
|
9466
|
+
* @description guarda el valor que contiene la puntuación de la reseña.
|
|
9467
|
+
* @param value
|
|
9468
|
+
*/
|
|
9469
|
+
setRatingValue = (value = 0) => {
|
|
9470
|
+
this.reviews_form.controls['rating'].setValue(value);
|
|
9471
|
+
};
|
|
9472
|
+
/**
|
|
9473
|
+
* @description procesa el formulario con los datos.
|
|
9474
|
+
* @param form
|
|
9475
|
+
* @param success_message mensaje para que se muestre en el caso de exito.
|
|
9476
|
+
*/
|
|
9477
|
+
sendForm = (form, success_message) => {
|
|
9478
|
+
if (form.valid) {
|
|
9479
|
+
this.withAuthenticated ? this.reviews_form.controls['email'].setValue(this.authService.getUserProfileAsUser().email) : null;
|
|
9480
|
+
this.productService.saveReviews(this.product.id, form.value).toPromise().then(res => {
|
|
9481
|
+
this.reviews_form.reset();
|
|
9482
|
+
this.toastrService.show(success_message ? success_message : 'success-review');
|
|
9483
|
+
this.loading = false;
|
|
9484
|
+
this.ready.emit(true);
|
|
9485
|
+
// Queda preparado por si algun dia se quiere manejar sincronismo.
|
|
9486
|
+
//this.updateReviews()
|
|
9487
|
+
}, err => {
|
|
9488
|
+
this.toastrService.show('inquiry-error');
|
|
9489
|
+
this.loading = false;
|
|
9490
|
+
this.ready.emit(true);
|
|
9491
|
+
});
|
|
9492
|
+
}
|
|
9493
|
+
else {
|
|
9494
|
+
this.toastrService.show('invalid-form');
|
|
9495
|
+
this.loading = false;
|
|
9496
|
+
this.ready.emit(true);
|
|
9497
|
+
}
|
|
9498
|
+
};
|
|
9499
|
+
/**
|
|
9500
|
+
* @descirption controla que el usuario este logueado para comentar. Si la variable withAuthenticated es falso entonces no realiza este control.
|
|
9501
|
+
* @param e evento producido por el submit del formulario
|
|
9502
|
+
*/
|
|
9503
|
+
toastReviewsForm = (e, message) => {
|
|
9504
|
+
this.loading = true;
|
|
9505
|
+
e.preventDefault();
|
|
9506
|
+
if (this.withAuthenticated) {
|
|
9507
|
+
this.authService.isAuthenticated() ?
|
|
9508
|
+
this.sendForm(this.reviews_form, message ? message : 'success-review') : this.toastrService.show('authenticated-for-comment');
|
|
9509
|
+
}
|
|
9510
|
+
else {
|
|
9511
|
+
this.sendForm(this.reviews_form, message ? message : 'success-review');
|
|
9512
|
+
}
|
|
9513
|
+
};
|
|
9514
|
+
/**
|
|
9515
|
+
* @description actualiza las reviews
|
|
9516
|
+
* @returns
|
|
9517
|
+
*/
|
|
9518
|
+
updateReviews = () => this.reviewsService.updateReviewsByCode(this.product.id);
|
|
9519
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsFormEcComponent, deps: [{ token: ToastService }, { token: i2.Router }, { token: CoreConstantsService }, { token: i1$3.FormBuilder }, { token: ProductsService }, { token: AuthService }, { token: ReviewsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ReviewsFormEcComponent, isStandalone: true, selector: "app-reviews-form-ec", inputs: { product: "product", withAuthenticated: "withAuthenticated", max: "max" }, outputs: { ready: "ready" }, usesInheritance: true, ngImport: i0, template: "<form class=\"formResenia\" [formGroup]=\"reviews_form\" (submit)=\"toastReviewsForm($event)\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label class=\"pt-2\">{{\"product\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <p class=\"mt-1 mb-3\">{{ product.name }}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Calificaci\u00F3n -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label class=\"pt-2\">{{\"rating\" | translate}}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <div class=\"cont-star mt-1 mb-3\">\r\n @for(star of limit; track $index){\r\n <input type=\"radio\" class=\"d-none\" [id]=\"'star-' + (limit.length - $index)\" [value]=\"limit.length - $index\"\r\n formControlName=\"rating\">\r\n <label class=\"star-label\" [for]=\"'star-' + (limit.length - $index)\">\r\n <i class=\"bi bi-star-fill\"></i>\r\n </label>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Resumen -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label for=\"review-summary\" class=\"pt-2\">{{\"summary\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <textarea id=\"review-summary\" class=\"w-100\" placeholder=\"\u00BFC\u00F3mo fue tu experiencia?\" formControlName=\"title\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <!-- Detalle -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label for=\"review-detail\" class=\"pt-2\">{{\"detail\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <textarea id=\"review-detail\" class=\"w-100\" placeholder=\"Contanos por qu\u00E9\" formControlName=\"comment\"></textarea>\r\n <small class=\"text-uppercase\">(*) {{\"mandatory-fields\" | translate }}</small>\r\n </div>\r\n </div>\r\n\r\n <!-- Bot\u00F3n de env\u00EDo -->\r\n <div class=\"row\">\r\n <div class=\"col-4\"></div>\r\n <div class=\"col-8\">\r\n <button type=\"submit\" class=\"btn btn-dark py-2 px-4 rounded-0 mt-4\"\r\n [disabled]=\"reviews_form.invalid\">{{\"submit-review\" | translate }}</button>\r\n </div>\r\n </div> \r\n</form>", styles: [".cont-star{direction:rtl;unicode-bidi:bidi-override;display:flex;justify-content:end}.cont-star label{display:flex}.cont-star label i{color:#ccc!important;cursor:pointer;font-size:26px;line-height:30px}.cont-star label i:hover,.cont-star label:hover~label i{color:#ffc107!important}input[type=radio]:checked~label i{color:#ffc107!important}input[type=radio]:checked~label i:before,label:hover i:before{content:\"\\f586\"}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
9521
|
+
}
|
|
9522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReviewsFormEcComponent, decorators: [{
|
|
9523
|
+
type: Component,
|
|
9524
|
+
args: [{ selector: 'app-reviews-form-ec', standalone: true, imports: [TranslateModule, ReactiveFormsModule], template: "<form class=\"formResenia\" [formGroup]=\"reviews_form\" (submit)=\"toastReviewsForm($event)\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label class=\"pt-2\">{{\"product\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <p class=\"mt-1 mb-3\">{{ product.name }}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Calificaci\u00F3n -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label class=\"pt-2\">{{\"rating\" | translate}}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <div class=\"cont-star mt-1 mb-3\">\r\n @for(star of limit; track $index){\r\n <input type=\"radio\" class=\"d-none\" [id]=\"'star-' + (limit.length - $index)\" [value]=\"limit.length - $index\"\r\n formControlName=\"rating\">\r\n <label class=\"star-label\" [for]=\"'star-' + (limit.length - $index)\">\r\n <i class=\"bi bi-star-fill\"></i>\r\n </label>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Resumen -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label for=\"review-summary\" class=\"pt-2\">{{\"summary\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <textarea id=\"review-summary\" class=\"w-100\" placeholder=\"\u00BFC\u00F3mo fue tu experiencia?\" formControlName=\"title\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <!-- Detalle -->\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <label for=\"review-detail\" class=\"pt-2\">{{\"detail\" | translate }}*</label>\r\n </div>\r\n <div class=\"col-8\">\r\n <textarea id=\"review-detail\" class=\"w-100\" placeholder=\"Contanos por qu\u00E9\" formControlName=\"comment\"></textarea>\r\n <small class=\"text-uppercase\">(*) {{\"mandatory-fields\" | translate }}</small>\r\n </div>\r\n </div>\r\n\r\n <!-- Bot\u00F3n de env\u00EDo -->\r\n <div class=\"row\">\r\n <div class=\"col-4\"></div>\r\n <div class=\"col-8\">\r\n <button type=\"submit\" class=\"btn btn-dark py-2 px-4 rounded-0 mt-4\"\r\n [disabled]=\"reviews_form.invalid\">{{\"submit-review\" | translate }}</button>\r\n </div>\r\n </div> \r\n</form>", styles: [".cont-star{direction:rtl;unicode-bidi:bidi-override;display:flex;justify-content:end}.cont-star label{display:flex}.cont-star label i{color:#ccc!important;cursor:pointer;font-size:26px;line-height:30px}.cont-star label i:hover,.cont-star label:hover~label i{color:#ffc107!important}input[type=radio]:checked~label i{color:#ffc107!important}input[type=radio]:checked~label i:before,label:hover i:before{content:\"\\f586\"}\n"] }]
|
|
9525
|
+
}], ctorParameters: () => [{ type: ToastService }, { type: i2.Router }, { type: CoreConstantsService }, { type: i1$3.FormBuilder }, { type: ProductsService }, { type: AuthService }, { type: ReviewsService }], propDecorators: { product: [{
|
|
9526
|
+
type: Input
|
|
9527
|
+
}], withAuthenticated: [{
|
|
9528
|
+
type: Input
|
|
9529
|
+
}], max: [{
|
|
9530
|
+
type: Input
|
|
9531
|
+
}], ready: [{
|
|
9532
|
+
type: Output
|
|
9533
|
+
}] } });
|
|
9534
|
+
|
|
9535
|
+
class SectionContainerEcComponent extends ComponentHelper {
|
|
9536
|
+
content_html = "<p>Sin información</p>";
|
|
9537
|
+
loadSection = false;
|
|
9538
|
+
sanitizeHtml = false;
|
|
9539
|
+
name = null;
|
|
9540
|
+
dataSection;
|
|
9541
|
+
sections = [];
|
|
9542
|
+
optionsService = inject(OptionsService);
|
|
9543
|
+
activatedRoute = inject(ActivatedRoute);
|
|
9544
|
+
toastrService = inject(ToastrService);
|
|
9545
|
+
sanitizer = inject(DomSanitizer);
|
|
9546
|
+
constructor() {
|
|
9547
|
+
super();
|
|
9548
|
+
this.optionsService.getSections();
|
|
9549
|
+
this.ecOnConstruct();
|
|
9550
|
+
}
|
|
9551
|
+
ngOnInit() {
|
|
9552
|
+
if (this.name) {
|
|
9553
|
+
this.getSection(this.name);
|
|
9554
|
+
this.getDataSection(this.name);
|
|
9555
|
+
//console.log('con parametro')
|
|
9556
|
+
}
|
|
9557
|
+
else {
|
|
9558
|
+
this.activatedRoute.params.subscribe(params => {
|
|
9559
|
+
this.name = params['name'];
|
|
9560
|
+
this.getSection(this.name);
|
|
9561
|
+
this.getDataSection(this.name);
|
|
9562
|
+
//console.log('sin parametro', this.name)
|
|
9563
|
+
});
|
|
9564
|
+
}
|
|
9565
|
+
this.ecOnInit();
|
|
9566
|
+
}
|
|
9567
|
+
getSection = (link) => {
|
|
9568
|
+
this.loadSection = false;
|
|
9569
|
+
this.optionsService.getSectionContentByLink(link).toPromise().then((html) => {
|
|
9570
|
+
if (html)
|
|
9571
|
+
this.content_html =
|
|
9572
|
+
this.sanitizeHtml
|
|
9573
|
+
? html
|
|
9574
|
+
: this.sanitizer.bypassSecurityTrustHtml(html);
|
|
9575
|
+
this.loadSection = true;
|
|
9576
|
+
}, (error) => {
|
|
9577
|
+
console.log(error);
|
|
9578
|
+
this.loadSection = true;
|
|
9579
|
+
this.content_html = "<p>Sin información</p>";
|
|
9580
|
+
this.toastrService.show('No fue posible encontrar la sección solicitada');
|
|
9581
|
+
}).catch((error) => {
|
|
9582
|
+
this.content_html = "<p>Sin información</p>";
|
|
9583
|
+
this.loadSection = true;
|
|
9584
|
+
});
|
|
9585
|
+
};
|
|
9586
|
+
getDataSection = (code) => {
|
|
9587
|
+
this.dataSection = this.sections.find(section => section.code == code);
|
|
9588
|
+
};
|
|
9589
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SectionContainerEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9590
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: SectionContainerEcComponent, isStandalone: true, selector: "app-section-container-ec", inputs: { sanitizeHtml: "sanitizeHtml", name: "name" }, usesInheritance: true, ngImport: i0, template: "<div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"scrol-if\">\r\n @if (loadSection){\r\n <div [innerHtml]=\"content_html\"></div>\r\n } @else {\r\n <div class=\"col-12 align-items-center\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center my-5\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"name\"></app-blocks-ec>", styles: [".custom-page{background-color:#fff!important;padding-top:5%!important;padding-bottom:5%!important}.scrol-if{overflow:auto}\n"], dependencies: [{ kind: "component", type: BlocksEcComponent, selector: "app-blocks-ec", inputs: ["templates", "show_loading", "section", "blockFilters"] }, { kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }] });
|
|
9591
|
+
}
|
|
9592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SectionContainerEcComponent, decorators: [{
|
|
9593
|
+
type: Component,
|
|
9594
|
+
args: [{ selector: 'app-section-container-ec', standalone: true, imports: [BlocksEcComponent, LoadingFullEcComponent], template: "<div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"scrol-if\">\r\n @if (loadSection){\r\n <div [innerHtml]=\"content_html\"></div>\r\n } @else {\r\n <div class=\"col-12 align-items-center\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center my-5\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"name\"></app-blocks-ec>", styles: [".custom-page{background-color:#fff!important;padding-top:5%!important;padding-bottom:5%!important}.scrol-if{overflow:auto}\n"] }]
|
|
9595
|
+
}], ctorParameters: () => [], propDecorators: { sanitizeHtml: [{
|
|
9596
|
+
type: Input
|
|
9597
|
+
}], name: [{
|
|
9598
|
+
type: Input
|
|
9599
|
+
}] } });
|
|
8904
9600
|
|
|
8905
9601
|
//Types
|
|
8906
9602
|
|
|
@@ -9151,5 +9847,5 @@ const directives = [
|
|
|
9151
9847
|
* Generated bundle index. Do not edit.
|
|
9152
9848
|
*/
|
|
9153
9849
|
|
|
9154
|
-
export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, FacebookPixelService, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, ParamsContext, PaymentService, PriceEcComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductOffDirective, ProductStockDirective, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, RelatedProductsEcComponent, ShipmentService, SidebarEcComponent, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, directives, provideEnvironment };
|
|
9850
|
+
export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, FacebookPixelService, FaqsEcComponent, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, ParamsContext, PaymentService, PriceEcComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductOffDirective, ProductStockDirective, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, RelatedProductsEcComponent, ReviewsEcComponent, ReviewsFormEcComponent, SectionContainerEcComponent, ShareEcComponent, ShipmentService, SidebarEcComponent, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, directives, provideEnvironment };
|
|
9155
9851
|
//# sourceMappingURL=ng-easycommerce-v18.mjs.map
|