@mychoice/mychoice-sdk-modules 2.1.15 → 2.1.17

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.
@@ -0,0 +1,2 @@
1
+ import { SdkFC } from '@mychoice/mychoice-sdk-components';
2
+ export declare const LoaderVid: SdkFC;
@@ -1 +1,2 @@
1
1
  export { LoaderPrimary } from './LoaderPrimary';
2
+ export { LoaderVid } from './LoaderVid';
@@ -1 +1,2 @@
1
1
  export { LoaderPrimary } from './LoaderPrimary';
2
+ export { LoaderVid } from './LoaderPrimary/LoaderVid';
package/dist/esm/index.js CHANGED
@@ -238,9 +238,17 @@ HeaderMyChoiceMobile.defaultProps = {
238
238
  className: '',
239
239
  };
240
240
 
241
+ const LoaderVid = () => (
242
+ // eslint-disable-next-line jsx-a11y/media-has-caption
243
+ jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/Pig-Video.mp4", autoPlay: true, loop: true, muted: true, preload: "auto", style: { maxHeight: '400px' } }));
244
+
241
245
  const LoaderPrimary = () => {
242
246
  const { appLoaderState } = useStoreAppLoader();
243
- return (jsxs("div", { className: "loader-wrapper", children: [!!appLoaderState.description && jsx("h4", { children: appLoaderState.description }), jsx(IconLoaderPrimary, {})] }));
247
+ const { appConfigState } = useStoreAppConfig();
248
+ console.log(window.location.pathname);
249
+ const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
250
+ console.log(isLastPage);
251
+ return (jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === AppTypes.TheBig || !isLastPage ? jsx(IconLoaderPrimary, {}) : jsx(LoaderVid, {}), !!appLoaderState.description && (jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxs("div", { children: [line, jsx("br", {})] }, index))) }))] }));
244
252
  };
245
253
 
246
254
  const ModalConfirm = () => {
@@ -2180,7 +2188,7 @@ const SectionApplicantInfo = () => {
2180
2188
  });
2181
2189
  }
2182
2190
  };
2183
- return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsx("h2", { className: "section-title", children: " A bit about you and how long you have held fort." }), jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Applicant First Name", error: !firstName && applicantState.inValidation, errorMessage: getErrorMessage(firstName, applicantState.inValidation) }), jsx(DateSelectFormBox, { name: "dateOfBirth", dateNames: ['birthYear', 'birthMonth', 'birthDay'], onDateChange: handleDateOfBirthChange, defaultValue: defaultDateOfBirth, title: "Birthdate of the oldest applicant", description: "If there\u2019s more than one applicant, please use the date of birth of the eldest applicant.", error: applicantState.inValidation, errorMessage: getDateErrorMessage([birthDay || '', birthMonth || '', birthYear || ''], applicantState.inValidation), maxDate: subYearsFromDate('', 14), isDay: true }), jsxs("div", { children: [jsx(SelectFormBox, { options: residentsOptions, name: "familiesCount", onChange: handleFamiliesCountChange, defaultValue: getSelectedOption(residentsOptions, familiesCount.toString()), title: "Who lives in this residence?", placeholder: "Select", description: "Let us know whether this address is being used for residential or commercial purposes.", autoSelectIfValueIsOutOfOptions: false, error: !familiesCount && applicantState.inValidation, errorMessage: getErrorMessage(familiesCount, applicantState.inValidation) }), familiesCount?.toString() === 'none' && (jsx("p", { className: "warning-message", children: "To obtain an accurate insurance quote, kindly reach out to a licensed representative at 1-855-331-6933 between Monday and Saturday, from 9:30 AM to 9:30 PM. Speaking with a representative is especially important for commercial properties, as it ensures that all relevant incidents are appropriately considered in your insurance quote." }))] }), jsx(DateSelectFormBox, { name: "occupiedDate", dateNames: ['occupiedYear'], datePlaceholders: ['Select'], onDateChange: handleOccupiedDateChange, defaultValue: defaultOccupiedDate, title: "In what year did you begin residing at this property?", hintMessage: occupiedHintMessage, errorMessage: getDateErrorMessage(['01', '01', occupiedYear || ''], applicantState.inValidation), error: applicantState.inValidation, minDate: birthDate, isMonth: false })] }));
2191
+ return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsx("h2", { className: "section-title", children: " A bit about you and how long you have held fort." }), jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Applicant First Name", error: !firstName && applicantState.inValidation, errorMessage: getErrorMessage(firstName, applicantState.inValidation) }), jsx(DateSelectFormBox, { name: "dateOfBirth", dateNames: ['birthYear', 'birthMonth', 'birthDay'], onDateChange: handleDateOfBirthChange, defaultValue: defaultDateOfBirth, title: "Birthdate of the oldest applicant", description: "If there\u2019s more than one applicant, please use the date of birth of the eldest applicant.", error: applicantState.inValidation, errorMessage: getDateErrorMessage([birthDay || '', birthMonth || '', birthYear || ''], applicantState.inValidation), maxDate: subYearsFromDate('', 14), isDay: true }), jsxs("div", { children: [jsx(SelectFormBox, { options: residentsOptions, name: "familiesCount", onChange: handleFamiliesCountChange, defaultValue: getSelectedOption(residentsOptions, familiesCount.toString()), title: "Who lives in this residence?", placeholder: "Select", description: "Please let us know whether this address is being used for residential or commercial purposes.", autoSelectIfValueIsOutOfOptions: false, error: !familiesCount && applicantState.inValidation, errorMessage: getErrorMessage(familiesCount, applicantState.inValidation) }), familiesCount?.toString() === 'none' && (jsx("p", { className: "warning-message", children: "To obtain an accurate insurance quote, kindly reach out to a licensed representative at 1-855-331-6933 between Monday and Saturday, from 9:30 AM to 9:30 PM. Speaking with a representative is especially important for commercial properties, as it ensures that all relevant incidents are appropriately considered in your insurance quote." }))] }), jsx(DateSelectFormBox, { name: "occupiedDate", dateNames: ['occupiedYear'], datePlaceholders: ['Select'], onDateChange: handleOccupiedDateChange, defaultValue: defaultOccupiedDate, title: "In what year did you begin residing at this property?", hintMessage: occupiedHintMessage, errorMessage: getDateErrorMessage(['01', '01', occupiedYear || ''], applicantState.inValidation), error: applicantState.inValidation, minDate: birthDate, isMonth: false })] }));
2184
2192
  };
