@fonixtree/magic-design 0.0.1
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/Montserrat-Bold.ttf +0 -0
- package/es/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/es/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/es/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/es/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/es/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/es/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.css +299 -0
- package/es/assets/fonts/magic-box-iconfont.css.bak +299 -0
- package/es/assets/fonts/magic-box-iconfont.js +1 -0
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -0
- 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/icon/index.js +68 -0
- package/es/assets/images/layout-icon/carouselLayout1.png +0 -0
- package/es/assets/images/layout-icon/carouselLayout2.png +0 -0
- package/es/assets/images/layout-icon/dividerLayout.svg +4 -0
- package/es/assets/images/layout-icon/imageGalleryLayout1.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout2.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-1.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3-1.svg +18 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3-2.svg +9 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p1.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p4.png +0 -0
- package/es/assets/images/layout-icon/layout-search.png +0 -0
- package/es/assets/images/layout-icon/newsletter.svg +7 -0
- package/es/assets/less/button.less +9 -0
- package/es/assets/less/common.less +82 -0
- package/es/assets/less/cylon-antd.less +32534 -0
- package/es/assets/less/font.less +50 -0
- package/es/assets/less/global.less +8 -0
- package/es/assets/less/index.less +11 -0
- package/es/assets/less/input.less +8 -0
- package/es/assets/less/menu.less +21 -0
- package/es/assets/less/modal.less +16 -0
- package/es/assets/less/select.less +19 -0
- package/es/assets/less/slider.less +21 -0
- package/es/assets/less/switch.less +20 -0
- package/es/assets/less/table.less +40 -0
- package/es/assets/less/variables.less +4 -0
- package/es/common/AlignSelector/index.js +104 -0
- package/es/common/AlignSelector/index.less +28 -0
- package/es/common/Button/index.js +134 -0
- package/es/common/Button/index.less +68 -0
- package/es/common/ButtonIconLayout/index.js +103 -0
- package/es/common/ButtonIconLayout/index.less +53 -0
- package/es/common/Collapse/index.js +384 -0
- package/es/common/Collapse/index.less +97 -0
- package/es/common/ColorPicker/imgs/no-color.png +0 -0
- package/es/common/ColorPicker/index.js +131 -0
- package/es/common/ColorPicker/index.less +26 -0
- package/es/common/ColorPickerInput/imgs/code.png +0 -0
- package/es/common/ColorPickerInput/index.js +114 -0
- package/es/common/ColorPickerInput/index.less +50 -0
- package/es/common/CountDown/index.js +151 -0
- package/es/common/CountDown/index.less +23 -0
- package/es/common/Field/index.js +80 -0
- package/es/common/Field/index.less +37 -0
- package/es/common/FontStyles/index.js +178 -0
- package/es/common/FontStyles/index.less +63 -0
- package/es/common/GroupList/defaultImg.png +0 -0
- package/es/common/GroupList/index.js +210 -0
- package/es/common/GroupList/index.less +85 -0
- package/es/common/IconPicker/index.js +147 -0
- package/es/common/IconPicker/index.less +46 -0
- package/es/common/Iconfont/index.js +148 -0
- package/es/common/Iconfont/index.less +20 -0
- package/es/common/ImageModal/CommonModal/const.js +22 -0
- package/es/common/ImageModal/CommonModal/index.js +46 -0
- package/es/common/ImageModal/CommonSelPicCard/index.js +80 -0
- package/es/common/ImageModal/CommonSelPicCard/index.less +40 -0
- package/es/common/ImageModal/const.js +24 -0
- package/es/common/ImageModal/index.js +748 -0
- package/es/common/ImageModal/index.less +21 -0
- package/es/common/ImagePicker/index.js +162 -0
- package/es/common/ImagePicker/index.less +104 -0
- package/es/common/InputNumber/index.js +91 -0
- package/es/common/InputNumber/index.less +33 -0
- package/es/common/LayoutSelector/imgs/center.png +0 -0
- package/es/common/LayoutSelector/imgs/left.png +0 -0
- package/es/common/LayoutSelector/imgs/right.png +0 -0
- package/es/common/LayoutSelector/index.js +111 -0
- package/es/common/LayoutSelector/index.less +34 -0
- package/es/common/LinkModal/CatgTable/index.js +234 -0
- package/es/common/LinkModal/CouponTable/index.js +299 -0
- package/es/common/LinkModal/CustomTable/index.js +227 -0
- package/es/common/LinkModal/FilteredProductModal/index.js +640 -0
- package/es/common/LinkModal/FilteredProductModal/index.less +113 -0
- package/es/common/LinkModal/FunctionTable/index.js +221 -0
- package/es/common/LinkModal/ProductDetailPage/index.js +433 -0
- package/es/common/LinkModal/ProductDetailPage/index.less +21 -0
- package/es/common/LinkModal/index.js +136 -0
- package/es/common/LinkModal/index.less +108 -0
- package/es/common/NewImg/index.js +165 -0
- package/es/common/NewImg/index.less +0 -0
- package/es/common/ProductModal/index.js +760 -0
- package/es/common/ProductModal/index.less +238 -0
- package/es/common/ProductSource/index.js +250 -0
- package/es/common/ProductSource/index.less +12 -0
- package/es/common/RcCollapse/Collapse.js +240 -0
- package/es/common/RcCollapse/Panel.js +193 -0
- package/es/common/RcCollapse/PanelContent.js +59 -0
- package/es/common/RcCollapse/index.js +15 -0
- package/es/common/RcCollapse/index.less +108 -0
- package/es/common/RcCollapse/interface.js +1 -0
- package/es/common/RcCollapse/motion.less +12 -0
- package/es/common/RcCollapse/motionUtil.js +44 -0
- package/es/common/Slider/index.js +151 -0
- package/es/common/Slider/index.less +45 -0
- package/es/common/SwitchCollapse/index.js +216 -0
- package/es/common/SwitchCollapse/index.less +40 -0
- package/es/common/UrlPicker/index.js +119 -0
- package/es/common/UrlPicker/index.less +72 -0
- package/es/common/index.js +127 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +268 -0
- package/es/composite-comp/bol/components/Banner/imgs/banner.png +0 -0
- package/es/composite-comp/bol/components/Banner/index.js +89 -0
- package/es/composite-comp/bol/components/Banner/mobile/index.js +216 -0
- package/es/composite-comp/bol/components/Banner/mobile/index.less +73 -0
- package/es/composite-comp/bol/components/Banner/pc/index.js +278 -0
- package/es/composite-comp/bol/components/Banner/pc/index.less +78 -0
- package/es/composite-comp/bol/components/Button/defaultJSON.js +110 -0
- package/es/composite-comp/bol/components/Button/index.js +103 -0
- package/es/composite-comp/bol/components/Button/index.less +47 -0
- package/es/composite-comp/bol/components/Carousel/defaultJSON.js +292 -0
- package/es/composite-comp/bol/components/Carousel/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/components/Carousel/index.js +93 -0
- package/es/composite-comp/bol/components/Carousel/mobile/index.js +248 -0
- package/es/composite-comp/bol/components/Carousel/mobile/index.less +81 -0
- package/es/composite-comp/bol/components/Carousel/pc/index.js +254 -0
- package/es/composite-comp/bol/components/Carousel/pc/index.less +81 -0
- package/es/composite-comp/bol/components/Divider/defaultJSON.js +47 -0
- package/es/composite-comp/bol/components/Divider/index.js +101 -0
- package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +74 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/banner.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/index.js +84 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +83 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +73 -0
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +537 -0
- package/es/composite-comp/bol/components/ImageText/index.js +88 -0
- package/es/composite-comp/bol/components/ImageText/mobile/index.js +181 -0
- package/es/composite-comp/bol/components/ImageText/mobile/index.less +284 -0
- package/es/composite-comp/bol/components/ImageText/pc/index.js +155 -0
- package/es/composite-comp/bol/components/ImageText/pc/index.less +106 -0
- package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +135 -0
- package/es/composite-comp/bol/components/Newsletter/index.js +127 -0
- package/es/composite-comp/bol/components/Newsletter/index.less +75 -0
- package/es/composite-comp/bol/components/Tag/defaultJSON.js +112 -0
- package/es/composite-comp/bol/components/Tag/index.js +107 -0
- package/es/composite-comp/bol/components/Tag/index.less +34 -0
- package/es/composite-comp/bol/components/Text/defaultJSON.js +149 -0
- package/es/composite-comp/bol/components/Text/index.js +123 -0
- package/es/composite-comp/bol/components/Text/index.less +60 -0
- package/es/composite-comp/bol/components/Text/slice.svg +1 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +126 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +225 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/index.js +46 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigContent/index.js +99 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout2.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +67 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +144 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.less +0 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.js +199 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +67 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.js +98 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerContentSetting/index.js +177 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerSpacingSetting/index.js +89 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +144 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.less +0 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +126 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +196 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/InputField/index.js +185 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +111 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +109 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout2.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +61 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.js +99 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.less +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +138 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/index.js +69 -0
- package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +151 -0
- package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.less +3 -0
- package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +164 -0
- package/es/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +82 -0
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +141 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.js +99 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.less +0 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/index.js +90 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/index.less +3 -0
- package/es/composite-comp/common/components/ImageLabel/index.js +90 -0
- package/es/composite-comp/common/components/ImageLabel/index.less +35 -0
- package/es/composite-comp/common/components/ProductItem/index.js +191 -0
- package/es/composite-comp/common/components/ProductItem/index.less +121 -0
- package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +109 -0
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +202 -0
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.less +21 -0
- package/es/composite-comp/common/config-panels/SpacingConfig/index.js +154 -0
- package/es/composite-comp/common/config-panels/SpacingConfig/index.less +17 -0
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +183 -0
- package/es/composite-comp/dito/components/FlashDeal/index.js +86 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +436 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +94 -0
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +220 -0
- package/es/composite-comp/dito/components/Recommend/index.js +86 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +530 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +79 -0
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +56 -0
- package/es/composite-comp/dito/components/SearchBar/imgs/dito-logo.svg +6 -0
- package/es/composite-comp/dito/components/SearchBar/index.js +86 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +108 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +38 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +143 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +125 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.less +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +62 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +118 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.less +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +143 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +62 -0
- package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +138 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +185 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +3 -0
- package/es/constants/component-types.js +87 -0
- package/es/constants/index.js +144 -0
- package/es/constants/layout.js +120 -0
- package/es/core/Designer/CompListPanel/CompCard/index.js +42 -0
- package/es/core/Designer/CompListPanel/CompCard/index.less +69 -0
- package/es/core/Designer/CompListPanel/index.js +156 -0
- package/es/core/Designer/CompListPanel/index.less +69 -0
- package/es/core/Designer/ConfigPanel/index.js +294 -0
- package/es/core/Designer/ConfigPanel/index.less +139 -0
- package/es/core/Designer/History/index.js +91 -0
- package/es/core/Designer/PageCompList/index.js +266 -0
- package/es/core/Designer/PageCompList/index.less +114 -0
- package/es/core/Designer/QuickMenuBar/index.js +176 -0
- package/es/core/Designer/QuickMenuBar/index.less +67 -0
- package/es/core/Designer/ViewArea/index.js +150 -0
- package/es/core/Designer/ViewArea/index.less +53 -0
- package/es/core/Designer/index.js +454 -0
- package/es/core/Designer/index.less +6 -0
- package/es/core/Renderer/index.js +82 -0
- package/es/decorator/compositeDecorator.js +129 -0
- package/es/decorator/index.js +23 -0
- package/es/decorator/metaDecorator.js +199 -0
- package/es/index.js +27 -0
- package/es/meta-comp/components/Button/index.js +185 -0
- package/es/meta-comp/components/Button/index.less +19 -0
- package/es/meta-comp/components/Image/index.js +171 -0
- package/es/meta-comp/components/Image/index.less +18 -0
- package/es/meta-comp/components/Text/index.js +470 -0
- package/es/meta-comp/components/Text/index.less +38 -0
- package/es/meta-comp/components/index.js +31 -0
- package/es/meta-comp/config-panels/BaseConfig.js +87 -0
- package/es/meta-comp/config-panels/ButtonConfig/index.js +349 -0
- package/es/meta-comp/config-panels/ButtonConfig/index.less +4 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +204 -0
- package/es/meta-comp/config-panels/ImageConfig/index.less +16 -0
- package/es/meta-comp/config-panels/TextConfig/index.js +327 -0
- package/es/meta-comp/config-panels/TextConfig/index.less +24 -0
- package/es/mobx/Store.js +93 -0
- package/es/mobx/index.js +36 -0
- package/es/utils/androidUtil.js +113 -0
- package/es/utils/businessUtil.js +235 -0
- package/es/utils/commonUtil.js +269 -0
- package/es/utils/compJsonUtil.js +240 -0
- package/es/utils/coreUtil.js +156 -0
- package/es/utils/currencyUtil.js +190 -0
- package/es/utils/dataTreeUtils.js +105 -0
- package/es/utils/dateUtil.js +70 -0
- package/es/utils/storeUtil.js +258 -0
- package/lib/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/lib/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/lib/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/lib/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/lib/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/lib/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/lib/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.css +299 -0
- package/lib/assets/fonts/magic-box-iconfont.css.bak +299 -0
- package/lib/assets/fonts/magic-box-iconfont.js +1 -0
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -0
- 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/icon/index.js +68 -0
- package/lib/assets/images/layout-icon/carouselLayout1.png +0 -0
- package/lib/assets/images/layout-icon/carouselLayout2.png +0 -0
- package/lib/assets/images/layout-icon/dividerLayout.svg +4 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout1.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout2.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-1.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3-1.svg +18 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3-2.svg +9 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p1.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p4.png +0 -0
- package/lib/assets/images/layout-icon/layout-search.png +0 -0
- package/lib/assets/images/layout-icon/newsletter.svg +7 -0
- package/lib/assets/less/button.less +9 -0
- package/lib/assets/less/common.less +82 -0
- package/lib/assets/less/cylon-antd.less +32534 -0
- package/lib/assets/less/font.less +50 -0
- package/lib/assets/less/global.less +8 -0
- package/lib/assets/less/index.less +11 -0
- package/lib/assets/less/input.less +8 -0
- package/lib/assets/less/menu.less +21 -0
- package/lib/assets/less/modal.less +16 -0
- package/lib/assets/less/select.less +19 -0
- package/lib/assets/less/slider.less +21 -0
- package/lib/assets/less/switch.less +20 -0
- package/lib/assets/less/table.less +40 -0
- package/lib/assets/less/variables.less +4 -0
- package/lib/common/AlignSelector/index.js +104 -0
- package/lib/common/AlignSelector/index.less +28 -0
- package/lib/common/Button/index.js +134 -0
- package/lib/common/Button/index.less +68 -0
- package/lib/common/ButtonIconLayout/index.js +103 -0
- package/lib/common/ButtonIconLayout/index.less +53 -0
- package/lib/common/Collapse/index.js +384 -0
- package/lib/common/Collapse/index.less +97 -0
- package/lib/common/ColorPicker/imgs/no-color.png +0 -0
- package/lib/common/ColorPicker/index.js +131 -0
- package/lib/common/ColorPicker/index.less +26 -0
- package/lib/common/ColorPickerInput/imgs/code.png +0 -0
- package/lib/common/ColorPickerInput/index.js +114 -0
- package/lib/common/ColorPickerInput/index.less +50 -0
- package/lib/common/CountDown/index.js +151 -0
- package/lib/common/CountDown/index.less +23 -0
- package/lib/common/Field/index.js +80 -0
- package/lib/common/Field/index.less +37 -0
- package/lib/common/FontStyles/index.js +178 -0
- package/lib/common/FontStyles/index.less +63 -0
- package/lib/common/GroupList/defaultImg.png +0 -0
- package/lib/common/GroupList/index.js +210 -0
- package/lib/common/GroupList/index.less +85 -0
- package/lib/common/IconPicker/index.js +147 -0
- package/lib/common/IconPicker/index.less +46 -0
- package/lib/common/Iconfont/index.js +148 -0
- package/lib/common/Iconfont/index.less +20 -0
- package/lib/common/ImageModal/CommonModal/const.js +22 -0
- package/lib/common/ImageModal/CommonModal/index.js +46 -0
- package/lib/common/ImageModal/CommonSelPicCard/index.js +80 -0
- package/lib/common/ImageModal/CommonSelPicCard/index.less +40 -0
- package/lib/common/ImageModal/const.js +24 -0
- package/lib/common/ImageModal/index.js +748 -0
- package/lib/common/ImageModal/index.less +21 -0
- package/lib/common/ImagePicker/index.js +162 -0
- package/lib/common/ImagePicker/index.less +104 -0
- package/lib/common/InputNumber/index.js +91 -0
- package/lib/common/InputNumber/index.less +33 -0
- package/lib/common/LayoutSelector/imgs/center.png +0 -0
- package/lib/common/LayoutSelector/imgs/left.png +0 -0
- package/lib/common/LayoutSelector/imgs/right.png +0 -0
- package/lib/common/LayoutSelector/index.js +111 -0
- package/lib/common/LayoutSelector/index.less +34 -0
- package/lib/common/LinkModal/CatgTable/index.js +234 -0
- package/lib/common/LinkModal/CouponTable/index.js +299 -0
- package/lib/common/LinkModal/CustomTable/index.js +227 -0
- package/lib/common/LinkModal/FilteredProductModal/index.js +640 -0
- package/lib/common/LinkModal/FilteredProductModal/index.less +113 -0
- package/lib/common/LinkModal/FunctionTable/index.js +221 -0
- package/lib/common/LinkModal/ProductDetailPage/index.js +433 -0
- package/lib/common/LinkModal/ProductDetailPage/index.less +21 -0
- package/lib/common/LinkModal/index.js +136 -0
- package/lib/common/LinkModal/index.less +108 -0
- package/lib/common/NewImg/index.js +165 -0
- package/lib/common/NewImg/index.less +0 -0
- package/lib/common/ProductModal/index.js +760 -0
- package/lib/common/ProductModal/index.less +238 -0
- package/lib/common/ProductSource/index.js +250 -0
- package/lib/common/ProductSource/index.less +12 -0
- package/lib/common/RcCollapse/Collapse.js +240 -0
- package/lib/common/RcCollapse/Panel.js +193 -0
- package/lib/common/RcCollapse/PanelContent.js +59 -0
- package/lib/common/RcCollapse/index.js +15 -0
- package/lib/common/RcCollapse/index.less +108 -0
- package/lib/common/RcCollapse/interface.js +1 -0
- package/lib/common/RcCollapse/motion.less +12 -0
- package/lib/common/RcCollapse/motionUtil.js +44 -0
- package/lib/common/Slider/index.js +151 -0
- package/lib/common/Slider/index.less +45 -0
- package/lib/common/SwitchCollapse/index.js +216 -0
- package/lib/common/SwitchCollapse/index.less +40 -0
- package/lib/common/UrlPicker/index.js +119 -0
- package/lib/common/UrlPicker/index.less +72 -0
- package/lib/common/index.js +127 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +268 -0
- package/lib/composite-comp/bol/components/Banner/imgs/banner.png +0 -0
- package/lib/composite-comp/bol/components/Banner/index.js +89 -0
- package/lib/composite-comp/bol/components/Banner/mobile/index.js +216 -0
- package/lib/composite-comp/bol/components/Banner/mobile/index.less +73 -0
- package/lib/composite-comp/bol/components/Banner/pc/index.js +278 -0
- package/lib/composite-comp/bol/components/Banner/pc/index.less +78 -0
- package/lib/composite-comp/bol/components/Button/defaultJSON.js +110 -0
- package/lib/composite-comp/bol/components/Button/index.js +103 -0
- package/lib/composite-comp/bol/components/Button/index.less +47 -0
- package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +292 -0
- package/lib/composite-comp/bol/components/Carousel/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/components/Carousel/index.js +93 -0
- package/lib/composite-comp/bol/components/Carousel/mobile/index.js +248 -0
- package/lib/composite-comp/bol/components/Carousel/mobile/index.less +81 -0
- package/lib/composite-comp/bol/components/Carousel/pc/index.js +254 -0
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +81 -0
- package/lib/composite-comp/bol/components/Divider/defaultJSON.js +47 -0
- package/lib/composite-comp/bol/components/Divider/index.js +101 -0
- package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +74 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/banner.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/index.js +84 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +83 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +73 -0
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +537 -0
- package/lib/composite-comp/bol/components/ImageText/index.js +88 -0
- package/lib/composite-comp/bol/components/ImageText/mobile/index.js +181 -0
- package/lib/composite-comp/bol/components/ImageText/mobile/index.less +284 -0
- package/lib/composite-comp/bol/components/ImageText/pc/index.js +155 -0
- package/lib/composite-comp/bol/components/ImageText/pc/index.less +106 -0
- package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +135 -0
- package/lib/composite-comp/bol/components/Newsletter/index.js +127 -0
- package/lib/composite-comp/bol/components/Newsletter/index.less +75 -0
- package/lib/composite-comp/bol/components/Tag/defaultJSON.js +112 -0
- package/lib/composite-comp/bol/components/Tag/index.js +107 -0
- package/lib/composite-comp/bol/components/Tag/index.less +34 -0
- package/lib/composite-comp/bol/components/Text/defaultJSON.js +149 -0
- package/lib/composite-comp/bol/components/Text/index.js +123 -0
- package/lib/composite-comp/bol/components/Text/index.less +60 -0
- package/lib/composite-comp/bol/components/Text/slice.svg +1 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +126 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +225 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/index.js +46 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout2.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +67 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +144 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.js +199 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +67 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.js +98 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerContentSetting/index.js +177 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerSpacingSetting/index.js +89 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +144 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +126 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +196 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/InputField/index.js +185 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +111 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +109 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout2.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +61 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +138 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/index.js +69 -0
- package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +151 -0
- package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.less +3 -0
- package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +164 -0
- package/lib/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +82 -0
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +141 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.less +0 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/index.js +90 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/index.less +3 -0
- package/lib/composite-comp/common/components/ImageLabel/index.js +90 -0
- package/lib/composite-comp/common/components/ImageLabel/index.less +35 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +191 -0
- package/lib/composite-comp/common/components/ProductItem/index.less +121 -0
- package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +109 -0
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +202 -0
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.less +21 -0
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +154 -0
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.less +17 -0
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +183 -0
- package/lib/composite-comp/dito/components/FlashDeal/index.js +86 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +436 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +94 -0
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +220 -0
- package/lib/composite-comp/dito/components/Recommend/index.js +86 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +530 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +79 -0
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +56 -0
- package/lib/composite-comp/dito/components/SearchBar/imgs/dito-logo.svg +6 -0
- package/lib/composite-comp/dito/components/SearchBar/index.js +86 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +108 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +38 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +143 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +125 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +62 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +118 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +143 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +62 -0
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +138 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +185 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +3 -0
- package/lib/constants/component-types.js +87 -0
- package/lib/constants/index.js +144 -0
- package/lib/constants/layout.js +120 -0
- package/lib/core/Designer/CompListPanel/CompCard/index.js +42 -0
- package/lib/core/Designer/CompListPanel/CompCard/index.less +69 -0
- package/lib/core/Designer/CompListPanel/index.js +156 -0
- package/lib/core/Designer/CompListPanel/index.less +69 -0
- package/lib/core/Designer/ConfigPanel/index.js +294 -0
- package/lib/core/Designer/ConfigPanel/index.less +139 -0
- package/lib/core/Designer/History/index.js +91 -0
- package/lib/core/Designer/PageCompList/index.js +266 -0
- package/lib/core/Designer/PageCompList/index.less +114 -0
- package/lib/core/Designer/QuickMenuBar/index.js +176 -0
- package/lib/core/Designer/QuickMenuBar/index.less +67 -0
- package/lib/core/Designer/ViewArea/index.js +150 -0
- package/lib/core/Designer/ViewArea/index.less +53 -0
- package/lib/core/Designer/index.js +454 -0
- package/lib/core/Designer/index.less +6 -0
- package/lib/core/Renderer/index.js +82 -0
- package/lib/decorator/compositeDecorator.js +129 -0
- package/lib/decorator/index.js +23 -0
- package/lib/decorator/metaDecorator.js +199 -0
- package/lib/index.js +27 -0
- package/lib/meta-comp/components/Button/index.js +185 -0
- package/lib/meta-comp/components/Button/index.less +19 -0
- package/lib/meta-comp/components/Image/index.js +171 -0
- package/lib/meta-comp/components/Image/index.less +18 -0
- package/lib/meta-comp/components/Text/index.js +470 -0
- package/lib/meta-comp/components/Text/index.less +38 -0
- package/lib/meta-comp/components/index.js +31 -0
- package/lib/meta-comp/config-panels/BaseConfig.js +87 -0
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +349 -0
- package/lib/meta-comp/config-panels/ButtonConfig/index.less +4 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +204 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.less +16 -0
- package/lib/meta-comp/config-panels/TextConfig/index.js +327 -0
- package/lib/meta-comp/config-panels/TextConfig/index.less +24 -0
- package/lib/mobx/Store.js +93 -0
- package/lib/mobx/index.js +36 -0
- package/lib/utils/androidUtil.js +113 -0
- package/lib/utils/businessUtil.js +235 -0
- package/lib/utils/commonUtil.js +269 -0
- package/lib/utils/compJsonUtil.js +240 -0
- package/lib/utils/coreUtil.js +156 -0
- package/lib/utils/currencyUtil.js +190 -0
- package/lib/utils/dataTreeUtils.js +105 -0
- package/lib/utils/dateUtil.js +70 -0
- package/lib/utils/storeUtil.js +258 -0
- package/package.json +68 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.initMap = exports.getTextInitJson = exports.getBannerNodeJson = exports.getBannerJson = void 0;
|
|
7
|
+
|
|
8
|
+
var _uuid = require("uuid");
|
|
9
|
+
|
|
10
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
11
|
+
__assign = Object.assign || function (t) {
|
|
12
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
13
|
+
s = arguments[i];
|
|
14
|
+
|
|
15
|
+
for (var p in s) {
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return __assign.apply(this, arguments);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 获取 text 元组件json
|
|
28
|
+
*/
|
|
29
|
+
var getMetaTextJson = function getMetaTextJson() {
|
|
30
|
+
return {
|
|
31
|
+
open: false,
|
|
32
|
+
type: 'TEXT',
|
|
33
|
+
text: 'Title',
|
|
34
|
+
specialContent: [],
|
|
35
|
+
content: {
|
|
36
|
+
fontFamily: '',
|
|
37
|
+
size: '',
|
|
38
|
+
fontSize: '',
|
|
39
|
+
width: ''
|
|
40
|
+
},
|
|
41
|
+
underline: {
|
|
42
|
+
open: false,
|
|
43
|
+
borderBottomColor: '',
|
|
44
|
+
borderBottomStyle: '',
|
|
45
|
+
borderBottomWidth: ''
|
|
46
|
+
},
|
|
47
|
+
vertical: {
|
|
48
|
+
open: false,
|
|
49
|
+
lineHeight: ''
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* 获取 image 元组件json
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
var getMetaImageJson = function getMetaImageJson() {
|
|
60
|
+
return {
|
|
61
|
+
open: true,
|
|
62
|
+
type: 'IMAGE',
|
|
63
|
+
content: {
|
|
64
|
+
pcImgSrc: '',
|
|
65
|
+
h5ImgSrc: '',
|
|
66
|
+
name: 'image name',
|
|
67
|
+
clickUrl: ''
|
|
68
|
+
},
|
|
69
|
+
hover: {
|
|
70
|
+
open: false,
|
|
71
|
+
backgroundType: 'enlarge',
|
|
72
|
+
magnification: 1,
|
|
73
|
+
pcImgHoverUrl: '',
|
|
74
|
+
h5ImgHoverUrl: ''
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* 获取 button 元组件json
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
var getMetaButtonJson = function getMetaButtonJson() {
|
|
85
|
+
return {
|
|
86
|
+
open: false,
|
|
87
|
+
type: 'BUTTON',
|
|
88
|
+
name: 'Button',
|
|
89
|
+
text: 'Button',
|
|
90
|
+
content: {
|
|
91
|
+
url: '',
|
|
92
|
+
backgroundColor: '#2F54EB'
|
|
93
|
+
},
|
|
94
|
+
buttonText: {
|
|
95
|
+
fontFamily: 'st',
|
|
96
|
+
fontStyles: {
|
|
97
|
+
fontStyle: 'normal',
|
|
98
|
+
color: '#fff',
|
|
99
|
+
textAlign: 'left'
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
buttonBorder: {
|
|
103
|
+
open: false,
|
|
104
|
+
borderColor: '',
|
|
105
|
+
borderRadius: 0
|
|
106
|
+
},
|
|
107
|
+
buttonIcon: {
|
|
108
|
+
iconUrl: '',
|
|
109
|
+
layout: 'right'
|
|
110
|
+
},
|
|
111
|
+
hover: {
|
|
112
|
+
open: false,
|
|
113
|
+
content: {
|
|
114
|
+
backgroundColor: '#051c7b'
|
|
115
|
+
},
|
|
116
|
+
buttonText: {
|
|
117
|
+
fontFamily: 'st',
|
|
118
|
+
fontStyles: {
|
|
119
|
+
fontStyle: 'normal',
|
|
120
|
+
color: '#fff',
|
|
121
|
+
textAlign: 'left'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
buttonBorder: {
|
|
125
|
+
open: false,
|
|
126
|
+
borderColor: '',
|
|
127
|
+
borderRadius: 0
|
|
128
|
+
},
|
|
129
|
+
buttonIcon: {
|
|
130
|
+
iconUrl: '',
|
|
131
|
+
layout: 'right'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* 获取banner组件的初始化json
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
var getBannerJson = function getBannerJson() {
|
|
142
|
+
return {
|
|
143
|
+
id: (0, _uuid.v4)(),
|
|
144
|
+
type: 'BANNER',
|
|
145
|
+
setting: {
|
|
146
|
+
// 自动轮播
|
|
147
|
+
autoplay: {
|
|
148
|
+
open: false,
|
|
149
|
+
interval: 4
|
|
150
|
+
},
|
|
151
|
+
// 切换按钮
|
|
152
|
+
navigation: {
|
|
153
|
+
open: false,
|
|
154
|
+
size: 16,
|
|
155
|
+
hoverSize: 16,
|
|
156
|
+
color: '#384966',
|
|
157
|
+
hoverColor: '#384966'
|
|
158
|
+
},
|
|
159
|
+
// 面板指示点
|
|
160
|
+
dots: {
|
|
161
|
+
open: false,
|
|
162
|
+
color: '#ff',
|
|
163
|
+
hoverColor: '#fff',
|
|
164
|
+
size: 16,
|
|
165
|
+
hoverSize: 16
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
groupSource: []
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* 获取banner组件节点json, 用于存入banner 的 groupSource中
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
exports.getBannerJson = getBannerJson;
|
|
177
|
+
|
|
178
|
+
var getBannerNodeJson = function getBannerNodeJson() {
|
|
179
|
+
return {
|
|
180
|
+
id: (0, _uuid.v4)(),
|
|
181
|
+
image: __assign({}, getMetaImageJson()),
|
|
182
|
+
title: __assign({}, getMetaTextJson()),
|
|
183
|
+
text: __assign({}, getMetaTextJson()),
|
|
184
|
+
button: __assign({}, getMetaButtonJson()),
|
|
185
|
+
secondButton: __assign({}, getMetaButtonJson()),
|
|
186
|
+
customize: {
|
|
187
|
+
layout: 1,
|
|
188
|
+
align: 'left'
|
|
189
|
+
},
|
|
190
|
+
background: {
|
|
191
|
+
opacity: 100,
|
|
192
|
+
color: '#232F46',
|
|
193
|
+
image: ''
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* 获取text组件的初始化json
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
exports.getBannerNodeJson = getBannerNodeJson;
|
|
203
|
+
|
|
204
|
+
var getTextInitJson = function getTextInitJson() {
|
|
205
|
+
return {
|
|
206
|
+
id: (0, _uuid.v4)(),
|
|
207
|
+
type: 'TEXT',
|
|
208
|
+
setting: {
|
|
209
|
+
layout: 'left',
|
|
210
|
+
title: __assign({
|
|
211
|
+
open: false,
|
|
212
|
+
type: 'TEXT'
|
|
213
|
+
}, getMetaTextJson()),
|
|
214
|
+
subtitle: __assign({
|
|
215
|
+
open: false,
|
|
216
|
+
type: 'TEXT'
|
|
217
|
+
}, getMetaTextJson())
|
|
218
|
+
},
|
|
219
|
+
source: [{
|
|
220
|
+
title: {
|
|
221
|
+
type: 'TEXT'
|
|
222
|
+
},
|
|
223
|
+
content: {
|
|
224
|
+
type: 'TEXT'
|
|
225
|
+
}
|
|
226
|
+
}],
|
|
227
|
+
style: {
|
|
228
|
+
align: 'left',
|
|
229
|
+
backgroundColor: 'red',
|
|
230
|
+
backgroundImage: '../image.png'
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
exports.getTextInitJson = getTextInitJson;
|
|
236
|
+
var initMap = {
|
|
237
|
+
TEXT: getTextInitJson,
|
|
238
|
+
BANNER: getBannerJson
|
|
239
|
+
};
|
|
240
|
+
exports.initMap = initMap;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.copyNode = exports.clickUrl = void 0;
|
|
7
|
+
|
|
8
|
+
var _uuid = require("uuid");
|
|
9
|
+
|
|
10
|
+
var _businessUtil = require("./businessUtil");
|
|
11
|
+
|
|
12
|
+
var _commonUtil = require("./commonUtil");
|
|
13
|
+
|
|
14
|
+
var _androidUtil = require("./androidUtil");
|
|
15
|
+
|
|
16
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
17
|
+
|
|
18
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
19
|
+
__assign = Object.assign || function (t) {
|
|
20
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
+
s = arguments[i];
|
|
22
|
+
|
|
23
|
+
for (var p in s) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return __assign.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var _this = void 0;
|
|
35
|
+
|
|
36
|
+
var isDesignMode = function isDesignMode() {
|
|
37
|
+
return window.magicDesign.mode === 'designer';
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.isDesignMode = isDesignMode;
|
|
41
|
+
|
|
42
|
+
var isPc = function isPc() {
|
|
43
|
+
return window.magicDesign.device === 'pc';
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.isPc = isPc;
|
|
47
|
+
|
|
48
|
+
var setMagicDesign = function setMagicDesign(magicDesignObj) {
|
|
49
|
+
window.magicDesign = __assign(__assign({}, window.magicDesign), magicDesignObj);
|
|
50
|
+
};
|
|
51
|
+
/** 刷新预览区域 */
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
exports.setMagicDesign = setMagicDesign;
|
|
55
|
+
|
|
56
|
+
var renderPreview = function renderPreview() {
|
|
57
|
+
var evt = new Event('render-view', {
|
|
58
|
+
bubbles: false
|
|
59
|
+
});
|
|
60
|
+
window.document.dispatchEvent(evt);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.renderPreview = renderPreview;
|
|
64
|
+
|
|
65
|
+
var clickUrl = function clickUrl(url) {
|
|
66
|
+
console.log('url', url);
|
|
67
|
+
|
|
68
|
+
if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var _a = (0, _businessUtil.parseUrl)(url),
|
|
73
|
+
h5Link = _a.h5Link,
|
|
74
|
+
pcLink = _a.pcLink,
|
|
75
|
+
params = _a.params;
|
|
76
|
+
|
|
77
|
+
var type = params.type,
|
|
78
|
+
data = params.data; // 领取优惠券
|
|
79
|
+
|
|
80
|
+
if (type === 'GET_COUPON') {
|
|
81
|
+
_this.getCoupon(data.couponId);
|
|
82
|
+
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!(0, _androidUtil.browserVersion)().isApp) {
|
|
87
|
+
if (url.startsWith('/')) {
|
|
88
|
+
(0, _commonUtil.navigateTo)(url);
|
|
89
|
+
} else {
|
|
90
|
+
location.href = url;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if ((0, _androidUtil.browserVersion)().android) {
|
|
97
|
+
sendToAndroid({
|
|
98
|
+
type: 'jump',
|
|
99
|
+
params: {
|
|
100
|
+
url: h5Link
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
} else if ((0, _androidUtil.browserVersion)().ios) {
|
|
104
|
+
if (type === 'CUSTOMIZED') {
|
|
105
|
+
// 适配ios 从首页跳转自定义页面
|
|
106
|
+
_this.goH5Page(h5Link);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
sendToIos(params);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.clickUrl = clickUrl;
|
|
114
|
+
|
|
115
|
+
function isObject(value) {
|
|
116
|
+
var type = _typeof(value);
|
|
117
|
+
|
|
118
|
+
return value != null && (type === 'object' || type === 'function');
|
|
119
|
+
} // 拷贝节点方法,重新生成节点中的id和parentId字段
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
var copyNode = function copyNode(value, parentId) {
|
|
123
|
+
if (!isObject(value)) {
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var isArr = Array.isArray(value);
|
|
128
|
+
|
|
129
|
+
if (isArr) {
|
|
130
|
+
var newArray_1 = [];
|
|
131
|
+
value.forEach(function (data) {
|
|
132
|
+
newArray_1.push(copyNode(data));
|
|
133
|
+
});
|
|
134
|
+
return newArray_1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var newNode = {};
|
|
138
|
+
|
|
139
|
+
if (value.id) {
|
|
140
|
+
newNode.id = (0, _uuid.v4)();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var names = Object.getOwnPropertyNames(value);
|
|
144
|
+
names.forEach(function (name) {
|
|
145
|
+
if (name === 'id') return;
|
|
146
|
+
|
|
147
|
+
if (name === 'parentId') {
|
|
148
|
+
newNode.parentId = parentId;
|
|
149
|
+
} else {
|
|
150
|
+
newNode[name] = copyNode(value[name], newNode.id);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return newNode;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
exports.copyNode = copyNode;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
|
|
7
|
+
|
|
8
|
+
var _divide = _interopRequireDefault(require("lodash/divide"));
|
|
9
|
+
|
|
10
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
11
|
+
|
|
12
|
+
var _commonUtil = require("./commonUtil");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
/* eslint-disable */
|
|
17
|
+
var precision = (0, _commonUtil.ensure)(function () {
|
|
18
|
+
return window.ecommerce.precision;
|
|
19
|
+
}, '0'); // 千分位展示
|
|
20
|
+
|
|
21
|
+
var addSeparators = function addSeparators(nStr, thousandsSep, decimalSep) {
|
|
22
|
+
if (!Number(nStr)) {
|
|
23
|
+
return nStr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var x1;
|
|
27
|
+
var x2;
|
|
28
|
+
nStr += '';
|
|
29
|
+
var x = nStr.split('.');
|
|
30
|
+
x1 = x[0];
|
|
31
|
+
x2 = x.length > 1 ? decimalSep + x[1] : '';
|
|
32
|
+
var rgx = /(\d+)(\d{3})/;
|
|
33
|
+
|
|
34
|
+
while (rgx.test(x1)) {
|
|
35
|
+
x1 = x1.replace(rgx, "$1" + thousandsSep + "$2");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return x1 + x2;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.addSeparators = addSeparators;
|
|
42
|
+
|
|
43
|
+
var getPricePrefix = function getPricePrefix() {
|
|
44
|
+
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
45
|
+
return window.ecommerce.prefix;
|
|
46
|
+
}, 'Rp');
|
|
47
|
+
return pricePrefix;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.getPricePrefix = getPricePrefix;
|
|
51
|
+
|
|
52
|
+
var getPrecision = function getPrecision() {
|
|
53
|
+
var ret = (0, _commonUtil.ensure)(function () {
|
|
54
|
+
return window.ecommerce.precision;
|
|
55
|
+
}, '0');
|
|
56
|
+
return Number(ret);
|
|
57
|
+
}; // 格式化金额
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
exports.getPrecision = getPrecision;
|
|
61
|
+
|
|
62
|
+
var formatCurrency = function formatCurrency(num) {
|
|
63
|
+
var displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
64
|
+
return window.ecommerce.displayCurrencyPrecision;
|
|
65
|
+
}, '0');
|
|
66
|
+
var precision = (0, _commonUtil.ensure)(function () {
|
|
67
|
+
return window.ecommerce.precision;
|
|
68
|
+
}, '0');
|
|
69
|
+
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
70
|
+
return window.ecommerce.prefix;
|
|
71
|
+
}, 'Rp');
|
|
72
|
+
var numVal = num;
|
|
73
|
+
|
|
74
|
+
if (Number.isNaN(num) || !Number.isFinite(num)) {
|
|
75
|
+
numVal = 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var displayNum = displayPrecision != null && displayPrecision !== '' ? displayPrecision : precision;
|
|
79
|
+
var ret = numVal / Math.pow(10, precision);
|
|
80
|
+
return addSeparators(ret.toFixed(displayNum), pricePrefix === "IDR" || pricePrefix === "Rp" ? '.' : ',', '.');
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.formatCurrency = formatCurrency;
|
|
84
|
+
|
|
85
|
+
var formatCurrencyWithSymbol = function formatCurrencyWithSymbol(num) {
|
|
86
|
+
var ret = formatCurrency(num);
|
|
87
|
+
return getPricePrefix() + " " + ret;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* TODO 未兼容科学计数法(小数点后7位)
|
|
91
|
+
* 计算浮点位数
|
|
92
|
+
* @param {*} number 数字
|
|
93
|
+
* @returns count
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
exports.formatCurrencyWithSymbol = formatCurrencyWithSymbol;
|
|
98
|
+
|
|
99
|
+
var calcFloatCount = function calcFloatCount(number) {
|
|
100
|
+
var numbString = String(number);
|
|
101
|
+
var findIndex = numbString.indexOf('.');
|
|
102
|
+
if (findIndex === -1) return 0;
|
|
103
|
+
return numbString.length - findIndex - 1;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* 保留小数位
|
|
107
|
+
* @param {number} number 数字
|
|
108
|
+
* @param {int?} precision 位数 默认:2
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
exports.calcFloatCount = calcFloatCount;
|
|
113
|
+
|
|
114
|
+
var numberToFixed = function numberToFixed(numb, precision) {
|
|
115
|
+
if (precision === void 0) {
|
|
116
|
+
precision = 2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var multiple = Math.pow(10, precision);
|
|
120
|
+
var floatCount = calcFloatCount(numb);
|
|
121
|
+
|
|
122
|
+
if (floatCount <= precision) {
|
|
123
|
+
if (floatCount === 0) {
|
|
124
|
+
if (precision <= 0) {
|
|
125
|
+
return "" + String(~~numb);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return String(~~numb) + "." + new Array(precision - floatCount).fill('0').join('');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return String(numb) + new Array(precision - floatCount).fill('0').join('');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var bigMultiple = multiple * 10;
|
|
135
|
+
var tempNumb = ~~(numb * bigMultiple);
|
|
136
|
+
var lastNumber = String(tempNumb).slice(-1);
|
|
137
|
+
var resultNumber = ~~(numb * multiple);
|
|
138
|
+
if (~~lastNumber >= 5) resultNumber += 1;
|
|
139
|
+
var result = resultNumber / multiple;
|
|
140
|
+
var resultFloatCount = calcFloatCount(result);
|
|
141
|
+
return result + new Array(precision - resultFloatCount).fill('0').join('');
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* 格式化数值,不加前缀 (前台使用) 例如:缩小100倍
|
|
145
|
+
* @param {*} value 数值
|
|
146
|
+
* @param {*} customPrecision 精度转换,默认读配置项
|
|
147
|
+
* @param {*} customDisplayPrecision 保留小数位数,默认读配置项(传null,表示不作处理只转换精度)
|
|
148
|
+
* @returns 格式化后的数值字符串
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
exports.numberToFixed = numberToFixed;
|
|
153
|
+
|
|
154
|
+
var currencyToFont = function currencyToFont(value, customPrecision, customDisplayPrecision) {
|
|
155
|
+
if (value === null || value === undefined || value === '' || Number.isNaN(Number(value))) {
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
var precision; // 优先使用参数上的精度
|
|
160
|
+
|
|
161
|
+
if (!(0, _isEmpty["default"])(customPrecision) && !Number.isNaN(Number(customPrecision))) {
|
|
162
|
+
precision = Number(customPrecision);
|
|
163
|
+
} else {
|
|
164
|
+
precision = (0, _commonUtil.ensure)(function () {
|
|
165
|
+
return window.ecommerce.precision;
|
|
166
|
+
}, '0');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var number = Number(value);
|
|
170
|
+
var temp = (0, _divide["default"])(number, Math.pow(10, precision)); // 特殊处理,不需要格式化小数位
|
|
171
|
+
|
|
172
|
+
if (customDisplayPrecision === null) {
|
|
173
|
+
return "" + temp;
|
|
174
|
+
} // 精度格式化
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
var displayPrecision; // 优先使用参数上的精度
|
|
178
|
+
|
|
179
|
+
if (!(0, _isEmpty["default"])(customDisplayPrecision) && !Number.isNaN(Number(customDisplayPrecision))) {
|
|
180
|
+
displayPrecision = Number(customDisplayPrecision);
|
|
181
|
+
} else {
|
|
182
|
+
displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
183
|
+
return window.ecommerce.displayCurrencyPrecision;
|
|
184
|
+
}, 'Rp');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return temp.toFixed(Number(displayPrecision));
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
exports.currencyToFont = currencyToFont;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
|
+
|
|
10
|
+
var _isObject = _interopRequireDefault(require("lodash/isObject"));
|
|
11
|
+
|
|
12
|
+
var _mapKeys = _interopRequireDefault(require("lodash/mapKeys"));
|
|
13
|
+
|
|
14
|
+
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 处理树相关的工具
|
|
22
|
+
*/
|
|
23
|
+
var _default = {
|
|
24
|
+
/** 将一维数组转换为树结构 */
|
|
25
|
+
translateDataToTree: function translateDataToTree(jsonData, id, pid, mapProps) {
|
|
26
|
+
var newData = (0, _cloneDeep["default"])(jsonData);
|
|
27
|
+
var result = [];
|
|
28
|
+
var temp = {};
|
|
29
|
+
|
|
30
|
+
for (var i = 0; i < newData.length; i += 1) {
|
|
31
|
+
temp[newData[i][id]] = newData[i]; // 以id作为索引存储元素,可以无需遍历直接定位元素
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var _loop_1 = function _loop_1(j) {
|
|
35
|
+
var currentElement = newData[j]; // 添加需要的属性
|
|
36
|
+
|
|
37
|
+
if (mapProps && (0, _isObject["default"])(mapProps) && !(0, _isEmpty["default"])(mapProps)) {
|
|
38
|
+
(0, _mapKeys["default"])(mapProps, function (value, key) {
|
|
39
|
+
currentElement[key] = currentElement[value];
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var tempCurrentElementParent = temp[currentElement[pid]]; // 临时变量里面的当前元素的父元素
|
|
44
|
+
|
|
45
|
+
if (tempCurrentElementParent) {
|
|
46
|
+
// 如果存在父元素
|
|
47
|
+
if (!tempCurrentElementParent.children) {
|
|
48
|
+
// 如果父元素没有chindren键
|
|
49
|
+
tempCurrentElementParent.children = []; // 设上父元素的children键
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
tempCurrentElementParent.children.push(currentElement); // 给父元素加上当前元素作为子元素
|
|
53
|
+
} else {
|
|
54
|
+
// 不存在父元素,意味着当前元素是一级元素
|
|
55
|
+
result.push(currentElement);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
for (var j = 0; j < newData.length; j += 1) {
|
|
60
|
+
_loop_1(j);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return result;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* jsonData 输入数据
|
|
68
|
+
* 需要查找的id
|
|
69
|
+
* pk 主键的名称
|
|
70
|
+
* childKeys返回值
|
|
71
|
+
*/
|
|
72
|
+
findChildKeys: function findChildKeys(jsonData, id, pk, childKeys) {
|
|
73
|
+
var target = {};
|
|
74
|
+
this.dsFilter(jsonData, id, pk, target);
|
|
75
|
+
|
|
76
|
+
if (target && JSON.stringify(target) !== '{}') {
|
|
77
|
+
childKeys.push(target[pk]);
|
|
78
|
+
|
|
79
|
+
if (target.children && target.children.length) {
|
|
80
|
+
this.getChildKey(target.children, pk, childKeys);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
dsFilter: function dsFilter(dealData, id, pk, target) {
|
|
85
|
+
for (var i = 0; i < dealData.length; i += 1) {
|
|
86
|
+
if (dealData[i].children && dealData[i].children.length) {
|
|
87
|
+
this.dsFilter(dealData[i].children, id, pk, target);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (dealData[i][pk] === id) {
|
|
91
|
+
_extends(target, dealData[i]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
getChildKey: function getChildKey(dealData, pk, childKeys) {
|
|
96
|
+
for (var i = 0; i < dealData.length; i += 1) {
|
|
97
|
+
if (dealData[i].children && dealData[i].children.length) {
|
|
98
|
+
this.getChildKey(dealData[i].children, pk, childKeys);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
childKeys.push(dealData[i][pk]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
exports["default"] = _default;
|