@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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _componentTypes = require("../../constants/component-types");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
15
|
+
__assign = Object.assign || function (t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
|
|
19
|
+
for (var p in s) {
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return __assign.apply(this, arguments);
|
|
28
|
+
};
|
|
29
|
+
/* eslint-disable consistent-return */
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var setDesignConfig = function setDesignConfig(props) {
|
|
33
|
+
var config = props.config,
|
|
34
|
+
device = props.device,
|
|
35
|
+
isShop = props.isShop;
|
|
36
|
+
window.magicDesign = __assign({
|
|
37
|
+
pageBackground: '#f2f2f2',
|
|
38
|
+
compSpacing: '16',
|
|
39
|
+
mode: 'renderer',
|
|
40
|
+
device: device,
|
|
41
|
+
isShop: isShop
|
|
42
|
+
}, config);
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @class Renderer 页面预览器,外部工程使用此类来渲染出页面。
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
var Renderer = function Renderer(props) {
|
|
50
|
+
var pageData = props.pageData;
|
|
51
|
+
setDesignConfig(props);
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
className: "render_wrap",
|
|
54
|
+
magic_design: "",
|
|
55
|
+
style: {
|
|
56
|
+
background: window.magicDesign.pageBackground
|
|
57
|
+
}
|
|
58
|
+
}, pageData && pageData.childNodes && pageData.childNodes.map(function (nodeData) {
|
|
59
|
+
var Clazz = _componentTypes.componentMap[nodeData.type];
|
|
60
|
+
|
|
61
|
+
if (!Clazz) {
|
|
62
|
+
console.error("[MagicBox] Can not find type " + nodeData.type);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var newInstanceProps = __assign(__assign({}, nodeData), {
|
|
67
|
+
nodeData: nodeData
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
+
key: nodeData.id
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(Clazz, __assign({}, newInstanceProps), null));
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
Renderer.defaultProps = {
|
|
77
|
+
pageData: {},
|
|
78
|
+
device: 'pc',
|
|
79
|
+
config: {}
|
|
80
|
+
};
|
|
81
|
+
var _default = Renderer;
|
|
82
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = compositeDecorator;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _mobx = require("../mobx");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
19
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
20
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
21
|
+
__proto__: []
|
|
22
|
+
} instanceof Array && function (d, b) {
|
|
23
|
+
d.__proto__ = b;
|
|
24
|
+
} || function (d, b) {
|
|
25
|
+
for (var p in b) {
|
|
26
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return _extendStatics(d, b);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return function (d, b) {
|
|
34
|
+
_extendStatics(d, b);
|
|
35
|
+
|
|
36
|
+
function __() {
|
|
37
|
+
this.constructor = d;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
41
|
+
};
|
|
42
|
+
}();
|
|
43
|
+
|
|
44
|
+
function compositeDecorator(WrappedComponent) {
|
|
45
|
+
var Wrapper =
|
|
46
|
+
/** @class */
|
|
47
|
+
function (_super) {
|
|
48
|
+
__extends(Wrapper, _super);
|
|
49
|
+
|
|
50
|
+
function Wrapper() {
|
|
51
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
52
|
+
|
|
53
|
+
_this.state = {
|
|
54
|
+
clickedFloor: ''
|
|
55
|
+
}; // 复合组件点击事件
|
|
56
|
+
|
|
57
|
+
_this.onCompositeCompClick = function (event) {
|
|
58
|
+
// 触发左侧楼层的滚动
|
|
59
|
+
if (document.getElementById("card" + _this.props.nodeData.id)) {
|
|
60
|
+
document.getElementById("card" + _this.props.nodeData.id).scrollIntoView({
|
|
61
|
+
behavior: 'smooth'
|
|
62
|
+
});
|
|
63
|
+
} // 这里必须阻止事件冒泡,然后再触发自定义的事件
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
event.stopPropagation(); // 触发点击组件事件
|
|
68
|
+
|
|
69
|
+
var evt = new Event('component-click', {
|
|
70
|
+
bubbles: false
|
|
71
|
+
});
|
|
72
|
+
evt.data = _this.props.nodeData;
|
|
73
|
+
window.document.dispatchEvent(evt);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
_this.getStyle = function () {
|
|
77
|
+
var style = {
|
|
78
|
+
border: 'none'
|
|
79
|
+
}; // 处理复合组件的选中状态
|
|
80
|
+
|
|
81
|
+
if (window.magicDesign.mode === 'designer') {
|
|
82
|
+
style.border = '1px solid transparent';
|
|
83
|
+
|
|
84
|
+
if (_this.props.nodeData.id === _this.state.clickedFloor) {
|
|
85
|
+
style.border = '1px dashed red';
|
|
86
|
+
}
|
|
87
|
+
} // 处理复合组件的下边距
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if (Wrapper.type !== 'DIVIDER') {
|
|
91
|
+
var rate = window.magicDesign.device === 'pc' ? 1.5 : 1;
|
|
92
|
+
style.marginBottom = Number(window.magicDesign.compSpacing) * rate + "px";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return style;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return _this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Wrapper.prototype.componentDidMount = function () {
|
|
102
|
+
var _this = this;
|
|
103
|
+
|
|
104
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
105
|
+
_this.setState({
|
|
106
|
+
clickedFloor: _mobx.store.clickedFloor
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
Wrapper.prototype.componentWillUnmount = function () {
|
|
112
|
+
this.distroy();
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
Wrapper.prototype.render = function () {
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
117
|
+
className: "composite_wrap",
|
|
118
|
+
onClick: this.onCompositeCompClick,
|
|
119
|
+
style: this.getStyle()
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
Wrapper.getDefaultJSON = WrappedComponent.getDefaultJSON;
|
|
124
|
+
Wrapper.type = WrappedComponent.type;
|
|
125
|
+
return Wrapper;
|
|
126
|
+
}(_react.Component);
|
|
127
|
+
|
|
128
|
+
return Wrapper;
|
|
129
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "compositeDecorator", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _compositeDecorator["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "metaDecorator", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _metaDecorator["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _compositeDecorator = _interopRequireDefault(require("./compositeDecorator"));
|
|
20
|
+
|
|
21
|
+
var _metaDecorator = _interopRequireDefault(require("./metaDecorator"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = metaDecorator;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _mobx = require("../mobx");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
19
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
20
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
21
|
+
__proto__: []
|
|
22
|
+
} instanceof Array && function (d, b) {
|
|
23
|
+
d.__proto__ = b;
|
|
24
|
+
} || function (d, b) {
|
|
25
|
+
for (var p in b) {
|
|
26
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return _extendStatics(d, b);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return function (d, b) {
|
|
34
|
+
_extendStatics(d, b);
|
|
35
|
+
|
|
36
|
+
function __() {
|
|
37
|
+
this.constructor = d;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
41
|
+
};
|
|
42
|
+
}();
|
|
43
|
+
|
|
44
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
45
|
+
var t = {};
|
|
46
|
+
|
|
47
|
+
for (var p in s) {
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function metaDecorator(WrappedComponent) {
|
|
58
|
+
var Wrapper =
|
|
59
|
+
/** @class */
|
|
60
|
+
function (_super) {
|
|
61
|
+
__extends(Wrapper, _super);
|
|
62
|
+
|
|
63
|
+
function Wrapper() {
|
|
64
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
|
|
66
|
+
_this.state = {
|
|
67
|
+
clickedMeta: '',
|
|
68
|
+
hoveredMeta: ''
|
|
69
|
+
}; // 元组件点击事件
|
|
70
|
+
|
|
71
|
+
_this.onMetaClick = function (event) {
|
|
72
|
+
var _a, _b, _c;
|
|
73
|
+
|
|
74
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
75
|
+
return;
|
|
76
|
+
} // 组织冒泡
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
var parentId = (_a = _this.props.data) === null || _a === void 0 ? void 0 : _a.parentId;
|
|
82
|
+
var metaId = (_b = _this.props.data) === null || _b === void 0 ? void 0 : _b.id;
|
|
83
|
+
var floorId = null; // group中的元组件
|
|
84
|
+
|
|
85
|
+
if (parentId) {
|
|
86
|
+
floorId = _mobx.store.getFloorIdByGroupId(parentId);
|
|
87
|
+
} else {
|
|
88
|
+
// 复合组件中的元组件
|
|
89
|
+
floorId = _mobx.store.getFloorIdByMetaId(metaId);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
_mobx.store.setState({
|
|
93
|
+
clickedMeta: (_c = _this.props.data) === null || _c === void 0 ? void 0 : _c.id,
|
|
94
|
+
clickedGroup: parentId,
|
|
95
|
+
clickedFloor: floorId
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
_this.onMouseEnter = function () {
|
|
100
|
+
var _a;
|
|
101
|
+
|
|
102
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
_mobx.store.setState({
|
|
107
|
+
hoveredMeta: (_a = _this.props.data) === null || _a === void 0 ? void 0 : _a.id
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
_this.onMouseLeave = function () {
|
|
112
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_mobx.store.setState({
|
|
117
|
+
hoveredMeta: ''
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
_this.isDesignerActive = function () {
|
|
122
|
+
var data = _this.props.data;
|
|
123
|
+
var _a = _this.state,
|
|
124
|
+
hoveredMeta = _a.hoveredMeta,
|
|
125
|
+
clickedMeta = _a.clickedMeta;
|
|
126
|
+
var isHover = (data === null || data === void 0 ? void 0 : data.id) === hoveredMeta;
|
|
127
|
+
var isClick = (data === null || data === void 0 ? void 0 : data.id) === clickedMeta;
|
|
128
|
+
|
|
129
|
+
if (window.magicDesign.mode === 'designer' && (isHover || isClick)) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return false;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
_this.getStyle = function () {
|
|
137
|
+
var _a = _this.state,
|
|
138
|
+
hoveredMeta = _a.hoveredMeta,
|
|
139
|
+
clickedMeta = _a.clickedMeta;
|
|
140
|
+
var data = _this.props.data;
|
|
141
|
+
var isHover = (data === null || data === void 0 ? void 0 : data.id) === hoveredMeta;
|
|
142
|
+
var isClick = (data === null || data === void 0 ? void 0 : data.id) === clickedMeta;
|
|
143
|
+
var style = {
|
|
144
|
+
boxSizing: 'border-box',
|
|
145
|
+
height: '100%'
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
if (window.magicDesign.mode === 'renderer') {
|
|
149
|
+
return style;
|
|
150
|
+
} else {
|
|
151
|
+
style.border = isHover || isClick ? '1px solid #2F54EB' : '1px solid transparent';
|
|
152
|
+
style.backgroundColor = isHover ? 'rgba(47,84,235,0.2)' : '';
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return style;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return _this;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
Wrapper.prototype.componentDidMount = function () {
|
|
162
|
+
var _this = this;
|
|
163
|
+
|
|
164
|
+
this.distroy = (0, _mobx.autorun)(function () {
|
|
165
|
+
_this.setState({
|
|
166
|
+
clickedMeta: _mobx.store.clickedMeta,
|
|
167
|
+
hoveredMeta: _mobx.store.hoveredMeta
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
Wrapper.prototype.componentWillUnmount = function () {
|
|
173
|
+
this.distroy();
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
Wrapper.prototype.render = function () {
|
|
177
|
+
var _a = this.props,
|
|
178
|
+
className = _a.className,
|
|
179
|
+
style = _a.style,
|
|
180
|
+
rest = __rest(_a, ["className", "style"]);
|
|
181
|
+
|
|
182
|
+
var hoverStyle = this.getStyle();
|
|
183
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
184
|
+
className: className,
|
|
185
|
+
style: style
|
|
186
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
187
|
+
className: "meta_wrap",
|
|
188
|
+
onClick: this.onMetaClick,
|
|
189
|
+
onMouseEnter: this.onMouseEnter,
|
|
190
|
+
onMouseLeave: this.onMouseLeave,
|
|
191
|
+
style: hoverStyle
|
|
192
|
+
}, /*#__PURE__*/_react["default"].createElement(WrappedComponent, rest)));
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return Wrapper;
|
|
196
|
+
}(_react.Component);
|
|
197
|
+
|
|
198
|
+
return Wrapper;
|
|
199
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Designer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Designer["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Renderer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Renderer["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
require("./assets/less/index.less");
|
|
20
|
+
|
|
21
|
+
require("./assets/less/cylon-antd.less");
|
|
22
|
+
|
|
23
|
+
var _Designer = _interopRequireDefault(require("./core/Designer"));
|
|
24
|
+
|
|
25
|
+
var _Renderer = _interopRequireDefault(require("./core/Renderer"));
|
|
26
|
+
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
require("./index.less");
|
|
13
|
+
|
|
14
|
+
var _businessUtil = require("@/components/utils/businessUtil");
|
|
15
|
+
|
|
16
|
+
var _coreUtil = require("../../../utils/coreUtil");
|
|
17
|
+
|
|
18
|
+
var _decorator = require("../../../decorator");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
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); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
29
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
30
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
31
|
+
__proto__: []
|
|
32
|
+
} instanceof Array && function (d, b) {
|
|
33
|
+
d.__proto__ = b;
|
|
34
|
+
} || function (d, b) {
|
|
35
|
+
for (var p in b) {
|
|
36
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return _extendStatics(d, b);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return function (d, b) {
|
|
44
|
+
_extendStatics(d, b);
|
|
45
|
+
|
|
46
|
+
function __() {
|
|
47
|
+
this.constructor = d;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
|
|
54
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
55
|
+
__assign = Object.assign || function (t) {
|
|
56
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
57
|
+
s = arguments[i];
|
|
58
|
+
|
|
59
|
+
for (var p in s) {
|
|
60
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return t;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return __assign.apply(this, arguments);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
71
|
+
var c = arguments.length,
|
|
72
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
73
|
+
d;
|
|
74
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
75
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
76
|
+
}
|
|
77
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var Button =
|
|
81
|
+
/** @class */
|
|
82
|
+
function (_super) {
|
|
83
|
+
__extends(Button, _super);
|
|
84
|
+
|
|
85
|
+
function Button() {
|
|
86
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
87
|
+
|
|
88
|
+
_this.state = {
|
|
89
|
+
hover: false
|
|
90
|
+
};
|
|
91
|
+
/** 备份历史数据 比对不一致时渲染 */
|
|
92
|
+
|
|
93
|
+
_this.preData = '';
|
|
94
|
+
return _this;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Button.prototype.shouldComponentUpdate = function (nextProps) {
|
|
98
|
+
return JSON.stringify(nextProps.data) != this.preData;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
Button.prototype.render = function () {
|
|
102
|
+
var _this = this;
|
|
103
|
+
|
|
104
|
+
var _a;
|
|
105
|
+
|
|
106
|
+
var _b = this.props,
|
|
107
|
+
data = _b.data,
|
|
108
|
+
className = _b.className,
|
|
109
|
+
readonly = _b.readonly;
|
|
110
|
+
var hover = this.state.hover;
|
|
111
|
+
this.preData = JSON.stringify(data);
|
|
112
|
+
|
|
113
|
+
var style = __assign({
|
|
114
|
+
backgroundColor: data.content.backgroundColor,
|
|
115
|
+
border: data.buttonBorder.open && data.buttonBorder.borderColor ? "1px solid " + data.buttonBorder.borderColor : '1px solid transparent',
|
|
116
|
+
borderRadius: data.buttonBorder.open ? data.buttonBorder.borderRadius : 0
|
|
117
|
+
}, data.buttonText);
|
|
118
|
+
|
|
119
|
+
var iconUrl = data.buttonIcon.iconUrl;
|
|
120
|
+
var iconLayout = data.buttonIcon.layout;
|
|
121
|
+
|
|
122
|
+
if (hover && ((_a = data.hover) === null || _a === void 0 ? void 0 : _a.open)) {
|
|
123
|
+
style = __assign(__assign(__assign({}, style), {
|
|
124
|
+
backgroundColor: data.hover.content.backgroundColor,
|
|
125
|
+
border: data.hover.buttonBorder.open && data.hover.buttonBorder.borderColor ? "1px solid " + data.hover.buttonBorder.borderColor : '1px solid transparent',
|
|
126
|
+
borderRadius: data.hover.buttonBorder.open ? data.hover.buttonBorder.borderRadius : 0
|
|
127
|
+
}), data.hover.buttonText);
|
|
128
|
+
iconUrl = data.hover.buttonIcon.iconUrl;
|
|
129
|
+
iconLayout = data.hover.buttonIcon.layout;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
var btnText = /*#__PURE__*/_react["default"].createElement("span", {
|
|
133
|
+
className: "item",
|
|
134
|
+
contentEditable: (0, _coreUtil.isDesignMode)() && !readonly,
|
|
135
|
+
onInput: function onInput(e) {
|
|
136
|
+
var text = e.target.textContent;
|
|
137
|
+
data.text = text;
|
|
138
|
+
/** 主动更新历史数据避免render */
|
|
139
|
+
|
|
140
|
+
_this.preData = JSON.stringify(__assign(__assign({}, JSON.parse(_this.preData)), {
|
|
141
|
+
text: text
|
|
142
|
+
}));
|
|
143
|
+
},
|
|
144
|
+
suppressContentEditableWarning: true
|
|
145
|
+
}, data.text);
|
|
146
|
+
|
|
147
|
+
var wrapStyle = (0, _businessUtil.computeStyle)(data, window.magicDesign.device);
|
|
148
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
|
+
className: (0, _classnames["default"])('m-meta-button', className),
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return (0, _coreUtil.clickUrl)(data.content.url);
|
|
152
|
+
},
|
|
153
|
+
onMouseEnter: function onMouseEnter() {
|
|
154
|
+
return _this.setState({
|
|
155
|
+
hover: true
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
onMouseLeave: function onMouseLeave() {
|
|
159
|
+
return _this.setState({
|
|
160
|
+
hover: false
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
style: __assign(__assign({}, style), wrapStyle)
|
|
164
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
165
|
+
className: (0, _classnames["default"])('btnContent', {
|
|
166
|
+
horizontal: iconLayout === 'left' || iconLayout === 'right'
|
|
167
|
+
})
|
|
168
|
+
}, (iconLayout === 'right' || iconLayout === 'bottom') && btnText, iconUrl && /*#__PURE__*/_react["default"].createElement("img", {
|
|
169
|
+
alt: "",
|
|
170
|
+
className: "item",
|
|
171
|
+
src: iconUrl
|
|
172
|
+
}), (iconLayout === 'left' || iconLayout === 'top') && btnText));
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
Button.defaultProps = {
|
|
176
|
+
data: {},
|
|
177
|
+
className: '',
|
|
178
|
+
readonly: false
|
|
179
|
+
};
|
|
180
|
+
Button = __decorate([_decorator.metaDecorator], Button);
|
|
181
|
+
return Button;
|
|
182
|
+
}(_react.Component);
|
|
183
|
+
|
|
184
|
+
var _default = Button;
|
|
185
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.m-meta-button {
|
|
2
|
+
transition: all 0.25s;
|
|
3
|
+
|
|
4
|
+
.btnContent {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
|
|
11
|
+
&.horizontal {
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
img {
|
|
16
|
+
height: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|