ng-easycommerce 0.0.445 → 0.0.448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/bundles/ng-easycommerce.umd.js +167 -15
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/core.consts.js +20 -2
- package/esm2015/lib/ec-component/account-ec/orders-list-ec/orders-list-ec.component.js +99 -3
- package/esm2015/lib/ec-component/build-your-ec/build-your-ec.component.js +36 -5
- package/esm2015/lib/ec-component/checkout-ec/step-ec/step-ec.component.js +3 -3
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +4 -3
- package/esm2015/lib/ec-component/header-ec/header-ec.component.js +3 -3
- package/esm2015/lib/ec-component/section-container-ec/section-container-ec.component.js +3 -3
- package/esm2015/lib/interfaces/filter.js +1 -1
- package/esm2015/lib/interfaces/filterStep.js +1 -1
- package/esm5/lib/core.consts.js +20 -2
- package/esm5/lib/ec-component/account-ec/orders-list-ec/orders-list-ec.component.js +99 -3
- package/esm5/lib/ec-component/build-your-ec/build-your-ec.component.js +38 -5
- package/esm5/lib/ec-component/checkout-ec/step-ec/step-ec.component.js +3 -3
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +4 -3
- package/esm5/lib/ec-component/header-ec/header-ec.component.js +7 -3
- package/esm5/lib/ec-component/section-container-ec/section-container-ec.component.js +3 -3
- package/esm5/lib/interfaces/filter.js +1 -1
- package/esm5/lib/interfaces/filterStep.js +1 -1
- package/fesm2015/ng-easycommerce.js +161 -15
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +167 -15
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +18 -1
- package/lib/ec-component/account-ec/orders-list-ec/orders-list-ec.component.d.ts +38 -0
- package/lib/ec-component/build-your-ec/build-your-ec.component.d.ts +12 -0
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +1 -0
- package/lib/ec-component/header-ec/header-ec.component.d.ts +1 -1
- package/lib/interfaces/filter.d.ts +11 -0
- package/lib/interfaces/filterStep.d.ts +7 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# version 0.0.448
|
|
2
|
+
- Se agrega la funcionalidad para poder ordenar por columnas las ordenes de los clientes.
|
|
3
|
+
- Se modifica la funcion setSearchValue de header-ec para que acepte una funcion que se ejecuta al presionar enter.
|
|
4
|
+
- Se arregla el problema de estilos en los botones del checkout.
|
|
5
|
+
|
|
6
|
+
# version 0.0.447
|
|
7
|
+
- Se actualiza el componente de build-your-ec para que trabaje con la toma de los filtros de atributos.
|
|
8
|
+
|
|
9
|
+
# version 0.0.446
|
|
10
|
+
- Se agrega la opcion de aplicar filtros por defectos al ingresar a la seccion de Collection.
|
|
11
|
+
|
|
1
12
|
# version 0.0.445
|
|
2
13
|
- Se crea el componente reviews-ec para el manejo de los datos de las reviews de un producto.
|
|
3
14
|
- Se crea el componente reviews-form-ec para todo lo que tenga que ver con guardar una opinion para un producto.
|
|
@@ -254,7 +254,12 @@
|
|
|
254
254
|
* Execute the function passed as params, if the frontend is in production mode
|
|
255
255
|
*/
|
|
256
256
|
this.onlyIfProduction = function (next, params) { return _this.isProduction() && next(params); };
|
|
257
|
-
|
|
257
|
+
/**
|
|
258
|
+
* @description Devuelve la url base donde se alojan los archivos multimedia
|
|
259
|
+
* @param postMedia carpeta donde se guardan los archivos
|
|
260
|
+
* @returns
|
|
261
|
+
*/
|
|
262
|
+
this.mediaUrl = function (postMedia) { return _this.urlAssets + (_this.urlAssets == _this.urlBase ? 'media/' : '') + (postMedia ? postMedia : "image/"); };
|
|
258
263
|
this.mediaBannerUrl = function () { return _this.urlAssets + (_this.urlAssets == _this.urlBase ? 'media/' : '') + "banner-image/"; };
|
|
259
264
|
this.mediaStoreUrl = function () { return _this.urlAssets + (_this.urlAssets == _this.urlBase ? 'media/' : '') + "store-image/"; };
|
|
260
265
|
this.getProductsListRoute = function () { return 'collection/'; };
|
|
@@ -430,6 +435,19 @@
|
|
|
430
435
|
_this.setCurrency(channelConfig.currency || channelConfig.baseCurrency);
|
|
431
436
|
return channelConfig;
|
|
432
437
|
};
|
|
438
|
+
/**
|
|
439
|
+
* @description Se utiliza para configurar los filtros por defecto que se aplicaran en la seccion 'Collection'
|
|
440
|
+
* cuando se ingresa a la misma.
|
|
441
|
+
*/
|
|
442
|
+
this.defaultFilters = [];
|
|
443
|
+
/**
|
|
444
|
+
* @description Settea el valor de la variable defaulFilters.
|
|
445
|
+
* @param filters
|
|
446
|
+
*/
|
|
447
|
+
this.setDefaultFilters = function (filters) {
|
|
448
|
+
_this.defaultFilters = filters;
|
|
449
|
+
};
|
|
450
|
+
this.getDefaultFilters = function () { return _this.defaultFilters; };
|
|
433
451
|
}
|
|
434
452
|
/**
|
|
435
453
|
*
|
|
@@ -7603,6 +7621,7 @@
|
|
|
7603
7621
|
return { type: 'color', code: 'color', defaultFirstOption: false, checkIfStock: true };
|
|
7604
7622
|
};
|
|
7605
7623
|
_this.paramsSrv.parameters.subscribe(function (param) { return _this.params = param; });
|
|
7624
|
+
_this.defaultFilters = _this.consts.getDefaultFilters();
|
|
7606
7625
|
_this.ecOnConstruct();
|
|
7607
7626
|
return _this;
|
|
7608
7627
|
}
|
|
@@ -7620,10 +7639,10 @@
|
|
|
7620
7639
|
var cambio_1 = false;
|
|
7621
7640
|
_this.products = [];
|
|
7622
7641
|
if (!params['type'] || !params['value']) {
|
|
7623
|
-
_this.productsService.getProductsForFilter({ latest: true, limit: 10 }, _this.optionsFilters, queryParams.search);
|
|
7642
|
+
_this.productsService.getProductsForFilter({ latest: true, limit: 10 }, _this.optionsFilters, queryParams.search, _this.defaultFilters);
|
|
7624
7643
|
}
|
|
7625
7644
|
else {
|
|
7626
|
-
_this.productsService.getProductsForFilter({ type: params.type, value: params.value }, _this.optionsFilters, queryParams.search);
|
|
7645
|
+
_this.productsService.getProductsForFilter({ type: params.type, value: params.value }, _this.optionsFilters, queryParams.search, _this.defaultFilters);
|
|
7627
7646
|
cambio_1 = true;
|
|
7628
7647
|
_this.type = params['type'];
|
|
7629
7648
|
_this.value = params['value'];
|
|
@@ -8227,8 +8246,12 @@
|
|
|
8227
8246
|
_this.authService.logout();
|
|
8228
8247
|
_this.router.navigateByUrl('home');
|
|
8229
8248
|
};
|
|
8230
|
-
_this.setSearchValue = function (event) {
|
|
8231
|
-
|
|
8249
|
+
_this.setSearchValue = function (event, afterSearch) {
|
|
8250
|
+
var args = [];
|
|
8251
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
8252
|
+
args[_i - 2] = arguments[_i];
|
|
8253
|
+
}
|
|
8254
|
+
event.key == 'Enter' && _this.getCollectionSearch() && (afterSearch ? afterSearch(args) : null);
|
|
8232
8255
|
_this.searchValue = event.target.value;
|
|
8233
8256
|
};
|
|
8234
8257
|
_this.getCollectionSearch = function () { return _this.router.navigateByUrl('/collection?search=' + _this.searchValue); };
|
|
@@ -9269,14 +9292,14 @@
|
|
|
9269
9292
|
if (this.name) {
|
|
9270
9293
|
this.getSection(this.name);
|
|
9271
9294
|
this.getDataSection(this.name);
|
|
9272
|
-
console.log('con parametro')
|
|
9295
|
+
//console.log('con parametro')
|
|
9273
9296
|
}
|
|
9274
9297
|
else {
|
|
9275
9298
|
this.activatedRoute.params.subscribe(function (params) {
|
|
9276
9299
|
_this.name = params.name;
|
|
9277
9300
|
_this.getSection(_this.name);
|
|
9278
9301
|
_this.getDataSection(_this.name);
|
|
9279
|
-
console.log('sin parametro',
|
|
9302
|
+
//console.log('sin parametro', this.name)
|
|
9280
9303
|
});
|
|
9281
9304
|
}
|
|
9282
9305
|
this.ecOnInit();
|
|
@@ -10725,6 +10748,21 @@
|
|
|
10725
10748
|
_this.router = router;
|
|
10726
10749
|
_this.consts = consts;
|
|
10727
10750
|
_this.loading = true;
|
|
10751
|
+
/**
|
|
10752
|
+
* @description name -> nombre de clave de valuesToSort; asc -> true: ascendente, false: descendente
|
|
10753
|
+
*/
|
|
10754
|
+
_this.currentSort = { name: '', asc: true };
|
|
10755
|
+
/**
|
|
10756
|
+
* @description true -> ordena de forma ascendente | false -> ordena de forma decreciente
|
|
10757
|
+
*/
|
|
10758
|
+
_this.valuesToSort = {
|
|
10759
|
+
number: { asc: true, attribute: 'number' },
|
|
10760
|
+
paymentState: { asc: true, attribute: 'state' },
|
|
10761
|
+
method: { asc: true, attribute: 'method', subAttribute: 'name' },
|
|
10762
|
+
methodState: { asc: true, attribute: 'state' },
|
|
10763
|
+
date: { asc: true, attribute: 'checkoutCompletedAt' },
|
|
10764
|
+
total: { asc: true, attribute: 'total' }
|
|
10765
|
+
};
|
|
10728
10766
|
_this.sortedByNewest = function (orders) { return orders && orders.length && orders.sort(function (anOrder, otherOrder) { return anOrder.number > otherOrder.number ? -1 : 1; }); };
|
|
10729
10767
|
_this.goToOrder = function (order) {
|
|
10730
10768
|
_this.ordersService.setSelectedOrder(order);
|
|
@@ -10751,6 +10789,87 @@
|
|
|
10751
10789
|
}
|
|
10752
10790
|
}
|
|
10753
10791
|
};
|
|
10792
|
+
/**
|
|
10793
|
+
* @description Ordena la lista de ordenes
|
|
10794
|
+
* @param value recibe una valor que debe coincidir con las claves de la variable valuesToSort
|
|
10795
|
+
*/
|
|
10796
|
+
_this.sortOrders = function (value) {
|
|
10797
|
+
_this.sortValue = value;
|
|
10798
|
+
_this.setCurrentSort(_this.sortValue, _this.valuesToSort[_this.sortValue].asc);
|
|
10799
|
+
var comparator = (_this.valuesToSort[_this.sortValue].asc)
|
|
10800
|
+
? [-1, 1]
|
|
10801
|
+
: [1, -1];
|
|
10802
|
+
_this.valuesToSort[_this.sortValue].asc = !_this.valuesToSort[_this.sortValue].asc;
|
|
10803
|
+
var typeValue;
|
|
10804
|
+
if (_this.orders.length > 0) {
|
|
10805
|
+
typeValue = typeof (_this.orders[0]);
|
|
10806
|
+
}
|
|
10807
|
+
var sortFunction = _this.getSortFunction(_this.sortValue);
|
|
10808
|
+
_this.orders =
|
|
10809
|
+
_this.sortValue
|
|
10810
|
+
? _this.orders.sort(function (aOrders, otherOrders) { return sortFunction(aOrders, otherOrders, _this.valuesToSort[_this.sortValue], comparator); })
|
|
10811
|
+
: _this.orders;
|
|
10812
|
+
};
|
|
10813
|
+
/**
|
|
10814
|
+
* @description retorna la funcion que se debe utilizar para el sort del arreglo
|
|
10815
|
+
* @param value parametro que indica el tipo de funcion que debe retornar
|
|
10816
|
+
* @returns funcion para utilizar en la busqueda
|
|
10817
|
+
*/
|
|
10818
|
+
_this.getSortFunction = function (value) {
|
|
10819
|
+
switch (value) {
|
|
10820
|
+
case 'paymentState':
|
|
10821
|
+
return _this.sortPaymentState;
|
|
10822
|
+
case 'method':
|
|
10823
|
+
return _this.sortShipments;
|
|
10824
|
+
case 'methodState':
|
|
10825
|
+
return _this.sortShipments;
|
|
10826
|
+
case 'total':
|
|
10827
|
+
return _this.sortNumber;
|
|
10828
|
+
default:
|
|
10829
|
+
return _this.sortText;
|
|
10830
|
+
}
|
|
10831
|
+
};
|
|
10832
|
+
/* Funciones para ordernar */
|
|
10833
|
+
_this.sortPaymentState = function (aOrders, otherOrders, data, comparator) {
|
|
10834
|
+
return (aOrders.payments[0][data.attribute] == otherOrders.payments[0][data.attribute])
|
|
10835
|
+
? _this.tieBreaker(aOrders, otherOrders, comparator)
|
|
10836
|
+
: String(aOrders.payments[0][data.attribute]).toLowerCase() < String(otherOrders.payments[0][data.attribute]).toLowerCase() ? comparator[0] : comparator[1];
|
|
10837
|
+
};
|
|
10838
|
+
_this.sortShipments = function (aOrders, otherOrders, data, comparator) {
|
|
10839
|
+
if (data.subAttribute) {
|
|
10840
|
+
return (aOrders.shipments[0][data.attribute][data.subAttribute] == otherOrders.shipments[0][data.attribute][data.subAttribute])
|
|
10841
|
+
? _this.tieBreaker(aOrders, otherOrders, comparator)
|
|
10842
|
+
: String(aOrders.shipments[0][data.attribute][data.subAttribute]).toLowerCase() < String(otherOrders.shipments[0][data.attribute][data.subAttribute]).toLowerCase() ? comparator[0] : comparator[1];
|
|
10843
|
+
}
|
|
10844
|
+
else {
|
|
10845
|
+
return (aOrders.shipments[0][data.attribute] == otherOrders.shipments[0][data.attribute])
|
|
10846
|
+
? _this.tieBreaker(aOrders, otherOrders, comparator)
|
|
10847
|
+
: String(aOrders.shipments[0][data.attribute]).toLowerCase() < String(otherOrders.shipments[0][data.attribute]).toLowerCase() ? comparator[0] : comparator[1];
|
|
10848
|
+
}
|
|
10849
|
+
};
|
|
10850
|
+
_this.sortNumber = function (aOrders, otherOrders, data, comparator) { return aOrders[data.attribute] < otherOrders[data.attribute] ? comparator[0] : comparator[1]; };
|
|
10851
|
+
_this.sortText = function (aOrders, otherOrders, data, comparator) {
|
|
10852
|
+
return (aOrders[data.attribute] == otherOrders[data.attribute])
|
|
10853
|
+
? aOrders.number.toLowerCase() < otherOrders.number.toLowerCase() ? comparator[0] : comparator[1]
|
|
10854
|
+
: String(aOrders[data.attribute]).toLowerCase() < String(otherOrders[data.attribute]).toLowerCase() ? comparator[0] : comparator[1];
|
|
10855
|
+
};
|
|
10856
|
+
/**
|
|
10857
|
+
* @description funcion utilizada para desempate.
|
|
10858
|
+
* @param aOrders
|
|
10859
|
+
* @param otherOrders
|
|
10860
|
+
* @param comparator
|
|
10861
|
+
* @returns
|
|
10862
|
+
*/
|
|
10863
|
+
_this.tieBreaker = function (aOrders, otherOrders, comparator) { return aOrders.number.toLowerCase() < otherOrders.number.toLowerCase() ? comparator[0] : comparator[1]; };
|
|
10864
|
+
/**
|
|
10865
|
+
* @description cambia los valores de la variable currentSort
|
|
10866
|
+
* @param name
|
|
10867
|
+
* @param asc
|
|
10868
|
+
*/
|
|
10869
|
+
_this.setCurrentSort = function (name, asc) {
|
|
10870
|
+
_this.currentSort.name = name;
|
|
10871
|
+
_this.currentSort.asc = asc;
|
|
10872
|
+
};
|
|
10754
10873
|
_this.mediaUrl = _this.consts.mediaUrl();
|
|
10755
10874
|
_this.ecOnConstruct();
|
|
10756
10875
|
return _this;
|
|
@@ -10776,8 +10895,8 @@
|
|
|
10776
10895
|
OrdersEcComponent = __decorate$1g([
|
|
10777
10896
|
core.Component({
|
|
10778
10897
|
selector: 'app-orders-ec',
|
|
10779
|
-
template: "<div class=\"container-fluid\" id=\"ordersEcComponent\">\n <section id=\"orders\" class=\"w-100\" *ngIf=\"!loading; else loadingView\">\n <div *ngIf=\"orders && orders.length; else noOrders\">\n <div class=\"row
|
|
10780
|
-
styles: ["#ordersEcComponent .btn.btdetalle{background-color:#000;color:#fff;border-color:#000;border-width:1px;border-radius:10px;padding:10px 0}#ordersEcComponent .btn.btdetalle:hover{background-color:#fff;color:#000;border-color:#000}"]
|
|
10898
|
+
template: "<div class=\"container-fluid\" id=\"ordersEcComponent\">\n <section id=\"orders\" class=\"w-100\" *ngIf=\"!loading; else loadingView\">\n <div *ngIf=\"orders && orders.length; else noOrders\">\n <div class=\"row mb-1 border-bottom\">\n <div class=\"col-lg-2 col-12\">\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'number' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('number')\">{{ 'order' | translate }}:</p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'paymentState' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('paymentState')\">{{ 'payment-state' | translate }}:</p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'method' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('method')\">{{ 'shipment-method' | translate }}:</p>\n </div>\n <div class=\"col-lg-2 col-12 \">\n <p\n [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'methodState' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('methodState')\">\n {{ 'shipment-state' | translate }}:</p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'date' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('date')\">{{ 'date' | translate }}:</p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'total' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\n (click)=\"sortOrders('total')\">{{ 'total' | translate }}:</p>\n </div>\n </div>\n <div class=\"row item border-bottom\" *ngFor=\"let order of orders\">\n <div class=\"col-lg-2 col-12\">\n <h5 class=\"fw-bold\">\n {{ order.number }}\n </h5>\n <ng-container *ngIf=\"order.items[0].product.variants[0]?.images?.length ; else defaultpicture\">\n <img class=\"smc maxwidth\" [src]=\"mediaUrl + order.items[0].product.variants[0].images[0]\" alt=\"\">\n </ng-container>\n <ng-template #defaultpicture>\n <img *ngIf=\"order.items[0].product.picturesdefault\" class=\"smc maxwidth\"\n [src]=\"mediaUrl + order.items[0].product.picturesdefault[0]\" alt=\"\">\n </ng-template>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p class=\"price\">\n {{ order.payments[0].state | translate | titlecase }}\n </p>\n </div>\n <div class=\"col-lg-2 col-12\">\n \n <p class=\"price\">\n {{ order.shipments[0].method.name }}\n </p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p class=\"price\">\n {{ order.shipments[0].state | translate | titlecase }}\n </p>\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\n <!-- <button class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver seguimiento</button> -->\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\" class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver seguimiento</a>\n </div>\n <div class=\"col-lg-2 col-12\">\n <p class=\"price\">\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\n </p>\n </div>\n <div class=\"col-lg-2 col-12\">\n <h5 class=\"fw-bold text-nowrap\">\n {{ (order.totals.total) | ecCurrencySymbol }}\n </h5>\n <button class=\"btn px-0 w-100 btdetalle\" (click)=\"goToOrder(order)\">{{\n 'see-order' | translate }}</button>\n </div>\n </div>\n </div>\n </section>\n</div>\n\n<ng-template #noOrders>\n <div class=\"w-100 h-50\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <h5>{{ 'no-orders' | translate }}</h5>\n </div>\n </div>\n</ng-template>\n\n<ng-template #errorView>\n <div class=\"w-100 h-50\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <h4>{{ 'orders-error' | translate }}</h4>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingView>\n <div class=\"w-100 h-50 py-5\">\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\n <app-loading-full-ec></app-loading-full-ec>\n </div>\n </div>\n</ng-template>",
|
|
10899
|
+
styles: ["#ordersEcComponent .btn.btdetalle{background-color:#000;color:#fff;border-color:#000;border-width:1px;border-radius:10px;padding:10px 0}#ordersEcComponent .btn.btdetalle:hover{background-color:#fff;color:#000;border-color:#000}.asc.dropdown-toggle::after{transform:rotate(180deg)}.applied.dropdown-toggle::after{color:#198754}"]
|
|
10781
10900
|
})
|
|
10782
10901
|
], OrdersEcComponent);
|
|
10783
10902
|
return OrdersEcComponent;
|
|
@@ -13994,12 +14113,44 @@
|
|
|
13994
14113
|
* @param item step para obtener los datos.
|
|
13995
14114
|
*/
|
|
13996
14115
|
_this.itemValuesFactory = function (item) {
|
|
14116
|
+
item.values = _this.getValuesByFilter(item);
|
|
14117
|
+
};
|
|
14118
|
+
/**
|
|
14119
|
+
* @description retorna los valores del filtro segun el tipo.
|
|
14120
|
+
* @param item filtro
|
|
14121
|
+
* @returns retorna un arreglo con las opciones del filtro.
|
|
14122
|
+
*/
|
|
14123
|
+
_this.getValuesByFilter = function (item) {
|
|
14124
|
+
switch (item.type) {
|
|
14125
|
+
case 'optionProduct':
|
|
14126
|
+
//parche temporal
|
|
14127
|
+
item.productOption.values.forEach(function (elem) {
|
|
14128
|
+
return elem.image.toLowerCase().includes('product_option_value_translation_image/') ?
|
|
14129
|
+
elem.image = elem.image.split('product_option_value_translation_image/')[1] : null;
|
|
14130
|
+
});
|
|
14131
|
+
return item.productOption.values;
|
|
14132
|
+
case 'attribute':
|
|
14133
|
+
return item.attribute.children;
|
|
14134
|
+
case 'taxon':
|
|
14135
|
+
//this.optionsService.categories.subscribe(res => item.values = res)
|
|
14136
|
+
//this.productsService.getProductsForFilter({ latest: true, limit: 10 }, ['category'], '999');
|
|
14137
|
+
break;
|
|
14138
|
+
default:
|
|
14139
|
+
break;
|
|
14140
|
+
}
|
|
14141
|
+
};
|
|
14142
|
+
/**
|
|
14143
|
+
* @description cambia el contenido de los valores de los filtros, segun el tipo de filtro.
|
|
14144
|
+
* @param item filtro
|
|
14145
|
+
* @param values arreglo con los valores de las opciones
|
|
14146
|
+
*/
|
|
14147
|
+
_this.setValuesByFilter = function (item, values) {
|
|
13997
14148
|
switch (item.type) {
|
|
13998
14149
|
case 'optionProduct':
|
|
13999
|
-
item.values =
|
|
14150
|
+
item.productOption.values = values;
|
|
14000
14151
|
break;
|
|
14001
14152
|
case 'attribute':
|
|
14002
|
-
|
|
14153
|
+
item.attribute.children = values;
|
|
14003
14154
|
break;
|
|
14004
14155
|
case 'taxon':
|
|
14005
14156
|
//this.optionsService.categories.subscribe(res => item.values = res)
|
|
@@ -14086,7 +14237,7 @@
|
|
|
14086
14237
|
}
|
|
14087
14238
|
else {
|
|
14088
14239
|
_this.stepList[_this.currentPosition].current = true;
|
|
14089
|
-
_this.stepList[_this.currentPosition]
|
|
14240
|
+
_this.setValuesByFilter(_this.stepList[_this.currentPosition], _this.getValuesByFilter(_this.currentStep));
|
|
14090
14241
|
_this.itemValuesFactory(_this.stepList[_this.currentPosition]);
|
|
14091
14242
|
_this.itemCurrentSelected = '';
|
|
14092
14243
|
}
|
|
@@ -14097,6 +14248,7 @@
|
|
|
14097
14248
|
*/
|
|
14098
14249
|
_this.prev = function (index) {
|
|
14099
14250
|
if (index === void 0) { index = -1; }
|
|
14251
|
+
_this.noMoreCoincidences = false;
|
|
14100
14252
|
_this.stepList[_this.currentPosition].current = false;
|
|
14101
14253
|
_this.stepList[_this.currentPosition].touched = false;
|
|
14102
14254
|
if (index >= 0) {
|
|
@@ -14133,7 +14285,7 @@
|
|
|
14133
14285
|
* @param item filtro/paso
|
|
14134
14286
|
* @returns los valores asociados a la opcion elegida
|
|
14135
14287
|
*/
|
|
14136
|
-
_this.getAssociatedData = function (code, item) { return item.
|
|
14288
|
+
_this.getAssociatedData = function (code, item) { return _this.getValuesByFilter(item).find(function (elem) { return elem.code == code; }); };
|
|
14137
14289
|
/**
|
|
14138
14290
|
* @description actualiza la lista de pasos.
|
|
14139
14291
|
* @param list
|
|
@@ -14530,8 +14682,8 @@
|
|
|
14530
14682
|
StepEcComponent = __decorate$1J([
|
|
14531
14683
|
core.Component({
|
|
14532
14684
|
selector: 'app-step-ec',
|
|
14533
|
-
template: "<ng-container [ngSwitch]=\"step_id\">\n\n <ng-container *ngSwitchCase=\"1\">\n <app-dataform-ec [step_id]=\"1\">\n </app-dataform-ec>\n <div class=\"checkout-btn-unique text-end\">\n <button *ngIf=\"isStepReady('address')\" class=\"btn valid-btn\"\n (click)=\"nextStep()\"> {{(lastStep ? 'finish-checkout' : 'ready-form')|translate}}</button>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <ng-container *ngIf=\"isStepReady('address')\">\n <app-shipment-ec [step_id]=\"2\">\n </app-shipment-ec>\n <div class=\"checkout-btn-container mt-2\">\n <button class=\"btn valid-btn\" (click)=\"goBack()\">{{'back'|translate}}</button>\n <ng-container *ngIf=\"(checkoutService.order$ | async) as order\">\n <button *ngIf=\"isStepReady('shipment')\" (click)=\"nextStep()\"\n class=\"btn valid-btn float-end\">{{ (lastStep ? 'finish-checkout' : 'ready-form') |translate}}\n </button>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"3\">\n <ng-container *ngIf=\"isStepReady(previousStep)\">\n <app-payment-ec [step_id]=\"3\">\n </app-payment-ec>\n <div class=\"checkout-btn-container mt-2\">\n <button class=\"btn valid-btn\"\n (click)=\"goBack()\">{{'back'|translate}}</button>\n </div>\n </ng-container>\n </ng-container>\n\n</ng-container>\n",
|
|
14534
|
-
styles: [""]
|
|
14685
|
+
template: "<ng-container [ngSwitch]=\"step_id\">\n\n <ng-container *ngSwitchCase=\"1\">\n <app-dataform-ec [step_id]=\"1\">\n </app-dataform-ec>\n <div class=\"checkout-btn-unique text-end\">\n <button *ngIf=\"isStepReady('address')\" class=\"btn valid-btn mt-2\"\n (click)=\"nextStep()\"> {{(lastStep ? 'finish-checkout' : 'ready-form')|translate}}</button>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <ng-container *ngIf=\"isStepReady('address')\">\n <app-shipment-ec [step_id]=\"2\">\n </app-shipment-ec>\n <div class=\"checkout-btn-container mt-2\">\n <button class=\"btn valid-btn\" (click)=\"goBack()\">{{'back'|translate}}</button>\n <ng-container *ngIf=\"(checkoutService.order$ | async) as order\">\n <button *ngIf=\"isStepReady('shipment')\" (click)=\"nextStep()\"\n class=\"btn valid-btn float-end\">{{ (lastStep ? 'finish-checkout' : 'ready-form') |translate}}\n </button>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"3\">\n <ng-container *ngIf=\"isStepReady(previousStep)\">\n <app-payment-ec [step_id]=\"3\">\n </app-payment-ec>\n <div class=\"checkout-btn-container mt-2\">\n <button class=\"btn valid-btn\"\n (click)=\"goBack()\">{{'back'|translate}}</button>\n </div>\n </ng-container>\n </ng-container>\n\n</ng-container>\n",
|
|
14686
|
+
styles: [".btn:disabled{opacity:.65}.btn.valid-btn{background-color:#000;color:#fff;margin-right:12px}"]
|
|
14535
14687
|
})
|
|
14536
14688
|
], StepEcComponent);
|
|
14537
14689
|
return StepEcComponent;
|