2185
2193
 
2186
2194
  const SectionApplicantInsurancePolicy = () => {
@@ -2553,7 +2561,7 @@ const SectionDwelling = () => {
2553
2561
  // payload: { replacementCost: value as string },
2554
2562
  // });
2555
2563
  // };
2556
- return (jsxs("div", { className: "form-section top-section", children: [jsx(DateSelectFormBox, { name: "builtDate", dateNames: ['builtYear'], datePlaceholders: ['Select'], onDateChange: handleBuiltDateChange, defaultValue: builtDate, title: "What year was your property constructed?", errorMessage: getDateErrorMessage(['01', '01', builtYear || ''], dwellingState.inValidation), error: !builtYear && dwellingState.inValidation, isMonth: false }), jsx(SelectFormBox, { options: getBuildingStructureOptions(), name: "buildingStructure", onChange: handleBuildingStructureChange, defaultValue: getSelectedOption(getBuildingStructureOptions(), buildingStructure), title: "Describe the style of building", description: buildingStructureDescription, placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !buildingStructure && dwellingState.inValidation, errorMessage: getErrorMessage(buildingStructure, dwellingState.inValidation) }), isHomeOwner && (jsxs(Fragment, { children: [jsx(InputFormBox, { name: "livingArea", title: "What is the total square footage of the living area in your property?", type: InputTypes.Number, onChange: handleLivingAreaChange, defaultValue: livingArea, placeholder: "Living area", error: !livingArea && dwellingState.inValidation, errorMessage: getErrorMessage(livingArea, dwellingState.inValidation) }), jsx(SelectFormBox, { options: exteriorFinishOptions, name: "exteriorFinish", onChange: handleExteriorFinishChange, defaultValue: getSelectedOption(exteriorFinishOptions, exteriorFinish), title: "What is the exterior material or finish of your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: constructionTypeOptions, name: "constructionType", onChange: handleConstructionTypeChange, defaultValue: getSelectedOption(constructionTypeOptions, constructionType), title: "What is the construction classification/type of your property?", placeholder: "Select", description: "To provide an accurate insurance quote, insurance companies require knowledge of the construction type of your property. Typically, properties constructed with sturdy materials like brick have lower insurance costs due to their reduced combustibility. Although many properties built after 1970 feature brick, concrete, or stone exteriors, their underlying construction is often wood. Brick and masonry construction were more prevalent in houses built before 1970. High-rise buildings, on the other hand, are commonly constructed using fire-resistive materials. If you are unsure about the construction type of your property, please select 'Other'.", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: garageTypeOptions, name: "garageType", onChange: handleGarageTypeChange, defaultValue: getSelectedOption(garageTypeOptions, garageType), title: "What type of garage is present on your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: getNumericOptions(0, 100, '%'), name: "basementFinishPercent", onChange: handleBasementFinishPercentChange, defaultValue: getSelectedOption(getNumericOptions(0, 100, '%'), basementFinishPercent), title: "How much of the basement is finished?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(InputFormBox, { name: "storeysCount", title: "How many levels does your property have?", type: InputTypes.Number, onChange: handleStoreysCountChange, defaultValue: storeysCount, placeholder: "Storeys count", minValue: 1, maxValue: 30 })] })), (isHomeOwner
2564
+ return (jsxs("div", { className: "form-section top-section", children: [jsx("h2", { className: "section-title", style: { textAlign: 'center' }, children: "Tell us a bit about your place." }), jsx(DateSelectFormBox, { name: "builtDate", dateNames: ['builtYear'], datePlaceholders: ['Select'], onDateChange: handleBuiltDateChange, defaultValue: builtDate, title: "What year was your property constructed?", errorMessage: getDateErrorMessage(['01', '01', builtYear || ''], dwellingState.inValidation), error: !builtYear && dwellingState.inValidation, isMonth: false }), jsx(SelectFormBox, { options: getBuildingStructureOptions(), name: "buildingStructure", onChange: handleBuildingStructureChange, defaultValue: getSelectedOption(getBuildingStructureOptions(), buildingStructure), title: "Describe the style of building", description: buildingStructureDescription, placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !buildingStructure && dwellingState.inValidation, errorMessage: getErrorMessage(buildingStructure, dwellingState.inValidation) }), isHomeOwner && (jsxs(Fragment, { children: [jsx(InputFormBox, { name: "livingArea", title: "What is the total square footage of the living area in your property?", type: InputTypes.Number, onChange: handleLivingAreaChange, defaultValue: livingArea, placeholder: "Living area", error: !livingArea && dwellingState.inValidation, errorMessage: getErrorMessage(livingArea, dwellingState.inValidation) }), jsx(SelectFormBox, { options: exteriorFinishOptions, name: "exteriorFinish", onChange: handleExteriorFinishChange, defaultValue: getSelectedOption(exteriorFinishOptions, exteriorFinish), title: "What is the exterior material or finish of your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: constructionTypeOptions, name: "constructionType", onChange: handleConstructionTypeChange, defaultValue: getSelectedOption(constructionTypeOptions, constructionType), title: "What is the construction classification/type of your property?", placeholder: "Select", description: "To provide an accurate insurance quote, insurance companies require knowledge of the construction type of your property. Typically, properties constructed with sturdy materials like brick have lower insurance costs due to their reduced combustibility. Although many properties built after 1970 feature brick, concrete, or stone exteriors, their underlying construction is often wood. Brick and masonry construction were more prevalent in houses built before 1970. High-rise buildings, on the other hand, are commonly constructed using fire-resistive materials. If you are unsure about the construction type of your property, please select 'Other'.", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: garageTypeOptions, name: "garageType", onChange: handleGarageTypeChange, defaultValue: getSelectedOption(garageTypeOptions, garageType), title: "What type of garage is present on your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: getNumericOptions(0, 100, '%'), name: "basementFinishPercent", onChange: handleBasementFinishPercentChange, defaultValue: getSelectedOption(getNumericOptions(0, 100, '%'), basementFinishPercent), title: "How much of the basement is finished?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsx(InputFormBox, { name: "storeysCount", title: "How many levels does your property have?", type: InputTypes.Number, onChange: handleStoreysCountChange, defaultValue: storeysCount, placeholder: "Storeys count", minValue: 1, maxValue: 30 })] })), (isHomeOwner
2557
2565
  || (isCondoOwner && ['endrow', 'inrow'].includes(buildingStructure))
2558
2566
  || (isTenant && ['detached', 'basement', 'endrow', 'inrow', 'duplex', 'triplex'].includes(buildingStructure)))
2559
2567
  && (jsx(DateSelectFormBox, { name: "roofReplacedDate", dateNames: ['roofReplacedYear'], datePlaceholders: ['Select'], onDateChange: handleRoofReplaceDateChange, defaultValue: roofReplacedDate, title: "When was the last time your roof was replaced?", errorMessage: getDateErrorMessage(['01', '01', roofReplacedYear || ''], dwellingState.inValidation), error: dwellingState.inValidation, minDate: `${builtYear}-01-01`, isMonth: false })), jsx(SelectFormBox, { options: fireHallDistanceOptions, name: "fireHallDistance", onChange: handleFireHallDistanceChange, defaultValue: getSelectedOption(fireHallDistanceOptions, fireHallDistance), title: "How far is the nearest fire hall approximately?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !fireHallDistance && dwellingState.inValidation, errorMessage: getErrorMessage(fireHallDistance.toString(), dwellingState.inValidation) }), jsx(SelectFormBox, { options: fireHydrantDistanceOptions, name: "fireHydrantDistance", onChange: handleFireHydrantDistanceChange, defaultValue: getSelectedOption(fireHydrantDistanceOptions, fireHydrantDistance), title: "How far is the nearest fire hydrant approximately?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !fireHydrantDistance && dwellingState.inValidation, errorMessage: getErrorMessage(fireHydrantDistance.toString(), dwellingState.inValidation) }), jsx(SelectFormBox, { options: primaryHeatingTypeOptions, name: `heatings-${0}`, onChange: handleHeatingTypeChange(0), defaultValue: getSelectedOption(primaryHeatingTypeOptions, heatings[0].type), title: "What is the primary heating system installed at your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !heatings[0].type && dwellingState.inValidation, errorMessage: getErrorMessage(heatings[0].type, dwellingState.inValidation) }), isHomeOwner && (jsx(SelectFormBox, { options: auxHeatingTypeOptions, name: `heatings-${1}`, onChange: handleHeatingTypeChange(1), defaultValue: getSelectedOption(auxHeatingTypeOptions, heatings[1].type), title: "What is the secondary heating system installed at your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !heatings[1].type && dwellingState.inValidation, errorMessage: getErrorMessage(heatings[1].type, dwellingState.inValidation) })), ((isHomeOwner && ['detached', 'semidetached', 'endrow', 'inrow'].includes(buildingStructure))
@@ -4313,5 +4321,5 @@ AppWrapper.defaultProps = {
4313
4321
  insuranceType: InsuranceTypes.Car,
4314
4322
  };
4315
4323
 
4316
- export { AppWrapper, DateSelectFormBox, HeaderMyChoice, HeaderMyChoiceMobile, HeaderPartner, HeaderTheBig, InputFormBox, InputFormEmailBox, InputFormLicenceBox, InputFormPhoneBox, LabelFormBox, LoaderPrimary, ModalAddress, ModalConfirm, ModalFinale, ModalMessage, ModalPostal, ModalQuoteRequest, NavigationBottom, NavigationBottomTheBig, NavigationTab, NavigationTabMobile, NavigationTop, OfferSection, PageAddress, PageApplicant, PageCarDiscount, PageCarQuote, PageCoverage, PageDriver, PageHomeDiscount, PageHomeQuote, PageLifeApplicant, PageLifeQuote, PageProperty, PageVehicle, ProviderImageFooter, SelectFormBox, SwitchButtonBox, capitalize, formSteps, formatPhoneObject, formatTitleToCapital, getDateErrorMessage, getErrorMessage, getSelectedOption, usePathGroups };
4324
+ export { AppWrapper, DateSelectFormBox, HeaderMyChoice, HeaderMyChoiceMobile, HeaderPartner, HeaderTheBig, InputFormBox, InputFormEmailBox, InputFormLicenceBox, InputFormPhoneBox, LabelFormBox, LoaderPrimary, LoaderVid, ModalAddress, ModalConfirm, ModalFinale, ModalMessage, ModalPostal, ModalQuoteRequest, NavigationBottom, NavigationBottomTheBig, NavigationTab, NavigationTabMobile, NavigationTop, OfferSection, PageAddress, PageApplicant, PageCarDiscount, PageCarQuote, PageCoverage, PageDriver, PageHomeDiscount, PageHomeQuote, PageLifeApplicant, PageLifeQuote, PageProperty, PageVehicle, ProviderImageFooter, SelectFormBox, SwitchButtonBox, capitalize, formSteps, formatPhoneObject, formatTitleToCapital, getDateErrorMessage, getErrorMessage, getSelectedOption, usePathGroups };
4317
4325
  //# sourceMappingURL=index.js.map