@ubnt/store.core 9.18.0-alpha.9 → 9.18.0
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/CHANGELOG.md +1 -197
- package/lib/_virtual/_virtual_multi-entry.js +12 -27
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +10 -14
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/{components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js → assets/icons/menu/icon-globe.svg.js} +6 -6
- package/lib/assets/icons/menu/icon-globe.svg.js.map +1 -0
- package/lib/assets/icons/menu/icon-globe.svg.mjs +3 -0
- package/lib/assets/icons/menu/icon-globe.svg.mjs.map +1 -0
- package/lib/assets/ucgMax.jpg +0 -0
- package/lib/assets/ucgMax2.jpg +0 -0
- package/lib/assets/ucgUltra.jpg +0 -0
- package/lib/assets/ucgUltra2.jpg +0 -0
- package/lib/assets/udmPro.jpg +0 -0
- package/lib/assets/udmPro2.jpg +0 -0
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.jpg +0 -0
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +3 -2
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +3 -2
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/Compare/Compare.styles.d.ts +5 -5
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/Container/Container.js +3 -4
- package/lib/components/Container/Container.js.map +1 -1
- package/lib/components/Container/Container.mjs +4 -5
- package/lib/components/Container/Container.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.js +1 -11
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +3 -13
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/Header.js +6 -6
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +6 -6
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.styles.d.ts +2 -2
- package/lib/components/Header/Header.types.d.ts +4 -12
- package/lib/components/Header/Header.types.js +1 -2
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs +1 -2
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +0 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +95 -92
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +95 -92
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +0 -9
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +1 -15
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +2 -13
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +4 -10
- package/lib/components/Header/ProHeader/ProHeader.d.ts +4 -3
- package/lib/components/Header/ProHeader/ProHeader.js +120 -247
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +124 -249
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +1 -4
- package/lib/components/Header/ProHeader/ProHeader.styles.js +17 -23
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +18 -21
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Header/translations/ar.json.js +1 -4
- package/lib/components/Header/translations/ar.json.js.map +1 -1
- package/lib/components/Header/translations/ar.json.mjs +2 -4
- package/lib/components/Header/translations/ar.json.mjs.map +1 -1
- package/lib/components/Header/translations/de.json.js +1 -4
- package/lib/components/Header/translations/de.json.js.map +1 -1
- package/lib/components/Header/translations/de.json.mjs +2 -4
- package/lib/components/Header/translations/de.json.mjs.map +1 -1
- package/lib/components/Header/translations/el.json.js +1 -4
- package/lib/components/Header/translations/el.json.js.map +1 -1
- package/lib/components/Header/translations/el.json.mjs +2 -4
- package/lib/components/Header/translations/el.json.mjs.map +1 -1
- package/lib/components/Header/translations/en.json.js +1 -4
- package/lib/components/Header/translations/en.json.js.map +1 -1
- package/lib/components/Header/translations/en.json.mjs +2 -4
- package/lib/components/Header/translations/en.json.mjs.map +1 -1
- package/lib/components/Header/translations/es.json.js +1 -4
- package/lib/components/Header/translations/es.json.js.map +1 -1
- package/lib/components/Header/translations/es.json.mjs +2 -4
- package/lib/components/Header/translations/es.json.mjs.map +1 -1
- package/lib/components/Header/translations/fr.json.js +1 -4
- package/lib/components/Header/translations/fr.json.js.map +1 -1
- package/lib/components/Header/translations/fr.json.mjs +2 -4
- package/lib/components/Header/translations/fr.json.mjs.map +1 -1
- package/lib/components/Header/translations/it.json.js +1 -4
- package/lib/components/Header/translations/it.json.js.map +1 -1
- package/lib/components/Header/translations/it.json.mjs +2 -4
- package/lib/components/Header/translations/it.json.mjs.map +1 -1
- package/lib/components/Header/translations/ja.json.js +1 -4
- package/lib/components/Header/translations/ja.json.js.map +1 -1
- package/lib/components/Header/translations/ja.json.mjs +2 -4
- package/lib/components/Header/translations/ja.json.mjs.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.js +1 -4
- package/lib/components/Header/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.mjs +2 -4
- package/lib/components/Header/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.js +1 -4
- package/lib/components/Header/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.mjs +2 -4
- package/lib/components/Header/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js +1 -4
- package/lib/components/Header/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs +2 -4
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/Hero/Hero.styles.d.ts +2 -2
- package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +1 -1
- package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.d.ts +0 -3
- package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +1 -1
- package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +1 -1
- package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +0 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +15 -15
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +10 -10
- package/lib/components/ModelCompareV3/data/VideoRecorders.js +2 -3
- package/lib/components/ModelCompareV3/data/VideoRecorders.js.map +1 -1
- package/lib/components/ModelCompareV3/data/VideoRecorders.mjs +2 -3
- package/lib/components/ModelCompareV3/data/VideoRecorders.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.js +107 -743
- package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.mjs +107 -743
- package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.js +0 -6
- package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -6
- package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +106 -742
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +106 -742
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +17 -313
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +17 -311
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -3
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +34 -120
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs +34 -120
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.d.ts +2 -16
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js +12 -54
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs +11 -50
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowLeftPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowRightPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +2 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs +2 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs.map +1 -1
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.d.ts +1 -1
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.js +1 -3
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +1 -0
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.mjs +1 -3
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +1 -0
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.d.ts +0 -1
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.js +7 -10
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +1 -0
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.styles.mjs +7 -10
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +1 -0
- package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/HorizontalOptionSelect.types.d.ts +0 -1
- package/lib/components/ResourceCalculatorV1/components/index.d.ts +1 -0
- package/lib/components/ResourceCalculatorV1/components/index.js +5 -0
- package/lib/components/{Header/Navigation/ProMenu → ResourceCalculatorV1/components}/index.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/components/index.mjs +3 -0
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +4 -6
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +4 -6
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.js +0 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/index.mjs +0 -2
- package/lib/components/index.mjs.map +1 -1
- package/lib/constants/icons/options/colors/black.svg.js +5 -5
- package/lib/constants/icons/options/colors/index.js +3 -3
- package/lib/constants/icons/options/styles/black.svg.js +5 -5
- package/lib/constants/icons/options/styles/index.js +3 -3
- package/lib/constants/optionIcons.js +6 -6
- package/lib/constants/optionIcons.mjs +4 -4
- package/lib/constants/proStoreCategories/mapping/index.d.ts +0 -1
- package/lib/constants/proStoreCategories/mapping/index.js +10 -15
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +10 -15
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +1 -2
- package/lib/constants/proStoreCategories/mapping/unifi.js +0 -1
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +0 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +0 -3
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +1 -3
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +1 -1
- package/lib/constants/theme.js +0 -4
- package/lib/constants/theme.js.map +1 -1
- package/lib/constants/theme.mjs +0 -4
- package/lib/constants/theme.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +1 -1
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +1 -1
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/helpers/index.js +0 -11
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +0 -1
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/helpers/ux.d.ts +1 -9
- package/lib/helpers/ux.js +0 -15
- package/lib/helpers/ux.js.map +1 -1
- package/lib/helpers/ux.mjs +1 -15
- package/lib/helpers/ux.mjs.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +0 -1
- package/lib/types/index.mjs.map +1 -1
- package/lib/utils/array.d.ts +0 -4
- package/lib/utils/array.js +0 -10
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +1 -10
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/money/constants.d.ts +25 -56
- package/lib/utils/money/constants.js +7 -72
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +7 -70
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/format.d.ts +5 -10
- package/lib/utils/money/format.js +14 -22
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +16 -23
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +1 -4
- package/lib/utils/money/index.js +8 -26
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +4 -8
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/misc.d.ts +28 -68
- package/lib/utils/money/misc.js +64 -35
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs +43 -32
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/money/tax.d.ts +2 -38
- package/lib/utils/money/tax.js +10 -46
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +11 -42
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/types.d.ts +3 -78
- package/lib/utils/number.d.ts +1 -1
- package/lib/utils/number.js +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/validations.d.ts +15 -0
- package/lib/utils/validations.js +23 -0
- package/lib/utils/validations.js.map +1 -0
- package/lib/utils/validations.mjs +21 -0
- package/lib/utils/validations.mjs.map +1 -0
- package/package.json +1 -1
- package/lib/assets/efg.png +0 -0
- package/lib/assets/envr.png +0 -0
- package/lib/assets/icon-location-pin.svg +0 -5
- package/lib/assets/icons/menu/icon-location-pin.svg.js +0 -27
- package/lib/assets/icons/menu/icon-location-pin.svg.js.map +0 -1
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs +0 -3
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs.map +0 -1
- package/lib/assets/ucg-max.png +0 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +0 -2
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js +0 -103
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +0 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +0 -81
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +0 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +0 -23
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +0 -121
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +0 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +0 -106
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +0 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +0 -12
- package/lib/components/Header/Navigation/ProMenu/index.d.ts +0 -1
- package/lib/components/Header/Navigation/ProMenu/index.js +0 -6
- package/lib/components/Header/Navigation/ProMenu/index.mjs +0 -3
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +0 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +0 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +0 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +0 -1
- package/lib/components/ModelCompareV3/assets/envr.png.js +0 -27
- package/lib/components/ModelCompareV3/assets/envr.png.js.map +0 -1
- package/lib/components/ModelCompareV3/assets/envr.png.mjs +0 -3
- package/lib/components/ModelCompareV3/assets/envr.png.mjs.map +0 -1
- package/lib/components/ModelCompareV3/data/products/envr.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/products/envr.js +0 -97
- package/lib/components/ModelCompareV3/data/products/envr.js.map +0 -1
- package/lib/components/ModelCompareV3/data/products/envr.mjs +0 -89
- package/lib/components/ModelCompareV3/data/products/envr.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
- package/lib/helpers/product.d.ts +0 -87
- package/lib/helpers/product.js +0 -346
- package/lib/helpers/product.js.map +0 -1
- package/lib/helpers/product.mjs +0 -335
- package/lib/helpers/product.mjs.map +0 -1
- package/lib/types/product.d.ts +0 -87
- package/lib/types/product.js +0 -14
- package/lib/types/product.js.map +0 -1
- package/lib/types/product.mjs +0 -13
- package/lib/types/product.mjs.map +0 -1
- package/lib/utils/money/allocators/fixedAmount.d.ts +0 -26
- package/lib/utils/money/allocators/fixedAmount.js +0 -52
- package/lib/utils/money/allocators/fixedAmount.js.map +0 -1
- package/lib/utils/money/allocators/fixedAmount.mjs +0 -50
- package/lib/utils/money/allocators/fixedAmount.mjs.map +0 -1
- package/lib/utils/money/allocators/index.d.ts +0 -2
- package/lib/utils/money/allocators/index.js +0 -8
- package/lib/utils/money/allocators/index.js.map +0 -1
- package/lib/utils/money/allocators/index.mjs +0 -4
- package/lib/utils/money/allocators/index.mjs.map +0 -1
- package/lib/utils/money/allocators/productAmount.d.ts +0 -13
- package/lib/utils/money/allocators/productAmount.js +0 -98
- package/lib/utils/money/allocators/productAmount.js.map +0 -1
- package/lib/utils/money/allocators/productAmount.mjs +0 -96
- package/lib/utils/money/allocators/productAmount.mjs.map +0 -1
- package/lib/utils/money/exchangeRate.d.ts +0 -31
- package/lib/utils/money/exchangeRate.js +0 -27
- package/lib/utils/money/exchangeRate.js.map +0 -1
- package/lib/utils/money/exchangeRate.mjs +0 -23
- package/lib/utils/money/exchangeRate.mjs.map +0 -1
- package/lib/utils/money/misc.private.d.ts +0 -23
- package/lib/utils/money/misc.private.js +0 -46
- package/lib/utils/money/misc.private.js.map +0 -1
- package/lib/utils/money/misc.private.mjs +0 -21
- package/lib/utils/money/misc.private.mjs.map +0 -1
- package/lib/utils/money/shipping.d.ts +0 -5
- package/lib/utils/money/shipping.js +0 -8
- package/lib/utils/money/shipping.js.map +0 -1
- package/lib/utils/money/shipping.mjs +0 -6
- package/lib/utils/money/shipping.mjs.map +0 -1
- package/lib/utils/money/tax.private.d.ts +0 -17
- package/lib/utils/money/tax.private.js +0 -65
- package/lib/utils/money/tax.private.js.map +0 -1
- package/lib/utils/money/tax.private.mjs +0 -60
- package/lib/utils/money/tax.private.mjs.map +0 -1
- package/lib/utils/productSort.d.ts +0 -41
- package/lib/utils/productSort.js +0 -67
- package/lib/utils/productSort.js.map +0 -1
- package/lib/utils/productSort.mjs +0 -60
- package/lib/utils/productSort.mjs.map +0 -1
- /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.d.ts +0 -0
- /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.js +0 -0
- /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.js.map +0 -0
- /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.mjs +0 -0
- /package/lib/components/{HorizontalOptionSelect → ResourceCalculatorV1/components/HorizontalOptionSelect}/index.mjs.map +0 -0
- /package/lib/components/{Header/Navigation/ProMenu → ResourceCalculatorV1/components}/index.mjs.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax.mjs","sources":["../../../src/utils/money/tax.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"tax.mjs","sources":["../../../src/utils/money/tax.ts"],"sourcesContent":["import { allocate, type Dinero, dinero, down, toSnapshot } from \"dinero.js\";\n\nexport const allocateTaxAmount = (\n baseAmountObj: Dinero<number>,\n floatRate: number,\n) => {\n // FIXME: currently the API returns rate as a floating number, but the dinero lib expects be a integer number with some\n // scale so for now we attempt calculate the scale from the float rate\n // @see https://v2.dinerojs.com/docs/api/mutations/allocate\n const rateScale = String(floatRate).split(\".\")[1]?.length;\n if (rateScale === undefined) {\n throw new Error(`rateScale is unsupported ${floatRate}`);\n }\n const rateInt = Math.round(floatRate * Math.pow(10, rateScale));\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return allocate(baseAmountObj, [\n rateInt,\n Math.pow(10, rateScale) - rateInt,\n ])[0]!;\n};\n\nexport const removeTaxAmount = (\n baseAmountWithTaxObj: Dinero<number>,\n floatRate: number,\n) => {\n const snapshot = toSnapshot(baseAmountWithTaxObj);\n return dinero({\n ...snapshot,\n amount: down(snapshot.amount / (1 + floatRate)),\n });\n};\n"],"names":["allocateTaxAmount","baseAmountObj","floatRate","rateScale","String","split","length","Error","rateInt","Math","round","pow","allocate","removeTaxAmount","baseAmountWithTaxObj","snapshot","toSnapshot","dinero","amount","down"],"mappings":";;AAEa,MAAAA,iBAAA,GAAoBA,CAC/BC,aAAA,EACAC,SACG,KAAA;EAIG,MAAAC,SAAA,GAAYC,OAAOF,SAAS,CAAA,CAAEG,MAAM,GAAG,CAAA,CAAE,CAAC,CAAG,EAAAC,MAAA;EACnD,IAAIH,cAAc,KAAW,CAAA,EAAA;IAC3B,MAAM,IAAII,KAAA,CAAkC,4BAAAL,SAAW,EAAA,CAAA;EACzD;EACM,MAAAM,OAAA,GAAUC,KAAKC,KAAM,CAAAR,SAAA,GAAYO,KAAKE,GAAI,CAAA,EAAA,EAAIR,SAAS,CAAC,CAAA;EAE9D,OAAOS,SAASX,aAAe,EAAA,CAC7BO,OAAA,EACAC,IAAK,CAAAE,GAAA,CAAI,EAAI,EAAAR,SAAS,CAAI,GAAAK,OAAA,CAC3B,EAAE,CAAC,CAAA;AACN,CAAA;AAEa,MAAAK,eAAA,GAAkBA,CAC7BC,oBAAA,EACAZ,SACG,KAAA;EACG,MAAAa,QAAA,GAAWC,WAAWF,oBAAoB,CAAA;EAChD,OAAOG,MAAO,CAAA;IACZ,GAAGF,QAAA;IACHG,MAAQ,EAAAC,IAAA,CAAKJ,QAAS,CAAAG,MAAA,IAAU,IAAIhB,SAAU,CAAA;EAAA,CAC/C,CAAA;AACH,CAAA;"}
|
|
@@ -1,85 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Currency } from "../../types";
|
|
3
|
-
/**
|
|
4
|
-
* Floating point number of item tax rate
|
|
5
|
-
* Number in range of 0>rate<1 (non-inclusive boundaries)
|
|
6
|
-
* @example
|
|
7
|
-
* 0.09 // 9%
|
|
8
|
-
*/
|
|
9
|
-
export type TaxRate = number;
|
|
10
|
-
/**
|
|
11
|
-
* Shorthand for Dinero.js instance with number as the amount
|
|
12
|
-
*/
|
|
13
|
-
export type Dino = Dinero<number>;
|
|
14
|
-
/**
|
|
15
|
-
* Shorthand for Dinero.js currency instance representing either a currency or custom currency such as tax-rate or shipping
|
|
16
|
-
*/
|
|
17
|
-
export type DinoCurrency = DineroCurrency<number>;
|
|
18
|
-
/**
|
|
19
|
-
* Cents representation of specific currency
|
|
20
|
-
* As a helper to easily understand the code, we use `Cents` as a type alias for `number` as historically we have had
|
|
21
|
-
* mistakes by the team where we have used as dollar instead of `Cents` and vice versa.
|
|
22
|
-
* @example
|
|
23
|
-
* 100 // in USD this is $1.00
|
|
24
|
-
* 100 // in YEN this is ¥100
|
|
25
|
-
*/
|
|
26
|
-
export type Cents = number;
|
|
27
|
-
/**
|
|
28
|
-
* Type definition for a rounding function that can be used to round fractions
|
|
29
|
-
*/
|
|
30
|
-
export type RoundingFn = (float: number) => Cents;
|
|
31
|
-
/**
|
|
32
|
-
* Convenient way to represent a money on the API level
|
|
33
|
-
* When working with dinero you typically will convert this to a Dinero instance
|
|
34
|
-
*/
|
|
35
|
-
export interface Money {
|
|
36
|
-
amount: Cents;
|
|
37
|
-
currency: Currency;
|
|
38
|
-
}
|
|
1
|
+
import type { Currency as DineroCurrency } from "dinero.js";
|
|
39
2
|
/**
|
|
40
3
|
* Attempt to type out some locales `language-TERRITORY` which "we" as store care about
|
|
41
4
|
* @see https://unicode-org.github.io/cldr-staging/charts/38/supplemental/territory_language_information.html
|
|
42
5
|
*/
|
|
43
6
|
export type Locale = "ar-AE" | "ar-SA" | "bg-BG" | "bn-BD" | "bn-IN" | "cs-CZ" | "da-DK" | "de-AT" | "de-CH" | "de-DE" | "el-GR" | "en-AU" | "en-BR" | "en-CA" | "en-GB" | "en-IE" | "en-IN" | "en-JP" | "en-NZ" | "en-SG" | "en-US" | "en-ZA" | "es-AR" | "es-CL" | "es-CO" | "es-ES" | "es-MX" | "es-US" | "fi-FI" | "fr-BE" | "fr-CA" | "fr-CH" | "fr-FR" | "he-IL" | "hi-IN" | "hr-HR" | "hu-HU" | "id-ID" | "it-CH" | "it-IT" | "ja-JP" | "ko-KR" | "nl-BE" | "nl-NL" | "no-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sv-SE" | "ta-IN" | "ta-LK" | "th-TH" | "tr-TR" | "zh-CN" | "zh-HK" | "zh-TW" | string;
|
|
44
|
-
export type
|
|
45
|
-
currency:
|
|
7
|
+
export type CurrencyObj = {
|
|
8
|
+
currency: DineroCurrency<number>;
|
|
46
9
|
locale: Locale;
|
|
47
10
|
};
|
|
48
|
-
export interface LineItemSummary {
|
|
49
|
-
itemPrice: Cents;
|
|
50
|
-
/**
|
|
51
|
-
* Item quantity that is always bigger than zero!
|
|
52
|
-
*/
|
|
53
|
-
quantity: number;
|
|
54
|
-
currency: Currency;
|
|
55
|
-
/**
|
|
56
|
-
* Total discount amount (only) applied for the given item quantity.
|
|
57
|
-
* No taxes are included. Calculated by `total_raw_price * <discount-allocation-percentage>`
|
|
58
|
-
*/
|
|
59
|
-
discountAmount: Cents;
|
|
60
|
-
/**
|
|
61
|
-
* subtotal - discountAmount
|
|
62
|
-
*/
|
|
63
|
-
taxableAmount: Cents;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Pretty much the same as PreTaxItemSummary but with quantity always set to 1 (for clearer type hinting and reasoning
|
|
67
|
-
* around the topic)
|
|
68
|
-
*/
|
|
69
|
-
export interface SingleLineItemSummary extends LineItemSummary {
|
|
70
|
-
quantity: 1;
|
|
71
|
-
}
|
|
72
|
-
export interface FullLineItemSummary extends LineItemSummary {
|
|
73
|
-
/**
|
|
74
|
-
* Total price for the given item quantity. Calculated by `(itemPrice * quantity)`
|
|
75
|
-
*/
|
|
76
|
-
subtotal: Cents;
|
|
77
|
-
/**
|
|
78
|
-
* Total tax amount for the given item quantity.
|
|
79
|
-
*/
|
|
80
|
-
tax: Cents;
|
|
81
|
-
/**
|
|
82
|
-
* Total price for the given item quantity. Calculated by `subtotal - discountAmount + tax`
|
|
83
|
-
*/
|
|
84
|
-
total: Cents;
|
|
85
|
-
}
|
package/lib/utils/number.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function isFloat(value: unknown, entity?: string, ErrorClass?: ne
|
|
|
31
31
|
* toFixed(1.2345, 0) // => "1"
|
|
32
32
|
* toFixed(1.23, 4) // => "1.2300"
|
|
33
33
|
*/
|
|
34
|
-
export declare function toFixedRate(rate: number, scale: number
|
|
34
|
+
export declare function toFixedRate(rate: number, scale: number): string;
|
|
35
35
|
export declare function toFixedRate(rate: number, scale: number, asNumber: true): number;
|
|
36
36
|
/**
|
|
37
37
|
* Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of
|
package/lib/utils/number.js
CHANGED
|
@@ -21,7 +21,7 @@ function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
|
21
21
|
function isFloat(value, entity = "Value", ErrorClass = TypeError) {
|
|
22
22
|
isFiniteNumber(value, entity, ErrorClass);
|
|
23
23
|
}
|
|
24
|
-
function toFixedRate(rate, scale, asNumber) {
|
|
24
|
+
function toFixedRate(rate, scale = 0, asNumber = false) {
|
|
25
25
|
isFloat(rate, "Rate");
|
|
26
26
|
const fixedRate = rate.toFixed(scale);
|
|
27
27
|
return asNumber ? +fixedRate : fixedRate;
|
package/lib/utils/number.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(
|
|
1
|
+
{"version":3,"file":"number.js","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(rate: number, scale: number): string;\nexport function toFixedRate(\n rate: number,\n scale: number,\n asNumber: true,\n): number;\nexport function toFixedRate(rate: number, scale = 0, asNumber = false) {\n // Verify rate\n isFloat(rate, \"Rate\");\n\n const fixedRate = rate.toFixed(scale);\n\n return asNumber ? +fixedRate : fixedRate;\n}\n\n/**\n * Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of\n * doing it. Removes any redundant trailing zeros.\n * @example\n * numberToString(1.23) // => \"1.23\"\n * numberToString(10.00) // => \"10\"\n * @throws If given input is not a valid number\n */\nexport const numberToString = (num: number): string => {\n isFloat(num);\n return num.toString(10);\n};\n\n/**\n * @see https://stackoverflow.com/a/35000557\n */\nexport const findClosestNumber = <T extends number>(\n haystack: T[],\n needle: number,\n): T => {\n return haystack.reduce((prev, curr) =>\n Math.abs(curr - needle) < Math.abs(prev - needle) ? curr : prev,\n );\n};\n\n/**\n * Splits number into array by max value provided.\n * E.g. splitNumberBy(100, 30) => [30, 30, 30, 10]\n */\nexport const splitNumberBy = (value: number, by: number) => {\n const chunks = new Array(Math.floor(value / by)).fill(by);\n const remainder = value % by;\n\n if (remainder > 0) {\n chunks.push(remainder);\n }\n\n return chunks;\n};\n\n/**\n * Clamp value to a given range\n */\nexport const clamp = (val: number, min: number, max: number) => {\n const trueMin = Math.min(min, max);\n const trueMax = Math.max(min, max);\n\n return Math.min(trueMax, Math.max(trueMin, val));\n};\n\n/**\n * Interpolate a number to a new range\n *\n * @example\n * linearInterpolate(5, [0, 10], [0, 100]); // 50\n */\nexport const linearInterpolate = (\n inputY: number,\n [fromMin, fromMax]: [number, number],\n [toMin, toMax]: [number, number],\n clampResult = true,\n) => {\n const percent = (inputY - fromMin) / (fromMax - fromMin);\n const outputX = percent * (toMax - toMin) + toMin;\n\n return clampResult ? clamp(outputX, toMin, toMax) : outputX;\n};\n\n/**\n * Increase value and start over once the range is overflown\n */\nexport const incrementLoopValue = (\n value: number,\n [min, max]: [number, number],\n) => {\n if (value === max) {\n return min;\n }\n return value + 1;\n};\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger","isFloat","toFixedRate","rate","scale","asNumber","fixedRate","toFixed","numberToString","num","toString","findClosestNumber","haystack","needle","reduce","prev","curr","Math","abs","splitNumberBy","by","chunks","Array","floor","fill","remainder","push","clamp","val","min","max","trueMin","trueMax","linearInterpolate","inputY","fromMin","fromMax","toMin","toMax","clampResult","percent","outputX","incrementLoopValue"],"mappings":";;;AAIO,SAASA,cACdA,CAAAC,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACzB,IAAI,OAAOH,KAAU,KAAA,QAAA,IAAYI,MAAO,CAAAC,KAAA,CAAML,KAAK,CAAG,EAAA;IAEpD,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,qBAAqBD,KAAO,EAAA,CAAA;EAC5D;EAEA,IAAI,CAACI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,MAAMC,qBAAqBA,CAChCnD,KAAA,EACA,CAACsC,GAAA,EAAKC,GAAG,CACN,KAAA;EACH,IAAIvC,UAAUuC,GAAK,EAAA;IACV,OAAAD,GAAA;EACT;EACA,OAAOtC,KAAQ,GAAA,CAAA;AACjB,CAAA;;;;;;;;;;"}
|
package/lib/utils/number.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
|
20
20
|
function isFloat(value, entity = "Value", ErrorClass = TypeError) {
|
|
21
21
|
isFiniteNumber(value, entity, ErrorClass);
|
|
22
22
|
}
|
|
23
|
-
function toFixedRate(rate, scale, asNumber) {
|
|
23
|
+
function toFixedRate(rate, scale = 0, asNumber = false) {
|
|
24
24
|
isFloat(rate, "Rate");
|
|
25
25
|
const fixedRate = rate.toFixed(scale);
|
|
26
26
|
return asNumber ? +fixedRate : fixedRate;
|
package/lib/utils/number.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.mjs","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(
|
|
1
|
+
{"version":3,"file":"number.mjs","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(rate: number, scale: number): string;\nexport function toFixedRate(\n rate: number,\n scale: number,\n asNumber: true,\n): number;\nexport function toFixedRate(rate: number, scale = 0, asNumber = false) {\n // Verify rate\n isFloat(rate, \"Rate\");\n\n const fixedRate = rate.toFixed(scale);\n\n return asNumber ? +fixedRate : fixedRate;\n}\n\n/**\n * Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of\n * doing it. Removes any redundant trailing zeros.\n * @example\n * numberToString(1.23) // => \"1.23\"\n * numberToString(10.00) // => \"10\"\n * @throws If given input is not a valid number\n */\nexport const numberToString = (num: number): string => {\n isFloat(num);\n return num.toString(10);\n};\n\n/**\n * @see https://stackoverflow.com/a/35000557\n */\nexport const findClosestNumber = <T extends number>(\n haystack: T[],\n needle: number,\n): T => {\n return haystack.reduce((prev, curr) =>\n Math.abs(curr - needle) < Math.abs(prev - needle) ? curr : prev,\n );\n};\n\n/**\n * Splits number into array by max value provided.\n * E.g. splitNumberBy(100, 30) => [30, 30, 30, 10]\n */\nexport const splitNumberBy = (value: number, by: number) => {\n const chunks = new Array(Math.floor(value / by)).fill(by);\n const remainder = value % by;\n\n if (remainder > 0) {\n chunks.push(remainder);\n }\n\n return chunks;\n};\n\n/**\n * Clamp value to a given range\n */\nexport const clamp = (val: number, min: number, max: number) => {\n const trueMin = Math.min(min, max);\n const trueMax = Math.max(min, max);\n\n return Math.min(trueMax, Math.max(trueMin, val));\n};\n\n/**\n * Interpolate a number to a new range\n *\n * @example\n * linearInterpolate(5, [0, 10], [0, 100]); // 50\n */\nexport const linearInterpolate = (\n inputY: number,\n [fromMin, fromMax]: [number, number],\n [toMin, toMax]: [number, number],\n clampResult = true,\n) => {\n const percent = (inputY - fromMin) / (fromMax - fromMin);\n const outputX = percent * (toMax - toMin) + toMin;\n\n return clampResult ? clamp(outputX, toMin, toMax) : outputX;\n};\n\n/**\n * Increase value and start over once the range is overflown\n */\nexport const incrementLoopValue = (\n value: number,\n [min, max]: [number, number],\n) => {\n if (value === max) {\n return min;\n }\n return value + 1;\n};\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger","isFloat","toFixedRate","rate","scale","asNumber","fixedRate","toFixed","numberToString","num","toString","findClosestNumber","haystack","needle","reduce","prev","curr","Math","abs","splitNumberBy","by","chunks","Array","floor","fill","remainder","push","clamp","val","min","max","trueMin","trueMax","linearInterpolate","input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AO,EAAAC,KAAK,CACb,EAAAC,WAAA,GAAc,IACX,KAAA;EACG,MAAAC,OAAA,GAAA,CAAWN,MAAS,GAAAC,OAAA,KAAYC,OAAU,GAAAD,OAAA,CAAA;EAC1C,MAAAM,OAAA,GAAUD,OAAW,IAAAF,KAAA,GAAQD,KAAS,CAAA,GAAAA,KAAA;EAE5C,OAAOE,WAAc,GAAAZ,KAAA,CAAMc,OAAS,EAAAJ,KAAA,EAAOC,KAAK,CAAI,GAAAG,OAAA;AACtD,CAAA;AAKO,MAAMC,qBAAqBA,CAChCnD,KAAA,EACA,CAACsC,GAAA,EAAKC,GAAG,CACN,KAAA;EACH,IAAIvC,UAAUuC,GAAK,EAAA;IACV,OAAAD,GAAA;EACT;EACA,OAAOtC,KAAQ,GAAA,CAAA;AACjB,CAAA;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)
|
|
3
|
+
* @throws If given input is not a finite number
|
|
4
|
+
*/
|
|
5
|
+
export declare function isFiniteNumber(value: unknown, entity?: string, ErrorClass?: new (message: string) => void): asserts value is number;
|
|
6
|
+
/**
|
|
7
|
+
* Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a
|
|
8
|
+
* Number.isSafeInteger would be sufficient.
|
|
9
|
+
*
|
|
10
|
+
* Code inspired from graphql-scalars library.
|
|
11
|
+
* @see
|
|
12
|
+
* https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32
|
|
13
|
+
* @throws If given input is not a valid integer
|
|
14
|
+
*/
|
|
15
|
+
export declare function isInt(value: unknown, entity?: string, ErrorClass?: new (message: string) => void): asserts value is number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
function isFiniteNumber(value, entity = "Value", ErrorClass = TypeError) {
|
|
5
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
6
|
+
throw new ErrorClass(`${entity} is not a number: ${value}`);
|
|
7
|
+
}
|
|
8
|
+
if (!Number.isFinite(value)) {
|
|
9
|
+
throw new ErrorClass(`${entity} is not a finite number: ${value}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
13
|
+
isFiniteNumber(value, entity, ErrorClass);
|
|
14
|
+
if (!Number.isInteger(value)) {
|
|
15
|
+
throw new ErrorClass(`${entity} is not an integer: ${value}`);
|
|
16
|
+
}
|
|
17
|
+
if (!Number.isSafeInteger(value)) {
|
|
18
|
+
throw new ErrorClass(`${entity} is not a safe integer: ${value}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.isFiniteNumber = isFiniteNumber;
|
|
22
|
+
exports.isInt = isInt;
|
|
23
|
+
//# sourceMappingURL=validations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.js","sources":["../../src/utils/validations.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger"],"mappings":";;;AAIO,SAASA,cACdA,CAAAC,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACzB,IAAI,OAAOH,KAAU,KAAA,QAAA,IAAYI,MAAO,CAAAC,KAAA,CAAML,KAAK,CAAG,EAAA;IAEpD,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,qBAAqBD,KAAO,EAAA,CAAA;EAC5D;EAEA,IAAI,CAACI,MAAA,CAAOE,QAAS,CAAAN,KAAK,CAAG,EAAA;IAE3B,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,4BAA4BD,KAAO,EAAA,CAAA;EACnE;AACF;AAWO,SAASO,KACdA,CAAAP,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACVJ,cAAA,CAAAC,KAAA,EAAOC,QAAQC,UAAU,CAAA;EAExC,IAAI,CAACE,MAAA,CAAOI,SAAU,CAAAR,KAAK,CAAG,EAAA;IAE5B,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,uBAAuBD,KAAO,EAAA,CAAA;EAC9D;EAEA,IAAI,CAACI,MAAA,CAAOK,aAAc,CAAAT,KAAK,CAAG,EAAA;IAEhC,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,2BAA2BD,KAAO,EAAA,CAAA;EAClE;AACF;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function isFiniteNumber(value, entity = "Value", ErrorClass = TypeError) {
|
|
4
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
5
|
+
throw new ErrorClass(`${entity} is not a number: ${value}`);
|
|
6
|
+
}
|
|
7
|
+
if (!Number.isFinite(value)) {
|
|
8
|
+
throw new ErrorClass(`${entity} is not a finite number: ${value}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
12
|
+
isFiniteNumber(value, entity, ErrorClass);
|
|
13
|
+
if (!Number.isInteger(value)) {
|
|
14
|
+
throw new ErrorClass(`${entity} is not an integer: ${value}`);
|
|
15
|
+
}
|
|
16
|
+
if (!Number.isSafeInteger(value)) {
|
|
17
|
+
throw new ErrorClass(`${entity} is not a safe integer: ${value}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export { isFiniteNumber, isInt };
|
|
21
|
+
//# sourceMappingURL=validations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.mjs","sources":["../../src/utils/validations.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger"],"mappings":";;AAIO,SAASA,cACdA,CAAAC,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACzB,IAAI,OAAOH,KAAU,KAAA,QAAA,IAAYI,MAAO,CAAAC,KAAA,CAAML,KAAK,CAAG,EAAA;IAEpD,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,qBAAqBD,KAAO,EAAA,CAAA;EAC5D;EAEA,IAAI,CAACI,MAAA,CAAOE,QAAS,CAAAN,KAAK,CAAG,EAAA;IAE3B,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,4BAA4BD,KAAO,EAAA,CAAA;EACnE;AACF;AAWO,SAASO,KACdA,CAAAP,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACVJ,cAAA,CAAAC,KAAA,EAAOC,QAAQC,UAAU,CAAA;EAExC,IAAI,CAACE,MAAA,CAAOI,SAAU,CAAAR,KAAK,CAAG,EAAA;IAE5B,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,uBAAuBD,KAAO,EAAA,CAAA;EAC9D;EAEA,IAAI,CAACI,MAAA,CAAOK,aAAc,CAAAT,KAAK,CAAG,EAAA;IAEhC,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,2BAA2BD,KAAO,EAAA,CAAA;EAClE;AACF;"}
|
package/package.json
CHANGED
package/lib/assets/efg.png
DELETED
|
Binary file
|
package/lib/assets/envr.png
DELETED
|
Binary file
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="17" height="17" viewBox="0 0 17 17" fill="none"
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0499 6.80268C11.0499 8.21196 9.90823 9.3544 8.4999 9.3544C7.09158 9.3544 5.9499 8.21196 5.9499 6.80268C5.9499 5.3934 7.09158 4.25095 8.4999 4.25095C9.90823 4.25095 11.0499 5.3934 11.0499 6.80268ZM10.1999 6.80268C10.1999 7.7422 9.43879 8.50383 8.4999 8.50383C7.56102 8.50383 6.7999 7.7422 6.7999 6.80268C6.7999 5.86316 7.56102 5.10152 8.4999 5.10152C9.43879 5.10152 10.1999 5.86316 10.1999 6.80268Z" fill="currentColor"/>
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4999 1.69922C5.68325 1.69922 3.3999 3.98411 3.3999 6.80268C3.3999 8.76181 4.31062 10.6139 5.31026 12.0638C6.31479 13.5208 7.44298 14.6203 7.94931 15.0835C8.26361 15.3711 8.73619 15.3711 9.0505 15.0835C9.55683 14.6203 10.685 13.5208 11.6895 12.0638C12.6892 10.6139 13.5999 8.76181 13.5999 6.80268C13.5999 3.98411 11.3166 1.69922 8.4999 1.69922ZM4.2499 6.80268C4.2499 4.45387 6.15269 2.54979 8.4999 2.54979C10.8471 2.54979 12.7499 4.45387 12.7499 6.80268C12.7499 8.51023 11.9489 10.1898 10.9899 11.5808C10.0506 12.9431 8.99195 13.9825 8.4999 14.4347C8.00786 13.9825 6.94916 12.9431 6.00991 11.5808C5.0509 10.1898 4.2499 8.51023 4.2499 6.80268Z" fill="currentColor"/>
|
|
5
|
-
</svg>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var LocationPinIcon = require("../../icon-location-pin.svg");
|
|
7
|
-
function _interopDefault(e) {
|
|
8
|
-
return e && e.__esModule ? e : {
|
|
9
|
-
default: e
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
var LocationPinIcon__default = /*#__PURE__*/_interopDefault(LocationPinIcon);
|
|
13
|
-
Object.defineProperty(exports, "default", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return LocationPinIcon__default["default"];
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.keys(LocationPinIcon).forEach(function (k) {
|
|
20
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return LocationPinIcon[k];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=icon-location-pin.svg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon-location-pin.svg.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon-location-pin.svg.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/lib/assets/ucg-max.png
DELETED
|
Binary file
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var reactUse = require('react-use');
|
|
6
|
-
require('../../../../contexts/MenuContext/index.js');
|
|
7
|
-
require('../../../../contexts/MenuContext/mapping.js');
|
|
8
|
-
require('../../../../hooks/index.js');
|
|
9
|
-
var useHasTouch = require('../../../../hooks/useHasTouch.js');
|
|
10
|
-
require('../../translations/index.js');
|
|
11
|
-
var ProMenu_styles = require('./ProMenu.styles.js');
|
|
12
|
-
var context = require('../../../../contexts/MenuContext/context.js');
|
|
13
|
-
var useTranslation = require('../../../../hooks/useTranslation.js');
|
|
14
|
-
var en = require('../../translations/en.json.js');
|
|
15
|
-
var constants = require('../../../../types/constants.js');
|
|
16
|
-
"use strict";
|
|
17
|
-
const NavigationProMenu = ({
|
|
18
|
-
show,
|
|
19
|
-
currentCountryName,
|
|
20
|
-
handleStorePickerClick,
|
|
21
|
-
productLineValue,
|
|
22
|
-
productLineOptions,
|
|
23
|
-
onProductLineChange
|
|
24
|
-
}) => {
|
|
25
|
-
const {
|
|
26
|
-
motif
|
|
27
|
-
} = context.useMenu();
|
|
28
|
-
const {
|
|
29
|
-
formatMessage
|
|
30
|
-
} = useTranslation.useTranslation({
|
|
31
|
-
defaultTranslation: en["default"],
|
|
32
|
-
additionalTranslations: {
|
|
33
|
-
[constants.Language.Ja]: () => Promise.resolve().then(function () {
|
|
34
|
-
return require('../../translations/ja.json.js');
|
|
35
|
-
}).then(res => res.default),
|
|
36
|
-
[constants.Language.Ar]: () => Promise.resolve().then(function () {
|
|
37
|
-
return require('../../translations/ar.json.js');
|
|
38
|
-
}).then(res => res.default),
|
|
39
|
-
[constants.Language.De]: () => Promise.resolve().then(function () {
|
|
40
|
-
return require('../../translations/de.json.js');
|
|
41
|
-
}).then(res => res.default),
|
|
42
|
-
[constants.Language.Es]: () => Promise.resolve().then(function () {
|
|
43
|
-
return require('../../translations/es.json.js');
|
|
44
|
-
}).then(res => res.default),
|
|
45
|
-
[constants.Language.El]: () => Promise.resolve().then(function () {
|
|
46
|
-
return require('../../translations/el.json.js');
|
|
47
|
-
}).then(res => res.default),
|
|
48
|
-
[constants.Language.It]: () => Promise.resolve().then(function () {
|
|
49
|
-
return require('../../translations/it.json.js');
|
|
50
|
-
}).then(res => res.default),
|
|
51
|
-
[constants.Language.Pt]: () => Promise.resolve().then(function () {
|
|
52
|
-
return require('../../translations/pt-BR.json.js');
|
|
53
|
-
}).then(res => res.default),
|
|
54
|
-
[constants.Language.Zh]: () => Promise.resolve().then(function () {
|
|
55
|
-
return require('../../translations/zh-Hans.json.js');
|
|
56
|
-
}).then(res => res.default),
|
|
57
|
-
[constants.Language.Fr]: () => Promise.resolve().then(function () {
|
|
58
|
-
return require('../../translations/fr.json.js');
|
|
59
|
-
}).then(res => res.default),
|
|
60
|
-
[constants.Language.Tw]: () => Promise.resolve().then(function () {
|
|
61
|
-
return require('../../translations/zh-Hant-TW.json.js');
|
|
62
|
-
}).then(res => res.default)
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
const wrapRef = react.useRef(null);
|
|
66
|
-
const wrapHover = reactUse.useHoverDirty(wrapRef);
|
|
67
|
-
const hasTouch = useHasTouch.useHasTouch();
|
|
68
|
-
const slideInView = react.useMemo(() => {
|
|
69
|
-
const hasHover = !hasTouch && wrapHover;
|
|
70
|
-
return show || hasHover;
|
|
71
|
-
}, [hasTouch, show, wrapHover]);
|
|
72
|
-
return /* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.Wrap, {
|
|
73
|
-
ref: wrapRef,
|
|
74
|
-
motif,
|
|
75
|
-
slideInView,
|
|
76
|
-
children: /* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.MenuWrap, {
|
|
77
|
-
motif,
|
|
78
|
-
children: /* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.MenuWrapInner, {
|
|
79
|
-
children: /* @__PURE__ */jsxRuntime.jsxs(ProMenu_styles.Container, {
|
|
80
|
-
size: "desktop",
|
|
81
|
-
noVerticalMargin: true,
|
|
82
|
-
children: [/* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.ContainerRow, {
|
|
83
|
-
children: productLineOptions.map(option => /* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.LinkButton, {
|
|
84
|
-
motif,
|
|
85
|
-
$active: option.value === productLineValue,
|
|
86
|
-
onClick: () => onProductLineChange?.(option.value),
|
|
87
|
-
children: option.label
|
|
88
|
-
}, option.value))
|
|
89
|
-
}), currentCountryName && /* @__PURE__ */jsxRuntime.jsxs(ProMenu_styles.ContainerRow, {
|
|
90
|
-
children: [currentCountryName, /* @__PURE__ */jsxRuntime.jsx(ProMenu_styles.LinkButton, {
|
|
91
|
-
motif,
|
|
92
|
-
$active: true,
|
|
93
|
-
onClick: handleStorePickerClick,
|
|
94
|
-
children: formatMessage("Change")
|
|
95
|
-
})]
|
|
96
|
-
})]
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
exports.NavigationProMenu = NavigationProMenu;
|
|
103
|
-
//# sourceMappingURL=ProMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProMenu.js","sources":["../../../../../src/components/Header/Navigation/ProMenu/ProMenu.tsx"],"sourcesContent":["import { useMemo, useRef } from \"react\";\nimport { useHoverDirty } from \"react-use\";\n\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { Language } from \"../../../../contexts/MenuContext/mapping\";\nimport { useTranslation } from \"../../../../hooks\";\nimport { useHasTouch } from \"../../../../hooks/useHasTouch\";\nimport { en as EN_TRANSLATION } from \"../../translations\";\nimport * as S from \"./ProMenu.styles\";\nimport type { NavigationProMenuPrivateProps } from \"./ProMenu.types\";\n\nexport const NavigationProMenu = ({\n show,\n currentCountryName,\n handleStorePickerClick,\n productLineValue,\n productLineOptions,\n onProductLineChange,\n}: NavigationProMenuPrivateProps) => {\n const { motif } = useMenu();\n const { formatMessage } = useTranslation({\n defaultTranslation: EN_TRANSLATION,\n additionalTranslations: {\n [Language.Ja]: () =>\n import(\"../../translations/ja.json\").then((res) => res.default),\n [Language.Ar]: () =>\n import(\"../../translations/ar.json\").then((res) => res.default),\n [Language.De]: () =>\n import(\"../../translations/de.json\").then((res) => res.default),\n [Language.Es]: () =>\n import(\"../../translations/es.json\").then((res) => res.default),\n [Language.El]: () =>\n import(\"../../translations/el.json\").then((res) => res.default),\n [Language.It]: () =>\n import(\"../../translations/it.json\").then((res) => res.default),\n [Language.Pt]: () =>\n import(\"../../translations/pt-BR.json\").then((res) => res.default),\n [Language.Zh]: () =>\n import(\"../../translations/zh-Hans.json\").then((res) => res.default),\n [Language.Fr]: () =>\n import(\"../../translations/fr.json\").then((res) => res.default),\n [Language.Tw]: () =>\n import(\"../../translations/zh-Hant-TW.json\").then((res) => res.default),\n },\n });\n\n // #############################################################################\n // Refs\n // #############################################################################\n const wrapRef = useRef<HTMLDivElement>(null);\n\n // #############################################################################\n // Handle show\n // #############################################################################\n const wrapHover = useHoverDirty(wrapRef);\n const hasTouch = useHasTouch();\n\n const slideInView = useMemo((): boolean => {\n // Ignore hover on touch devices\n const hasHover = !hasTouch && wrapHover;\n\n // Show when parent or wrap has hover\n return show || hasHover;\n }, [hasTouch, show, wrapHover]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap ref={wrapRef} motif={motif} slideInView={slideInView}>\n <S.MenuWrap motif={motif}>\n <S.MenuWrapInner>\n <S.Container size=\"desktop\" noVerticalMargin>\n {/* Product line */}\n <S.ContainerRow>\n {productLineOptions.map((option) => (\n <S.LinkButton\n key={option.value}\n motif={motif}\n $active={option.value === productLineValue}\n onClick={() => onProductLineChange?.(option.value)}\n >\n {option.label}\n </S.LinkButton>\n ))}\n </S.ContainerRow>\n\n {/* Country */}\n {currentCountryName && (\n <S.ContainerRow>\n {currentCountryName}\n <S.LinkButton\n motif={motif}\n $active\n onClick={handleStorePickerClick}\n >\n {formatMessage(\"Change\")}\n </S.LinkButton>\n </S.ContainerRow>\n )}\n </S.Container>\n </S.MenuWrapInner>\n </S.MenuWrap>\n </S.Wrap>\n );\n};\n"],"names":["NavigationProMenu","show","currentCountryName","handleStorePickerClick","productLineValue","productLineOptions","onProductLineChange","motif","useMenu","formatMessage","useTranslation","defaultTranslation","EN_TRANSLATION","additionalTranslations","Language","Ja","Promise","then","res","default","Ar","De","Es","El","It","Pt","Zh","Fr","Tw","wrapRef","useRef","wrapHover","useHoverDirty","hasTouch","useHasTouch","slideInView","useMemo","hasHover","jsx","S.Wrap","ref","children","S.MenuWrap","S.MenuWrapInner","MenuWrapInner","jsxs","S.Container","size","noVerticalMargin","S.ContainerRow","ContainerRow","map","option","S.LinkButton","LinkButton","$active","value","onClick","label"],"mappings":";;;;;;;;;;;;;;;;AAWO,MAAMA,oBAAoBA,CAAC;EAChCC,IAAA;EACAC,kBAAA;EACAC,sBAAA;EACAC,gBAAA;EACAC,kBAAA;EACAC;AACF,CAAqC,KAAA;EAC7B,MAAA;IAAEC;GAAM,GAAIC,OAAAA,CAAAA,OAAQ,EAAA;EACpB,MAAA;IAAEC;EAAc,CAAA,GAAIC,6BAAe,CAAA;IACvCC,kBAAoB,EAAAC,EAAA,CAAA,SAAA,CAAA;IACpBC,sBAAwB,EAAA;MACtB,CAACC,SAAA,CAAAA,QAAA,CAASC,EAAE,GAAG,MACbC;uBAAO,+BAA4B,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAChE,CAACL,SAAA,CAAAA,QAAA,CAASM,EAAE,GAAG,MACbJ;uBAAO,+BAA4B,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAChE,CAACL,SAAA,CAAAA,QAAA,CAASO,EAAE,GAAG,MACbL;uBAAO,+BAA4B,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAChE,CAACL,SAAA,CAAAA,QAAA,CAASQ,EAAE,GAAG,MACbN;uBAAO,+BAA4B,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,O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 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef, useMemo } from 'react';
|
|
3
|
-
import { useHoverDirty } from 'react-use';
|
|
4
|
-
import '../../../../contexts/MenuContext/index.mjs';
|
|
5
|
-
import '../../../../contexts/MenuContext/mapping.mjs';
|
|
6
|
-
import '../../../../hooks/index.mjs';
|
|
7
|
-
import { useHasTouch } from '../../../../hooks/useHasTouch.mjs';
|
|
8
|
-
import '../../translations/index.mjs';
|
|
9
|
-
import { Wrap, MenuWrap, MenuWrapInner, Container, ContainerRow, LinkButton } from './ProMenu.styles.mjs';
|
|
10
|
-
import { useMenu } from '../../../../contexts/MenuContext/context.mjs';
|
|
11
|
-
import { useTranslation } from '../../../../hooks/useTranslation.mjs';
|
|
12
|
-
import EN_TRANSLATION from '../../translations/en.json.mjs';
|
|
13
|
-
import { Language } from '../../../../types/constants.mjs';
|
|
14
|
-
"use strict";
|
|
15
|
-
const NavigationProMenu = ({
|
|
16
|
-
show,
|
|
17
|
-
currentCountryName,
|
|
18
|
-
handleStorePickerClick,
|
|
19
|
-
productLineValue,
|
|
20
|
-
productLineOptions,
|
|
21
|
-
onProductLineChange
|
|
22
|
-
}) => {
|
|
23
|
-
const {
|
|
24
|
-
motif
|
|
25
|
-
} = useMenu();
|
|
26
|
-
const {
|
|
27
|
-
formatMessage
|
|
28
|
-
} = useTranslation({
|
|
29
|
-
defaultTranslation: EN_TRANSLATION,
|
|
30
|
-
additionalTranslations: {
|
|
31
|
-
[Language.Ja]: () => import('../../translations/ja.json.mjs').then(res => res.default),
|
|
32
|
-
[Language.Ar]: () => import('../../translations/ar.json.mjs').then(res => res.default),
|
|
33
|
-
[Language.De]: () => import('../../translations/de.json.mjs').then(res => res.default),
|
|
34
|
-
[Language.Es]: () => import('../../translations/es.json.mjs').then(res => res.default),
|
|
35
|
-
[Language.El]: () => import('../../translations/el.json.mjs').then(res => res.default),
|
|
36
|
-
[Language.It]: () => import('../../translations/it.json.mjs').then(res => res.default),
|
|
37
|
-
[Language.Pt]: () => import('../../translations/pt-BR.json.mjs').then(res => res.default),
|
|
38
|
-
[Language.Zh]: () => import('../../translations/zh-Hans.json.mjs').then(res => res.default),
|
|
39
|
-
[Language.Fr]: () => import('../../translations/fr.json.mjs').then(res => res.default),
|
|
40
|
-
[Language.Tw]: () => import('../../translations/zh-Hant-TW.json.mjs').then(res => res.default)
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const wrapRef = useRef(null);
|
|
44
|
-
const wrapHover = useHoverDirty(wrapRef);
|
|
45
|
-
const hasTouch = useHasTouch();
|
|
46
|
-
const slideInView = useMemo(() => {
|
|
47
|
-
const hasHover = !hasTouch && wrapHover;
|
|
48
|
-
return show || hasHover;
|
|
49
|
-
}, [hasTouch, show, wrapHover]);
|
|
50
|
-
return /* @__PURE__ */jsx(Wrap, {
|
|
51
|
-
ref: wrapRef,
|
|
52
|
-
motif,
|
|
53
|
-
slideInView,
|
|
54
|
-
children: /* @__PURE__ */jsx(MenuWrap, {
|
|
55
|
-
motif,
|
|
56
|
-
children: /* @__PURE__ */jsx(MenuWrapInner, {
|
|
57
|
-
children: /* @__PURE__ */jsxs(Container, {
|
|
58
|
-
size: "desktop",
|
|
59
|
-
noVerticalMargin: true,
|
|
60
|
-
children: [/* @__PURE__ */jsx(ContainerRow, {
|
|
61
|
-
children: productLineOptions.map(option => /* @__PURE__ */jsx(LinkButton, {
|
|
62
|
-
motif,
|
|
63
|
-
$active: option.value === productLineValue,
|
|
64
|
-
onClick: () => onProductLineChange?.(option.value),
|
|
65
|
-
children: option.label
|
|
66
|
-
}, option.value))
|
|
67
|
-
}), currentCountryName && /* @__PURE__ */jsxs(ContainerRow, {
|
|
68
|
-
children: [currentCountryName, /* @__PURE__ */jsx(LinkButton, {
|
|
69
|
-
motif,
|
|
70
|
-
$active: true,
|
|
71
|
-
onClick: handleStorePickerClick,
|
|
72
|
-
children: formatMessage("Change")
|
|
73
|
-
})]
|
|
74
|
-
})]
|
|
75
|
-
})
|
|
76
|
-
})
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
export { NavigationProMenu };
|
|
81
|
-
//# sourceMappingURL=ProMenu.mjs.map
|