@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.
package/dist/cjs/index.js CHANGED
@@ -248,9 +248,17 @@ HeaderMyChoiceMobile.defaultProps = {
248
248
  className: '',
249
249
  };
250
250
 
251
+ const LoaderVid = () => (
252
+ // eslint-disable-next-line jsx-a11y/media-has-caption
253
+ jsxRuntime.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' } }));
254
+
251
255
  const LoaderPrimary = () => {
252
256
  const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
253
- return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [!!appLoaderState.description && jsxRuntime.jsx("h4", { children: appLoaderState.description }), jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {})] }));
257
+ const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
258
+ console.log(window.location.pathname);
259
+ const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
260
+ console.log(isLastPage);
261
+ return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === mychoiceSdkComponents.AppTypes.TheBig || !isLastPage ? jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {}) : jsxRuntime.jsx(LoaderVid, {}), !!appLoaderState.description && (jsxRuntime.jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxRuntime.jsxs("div", { children: [line, jsxRuntime.jsx("br", {})] }, index))) }))] }));
254
262
  };
255
263
 
256
264
  const ModalConfirm = () => {
@@ -2190,7 +2198,7 @@ const SectionApplicantInfo = () => {
2190
2198
  });
2191
2199
  }
2192
2200
  };
2193
- return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsx("h2", { className: "section-title", children: " A bit about you and how long you have held fort." }), jsxRuntime.jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Applicant First Name", error: !firstName && applicantState.inValidation, errorMessage: getErrorMessage(firstName, applicantState.inValidation) }), jsxRuntime.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: mychoiceSdkComponents.subYearsFromDate('', 14), isDay: true }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.residentsOptions, name: "familiesCount", onChange: handleFamiliesCountChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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' && (jsxRuntime.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." }))] }), jsxRuntime.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 })] }));
2201
+ return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsx("h2", { className: "section-title", children: " A bit about you and how long you have held fort." }), jsxRuntime.jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Applicant First Name", error: !firstName && applicantState.inValidation, errorMessage: getErrorMessage(firstName, applicantState.inValidation) }), jsxRuntime.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: mychoiceSdkComponents.subYearsFromDate('', 14), isDay: true }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.residentsOptions, name: "familiesCount", onChange: handleFamiliesCountChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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' && (jsxRuntime.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." }))] }), jsxRuntime.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 })] }));
2194
2202
  };
2195
2203
 
2196
2204
  const SectionApplicantInsurancePolicy = () => {
@@ -2563,7 +2571,7 @@ const SectionDwelling = () => {
2563
2571
  // payload: { replacementCost: value as string },
2564
2572
  // });
2565
2573
  // };
2566
- return (jsxRuntime.jsxs("div", { className: "form-section top-section", children: [jsxRuntime.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 }), jsxRuntime.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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(InputFormBox, { name: "livingArea", title: "What is the total square footage of the living area in your property?", type: mychoiceSdkComponents.InputTypes.Number, onChange: handleLivingAreaChange, defaultValue: livingArea, placeholder: "Living area", error: !livingArea && dwellingState.inValidation, errorMessage: getErrorMessage(livingArea, dwellingState.inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.exteriorFinishOptions, name: "exteriorFinish", onChange: handleExteriorFinishChange, defaultValue: getSelectedOption(mychoiceSdkComponents.exteriorFinishOptions, exteriorFinish), title: "What is the exterior material or finish of your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.constructionTypeOptions, name: "constructionType", onChange: handleConstructionTypeChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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 }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.garageTypeOptions, name: "garageType", onChange: handleGarageTypeChange, defaultValue: getSelectedOption(mychoiceSdkComponents.garageTypeOptions, garageType), title: "What type of garage is present on your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.getNumericOptions(0, 100, '%'), name: "basementFinishPercent", onChange: handleBasementFinishPercentChange, defaultValue: getSelectedOption(mychoiceSdkComponents.getNumericOptions(0, 100, '%'), basementFinishPercent), title: "How much of the basement is finished?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(InputFormBox, { name: "storeysCount", title: "How many levels does your property have?", type: mychoiceSdkComponents.InputTypes.Number, onChange: handleStoreysCountChange, defaultValue: storeysCount, placeholder: "Storeys count", minValue: 1, maxValue: 30 })] })), (isHomeOwner
2574
+ return (jsxRuntime.jsxs("div", { className: "form-section top-section", children: [jsxRuntime.jsx("h2", { className: "section-title", style: { textAlign: 'center' }, children: "Tell us a bit about your place." }), jsxRuntime.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 }), jsxRuntime.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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(InputFormBox, { name: "livingArea", title: "What is the total square footage of the living area in your property?", type: mychoiceSdkComponents.InputTypes.Number, onChange: handleLivingAreaChange, defaultValue: livingArea, placeholder: "Living area", error: !livingArea && dwellingState.inValidation, errorMessage: getErrorMessage(livingArea, dwellingState.inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.exteriorFinishOptions, name: "exteriorFinish", onChange: handleExteriorFinishChange, defaultValue: getSelectedOption(mychoiceSdkComponents.exteriorFinishOptions, exteriorFinish), title: "What is the exterior material or finish of your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.constructionTypeOptions, name: "constructionType", onChange: handleConstructionTypeChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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 }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.garageTypeOptions, name: "garageType", onChange: handleGarageTypeChange, defaultValue: getSelectedOption(mychoiceSdkComponents.garageTypeOptions, garageType), title: "What type of garage is present on your property?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.getNumericOptions(0, 100, '%'), name: "basementFinishPercent", onChange: handleBasementFinishPercentChange, defaultValue: getSelectedOption(mychoiceSdkComponents.getNumericOptions(0, 100, '%'), basementFinishPercent), title: "How much of the basement is finished?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false }), jsxRuntime.jsx(InputFormBox, { name: "storeysCount", title: "How many levels does your property have?", type: mychoiceSdkComponents.InputTypes.Number, onChange: handleStoreysCountChange, defaultValue: storeysCount, placeholder: "Storeys count", minValue: 1, maxValue: 30 })] })), (isHomeOwner
2567
2575
  || (isCondoOwner && ['endrow', 'inrow'].includes(buildingStructure))
2568
2576
  || (isTenant && ['detached', 'basement', 'endrow', 'inrow', 'duplex', 'triplex'].includes(buildingStructure)))
2569
2577
  && (jsxRuntime.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 })), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.fireHallDistanceOptions, name: "fireHallDistance", onChange: handleFireHallDistanceChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.fireHydrantDistanceOptions, name: "fireHydrantDistance", onChange: handleFireHydrantDistanceChange, defaultValue: getSelectedOption(mychoiceSdkComponents.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) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.primaryHeatingTypeOptions, name: `heatings-${0}`, onChange: handleHeatingTypeChange(0), defaultValue: getSelectedOption(mychoiceSdkComponents.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 && (jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.auxHeatingTypeOptions, name: `heatings-${1}`, onChange: handleHeatingTypeChange(1), defaultValue: getSelectedOption(mychoiceSdkComponents.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))
@@ -4335,6 +4343,7 @@ exports.InputFormLicenceBox = InputFormLicenceBox;
4335
4343
  exports.InputFormPhoneBox = InputFormPhoneBox;
4336
4344
  exports.LabelFormBox = LabelFormBox;
4337
4345
  exports.LoaderPrimary = LoaderPrimary;
4346
+ exports.LoaderVid = LoaderVid;
4338
4347
  exports.ModalAddress = ModalAddress;
4339
4348
  exports.ModalConfirm = ModalConfirm;
4340
4349
  exports.ModalFinale = ModalFinale;