ng-easycommerce 0.0.443 → 0.0.444
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 +5 -0
- package/bundles/ng-easycommerce.umd.js +156 -46
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/build-your-ec/build-your-ec.component.js +65 -22
- package/esm2015/lib/ec-component/build-your-ec/product-found-ec/product-found-ec.component.js +13 -1
- package/esm2015/lib/ec-component/header-ec/header-ec.component.js +17 -2
- package/esm2015/lib/ec-component/section-container-ec/section-container-ec.component.js +9 -1
- package/esm2015/lib/services/concatenated-associations.service.js +23 -3
- package/esm5/lib/ec-component/build-your-ec/build-your-ec.component.js +65 -22
- package/esm5/lib/ec-component/build-your-ec/product-found-ec/product-found-ec.component.js +13 -1
- package/esm5/lib/ec-component/header-ec/header-ec.component.js +29 -2
- package/esm5/lib/ec-component/section-container-ec/section-container-ec.component.js +9 -1
- package/esm5/lib/services/concatenated-associations.service.js +23 -3
- package/fesm2015/ng-easycommerce.js +122 -24
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +156 -46
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/build-your-ec/build-your-ec.component.d.ts +50 -0
- package/lib/ec-component/build-your-ec/product-found-ec/product-found-ec.component.d.ts +12 -0
- package/lib/ec-component/header-ec/header-ec.component.d.ts +5 -1
- package/lib/ec-component/section-container-ec/section-container-ec.component.d.ts +3 -0
- package/lib/services/concatenated-associations.service.d.ts +18 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# version 0.0.444
|
|
2
|
+
- Se mejora la funcionalidad del componente build-your-ec.
|
|
3
|
+
- Se agrega en el componente header la opcion de obtener las secciones en el menu.
|
|
4
|
+
- Se actualiza el componente section-container-ec para obtener todos los datos de la seccion.
|
|
5
|
+
|
|
1
6
|
# version 0.0.443
|
|
2
7
|
- Se actualiza la funcionalidad del componente build-your-ec, se mejora el proceso paso y filtrado de opciones, se captura error en caso de que no existan mas coincidencias.
|
|
3
8
|
- Se crea nuevo componente, product-found-ec, para el manejo de los productos resultantes de la busqueda por filtros.
|
|
@@ -8130,6 +8130,17 @@
|
|
|
8130
8130
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
8131
8131
|
};
|
|
8132
8132
|
})();
|
|
8133
|
+
var __assign$m = (this && this.__assign) || function () {
|
|
8134
|
+
__assign$m = Object.assign || function(t) {
|
|
8135
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8136
|
+
s = arguments[i];
|
|
8137
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8138
|
+
t[p] = s[p];
|
|
8139
|
+
}
|
|
8140
|
+
return t;
|
|
8141
|
+
};
|
|
8142
|
+
return __assign$m.apply(this, arguments);
|
|
8143
|
+
};
|
|
8133
8144
|
var __decorate$Z = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8134
8145
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8135
8146
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8171,12 +8182,21 @@
|
|
|
8171
8182
|
_this.renderer = renderer;
|
|
8172
8183
|
//og elden
|
|
8173
8184
|
_this.menuItems = [];
|
|
8174
|
-
_this.
|
|
8185
|
+
_this.menuItemsSections = [];
|
|
8186
|
+
_this.sections = [];
|
|
8175
8187
|
_this.attributes = [];
|
|
8176
8188
|
_this.categories = [];
|
|
8177
8189
|
_this.envetUrlTransparent = ["/home", "/"];
|
|
8178
8190
|
_this.params = {};
|
|
8179
8191
|
_this.toggled = false;
|
|
8192
|
+
_this.updateMenuItemSection = function (elements) {
|
|
8193
|
+
_this.menuItemsSections = _this.optionsService.generateMenu(elements);
|
|
8194
|
+
_this.menuItemsSections = _this.ecUpdateMenuItemSection(_this.menuItemsSections);
|
|
8195
|
+
_this.sections = _this.menuItemsSections;
|
|
8196
|
+
};
|
|
8197
|
+
_this.ecUpdateMenuItemSection = function (menuItems) {
|
|
8198
|
+
return menuItems;
|
|
8199
|
+
};
|
|
8180
8200
|
_this.updateMenuItem = function (title, elements) {
|
|
8181
8201
|
var _a, _b;
|
|
8182
8202
|
var index = _this.menuItems.findIndex(function (element) { return element.title == title; });
|
|
@@ -8229,6 +8249,12 @@
|
|
|
8229
8249
|
};
|
|
8230
8250
|
_this.updateMenuItemLastCreated = function (arrayMenu) { return arrayMenu; };
|
|
8231
8251
|
_this.changeUrlNavigation = function (url) { };
|
|
8252
|
+
_this.addChildren = function (menuItems, code, item, stackPlace) {
|
|
8253
|
+
if (stackPlace === void 0) { stackPlace = 'end'; }
|
|
8254
|
+
var _a, _b;
|
|
8255
|
+
(stackPlace == 'start')
|
|
8256
|
+
? (_a = menuItems.find(function (item) { var _a; return (_a = item.code) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(code); })) === null || _a === void 0 ? void 0 : _a.children.unshift(__assign$m({ code: 'sd', name: 'sd', path: '/home', title: 'sd' }, item)) : (_b = menuItems.find(function (item) { var _a; return (_a = item.code) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(code); })) === null || _b === void 0 ? void 0 : _b.children.push(__assign$m({ code: 'sd', name: 'sd', path: '/home', title: 'sd' }, item));
|
|
8257
|
+
};
|
|
8232
8258
|
_this.envetUrlTransparent = _this.changeUrlTransparent(_this.envetUrlTransparent);
|
|
8233
8259
|
_this.router.events.subscribe(function (event) {
|
|
8234
8260
|
if (event instanceof router.NavigationStart) {
|
|
@@ -8248,6 +8274,7 @@
|
|
|
8248
8274
|
_this.updateMenuItem('attributes', res);
|
|
8249
8275
|
_this.subscribeAttributes(res);
|
|
8250
8276
|
});
|
|
8277
|
+
_this.optionsService.sections.subscribe(function (res) { return (res.length > 0) && _this.updateMenuItemSection(res); });
|
|
8251
8278
|
_this.ecOnConstruct();
|
|
8252
8279
|
return _this;
|
|
8253
8280
|
}
|
|
@@ -8441,8 +8468,8 @@
|
|
|
8441
8468
|
return LoginEcComponent;
|
|
8442
8469
|
}(ComponentHelper));
|
|
8443
8470
|
|
|
8444
|
-
var __assign$
|
|
8445
|
-
__assign$
|
|
8471
|
+
var __assign$n = (this && this.__assign) || function () {
|
|
8472
|
+
__assign$n = Object.assign || function(t) {
|
|
8446
8473
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8447
8474
|
s = arguments[i];
|
|
8448
8475
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -8450,7 +8477,7 @@
|
|
|
8450
8477
|
}
|
|
8451
8478
|
return t;
|
|
8452
8479
|
};
|
|
8453
|
-
return __assign$
|
|
8480
|
+
return __assign$n.apply(this, arguments);
|
|
8454
8481
|
};
|
|
8455
8482
|
var __decorate$10 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8456
8483
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8782,7 +8809,7 @@
|
|
|
8782
8809
|
product_selected.price = parseFloat(this.asociatedDataSubject.value.price);
|
|
8783
8810
|
product_selected.saleprice = parseFloat(this.asociatedDataSubject.value.price);
|
|
8784
8811
|
product_selected.options = {};
|
|
8785
|
-
this.variants[0].options.forEach(function (option) { return product_selected.options = __assign$
|
|
8812
|
+
this.variants[0].options.forEach(function (option) { return product_selected.options = __assign$n(__assign$n({}, product_selected.options), option); });
|
|
8786
8813
|
return product_selected;
|
|
8787
8814
|
};
|
|
8788
8815
|
/**
|
|
@@ -8824,7 +8851,7 @@
|
|
|
8824
8851
|
}
|
|
8825
8852
|
variantsAvailable.push(aux);
|
|
8826
8853
|
});
|
|
8827
|
-
return variantsAvailable.filter(function (va) { return _this.constants.containsAll(__assign$
|
|
8854
|
+
return variantsAvailable.filter(function (va) { return _this.constants.containsAll(__assign$n({}, variantsSelected), va); });
|
|
8828
8855
|
};
|
|
8829
8856
|
/**
|
|
8830
8857
|
*
|
|
@@ -8867,8 +8894,8 @@
|
|
|
8867
8894
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
8868
8895
|
};
|
|
8869
8896
|
})();
|
|
8870
|
-
var __assign$
|
|
8871
|
-
__assign$
|
|
8897
|
+
var __assign$o = (this && this.__assign) || function () {
|
|
8898
|
+
__assign$o = Object.assign || function(t) {
|
|
8872
8899
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8873
8900
|
s = arguments[i];
|
|
8874
8901
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -8876,7 +8903,7 @@
|
|
|
8876
8903
|
}
|
|
8877
8904
|
return t;
|
|
8878
8905
|
};
|
|
8879
|
-
return __assign$
|
|
8906
|
+
return __assign$o.apply(this, arguments);
|
|
8880
8907
|
};
|
|
8881
8908
|
var __decorate$11 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8882
8909
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -8942,7 +8969,7 @@
|
|
|
8942
8969
|
_this.breadcrumb = _this.optionsService.getBreadcrumb(_this.product.category);
|
|
8943
8970
|
});
|
|
8944
8971
|
_this.productService.product$.pipe(operators.filter(function (data) { return data && data.id && data.id != 0; })).subscribe(function (productParam) {
|
|
8945
|
-
_this.analyticsService.callEvent('view_item', __assign$
|
|
8972
|
+
_this.analyticsService.callEvent('view_item', __assign$o(__assign$o({}, productParam), { currency: _this.consts.currency.code }));
|
|
8946
8973
|
_this.changeImgFocus(productParam.picturesdefault[0]);
|
|
8947
8974
|
});
|
|
8948
8975
|
_this.ecOnConstruct();
|
|
@@ -9222,6 +9249,10 @@
|
|
|
9222
9249
|
_this.loadSection = true;
|
|
9223
9250
|
});
|
|
9224
9251
|
};
|
|
9252
|
+
_this.getDataSection = function (code) {
|
|
9253
|
+
_this.dataSection = _this.sections.find(function (section) { return section.code == code; });
|
|
9254
|
+
};
|
|
9255
|
+
_this.optionsService.sections.subscribe(function (res) { return _this.sections = res; });
|
|
9225
9256
|
_this.ecOnConstruct();
|
|
9226
9257
|
return _this;
|
|
9227
9258
|
}
|
|
@@ -9229,11 +9260,15 @@
|
|
|
9229
9260
|
var _this = this;
|
|
9230
9261
|
if (this.name) {
|
|
9231
9262
|
this.getSection(this.name);
|
|
9263
|
+
this.getDataSection(this.name);
|
|
9264
|
+
console.log('con parametro');
|
|
9232
9265
|
}
|
|
9233
9266
|
else {
|
|
9234
9267
|
this.activatedRoute.params.subscribe(function (params) {
|
|
9235
9268
|
_this.name = params.name;
|
|
9236
9269
|
_this.getSection(_this.name);
|
|
9270
|
+
_this.getDataSection(_this.name);
|
|
9271
|
+
console.log('sin parametro', _this.name);
|
|
9237
9272
|
});
|
|
9238
9273
|
}
|
|
9239
9274
|
this.ecOnInit();
|
|
@@ -9680,8 +9715,8 @@
|
|
|
9680
9715
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
9681
9716
|
};
|
|
9682
9717
|
})();
|
|
9683
|
-
var __assign$
|
|
9684
|
-
__assign$
|
|
9718
|
+
var __assign$p = (this && this.__assign) || function () {
|
|
9719
|
+
__assign$p = Object.assign || function(t) {
|
|
9685
9720
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9686
9721
|
s = arguments[i];
|
|
9687
9722
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -9689,7 +9724,7 @@
|
|
|
9689
9724
|
}
|
|
9690
9725
|
return t;
|
|
9691
9726
|
};
|
|
9692
|
-
return __assign$
|
|
9727
|
+
return __assign$p.apply(this, arguments);
|
|
9693
9728
|
};
|
|
9694
9729
|
var __decorate$1a = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
9695
9730
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -9782,7 +9817,7 @@
|
|
|
9782
9817
|
_this.payment_method = payment_data.id;
|
|
9783
9818
|
_this.issuer_id = payment_data.issuer.id;
|
|
9784
9819
|
payment_data.payer_costs.forEach(function (payerCost) {
|
|
9785
|
-
_this.installments.push(__assign$
|
|
9820
|
+
_this.installments.push(__assign$p(__assign$p({}, payerCost), { name: ('Cuotas: ' + payerCost.installments + ' - Total: ' + _this.calculateTotal(payerCost)), value: payerCost.installments }));
|
|
9786
9821
|
});
|
|
9787
9822
|
_this.installment_data = payment_data;
|
|
9788
9823
|
}
|
|
@@ -9869,7 +9904,7 @@
|
|
|
9869
9904
|
if (status == 200 && response.length) {
|
|
9870
9905
|
_this.installments = [];
|
|
9871
9906
|
response[0].payer_costs.forEach(function (payerCost) {
|
|
9872
|
-
_this.installments.push(__assign$
|
|
9907
|
+
_this.installments.push(__assign$p(__assign$p({}, payerCost), { name: payerCost.recommended_message, value: payerCost.installments }));
|
|
9873
9908
|
});
|
|
9874
9909
|
_this.installment_data = response[0];
|
|
9875
9910
|
}
|
|
@@ -12960,8 +12995,8 @@
|
|
|
12960
12995
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12961
12996
|
};
|
|
12962
12997
|
})();
|
|
12963
|
-
var __assign$
|
|
12964
|
-
__assign$
|
|
12998
|
+
var __assign$q = (this && this.__assign) || function () {
|
|
12999
|
+
__assign$q = Object.assign || function(t) {
|
|
12965
13000
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12966
13001
|
s = arguments[i];
|
|
12967
13002
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -12969,7 +13004,7 @@
|
|
|
12969
13004
|
}
|
|
12970
13005
|
return t;
|
|
12971
13006
|
};
|
|
12972
|
-
return __assign$
|
|
13007
|
+
return __assign$q.apply(this, arguments);
|
|
12973
13008
|
};
|
|
12974
13009
|
var __decorate$1y = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
12975
13010
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -13016,7 +13051,7 @@
|
|
|
13016
13051
|
var _this = this;
|
|
13017
13052
|
this.subs = this.authService.channelsUser.pipe(operators.filter(function (res) { return res != null && res.length > 0; })).subscribe(function (res) {
|
|
13018
13053
|
_this.channels = res.map(function (item) {
|
|
13019
|
-
return __assign$
|
|
13054
|
+
return __assign$q(__assign$q({}, item), { selected: false });
|
|
13020
13055
|
});
|
|
13021
13056
|
_this.initializeTemplate();
|
|
13022
13057
|
});
|
|
@@ -13794,13 +13829,28 @@
|
|
|
13794
13829
|
this.currentStepSubject = new rxjs.BehaviorSubject({});
|
|
13795
13830
|
this.stepList$ = this.stepListSubject.asObservable();
|
|
13796
13831
|
this.currentStep$ = this.currentStepSubject.asObservable();
|
|
13832
|
+
/**
|
|
13833
|
+
* @description sujeto para observar los errores.
|
|
13834
|
+
*/
|
|
13835
|
+
this.errorSubject = new rxjs.BehaviorSubject({});
|
|
13836
|
+
/**
|
|
13837
|
+
* @description observable para el manejo de errores.
|
|
13838
|
+
*/
|
|
13839
|
+
this.error$ = this.errorSubject.asObservable();
|
|
13797
13840
|
//Lista de endpoints
|
|
13798
13841
|
this.stepListApi = function (sectionName) { return 'shop-api/' + _this.consts.getChannel() + '/concatenated_associations/' + sectionName; };
|
|
13799
13842
|
this.applyFilterApi = function () { return 'shop-api/' + _this.consts.getChannel() + '/concatenated_associations/step_by_step/'; };
|
|
13843
|
+
/**
|
|
13844
|
+
* @description Obtiene la lista de pasos completa, dato que se recibe cuando inicia la carga de datos.
|
|
13845
|
+
* @param section Este parametro recibe la seccion de donde se obtendran la lista de pasos
|
|
13846
|
+
* @param fatherCode Este parametro recibe el codigo padre de esa seccion, es decir de donde empieza el filtrado de pasos.
|
|
13847
|
+
* @returns
|
|
13848
|
+
*/
|
|
13800
13849
|
this.getStepList = function (section, fatherCode) { return __awaiter$e(_this, void 0, void 0, function () {
|
|
13801
13850
|
var _this = this;
|
|
13802
13851
|
return __generator$e(this, function (_a) {
|
|
13803
|
-
return [2 /*return*/, this.connection.post(this.stepListApi(section)).subscribe(function (res) {
|
|
13852
|
+
return [2 /*return*/, section && this.connection.post(this.stepListApi(section)).subscribe(function (res) {
|
|
13853
|
+
_this.errorSubject.next({ state: false });
|
|
13804
13854
|
//Si existe el codigo del padre
|
|
13805
13855
|
if (fatherCode) {
|
|
13806
13856
|
var values = res.filter(function (e) { return e[0].code == fatherCode; });
|
|
@@ -13809,6 +13859,7 @@
|
|
|
13809
13859
|
_this.initializeStepList(values[0]); //inicializa
|
|
13810
13860
|
}
|
|
13811
13861
|
else {
|
|
13862
|
+
_this.errorSubject.next({ state: true, error: 'error no hay nada con ese codigo' });
|
|
13812
13863
|
console.log('error no hay nada con ese codigo');
|
|
13813
13864
|
_this.initializeStepList([]); //inicializa con un arreglo vacio
|
|
13814
13865
|
}
|
|
@@ -13817,7 +13868,7 @@
|
|
|
13817
13868
|
//Si no hay codigo del padre, inicializa con el primer valor del arreglo
|
|
13818
13869
|
_this.initializeStepList(res[0]);
|
|
13819
13870
|
}
|
|
13820
|
-
}, function (e) { return
|
|
13871
|
+
}, function (e) { return _this.errorSubject.next({ state: true, error: e }); })
|
|
13821
13872
|
/**
|
|
13822
13873
|
* @description Inicializa la carga de datos al subjeto del observable.
|
|
13823
13874
|
* @param response Respuesta recibida desde el backend
|
|
@@ -13850,6 +13901,10 @@
|
|
|
13850
13901
|
//console.log('entre update')
|
|
13851
13902
|
_this.stepListSubject.next(value);
|
|
13852
13903
|
};
|
|
13904
|
+
/**
|
|
13905
|
+
* @decription actualiza el paso actual en donde se encuentra.
|
|
13906
|
+
* @param value
|
|
13907
|
+
*/
|
|
13853
13908
|
this.updateCurrentStep = function (value) {
|
|
13854
13909
|
_this.currentStepSubject.next(value);
|
|
13855
13910
|
};
|
|
@@ -13907,13 +13962,18 @@
|
|
|
13907
13962
|
_this.formBuilder = formBuilder;
|
|
13908
13963
|
_this.toastrService = toastrService;
|
|
13909
13964
|
_this.consts = consts;
|
|
13910
|
-
_this.currentPosition = 0;
|
|
13911
|
-
_this.selectedValues = {};
|
|
13912
|
-
_this.itemCurrentSelected = '';
|
|
13913
|
-
_this.loadingStep = false;
|
|
13914
|
-
_this.finished = false;
|
|
13915
|
-
_this.noMoreCoincidences = false;
|
|
13916
|
-
_this.products = [];
|
|
13965
|
+
_this.currentPosition = 0; //Guarda la posicion del paso activo
|
|
13966
|
+
_this.selectedValues = {}; //Guarda los valores que se van seleccionando.
|
|
13967
|
+
_this.itemCurrentSelected = ''; //Para guarda el item selecciondo
|
|
13968
|
+
_this.loadingStep = false; //Marca si se esta cargando el paso
|
|
13969
|
+
_this.finished = false; //Marca si finalizo la secuencia de pasos
|
|
13970
|
+
_this.noMoreCoincidences = false; //Marca si no hay mas coincidencias de productos
|
|
13971
|
+
_this.products = []; //Recibe el/los producto/s resultantes
|
|
13972
|
+
/**
|
|
13973
|
+
* @description inserta atributos adicionales a los pasos recibidos.
|
|
13974
|
+
* current => para indicar cuando el paso esta activo.
|
|
13975
|
+
* touched => para indicar cuando el paso fue activado.
|
|
13976
|
+
*/
|
|
13917
13977
|
_this.insertAttributes = function () {
|
|
13918
13978
|
//console.log('attributes', this.stepList)
|
|
13919
13979
|
_this.stepList.map(function (step, index) {
|
|
@@ -13921,6 +13981,10 @@
|
|
|
13921
13981
|
step.touched = false;
|
|
13922
13982
|
});
|
|
13923
13983
|
};
|
|
13984
|
+
/**
|
|
13985
|
+
* @description retorna las opciones del paso segun el tipo de paso que esta recibiendo.
|
|
13986
|
+
* @param item step para obtener los datos.
|
|
13987
|
+
*/
|
|
13924
13988
|
_this.itemValuesFactory = function (item) {
|
|
13925
13989
|
switch (item.type) {
|
|
13926
13990
|
case 'optionProduct':
|
|
@@ -13937,42 +14001,51 @@
|
|
|
13937
14001
|
break;
|
|
13938
14002
|
}
|
|
13939
14003
|
};
|
|
14004
|
+
/**
|
|
14005
|
+
* @description Carga el componente para obtener sus datos iniciales.
|
|
14006
|
+
* @param section Seccion asociada con la asociaciones creadas
|
|
14007
|
+
* @param fatherCode Codigo del paso de donde se quiere arrancar el filtrado.
|
|
14008
|
+
*/
|
|
13940
14009
|
_this.load = function (section, fatherCode) {
|
|
13941
14010
|
if (section === void 0) { section = ''; }
|
|
13942
|
-
_this.concatenated.load(section
|
|
14011
|
+
_this.concatenated.load(section, fatherCode);
|
|
13943
14012
|
};
|
|
14013
|
+
/**
|
|
14014
|
+
* @description carga con el valor seleccionado. Reinicia la condicion de "no más coincidencias"
|
|
14015
|
+
* @param value
|
|
14016
|
+
*/
|
|
13944
14017
|
_this.setItemCurrentSelected = function (value) {
|
|
13945
14018
|
_this.noMoreCoincidences = false;
|
|
13946
14019
|
_this.itemCurrentSelected = value;
|
|
13947
14020
|
};
|
|
14021
|
+
/**
|
|
14022
|
+
* @description funcion para ser utilizada como captura del envio de un formulario.
|
|
14023
|
+
* @param event
|
|
14024
|
+
*/
|
|
13948
14025
|
_this.submitNext = function (event) {
|
|
13949
14026
|
event.preventDefault();
|
|
13950
14027
|
if (!_this.stepList[_this.currentPosition].skippeable) {
|
|
13951
|
-
/* console.log(this.itemCurrentSelected,'-',this.itemCurrentSelected.length) */
|
|
13952
14028
|
if (_this.itemCurrentSelected && _this.itemCurrentSelected.length) {
|
|
13953
|
-
/* console.log(!this.stepList[this.currentPosition].skippeable,' ', this.itemCurrentSelected.length-1) */
|
|
13954
14029
|
_this.next(_this.itemCurrentSelected);
|
|
13955
14030
|
}
|
|
13956
14031
|
else {
|
|
13957
|
-
//mensaje toast
|
|
13958
14032
|
_this.toastrService.show('Escoja una opción');
|
|
13959
|
-
/* console.log('elegí algo papu') */
|
|
13960
14033
|
}
|
|
13961
14034
|
}
|
|
13962
14035
|
else {
|
|
13963
14036
|
_this.itemCurrentSelected ? _this.next(_this.itemCurrentSelected) : _this.next();
|
|
13964
14037
|
}
|
|
13965
14038
|
};
|
|
14039
|
+
/**
|
|
14040
|
+
* @description evalua el valor que recibe por parametro, realiza la consulta para el filtrado y carga los datos recibidos.
|
|
14041
|
+
* @param selectValue valor asociado al codigo de la opcion elegida.
|
|
14042
|
+
*/
|
|
13966
14043
|
_this.next = function (selectValue) {
|
|
13967
14044
|
if (selectValue === void 0) { selectValue = ''; }
|
|
13968
14045
|
_this.loadingStep = true;
|
|
13969
|
-
//this.noMoreCoincidences = false
|
|
13970
|
-
/* console.log(' current next', this.currentStep)
|
|
13971
|
-
console.log(selectValue) */
|
|
13972
14046
|
if (selectValue) {
|
|
13973
14047
|
//se envia la peticion con el valor elegido
|
|
13974
14048
|
_this.selectedValues[_this.currentPosition] = [selectValue];
|
|
13975
|
-
/* console.log(this.selectedValues) */
|
|
13976
14049
|
_this.concatenated.applyFilter({
|
|
13977
14050
|
"code": _this.code,
|
|
13978
14051
|
"values": _this.selectedValues
|
|
@@ -13980,22 +14053,28 @@
|
|
|
13980
14053
|
}
|
|
13981
14054
|
else {
|
|
13982
14055
|
//se envia la peticion con valor skipped=false.. etc
|
|
14056
|
+
_this.selectedValues[_this.currentPosition] = [""];
|
|
14057
|
+
_this.concatenated.applyFilter({
|
|
14058
|
+
"code": _this.code,
|
|
14059
|
+
"values": _this.selectedValues
|
|
14060
|
+
}).then(function (e) { return _this.setNextStep(selectValue); }).catch(function (e) { e.status == 500 ? _this.noMoreCoincidences = true : null; });
|
|
13983
14061
|
console.log('vacio pa');
|
|
13984
14062
|
}
|
|
13985
14063
|
_this.loadingStep = false;
|
|
13986
14064
|
};
|
|
14065
|
+
/**
|
|
14066
|
+
* @description realiza el transpaso de datos desde el paso actual al siguiente paso de filtrado.
|
|
14067
|
+
* @param selectValue valor asociado al codigo de la opcion elegida.
|
|
14068
|
+
*/
|
|
13987
14069
|
_this.setNextStep = function (selectValue) {
|
|
13988
14070
|
_this.stepList[_this.currentPosition].valueSelected = _this.getAssociatedData(selectValue, _this.stepList[_this.currentPosition]);
|
|
13989
|
-
/* console.log(this.getAssociatedData(selectValue,this.stepList[this.currentPosition]))
|
|
13990
|
-
console.log(this.currentStep) */
|
|
13991
14071
|
_this.stepList[_this.currentPosition].current = false;
|
|
13992
14072
|
_this.stepList[_this.currentPosition].touched = true;
|
|
13993
14073
|
_this.currentPosition++;
|
|
14074
|
+
// Si es el final de la lista de pasos.
|
|
13994
14075
|
if (_this.currentPosition == _this.stepList.length) {
|
|
13995
|
-
/* console.log(this.currentStep) */
|
|
13996
14076
|
_this.products = _this.currentStep;
|
|
13997
14077
|
_this.finished = true;
|
|
13998
|
-
/* console.log('final', this.finished) */
|
|
13999
14078
|
}
|
|
14000
14079
|
else {
|
|
14001
14080
|
_this.stepList[_this.currentPosition].current = true;
|
|
@@ -14004,6 +14083,10 @@
|
|
|
14004
14083
|
_this.itemCurrentSelected = '';
|
|
14005
14084
|
}
|
|
14006
14085
|
};
|
|
14086
|
+
/**
|
|
14087
|
+
* @description realiza las configuraciones necesarias para el retroceso de un paso.
|
|
14088
|
+
* @param index cantidad de pasos que se quiere retroceder, 1 por defecto.
|
|
14089
|
+
*/
|
|
14007
14090
|
_this.prev = function (index) {
|
|
14008
14091
|
if (index === void 0) { index = -1; }
|
|
14009
14092
|
_this.stepList[_this.currentPosition].current = false;
|
|
@@ -14021,6 +14104,11 @@
|
|
|
14021
14104
|
: '';
|
|
14022
14105
|
/* console.log(this.stepList) */
|
|
14023
14106
|
};
|
|
14107
|
+
/**
|
|
14108
|
+
* @description limpia los pasos, volviendo sus valores a los iniciales.
|
|
14109
|
+
* Elimina los valores del arreglo de valores seleccionados.
|
|
14110
|
+
* @param index
|
|
14111
|
+
*/
|
|
14024
14112
|
_this.clearItems = function (index) {
|
|
14025
14113
|
_this.stepList.map(function (step, i) {
|
|
14026
14114
|
if (i > index) {
|
|
@@ -14028,11 +14116,20 @@
|
|
|
14028
14116
|
step.touched = false;
|
|
14029
14117
|
step.valueSelected = '';
|
|
14030
14118
|
delete _this.selectedValues[i];
|
|
14031
|
-
/* console.log(this.selectedValues) */
|
|
14032
14119
|
}
|
|
14033
14120
|
});
|
|
14034
14121
|
};
|
|
14122
|
+
/**
|
|
14123
|
+
* @description retorna los datos de los valores de las opciones
|
|
14124
|
+
* @param code codigo de la opcion elegida
|
|
14125
|
+
* @param item filtro/paso
|
|
14126
|
+
* @returns los valores asociados a la opcion elegida
|
|
14127
|
+
*/
|
|
14035
14128
|
_this.getAssociatedData = function (code, item) { return item.productOption.values.find(function (elem) { return elem.code == code; }); };
|
|
14129
|
+
/**
|
|
14130
|
+
* @description actualiza la lista de pasos.
|
|
14131
|
+
* @param list
|
|
14132
|
+
*/
|
|
14036
14133
|
_this.updateList = function (list) {
|
|
14037
14134
|
_this.concatenated.updateStepList(list);
|
|
14038
14135
|
};
|
|
@@ -14046,6 +14143,7 @@
|
|
|
14046
14143
|
}
|
|
14047
14144
|
});
|
|
14048
14145
|
_this.concatenated.currentStep$.subscribe(function (res) { return _this.currentStep = res; });
|
|
14146
|
+
_this.concatenated.error$.subscribe(function (res) { return _this.error = res; });
|
|
14049
14147
|
_this.ecOnConstruct();
|
|
14050
14148
|
return _this;
|
|
14051
14149
|
}
|
|
@@ -14084,8 +14182,8 @@
|
|
|
14084
14182
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14085
14183
|
};
|
|
14086
14184
|
})();
|
|
14087
|
-
var __assign$
|
|
14088
|
-
__assign$
|
|
14185
|
+
var __assign$r = (this && this.__assign) || function () {
|
|
14186
|
+
__assign$r = Object.assign || function(t) {
|
|
14089
14187
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14090
14188
|
s = arguments[i];
|
|
14091
14189
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -14093,7 +14191,7 @@
|
|
|
14093
14191
|
}
|
|
14094
14192
|
return t;
|
|
14095
14193
|
};
|
|
14096
|
-
return __assign$
|
|
14194
|
+
return __assign$r.apply(this, arguments);
|
|
14097
14195
|
};
|
|
14098
14196
|
var __decorate$1H = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14099
14197
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -14115,17 +14213,29 @@
|
|
|
14115
14213
|
_this.router = router;
|
|
14116
14214
|
_this.toastrService = toastrService;
|
|
14117
14215
|
_this.quantity = 1;
|
|
14216
|
+
/**
|
|
14217
|
+
* @description agrega el producto al carrito de compras
|
|
14218
|
+
*/
|
|
14118
14219
|
_this.addToCart = function () {
|
|
14119
14220
|
_this.quantity > 0 && _this.productService.addToCart(_this.quantity);
|
|
14120
14221
|
};
|
|
14222
|
+
/**
|
|
14223
|
+
* @description suma 1 a la cantidad del producto para agregar al carrito, si es que hay stock disponible
|
|
14224
|
+
* @param stock stock del producto que se quiere agregar al carrito
|
|
14225
|
+
* @returns
|
|
14226
|
+
*/
|
|
14121
14227
|
_this.plus = function (stock) { return _this.quantity < stock ? _this.quantity = _this.quantity + 1 : _this.toastrService.show('out-of-stock-actually'); };
|
|
14228
|
+
/**
|
|
14229
|
+
* @description resta 1 la cantidad del producto para agregar al carrito.
|
|
14230
|
+
* @returns
|
|
14231
|
+
*/
|
|
14122
14232
|
_this.less = function () { return _this.quantity > 1 ? _this.quantity = _this.quantity - 1 : null; };
|
|
14123
14233
|
_this.productService.product$.subscribe(function (res) {
|
|
14124
14234
|
_this.associatedData = res;
|
|
14125
14235
|
window.scroll(0, 0);
|
|
14126
14236
|
});
|
|
14127
14237
|
_this.productService.product$.pipe(operators.filter(function (data) { return data && data.id && data.id != 0; })).subscribe(function (productParam) {
|
|
14128
|
-
_this.analyticsService.callEvent('view_item', __assign$
|
|
14238
|
+
_this.analyticsService.callEvent('view_item', __assign$r(__assign$r({}, productParam), { currency: _this.consts.currency.code }));
|
|
14129
14239
|
});
|
|
14130
14240
|
_this.ecOnConstruct();
|
|
14131
14241
|
return _this;
|