@sentecacommerce-theme/lib 0.13.18 → 0.13.21-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/api/getSDKConfig.js +4 -4
- package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +48 -43
- package/dist/cjs/hooks/useProduct/utils/index.js +1 -1
- package/dist/cjs/product/hooks/useBnpOffers.js +47 -40
- package/dist/esm/api/getSDKConfig.js +5 -5
- package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +48 -43
- package/dist/esm/hooks/useProduct/utils/index.js +1 -1
- package/dist/esm/product/hooks/useBnpOffers.js +47 -40
- package/dist/types/checkout/hooks/useBnpCalculateForCart.d.ts +4 -3
- package/dist/types/product/hooks/useBnpOffers.d.ts +12 -8
- package/package.json +4 -4
@@ -53,18 +53,18 @@ var getSDKConfig = function() {
|
|
53
53
|
exports.getSDKConfig = getSDKConfig;
|
54
54
|
var getOptions = function() {
|
55
55
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
56
|
+
var ref;
|
57
|
+
var basePath = process.env.NEXT_PUBLIC_PROXY_URL + ((ref = options === null || options === void 0 ? void 0 : options.basePath) !== null && ref !== void 0 ? ref : '/platform');
|
56
58
|
if (!(0, _utils).canUseDOM()) {
|
57
59
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
58
60
|
var nodeFetch = require('node-fetch');
|
59
|
-
var ref;
|
60
61
|
return _objectSpread({}, options, {
|
61
|
-
basePath:
|
62
|
+
basePath: basePath,
|
62
63
|
fetchApi: nodeFetch
|
63
64
|
}, process.env.sdkConfig || {});
|
64
65
|
} else {
|
65
|
-
var ref2;
|
66
66
|
return _objectSpread({}, options, {
|
67
|
-
basePath:
|
67
|
+
basePath: basePath,
|
68
68
|
token: _jsCookie.default.get(_utils.AUTH_TOKEN_KEY) || _jsCookie.default.get(_utils.ANONYMOUS_TOKEN_KEY) || process.env.API_KEY || process.env.apiKey,
|
69
69
|
fetchApi: window.fetch.bind(window)
|
70
70
|
}, process.env.sdkConfig || {});
|
@@ -55,56 +55,61 @@ function _objectSpread(target) {
|
|
55
55
|
return target;
|
56
56
|
}
|
57
57
|
var useBnpCalculateForCart = function(props) {
|
58
|
-
var
|
58
|
+
var ref5, ref1, ref2, ref3;
|
59
59
|
var ref4 = props !== null && props !== void 0 ? props : {}, _preferredInstallmentCentAmount = ref4.preferredInstallmentCentAmount, preferredInstallmentCentAmount = _preferredInstallmentCentAmount === void 0 ? 0 : _preferredInstallmentCentAmount, _downPaymentCentAmount = ref4.downPaymentCentAmount, downPaymentCentAmount = _downPaymentCentAmount === void 0 ? 0 : _downPaymentCentAmount;
|
60
60
|
var response = (0, _api).useBnpCalculateForCartQuery({
|
61
61
|
preferredInstallmentCentAmount: preferredInstallmentCentAmount,
|
62
62
|
downPaymentCentAmount: downPaymentCentAmount
|
63
63
|
});
|
64
|
-
var configLocale = ((
|
64
|
+
var configLocale = ((ref5 = (0, _index).useConfigState()) === null || ref5 === void 0 ? void 0 : (ref1 = ref5.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
65
65
|
return (0, _react).useMemo(function() {
|
66
|
-
var
|
66
|
+
var ref6;
|
67
67
|
return _objectSpread({}, response, {
|
68
|
-
data:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
68
|
+
data: (ref6 = response.data) === null || ref6 === void 0 ? void 0 : ref6.map(function(options) {
|
69
|
+
var ref;
|
70
|
+
return {
|
71
|
+
name: options.scheme.name,
|
72
|
+
scheme: options.scheme,
|
73
|
+
offers: (ref = options.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
74
|
+
var _totalRepaymentAmount = (0, _index).decodePrice(offer.totalRepaymentAmount);
|
75
|
+
var _correctDownPaymentAmount = (0, _index).decodePrice(offer.correctDownPaymentAmount);
|
76
|
+
var _installmentAmount = (0, _index).decodePrice(offer.installmentAmount);
|
77
|
+
var _processingFeeAmount = (0, _index).decodePrice(offer.processingFeeAmount);
|
78
|
+
var totalRepaymentAmount = (0, _index).formatAsCurrency({
|
79
|
+
price: _totalRepaymentAmount,
|
80
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
81
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
82
|
+
locale: configLocale || 'en'
|
83
|
+
});
|
84
|
+
var correctDownPaymentAmount = (0, _index).formatAsCurrency({
|
85
|
+
price: _correctDownPaymentAmount,
|
86
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
87
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
88
|
+
locale: configLocale || 'en'
|
89
|
+
});
|
90
|
+
var installmentAmount = (0, _index).formatAsCurrency({
|
91
|
+
price: _installmentAmount,
|
92
|
+
precision: offer.installmentAmount.fractionDigits,
|
93
|
+
currency: offer.installmentAmount.currencyCode,
|
94
|
+
locale: configLocale || 'en'
|
95
|
+
});
|
96
|
+
var processingFeeAmount = (0, _index).formatAsCurrency({
|
97
|
+
price: _processingFeeAmount,
|
98
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
99
|
+
currency: offer.processingFeeAmount.currencyCode,
|
100
|
+
locale: configLocale || 'en'
|
101
|
+
});
|
102
|
+
return _objectSpread({}, offer, {
|
103
|
+
offerRaw: offer,
|
104
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
105
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
106
|
+
installmentAmount: installmentAmount,
|
107
|
+
processingFeeAmount: processingFeeAmount
|
108
|
+
});
|
109
|
+
}).sort(function(offer, offer2) {
|
110
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
111
|
+
})
|
112
|
+
};
|
108
113
|
})
|
109
114
|
});
|
110
115
|
}, [
|
@@ -226,7 +226,7 @@ exports.createMappedAttributes = createMappedAttributes;
|
|
226
226
|
var processAvailabilityPerStore = function(availabilities) {
|
227
227
|
var ref;
|
228
228
|
return (ref = availabilities === null || availabilities === void 0 ? void 0 : availabilities.filter(function(x) {
|
229
|
-
return
|
229
|
+
return x.availableQuantity > 0;
|
230
230
|
})) === null || ref === void 0 ? void 0 : ref.map(function(param) {
|
231
231
|
var acceptsBackorders = param.acceptsBackorders, stockLocationName = param.stockLocationName, restockableInDays = param.restockableInDays, availableQuantity = param.availableQuantity;
|
232
232
|
return {
|
@@ -34,49 +34,56 @@ function _objectSpread(target) {
|
|
34
34
|
return target;
|
35
35
|
}
|
36
36
|
var useBnpOffers = function(props) {
|
37
|
-
var
|
38
|
-
var configLocale = ((
|
37
|
+
var ref4, ref1, ref2, ref3;
|
38
|
+
var configLocale = ((ref4 = (0, _index).useConfigState()) === null || ref4 === void 0 ? void 0 : (ref1 = ref4.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
39
39
|
var response = (0, _queries).useBnpOffersQuery(props);
|
40
40
|
return (0, _react).useMemo(function() {
|
41
|
-
var
|
41
|
+
var ref5;
|
42
42
|
return _objectSpread({}, response, {
|
43
|
-
data: response === null || response === void 0 ? void 0 : (
|
44
|
-
var
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
43
|
+
data: response === null || response === void 0 ? void 0 : (ref5 = response.data) === null || ref5 === void 0 ? void 0 : ref5.map(function(result) {
|
44
|
+
var ref;
|
45
|
+
return {
|
46
|
+
name: result.scheme.name,
|
47
|
+
scheme: result.scheme,
|
48
|
+
offers: (ref = result.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
49
|
+
var _totalRepaymentAmount = (0, _index).decodePrice(offer.totalRepaymentAmount);
|
50
|
+
var _correctDownPaymentAmount = (0, _index).decodePrice(offer.correctDownPaymentAmount);
|
51
|
+
var _installmentAmount = (0, _index).decodePrice(offer.installmentAmount);
|
52
|
+
var _processingFeeAmount = (0, _index).decodePrice(offer.processingFeeAmount);
|
53
|
+
var totalRepaymentAmount = (0, _index).formatAsCurrency({
|
54
|
+
price: _totalRepaymentAmount,
|
55
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
56
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
57
|
+
locale: configLocale || 'en'
|
58
|
+
});
|
59
|
+
var correctDownPaymentAmount = (0, _index).formatAsCurrency({
|
60
|
+
price: _correctDownPaymentAmount,
|
61
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
62
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
63
|
+
locale: configLocale || 'en'
|
64
|
+
});
|
65
|
+
var installmentAmount = (0, _index).formatAsCurrency({
|
66
|
+
price: _installmentAmount,
|
67
|
+
precision: offer.installmentAmount.fractionDigits,
|
68
|
+
currency: offer.installmentAmount.currencyCode,
|
69
|
+
locale: configLocale || 'en'
|
70
|
+
});
|
71
|
+
var processingFeeAmount = (0, _index).formatAsCurrency({
|
72
|
+
price: _processingFeeAmount,
|
73
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
74
|
+
currency: offer.processingFeeAmount.currencyCode,
|
75
|
+
locale: configLocale || 'en'
|
76
|
+
});
|
77
|
+
return _objectSpread({}, offer, {
|
78
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
79
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
80
|
+
installmentAmount: installmentAmount,
|
81
|
+
processingFeeAmount: processingFeeAmount
|
82
|
+
});
|
83
|
+
}).sort(function(offer, offer2) {
|
84
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
85
|
+
})
|
86
|
+
};
|
80
87
|
})
|
81
88
|
});
|
82
89
|
}, [
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Configuration, HttpClient } from '@sentecacommerce/sdk';
|
2
2
|
import Cookies from 'js-cookie';
|
3
|
-
import { ANONYMOUS_TOKEN_KEY, AUTH_TOKEN_KEY,
|
3
|
+
import { ANONYMOUS_TOKEN_KEY, AUTH_TOKEN_KEY, canUseDOM, getLocaleFromPath } from '../utils';
|
4
4
|
function _defineProperty(obj, key, value) {
|
5
5
|
if (key in obj) {
|
6
6
|
Object.defineProperty(obj, key, {
|
@@ -43,18 +43,18 @@ export var getSDKConfig = function() {
|
|
43
43
|
};
|
44
44
|
export var getOptions = function() {
|
45
45
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
46
|
+
var ref;
|
47
|
+
var basePath = process.env.NEXT_PUBLIC_PROXY_URL + ((ref = options === null || options === void 0 ? void 0 : options.basePath) !== null && ref !== void 0 ? ref : '/platform');
|
46
48
|
if (!canUseDOM()) {
|
47
49
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
48
50
|
var nodeFetch = require('node-fetch');
|
49
|
-
var ref;
|
50
51
|
return _objectSpread({}, options, {
|
51
|
-
basePath:
|
52
|
+
basePath: basePath,
|
52
53
|
fetchApi: nodeFetch
|
53
54
|
}, process.env.sdkConfig || {});
|
54
55
|
} else {
|
55
|
-
var ref2;
|
56
56
|
return _objectSpread({}, options, {
|
57
|
-
basePath:
|
57
|
+
basePath: basePath,
|
58
58
|
token: Cookies.get(AUTH_TOKEN_KEY) || Cookies.get(ANONYMOUS_TOKEN_KEY) || process.env.API_KEY || process.env.apiKey,
|
59
59
|
fetchApi: window.fetch.bind(window)
|
60
60
|
}, process.env.sdkConfig || {});
|
@@ -30,56 +30,61 @@ function _objectSpread(target) {
|
|
30
30
|
return target;
|
31
31
|
}
|
32
32
|
export var useBnpCalculateForCart = function(props) {
|
33
|
-
var
|
33
|
+
var ref5, ref1, ref2, ref3;
|
34
34
|
var ref4 = props !== null && props !== void 0 ? props : {}, _preferredInstallmentCentAmount = ref4.preferredInstallmentCentAmount, preferredInstallmentCentAmount = _preferredInstallmentCentAmount === void 0 ? 0 : _preferredInstallmentCentAmount, _downPaymentCentAmount = ref4.downPaymentCentAmount, downPaymentCentAmount = _downPaymentCentAmount === void 0 ? 0 : _downPaymentCentAmount;
|
35
35
|
var response = useBnpCalculateForCartQuery({
|
36
36
|
preferredInstallmentCentAmount: preferredInstallmentCentAmount,
|
37
37
|
downPaymentCentAmount: downPaymentCentAmount
|
38
38
|
});
|
39
|
-
var configLocale = ((
|
39
|
+
var configLocale = ((ref5 = useConfigState()) === null || ref5 === void 0 ? void 0 : (ref1 = ref5.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
40
40
|
return useMemo(function() {
|
41
|
-
var
|
41
|
+
var ref6;
|
42
42
|
return _objectSpread({}, response, {
|
43
|
-
data:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
43
|
+
data: (ref6 = response.data) === null || ref6 === void 0 ? void 0 : ref6.map(function(options) {
|
44
|
+
var ref;
|
45
|
+
return {
|
46
|
+
name: options.scheme.name,
|
47
|
+
scheme: options.scheme,
|
48
|
+
offers: (ref = options.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
49
|
+
var _totalRepaymentAmount = decodePrice(offer.totalRepaymentAmount);
|
50
|
+
var _correctDownPaymentAmount = decodePrice(offer.correctDownPaymentAmount);
|
51
|
+
var _installmentAmount = decodePrice(offer.installmentAmount);
|
52
|
+
var _processingFeeAmount = decodePrice(offer.processingFeeAmount);
|
53
|
+
var totalRepaymentAmount = formatAsCurrency({
|
54
|
+
price: _totalRepaymentAmount,
|
55
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
56
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
57
|
+
locale: configLocale || 'en'
|
58
|
+
});
|
59
|
+
var correctDownPaymentAmount = formatAsCurrency({
|
60
|
+
price: _correctDownPaymentAmount,
|
61
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
62
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
63
|
+
locale: configLocale || 'en'
|
64
|
+
});
|
65
|
+
var installmentAmount = formatAsCurrency({
|
66
|
+
price: _installmentAmount,
|
67
|
+
precision: offer.installmentAmount.fractionDigits,
|
68
|
+
currency: offer.installmentAmount.currencyCode,
|
69
|
+
locale: configLocale || 'en'
|
70
|
+
});
|
71
|
+
var processingFeeAmount = formatAsCurrency({
|
72
|
+
price: _processingFeeAmount,
|
73
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
74
|
+
currency: offer.processingFeeAmount.currencyCode,
|
75
|
+
locale: configLocale || 'en'
|
76
|
+
});
|
77
|
+
return _objectSpread({}, offer, {
|
78
|
+
offerRaw: offer,
|
79
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
80
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
81
|
+
installmentAmount: installmentAmount,
|
82
|
+
processingFeeAmount: processingFeeAmount
|
83
|
+
});
|
84
|
+
}).sort(function(offer, offer2) {
|
85
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
86
|
+
})
|
87
|
+
};
|
83
88
|
})
|
84
89
|
});
|
85
90
|
}, [
|
@@ -230,7 +230,7 @@ export var createMappedAttributes = function(currentVariant) {
|
|
230
230
|
export var processAvailabilityPerStore = function(availabilities) {
|
231
231
|
var ref;
|
232
232
|
return (ref = availabilities === null || availabilities === void 0 ? void 0 : availabilities.filter(function(x) {
|
233
|
-
return
|
233
|
+
return x.availableQuantity > 0;
|
234
234
|
})) === null || ref === void 0 ? void 0 : ref.map(function(param) {
|
235
235
|
var acceptsBackorders = param.acceptsBackorders, stockLocationName = param.stockLocationName, restockableInDays = param.restockableInDays, availableQuantity = param.availableQuantity;
|
236
236
|
return {
|
@@ -30,49 +30,56 @@ function _objectSpread(target) {
|
|
30
30
|
return target;
|
31
31
|
}
|
32
32
|
export var useBnpOffers = function(props) {
|
33
|
-
var
|
34
|
-
var configLocale = ((
|
33
|
+
var ref4, ref1, ref2, ref3;
|
34
|
+
var configLocale = ((ref4 = useConfigState()) === null || ref4 === void 0 ? void 0 : (ref1 = ref4.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
35
35
|
var response = useBnpOffersQuery(props);
|
36
36
|
return useMemo(function() {
|
37
|
-
var
|
37
|
+
var ref5;
|
38
38
|
return _objectSpread({}, response, {
|
39
|
-
data: response === null || response === void 0 ? void 0 : (
|
40
|
-
var
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
39
|
+
data: response === null || response === void 0 ? void 0 : (ref5 = response.data) === null || ref5 === void 0 ? void 0 : ref5.map(function(result) {
|
40
|
+
var ref;
|
41
|
+
return {
|
42
|
+
name: result.scheme.name,
|
43
|
+
scheme: result.scheme,
|
44
|
+
offers: (ref = result.offers) === null || ref === void 0 ? void 0 : ref.map(function(offer) {
|
45
|
+
var _totalRepaymentAmount = decodePrice(offer.totalRepaymentAmount);
|
46
|
+
var _correctDownPaymentAmount = decodePrice(offer.correctDownPaymentAmount);
|
47
|
+
var _installmentAmount = decodePrice(offer.installmentAmount);
|
48
|
+
var _processingFeeAmount = decodePrice(offer.processingFeeAmount);
|
49
|
+
var totalRepaymentAmount = formatAsCurrency({
|
50
|
+
price: _totalRepaymentAmount,
|
51
|
+
precision: offer.totalRepaymentAmount.fractionDigits,
|
52
|
+
currency: offer.totalRepaymentAmount.currencyCode,
|
53
|
+
locale: configLocale || 'en'
|
54
|
+
});
|
55
|
+
var correctDownPaymentAmount = formatAsCurrency({
|
56
|
+
price: _correctDownPaymentAmount,
|
57
|
+
precision: offer.correctDownPaymentAmount.fractionDigits,
|
58
|
+
currency: offer.correctDownPaymentAmount.currencyCode,
|
59
|
+
locale: configLocale || 'en'
|
60
|
+
});
|
61
|
+
var installmentAmount = formatAsCurrency({
|
62
|
+
price: _installmentAmount,
|
63
|
+
precision: offer.installmentAmount.fractionDigits,
|
64
|
+
currency: offer.installmentAmount.currencyCode,
|
65
|
+
locale: configLocale || 'en'
|
66
|
+
});
|
67
|
+
var processingFeeAmount = formatAsCurrency({
|
68
|
+
price: _processingFeeAmount,
|
69
|
+
precision: offer.processingFeeAmount.fractionDigits,
|
70
|
+
currency: offer.processingFeeAmount.currencyCode,
|
71
|
+
locale: configLocale || 'en'
|
72
|
+
});
|
73
|
+
return _objectSpread({}, offer, {
|
74
|
+
totalRepaymentAmount: totalRepaymentAmount,
|
75
|
+
correctDownPaymentAmount: correctDownPaymentAmount,
|
76
|
+
installmentAmount: installmentAmount,
|
77
|
+
processingFeeAmount: processingFeeAmount
|
78
|
+
});
|
79
|
+
}).sort(function(offer, offer2) {
|
80
|
+
return Number(offer.maturity) - Number(offer2.maturity);
|
81
|
+
})
|
82
|
+
};
|
76
83
|
})
|
77
84
|
});
|
78
85
|
}, [
|
@@ -3,6 +3,8 @@ export declare const useBnpCalculateForCart: (props?: {
|
|
3
3
|
downPaymentCentAmount?: number | undefined;
|
4
4
|
} | undefined) => {
|
5
5
|
data: {
|
6
|
+
name: string;
|
7
|
+
scheme: import("@sentecacommerce/sdk").PricingSchemesDTO;
|
6
8
|
offers: {
|
7
9
|
offerRaw: import("@sentecacommerce/sdk").LoanVariantDTO;
|
8
10
|
totalRepaymentAmount: import("../../index").FormattedPriceType;
|
@@ -13,9 +15,8 @@ export declare const useBnpCalculateForCart: (props?: {
|
|
13
15
|
maturity: string;
|
14
16
|
nir: string;
|
15
17
|
variantId: string;
|
16
|
-
}[]
|
17
|
-
|
18
|
-
};
|
18
|
+
}[];
|
19
|
+
}[] | undefined;
|
19
20
|
canFetchMore: boolean | undefined;
|
20
21
|
clear: () => void;
|
21
22
|
error: unknown;
|
@@ -4,14 +4,18 @@ export declare const useBnpOffers: (props: {
|
|
4
4
|
downPaymentCentAmount?: number;
|
5
5
|
}) => {
|
6
6
|
data: {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
name: string;
|
8
|
+
scheme: import("@sentecacommerce/sdk").PricingSchemesDTO;
|
9
|
+
offers: {
|
10
|
+
totalRepaymentAmount: import("../../index").FormattedPriceType;
|
11
|
+
correctDownPaymentAmount: import("../../index").FormattedPriceType;
|
12
|
+
installmentAmount: import("../../index").FormattedPriceType;
|
13
|
+
processingFeeAmount: import("../../index").FormattedPriceType;
|
14
|
+
apr: string;
|
15
|
+
maturity: string;
|
16
|
+
nir: string;
|
17
|
+
variantId: string;
|
18
|
+
}[];
|
15
19
|
}[] | undefined;
|
16
20
|
canFetchMore: boolean | undefined;
|
17
21
|
clear: () => void;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
3
3
|
"sideEffects": false,
|
4
|
-
"version": "0.13.
|
4
|
+
"version": "0.13.21-alpha.0+1eaf982",
|
5
5
|
"main": "dist/cjs/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
7
7
|
"types": "dist/types/index.d.ts",
|
@@ -31,13 +31,13 @@
|
|
31
31
|
"watch:cjs": "swc src --out-dir dist/cjs -w",
|
32
32
|
"watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "1eaf9822c6a7e00f5e893efbe7b4d74adac6ead9",
|
35
35
|
"peerDependencies": {
|
36
36
|
"react-query": "^2.26.2"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@sentecacommerce-theme/base": "^0.13.
|
40
|
-
"@sentecacommerce-theme/cms": "^0.13.
|
39
|
+
"@sentecacommerce-theme/base": "^0.13.21-alpha.0+1eaf982",
|
40
|
+
"@sentecacommerce-theme/cms": "^0.13.21-alpha.0+1eaf982",
|
41
41
|
"@sentecacommerce/sdk": "2.0.175",
|
42
42
|
"body-scroll-lock": "^3.1.5",
|
43
43
|
"copy-to-clipboard": "^3.3.1",
|