@fonixtree/magic-design 0.0.78 → 0.0.80
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/es/assets/fonts/magic-box-iconfont.css +24 -12
- package/es/assets/fonts/magic-box-iconfont.css.bak +24 -12
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/assets/images/layout-icon/layout-navigation-normal.png +0 -0
- package/es/assets/less/common.less +2 -2
- package/es/assets/less/modal.less +7 -2
- package/es/common/Button/index.js +2 -1
- package/es/common/Button/index.less +5 -0
- package/es/common/ButtonIconLayout/index.less +4 -2
- package/es/common/Collapse/index.js +14 -4
- package/es/common/FontStyles/index.less +1 -1
- package/es/common/GroupList/index.js +4 -3
- package/es/common/ImageModal/index.js +31 -26
- package/es/common/ImageModal/index.less +6 -1
- package/es/common/ImgArea/components/Crop.js +267 -0
- package/es/common/ImgArea/components/Icons.js +44 -0
- package/es/common/ImgArea/components/MultiCrops.js +210 -0
- package/es/common/ImgArea/index.js +11 -0
- package/es/common/LinkModal/BundleCampaign/index.js +17 -17
- package/es/common/LinkModal/CustomTable/index.js +1 -0
- package/es/common/LinkModal/FilteredProductModal/index.js +3 -3
- package/es/common/LinkModal/FilteredProductModal/index.less +2 -3
- package/es/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/es/common/LinkModal/index.less +1 -1
- package/es/common/MagicLink/index.js +89 -0
- package/es/common/MagicLink/index.less +0 -0
- package/es/common/ProductModal/index.js +1 -1
- package/es/common/ProductModal/index.less +12 -7
- package/es/common/UrlPicker/index.js +6 -2
- package/es/common/UrlPicker/index.less +12 -1
- package/es/common/index.js +8 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
- package/es/composite-comp/bol/components/Banner/mobile/index.js +4 -10
- package/es/composite-comp/bol/components/Banner/pc/index.js +3 -6
- package/es/composite-comp/bol/components/Button/defaultJSON.js +40 -70
- package/es/composite-comp/bol/components/Button/index.js +8 -14
- package/es/composite-comp/bol/components/Button/index.less +1 -0
- package/es/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
- package/es/composite-comp/bol/components/Carousel/index.js +1 -6
- package/es/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
- package/es/composite-comp/bol/components/Carousel/pc/index.js +15 -7
- package/es/composite-comp/bol/components/Carousel/pc/index.less +13 -5
- package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
- package/es/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
- package/es/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
- package/es/composite-comp/bol/components/ImageText/pc/index.js +46 -18
- package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
- package/es/composite-comp/bol/components/Newsletter/index.js +1 -6
- package/es/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
- package/es/composite-comp/bol/components/Tag/index.js +8 -14
- package/es/composite-comp/bol/components/Tag/index.less +1 -0
- package/es/composite-comp/bol/components/Text/defaultJSON.js +4 -6
- package/es/composite-comp/bol/components/Text/index.js +4 -8
- package/es/composite-comp/bol/components/Text/index.less +3 -3
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
- package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
- package/es/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
- package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
- package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
- package/es/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
- package/es/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
- package/es/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/es/composite-comp/common/components/ImageLabel/index.less +6 -2
- package/es/composite-comp/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/common/components/ProductItem/index.less +9 -9
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
- package/es/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
- package/es/composite-comp/dito/components/FlashDeal/index.js +5 -1
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
- package/es/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
- package/es/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
- package/es/composite-comp/dito/components/PcNavigation/index.js +85 -0
- package/es/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
- package/es/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
- package/es/composite-comp/dito/components/Recommend/index.js +5 -6
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
- package/es/composite-comp/dito/components/Recommend/pc/index.js +134 -22
- package/es/composite-comp/dito/components/Recommend/pc/index.less +54 -12
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
- package/es/composite-comp/dito/components/SearchBar/index.js +7 -2
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/es/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
- package/es/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
- package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
- package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
- package/es/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
- package/es/constants/component-types.js +13 -3
- package/es/constants/index.js +20 -2
- package/es/constants/layout.js +34 -8
- package/es/core/Designer/CompListPanel/index.js +8 -33
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/es/core/Designer/ConfigPanel/index.js +72 -23
- package/es/core/Designer/ConfigPanel/index.less +4 -0
- package/es/core/Designer/History/index.js +34 -28
- package/es/core/Designer/PageCompList/index.js +13 -3
- package/es/core/Designer/PageCompList/index.less +10 -10
- package/es/core/Designer/QuickMenuBar/index.js +1 -1
- package/es/core/Designer/ViewArea/index.js +20 -6
- package/es/core/Designer/index.js +43 -37
- package/es/core/Renderer/index.js +21 -5
- package/es/decorator/compositeDecorator.js +45 -12
- package/es/decorator/index.js +8 -0
- package/es/decorator/metaDecorator.js +4 -3
- package/es/decorator/updateConfigDecorator.js +76 -0
- package/es/locale/en/en.json +14 -1
- package/es/locale/es/es.json +14 -1
- package/es/locale/id/id.json +14 -1
- package/es/meta-comp/components/Button/editable.js +114 -0
- package/es/meta-comp/components/Button/editable.less +6 -0
- package/es/meta-comp/components/Button/index.js +14 -33
- package/es/meta-comp/components/Button/index.less +3 -2
- package/es/meta-comp/components/Image/index.js +39 -8
- package/es/meta-comp/components/Image/index.less +7 -4
- package/es/meta-comp/components/Text/index.js +28 -11
- package/es/meta-comp/config-panels/BaseConfig.js +8 -10
- package/es/meta-comp/config-panels/ButtonConfig/index.js +2 -3
- package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
- package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
- package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
- package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +17 -4
- package/es/meta-comp/config-panels/TextConfig/index.js +15 -6
- package/es/mobx/Store.js +6 -10
- package/es/utils/coreUtil.js +15 -2
- package/lib/assets/fonts/magic-box-iconfont.css +24 -12
- package/lib/assets/fonts/magic-box-iconfont.css.bak +24 -12
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/assets/images/layout-icon/layout-navigation-normal.png +0 -0
- package/lib/assets/less/common.less +2 -2
- package/lib/assets/less/modal.less +7 -2
- package/lib/common/Button/index.js +2 -1
- package/lib/common/Button/index.less +5 -0
- package/lib/common/ButtonIconLayout/index.less +4 -2
- package/lib/common/Collapse/index.js +14 -4
- package/lib/common/FontStyles/index.less +1 -1
- package/lib/common/GroupList/index.js +4 -3
- package/lib/common/ImageModal/index.js +31 -26
- package/lib/common/ImageModal/index.less +6 -1
- package/lib/common/ImgArea/components/Crop.js +267 -0
- package/lib/common/ImgArea/components/Icons.js +44 -0
- package/lib/common/ImgArea/components/MultiCrops.js +210 -0
- package/lib/common/ImgArea/index.js +11 -0
- package/lib/common/LinkModal/BundleCampaign/index.js +17 -17
- package/lib/common/LinkModal/CustomTable/index.js +1 -0
- package/lib/common/LinkModal/FilteredProductModal/index.js +3 -3
- package/lib/common/LinkModal/FilteredProductModal/index.less +2 -3
- package/lib/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/lib/common/LinkModal/index.less +1 -1
- package/lib/common/MagicLink/index.js +89 -0
- package/lib/common/MagicLink/index.less +0 -0
- package/lib/common/ProductModal/index.js +1 -1
- package/lib/common/ProductModal/index.less +12 -7
- package/lib/common/UrlPicker/index.js +6 -2
- package/lib/common/UrlPicker/index.less +12 -1
- package/lib/common/index.js +8 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
- package/lib/composite-comp/bol/components/Banner/mobile/index.js +4 -10
- package/lib/composite-comp/bol/components/Banner/pc/index.js +3 -6
- package/lib/composite-comp/bol/components/Button/defaultJSON.js +40 -70
- package/lib/composite-comp/bol/components/Button/index.js +8 -14
- package/lib/composite-comp/bol/components/Button/index.less +1 -0
- package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
- package/lib/composite-comp/bol/components/Carousel/index.js +1 -6
- package/lib/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
- package/lib/composite-comp/bol/components/Carousel/pc/index.js +15 -7
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +13 -5
- package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
- package/lib/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
- package/lib/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
- package/lib/composite-comp/bol/components/ImageText/pc/index.js +46 -18
- package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/components/Newsletter/index.js +1 -6
- package/lib/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
- package/lib/composite-comp/bol/components/Tag/index.js +8 -14
- package/lib/composite-comp/bol/components/Tag/index.less +1 -0
- package/lib/composite-comp/bol/components/Text/defaultJSON.js +4 -6
- package/lib/composite-comp/bol/components/Text/index.js +4 -8
- package/lib/composite-comp/bol/components/Text/index.less +3 -3
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
- package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
- package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
- package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
- package/lib/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
- package/lib/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
- package/lib/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/lib/composite-comp/common/components/ImageLabel/index.less +6 -2
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +9 -9
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
- package/lib/composite-comp/dito/components/FlashDeal/index.js +5 -1
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
- package/lib/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
- package/lib/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
- package/lib/composite-comp/dito/components/PcNavigation/index.js +85 -0
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
- package/lib/composite-comp/dito/components/Recommend/index.js +5 -6
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +134 -22
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +54 -12
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
- package/lib/composite-comp/dito/components/SearchBar/index.js +7 -2
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/lib/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
- package/lib/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
- package/lib/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
- package/lib/constants/component-types.js +13 -3
- package/lib/constants/index.js +20 -2
- package/lib/constants/layout.js +34 -8
- package/lib/core/Designer/CompListPanel/index.js +8 -33
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/lib/core/Designer/ConfigPanel/index.js +72 -23
- package/lib/core/Designer/ConfigPanel/index.less +4 -0
- package/lib/core/Designer/History/index.js +34 -28
- package/lib/core/Designer/PageCompList/index.js +13 -3
- package/lib/core/Designer/PageCompList/index.less +10 -10
- package/lib/core/Designer/QuickMenuBar/index.js +1 -1
- package/lib/core/Designer/ViewArea/index.js +20 -6
- package/lib/core/Designer/index.js +43 -37
- package/lib/core/Renderer/index.js +21 -5
- package/lib/decorator/compositeDecorator.js +45 -12
- package/lib/decorator/index.js +8 -0
- package/lib/decorator/metaDecorator.js +4 -3
- package/lib/decorator/updateConfigDecorator.js +76 -0
- package/lib/locale/en/en.json +14 -1
- package/lib/locale/es/es.json +14 -1
- package/lib/locale/id/id.json +14 -1
- package/lib/meta-comp/components/Button/editable.js +114 -0
- package/lib/meta-comp/components/Button/editable.less +6 -0
- package/lib/meta-comp/components/Button/index.js +14 -33
- package/lib/meta-comp/components/Button/index.less +3 -2
- package/lib/meta-comp/components/Image/index.js +39 -8
- package/lib/meta-comp/components/Image/index.less +7 -4
- package/lib/meta-comp/components/Text/index.js +28 -11
- package/lib/meta-comp/config-panels/BaseConfig.js +8 -10
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +2 -3
- package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
- package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
- package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
- package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +17 -4
- package/lib/meta-comp/config-panels/TextConfig/index.js +15 -6
- package/lib/mobx/Store.js +6 -10
- package/lib/utils/coreUtil.js +15 -2
- package/package.json +5 -3
|
@@ -7,13 +7,16 @@ exports.recommendGroupSourceJSON = exports.getDefaultJSON = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
9
|
|
|
10
|
-
var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
10
|
+
var recommendGroupSourceJSON = function recommendGroupSourceJSON(parentId, logo, text) {
|
|
11
11
|
var groupId = (0, _uuid.v4)();
|
|
12
|
+
var imageId = (0, _uuid.v4)();
|
|
13
|
+
var groupNameId = (0, _uuid.v4)();
|
|
12
14
|
return {
|
|
13
15
|
id: groupId,
|
|
16
|
+
parentId: parentId,
|
|
14
17
|
image: {
|
|
15
18
|
parentId: groupId,
|
|
16
|
-
id:
|
|
19
|
+
id: imageId,
|
|
17
20
|
open: true,
|
|
18
21
|
type: 'IMAGE',
|
|
19
22
|
content: {
|
|
@@ -33,12 +36,13 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
33
36
|
},
|
|
34
37
|
groupName: {
|
|
35
38
|
parentId: groupId,
|
|
36
|
-
id:
|
|
39
|
+
id: groupNameId,
|
|
37
40
|
open: true,
|
|
38
41
|
type: 'TEXT',
|
|
39
42
|
specialContent: [],
|
|
40
43
|
text: text,
|
|
41
44
|
content: {
|
|
45
|
+
sizeType: 'Customize font styles',
|
|
42
46
|
fontFamily: 'Open Sans',
|
|
43
47
|
fontWeight: 400,
|
|
44
48
|
fontSize: 14,
|
|
@@ -52,6 +56,7 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
52
56
|
vertical: {}
|
|
53
57
|
},
|
|
54
58
|
seeAll: {
|
|
59
|
+
parentId: groupId,
|
|
55
60
|
id: (0, _uuid.v4)(),
|
|
56
61
|
open: true,
|
|
57
62
|
type: 'BUTTON',
|
|
@@ -61,6 +66,7 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
61
66
|
backgroundColor: '#fff'
|
|
62
67
|
},
|
|
63
68
|
buttonText: {
|
|
69
|
+
sizeType: 'Customize font styles',
|
|
64
70
|
fontFamily: 'Open Sans',
|
|
65
71
|
fontWeight: 400,
|
|
66
72
|
fontSize: 12,
|
|
@@ -98,10 +104,10 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
98
104
|
intelligentValue: [],
|
|
99
105
|
maxProdNum: 10,
|
|
100
106
|
hover: {
|
|
101
|
-
open:
|
|
107
|
+
open: false,
|
|
102
108
|
image: {
|
|
103
109
|
parentId: groupId,
|
|
104
|
-
id:
|
|
110
|
+
id: imageId,
|
|
105
111
|
open: false,
|
|
106
112
|
type: 'IMAGE',
|
|
107
113
|
content: {
|
|
@@ -121,12 +127,13 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
121
127
|
},
|
|
122
128
|
groupName: {
|
|
123
129
|
parentId: groupId,
|
|
124
|
-
id:
|
|
130
|
+
id: groupNameId,
|
|
125
131
|
open: false,
|
|
126
132
|
type: 'TEXT',
|
|
127
133
|
specialContent: [],
|
|
128
134
|
text: text,
|
|
129
135
|
content: {
|
|
136
|
+
sizeType: 'Customize font styles',
|
|
130
137
|
fontFamily: 'Open Sans',
|
|
131
138
|
fontWeight: 600,
|
|
132
139
|
fontSize: 14,
|
|
@@ -146,10 +153,11 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(logo, text) {
|
|
|
146
153
|
exports.recommendGroupSourceJSON = recommendGroupSourceJSON;
|
|
147
154
|
|
|
148
155
|
var getDefaultJSON = function getDefaultJSON() {
|
|
156
|
+
var groupId = (0, _uuid.v4)();
|
|
149
157
|
return {
|
|
150
|
-
id:
|
|
158
|
+
id: groupId,
|
|
151
159
|
type: 'RECOMMEND',
|
|
152
|
-
groupSource: [recommendGroupSourceJSON('', 'Tab1'), recommendGroupSourceJSON('', 'Tab2')],
|
|
160
|
+
groupSource: [recommendGroupSourceJSON(groupId, '', 'Tab1'), recommendGroupSourceJSON(groupId, '', 'Tab2')],
|
|
153
161
|
content: {
|
|
154
162
|
label: {
|
|
155
163
|
id: (0, _uuid.v4)(),
|
|
@@ -161,6 +169,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
161
169
|
backgroundColor: '#CE1126'
|
|
162
170
|
},
|
|
163
171
|
buttonText: {
|
|
172
|
+
sizeType: 'Customize font styles',
|
|
164
173
|
fontFamily: 'Open Sans',
|
|
165
174
|
fontWeight: 600,
|
|
166
175
|
fontSize: 8,
|
|
@@ -199,6 +208,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
199
208
|
specialContent: [],
|
|
200
209
|
text: 'Flash Deal',
|
|
201
210
|
content: {
|
|
211
|
+
sizeType: 'Customize font styles',
|
|
202
212
|
fontFamily: 'Open Sans',
|
|
203
213
|
fontWeight: 700,
|
|
204
214
|
fontSize: 14,
|
|
@@ -221,6 +231,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
221
231
|
specialContent: [],
|
|
222
232
|
text: 'Flash Deal',
|
|
223
233
|
content: {
|
|
234
|
+
sizeType: 'Customize font styles',
|
|
224
235
|
fontFamily: 'Open Sans',
|
|
225
236
|
fontWeight: 700,
|
|
226
237
|
fontSize: 14,
|
|
@@ -243,6 +254,7 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
243
254
|
specialContent: [],
|
|
244
255
|
text: 'Flash Deal',
|
|
245
256
|
content: {
|
|
257
|
+
sizeType: 'Customize font styles',
|
|
246
258
|
fontFamily: 'Open Sans',
|
|
247
259
|
fontWeight: 500,
|
|
248
260
|
fontSize: 10,
|
|
@@ -268,19 +280,25 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
268
280
|
paddingBottom: 0,
|
|
269
281
|
paddingLeft: 0,
|
|
270
282
|
paddingRight: 0,
|
|
271
|
-
marginBottom:
|
|
283
|
+
marginBottom: window.magicDesign.compSpacing * 1.5
|
|
272
284
|
},
|
|
273
285
|
mobile: {
|
|
274
286
|
paddingTop: 0,
|
|
275
287
|
paddingBottom: 0,
|
|
276
288
|
paddingLeft: 0,
|
|
277
289
|
paddingRight: 0,
|
|
278
|
-
marginBottom:
|
|
290
|
+
marginBottom: window.magicDesign.compSpacing
|
|
279
291
|
}
|
|
280
292
|
},
|
|
281
293
|
customize: {
|
|
282
|
-
layout:
|
|
283
|
-
|
|
294
|
+
layout: {
|
|
295
|
+
pcLayout: 'layout1',
|
|
296
|
+
h5Layout: 'layout1'
|
|
297
|
+
},
|
|
298
|
+
align: 'left',
|
|
299
|
+
pcRowNum: 6,
|
|
300
|
+
pcMaxRowNum: 6,
|
|
301
|
+
pcMinRowNum: 5
|
|
284
302
|
},
|
|
285
303
|
background: {
|
|
286
304
|
opacity: 100,
|
|
@@ -9,14 +9,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _mobile = _interopRequireDefault(require("./mobile"));
|
|
11
11
|
|
|
12
|
+
var _pc = _interopRequireDefault(require("./pc"));
|
|
13
|
+
|
|
12
14
|
var _defaultJSON = require("./defaultJSON");
|
|
13
15
|
|
|
14
16
|
var _coreUtil = require("../../../../utils/coreUtil");
|
|
15
17
|
|
|
16
18
|
var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
|
|
17
19
|
|
|
18
|
-
var _businessUtil = require("../../../../utils/businessUtil");
|
|
19
|
-
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -72,10 +72,9 @@ function (_super) {
|
|
|
72
72
|
|
|
73
73
|
Recommend.prototype.render = function () {
|
|
74
74
|
var nodeData = this.props.nodeData;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, (0, _coreUtil.isPc)() ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
75
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
|
|
76
|
+
panelProps: nodeData
|
|
77
|
+
}) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
|
|
79
78
|
panelProps: nodeData
|
|
80
79
|
}));
|
|
81
80
|
};
|
|
@@ -227,10 +227,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
var LAYOUT_IMAGE_SIZE = {
|
|
230
|
-
left: {
|
|
231
|
-
w: '100%',
|
|
232
|
-
h: 165
|
|
233
|
-
},
|
|
234
230
|
layout1: {
|
|
235
231
|
w: '100%',
|
|
236
232
|
h: 164
|
|
@@ -263,6 +259,7 @@ function (_super) {
|
|
|
263
259
|
|
|
264
260
|
_this.preData = {};
|
|
265
261
|
_this.preLayout = '';
|
|
262
|
+
_this.preContent = '';
|
|
266
263
|
_this._cache = (0, _coreUtil.isDesignMode)() ? {} : (0, _commonUtil.ensure)(function () {
|
|
267
264
|
return (0, _storeUtil.getMagicStore)("recommend_" + _this.props.panelProps.id);
|
|
268
265
|
}, {});
|
|
@@ -292,9 +289,10 @@ function (_super) {
|
|
|
292
289
|
|
|
293
290
|
_this.getTabBarActiveColor = function (_panelProps) {
|
|
294
291
|
var tabIndex = _this.state.tabIndex;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
292
|
+
var activeHoverGroupName = _panelProps.groupSource[tabIndex].hover;
|
|
293
|
+
return activeHoverGroupName.open ? (0, _commonUtil.ensure)(function () {
|
|
294
|
+
return activeHoverGroupName.groupName.content.color;
|
|
295
|
+
}, '#CE1126') : '#CE1126';
|
|
298
296
|
};
|
|
299
297
|
|
|
300
298
|
_this.getProductList = function (index) {
|
|
@@ -416,18 +414,16 @@ function (_super) {
|
|
|
416
414
|
};
|
|
417
415
|
|
|
418
416
|
_this.resetLayout = function () {
|
|
419
|
-
var layout = _this.props.panelProps.customize.layout.h5Layout
|
|
420
|
-
|
|
417
|
+
var layout = _this.props.panelProps.customize.layout.h5Layout;
|
|
421
418
|
var LAYOUT_COLUMN = {
|
|
422
|
-
left: 2,
|
|
423
419
|
layout1: 2,
|
|
424
420
|
layout2: 1,
|
|
425
421
|
layout3: 3
|
|
426
422
|
};
|
|
427
423
|
if (!LAYOUT_COLUMN[layout]) return;
|
|
428
424
|
setTimeout(function () {
|
|
429
|
-
if (document.querySelector(
|
|
430
|
-
_this.getMacy(
|
|
425
|
+
if (document.querySelector(".macyContainer_" + _this.props.panelProps.id)) {
|
|
426
|
+
_this.getMacy(".macyContainer_" + _this.props.panelProps.id, LAYOUT_COLUMN[layout]);
|
|
431
427
|
}
|
|
432
428
|
});
|
|
433
429
|
};
|
|
@@ -469,8 +465,7 @@ function (_super) {
|
|
|
469
465
|
|
|
470
466
|
_this.onTabClick = function (e, index) {
|
|
471
467
|
var tabIndex = _this.state.tabIndex;
|
|
472
|
-
if (tabIndex === index) return;
|
|
473
|
-
e.currentTarget.scrollIntoView(false);
|
|
468
|
+
if (tabIndex === index) return; // e.currentTarget.scrollIntoView(false);
|
|
474
469
|
|
|
475
470
|
_this.setState({
|
|
476
471
|
tabIndex: index
|
|
@@ -543,13 +538,15 @@ function (_super) {
|
|
|
543
538
|
hideTabs: hideTabs
|
|
544
539
|
});
|
|
545
540
|
});
|
|
546
|
-
var curLayout = panelProps.customize.layout.h5Layout
|
|
541
|
+
var curLayout = panelProps.customize.layout.h5Layout;
|
|
542
|
+
var curContent = JSON.stringify(panelProps.content);
|
|
547
543
|
|
|
548
|
-
if (curLayout !== this.preLayout) {
|
|
544
|
+
if (curLayout !== this.preLayout || curContent !== this.preContent) {
|
|
549
545
|
this.resetLayout();
|
|
550
546
|
}
|
|
551
547
|
|
|
552
548
|
this.preLayout = curLayout;
|
|
549
|
+
this.preContent = curContent;
|
|
553
550
|
};
|
|
554
551
|
|
|
555
552
|
RecommendMobile.prototype.render = function () {
|
|
@@ -565,8 +562,11 @@ function (_super) {
|
|
|
565
562
|
var bgStyle = this.getBackgroundStyle();
|
|
566
563
|
var products = this.state["products" + tabIndex] || [];
|
|
567
564
|
var isDivide = groupSource.length <= 3;
|
|
568
|
-
var layout = panelProps.customize.layout.h5Layout
|
|
569
|
-
|
|
565
|
+
var layout = panelProps.customize.layout.h5Layout;
|
|
566
|
+
|
|
567
|
+
var _seeAll = (0, _commonUtil.ensure)(function () {
|
|
568
|
+
return groupSource[tabIndex].seeAll;
|
|
569
|
+
}, '');
|
|
570
570
|
|
|
571
571
|
var imgHeight = (0, _commonUtil.ensure)(function () {
|
|
572
572
|
return LAYOUT_IMAGE_SIZE[layout].h;
|
|
@@ -614,11 +614,33 @@ function (_super) {
|
|
|
614
614
|
transform: "translateX(" + tabLeft + "px)",
|
|
615
615
|
background: this.getTabBarActiveColor(panelProps)
|
|
616
616
|
}
|
|
617
|
-
})), ['
|
|
617
|
+
})), ['layout1', 'layout2', 'layout3'].includes(layout) ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
618
|
+
key: "macyContainer",
|
|
619
|
+
className: "macyContainer macyContainer_" + panelProps.id
|
|
620
|
+
}, products.map(function (item) {
|
|
621
|
+
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
622
|
+
key: item.productId,
|
|
623
|
+
data: item,
|
|
624
|
+
fixHeight: layout === 'layout3',
|
|
625
|
+
imgHeight: imgHeight,
|
|
626
|
+
imgWidth: imgWidth,
|
|
627
|
+
layout: layout === 'layout2' ? 'horizontal' : 'vertical',
|
|
628
|
+
onItemClick: function onItemClick() {
|
|
629
|
+
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId + "?productId=" + (item.sppProductId || item.productId || ''));
|
|
630
|
+
},
|
|
631
|
+
panelProps: panelProps.content,
|
|
632
|
+
showProgress: false
|
|
633
|
+
});
|
|
634
|
+
})), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
635
|
+
className: "btnSeeAll",
|
|
636
|
+
data: _seeAll
|
|
637
|
+
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
618
638
|
key: "scrollContainer",
|
|
619
639
|
className: (0, _classnames["default"])('scrollContainer', {
|
|
620
640
|
pl_100: layout === 'layout5'
|
|
621
641
|
})
|
|
642
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
643
|
+
className: "scrollProductList"
|
|
622
644
|
}, products.map(function (item) {
|
|
623
645
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
624
646
|
className: "productCard"
|
|
@@ -634,24 +656,10 @@ function (_super) {
|
|
|
634
656
|
panelProps: panelProps.content,
|
|
635
657
|
showProgress: false
|
|
636
658
|
}));
|
|
637
|
-
}))
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
642
|
-
key: item.productId,
|
|
643
|
-
data: item,
|
|
644
|
-
fixHeight: layout === 'layout3',
|
|
645
|
-
imgHeight: imgHeight,
|
|
646
|
-
imgWidth: imgWidth,
|
|
647
|
-
layout: layout === 'layout2' ? 'horizontal' : 'vertical',
|
|
648
|
-
onItemClick: function onItemClick() {
|
|
649
|
-
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId + "?productId=" + (item.sppProductId || item.productId || ''));
|
|
650
|
-
},
|
|
651
|
-
panelProps: panelProps.content,
|
|
652
|
-
showProgress: false
|
|
653
|
-
});
|
|
654
|
-
}))));
|
|
659
|
+
})), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
660
|
+
className: "btnSeeAll",
|
|
661
|
+
data: _seeAll
|
|
662
|
+
})));
|
|
655
663
|
};
|
|
656
664
|
|
|
657
665
|
RecommendMobile.defaultProps = {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
padding: 0 24px;
|
|
29
|
+
width: fit-content;
|
|
29
30
|
height: 100%;
|
|
30
31
|
justify-content: center;
|
|
31
32
|
white-space: nowrap;
|
|
@@ -66,8 +67,14 @@
|
|
|
66
67
|
padding-left: 100px;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
.
|
|
70
|
-
|
|
70
|
+
.scrollProductList {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
align-items: flex-start;
|
|
74
|
+
|
|
75
|
+
.productCard {
|
|
76
|
+
margin-right: 12px;
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
|
|
@@ -76,5 +83,6 @@
|
|
|
76
83
|
width: fit-content;
|
|
77
84
|
min-width: 80px;
|
|
78
85
|
margin: 0 auto;
|
|
86
|
+
flex: none;
|
|
79
87
|
}
|
|
80
88
|
}
|
|
@@ -13,6 +13,8 @@ require("./index.less");
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
+
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
17
|
+
|
|
16
18
|
var _mobx = require("../../../../../mobx");
|
|
17
19
|
|
|
18
20
|
var _ProductItem = _interopRequireDefault(require("../../../../common/components/ProductItem"));
|
|
@@ -25,6 +27,8 @@ var _commonUtil = require("../../../../../utils/commonUtil");
|
|
|
25
27
|
|
|
26
28
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
27
29
|
|
|
30
|
+
var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
|
|
31
|
+
|
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
33
|
|
|
30
34
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -228,16 +232,24 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
228
232
|
|
|
229
233
|
var LAYOUT_IMAGE_SIZE = {
|
|
230
234
|
layout1: {
|
|
231
|
-
w:
|
|
235
|
+
w: '100%',
|
|
232
236
|
h: 180
|
|
233
237
|
},
|
|
234
|
-
|
|
238
|
+
layout2_col6: {
|
|
235
239
|
w: 160,
|
|
236
240
|
h: 160
|
|
237
241
|
},
|
|
238
|
-
|
|
239
|
-
w:
|
|
240
|
-
h:
|
|
242
|
+
layout2_col5: {
|
|
243
|
+
w: 200,
|
|
244
|
+
h: 200
|
|
245
|
+
},
|
|
246
|
+
layout3_col6: {
|
|
247
|
+
w: 160,
|
|
248
|
+
h: 160
|
|
249
|
+
},
|
|
250
|
+
layout3_col5: {
|
|
251
|
+
w: 200,
|
|
252
|
+
h: 200
|
|
241
253
|
}
|
|
242
254
|
};
|
|
243
255
|
|
|
@@ -251,17 +263,31 @@ function (_super) {
|
|
|
251
263
|
|
|
252
264
|
_this.preData = {};
|
|
253
265
|
_this.preLayout = '';
|
|
266
|
+
_this.preContent = '';
|
|
254
267
|
_this._cache = (0, _coreUtil.isDesignMode)() ? {} : (0, _commonUtil.ensure)(function () {
|
|
255
268
|
return (0, _storeUtil.getMagicStore)("recommend_" + _this.props.panelProps.id);
|
|
256
269
|
}, {});
|
|
270
|
+
_this.scrollRef = /*#__PURE__*/_react["default"].createRef();
|
|
257
271
|
_this.state = __assign({
|
|
258
272
|
tabIndex: 0,
|
|
259
273
|
tabLeft: 0,
|
|
260
274
|
tabWidth: 0,
|
|
261
275
|
groupSource: [],
|
|
262
|
-
hideTabs: false
|
|
276
|
+
hideTabs: false,
|
|
277
|
+
scrollToLeftDisabled: true,
|
|
278
|
+
scrollToRightDisabled: true
|
|
263
279
|
}, _this._cache);
|
|
264
280
|
|
|
281
|
+
_this.setScrollDisabled = function (scrollDom) {
|
|
282
|
+
var scrollToLeftDisabled = scrollDom.scrollLeft === 0;
|
|
283
|
+
var scrollToRightDisabled = scrollDom.clientWidth + scrollDom.scrollLeft >= scrollDom.scrollWidth;
|
|
284
|
+
|
|
285
|
+
_this.setState({
|
|
286
|
+
scrollToLeftDisabled: scrollToLeftDisabled,
|
|
287
|
+
scrollToRightDisabled: scrollToRightDisabled
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
|
|
265
291
|
_this.initTab = function (index, hideTabs) {
|
|
266
292
|
var selectedTabDom = document.querySelector(".tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
|
|
267
293
|
var tabLeft = 0;
|
|
@@ -407,8 +433,8 @@ function (_super) {
|
|
|
407
433
|
var customize = _this.props.panelProps.customize;
|
|
408
434
|
if (customize.layout.pcLayout !== 'layout1') return;
|
|
409
435
|
setTimeout(function () {
|
|
410
|
-
if (document.querySelector(
|
|
411
|
-
_this.getMacy(
|
|
436
|
+
if (document.querySelector(".macyContainer_" + _this.props.panelProps.id)) {
|
|
437
|
+
_this.getMacy(".macyContainer_" + _this.props.panelProps.id, customize.pcRowNum);
|
|
412
438
|
}
|
|
413
439
|
});
|
|
414
440
|
};
|
|
@@ -450,8 +476,7 @@ function (_super) {
|
|
|
450
476
|
|
|
451
477
|
_this.onTabClick = function (e, index) {
|
|
452
478
|
var tabIndex = _this.state.tabIndex;
|
|
453
|
-
if (tabIndex === index) return;
|
|
454
|
-
e.currentTarget.scrollIntoView(false);
|
|
479
|
+
if (tabIndex === index) return; // e.currentTarget.scrollIntoView(false);
|
|
455
480
|
|
|
456
481
|
_this.setState({
|
|
457
482
|
tabIndex: index
|
|
@@ -462,6 +487,34 @@ function (_super) {
|
|
|
462
487
|
});
|
|
463
488
|
|
|
464
489
|
_this.getProductList(index);
|
|
490
|
+
|
|
491
|
+
setTimeout(function () {
|
|
492
|
+
var scrollDom = _this.scrollRef.current;
|
|
493
|
+
|
|
494
|
+
if (scrollDom) {
|
|
495
|
+
_this.setScrollDisabled(scrollDom);
|
|
496
|
+
|
|
497
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
498
|
+
_this.setScrollDisabled(scrollDom);
|
|
499
|
+
}, 500);
|
|
500
|
+
}
|
|
501
|
+
}, 0);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
_this.scrollToRight = function () {
|
|
505
|
+
var scrollDom = _this.scrollRef.current;
|
|
506
|
+
|
|
507
|
+
if (scrollDom.clientWidth + scrollDom.scrollLeft < scrollDom.scrollWidth) {
|
|
508
|
+
scrollDom.scrollTo(scrollDom.scrollLeft + scrollDom.clientWidth, 0);
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
_this.scrollToLeft = function () {
|
|
513
|
+
var scrollDom = _this.scrollRef.current;
|
|
514
|
+
|
|
515
|
+
if (scrollDom.scrollLeft > 0) {
|
|
516
|
+
scrollDom.scrollTo(scrollDom.scrollLeft - scrollDom.clientWidth, 0);
|
|
517
|
+
}
|
|
465
518
|
};
|
|
466
519
|
|
|
467
520
|
return _this;
|
|
@@ -483,6 +536,17 @@ function (_super) {
|
|
|
483
536
|
|
|
484
537
|
_this.getProductList(0);
|
|
485
538
|
});
|
|
539
|
+
setTimeout(function () {
|
|
540
|
+
var scrollDom = _this.scrollRef.current;
|
|
541
|
+
|
|
542
|
+
if (scrollDom) {
|
|
543
|
+
_this.setScrollDisabled(scrollDom);
|
|
544
|
+
|
|
545
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
546
|
+
_this.setScrollDisabled(scrollDom);
|
|
547
|
+
}, 500);
|
|
548
|
+
}
|
|
549
|
+
}, 0);
|
|
486
550
|
};
|
|
487
551
|
|
|
488
552
|
RecommendMobile.prototype.componentWillReceiveProps = function () {
|
|
@@ -524,13 +588,31 @@ function (_super) {
|
|
|
524
588
|
hideTabs: hideTabs
|
|
525
589
|
});
|
|
526
590
|
});
|
|
527
|
-
var curLayout = panelProps.customize
|
|
591
|
+
var curLayout = JSON.stringify(panelProps.customize);
|
|
528
592
|
|
|
529
593
|
if (curLayout !== this.preLayout) {
|
|
530
594
|
this.resetLayout();
|
|
595
|
+
setTimeout(function () {
|
|
596
|
+
var scrollDom = _this.scrollRef.current;
|
|
597
|
+
|
|
598
|
+
if (scrollDom) {
|
|
599
|
+
_this.setScrollDisabled(scrollDom);
|
|
600
|
+
|
|
601
|
+
scrollDom.onscroll = (0, _lodash["default"])(function () {
|
|
602
|
+
_this.setScrollDisabled(scrollDom);
|
|
603
|
+
}, 500);
|
|
604
|
+
}
|
|
605
|
+
}, 0);
|
|
531
606
|
}
|
|
532
607
|
|
|
533
608
|
this.preLayout = curLayout;
|
|
609
|
+
var curContent = JSON.stringify(panelProps.content);
|
|
610
|
+
|
|
611
|
+
if (curContent !== this.preContent) {
|
|
612
|
+
this.resetLayout();
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
this.preContent = curContent;
|
|
534
616
|
};
|
|
535
617
|
|
|
536
618
|
RecommendMobile.prototype.render = function () {
|
|
@@ -542,10 +624,12 @@ function (_super) {
|
|
|
542
624
|
tabLeft = _a.tabLeft,
|
|
543
625
|
tabWidth = _a.tabWidth,
|
|
544
626
|
groupSource = _a.groupSource,
|
|
545
|
-
hideTabs = _a.hideTabs
|
|
627
|
+
hideTabs = _a.hideTabs,
|
|
628
|
+
scrollToLeftDisabled = _a.scrollToLeftDisabled,
|
|
629
|
+
scrollToRightDisabled = _a.scrollToRightDisabled;
|
|
546
630
|
var bgStyle = this.getBackgroundStyle();
|
|
547
631
|
var products = this.state["products" + tabIndex] || [];
|
|
548
|
-
var isDivide = groupSource.length <=
|
|
632
|
+
var isDivide = groupSource.length <= 10;
|
|
549
633
|
var layout = panelProps.customize.layout.pcLayout;
|
|
550
634
|
|
|
551
635
|
var _seeAll = (0, _commonUtil.ensure)(function () {
|
|
@@ -553,10 +637,10 @@ function (_super) {
|
|
|
553
637
|
}, '');
|
|
554
638
|
|
|
555
639
|
var imgHeight = (0, _commonUtil.ensure)(function () {
|
|
556
|
-
return LAYOUT_IMAGE_SIZE[layout].h;
|
|
640
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].h : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].h;
|
|
557
641
|
}, 140);
|
|
558
642
|
var imgWidth = (0, _commonUtil.ensure)(function () {
|
|
559
|
-
return LAYOUT_IMAGE_SIZE[layout].w;
|
|
643
|
+
return layout === 'layout1' ? LAYOUT_IMAGE_SIZE[layout].w : LAYOUT_IMAGE_SIZE[layout + "_col" + panelProps.customize.pcRowNum].w;
|
|
560
644
|
}, 140);
|
|
561
645
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
562
646
|
className: "m-recommend-pc",
|
|
@@ -598,9 +682,23 @@ function (_super) {
|
|
|
598
682
|
transform: "translateX(" + tabLeft + "px)",
|
|
599
683
|
background: this.getTabBarActiveColor(panelProps)
|
|
600
684
|
}
|
|
601
|
-
})),
|
|
685
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
686
|
+
className: "tab-content"
|
|
687
|
+
}, layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
688
|
+
className: "arrow-icon left",
|
|
689
|
+
onClick: function onClick() {
|
|
690
|
+
return _this.scrollToLeft();
|
|
691
|
+
}
|
|
692
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
693
|
+
color: scrollToLeftDisabled ? '#BDC1C8' : '#232F46',
|
|
694
|
+
size: 20,
|
|
695
|
+
type: "icon-outlined-left"
|
|
696
|
+
})), layout === 'layout1' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
697
|
+
className: "tab-list"
|
|
698
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
602
699
|
key: "macyContainer",
|
|
603
|
-
|
|
700
|
+
ref: this.scrollRef,
|
|
701
|
+
className: "macyContainer macyContainer_" + panelProps.id
|
|
604
702
|
}, products.map(function (item) {
|
|
605
703
|
return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
|
|
606
704
|
key: item.productId,
|
|
@@ -609,19 +707,24 @@ function (_super) {
|
|
|
609
707
|
imgHeight: imgHeight,
|
|
610
708
|
imgWidth: imgWidth,
|
|
611
709
|
onItemClick: function onItemClick() {
|
|
612
|
-
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId
|
|
710
|
+
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId);
|
|
613
711
|
},
|
|
614
712
|
panelProps: panelProps.content,
|
|
615
713
|
showProgress: false
|
|
616
714
|
});
|
|
617
715
|
})), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
618
|
-
className: "btnSeeAll
|
|
716
|
+
className: (0, _classnames["default"])('btnSeeAll', {
|
|
717
|
+
line: layout === 'layout1'
|
|
718
|
+
}),
|
|
619
719
|
data: _seeAll
|
|
620
720
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
621
721
|
key: "scrollContainer",
|
|
722
|
+
ref: this.scrollRef,
|
|
622
723
|
className: (0, _classnames["default"])('scrollContainer', {
|
|
623
724
|
pl_100: layout === 'layout3'
|
|
624
725
|
})
|
|
726
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
727
|
+
className: "scrollProductList"
|
|
625
728
|
}, products.map(function (item) {
|
|
626
729
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
627
730
|
className: "productCard"
|
|
@@ -632,15 +735,24 @@ function (_super) {
|
|
|
632
735
|
imgHeight: imgHeight,
|
|
633
736
|
imgWidth: imgWidth,
|
|
634
737
|
onItemClick: function onItemClick() {
|
|
635
|
-
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId
|
|
738
|
+
return (0, _coreUtil.clickUrl)("/product/detail/" + item.offerId);
|
|
636
739
|
},
|
|
637
740
|
panelProps: panelProps.content,
|
|
638
741
|
showProgress: false
|
|
639
742
|
}));
|
|
640
|
-
}), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
743
|
+
})), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
|
|
641
744
|
className: "btnSeeAll",
|
|
642
745
|
data: _seeAll
|
|
643
|
-
}))
|
|
746
|
+
})), layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
747
|
+
className: "arrow-icon right",
|
|
748
|
+
onClick: function onClick() {
|
|
749
|
+
return _this.scrollToRight();
|
|
750
|
+
}
|
|
751
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
752
|
+
color: scrollToRightDisabled ? '#BDC1C8' : '#232F46',
|
|
753
|
+
size: 20,
|
|
754
|
+
type: "icon-outlined-right"
|
|
755
|
+
}))));
|
|
644
756
|
};
|
|
645
757
|
|
|
646
758
|
RecommendMobile.defaultProps = {
|