@hhgtech/hhg-components 1.29.79 → 1.29.81
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/build/{index-aefa01a7.js → WhatsApp-82018096.js} +24 -276
- package/build/adapters.js +17 -16
- package/build/atoms.js +100 -0
- package/build/babyGrowth.js +162 -164
- package/build/cache.js +3 -3
- package/build/care.js +18 -18
- package/build/components.js +179 -163
- package/build/{constants-94957c92.js → constants-3a475a22.js} +2 -2
- package/build/constants-513a9a41.js +318 -0
- package/build/{index-6036e2a0.js → constants-936f45e9.js} +0 -136
- package/build/constants-dd16fb4d.js +425 -0
- package/build/constants.js +3 -3
- package/build/{core-279a7b4f.js → core-9e44ee99.js} +2 -2
- package/build/{index-5033f644.js → dataTransform-6b4d7a4e.js} +85 -134
- package/build/{dataTransform-1c96db25.js → dataTransform-c1701cbd.js} +1 -1
- package/build/defaultClassWrapper-e87ca8ef.js +21 -0
- package/build/ecom.js +5 -5
- package/build/esm/WhatsApp-7d3732e2.js +46 -0
- package/build/esm/adapters.js +17 -16
- package/build/esm/atoms.js +57 -0
- package/build/esm/babyGrowth.js +87 -89
- package/build/esm/cache.js +3 -3
- package/build/esm/care.js +17 -17
- package/build/esm/components.js +91 -75
- package/build/esm/constants-6bdb97a8.js +417 -0
- package/build/esm/constants-71d9f33b.js +307 -0
- package/build/esm/{constants-78d473b4.js → constants-ebf80e5f.js} +2 -2
- package/build/esm/{index-122dd8ee.js → constants-f77fc231.js} +1 -127
- package/build/esm/constants.js +3 -3
- package/build/esm/{core-2715a7c7.js → core-c72e0ff5.js} +2 -2
- package/build/esm/{index-f672661d.js → dataTransform-3e8e25ba.js} +87 -135
- package/build/esm/{dataTransform-24bd11e8.js → dataTransform-6c032113.js} +1 -1
- package/build/esm/defaultClassWrapper-31caf23b.js +15 -0
- package/build/esm/ecom.js +5 -5
- package/build/esm/fixedBottomAdBlock-13ed4a34.js +3474 -0
- package/build/esm/footer.js +18 -18
- package/build/esm/gAssets.js +4 -4
- package/build/esm/{getDynamicHealthTool-d805169a.js → getDynamicHealthTool-7681e43a.js} +4 -4
- package/build/esm/{getSocialList-c8edb201.js → getSocialList-e8142513.js} +5 -6
- package/build/esm/healthToolsForm.js +40 -0
- package/build/esm/healthToolsForms.d.ts +7 -0
- package/build/esm/hooks.js +17 -17
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/index-16514f4d.js +156 -0
- package/build/esm/{index-2a4e676a.js → index-1da2ca0b.js} +2 -2
- package/build/esm/{utils-45e55363.js → index-1ecbcf21.js} +71 -105
- package/build/esm/{index-e2d856fc.js → index-21eac858.js} +1043 -1232
- package/build/esm/{index-c5b3a3ba.js → index-2774583d.js} +35 -176
- package/build/esm/index-29d04985.js +14 -0
- package/build/esm/index-2b9213cf.js +195 -0
- package/build/esm/index-3078acec.js +275 -0
- package/build/esm/index-376bee14.js +847 -0
- package/build/esm/index-38f50764.js +557 -0
- package/build/esm/index-42ad7763.js +95 -0
- package/build/esm/{index-47a90477.js → index-598ab51b.js} +5 -5
- package/build/esm/{index-ecb46439.js → index-69248434.js} +33 -5
- package/build/esm/index-6ac73f00.js +1114 -0
- package/build/esm/index-703205e3.js +54 -0
- package/build/esm/{index-7c6316a6.js → index-73301602.js} +2 -2
- package/build/esm/index-76d20d3f.js +100 -0
- package/build/esm/{index-ec38e886.js → index-780a08de.js} +2 -2
- package/build/esm/{index-92fd8661.js → index-78255d6c.js} +2 -2
- package/build/esm/{index-9b3bf9da.js → index-7cbe2a10.js} +12 -11
- package/build/esm/{index-5265867b.js → index-7e756cb8.js} +11 -10
- package/build/esm/{index.styled-eb1001c3.js → index-87a2ea8c.js} +21 -3
- package/build/esm/index-88ad2ca3.js +1681 -0
- package/build/esm/index-8952ceac.js +202 -0
- package/build/esm/index-996f7caf.js +148 -0
- package/build/esm/{index-272d3d01.js → index-9f1899f2.js} +4 -4
- package/build/esm/{index-63be4c47.js → index-b1bb27aa.js} +134 -62
- package/build/esm/{index-ef96fd13.js → index-bef3c9bd.js} +3 -3
- package/build/esm/{index-670d21ca.js → index-c1af3a8e.js} +13 -12
- package/build/esm/{index-b2eed677.js → index-c200bff6.js} +2 -2
- package/build/esm/{index-0de64a0f.js → index-cb4afb33.js} +6 -6
- package/build/esm/{index-741ce3ab.js → index-cdac57da.js} +1 -1
- package/build/esm/{index-49d819b7.js → index-cf6beac8.js} +2 -13
- package/build/esm/{index-ad5c69c9.js → index-d218b94e.js} +2 -2
- package/build/esm/index-d6201fa4.js +42 -0
- package/build/esm/index-e104ad21.js +335 -0
- package/build/esm/index-e26514ee.js +262 -0
- package/build/esm/index-f27edf45.js +130 -0
- package/build/esm/index.css +1 -1
- package/build/esm/index.js +89 -73
- package/build/esm/lead.js +23 -33
- package/build/esm/logoIcon-d93bc56e.js +104 -0
- package/build/esm/mantine.js +22 -20
- package/build/esm/misc.js +21 -21
- package/build/esm/molecules.js +88 -0
- package/build/esm/navigation.js +37 -37
- package/build/esm/onboardingV2.js +26 -35
- package/build/esm/organisms.js +57 -0
- package/build/esm/pwg.js +19 -19
- package/build/esm/{routing-e7ff0e08.js → routing-bebdc8b7.js} +2 -2
- package/build/esm/subot.js +31 -27
- package/build/esm/surveyOrPremiumBanner.js +45 -0
- package/build/esm/surveyQuestionCard.js +13 -0
- package/build/esm/surveyThankyouCard-bf6080eb.js +446 -0
- package/build/esm/together.js +35 -37
- package/build/esm/{types-37f2c5d4.js → types-2580132c.js} +28 -30
- package/build/esm/{types-ce933060.js → types-be952df2.js} +13 -13
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-8e1387db.js → useCategory-8f109eb7.js} +5 -5
- package/build/esm/{useHealthToolCache-28115f15.js → useHealthToolCache-d97dfa00.js} +2 -2
- package/build/esm/{useMantineLocale-bcfdeb0c.js → useMantineLocale-4fb67342.js} +3 -3
- package/build/esm/{usePlacesAutocomplete-837f491d.js → usePlacesAutocomplete-fe2e4cbe.js} +1 -1
- package/build/esm/{useTranslations-b8c49c9b.js → useTranslations-fbf6a6ab.js} +1 -1
- package/build/esm/{utils-86ef2283.js → utils-cef111b6.js} +1 -1
- package/build/esm/{defaultClassWrapper-fcdfc7a3.js → utils-d5a0b58f.js} +60 -408
- package/build/esm/vaccination.js +18 -29
- package/build/fixedBottomAdBlock-0d4379d1.js +3521 -0
- package/build/footer.js +18 -18
- package/build/gAssets.js +4 -4
- package/build/{getDynamicHealthTool-27b332df.js → getDynamicHealthTool-2a92e1a5.js} +4 -4
- package/build/{getSocialList-d16604ba.js → getSocialList-97e7bcc1.js} +8 -9
- package/build/healthToolsForm.js +54 -0
- package/build/healthToolsForms.d.ts +7 -0
- package/build/hooks.js +17 -17
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-058b3c0f.js +1127 -0
- package/build/{index-e914bc7c.js → index-05f106c2.js} +1050 -1240
- package/build/index-06fa8444.js +102 -0
- package/build/{index-e932125b.js → index-1efa7d84.js} +2 -2
- package/build/index-247a9eb2.js +1693 -0
- package/build/{index-4f5ce9db.js → index-264eeddd.js} +2 -2
- package/build/index-3d0d22b3.js +565 -0
- package/build/index-3dcb9bc6.js +61 -0
- package/build/{index-aff82754.js → index-4af08ec2.js} +2 -2
- package/build/index-6acb08c0.js +343 -0
- package/build/{index-1b7f73fa.js → index-6bc3f8c3.js} +5 -5
- package/build/{index-a903fdaa.js → index-6c27b627.js} +58 -201
- package/build/index-73cde644.js +156 -0
- package/build/{index-65765b10.js → index-77a2b9ee.js} +1 -1
- package/build/{index-dbaa00eb.js → index-7c1dc717.js} +12 -11
- package/build/index-7da7b531.js +107 -0
- package/build/{index-8c04d412.js → index-838b0f95.js} +6 -6
- package/build/index-a7de42d1.js +202 -0
- package/build/{index-517f6538.js → index-a86ea1b6.js} +2 -2
- package/build/index-aa818139.js +49 -0
- package/build/{index-4cd9cc62.js → index-b773bc3d.js} +4 -4
- package/build/index-bef2bc73.js +136 -0
- package/build/{utils-120200ad.js → index-c225ef22.js} +76 -120
- package/build/{index-42621fec.js → index-c2900d8c.js} +2 -2
- package/build/index-cb0544e5.js +866 -0
- package/build/{index-5aac5fb6.js → index-d34cd464.js} +2 -2
- package/build/{index-4026b8c5.js → index-d5b4089d.js} +141 -68
- package/build/index-dba2e361.js +20 -0
- package/build/{index-586f0a4f.js → index-dcbd8bf3.js} +37 -9
- package/build/index-dd1392e3.js +167 -0
- package/build/{index-875d81d3.js → index-def9867a.js} +11 -10
- package/build/index-e0bf03ac.js +277 -0
- package/build/index-ee964d3c.js +209 -0
- package/build/index-f10efb61.js +270 -0
- package/build/{index-701c74a1.js → index-f1f4fbb9.js} +13 -12
- package/build/{index-27c71242.js → index-f28c47ce.js} +1 -13
- package/build/{index-e39f5b25.js → index-f6575703.js} +2 -2
- package/build/{index.styled-8c14cf6c.js → index-fe7345fa.js} +22 -4
- package/build/index.css +1 -1
- package/build/index.js +190 -174
- package/build/lead.js +29 -39
- package/build/logoIcon-ee9a5501.js +110 -0
- package/build/mantine.js +24 -23
- package/build/misc.js +21 -21
- package/build/molecules.js +149 -0
- package/build/navigation.js +37 -37
- package/build/onboardingV2.js +45 -54
- package/build/organisms.js +74 -0
- package/build/pwg.js +19 -19
- package/build/{routing-40d4f591.js → routing-f6d54205.js} +2 -2
- package/build/subot.js +113 -109
- package/build/surveyOrPremiumBanner.js +53 -0
- package/build/surveyQuestionCard.js +22 -0
- package/build/surveyThankyouCard-ead6b355.js +454 -0
- package/build/together.js +41 -43
- package/build/{types-692f1edc.js → types-4ba4268f.js} +49 -49
- package/build/{types-ade68559.js → types-6c5643a2.js} +203 -205
- package/build/types.js +1 -1
- package/build/{useCategory-bbe47716.js → useCategory-e2c91f59.js} +5 -5
- package/build/{useHealthToolCache-80cb8990.js → useHealthToolCache-2a53367b.js} +2 -2
- package/build/{useMantineLocale-97b962eb.js → useMantineLocale-a4f0c61d.js} +3 -3
- package/build/{usePlacesAutocomplete-99a452c0.js → usePlacesAutocomplete-c76d0caf.js} +1 -1
- package/build/{useTranslations-76f64595.js → useTranslations-200168a3.js} +1 -1
- package/build/{defaultClassWrapper-feaae206.js → utils-95d9832e.js} +68 -427
- package/build/{utils-dc4471cf.js → utils-af695515.js} +1 -1
- package/build/vaccination.js +58 -69
- package/package.json +1 -1
- package/build/Instagram-5735e971.js +0 -32
- package/build/esm/Instagram-98c713bc.js +0 -26
- package/build/esm/index-18a80466.js +0 -33
- package/build/esm/index-1f6890ad.js +0 -1086
- package/build/esm/index-40fc06d9.js +0 -298
- package/build/esm/index-47d01c08.js +0 -23
- package/build/esm/index-687f9ee4.js +0 -71
- package/build/esm/index-aeb4ceda.js +0 -7245
- package/build/esm/index.styles-bff4ac47.js +0 -1322
- package/build/index-561d71d9.js +0 -7324
- package/build/index-5ff91adf.js +0 -39
- package/build/index-74b64958.js +0 -77
- package/build/index-84f7ce80.js +0 -30
- package/build/index-c9e324de.js +0 -1100
- package/build/index.styles-61201019.js +0 -1361
- /package/build/{BMI_BOYS.percentile.monthly-b2166d34.js → BMI_BOYS.percentile.monthly-71fb1c9f.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-8b80b329.js → BMI_BOYS.percentile.weekly-b2b344a7.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-233e699b.js → BMI_BOYS.percentile.yearly-031ddade.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-17ed8572.js → BMI_BOYS.zscore.monthly-bb1f9962.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-36c9735b.js → BMI_BOYS.zscore.weekly-d6198d53.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-e43d7246.js → BMI_BOYS.zscore.yearly-48255337.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-94ddebb1.js → BMI_GIRLS.percentile.monthly-e3e284ee.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-dc53474b.js → BMI_GIRLS.percentile.weekly-9f2d3977.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-897e47f7.js → BMI_GIRLS.percentile.yearly-c79f34ce.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-44dcd046.js → BMI_GIRLS.zscore.monthly-11092df0.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-6e9400e5.js → BMI_GIRLS.zscore.weekly-5c375d2b.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-3cd8c63d.js → BMI_GIRLS.zscore.yearly-adbba8e3.js} +0 -0
- /package/build/{ChevronDown-2775b53a.js → ChevronDown-f7e25d61.js} +0 -0
- /package/build/{Close-f419724f.js → Close-36b0da99.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-35ed4380.js → HEAD CIRCUM_BOYS.percentile.monthly-163b99ad.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-c7dc736d.js → HEAD CIRCUM_BOYS.percentile.weekly-c9882014.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-4c3b2318.js → HEAD CIRCUM_BOYS.percentile.yearly-9d2bc91e.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1f1cc8dd.js → HEAD CIRCUM_BOYS.zscore.monthly-1d2a215c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-67593063.js → HEAD CIRCUM_BOYS.zscore.weekly-1f139c91.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-197c548c.js → HEAD CIRCUM_BOYS.zscore.yearly-ba15501b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-47029e7a.js → HEAD CIRCUM_GIRLS.percentile.monthly-a546201a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-faf6b122.js → HEAD CIRCUM_GIRLS.percentile.weekly-66cd5a7e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-f79cdc09.js → HEAD CIRCUM_GIRLS.percentile.yearly-9db3c653.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-329fc5a0.js → HEAD CIRCUM_GIRLS.zscore.monthly-0405e2cb.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-aa73a5d6.js → HEAD CIRCUM_GIRLS.zscore.weekly-b2cc3ad2.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-5fdab08f.js → HEAD CIRCUM_GIRLS.zscore.yearly-3115f993.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-190579ee.js → HEIGHT_BOYS.percentile.monthly-35138a98.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-d902f59f.js → HEIGHT_BOYS.percentile.weekly-0216c35b.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-87254461.js → HEIGHT_BOYS.percentile.yearly-f698e45d.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-c741a8bb.js → HEIGHT_BOYS.zscore.monthly-01195728.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-c0b2c6c0.js → HEIGHT_BOYS.zscore.weekly-993e9cf2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-1a506923.js → HEIGHT_BOYS.zscore.yearly-fee3ed69.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-9b2b4c93.js → HEIGHT_GIRLS.percentile.monthly-27b2474a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-5ddecf9a.js → HEIGHT_GIRLS.percentile.weekly-77bff236.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-fa289855.js → HEIGHT_GIRLS.percentile.yearly-6200a720.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-c9db2d0d.js → HEIGHT_GIRLS.zscore.monthly-94978e64.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-c38c0951.js → HEIGHT_GIRLS.zscore.weekly-7951beb1.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-d78a2a93.js → HEIGHT_GIRLS.zscore.yearly-c2eca714.js} +0 -0
- /package/build/{Visible-34df6ee7.js → Visible-eee51ba6.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-7a5f3721.js → WEIGHT_BOYS.percentile.monthly-6a6f901b.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-d86f23fa.js → WEIGHT_BOYS.percentile.weekly-737fb867.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-c154651c.js → WEIGHT_BOYS.percentile.yearly-7772b5e5.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-8f39952a.js → WEIGHT_BOYS.zscore.monthly-8db2e7d6.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-3118363f.js → WEIGHT_BOYS.zscore.weekly-ddd37c1a.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-d463cfe7.js → WEIGHT_BOYS.zscore.yearly-332a8f7b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-4d025f09.js → WEIGHT_GIRLS.percentile.monthly-3edad688.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-89f1f560.js → WEIGHT_GIRLS.percentile.weekly-f113a82a.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-e79630f6.js → WEIGHT_GIRLS.percentile.yearly-95afbeaf.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-64bd7db5.js → WEIGHT_GIRLS.zscore.monthly-d27c4bd4.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-628674eb.js → WEIGHT_GIRLS.zscore.weekly-2b113519.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-5bb1b712.js → WEIGHT_GIRLS.zscore.yearly-c82b04db.js} +0 -0
- /package/build/{animation-21a29164.js → animation-e1375a3b.js} +0 -0
- /package/build/{cart-cd1f9e9e.js → cart-67147d06.js} +0 -0
- /package/build/{cookieHelper-6fd4e238.js → cookieHelper-17491ce8.js} +0 -0
- /package/build/{doctor-15fac518.js → doctor-17b525f8.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-bc430a4a.js → BMI_BOYS.percentile.monthly-7c9d4923.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-404f8241.js → BMI_BOYS.percentile.weekly-c410294a.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-cc6a1393.js → BMI_BOYS.percentile.yearly-695a4fe2.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-e94926d8.js → BMI_BOYS.zscore.monthly-9fb9f281.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-8d1da103.js → BMI_BOYS.zscore.weekly-d2109e4b.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-94f8b37e.js → BMI_BOYS.zscore.yearly-bfa5361b.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-356bd71d.js → BMI_GIRLS.percentile.monthly-f5f60596.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-72979d47.js → BMI_GIRLS.percentile.weekly-26e4e864.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-729c84f5.js → BMI_GIRLS.percentile.yearly-5a2b297d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-6dea8018.js → BMI_GIRLS.zscore.monthly-4e80bed5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-da7a5d01.js → BMI_GIRLS.zscore.weekly-03b79f0b.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-0b0a5cae.js → BMI_GIRLS.zscore.yearly-822ed949.js} +0 -0
- /package/build/esm/{ChevronDown-5f18ca6b.js → ChevronDown-74267eb8.js} +0 -0
- /package/build/esm/{Close-87c65991.js → Close-372aa467.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-1c910c23.js → HEAD CIRCUM_BOYS.percentile.monthly-21b04c4c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-2da702f0.js → HEAD CIRCUM_BOYS.percentile.weekly-049a9d97.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-9fbeb684.js → HEAD CIRCUM_BOYS.percentile.yearly-a4bbbaba.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-c93df36e.js → HEAD CIRCUM_BOYS.zscore.monthly-7cb348c6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-930f82b2.js → HEAD CIRCUM_BOYS.zscore.weekly-678a1a52.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-f7523042.js → HEAD CIRCUM_BOYS.zscore.yearly-db81b17e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-d93ddef7.js → HEAD CIRCUM_GIRLS.percentile.monthly-cee33cd5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-2c7db258.js → HEAD CIRCUM_GIRLS.percentile.weekly-2cec19c3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-07202ee1.js → HEAD CIRCUM_GIRLS.percentile.yearly-5949e664.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-fafa785c.js → HEAD CIRCUM_GIRLS.zscore.monthly-7c2bffab.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-28b41bdb.js → HEAD CIRCUM_GIRLS.zscore.weekly-356dd00a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-c5b3bc8b.js → HEAD CIRCUM_GIRLS.zscore.yearly-e7b62215.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-0a092d31.js → HEIGHT_BOYS.percentile.monthly-359c4335.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-5827b445.js → HEIGHT_BOYS.percentile.weekly-a4d4acd3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-b88283c2.js → HEIGHT_BOYS.percentile.yearly-ec9a7f9b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-d275f074.js → HEIGHT_BOYS.zscore.monthly-12331258.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-20bbf392.js → HEIGHT_BOYS.zscore.weekly-172054d3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-2eea3a9c.js → HEIGHT_BOYS.zscore.yearly-bb47a3be.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9ad65492.js → HEIGHT_GIRLS.percentile.monthly-c93c0b34.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-898065d3.js → HEIGHT_GIRLS.percentile.weekly-f1f83097.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-ac5ceb79.js → HEIGHT_GIRLS.percentile.yearly-ccee4e55.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-327bdfa5.js → HEIGHT_GIRLS.zscore.monthly-caf5410c.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-e25ddbc7.js → HEIGHT_GIRLS.zscore.weekly-b1e28b0e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5531c2e3.js → HEIGHT_GIRLS.zscore.yearly-c3af35d3.js} +0 -0
- /package/build/esm/{Visible-70c720bb.js → Visible-3f9d7dca.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e199416b.js → WEIGHT_BOYS.percentile.monthly-8a4647df.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-0965076a.js → WEIGHT_BOYS.percentile.weekly-a2a6adf1.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-d04404d7.js → WEIGHT_BOYS.percentile.yearly-073df8b7.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-be1ae0cd.js → WEIGHT_BOYS.zscore.monthly-bb9e73d2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-8b6854c4.js → WEIGHT_BOYS.zscore.weekly-ef32ce7a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-bd90b96f.js → WEIGHT_BOYS.zscore.yearly-6cc77688.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-a4bb8428.js → WEIGHT_GIRLS.percentile.monthly-a4b518bc.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-c288d810.js → WEIGHT_GIRLS.percentile.weekly-dcedaebb.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-73a5ae07.js → WEIGHT_GIRLS.percentile.yearly-9e66577e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-cbcfdab4.js → WEIGHT_GIRLS.zscore.monthly-c07cb81f.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-185ff336.js → WEIGHT_GIRLS.zscore.weekly-9c5c3e8e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-c31a0aee.js → WEIGHT_GIRLS.zscore.yearly-e99ce511.js} +0 -0
- /package/build/esm/{animation-9a3ca482.js → animation-0b2299dc.js} +0 -0
- /package/build/esm/{cart-5f758c33.js → cart-f961dadc.js} +0 -0
- /package/build/esm/{cookieHelper-9c963e09.js → cookieHelper-73ce3871.js} +0 -0
- /package/build/esm/{doctor-1d62f054.js → doctor-8a07ca44.js} +0 -0
- /package/build/esm/{index-931414db.js → index-782fed08.js} +0 -0
- /package/build/esm/{index-4687d5f8.js → index-b65a8764.js} +0 -0
- /package/build/esm/{index-90e772e4.js → index-c3264b34.js} +0 -0
- /package/build/esm/{index-877eed06.js → index-e3787b20.js} +0 -0
- /package/build/esm/{isProduction-d39b7ab2.js → isProduction-5684a28c.js} +0 -0
- /package/build/esm/{localizeNumberFormat-f838842a.js → localizeNumberFormat-42ae8d89.js} +0 -0
- /package/build/esm/{normalizeLink-65565106.js → normalizeLink-d6f57223.js} +0 -0
- /package/build/esm/{number-cad310d0.js → number-13f075cf.js} +0 -0
- /package/build/esm/{paths-8fc18a86.js → paths-49a813e7.js} +0 -0
- /package/build/esm/{theme-eb1b39f6.js → theme-f18c2351.js} +0 -0
- /package/build/esm/{translationsContext-dfb42bf8.js → translationsContext-f3d1a7bd.js} +0 -0
- /package/build/esm/{tslib.es6-efad16cf.js → tslib.es6-761239c7.js} +0 -0
- /package/build/esm/{useIsInit-f341c0e8.js → useIsInit-ee864235.js} +0 -0
- /package/build/esm/{useOutsideClick-e10b28ce.js → useOutsideClick-7451aa57.js} +0 -0
- /package/build/esm/{useScrollbarSize-594c61c3.js → useScrollbarSize-84bb5b47.js} +0 -0
- /package/build/esm/{useUniqueId-d5f7586b.js → useUniqueId-c23213b6.js} +0 -0
- /package/build/esm/{utils-0d590d5e.js → utils-f8761b9d.js} +0 -0
- /package/build/{index-d54d6c50.js → index-97ebd7e1.js} +0 -0
- /package/build/{index-d8c60733.js → index-ba3797bb.js} +0 -0
- /package/build/{index-d628859e.js → index-bba97c2e.js} +0 -0
- /package/build/{index-0b957c10.js → index-df5cd44b.js} +0 -0
- /package/build/{isProduction-7f7f09ad.js → isProduction-aa963bf9.js} +0 -0
- /package/build/{localizeNumberFormat-011e6f65.js → localizeNumberFormat-90d4f9d5.js} +0 -0
- /package/build/{normalizeLink-23b10200.js → normalizeLink-451ae6d8.js} +0 -0
- /package/build/{number-249e0e0b.js → number-c2338382.js} +0 -0
- /package/build/{paths-02f54499.js → paths-e0bbfce7.js} +0 -0
- /package/build/{theme-416e0fd4.js → theme-e4f7f487.js} +0 -0
- /package/build/{translationsContext-6f3c14ea.js → translationsContext-39528d2f.js} +0 -0
- /package/build/{tslib.es6-dd1fc8f2.js → tslib.es6-7e140b89.js} +0 -0
- /package/build/{useIsInit-bb64ffbf.js → useIsInit-38cec0c4.js} +0 -0
- /package/build/{useOutsideClick-bd35bba1.js → useOutsideClick-e579e1ac.js} +0 -0
- /package/build/{useScrollbarSize-57b0fd8a.js → useScrollbarSize-5a8be010.js} +0 -0
- /package/build/{useUniqueId-4bafae28.js → useUniqueId-8929fe5f.js} +0 -0
- /package/build/{utils-3a589c92.js → utils-524bda7c.js} +0 -0
|
@@ -1,1086 +0,0 @@
|
|
|
1
|
-
import React__default, { useRef, useEffect, useState, useMemo, createContext, useContext } from 'react';
|
|
2
|
-
import { Portal, Box, Flex, rem, createStyles, Input, Chip, useMantineTheme, Switch } from '@mantine/core';
|
|
3
|
-
import { t as toggleNoScroll, M as MediaQueries } from './utils-0d590d5e.js';
|
|
4
|
-
import { w as StyledBackdrop, x as StyledDrawer, y as StyledDrawerPanel, z as StyledDrawerContent, A as StyledRadioImageGroup, B as StyledRadioImageItem, C as useStyles$b } from './index.styles-bff4ac47.js';
|
|
5
|
-
import { T as Text } from './index-b2eed677.js';
|
|
6
|
-
import { t as theme } from './theme-eb1b39f6.js';
|
|
7
|
-
import { M as MarryBabyText } from './index-47d01c08.js';
|
|
8
|
-
import { T as Text$1 } from './index-5265867b.js';
|
|
9
|
-
import { u as useScrollbarSize } from './useScrollbarSize-594c61c3.js';
|
|
10
|
-
import { createPortal } from 'react-dom';
|
|
11
|
-
import styled from '@emotion/styled';
|
|
12
|
-
import { s as setDefaultClass } from './defaultClassWrapper-fcdfc7a3.js';
|
|
13
|
-
import { _ as __rest } from './tslib.es6-efad16cf.js';
|
|
14
|
-
import { useForm, isNotEmpty } from '@mantine/form';
|
|
15
|
-
import { R as Radio, B as Button, c as Input$1 } from './index-e2d856fc.js';
|
|
16
|
-
import { C as CommonGAssets } from './index-92fd8661.js';
|
|
17
|
-
import './index-122dd8ee.js';
|
|
18
|
-
import './index-877eed06.js';
|
|
19
|
-
import './utils-45e55363.js';
|
|
20
|
-
import { D as DatePicker } from './index-47a90477.js';
|
|
21
|
-
import { u as useTranslations } from './useTranslations-b8c49c9b.js';
|
|
22
|
-
import '@mantine/hooks';
|
|
23
|
-
import './useMantineLocale-bcfdeb0c.js';
|
|
24
|
-
import './index-ef96fd13.js';
|
|
25
|
-
import './index-40fc06d9.js';
|
|
26
|
-
import './index.styled-eb1001c3.js';
|
|
27
|
-
import './index-4687d5f8.js';
|
|
28
|
-
import { BabyBoyMB, BabyGirlMB, CalendarMB } from '@hhgtech/icons/other';
|
|
29
|
-
import '@mantine/dates';
|
|
30
|
-
import flattenChildren from 'react-keyed-flatten-children';
|
|
31
|
-
|
|
32
|
-
const Backdrop = ({ open = false, onClickOutside, }) => {
|
|
33
|
-
return (React__default.createElement(StyledBackdrop, { "data-open": open, onClick: onClickOutside }));
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Consider to use at '@hhgtech/hhg-components/mantine'
|
|
38
|
-
*/
|
|
39
|
-
const Drawer = ({ children, title, onClose, open = false, placement = 'left', destroyOnClose = false, isPropagationEvent = true, className, }) => {
|
|
40
|
-
const ref = useRef();
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
toggleNoScroll(open);
|
|
43
|
-
return () => toggleNoScroll(false);
|
|
44
|
-
}, [open]);
|
|
45
|
-
const onCloseDrawer = () => {
|
|
46
|
-
ref.current.classList.add('slideOut');
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
onClose();
|
|
49
|
-
}, 800);
|
|
50
|
-
};
|
|
51
|
-
if (!open && destroyOnClose) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return (React__default.createElement(Portal, null,
|
|
55
|
-
React__default.createElement(StyledDrawer, { className: className, open: open },
|
|
56
|
-
React__default.createElement(Backdrop, { open: open, onClickOutside: onCloseDrawer }),
|
|
57
|
-
React__default.createElement(StyledDrawerPanel, { open: open, placement: placement, ref: ref, hasTitle: Boolean(title) },
|
|
58
|
-
React__default.createElement("div", { className: "title" },
|
|
59
|
-
title && (React__default.createElement(Text, { size: "s2", weight: "semiBold" }, title)),
|
|
60
|
-
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", className: "close-button", onClick: onCloseDrawer },
|
|
61
|
-
React__default.createElement("path", { d: "M5.99007 4.99067C5.79114 4.99072 5.59674 5.0501 5.43173 5.16121C5.26672 5.27233 5.1386 5.43013 5.06374 5.61444C4.98889 5.79875 4.9707 6.0012 5.0115 6.1959C5.05231 6.39061 5.15025 6.56872 5.29281 6.70747L10.5858 12.0004L5.29281 17.2934C5.19684 17.3855 5.12021 17.4959 5.06743 17.618C5.01464 17.7402 4.98676 17.8716 4.9854 18.0046C4.98405 18.1377 5.00926 18.2697 5.05954 18.3928C5.10983 18.516 5.1842 18.6279 5.27827 18.722C5.37235 18.8161 5.48426 18.8904 5.60743 18.9407C5.73061 18.991 5.86259 19.0162 5.99563 19.0149C6.12867 19.0135 6.2601 18.9856 6.38223 18.9328C6.50436 18.8801 6.61473 18.8034 6.70687 18.7075L11.9998 13.4145L17.2928 18.7075C17.385 18.8034 17.4953 18.8801 17.6175 18.9328C17.7396 18.9856 17.871 19.0135 18.0041 19.0149C18.1371 19.0162 18.2691 18.991 18.3922 18.9407C18.5154 18.8904 18.6273 18.8161 18.7214 18.722C18.8155 18.6279 18.8899 18.516 18.9401 18.3928C18.9904 18.2697 19.0156 18.1377 19.0143 18.0047C19.0129 17.8716 18.985 17.7402 18.9323 17.618C18.8795 17.4959 18.8028 17.3855 18.7069 17.2934L13.4139 12.0004L18.7069 6.70747C18.8514 6.567 18.9501 6.38616 18.99 6.18864C19.03 5.99112 19.0093 5.78614 18.9308 5.60055C18.8523 5.41497 18.7195 5.25744 18.5499 5.14861C18.3803 5.03978 18.1817 4.98473 17.9803 4.99067C17.7205 4.99841 17.4739 5.10699 17.2928 5.2934L11.9998 10.5864L6.70687 5.2934C6.61368 5.19761 6.50224 5.12146 6.37912 5.06947C6.25601 5.01747 6.12372 4.99068 5.99007 4.99067Z", fill: "#595959" }))),
|
|
62
|
-
React__default.createElement(StyledDrawerContent, { onClick: (e) => {
|
|
63
|
-
if (isPropagationEvent) {
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
}
|
|
66
|
-
} }, children &&
|
|
67
|
-
(React__default.isValidElement(children)
|
|
68
|
-
? children
|
|
69
|
-
: typeof children === 'function'
|
|
70
|
-
? children({
|
|
71
|
-
internalClose: onCloseDrawer,
|
|
72
|
-
})
|
|
73
|
-
: null))))));
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const RadioImageGroup = ({ value, options, className, direction = 'horizontal', onChange, isDisabled, siteType, }) => {
|
|
77
|
-
const [check, setCheck] = useState(value);
|
|
78
|
-
const handleOnChange = (v) => {
|
|
79
|
-
if (isDisabled)
|
|
80
|
-
return;
|
|
81
|
-
setCheck(v);
|
|
82
|
-
onChange && onChange(v);
|
|
83
|
-
};
|
|
84
|
-
const isMarryBaby = siteType === 'marryBaby';
|
|
85
|
-
return (React__default.createElement(StyledRadioImageGroup, { className: className, "data-direction": direction }, options.map((option, index) => (React__default.createElement(StyledRadioImageItem, { "data-selected": (value || check) === option.value, "data-is-mb": isMarryBaby, "data-disabled": isDisabled, key: index, onClick: () => {
|
|
86
|
-
handleOnChange(option.value);
|
|
87
|
-
} },
|
|
88
|
-
React__default.createElement("div", null,
|
|
89
|
-
option.content,
|
|
90
|
-
option.label && (React__default.createElement(React__default.Fragment, null, isMarryBaby ? (React__default.createElement(MarryBabyText, { type: "subtitle-2", color: (value || check) === option.value
|
|
91
|
-
? theme.mbColors.dark
|
|
92
|
-
: theme.mbColors.midGray }, option.label)) : (React__default.createElement(Text$1, { type: "bold", color: (value || check) === option.value ? '#2D87F3' : 'black', className: "radio-group-item-heading", size: "label1" }, option.label))))))))));
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const GenderOptionControl = (_a) => {
|
|
96
|
-
var { label, availableValue: availableValueInit, styles, isBaby, genderValue = {
|
|
97
|
-
male: 'male',
|
|
98
|
-
female: 'female',
|
|
99
|
-
}, type = 'button', hideLabel } = _a, radioProps = __rest(_a, ["label", "availableValue", "styles", "isBaby", "genderValue", "type", "hideLabel"]);
|
|
100
|
-
const { t } = useTranslations();
|
|
101
|
-
const { classes, cx, theme } = useStyles$b({ type }, {
|
|
102
|
-
name: 'GenderOptionControl',
|
|
103
|
-
styles,
|
|
104
|
-
});
|
|
105
|
-
const isMarryBaby = theme.other.template === 'mb';
|
|
106
|
-
const [availableValue, setAvailableValue] = useState();
|
|
107
|
-
const ref = useRef(null);
|
|
108
|
-
const genderOptions = useMemo(() => [
|
|
109
|
-
{
|
|
110
|
-
value: genderValue.male,
|
|
111
|
-
label: isBaby ? t('gender.boy') : t('gender.male'),
|
|
112
|
-
icon: isBaby ? (isMarryBaby ? (React__default.createElement(BabyBoyMB, null)) : (CommonGAssets.getAssetPath('health-tools/boy-icon.svg'))) : (CommonGAssets.getAssetPath('health-tools/male-icon.svg')),
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
value: genderValue.female,
|
|
116
|
-
label: isBaby ? t('gender.girl') : t('gender.female'),
|
|
117
|
-
icon: isBaby ? (isMarryBaby ? (React__default.createElement(BabyGirlMB, null)) : (CommonGAssets.getAssetPath('health-tools/girl-icon.svg'))) : (CommonGAssets.getAssetPath('health-tools/female-icon.svg')),
|
|
118
|
-
},
|
|
119
|
-
], []);
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
setAvailableValue(availableValueInit);
|
|
122
|
-
}, [availableValueInit]);
|
|
123
|
-
return (React__default.createElement(Box, { ref: ref, className: classes.root },
|
|
124
|
-
React__default.createElement(Radio.Group, Object.assign({ className: "radio-group", label: !hideLabel ? (React__default.createElement(Text, { as: "label", size: "s4", weight: "semiBold" }, label ||
|
|
125
|
-
(isBaby
|
|
126
|
-
? t('tools.selectBabyGender')
|
|
127
|
-
: t('tools.selectGender')))) : undefined, size: "lg" }, radioProps, { classNames: {
|
|
128
|
-
error: classes.groupErr,
|
|
129
|
-
} }, (type === 'radio' && {
|
|
130
|
-
error: null,
|
|
131
|
-
})),
|
|
132
|
-
React__default.createElement(Flex, { className: cx(classes.wrapper) }, genderOptions.map((i) => (React__default.createElement(Radio, Object.assign({ className: "gender-item", size: "sm", classNames: {
|
|
133
|
-
root: classes.itemRoot,
|
|
134
|
-
labelWrapper: classes.itemLabelWrapper,
|
|
135
|
-
label: classes.itemLabel,
|
|
136
|
-
inner: classes.itemInner,
|
|
137
|
-
body: classes.itemBody,
|
|
138
|
-
}, key: i.value, value: i.value }, (availableValue &&
|
|
139
|
-
i.value !== availableValue && {
|
|
140
|
-
disabled: true,
|
|
141
|
-
}), { label: React__default.createElement(Flex, { gap: rem(8), align: 'center', justify: 'center', sx: { zIndex: 0 } },
|
|
142
|
-
type === 'button' &&
|
|
143
|
-
(typeof i.icon === 'string' ? (React__default.createElement("img", { src: i.icon, className: "gender-image", alt: "female", loading: "lazy" })) : (i.icon)),
|
|
144
|
-
React__default.createElement(Text, { size: "p3" }, i.label)) }))))))));
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const StyledModal = setDefaultClass(styled.div `
|
|
148
|
-
position: relative;
|
|
149
|
-
z-index: 200;
|
|
150
|
-
background-color: ${theme.colors.white};
|
|
151
|
-
border-radius: ${theme.borderRadius};
|
|
152
|
-
box-shadow: 0px 8px 40px 0px #0000001a;
|
|
153
|
-
&[data-site-type='marryBaby'] {
|
|
154
|
-
border-radius: 16px;
|
|
155
|
-
.hhg-modal__content {
|
|
156
|
-
position: relative;
|
|
157
|
-
z-index: 111;
|
|
158
|
-
height: 100%;
|
|
159
|
-
padding: 24px;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
.hhg-modal__content {
|
|
163
|
-
position: relative;
|
|
164
|
-
z-index: 111;
|
|
165
|
-
height: 100%;
|
|
166
|
-
padding: 16px;
|
|
167
|
-
}
|
|
168
|
-
.hhg-modal__video {
|
|
169
|
-
position: relative;
|
|
170
|
-
z-index: 111;
|
|
171
|
-
height: 100%;
|
|
172
|
-
background-color: none;
|
|
173
|
-
box-shadow: none;
|
|
174
|
-
}
|
|
175
|
-
`, 'hhgcomp-modal-modal');
|
|
176
|
-
const StyledModalWrapper = styled.div `
|
|
177
|
-
position: fixed;
|
|
178
|
-
top: 0;
|
|
179
|
-
left: 0;
|
|
180
|
-
z-index: 201;
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
justify-content: center;
|
|
184
|
-
width: 100%;
|
|
185
|
-
height: 100%;
|
|
186
|
-
overflow-x: hidden;
|
|
187
|
-
overflow-y: auto;
|
|
188
|
-
outline: 0;
|
|
189
|
-
visibility: hidden;
|
|
190
|
-
opacity: 0;
|
|
191
|
-
background-color: rgba(0, 0, 0, 0.6);
|
|
192
|
-
transition: opacity 0.3s ease-in-out;
|
|
193
|
-
|
|
194
|
-
.hhg-modal__close {
|
|
195
|
-
position: absolute;
|
|
196
|
-
top: 16px;
|
|
197
|
-
right: 16px;
|
|
198
|
-
cursor: pointer;
|
|
199
|
-
img {
|
|
200
|
-
width: 100%;
|
|
201
|
-
height: 100%;
|
|
202
|
-
border-radius: 50%;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
&[data-type='video'] {
|
|
206
|
-
z-index: 1001;
|
|
207
|
-
}
|
|
208
|
-
&[data-open='true'] {
|
|
209
|
-
opacity: 1;
|
|
210
|
-
visibility: visible;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
${StyledModal.classSelector} {
|
|
214
|
-
transition: transform 0.3s ease-in-out;
|
|
215
|
-
}
|
|
216
|
-
&.slideTop {
|
|
217
|
-
${StyledModal.classSelector} {
|
|
218
|
-
transform: translate(0, -100vh);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
&[data-open='true'] {
|
|
222
|
-
${StyledModal.classSelector} {
|
|
223
|
-
transform: translate(0);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
&.scaleUp {
|
|
229
|
-
${StyledModal.classSelector} {
|
|
230
|
-
transform: scale(0.9);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&[data-open='true'] {
|
|
234
|
-
${StyledModal.classSelector} {
|
|
235
|
-
transform: scale(1);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
&[data-type='tail'] {
|
|
241
|
-
justify-content: flex-end;
|
|
242
|
-
${StyledModal.classSelector} {
|
|
243
|
-
width: 420px;
|
|
244
|
-
height: 100%;
|
|
245
|
-
border-radius: 0;
|
|
246
|
-
overflow: hidden auto;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
&[data-type='form'] {
|
|
250
|
-
${StyledModal.classSelector} {
|
|
251
|
-
width: 496px;
|
|
252
|
-
height: 548px;
|
|
253
|
-
max-height: 100%;
|
|
254
|
-
overflow-y: auto;
|
|
255
|
-
${MediaQueries.mbDown} {
|
|
256
|
-
width: 340px;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
&[data-type='video'] {
|
|
261
|
-
${StyledModal.classSelector} {
|
|
262
|
-
height: 100%;
|
|
263
|
-
max-height: 539px;
|
|
264
|
-
${MediaQueries.mbDown} {
|
|
265
|
-
height: 192px;
|
|
266
|
-
width: 100%;
|
|
267
|
-
height: 100%;
|
|
268
|
-
border-radius: ${theme.borderRadius};
|
|
269
|
-
max-height: 192px;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
&[data-type='confirm'] {
|
|
274
|
-
${StyledModal.classSelector} {
|
|
275
|
-
width: 100%;
|
|
276
|
-
max-width: 407px;
|
|
277
|
-
${MediaQueries.mbDown} {
|
|
278
|
-
width: calc(100% - 32px);
|
|
279
|
-
max-width: calc(100% - 32px);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
`;
|
|
284
|
-
const StyledModalMask = styled.div `
|
|
285
|
-
position: fixed;
|
|
286
|
-
top: 0;
|
|
287
|
-
left: 0;
|
|
288
|
-
width: 100vw;
|
|
289
|
-
height: 100vh;
|
|
290
|
-
align-items: center;
|
|
291
|
-
|
|
292
|
-
&[data-open='false'] {
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
|
-
&[data-type='video'] {
|
|
296
|
-
background-color: ${theme.colors.secondaryDark};
|
|
297
|
-
}
|
|
298
|
-
`;
|
|
299
|
-
|
|
300
|
-
const MODAL_ROOT_ID = 'hhg-modals';
|
|
301
|
-
const getModalsRoot = () => {
|
|
302
|
-
let el = document.getElementById(MODAL_ROOT_ID);
|
|
303
|
-
if (!el) {
|
|
304
|
-
el = document.createElement('div');
|
|
305
|
-
el.setAttribute('id', MODAL_ROOT_ID);
|
|
306
|
-
document.body.append(el);
|
|
307
|
-
}
|
|
308
|
-
return el;
|
|
309
|
-
};
|
|
310
|
-
const cleanUpModalShow = () => {
|
|
311
|
-
const selector = '.hhg-modal[data-open="true"]';
|
|
312
|
-
const remainingPopupOpened = document.querySelectorAll(selector);
|
|
313
|
-
// Remove the opening class if there are only 1 popup is shown
|
|
314
|
-
if (remainingPopupOpened.length < 1) {
|
|
315
|
-
document.body.classList.remove('hhc-modal-show');
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
const cleanUpDisabledScroll = () => {
|
|
319
|
-
// Clear the overflow if there are only 1 popup is shown. useEffect runs after so the count number becomes zero
|
|
320
|
-
const selector = '.hhg-modal[data-open="true"]';
|
|
321
|
-
const remainingPopupOpened = document.querySelectorAll(selector);
|
|
322
|
-
if (remainingPopupOpened.length < 1) {
|
|
323
|
-
document.body.style.overflow = '';
|
|
324
|
-
document.body.style.paddingRight = '';
|
|
325
|
-
document.body.classList.remove('hhc-disabled-scroll');
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
/**
|
|
329
|
-
* @deprecated Consider to use at '@hhgtech/hhg-components/mantine'
|
|
330
|
-
*/
|
|
331
|
-
const Modal = ({ type = 'lead', closeIcon, isOpen = true, onClose, children, className = '', animationType = 'scaleUp', isStaticBackdrop = false, siteType, }) => {
|
|
332
|
-
const [mounted, setMounted] = useState(false);
|
|
333
|
-
const elRef = useRef(null);
|
|
334
|
-
const { width: scrollBarWidth } = useScrollbarSize();
|
|
335
|
-
if (!elRef.current && mounted) {
|
|
336
|
-
elRef.current = document.createElement('div');
|
|
337
|
-
}
|
|
338
|
-
useEffect(() => {
|
|
339
|
-
setMounted(true);
|
|
340
|
-
return () => {
|
|
341
|
-
setMounted(false);
|
|
342
|
-
cleanUpModalShow();
|
|
343
|
-
cleanUpDisabledScroll();
|
|
344
|
-
};
|
|
345
|
-
}, []);
|
|
346
|
-
useEffect(() => {
|
|
347
|
-
if (mounted) {
|
|
348
|
-
const modalsRoot = getModalsRoot();
|
|
349
|
-
modalsRoot.appendChild(elRef.current);
|
|
350
|
-
return () => {
|
|
351
|
-
modalsRoot.removeChild(elRef.current);
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
}, [mounted]);
|
|
355
|
-
useEffect(() => {
|
|
356
|
-
if (isOpen) {
|
|
357
|
-
document.body.classList.add('hhc-modal-show');
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
cleanUpModalShow();
|
|
361
|
-
}
|
|
362
|
-
}, [isOpen]);
|
|
363
|
-
useEffect(() => {
|
|
364
|
-
if (isOpen) {
|
|
365
|
-
document.body.style.overflow = 'hidden';
|
|
366
|
-
document.body.style.paddingRight = scrollBarWidth + 'px';
|
|
367
|
-
document.body.classList.add('hhc-disabled-scroll');
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
cleanUpDisabledScroll();
|
|
371
|
-
}
|
|
372
|
-
}, [isOpen, scrollBarWidth]);
|
|
373
|
-
if (!mounted)
|
|
374
|
-
return null;
|
|
375
|
-
const classes = ['hhg-modal__wrapper', className, animationType]
|
|
376
|
-
.filter((s) => s)
|
|
377
|
-
.join(' ');
|
|
378
|
-
return createPortal(React__default.createElement(StyledModalWrapper, { className: classes, "data-open": isOpen, "data-type": type },
|
|
379
|
-
!isStaticBackdrop && (React__default.createElement(StyledModalMask, { "data-open": isOpen, onClick: onClose, "data-type": type })),
|
|
380
|
-
!isStaticBackdrop && type === 'video' && !!closeIcon && (React__default.createElement("div", { className: "hhg-modal__close", onClick: onClose }, closeIcon)),
|
|
381
|
-
React__default.createElement(StyledModal, { className: "hhg-modal", "data-open": isOpen, "data-site-type": siteType },
|
|
382
|
-
React__default.createElement("div", { className: type === 'video' ? 'hhg-modal__video' : 'hhg-modal__content' },
|
|
383
|
-
!!closeIcon && type !== 'video' && (React__default.createElement("div", { className: "hhg-modal__close", onClick: onClose }, closeIcon)),
|
|
384
|
-
children))), elRef.current);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
var useStyles$a = createStyles(() => {
|
|
388
|
-
return {
|
|
389
|
-
root: {
|
|
390
|
-
justifyContent: 'flex-start',
|
|
391
|
-
},
|
|
392
|
-
group: {
|
|
393
|
-
display: 'flex',
|
|
394
|
-
alignItems: 'stretch',
|
|
395
|
-
gap: rem(8),
|
|
396
|
-
},
|
|
397
|
-
item: {
|
|
398
|
-
flex: '1 1 0px',
|
|
399
|
-
},
|
|
400
|
-
icon: {
|
|
401
|
-
flexShrink: 0,
|
|
402
|
-
},
|
|
403
|
-
};
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
const ChipGroup = (_a) => {
|
|
407
|
-
var { data = [], label, isMobile, layout = 'horizonal', classNames, styles } = _a, props = __rest(_a, ["data", "label", "isMobile", "layout", "classNames", "styles"]);
|
|
408
|
-
const { classes, theme } = useStyles$a(undefined, {
|
|
409
|
-
name: 'ChipGroup',
|
|
410
|
-
classNames,
|
|
411
|
-
styles,
|
|
412
|
-
});
|
|
413
|
-
const isMarryBaby = theme.other.template === 'mb';
|
|
414
|
-
const iconSize = isMobile
|
|
415
|
-
? 48
|
|
416
|
-
: isMarryBaby
|
|
417
|
-
? 32
|
|
418
|
-
: layout === 'vertical'
|
|
419
|
-
? 32
|
|
420
|
-
: 18;
|
|
421
|
-
return (React__default.createElement(Box, null,
|
|
422
|
-
React__default.createElement(Input.Wrapper, { label: label },
|
|
423
|
-
React__default.createElement(Chip.Group, Object.assign({}, props),
|
|
424
|
-
React__default.createElement(Box, { className: classes.group }, data.map((i, idx) => (React__default.createElement(Chip, { className: classes.item, key: idx, value: String(i.value), styles: {
|
|
425
|
-
iconWrapper: {
|
|
426
|
-
display: 'none',
|
|
427
|
-
},
|
|
428
|
-
label: {
|
|
429
|
-
width: '100%',
|
|
430
|
-
borderRadius: rem(isMarryBaby ? 12 : 8),
|
|
431
|
-
padding: 0,
|
|
432
|
-
border: `1px solid ${isMarryBaby ? '#EAEAEC' : theme.colors.neutral[2]}`,
|
|
433
|
-
height: '100%',
|
|
434
|
-
'&[data-checked]': {
|
|
435
|
-
padding: 0,
|
|
436
|
-
backgroundColor: isMarryBaby
|
|
437
|
-
? '#FFE9F1'
|
|
438
|
-
: theme.colors.blue[0],
|
|
439
|
-
border: `1px solid ${isMarryBaby ? '#F5B4CB' : theme.colors.blue[1]}`,
|
|
440
|
-
},
|
|
441
|
-
[theme.fn.smallerThan('sm')]: {
|
|
442
|
-
alignItems: 'flex-start',
|
|
443
|
-
},
|
|
444
|
-
},
|
|
445
|
-
} },
|
|
446
|
-
React__default.createElement(Box, { sx: Object.assign(Object.assign(Object.assign({ width: '100%', display: 'flex', gap: rem(isMarryBaby ? 2 : 8), padding: '8px 16px 8px 12px', justifyContent: 'center', alignItems: 'center' }, (isMarryBaby && {
|
|
447
|
-
flexDirection: 'column',
|
|
448
|
-
})), (layout === 'vertical' && {
|
|
449
|
-
flexDirection: 'column',
|
|
450
|
-
padding: '16px 8px 8px',
|
|
451
|
-
})), { [theme.fn.smallerThan('sm')]: {
|
|
452
|
-
flexDirection: 'column',
|
|
453
|
-
padding: '16px 8px 8px',
|
|
454
|
-
} }) },
|
|
455
|
-
React__default.isValidElement(i.icon)
|
|
456
|
-
? React__default.cloneElement(i.icon, {
|
|
457
|
-
size: iconSize,
|
|
458
|
-
isMarryBaby,
|
|
459
|
-
className: classes.icon,
|
|
460
|
-
})
|
|
461
|
-
: null,
|
|
462
|
-
React__default.createElement(Text, { size: 'p4', styles: {
|
|
463
|
-
root: Object.assign(Object.assign({}, (isMarryBaby && {
|
|
464
|
-
textAlign: 'center',
|
|
465
|
-
})), { whiteSpace: 'normal', [theme.fn.smallerThan('sm')]: {
|
|
466
|
-
fontSize: rem(12),
|
|
467
|
-
lineHeight: rem(18),
|
|
468
|
-
textAlign: 'center',
|
|
469
|
-
} }),
|
|
470
|
-
} }, i.label))))))))));
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
const FormLayoutContext = createContext({});
|
|
474
|
-
|
|
475
|
-
const useStyles$9 = createStyles(() => {
|
|
476
|
-
return {
|
|
477
|
-
root: {
|
|
478
|
-
display: 'flex',
|
|
479
|
-
flexDirection: 'column',
|
|
480
|
-
gap: rem(8),
|
|
481
|
-
},
|
|
482
|
-
};
|
|
483
|
-
});
|
|
484
|
-
const FormRow = (_a) => {
|
|
485
|
-
var { styles, classNames, className, children } = _a, props = __rest(_a, ["styles", "classNames", "className", "children"]);
|
|
486
|
-
const { classes, cx } = useStyles$9(undefined, {
|
|
487
|
-
name: 'HealthToolFormWrapper__FormRow',
|
|
488
|
-
styles,
|
|
489
|
-
classNames,
|
|
490
|
-
});
|
|
491
|
-
return (React__default.createElement(Box, Object.assign({ className: cx(className, classes.root) }, props), children));
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
var useStyles$8 = createStyles((theme, { formLayout }) => {
|
|
495
|
-
return {
|
|
496
|
-
root: {
|
|
497
|
-
display: 'flex',
|
|
498
|
-
flexDirection: 'column',
|
|
499
|
-
gap: rem(formLayout === 'inline' ? 8 : 16),
|
|
500
|
-
'.mantine-Input-input::placeholder, .mantine-Input-input[data-invalid]::placeholder': {
|
|
501
|
-
color: '#8C8C8C',
|
|
502
|
-
},
|
|
503
|
-
},
|
|
504
|
-
control: {
|
|
505
|
-
width: rem(180),
|
|
506
|
-
flexShrink: 1,
|
|
507
|
-
'&.error': {
|
|
508
|
-
'button, input': {
|
|
509
|
-
borderColor: theme.colors.red[7],
|
|
510
|
-
},
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
};
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
const useStyles$7 = createStyles((theme, { formLayout }) => {
|
|
517
|
-
const isMarryBaby = theme.other.template === 'mb';
|
|
518
|
-
return {
|
|
519
|
-
root: Object.assign(Object.assign({ minWidth: rem(180) }, (formLayout === 'inline' && {
|
|
520
|
-
alignSelf: 'flex-end',
|
|
521
|
-
marginTop: rem(16),
|
|
522
|
-
})), (formLayout === 'default' && Object.assign({}, (isMarryBaby && {
|
|
523
|
-
alignSelf: 'center',
|
|
524
|
-
})))),
|
|
525
|
-
};
|
|
526
|
-
});
|
|
527
|
-
const SubmitBtn = (_a) => {
|
|
528
|
-
var { styles, classNames, className } = _a, props = __rest(_a, ["styles", "classNames", "className"]);
|
|
529
|
-
const { formLayout } = useContext(FormLayoutContext);
|
|
530
|
-
const { classes, cx } = useStyles$7({ formLayout }, {
|
|
531
|
-
name: 'HealthToolFormWrapper__SubmitBtn',
|
|
532
|
-
styles,
|
|
533
|
-
classNames,
|
|
534
|
-
});
|
|
535
|
-
return (React__default.createElement(Button, Object.assign({ className: cx('submit-btn', className, classes.root) }, props, { variant: "primary", size: "md" })));
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
const Switching = (_a) => {
|
|
539
|
-
var { label } = _a, props = __rest(_a, ["label"]);
|
|
540
|
-
const { t } = useTranslations();
|
|
541
|
-
const theme = useMantineTheme();
|
|
542
|
-
const isMarryBaby = theme.other.template === 'mb';
|
|
543
|
-
return (React__default.createElement(Flex, { gap: rem(4), sx: () => ({
|
|
544
|
-
justifyContent: 'space-between',
|
|
545
|
-
alignItems: 'center',
|
|
546
|
-
}) },
|
|
547
|
-
label && (React__default.createElement(Text, { size: isMarryBaby ? 'p4' : 's4', color: "gray.6" }, label)),
|
|
548
|
-
React__default.createElement(Switch, Object.assign({ labelPosition: "left", onLabel: t('switchBtn.yes'), offLabel: t('switchBtn.no') }, props, { styles: (theme) => ({
|
|
549
|
-
trackLabel: {
|
|
550
|
-
fontSize: rem(12),
|
|
551
|
-
},
|
|
552
|
-
track: {
|
|
553
|
-
cursor: 'pointer',
|
|
554
|
-
},
|
|
555
|
-
body: {
|
|
556
|
-
[theme.fn.largerThan('sm')]: {
|
|
557
|
-
flexDirection: 'column',
|
|
558
|
-
alignItems: 'flex-start',
|
|
559
|
-
},
|
|
560
|
-
[theme.fn.smallerThan('sm')]: {
|
|
561
|
-
justifyContent: 'space-between',
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
labelWrapper: {
|
|
565
|
-
[theme.fn.smallerThan('sm')]: {
|
|
566
|
-
display: 'flex',
|
|
567
|
-
justifyContent: 'center',
|
|
568
|
-
},
|
|
569
|
-
},
|
|
570
|
-
}) }))));
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
const useStyles$6 = createStyles((theme) => {
|
|
574
|
-
return {
|
|
575
|
-
root: {
|
|
576
|
-
color: theme.colors.gray[6],
|
|
577
|
-
whiteSpace: 'nowrap',
|
|
578
|
-
paddingRight: rem(16),
|
|
579
|
-
},
|
|
580
|
-
};
|
|
581
|
-
});
|
|
582
|
-
const Unit = (_a) => {
|
|
583
|
-
var { styles, classNames, className } = _a, props = __rest(_a, ["styles", "classNames", "className"]);
|
|
584
|
-
const { classes, cx } = useStyles$6(undefined, {
|
|
585
|
-
name: 'HealthToolFormWrapper__UnitText',
|
|
586
|
-
styles,
|
|
587
|
-
classNames,
|
|
588
|
-
});
|
|
589
|
-
return React__default.createElement(Text, Object.assign({ size: "p4", className: cx(className, classes.root) }, props));
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
var useStyles$5 = createStyles(() => {
|
|
593
|
-
return {
|
|
594
|
-
root: {
|
|
595
|
-
display: 'flex',
|
|
596
|
-
gap: rem(8),
|
|
597
|
-
border: '1px solid #EAEAEC',
|
|
598
|
-
borderRadius: rem(16),
|
|
599
|
-
padding: '10px 16px 12px 16px',
|
|
600
|
-
flex: '1 1 0px',
|
|
601
|
-
'.mantine-Input-input': {
|
|
602
|
-
border: 0,
|
|
603
|
-
paddingLeft: 0,
|
|
604
|
-
height: '22px',
|
|
605
|
-
borderRadius: 0,
|
|
606
|
-
'&:focus': {
|
|
607
|
-
outline: 0,
|
|
608
|
-
boxShadow: 'none',
|
|
609
|
-
},
|
|
610
|
-
},
|
|
611
|
-
},
|
|
612
|
-
info: {
|
|
613
|
-
display: 'flex',
|
|
614
|
-
flexDirection: 'column',
|
|
615
|
-
gap: 0,
|
|
616
|
-
flex: '1 1 0px',
|
|
617
|
-
},
|
|
618
|
-
label: {
|
|
619
|
-
color: '#7C7C8F',
|
|
620
|
-
fontWeight: 'normal',
|
|
621
|
-
},
|
|
622
|
-
content: {},
|
|
623
|
-
rightSection: {
|
|
624
|
-
display: 'flex',
|
|
625
|
-
alignItems: 'center',
|
|
626
|
-
textTransform: 'lowercase',
|
|
627
|
-
color: '#3E3F58',
|
|
628
|
-
},
|
|
629
|
-
};
|
|
630
|
-
});
|
|
631
|
-
|
|
632
|
-
const BorderBoxControl = (_a) => {
|
|
633
|
-
var { label, rightSection, children, styles, className, classNames } = _a, props = __rest(_a, ["label", "rightSection", "children", "styles", "className", "classNames"]);
|
|
634
|
-
const { classes, cx } = useStyles$5(undefined, {
|
|
635
|
-
name: 'HealthToolFormWrapper__BorderBoxControl',
|
|
636
|
-
styles,
|
|
637
|
-
classNames,
|
|
638
|
-
});
|
|
639
|
-
return (React__default.createElement(Box, Object.assign({ className: cx(classes.root, className) }, props),
|
|
640
|
-
React__default.createElement(Box, { className: classes.info },
|
|
641
|
-
label && (React__default.createElement(Text, { size: "n1", as: "label", className: classes.label }, label)),
|
|
642
|
-
React__default.createElement(Box, { className: classes.content }, React__default.isValidElement(children)
|
|
643
|
-
? React__default.cloneElement(children, Object.assign(Object.assign({}, children.props), { size: 'sm', error: null }))
|
|
644
|
-
: null)),
|
|
645
|
-
rightSection && (React__default.createElement(Box, { className: classes.rightSection }, typeof rightSection === 'string' ? (React__default.createElement(Text, { size: "p4" }, rightSection)) : React__default.isValidElement(rightSection) ? (React__default.cloneElement(rightSection, {
|
|
646
|
-
size: 24,
|
|
647
|
-
})) : null))));
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
var useStyles$4 = createStyles((theme, { width, direction }) => {
|
|
651
|
-
const isMarryBaby = theme.other.template === 'mb';
|
|
652
|
-
return {
|
|
653
|
-
root: {
|
|
654
|
-
display: 'flex',
|
|
655
|
-
flexDirection: 'column',
|
|
656
|
-
gap: rem(8),
|
|
657
|
-
},
|
|
658
|
-
row: {
|
|
659
|
-
display: 'flex',
|
|
660
|
-
flexDirection: direction,
|
|
661
|
-
alignItems: 'stretch',
|
|
662
|
-
justifyContent: 'space-between',
|
|
663
|
-
gap: rem(16),
|
|
664
|
-
minHeight: rem(40),
|
|
665
|
-
},
|
|
666
|
-
labelWrapper: Object.assign({ flex: '1 1 0px', display: 'flex', alignItems: 'center' }, (direction === 'row' && {
|
|
667
|
-
borderBottom: `1px solid ${theme.colors.neutral[1]}`,
|
|
668
|
-
})),
|
|
669
|
-
label: {
|
|
670
|
-
fontSize: rem(14),
|
|
671
|
-
color: theme.colors.gray[6],
|
|
672
|
-
},
|
|
673
|
-
content: {
|
|
674
|
-
display: 'flex',
|
|
675
|
-
alignItems: 'center',
|
|
676
|
-
gap: rem(8),
|
|
677
|
-
input: {
|
|
678
|
-
backgroundColor: '#fff',
|
|
679
|
-
},
|
|
680
|
-
},
|
|
681
|
-
control: {
|
|
682
|
-
width: typeof width === 'number' ? rem(width) : width,
|
|
683
|
-
flexShrink: 1,
|
|
684
|
-
input: Object.assign({}, (isMarryBaby && {
|
|
685
|
-
borderRadius: rem(12),
|
|
686
|
-
})),
|
|
687
|
-
'&.error': {
|
|
688
|
-
'button, input': {
|
|
689
|
-
borderColor: theme.colors.red[7],
|
|
690
|
-
},
|
|
691
|
-
},
|
|
692
|
-
},
|
|
693
|
-
error: {
|
|
694
|
-
color: 'red',
|
|
695
|
-
textAlign: 'right',
|
|
696
|
-
},
|
|
697
|
-
};
|
|
698
|
-
});
|
|
699
|
-
|
|
700
|
-
const BorderInlineControl = ({ label, children, styles, classNames, direction = 'row', width = 180, errorMess, }) => {
|
|
701
|
-
const { classes } = useStyles$4({ width, direction }, {
|
|
702
|
-
name: 'HealthToolFormWrapper__BorderInlineControl',
|
|
703
|
-
styles,
|
|
704
|
-
classNames,
|
|
705
|
-
});
|
|
706
|
-
return (React__default.createElement(Box, { className: classes.root },
|
|
707
|
-
React__default.createElement(Box, { className: classes.row },
|
|
708
|
-
React__default.createElement(Box, { className: classes.labelWrapper }, label && (React__default.createElement("label", { className: classes.label, htmlFor: "gender" }, label))),
|
|
709
|
-
React__default.createElement(Box, { className: classes.content }, flattenChildren(children).map((i, idx) => (React__default.createElement(Box, { key: idx, className: classes.control }, i))))),
|
|
710
|
-
errorMess && (React__default.createElement(Text, { size: "p4", className: classes.error }, errorMess))));
|
|
711
|
-
};
|
|
712
|
-
|
|
713
|
-
const useStyles$3 = createStyles(() => {
|
|
714
|
-
return {
|
|
715
|
-
root: {
|
|
716
|
-
color: 'red',
|
|
717
|
-
textAlign: 'right',
|
|
718
|
-
width: 'auto',
|
|
719
|
-
},
|
|
720
|
-
};
|
|
721
|
-
});
|
|
722
|
-
const Error = (_a) => {
|
|
723
|
-
var { styles, classNames, className } = _a, props = __rest(_a, ["styles", "classNames", "className"]);
|
|
724
|
-
const { classes, cx } = useStyles$3(undefined, {
|
|
725
|
-
name: 'HealthToolFormWrapper__UnitText',
|
|
726
|
-
styles,
|
|
727
|
-
classNames,
|
|
728
|
-
});
|
|
729
|
-
return React__default.createElement(Text, Object.assign({ size: "p4", className: cx(className, classes.root) }, props));
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
var useStyles$2 = createStyles((theme$1) => {
|
|
733
|
-
const isMarryBaby = theme$1.other.template === 'mb';
|
|
734
|
-
return {
|
|
735
|
-
root: {
|
|
736
|
-
label: Object.assign({}, (isMarryBaby && {
|
|
737
|
-
color: theme.mbColors.midGray,
|
|
738
|
-
fontSize: rem(12),
|
|
739
|
-
fontWeight: 'normal',
|
|
740
|
-
})),
|
|
741
|
-
},
|
|
742
|
-
};
|
|
743
|
-
});
|
|
744
|
-
|
|
745
|
-
const Control = (_a) => {
|
|
746
|
-
var { className, styles, classNames } = _a, rest = __rest(_a, ["className", "styles", "classNames"]);
|
|
747
|
-
const { classes, cx } = useStyles$2(undefined, {
|
|
748
|
-
name: 'HealthToolFormWrapper__Control',
|
|
749
|
-
styles,
|
|
750
|
-
classNames,
|
|
751
|
-
});
|
|
752
|
-
return React__default.createElement(Box, Object.assign({ className: cx(className, classes.root) }, rest));
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
const _HealthToolFormWrapper = (_a) => {
|
|
756
|
-
var { children, formLayout: formLayoutProp, styles, classNames, className, component = 'form' } = _a, rest = __rest(_a, ["children", "formLayout", "styles", "classNames", "className", "component"]);
|
|
757
|
-
const formLayout = formLayoutProp || 'default';
|
|
758
|
-
const { classes, cx } = useStyles$8({ formLayout }, {
|
|
759
|
-
name: 'HealthToolFormWrapper',
|
|
760
|
-
styles,
|
|
761
|
-
classNames,
|
|
762
|
-
});
|
|
763
|
-
return (React__default.createElement(FormLayoutContext.Provider, { value: {
|
|
764
|
-
formLayout,
|
|
765
|
-
} },
|
|
766
|
-
React__default.createElement(Box, Object.assign({ component: component, className: cx(className, classes.root) }, rest), children)));
|
|
767
|
-
};
|
|
768
|
-
const HealthToolFormWrapper = _HealthToolFormWrapper;
|
|
769
|
-
HealthToolFormWrapper.Control = Control;
|
|
770
|
-
HealthToolFormWrapper.BorderInlineControl = BorderInlineControl;
|
|
771
|
-
HealthToolFormWrapper.BorderBoxControl = BorderBoxControl;
|
|
772
|
-
HealthToolFormWrapper.Error = Error;
|
|
773
|
-
HealthToolFormWrapper.FormRow = FormRow;
|
|
774
|
-
HealthToolFormWrapper.Submit = SubmitBtn;
|
|
775
|
-
HealthToolFormWrapper.Unit = Unit;
|
|
776
|
-
HealthToolFormWrapper.Switching = Switching;
|
|
777
|
-
HealthToolFormWrapper.ChipGroup = ChipGroup;
|
|
778
|
-
|
|
779
|
-
const BabyGrowthFormContext = createContext({});
|
|
780
|
-
|
|
781
|
-
const INPUT_RANGE = {
|
|
782
|
-
height: {
|
|
783
|
-
min: 1,
|
|
784
|
-
max: 300,
|
|
785
|
-
},
|
|
786
|
-
weight: {
|
|
787
|
-
min: 1,
|
|
788
|
-
max: 200,
|
|
789
|
-
},
|
|
790
|
-
pregnantWeek: {
|
|
791
|
-
min: 1,
|
|
792
|
-
max: 40,
|
|
793
|
-
},
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
var useStyles$1 = createStyles((theme) => {
|
|
797
|
-
return {
|
|
798
|
-
unit: {
|
|
799
|
-
color: theme.colors.gray[4],
|
|
800
|
-
fontWeight: 'normal',
|
|
801
|
-
},
|
|
802
|
-
};
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
const DefaultForm = (_a) => {
|
|
806
|
-
var { styles, classNames } = _a, props = __rest(_a, ["styles", "classNames"]);
|
|
807
|
-
const { t } = useTranslations();
|
|
808
|
-
const { form, currentUrl, submitProps } = useContext(BabyGrowthFormContext);
|
|
809
|
-
const { classes } = useStyles$1(undefined, {
|
|
810
|
-
name: 'BabyGrowthForm__DefaultForm',
|
|
811
|
-
styles,
|
|
812
|
-
classNames,
|
|
813
|
-
});
|
|
814
|
-
const commonDateProps = {
|
|
815
|
-
placeholder: 'DD/MM/YYYY',
|
|
816
|
-
popoverProps: {
|
|
817
|
-
withinPortal: true,
|
|
818
|
-
},
|
|
819
|
-
};
|
|
820
|
-
return (React__default.createElement(HealthToolFormWrapper, Object.assign({ formLayout: "default" }, props),
|
|
821
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
822
|
-
React__default.createElement(HealthToolFormWrapper.Control, null,
|
|
823
|
-
React__default.createElement(GenderOptionControl, Object.assign({ isBaby: true, genderValue: {
|
|
824
|
-
male: 'boy',
|
|
825
|
-
female: 'girl',
|
|
826
|
-
} }, form.getInputProps('gender'), { error: null }))),
|
|
827
|
-
form.errors.gender && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.gender))),
|
|
828
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
829
|
-
React__default.createElement(Input$1.Wrapper, { label: t('babyGrowth.input.birthday') },
|
|
830
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { maxDate: new Date() }, form.getInputProps('birthday'), { error: null, onChange: (v) => {
|
|
831
|
-
v && form.validateField('measurementDate');
|
|
832
|
-
form.getInputProps('birthday').onChange(v);
|
|
833
|
-
} }))),
|
|
834
|
-
form.errors.birthday && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.birthday))),
|
|
835
|
-
React__default.createElement(Input$1.Number, Object.assign({ label: React__default.createElement(React__default.Fragment, null,
|
|
836
|
-
t('babyGrowth.height'),
|
|
837
|
-
React__default.createElement("span", { className: classes.unit },
|
|
838
|
-
"(",
|
|
839
|
-
t('babyGrowth.cm'),
|
|
840
|
-
")")) }, form.getInputProps('height'), { placeholder: t('babyGrowth.height'), min: INPUT_RANGE.height.min, max: INPUT_RANGE.height.max, onChange: (v) => {
|
|
841
|
-
form.setFieldValue('height', v);
|
|
842
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
843
|
-
} })),
|
|
844
|
-
React__default.createElement(Input$1.Number, Object.assign({ label: React__default.createElement(React__default.Fragment, null,
|
|
845
|
-
t('babyGrowth.weight'),
|
|
846
|
-
React__default.createElement("span", { className: classes.unit },
|
|
847
|
-
"(",
|
|
848
|
-
t('babyGrowth.kg'),
|
|
849
|
-
")")) }, form.getInputProps('weight'), { placeholder: t('babyGrowth.weight'), min: INPUT_RANGE.weight.min, max: INPUT_RANGE.weight.max, onChange: (v) => {
|
|
850
|
-
form.setFieldValue('weight', v);
|
|
851
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
852
|
-
} })),
|
|
853
|
-
React__default.createElement(Input$1.Number, Object.assign({ label: React__default.createElement(React__default.Fragment, null,
|
|
854
|
-
t('babyGrowth.head'),
|
|
855
|
-
React__default.createElement("span", { className: classes.unit },
|
|
856
|
-
"(",
|
|
857
|
-
t('babyGrowth.cm'),
|
|
858
|
-
")")) }, form.getInputProps('head'), { placeholder: t('babyGrowth.head'), onChange: (v) => {
|
|
859
|
-
form.setFieldValue('head', v);
|
|
860
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
861
|
-
} })),
|
|
862
|
-
form.errors.checkMesureVal && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.checkMesureVal)),
|
|
863
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
864
|
-
React__default.createElement(Input$1.Wrapper, { label: t('babyGrowth.input.measurementDate') },
|
|
865
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { defaultValue: new Date() }, form.getInputProps('measurementDate'), { maxDate: new Date(), error: null }))),
|
|
866
|
-
form.errors.measurementDate && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.measurementDate))),
|
|
867
|
-
React__default.createElement(HealthToolFormWrapper.Submit, Object.assign({ type: "submit", "data-event-category": "Health Tool", "data-event-action": "Baby Growth", "data-event-label": currentUrl }, submitProps), t('babyGrowth.input.submit'))));
|
|
868
|
-
};
|
|
869
|
-
|
|
870
|
-
var useStyles = createStyles((theme) => {
|
|
871
|
-
return {
|
|
872
|
-
root: {
|
|
873
|
-
display: 'flex',
|
|
874
|
-
flexDirection: 'column',
|
|
875
|
-
gap: rem(8),
|
|
876
|
-
},
|
|
877
|
-
bmiVal: {
|
|
878
|
-
display: 'inline-block',
|
|
879
|
-
},
|
|
880
|
-
unitText: {
|
|
881
|
-
color: theme.colors.gray[6],
|
|
882
|
-
},
|
|
883
|
-
submitBtn: {},
|
|
884
|
-
};
|
|
885
|
-
});
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* Using {@link Intl.NumberFormat} to covert a number to string base on its locale
|
|
889
|
-
* @param {number} num - Number to convert
|
|
890
|
-
* @param {number} maximumFractionDigits - Number of decimal digits
|
|
891
|
-
* @returns {string} - String based number
|
|
892
|
-
*/
|
|
893
|
-
const localizeNumberFormat = (num, maximumFractionDigits = 2) => {
|
|
894
|
-
return Intl.NumberFormat(undefined, {
|
|
895
|
-
maximumFractionDigits,
|
|
896
|
-
}).format(num);
|
|
897
|
-
};
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* Calculate BMI
|
|
901
|
-
* Using {@link localizeNumberFormat} to convert number based on locale
|
|
902
|
-
* @param {number} height - Height in number
|
|
903
|
-
* @param {number} weight - Weight in number
|
|
904
|
-
* @returns {number} - BMI with 2 decimal digits
|
|
905
|
-
*/
|
|
906
|
-
const bmiCalculate = (height = 0, weight = 0) => {
|
|
907
|
-
try {
|
|
908
|
-
if (height && weight) {
|
|
909
|
-
const bmi = Number(weight) / Math.pow(Number(height) / 100, 2);
|
|
910
|
-
if (isNaN(bmi))
|
|
911
|
-
return 0;
|
|
912
|
-
return Number(localizeNumberFormat(bmi));
|
|
913
|
-
}
|
|
914
|
-
else {
|
|
915
|
-
return 0;
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
catch (error) { }
|
|
919
|
-
return 0;
|
|
920
|
-
};
|
|
921
|
-
|
|
922
|
-
const InlineForm = (_a) => {
|
|
923
|
-
var { styles, classNames } = _a, props = __rest(_a, ["styles", "classNames"]);
|
|
924
|
-
const { t } = useTranslations();
|
|
925
|
-
const { form, currentUrl, submitProps } = useContext(BabyGrowthFormContext);
|
|
926
|
-
const { classes } = useStyles(undefined, {
|
|
927
|
-
name: 'BabyGrowthForm__InlineForm',
|
|
928
|
-
styles,
|
|
929
|
-
classNames,
|
|
930
|
-
});
|
|
931
|
-
const commonDateProps = {
|
|
932
|
-
placeholder: 'DD/MM/YYYY',
|
|
933
|
-
popoverProps: {
|
|
934
|
-
withinPortal: true,
|
|
935
|
-
},
|
|
936
|
-
};
|
|
937
|
-
return (React__default.createElement(HealthToolFormWrapper, Object.assign({ formLayout: "inline" }, props),
|
|
938
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
939
|
-
React__default.createElement(HealthToolFormWrapper.BorderInlineControl, { label: t('tools.selectBabyGender') },
|
|
940
|
-
React__default.createElement(GenderOptionControl, Object.assign({ type: "radio", hideLabel: true, isBaby: true, genderValue: {
|
|
941
|
-
male: 'boy',
|
|
942
|
-
female: 'girl',
|
|
943
|
-
} }, form.getInputProps('gender')))),
|
|
944
|
-
form.errors.gender && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.gender))),
|
|
945
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
946
|
-
React__default.createElement(HealthToolFormWrapper.BorderInlineControl, { label: t('babyGrowth.input.birthday') },
|
|
947
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { maxDate: new Date() }, form.getInputProps('birthday'), { error: null, onChange: (v) => {
|
|
948
|
-
v && form.validateField('measurementDate');
|
|
949
|
-
form.getInputProps('birthday').onChange(v);
|
|
950
|
-
} }))),
|
|
951
|
-
form.errors.birthday && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.birthday))),
|
|
952
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
953
|
-
React__default.createElement(HealthToolFormWrapper.BorderInlineControl, { label: "BMI", styles: {
|
|
954
|
-
control: {
|
|
955
|
-
'&:first-child': {
|
|
956
|
-
width: 'auto',
|
|
957
|
-
},
|
|
958
|
-
},
|
|
959
|
-
} },
|
|
960
|
-
React__default.createElement(Text, { size: "p3" },
|
|
961
|
-
React__default.createElement("span", { className: classes.bmiVal }, form.getInputProps('height').value &&
|
|
962
|
-
form.getInputProps('weight').value &&
|
|
963
|
-
bmiCalculate(Number(form.getInputProps('height').value), Number(form.getInputProps('weight').value))),
|
|
964
|
-
"(",
|
|
965
|
-
t('babyGrowth.kg.m2'),
|
|
966
|
-
")"),
|
|
967
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('height'), { placeholder: t('babyGrowth.height'), min: INPUT_RANGE.height.min, max: INPUT_RANGE.height.max, onChange: (v) => {
|
|
968
|
-
form.setFieldValue('height', v);
|
|
969
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
970
|
-
}, rightSection: React__default.createElement(HealthToolFormWrapper.Unit, null, t('babyGrowth.cm')) })),
|
|
971
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('weight'), { placeholder: t('babyGrowth.weight'), min: INPUT_RANGE.weight.min, max: INPUT_RANGE.weight.max, onChange: (v) => {
|
|
972
|
-
form.setFieldValue('weight', v);
|
|
973
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
974
|
-
}, rightSection: React__default.createElement(HealthToolFormWrapper.Unit, null, t('babyGrowth.kg')) }))),
|
|
975
|
-
React__default.createElement(HealthToolFormWrapper.BorderInlineControl, { label: t('babyGrowth.head') },
|
|
976
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('head'), { placeholder: t('babyGrowth.head'), onChange: (v) => {
|
|
977
|
-
form.setFieldValue('head', v);
|
|
978
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
979
|
-
}, rightSection: React__default.createElement(HealthToolFormWrapper.Unit, null, t('babyGrowth.cm')) }))),
|
|
980
|
-
form.errors.checkMesureVal && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.checkMesureVal))),
|
|
981
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
982
|
-
React__default.createElement(HealthToolFormWrapper.BorderInlineControl, { label: t('babyGrowth.input.measurementDate') },
|
|
983
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { maxDate: new Date() }, form.getInputProps('measurementDate'), { error: null }))),
|
|
984
|
-
form.errors.measurementDate && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.measurementDate))),
|
|
985
|
-
React__default.createElement(HealthToolFormWrapper.Submit, Object.assign({ type: "submit", "data-event-category": "Health Tool", "data-event-action": "Baby Growth", "data-event-label": currentUrl, className: classes.submitBtn }, submitProps), t('babyGrowth.input.submit'))));
|
|
986
|
-
};
|
|
987
|
-
|
|
988
|
-
const MbLayout = (_a) => {
|
|
989
|
-
var props = __rest(_a, []);
|
|
990
|
-
const { t } = useTranslations();
|
|
991
|
-
const { form, currentUrl, submitProps } = useContext(BabyGrowthFormContext);
|
|
992
|
-
const commonDateProps = {
|
|
993
|
-
placeholder: 'DD/MM/YYYY',
|
|
994
|
-
popoverProps: {
|
|
995
|
-
withinPortal: true,
|
|
996
|
-
},
|
|
997
|
-
};
|
|
998
|
-
return (React__default.createElement(HealthToolFormWrapper, Object.assign({ formLayout: "default" }, props),
|
|
999
|
-
React__default.createElement(HealthToolFormWrapper.FormRow, null,
|
|
1000
|
-
React__default.createElement(HealthToolFormWrapper.Control, null,
|
|
1001
|
-
React__default.createElement(GenderOptionControl, Object.assign({ isBaby: true, genderValue: {
|
|
1002
|
-
male: 'boy',
|
|
1003
|
-
female: 'girl',
|
|
1004
|
-
} }, form.getInputProps('gender'), { error: null }))),
|
|
1005
|
-
form.errors.gender && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.gender))),
|
|
1006
|
-
React__default.createElement(HealthToolFormWrapper.BorderBoxControl, { label: t('babyGrowth.input.birthday'), rightSection: React__default.createElement(CalendarMB, null) },
|
|
1007
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { maxDate: new Date() }, form.getInputProps('birthday'), { error: null, rightSection: null, onChange: (v) => {
|
|
1008
|
-
v && form.validateField('measurementDate');
|
|
1009
|
-
form.getInputProps('birthday').onChange(v);
|
|
1010
|
-
} }))),
|
|
1011
|
-
form.errors.birthday && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.birthday)),
|
|
1012
|
-
React__default.createElement(HealthToolFormWrapper.BorderBoxControl, { label: t('babyGrowth.height'), rightSection: t('babyGrowth.cm') },
|
|
1013
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('height'), { placeholder: t('tools.inputPlaceholder', {
|
|
1014
|
-
content: '160',
|
|
1015
|
-
}), min: INPUT_RANGE.height.min, max: INPUT_RANGE.height.max, onChange: (v) => {
|
|
1016
|
-
form.setFieldValue('height', v);
|
|
1017
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
1018
|
-
} }))),
|
|
1019
|
-
form.errors.height && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.height)),
|
|
1020
|
-
React__default.createElement(HealthToolFormWrapper.BorderBoxControl, { label: t('babyGrowth.weight'), rightSection: t('babyGrowth.kg') },
|
|
1021
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('weight'), { placeholder: t('tools.inputPlaceholder', {
|
|
1022
|
-
content: '50',
|
|
1023
|
-
}), min: INPUT_RANGE.weight.min, max: INPUT_RANGE.weight.max, onChange: (v) => {
|
|
1024
|
-
form.setFieldValue('weight', v);
|
|
1025
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
1026
|
-
} }))),
|
|
1027
|
-
form.errors.weight && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.weight)),
|
|
1028
|
-
React__default.createElement(HealthToolFormWrapper.BorderBoxControl, { label: t('babyGrowth.head'), rightSection: t('babyGrowth.cm') },
|
|
1029
|
-
React__default.createElement(Input$1.Number, Object.assign({}, form.getInputProps('head'), { placeholder: t('tools.inputPlaceholder', {
|
|
1030
|
-
content: '50',
|
|
1031
|
-
}), onChange: (v) => {
|
|
1032
|
-
form.setFieldValue('head', v);
|
|
1033
|
-
form.setFieldValue('checkMesureVal', !form.values.checkMesureVal);
|
|
1034
|
-
} }))),
|
|
1035
|
-
form.errors.checkMesureVal && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.checkMesureVal)),
|
|
1036
|
-
React__default.createElement(HealthToolFormWrapper.BorderBoxControl, { label: t('babyGrowth.input.measurementDate'), rightSection: React__default.createElement(CalendarMB, null) },
|
|
1037
|
-
React__default.createElement(Input$1.Wrapper, null,
|
|
1038
|
-
React__default.createElement(DatePicker, Object.assign({}, commonDateProps, { defaultValue: new Date() }, form.getInputProps('measurementDate'), { maxDate: new Date(), rightSection: null, error: null })))),
|
|
1039
|
-
form.errors.measurementDate && (React__default.createElement(HealthToolFormWrapper.Error, null, form.errors.measurementDate)),
|
|
1040
|
-
React__default.createElement(HealthToolFormWrapper.Submit, Object.assign({ type: "submit", "data-event-category": "Health Tool", "data-event-action": "Baby Growth", "data-event-label": currentUrl }, submitProps), t('babyGrowth.input.submit'))));
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
const BabyGrowthForm = (_a) => {
|
|
1044
|
-
var { onSubmit, formLayout = 'default', submitProps, currentUrl } = _a, rest = __rest(_a, ["onSubmit", "formLayout", "submitProps", "currentUrl"]);
|
|
1045
|
-
const { t } = useTranslations();
|
|
1046
|
-
const theme = useMantineTheme();
|
|
1047
|
-
const form = useForm({
|
|
1048
|
-
initialValues: {
|
|
1049
|
-
measurementDate: new Date(),
|
|
1050
|
-
},
|
|
1051
|
-
validate: {
|
|
1052
|
-
gender: isNotEmpty(t('validation.error.requiredField')),
|
|
1053
|
-
birthday: isNotEmpty(t('validation.error.requiredField')),
|
|
1054
|
-
measurementDate: (value, values) => {
|
|
1055
|
-
return values.birthday
|
|
1056
|
-
? values.birthday instanceof Date &&
|
|
1057
|
-
value instanceof Date &&
|
|
1058
|
-
values.birthday.getTime() <= value.getTime()
|
|
1059
|
-
? null
|
|
1060
|
-
: t('babyGrowth.error.measurementDateLowerThanBirthday', {
|
|
1061
|
-
name: '',
|
|
1062
|
-
})
|
|
1063
|
-
: null;
|
|
1064
|
-
},
|
|
1065
|
-
checkMesureVal: (_value, values) => {
|
|
1066
|
-
return (values.head === undefined &&
|
|
1067
|
-
values.height === undefined &&
|
|
1068
|
-
values.weight === undefined) ||
|
|
1069
|
-
values.head ||
|
|
1070
|
-
values.height ||
|
|
1071
|
-
values.weight
|
|
1072
|
-
? null
|
|
1073
|
-
: t('babyGrowth.error.atLeastOneOf');
|
|
1074
|
-
},
|
|
1075
|
-
},
|
|
1076
|
-
validateInputOnChange: ['checkMesureVal'],
|
|
1077
|
-
});
|
|
1078
|
-
const commonProps = Object.assign({ onSubmit: form.onSubmit((v) => onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(Object.assign(Object.assign({}, v), { bmi: bmiCalculate(Number(form.getInputProps('height').value), Number(form.getInputProps('weight').value)).toString() }))) }, rest);
|
|
1079
|
-
return (React__default.createElement(BabyGrowthFormContext.Provider, { value: {
|
|
1080
|
-
submitProps,
|
|
1081
|
-
currentUrl,
|
|
1082
|
-
form,
|
|
1083
|
-
} }, formLayout === 'default' ? (theme.other.template === 'mb' ? (React__default.createElement(MbLayout, Object.assign({ formLayout: formLayout }, commonProps))) : (React__default.createElement(DefaultForm, Object.assign({}, commonProps)))) : (React__default.createElement(InlineForm, Object.assign({}, commonProps)))));
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
export { BabyGrowthForm as B, Drawer as D, GenderOptionControl as G, HealthToolFormWrapper as H, INPUT_RANGE as I, Modal as M, RadioImageGroup as R };
|