@mychoice/mychoice-sdk-modules 2.1.62 → 2.1.64
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 +12 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +13 -10
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
3
|
-
import { AppTypes, TitleForm, TooltipForm, IconDelete, ColorVariablesTypes, InputTypes, InputForm, InputFormPhone, InputFormEmail, InputFormLicence, SelectForm, getFormattedDate, DateTypes, getDateOptions, ButtonForm, OfferHeader, OfferPrice, ButtonBase, ButtonTypes, CategoryTypes, ColorTypes, ButtonVariantTypes, SizeTypes, IconDropdownArrow, OfferDetail, CompanyRoleTypes, OperationHoursInfo, InsuranceTypes, HeaderNavGroup, ButtonMenu, DeviceTypes, IconLoaderPrimary, getInsuranceType, RequestStatusTypes, formatPostalCode, IconLoaderSecondary, postalCodeFormat, defaultBrokerPhone, useEffectOnce, carCondition, carStatus, carWinterTiresCheck, carKeepPlace, carUsagePurpose, firstDriveDistanceList, dailyDriveBusinessDistanceList, yearlyDriveDistanceList, numberWithCommas, VehiclePrimaryUseTypes, comprehensiveCoverage, collisionCoverage, defaultLocalIndex, maritalStatusOptions, subYearsFromDate, occupationOptions, genderOptions, applicantRelationshipOptions, addYearsToDate, checkDateIsSpecial, DriverLicenceTypes, getDifferenceInYears, getLicenceTypeOptions, getDisabledLicenceTypes, yesNoOptions, addDaysToDate, getMinDate, CheckboxForm, getMinDateByYears, compareDates, insuranceCancellationReasonOptions, DriverListTypes, licenceSuspensionsReasonOptions, trafficTicketsGroupOptions, DriverPriorityTypes, ValidationStatusTypes, QuoteEdit, coverageOptions, liabilityOptions, homeOwnerTypeOptions, tenantBuildingStructureOptions, condoBuildingStructureOptions, homeBuildingStructureOptions, residentsOptions, insuredYearsOptions, getInsuranceYearsOptions, ApplicantListTypes, claimTypeOptions, exteriorFinishOptions, constructionTypeOptions, garageTypeOptions, getNumericOptions, fireHallDistanceOptions, fireHydrantDistanceOptions, primaryHeatingTypeOptions, auxHeatingTypeOptions, InfoMessage, ppOptions, homeCoverageOptions, homeLiabilityOptions,
|
|
3
|
+
import { AppTypes, TitleForm, TooltipForm, IconDelete, ColorVariablesTypes, InputTypes, InputForm, InputFormPhone, InputFormEmail, InputFormLicence, SelectForm, getFormattedDate, DateTypes, getDateOptions, ButtonForm, OfferHeader, OfferPrice, ButtonBase, ButtonTypes, CategoryTypes, ColorTypes, ButtonVariantTypes, SizeTypes, IconDropdownArrow, OfferDetail, CompanyRoleTypes, OperationHoursInfo, InsuranceTypes, HeaderNavGroup, ButtonMenu, DeviceTypes, IconLoaderPrimary, getInsuranceType, RequestStatusTypes, formatPostalCode, IconLoaderSecondary, postalCodeFormat, defaultBrokerPhone, useEffectOnce, carCondition, carStatus, carWinterTiresCheck, carKeepPlace, carUsagePurpose, firstDriveDistanceList, dailyDriveBusinessDistanceList, yearlyDriveDistanceList, numberWithCommas, VehiclePrimaryUseTypes, comprehensiveCoverage, collisionCoverage, defaultLocalIndex, maritalStatusOptions, subYearsFromDate, occupationOptions, genderOptions, applicantRelationshipOptions, addYearsToDate, checkDateIsSpecial, DriverLicenceTypes, getDifferenceInYears, getLicenceTypeOptions, getDisabledLicenceTypes, yesNoOptions, addDaysToDate, getMinDate, CheckboxForm, getMinDateByYears, compareDates, insuranceCancellationReasonOptions, DriverListTypes, licenceSuspensionsReasonOptions, trafficTicketsGroupOptions, DriverPriorityTypes, ValidationStatusTypes, QuoteEdit, coverageOptions, liabilityOptions, homeOwnerTypeOptions, tenantBuildingStructureOptions, condoBuildingStructureOptions, homeBuildingStructureOptions, residentsOptions, insuredYearsOptions, getInsuranceYearsOptions, ApplicantListTypes, claimTypeOptions, exteriorFinishOptions, constructionTypeOptions, garageTypeOptions, getNumericOptions, fireHallDistanceOptions, fireHydrantDistanceOptions, primaryHeatingTypeOptions, auxHeatingTypeOptions, InfoMessage, ppOptions, homeCoverageOptions, homeLiabilityOptions, lifeInsuranceTypeOptions, lifeInsuranceOntarioTypeOptions, lifeCoverageOptions, smokerOptions, MychoiceStep, Step, IconClock, ButtonArrow, DirectionTypes, ButtonTabArrow, ButtonTab, ButtonTabMobile, NavigationCar, NavigationPerson, NavigationDiscount, NavigationQuotes, NavigationAddress, NavigationProperty, ModalTypes } from '@mychoice/mychoice-sdk-components';
|
|
4
4
|
import { useStoreAppConfig, CarQuoteDataHandler, useStorePartner, useStoreDeviceType, useStoreAppLoader, useStoreAppModal, StoreConfigAppModalActionTypes, useHandlerPostal, useHandlerCarMake, useHandlerCarModel, useStoreFormCarVehicle, StoreFormCarVehicleActionTypes, useProvince, useStoreFormCarDiscount, StoreFormCarDiscountActionTypes, useValidationVehicle, useStoreFormCarDriverBase, StoreFormCarDriverBaseActionTypes, useStoreFormCarConfig, useStoreFormCarDriverInfo, StoreFormCarDriverInfoActionTypes, useStoreFormCarDriverLicence, addDayToDate, StoreFormCarDriverLicenceActionTypes, useStoreFormCarDriverInsurance, useStoreFormCarQuote, StoreFormCarDriverInsuranceActionTypes, useStoreFormCarDriverCancellation, StoreFormCarDriverCancellationActionTypes, useStoreFormCarDriverSuspension, StoreFormCarDriverSuspensionActionTypes, useStoreFormCarDriverAccident, StoreFormCarDriverAccidentActionTypes, useStoreFormCarDriverTicket, StoreFormCarDriverTicketActionTypes, useValidationDriver, useValidationCarDiscount, useHandlerCarQuoterEmail, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeApplicantBase, StoreFormHomePostalActionTypes, StoreFormHomeDwellingActionTypes, StoreConfigAppConfigActionTypes, StoreFormHomeApplicantBaseActionTypes, useValidationAddress, useStoreFormHomeApplicantInfo, useStoreFormHomeDiscount, StoreFormHomeDiscountActionTypes, StoreFormHomeApplicantInfoActionTypes, useStoreFormHomeApplicantInsurance, StoreFormHomeApplicantInsuranceActionTypes, useStoreFormHomeApplicantCancellation, StoreFormHomeApplicantCancellationActionTypes, useStoreFormHomeApplicantClaim, StoreFormHomeApplicantClaimActionTypes, useValidationApplicant, useValidationDwelling, useStoreFormHomeQuote, HomeQuoteDataHandler, useValidationHomeDiscount, useHandlerHomeQuoterEmail, useStoreFormLifeCoverage, StoreFormLifeCoverageActionTypes, useValidationCoverage, useStoreFormLifeQuote, useStoreFormLifeApplicant, LifeQuoteDataHandler, useValidationLifeApplicant, useHandlerLifeQuoterEmail, StoreFormLifeApplicantActionTypes, useStoreFormCarPostal, useStoreFormLifePostal, ClearFormDataHandler, useStoreAppDevice, useStoreClient, useHandlerAuth, useHandlerPartner, StoreConfigAppLoaderActionTypes, StoreFormCarConfigActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StoreClientActionTypes, StoreConfigAppDeviceActionTypes, StoreProvider, initHttpResponse } from '@mychoice/mychoice-sdk-store';
|
|
5
5
|
import { useNavigate, useLocation, BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
|
6
6
|
import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react';
|
|
@@ -3005,6 +3005,11 @@ const SectionCoverage = () => {
|
|
|
3005
3005
|
});
|
|
3006
3006
|
};
|
|
3007
3007
|
const newLifeOptions = useMemo(() => {
|
|
3008
|
+
if (process.env.REACT_APP_ENV !== 'production') {
|
|
3009
|
+
return {
|
|
3010
|
+
options: lifeInsuranceTypeOptions,
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3008
3013
|
// Use different set for Ontario
|
|
3009
3014
|
if (isMychoice && province === '9') {
|
|
3010
3015
|
return {
|
|
@@ -3629,7 +3634,7 @@ NavigationBottomTheBig.defaultProps = {
|
|
|
3629
3634
|
|
|
3630
3635
|
const NavigationTab = React.memo((props) => {
|
|
3631
3636
|
const { className, name, addButtonLabel, items, selectItem, removeItem, createItem, activeItemIndex = 0, maxItemCount = 5, readOnly, } = props;
|
|
3632
|
-
const { appConfigState: { appType } } = useStoreAppConfig();
|
|
3637
|
+
const { appConfigState: { appType }, } = useStoreAppConfig();
|
|
3633
3638
|
const isThebig = appType === AppTypes.TheBig;
|
|
3634
3639
|
const handleButtonClick = (index) => () => {
|
|
3635
3640
|
if (selectItem) {
|
|
@@ -3645,20 +3650,18 @@ const NavigationTab = React.memo((props) => {
|
|
|
3645
3650
|
const handleArrowClick = (direction) => {
|
|
3646
3651
|
if (selectItem) {
|
|
3647
3652
|
if (direction === DirectionTypes.Left) {
|
|
3648
|
-
selectItem(
|
|
3653
|
+
selectItem(activeItemIndex - 1 > -1 ? activeItemIndex - 1 : 0);
|
|
3649
3654
|
}
|
|
3650
3655
|
if (direction === DirectionTypes.Right) {
|
|
3651
|
-
selectItem(
|
|
3656
|
+
selectItem(activeItemIndex + 1 < maxItemCount ? activeItemIndex + 1 : maxItemCount);
|
|
3652
3657
|
}
|
|
3653
3658
|
}
|
|
3654
3659
|
};
|
|
3655
3660
|
const reduceCount = activeItemIndex === 4 ? 2 : 1;
|
|
3656
|
-
return (jsxs("div", { className: `navigation-tab-box ${className}`, children: [
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
}, (prevProps, nextProps) => !((prevProps.items !== nextProps.items
|
|
3661
|
-
|| prevProps.activeItemIndex !== nextProps.activeItemIndex)));
|
|
3661
|
+
return (jsxs("div", { className: `navigation-tab-box ${className}`, children: [activeItemIndex > 1 && jsx(ButtonTabArrow, { onClick: () => handleArrowClick(DirectionTypes.Left) }), activeItemIndex <= items.length - 2 &&
|
|
3662
|
+
activeItemIndex < 3 &&
|
|
3663
|
+
((items.length > 2 && createItem) || (items.length > 3 && !createItem)) && (jsx(ButtonTabArrow, { onClick: () => handleArrowClick(DirectionTypes.Right), direction: DirectionTypes.Right })), jsxs("div", { className: "navigation-tab-container", style: { marginLeft: `${activeItemIndex > 1 ? `-${(activeItemIndex - reduceCount) * 9.875}rem` : '0'}` }, children: [items.map((tab, index) => (jsx(ButtonTab, { className: `${activeItemIndex === index ? 'active-tab' : 'inactive-tab'} ${isThebig ? 'thebig-bold' : 'mychoice'}`, label: tab.name, buttonClick: handleButtonClick(index), iconClick: handleIconClick(index), selfDelete: index !== 0 && !readOnly }, `${name}-${index}`))), items.length < maxItemCount && createItem && (jsx(ButtonTab, { className: isThebig ? 'add-thebig-medium' : 'add mychoice', label: addButtonLabel, buttonClick: createItem, selfDelete: false }))] })] }));
|
|
3664
|
+
}, (prevProps, nextProps) => !(prevProps.items !== nextProps.items || prevProps.activeItemIndex !== nextProps.activeItemIndex));
|
|
3662
3665
|
NavigationTab.defaultProps = {
|
|
3663
3666
|
className: '',
|
|
3664
3667
|
items: [],
|