@mychoice/mychoice-sdk-modules 2.1.81 → 2.1.83
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 +16 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +16 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -404,7 +404,19 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
|
|
|
404
404
|
postRequestQuoteOnliaUrl(true, redirectUrl);
|
|
405
405
|
};
|
|
406
406
|
const isHubIntegration = brokerIntegration?.type === 'hub';
|
|
407
|
-
return (jsxRuntime.jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [(isTheBig || !offsiteUrl) && (jsxRuntime.
|
|
407
|
+
return (jsxRuntime.jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [(isTheBig || !offsiteUrl) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: mychoiceSdkComponents.CompanyRoleTypes.Broker, description: brokerCompany?.description, isBestOffer: isBestOffer }), jsxRuntime.jsx("hr", { style: {
|
|
408
|
+
margin: '0',
|
|
409
|
+
padding: '0',
|
|
410
|
+
width: '100%',
|
|
411
|
+
height: '1px',
|
|
412
|
+
backgroundColor: '$color-background-header-primary',
|
|
413
|
+
} })] })), jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsxRuntime.jsx(mychoiceSdkComponents.OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) }), jsxRuntime.jsx("hr", { style: {
|
|
414
|
+
margin: '0',
|
|
415
|
+
padding: '0',
|
|
416
|
+
width: '100%',
|
|
417
|
+
height: '1px',
|
|
418
|
+
backgroundColor: '$color-background-header-primary',
|
|
419
|
+
} }), !isHubIntegration && (jsxRuntime.jsx(mychoiceSdkComponents.OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer })), !isHubIntegration && (jsxRuntime.jsx(mychoiceSdkComponents.OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice })), isHubIntegration && (jsxRuntime.jsx("div", { className: "offer-phone hub-integration", children: jsxRuntime.jsx("div", { className: "hub-message-container", children: jsxRuntime.jsxs("p", { className: "hub-description", children: [jsxRuntime.jsx("span", { children: brokerIntegration?.data?.label }), jsxRuntime.jsx("br", {}), brokerIntegration?.data?.description] }) }) })), brokerIntegration?.type === 'youset' && brokerIntegration?.data?.url && (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: brokerIntegration?.data?.description || 'Click below to view your YouSet offer' }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: brokerIntegration?.data?.label || 'View Offer', type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium, onClick: () => window.open(brokerIntegration.data.url, '_blank') })] })), !brokerIntegration && !isTheBig && offsiteUrl && (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { children: "Click below to get this rate" }), jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy Online", type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium, onClick: handleCTAClick })] })), !brokerIntegration && (isTheBig || !offsiteUrl) && (jsxRuntime.jsxs("div", { className: "offer-phone", children: [jsxRuntime.jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsxRuntime.jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsxRuntime.jsx(mychoiceSdkComponents.ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: mychoiceSdkComponents.ButtonTypes.Button, category: mychoiceSdkComponents.CategoryTypes.Filled, color: mychoiceSdkComponents.ColorTypes.Primary, variant: mychoiceSdkComponents.ButtonVariantTypes.Rectangle, size: mychoiceSdkComponents.SizeTypes.Medium }) })] })), jsxRuntime.jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsxRuntime.jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsxRuntime.jsx(mychoiceSdkComponents.IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxRuntime.jsxs("div", { className: "offer-details", children: [!isHubIntegration && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(mychoiceSdkComponents.OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: mychoiceSdkComponents.CompanyRoleTypes.Offering, description: offerCompany?.description, isBestOffer: isBestOffer }) })), isMyChoice && coverages && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("hr", {}), jsxRuntime.jsx(VehicleOfferCoverages, { coverages: coverages, nonStandardCoverages: nonStandardCoverages })] }))] }))] }));
|
|
408
420
|
};
|
|
409
421
|
OfferSection.defaultProps = {
|
|
410
422
|
offerPrice: { monthly: 0, yearly: 0 },
|
|
@@ -619,7 +631,7 @@ const getRecommendedRange = (distanceDaily, distanceBusiness) => {
|
|
|
619
631
|
};
|
|
620
632
|
|
|
621
633
|
const BlockCarInfo = () => {
|
|
622
|
-
const { status: statusMake, getVehicleMake,
|
|
634
|
+
const { status: statusMake, getVehicleMake, vehicleMakeGroupList = [], } = mychoiceSdkStore.useHandlerCarMake();
|
|
623
635
|
const { status: statusModel, getVehicleModel, vehicleModelList = [] } = mychoiceSdkStore.useHandlerCarModel();
|
|
624
636
|
const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
|
|
625
637
|
const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
|
|
@@ -659,10 +671,10 @@ const BlockCarInfo = () => {
|
|
|
659
671
|
getVehicleModel(currentYear, currentMake);
|
|
660
672
|
}
|
|
661
673
|
});
|
|
662
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!
|
|
674
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!vehicleMakeGroupList.length
|
|
663
675
|
&& yearIsValid
|
|
664
676
|
&& statusMake === mychoiceSdkComponents.RequestStatusTypes.Success
|
|
665
|
-
&& (jsxRuntime.jsx(SelectFormBox, { options:
|
|
677
|
+
&& (jsxRuntime.jsx(SelectFormBox, { options: [], groupOptions: vehicleMakeGroupList, name: "carMakes", title: "Car Manufacturer", placeholder: "Select a Make", description: "The manufacturer of your vehicle is a huge influence on your insurance premium, but it isn\u2019t the only consideration. Some car manufacturers include security features that may qualify for discounts, like anti-theft protection or anti-lock brakes. Insurers also consider repair, risk, injury, and retail prices. If you do not see your vehicle on our list, call us for a telephonic quote.", error: !currentMake && vehicleState.inValidation, errorMessage: getErrorMessage(currentMake, vehicleState.inValidation), defaultValue: currentMake, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleMakeChange })), vehicleModelList.length > 0
|
|
666
678
|
&& currentMake
|
|
667
679
|
&& yearIsValid
|
|
668
680
|
&& statusModel === mychoiceSdkComponents.RequestStatusTypes.Success
|