@bunnyapp/components 1.7.0-beta.45 → 1.7.0-beta.47
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/dist/cjs/index.js +8 -8
- package/dist/esm/index.js +8 -8
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1283,7 +1283,7 @@ const DEFAULT_CONFIG = {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
|
|
1285
1285
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1286
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1286
|
+
const PACKAGE_VERSION = '1.7.0-beta.46';
|
|
1287
1287
|
const createRequestHeaders = (token) => {
|
|
1288
1288
|
const headers = createClientDevHeaders({ token });
|
|
1289
1289
|
// Add the components version header
|
|
@@ -28457,7 +28457,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28457
28457
|
const { mutate: createQuote, isPending: isCreatingQuote } = reactQuery.useMutation({
|
|
28458
28458
|
mutationFn: (subscriptionId) => quoteSubscriptionUpdate([subscriptionId], apiHost, token),
|
|
28459
28459
|
onSuccess: quote => {
|
|
28460
|
-
var _a, _b, _c;
|
|
28460
|
+
var _a, _b, _c, _d;
|
|
28461
28461
|
if (!(quote === null || quote === void 0 ? void 0 : quote.id))
|
|
28462
28462
|
throw new Error('quote id is required');
|
|
28463
28463
|
setQuoteId(quote === null || quote === void 0 ? void 0 : quote.id);
|
|
@@ -28474,7 +28474,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28474
28474
|
quantity,
|
|
28475
28475
|
quoteChangeId: quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id,
|
|
28476
28476
|
startDate: formatDateForApi(dayjs()),
|
|
28477
|
-
|
|
28477
|
+
priceListChargeId: (_d = subscriptionCharge.priceListCharge) === null || _d === void 0 ? void 0 : _d.id,
|
|
28478
28478
|
token,
|
|
28479
28479
|
});
|
|
28480
28480
|
},
|
|
@@ -28524,16 +28524,16 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28524
28524
|
}
|
|
28525
28525
|
// Used to disable all other quantity inputs for this subscription
|
|
28526
28526
|
setUpdatingChargeQuantityId(getUpdatingChargeQuantityId(charge.priceListChargeId, subscription.id));
|
|
28527
|
-
const
|
|
28528
|
-
debouncedQuantityUpdate(charge.priceListChargeId,
|
|
28527
|
+
const oldQuantity = (_a = charge.quantity) !== null && _a !== void 0 ? _a : 0;
|
|
28528
|
+
debouncedQuantityUpdate(charge.priceListChargeId, quantity, oldQuantity, subscription.id, quote, quoteId);
|
|
28529
28529
|
}
|
|
28530
28530
|
};
|
|
28531
28531
|
const debouncedDeleteQuote = react.useCallback(lodashExports.debounce((quoteId) => {
|
|
28532
28532
|
deleteQuote({ id: quoteId, apiHost, token });
|
|
28533
28533
|
}, DEBOUNCE_TIME), []);
|
|
28534
|
-
const debouncedQuantityUpdate = react.useCallback(lodashExports.debounce((priceListChargeId,
|
|
28534
|
+
const debouncedQuantityUpdate = react.useCallback(lodashExports.debounce((priceListChargeId, quantity, oldQuantity, subscriptionId, quote, quoteId) => {
|
|
28535
28535
|
var _a;
|
|
28536
|
-
if (
|
|
28536
|
+
if (quantity === oldQuantity) {
|
|
28537
28537
|
setErrorUpdatingQuantity(true);
|
|
28538
28538
|
showErrorNotification('New quantity cannot be the same as current');
|
|
28539
28539
|
return;
|
|
@@ -28548,7 +28548,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28548
28548
|
if (quoteCharge) {
|
|
28549
28549
|
updateQuoteCharge({
|
|
28550
28550
|
quoteChargeId: quoteCharge.id,
|
|
28551
|
-
quantity
|
|
28551
|
+
quantity,
|
|
28552
28552
|
});
|
|
28553
28553
|
}
|
|
28554
28554
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ const DEFAULT_CONFIG = {
|
|
|
1281
1281
|
};
|
|
1282
1282
|
|
|
1283
1283
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1284
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1284
|
+
const PACKAGE_VERSION = '1.7.0-beta.46';
|
|
1285
1285
|
const createRequestHeaders = (token) => {
|
|
1286
1286
|
const headers = createClientDevHeaders({ token });
|
|
1287
1287
|
// Add the components version header
|
|
@@ -28455,7 +28455,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28455
28455
|
const { mutate: createQuote, isPending: isCreatingQuote } = useMutation({
|
|
28456
28456
|
mutationFn: (subscriptionId) => quoteSubscriptionUpdate([subscriptionId], apiHost, token),
|
|
28457
28457
|
onSuccess: quote => {
|
|
28458
|
-
var _a, _b, _c;
|
|
28458
|
+
var _a, _b, _c, _d;
|
|
28459
28459
|
if (!(quote === null || quote === void 0 ? void 0 : quote.id))
|
|
28460
28460
|
throw new Error('quote id is required');
|
|
28461
28461
|
setQuoteId(quote === null || quote === void 0 ? void 0 : quote.id);
|
|
@@ -28472,7 +28472,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28472
28472
|
quantity,
|
|
28473
28473
|
quoteChangeId: quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id,
|
|
28474
28474
|
startDate: formatDateForApi(dayjs()),
|
|
28475
|
-
|
|
28475
|
+
priceListChargeId: (_d = subscriptionCharge.priceListCharge) === null || _d === void 0 ? void 0 : _d.id,
|
|
28476
28476
|
token,
|
|
28477
28477
|
});
|
|
28478
28478
|
},
|
|
@@ -28522,16 +28522,16 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28522
28522
|
}
|
|
28523
28523
|
// Used to disable all other quantity inputs for this subscription
|
|
28524
28524
|
setUpdatingChargeQuantityId(getUpdatingChargeQuantityId(charge.priceListChargeId, subscription.id));
|
|
28525
|
-
const
|
|
28526
|
-
debouncedQuantityUpdate(charge.priceListChargeId,
|
|
28525
|
+
const oldQuantity = (_a = charge.quantity) !== null && _a !== void 0 ? _a : 0;
|
|
28526
|
+
debouncedQuantityUpdate(charge.priceListChargeId, quantity, oldQuantity, subscription.id, quote, quoteId);
|
|
28527
28527
|
}
|
|
28528
28528
|
};
|
|
28529
28529
|
const debouncedDeleteQuote = useCallback(lodashExports.debounce((quoteId) => {
|
|
28530
28530
|
deleteQuote({ id: quoteId, apiHost, token });
|
|
28531
28531
|
}, DEBOUNCE_TIME), []);
|
|
28532
|
-
const debouncedQuantityUpdate = useCallback(lodashExports.debounce((priceListChargeId,
|
|
28532
|
+
const debouncedQuantityUpdate = useCallback(lodashExports.debounce((priceListChargeId, quantity, oldQuantity, subscriptionId, quote, quoteId) => {
|
|
28533
28533
|
var _a;
|
|
28534
|
-
if (
|
|
28534
|
+
if (quantity === oldQuantity) {
|
|
28535
28535
|
setErrorUpdatingQuantity(true);
|
|
28536
28536
|
showErrorNotification('New quantity cannot be the same as current');
|
|
28537
28537
|
return;
|
|
@@ -28546,7 +28546,7 @@ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription,
|
|
|
28546
28546
|
if (quoteCharge) {
|
|
28547
28547
|
updateQuoteCharge({
|
|
28548
28548
|
quoteChargeId: quoteCharge.id,
|
|
28549
|
-
quantity
|
|
28549
|
+
quantity,
|
|
28550
28550
|
});
|
|
28551
28551
|
}
|
|
28552
28552
|
}
|
package/package.json
CHANGED