@cloudbase/weda-ui 3.1.9 → 3.2.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/dist/configs/components/chart/bar.json +3 -3
- package/dist/configs/components/chart/line.json +3 -3
- package/dist/configs/components/chart/pie.json +3 -3
- package/dist/configs/components/form/departTreeSelect.json +124 -0
- package/dist/configs/components/form/userTreeSelect.json +128 -0
- package/dist/configs/components/formdetail.json +105 -0
- package/dist/configs/components/listView.json +9 -1
- package/dist/configs/components/lottery.json +1 -1
- package/dist/configs/components/tabs.json +10 -9
- package/dist/configs/components/wxOpenApi/share.json +5 -2
- package/dist/configs/index.d.ts +6 -0
- package/dist/configs/index.js +6 -0
- package/dist/cypress/support/commands.d.ts +1 -0
- package/dist/cypress/support/commands.js +40 -0
- package/dist/cypress/support/e2e.d.ts +24 -0
- package/dist/cypress/support/e2e.js +22 -0
- package/dist/src/configs/actions/showModal.json +48 -0
- package/dist/src/configs/actions/showToast.json +41 -0
- package/dist/src/configs/components/auth.json +16 -0
- package/dist/src/configs/components/button.json +239 -0
- package/dist/src/configs/components/calendar.json +81 -0
- package/dist/src/configs/components/carousel.json +292 -0
- package/dist/src/configs/components/chart/bar.json +954 -0
- package/dist/src/configs/components/chart/line.json +870 -0
- package/dist/src/configs/components/chart/pie.json +677 -0
- package/dist/src/configs/components/chart/statisticsCard.json +376 -0
- package/dist/src/configs/components/container.json +50 -0
- package/dist/src/configs/components/dataView.json +247 -0
- package/dist/src/configs/components/drawer.json +115 -0
- package/dist/src/configs/components/form/checkbox.json +179 -0
- package/dist/src/configs/components/form/departTreeSelect.json +124 -0
- package/dist/src/configs/components/form/form.json +73 -0
- package/dist/src/configs/components/form/input.json +154 -0
- package/dist/src/configs/components/form/location.json +216 -0
- package/dist/src/configs/components/form/radio.json +203 -0
- package/dist/src/configs/components/form/richText.json +133 -0
- package/dist/src/configs/components/form/select.json +449 -0
- package/dist/src/configs/components/form/switch.json +58 -0
- package/dist/src/configs/components/form/textarea.json +116 -0
- package/dist/src/configs/components/form/tips.json +34 -0
- package/dist/src/configs/components/form/uploader.json +171 -0
- package/dist/src/configs/components/form/uploaderFile.json +158 -0
- package/dist/src/configs/components/form/userTreeSelect.json +128 -0
- package/dist/src/configs/components/formdetail.json +105 -0
- package/dist/src/configs/components/graphicCard.json +413 -0
- package/dist/src/configs/components/image.json +187 -0
- package/dist/src/configs/components/link.json +79 -0
- package/dist/src/configs/components/listView.json +378 -0
- package/dist/src/configs/components/lottery.json +163 -0
- package/dist/src/configs/components/modal.json +72 -0
- package/dist/src/configs/components/navLayout.json +368 -0
- package/dist/src/configs/components/navigationBar.json +62 -0
- package/dist/src/configs/components/richtextview.json +26 -0
- package/dist/src/configs/components/scrollVeiw.json +253 -0
- package/dist/src/configs/components/slot.json +17 -0
- package/dist/src/configs/components/swiper.json +90 -0
- package/dist/src/configs/components/tabs.json +122 -0
- package/dist/src/configs/components/text.json +95 -0
- package/dist/src/configs/components/wedaVideo.json +89 -0
- package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
- package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
- package/dist/src/configs/components/wxOpenApi/share.json +160 -0
- package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
- package/dist/src/configs/index.d.ts +103 -0
- package/dist/src/configs/index.js +111 -0
- package/dist/src/docs/common/format.d.ts +13 -0
- package/dist/src/docs/common/format.js +122 -0
- package/dist/src/docs/common/tableView.d.ts +30 -0
- package/dist/src/docs/common/tableView.js +156 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +3 -0
- package/dist/src/setupTests.d.ts +2 -0
- package/dist/src/setupTests.js +19 -0
- package/dist/src/web/actions/index.d.ts +2 -0
- package/dist/src/web/actions/index.js +2 -0
- package/dist/src/web/actions/showModal/index.d.ts +4 -0
- package/dist/src/web/actions/showModal/index.js +67 -0
- package/dist/src/web/actions/showToast/index.d.ts +1 -0
- package/dist/src/web/actions/showToast/index.js +3 -0
- package/dist/src/web/components/button/index.d.ts +32 -0
- package/dist/src/web/components/button/index.js +48 -0
- package/dist/src/web/components/calendar/index.d.ts +19 -0
- package/dist/src/web/components/calendar/index.js +189 -0
- package/dist/src/web/components/calendar/util.d.ts +13 -0
- package/dist/src/web/components/calendar/util.js +74 -0
- package/dist/src/web/components/carousel/index.d.ts +41 -0
- package/dist/src/web/components/carousel/index.js +244 -0
- package/dist/src/web/components/chart/bar/index.d.ts +3 -0
- package/dist/src/web/components/chart/bar/index.js +41 -0
- package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
- package/dist/src/web/components/chart/bar/index.old.js +56 -0
- package/dist/src/web/components/chart/common/Chart.d.ts +9 -0
- package/dist/src/web/components/chart/common/Chart.js +23 -0
- package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
- package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
- package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
- package/dist/src/web/components/chart/common/chart-error.js +2 -0
- package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
- package/dist/src/web/components/chart/common/config/bar.js +49 -0
- package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
- package/dist/src/web/components/chart/common/config/global.js +16 -0
- package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
- package/dist/src/web/components/chart/common/config/line.js +49 -0
- package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
- package/dist/src/web/components/chart/common/config/pie.js +36 -0
- package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
- package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
- package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
- package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
- package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
- package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
- package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
- package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
- package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
- package/dist/src/web/components/chart/common/core/type.js +9 -0
- package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
- package/dist/src/web/components/chart/common/data-transform.js +246 -0
- package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
- package/dist/src/web/components/chart/common/echarts.js +24 -0
- package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
- package/dist/src/web/components/chart/common/error-boundary.js +26 -0
- package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
- package/dist/src/web/components/chart/common/useChart.js +61 -0
- package/dist/src/web/components/chart/line/index.d.ts +3 -0
- package/dist/src/web/components/chart/line/index.js +42 -0
- package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
- package/dist/src/web/components/chart/line/index.old.js +53 -0
- package/dist/src/web/components/chart/pie/index.d.ts +3 -0
- package/dist/src/web/components/chart/pie/index.js +42 -0
- package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
- package/dist/src/web/components/chart/pie/index.old.js +40 -0
- package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
- package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
- package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
- package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
- package/dist/src/web/components/common/portal.d.ts +7 -0
- package/dist/src/web/components/common/portal.js +14 -0
- package/dist/src/web/components/container/index.d.ts +6 -0
- package/dist/src/web/components/container/index.js +6 -0
- package/dist/src/web/components/dataView/index.d.ts +6 -0
- package/dist/src/web/components/dataView/index.js +8 -0
- package/dist/src/web/components/dataView/interface.d.ts +5 -0
- package/dist/src/web/components/dataView/interface.js +1 -0
- package/dist/src/web/components/drawer/index.d.ts +13 -0
- package/dist/src/web/components/drawer/index.js +12 -0
- package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
- package/dist/src/web/components/form/checkbox/index.js +167 -0
- package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
- package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
- package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
- package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
- package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
- package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
- package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
- package/dist/src/web/components/form/enumSelect/index.js +6 -0
- package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
- package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
- package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
- package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
- package/dist/src/web/components/form/form/index.d.ts +32 -0
- package/dist/src/web/components/form/form/index.js +141 -0
- package/dist/src/web/components/form/formcell/index.d.ts +8 -0
- package/dist/src/web/components/form/formcell/index.js +40 -0
- package/dist/src/web/components/form/input/index.d.ts +14 -0
- package/dist/src/web/components/form/input/index.js +86 -0
- package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
- package/dist/src/web/components/form/location/common/mapChoose.js +495 -0
- package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
- package/dist/src/web/components/form/location/common/mapView.js +172 -0
- package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
- package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
- package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
- package/dist/src/web/components/form/location/common/selectModal.js +44 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.js +104 -0
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +325 -0
- package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
- package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +224 -0
- package/dist/src/web/components/form/location/constants.d.ts +2 -0
- package/dist/src/web/components/form/location/constants.js +3 -0
- package/dist/src/web/components/form/location/index.d.ts +1 -0
- package/dist/src/web/components/form/location/index.js +17 -0
- package/dist/src/web/components/form/radio/index.d.ts +11 -0
- package/dist/src/web/components/form/radio/index.js +115 -0
- package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
- package/dist/src/web/components/form/renderDecorator.js +20 -0
- package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
- package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
- package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
- package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
- package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
- package/dist/src/web/components/form/select/allTimePicker/index.js +943 -0
- package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
- package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
- package/dist/src/web/components/form/select/h5.d.ts +16 -0
- package/dist/src/web/components/form/select/h5.js +452 -0
- package/dist/src/web/components/form/select/index.d.ts +66 -0
- package/dist/src/web/components/form/select/index.js +241 -0
- package/dist/src/web/components/form/select/region/index.d.ts +6 -0
- package/dist/src/web/components/form/select/region/index.js +147 -0
- package/dist/src/web/components/form/select/time.d.ts +9 -0
- package/dist/src/web/components/form/select/time.js +146 -0
- package/dist/src/web/components/form/select/use-options.d.ts +26 -0
- package/dist/src/web/components/form/select/use-options.js +103 -0
- package/dist/src/web/components/form/select/year.d.ts +7 -0
- package/dist/src/web/components/form/select/year.js +72 -0
- package/dist/src/web/components/form/switch/index.d.ts +6 -0
- package/dist/src/web/components/form/switch/index.js +58 -0
- package/dist/src/web/components/form/textarea/index.d.ts +12 -0
- package/dist/src/web/components/form/textarea/index.js +66 -0
- package/dist/src/web/components/form/tips/index.d.ts +8 -0
- package/dist/src/web/components/form/tips/index.js +17 -0
- package/dist/src/web/components/form/uploader/index.d.ts +3 -0
- package/dist/src/web/components/form/uploader/index.js +42 -0
- package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
- package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
- package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
- package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
- package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
- package/dist/src/web/components/form/uploaderFile/index.js +19 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +328 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +299 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.js +107 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +247 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +158 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
- package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
- package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +26 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +258 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +271 -0
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +35 -0
- package/dist/src/web/components/form/userOrgSelect/utils.js +72 -0
- package/dist/src/web/components/formdetail/index.d.ts +28 -0
- package/dist/src/web/components/formdetail/index.js +170 -0
- package/dist/src/web/components/graphicCard/index.d.ts +46 -0
- package/dist/src/web/components/graphicCard/index.js +179 -0
- package/dist/src/web/components/image/image.d.ts +9 -0
- package/dist/src/web/components/image/image.js +119 -0
- package/dist/src/web/components/image/index.d.ts +13 -0
- package/dist/src/web/components/image/index.js +77 -0
- package/dist/src/web/components/index.d.ts +50 -0
- package/dist/src/web/components/index.js +99 -0
- package/dist/src/web/components/link/index.d.ts +24 -0
- package/dist/src/web/components/link/index.js +71 -0
- package/dist/src/web/components/listView/index.d.ts +7 -0
- package/dist/src/web/components/listView/index.js +296 -0
- package/dist/src/web/components/listView/interface.d.ts +127 -0
- package/dist/src/web/components/listView/interface.js +1 -0
- package/dist/src/web/components/lottery/index.d.ts +22 -0
- package/dist/src/web/components/lottery/index.js +391 -0
- package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
- package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
- package/dist/src/web/components/modal/index.d.ts +17 -0
- package/dist/src/web/components/modal/index.js +11 -0
- package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
- package/dist/src/web/components/modal/modal.h5.js +46 -0
- package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
- package/dist/src/web/components/modal/modal.pc.js +31 -0
- package/dist/src/web/components/navLayout/index.d.ts +61 -0
- package/dist/src/web/components/navLayout/index.js +127 -0
- package/dist/src/web/components/navigationBar/common.d.ts +15 -0
- package/dist/src/web/components/navigationBar/common.js +127 -0
- package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
- package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
- package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
- package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
- package/dist/src/web/components/navigationBar/index.d.ts +13 -0
- package/dist/src/web/components/navigationBar/index.js +157 -0
- package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
- package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
- package/dist/src/web/components/phone/index.d.ts +18 -0
- package/dist/src/web/components/phone/index.js +4 -0
- package/dist/src/web/components/phoneCode/index.d.ts +18 -0
- package/dist/src/web/components/phoneCode/index.js +4 -0
- package/dist/src/web/components/picker/datePicker.d.ts +10 -0
- package/dist/src/web/components/picker/datePicker.js +31 -0
- package/dist/src/web/components/picker/picker.d.ts +6 -0
- package/dist/src/web/components/picker/picker.js +45 -0
- package/dist/src/web/components/picker/timePicker.d.ts +7 -0
- package/dist/src/web/components/picker/timePicker.js +42 -0
- package/dist/src/web/components/richText/const.d.ts +1 -0
- package/dist/src/web/components/richText/const.js +2 -0
- package/dist/src/web/components/richText/index.d.ts +50 -0
- package/dist/src/web/components/richText/index.js +352 -0
- package/dist/src/web/components/richTextView/index.d.ts +7 -0
- package/dist/src/web/components/richTextView/index.js +44 -0
- package/dist/src/web/components/scrollView/index.d.ts +27 -0
- package/dist/src/web/components/scrollView/index.js +95 -0
- package/dist/src/web/components/share/index.d.ts +34 -0
- package/dist/src/web/components/share/index.js +4 -0
- package/dist/src/web/components/slot/index.d.ts +6 -0
- package/dist/src/web/components/slot/index.js +9 -0
- package/dist/src/web/components/swiper/index.d.ts +24 -0
- package/dist/src/web/components/swiper/index.js +153 -0
- package/dist/src/web/components/tabs/index.d.ts +13 -0
- package/dist/src/web/components/tabs/index.js +15 -0
- package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
- package/dist/src/web/components/tabs/tabs.h5.js +42 -0
- package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
- package/dist/src/web/components/tabs/tabs.pc.js +40 -0
- package/dist/src/web/components/text/index.d.ts +14 -0
- package/dist/src/web/components/text/index.js +17 -0
- package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
- package/dist/src/web/components/uploaderFileView/index.js +46 -0
- package/dist/src/web/components/uploaderView/index.d.ts +17 -0
- package/dist/src/web/components/uploaderView/index.js +48 -0
- package/dist/src/web/components/userInfo/index.d.ts +26 -0
- package/dist/src/web/components/userInfo/index.js +4 -0
- package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
- package/dist/src/web/components/wedaVideo/index.js +144 -0
- package/dist/src/web/index.d.ts +8 -0
- package/dist/src/web/index.js +4 -0
- package/dist/src/web/utils/classnames.d.ts +2 -0
- package/dist/src/web/utils/classnames.js +37 -0
- package/dist/src/web/utils/constant.d.ts +23 -0
- package/dist/src/web/utils/constant.js +24 -0
- package/dist/src/web/utils/debounce.d.ts +2 -0
- package/dist/src/web/utils/debounce.js +92 -0
- package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
- package/dist/src/web/utils/getLocalCounter.js +4 -0
- package/dist/src/web/utils/getUserService.d.ts +11 -0
- package/dist/src/web/utils/getUserService.js +156 -0
- package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
- package/dist/src/web/utils/isObjectEqual.js +12 -0
- package/dist/src/web/utils/loading-fallback.d.ts +2 -0
- package/dist/src/web/utils/loading-fallback.js +2 -0
- package/dist/src/web/utils/lodash.d.ts +1 -0
- package/dist/src/web/utils/lodash.js +2 -0
- package/dist/src/web/utils/platform.d.ts +18 -0
- package/dist/src/web/utils/platform.js +193 -0
- package/dist/src/web/utils/tcb.d.ts +33 -0
- package/dist/src/web/utils/tcb.js +118 -0
- package/dist/src/web/utils/tmap.d.ts +3 -0
- package/dist/src/web/utils/tmap.js +21 -0
- package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
- package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
- package/dist/src/web/utils/useSetState.d.ts +1 -0
- package/dist/src/web/utils/useSetState.js +8 -0
- package/dist/src/web/utils/useSyncValue.d.ts +4 -0
- package/dist/src/web/utils/useSyncValue.js +15 -0
- package/dist/src/web/utils/weui.d.ts +1 -0
- package/dist/src/web/utils/weui.js +2 -0
- package/dist/web/components/calendar/index.js +10 -2
- package/dist/web/components/carousel/index.js +4 -0
- package/dist/web/components/chart/common/core/eChartBase.js +8 -2
- package/dist/web/components/form/form/index.js +10 -7
- package/dist/web/components/form/location/common/mapChoose.js +2 -0
- package/dist/web/components/form/location/common/mapView.js +2 -0
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +3 -1
- package/dist/web/components/form/location/components/LocationH5/location.module.css +3 -0
- package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
- package/dist/web/components/form/select/allTimePicker/index.css +136 -0
- package/dist/web/components/form/select/h5.js +4 -0
- package/dist/web/components/form/select/index.js +2 -8
- package/dist/web/components/form/switch/index.js +3 -2
- package/dist/web/components/form/switch/switch.module.css +7 -0
- package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
- package/dist/web/components/form/uploader/uploader.h5.js +14 -10
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -12
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -8
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +7 -0
- package/dist/web/components/form/userOrgSelect/comTool.js +89 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +20 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +259 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +153 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
- package/dist/web/components/form/userOrgSelect/index.d.ts +2 -0
- package/dist/web/components/form/userOrgSelect/index.js +17 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.css +805 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +643 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +24 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +229 -0
- package/dist/web/components/form/userOrgSelect/utils.d.ts +35 -0
- package/dist/web/components/form/userOrgSelect/utils.js +72 -0
- package/dist/web/components/formdetail/index.css +115 -0
- package/dist/web/components/formdetail/index.d.ts +28 -0
- package/dist/web/components/formdetail/index.js +170 -0
- package/dist/web/components/index.d.ts +3 -0
- package/dist/web/components/index.js +3 -0
- package/dist/web/components/listView/index.css +35 -5
- package/dist/web/components/listView/index.js +92 -68
- package/dist/web/components/listView/interface.d.ts +5 -0
- package/dist/web/components/lottery/index.js +2 -1
- package/dist/web/components/lottery/lotteryUtil.js +1 -0
- package/dist/web/components/navigationBar/index.css +21 -29
- package/dist/web/components/richText/index.css +1 -0
- package/dist/web/components/swiper/index.js +5 -1
- package/dist/web/components/wedaVideo/index.js +1 -0
- package/dist/web/utils/getUserService.d.ts +17 -0
- package/dist/web/utils/getUserService.js +148 -0
- package/dist/web/utils/platform.js +2 -0
- package/dist/web/weda-ui.css +9 -0
- package/package.json +27 -13
- package/dist/asset-manifest.json +0 -17
- package/dist/index.html +0 -88
- package/dist/static/js/bundle.js +0 -963
- package/dist/static/js/bundle.js.map +0 -1
- package/dist/static/js/main.chunk.js +0 -8841
- package/dist/static/js/main.chunk.js.map +0 -1
- package/dist/static/js/vendors~main.chunk.js +0 -247885
- package/dist/static/js/vendors~main.chunk.js.map +0 -1
- package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +0 -627
- package/dist/web/components/auth/index.d.ts +0 -10
- package/dist/web/components/auth/index.js +0 -37
- package/dist/web/utils/events.d.ts +0 -1
- package/dist/web/utils/events.js +0 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CommonPropsType, ICompRef } from '../../types';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export interface PropsType extends CommonPropsType {
|
|
5
|
+
name?: string;
|
|
6
|
+
value?: any;
|
|
7
|
+
isPureArray?: boolean;
|
|
8
|
+
parent: any;
|
|
9
|
+
}
|
|
10
|
+
declare type TCompRef = ICompRef<{
|
|
11
|
+
addition: () => void;
|
|
12
|
+
remove: (key: string) => void;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const reorderContext: (data: any, name: any, isPureArray: any) => any;
|
|
15
|
+
export declare const newContextItem: (childFormItem: any, name: any, isPureArray: any) => {
|
|
16
|
+
index: number;
|
|
17
|
+
_id: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const changeHandle: ({ type, name, data, childFormItem, isPureArray, params, }: {
|
|
20
|
+
type: any;
|
|
21
|
+
name: any;
|
|
22
|
+
data: any;
|
|
23
|
+
childFormItem: any;
|
|
24
|
+
isPureArray: any;
|
|
25
|
+
params: any;
|
|
26
|
+
}) => any;
|
|
27
|
+
declare const _default: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<TCompRef>>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import React, { useEffect, useRef, forwardRef, useImperativeHandle, useState, } from 'react';
|
|
2
|
+
import destr from 'destr';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import { usePlatform, randomStr } from '../../utils/platform';
|
|
5
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
6
|
+
import './index.css';
|
|
7
|
+
export const reorderContext = (data, name, isPureArray) => data.map((i, index) => {
|
|
8
|
+
const item = { ...i };
|
|
9
|
+
Object.keys(i).forEach((j) => {
|
|
10
|
+
var _a;
|
|
11
|
+
if ((_a = item[j]) === null || _a === void 0 ? void 0 : _a.name) {
|
|
12
|
+
item[j].name = isPureArray
|
|
13
|
+
? `${name}[${index}]`
|
|
14
|
+
: `${name}[${index}].${j}`;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
item.index = index;
|
|
18
|
+
return item;
|
|
19
|
+
});
|
|
20
|
+
export const newContextItem = (childFormItem, name, isPureArray) => {
|
|
21
|
+
const mock = { index: 0, _id: randomStr() };
|
|
22
|
+
childFormItem === null || childFormItem === void 0 ? void 0 : childFormItem.forEach((i) => {
|
|
23
|
+
mock[i] = {
|
|
24
|
+
name: isPureArray ? `${name}[0]` : `${name}[0].${i}`,
|
|
25
|
+
value: null,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return mock;
|
|
29
|
+
};
|
|
30
|
+
export const changeHandle = ({ type, name, data, childFormItem, isPureArray, params, }) => {
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'add': {
|
|
33
|
+
const mock = newContextItem(childFormItem, name, isPureArray);
|
|
34
|
+
data.push({ ...mock, _id: randomStr() });
|
|
35
|
+
data = reorderContext(data, name, isPureArray);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
case 'remove': {
|
|
39
|
+
data.splice(params.index, 1);
|
|
40
|
+
data = reorderContext(data, name, isPureArray);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case 'change': {
|
|
44
|
+
data = data.map((i) => {
|
|
45
|
+
const item = { ...i };
|
|
46
|
+
for (const [key, subItem] of Object.entries(item)) {
|
|
47
|
+
if (params.name === (subItem === null || subItem === void 0 ? void 0 : subItem.name)) {
|
|
48
|
+
item[key].value = params === null || params === void 0 ? void 0 : params.value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return item;
|
|
52
|
+
});
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
default: {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
export default forwardRef(function FormDetail(props, ref) {
|
|
62
|
+
const { className, id, style, children, events, name, value: initDetailValue, isPureArray, parent, } = props;
|
|
63
|
+
const observeRef = useRef(null); // 当前监听对象
|
|
64
|
+
const [defaultValue, setDetailValue] = useState([]);
|
|
65
|
+
const [contextData, setContextData] = useState([]);
|
|
66
|
+
const [childFormItem, setCildFormItem] = useState([]);
|
|
67
|
+
const platform = usePlatform();
|
|
68
|
+
const init = (defaultValue) => {
|
|
69
|
+
var _a;
|
|
70
|
+
const formDetailItemValue = {};
|
|
71
|
+
let childFormItem = defaultValue[0] ? Object.keys(defaultValue[0]) : [];
|
|
72
|
+
// 纯数组,默认key值为'arrayItem'
|
|
73
|
+
if (isPureArray) {
|
|
74
|
+
childFormItem = ['arrayItem'];
|
|
75
|
+
}
|
|
76
|
+
setCildFormItem(childFormItem);
|
|
77
|
+
let initialValues = [];
|
|
78
|
+
try {
|
|
79
|
+
initialValues = defaultValue.map((i, index) => {
|
|
80
|
+
let item = {};
|
|
81
|
+
if (isPureArray) {
|
|
82
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
83
|
+
const val = (i === null || i === void 0 ? void 0 : i.hasOwnProperty('arrayItem')) ? null : i;
|
|
84
|
+
item['arrayItem'] = { name: `${name}[${index}]`, value: val };
|
|
85
|
+
formDetailItemValue[`${name}[${index}]`] = val;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
item = { ...i };
|
|
89
|
+
Object.keys(i).forEach((j) => {
|
|
90
|
+
const key = `${name}[${index}].${j}`;
|
|
91
|
+
const val = i[j];
|
|
92
|
+
item[j] = { name: key, value: val };
|
|
93
|
+
formDetailItemValue[key] = val;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
item.index = index;
|
|
97
|
+
item._id = randomStr();
|
|
98
|
+
return item;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.log(error);
|
|
103
|
+
}
|
|
104
|
+
const mock = newContextItem(childFormItem, name, isPureArray);
|
|
105
|
+
const data = (initialValues === null || initialValues === void 0 ? void 0 : initialValues.length) ? initialValues : [mock];
|
|
106
|
+
setContextData(data);
|
|
107
|
+
(_a = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
108
|
+
data,
|
|
109
|
+
});
|
|
110
|
+
// 解决web端,编辑场景不回显初始值的问题
|
|
111
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
if (!isObjectEqual(formDetailItemValue, {})) {
|
|
114
|
+
parent.setValue(formDetailItemValue);
|
|
115
|
+
}
|
|
116
|
+
}, 0);
|
|
117
|
+
};
|
|
118
|
+
// 初始化context的值
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!isObjectEqual(initDetailValue, defaultValue)) {
|
|
121
|
+
setDetailValue(initDetailValue);
|
|
122
|
+
init(initDetailValue);
|
|
123
|
+
}
|
|
124
|
+
}, [initDetailValue]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
init(initDetailValue);
|
|
127
|
+
setDetailValue(initDetailValue);
|
|
128
|
+
// 组件卸载时触发
|
|
129
|
+
return () => {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
(_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
132
|
+
(_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, { data: [] });
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
135
|
+
const onChange = (type, params) => {
|
|
136
|
+
var _a;
|
|
137
|
+
let data = destr(contextData);
|
|
138
|
+
data = changeHandle({
|
|
139
|
+
type,
|
|
140
|
+
name,
|
|
141
|
+
data,
|
|
142
|
+
childFormItem,
|
|
143
|
+
isPureArray,
|
|
144
|
+
params,
|
|
145
|
+
});
|
|
146
|
+
setContextData(data);
|
|
147
|
+
(_a = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _a === void 0 ? void 0 : _a.call(events, { data });
|
|
148
|
+
};
|
|
149
|
+
useImperativeHandle(ref, () => {
|
|
150
|
+
return {
|
|
151
|
+
methods: {
|
|
152
|
+
addition: () => {
|
|
153
|
+
onChange('add', null);
|
|
154
|
+
},
|
|
155
|
+
remove: (params) => {
|
|
156
|
+
onChange('remove', params);
|
|
157
|
+
},
|
|
158
|
+
change: (params) => {
|
|
159
|
+
onChange('change', params);
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}, [onChange]);
|
|
164
|
+
return (React.createElement("div", { className: classNames({
|
|
165
|
+
'weda-ui': true,
|
|
166
|
+
'form-detail-wrap': true,
|
|
167
|
+
'h5-form-detail-wrap': platform === 'h5',
|
|
168
|
+
[className]: className,
|
|
169
|
+
}), id: id, style: style, role: "container", "data-testid": "formDetail" }, children));
|
|
170
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './index.css';
|
|
3
|
+
import type { CommonPropsType } from '../../types';
|
|
4
|
+
export declare type INavOption = {
|
|
5
|
+
params: Array<{
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}>;
|
|
9
|
+
paramObj?: any;
|
|
10
|
+
icon: string;
|
|
11
|
+
title: string;
|
|
12
|
+
des: string;
|
|
13
|
+
tapStatus: 'tap' | 'inside' | 'outer';
|
|
14
|
+
insideUrl?: string;
|
|
15
|
+
outerUrl?: string;
|
|
16
|
+
newPage?: boolean;
|
|
17
|
+
withParams?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export interface IGraphicCardPropsType extends CommonPropsType {
|
|
20
|
+
/**
|
|
21
|
+
* 导航配置
|
|
22
|
+
*/
|
|
23
|
+
navOption?: Readonly<INavOption[]>;
|
|
24
|
+
titleVisible: boolean;
|
|
25
|
+
titleColor: string;
|
|
26
|
+
titleFontWeight: string;
|
|
27
|
+
titleFontSize: number;
|
|
28
|
+
titleLineHeight: string;
|
|
29
|
+
titleMaxLines: number;
|
|
30
|
+
desColor: string;
|
|
31
|
+
desFontWeight: string;
|
|
32
|
+
desVisible: boolean;
|
|
33
|
+
desFontSize: number;
|
|
34
|
+
desLineHeight: string;
|
|
35
|
+
desMaxLines: number;
|
|
36
|
+
buttonVisible: boolean;
|
|
37
|
+
buttonText: string;
|
|
38
|
+
ColMobile: number;
|
|
39
|
+
ColPC: number;
|
|
40
|
+
percentageVisible: boolean;
|
|
41
|
+
iconWidthSize: string;
|
|
42
|
+
iconHeightSize: string;
|
|
43
|
+
textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify';
|
|
44
|
+
imageStyle: any;
|
|
45
|
+
}
|
|
46
|
+
export default function GraphicCard({ navOption, ColMobile, ColPC, iconWidthSize, iconHeightSize, titleVisible, desVisible, buttonVisible, textAlign, className, titleColor, titleFontWeight, titleFontSize, titleLineHeight, titleMaxLines, desColor, desFontWeight, desFontSize, desLineHeight, desMaxLines, buttonText, style, }: IGraphicCardPropsType): JSX.Element;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import { Row, Col, ConfigProvider, Button, Text } from 'tea-component';
|
|
5
|
+
import { usePlatform } from '../../utils/platform';
|
|
6
|
+
import { IconFont } from 'tdesign-icons-react';
|
|
7
|
+
import Image from '../image';
|
|
8
|
+
import { useWindowSize } from '@react-hookz/web';
|
|
9
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
10
|
+
import { emptyArray } from '../../utils/constant';
|
|
11
|
+
const CLASS_PREFIX = 'weda-graphic-card';
|
|
12
|
+
export default function GraphicCard({ navOption = emptyArray, ColMobile, ColPC, iconWidthSize, iconHeightSize, titleVisible, desVisible, buttonVisible, textAlign, className, titleColor, titleFontWeight, titleFontSize, titleLineHeight, titleMaxLines, desColor, desFontWeight, desFontSize, desLineHeight, desMaxLines, buttonText, style, }) {
|
|
13
|
+
const platform = usePlatform();
|
|
14
|
+
const isH5 = platform === 'h5';
|
|
15
|
+
const [colCount, setColCount] = React.useState(2);
|
|
16
|
+
// 一个栅格的宽度
|
|
17
|
+
const { width } = useWindowSize();
|
|
18
|
+
const singleGrid = useMemo(() => (width - 24 * 2) / 12, [width]);
|
|
19
|
+
// 两次默认值不同, 需要刷新
|
|
20
|
+
const prevNavOptionRef = React.useRef(null);
|
|
21
|
+
const prevColRef = React.useRef(0);
|
|
22
|
+
const cls = classNames({
|
|
23
|
+
[CLASS_PREFIX]: true,
|
|
24
|
+
[className]: className,
|
|
25
|
+
[`${CLASS_PREFIX}-mobile`]: isH5,
|
|
26
|
+
});
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const col = isH5 ? ColMobile : ColPC;
|
|
29
|
+
setColCount(col);
|
|
30
|
+
}, [isH5]);
|
|
31
|
+
const cardList = useMemo(() => {
|
|
32
|
+
const list = [];
|
|
33
|
+
if (prevColRef.current !== colCount ||
|
|
34
|
+
(navOption.length > 0 &&
|
|
35
|
+
!isObjectEqual(prevNavOptionRef.current !== navOption))) {
|
|
36
|
+
list.length = Math.floor(navOption.length / colCount);
|
|
37
|
+
list.forEach((item, index) => {
|
|
38
|
+
list[index] = [];
|
|
39
|
+
});
|
|
40
|
+
navOption.forEach((item, index) => {
|
|
41
|
+
const _index = Math.floor(index / colCount);
|
|
42
|
+
if (!list[_index] || list[_index].length <= 0) {
|
|
43
|
+
// 保证每个col 的数据都是有的,列入总共7个数据,那么第二行的3, 4,5数据是undefined, 占位
|
|
44
|
+
list[_index] = Array(colCount).fill(null);
|
|
45
|
+
}
|
|
46
|
+
const paramObj = {};
|
|
47
|
+
if (item === null || item === void 0 ? void 0 : item.params) {
|
|
48
|
+
for (const info of item.params) {
|
|
49
|
+
paramObj[info.key] = info.value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
item.paramObj = paramObj;
|
|
53
|
+
list[_index][index - _index * colCount] = item;
|
|
54
|
+
prevNavOptionRef.current = [...navOption];
|
|
55
|
+
prevColRef.current = colCount;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return list;
|
|
59
|
+
}, [colCount, navOption]);
|
|
60
|
+
const elementStyle = document.createElement('body').style;
|
|
61
|
+
const vendor = (() => {
|
|
62
|
+
const transformNames = {
|
|
63
|
+
webkit: 'webkitTransform',
|
|
64
|
+
Moz: 'MozTransform',
|
|
65
|
+
O: 'OTransform',
|
|
66
|
+
ms: 'msTransform',
|
|
67
|
+
standard: 'transform',
|
|
68
|
+
};
|
|
69
|
+
for (const key in transformNames) {
|
|
70
|
+
if (elementStyle[transformNames[key]] !== undefined) {
|
|
71
|
+
return key;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
})();
|
|
76
|
+
function prefixStyle(style) {
|
|
77
|
+
if (vendor === false) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (vendor === 'standard') {
|
|
81
|
+
return style;
|
|
82
|
+
}
|
|
83
|
+
return '-' + vendor + style.charAt(0).toUpperCase() + style.substr(1);
|
|
84
|
+
}
|
|
85
|
+
const boxStyle = prefixStyle('-box');
|
|
86
|
+
//标题样式
|
|
87
|
+
const titleStyle = {
|
|
88
|
+
display: `${boxStyle}`,
|
|
89
|
+
WebkitLineClamp: `${titleMaxLines ? titleMaxLines : 'inherit'}`,
|
|
90
|
+
overflow: 'hidden',
|
|
91
|
+
color: `${titleColor}`,
|
|
92
|
+
fontWeight: `${titleFontWeight}`,
|
|
93
|
+
fontSize: `${titleFontSize}` + 'px',
|
|
94
|
+
textAlign: `${textAlign}`,
|
|
95
|
+
lineHeight: `${titleLineHeight == 'auto' ? 'normal' : titleLineHeight}`,
|
|
96
|
+
};
|
|
97
|
+
const desStyle = {
|
|
98
|
+
display: `${boxStyle}`,
|
|
99
|
+
WebkitLineClamp: `${desMaxLines ? desMaxLines : 'inherit'}`,
|
|
100
|
+
overflow: 'hidden',
|
|
101
|
+
color: `${desColor}`,
|
|
102
|
+
fontWeight: `${desFontWeight}`,
|
|
103
|
+
fontSize: `${desFontSize}` + 'px',
|
|
104
|
+
textAlign: `${textAlign}`,
|
|
105
|
+
lineHeight: `${desLineHeight == 'auto' ? 'normal' : desLineHeight}`,
|
|
106
|
+
};
|
|
107
|
+
// 图片高度: 100% 基础下 H5: 1列 200px;2列 98px PC: 3列 220px 4列 162px
|
|
108
|
+
const imageStyle = React.useMemo(() => {
|
|
109
|
+
let width = '100%';
|
|
110
|
+
let height = platform === 'h5' ? '200' : '220';
|
|
111
|
+
if (platform === 'h5' && ColMobile === 2) {
|
|
112
|
+
height = '98';
|
|
113
|
+
}
|
|
114
|
+
if (platform !== 'h5' && ColPC === 4) {
|
|
115
|
+
height = '162';
|
|
116
|
+
}
|
|
117
|
+
const numReg = /^\d+$/;
|
|
118
|
+
width = numReg.test(iconWidthSize) ? iconWidthSize + 'px' : iconWidthSize;
|
|
119
|
+
height = numReg.test(iconHeightSize)
|
|
120
|
+
? iconHeightSize + 'px' //纯数字
|
|
121
|
+
: iconHeightSize.indexOf('%') == -1
|
|
122
|
+
? iconHeightSize
|
|
123
|
+
: (Number(height) * parseInt(iconHeightSize)) / 100 + 'px';
|
|
124
|
+
return { width, height };
|
|
125
|
+
}, [iconWidthSize, iconHeightSize, ColMobile, ColPC, isH5]);
|
|
126
|
+
const tapTo = (colInfo = navOption[0]) => {
|
|
127
|
+
switch (colInfo === null || colInfo === void 0 ? void 0 : colInfo.tapStatus) {
|
|
128
|
+
case 'tap':
|
|
129
|
+
return null;
|
|
130
|
+
case 'inside':
|
|
131
|
+
if (colInfo.insideUrl) {
|
|
132
|
+
app.navigateTo({
|
|
133
|
+
mode: 'weDa',
|
|
134
|
+
pageId: colInfo.insideUrl,
|
|
135
|
+
params: (colInfo === null || colInfo === void 0 ? void 0 : colInfo.withParams) && (colInfo === null || colInfo === void 0 ? void 0 : colInfo.params.length) > 0
|
|
136
|
+
? colInfo.paramObj
|
|
137
|
+
: null,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
//return renderCancel();
|
|
142
|
+
case 'outer':
|
|
143
|
+
if (colInfo.newPage) {
|
|
144
|
+
colInfo.outerUrl ? window.open(colInfo.outerUrl) : false;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
colInfo.outerUrl ? (window.location.href = colInfo.outerUrl) : false;
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
155
|
+
React.createElement("div", { className: cls, "data-testid": "graphicCard", style: style },
|
|
156
|
+
React.createElement("div", { className: `${CLASS_PREFIX}__wrapper` }, cardList.map((row, rowIndex) => {
|
|
157
|
+
return (React.createElement(Row, { className: `${CLASS_PREFIX}__row`, key: rowIndex },
|
|
158
|
+
React.createElement(React.Fragment, null, row &&
|
|
159
|
+
row.map((col, colIndex) => {
|
|
160
|
+
return (
|
|
161
|
+
// 每列内容左右间距为0.1栅格列宽
|
|
162
|
+
React.createElement(Col, { style: {
|
|
163
|
+
width: `${(1 / colCount) * 100}%`,
|
|
164
|
+
padding: `0 ${singleGrid * 0.1}px`,
|
|
165
|
+
cursor: (col === null || col === void 0 ? void 0 : col.tapStatus) != 'tap' ? 'pointer' : 'auto',
|
|
166
|
+
}, className: `${CLASS_PREFIX}__col ${CLASS_PREFIX}__col--${textAlign}`, key: colIndex },
|
|
167
|
+
React.createElement("div", { className: "wedatea2td-grid__box", "data-testid": `${colIndex}_click`, onClick: () => tapTo(col) },
|
|
168
|
+
React.createElement("div", { className: `${CLASS_PREFIX}__col-body` },
|
|
169
|
+
col && (React.createElement("div", { className: `${CLASS_PREFIX}__icon`, style: imageStyle },
|
|
170
|
+
React.createElement(Image, { mode: 'scaleToFill', lazyLoad: false, maskClosable: false, imgPreview: false, fit: 'cover', alt: '', src: col === null || col === void 0 ? void 0 : col.icon, className: `${CLASS_PREFIX}__img` }))),
|
|
171
|
+
React.createElement("div", { className: `${CLASS_PREFIX}__detail` },
|
|
172
|
+
titleVisible && (col === null || col === void 0 ? void 0 : col.title) && (React.createElement("div", { className: `${CLASS_PREFIX}__title`, style: titleStyle }, col === null || col === void 0 ? void 0 : col.title)),
|
|
173
|
+
desVisible && (col === null || col === void 0 ? void 0 : col.des) && (React.createElement("div", { className: `${CLASS_PREFIX}__desc`, style: desStyle }, col === null || col === void 0 ? void 0 : col.des)))),
|
|
174
|
+
buttonVisible && col && (React.createElement(Button, { type: "link", className: `${CLASS_PREFIX}__btn` },
|
|
175
|
+
React.createElement(Text, { className: `${CLASS_PREFIX}__btn--text` }, buttonText),
|
|
176
|
+
React.createElement(IconFont, { name: "arrow-right", className: `${CLASS_PREFIX}__btn-icon` }))))));
|
|
177
|
+
}))));
|
|
178
|
+
})))));
|
|
179
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PropsType } from './index';
|
|
3
|
+
interface ImageInnerPropsType extends Omit<PropsType, 'fit' | 'mode'> {
|
|
4
|
+
objectFit: React.CSSProperties['objectFit'];
|
|
5
|
+
isError: boolean;
|
|
6
|
+
setIsError: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function ImageInner({ objectFit, style, className, alt, src, isError, setIsError, events, lazyLoad, maskClosable, imgPreview, }: ImageInnerPropsType): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ConfigProvider, ImagePreview } from 'tea-component';
|
|
3
|
+
import { usePlatform } from '../../utils/platform';
|
|
4
|
+
import { useGesture } from '@use-gesture/react';
|
|
5
|
+
export function ImageInner({ objectFit, style, className, alt, src, isError, setIsError, events, lazyLoad, maskClosable, imgPreview, }) {
|
|
6
|
+
const platform = usePlatform();
|
|
7
|
+
const [imgShow, setImgShow] = React.useState(false);
|
|
8
|
+
const onMaskClick = () => {
|
|
9
|
+
if (maskClosable) {
|
|
10
|
+
setImgShow(false);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const [showHeight, setShowHeight] = React.useState(0);
|
|
14
|
+
const realWidth = React.useRef(0);
|
|
15
|
+
const realHeight = React.useRef(0);
|
|
16
|
+
const [offsetHeight, setOffsetHeight] = React.useState(0);
|
|
17
|
+
const [translateX, setTranslateX] = React.useState(0);
|
|
18
|
+
const [translateY, setTranslateY] = React.useState(0);
|
|
19
|
+
const [previewScale, setPreviewScale] = React.useState(1);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
// 防止触发浏览器的放大缩小
|
|
22
|
+
const handler = (e) => e.preventDefault();
|
|
23
|
+
document.addEventListener('gesturestart', handler);
|
|
24
|
+
document.addEventListener('gesturechange', handler);
|
|
25
|
+
return () => {
|
|
26
|
+
document.removeEventListener('gesturestart', handler);
|
|
27
|
+
document.removeEventListener('gesturechange', handler);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
const bind = useGesture({
|
|
31
|
+
onClick: ({ event }) => {
|
|
32
|
+
// 防止冒泡出发关闭预览
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
},
|
|
35
|
+
onPinch: ({ offset }) => {
|
|
36
|
+
const [s] = offset;
|
|
37
|
+
setPreviewScale(s);
|
|
38
|
+
},
|
|
39
|
+
onDrag: ({ offset, event }) => {
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
const [x, y] = offset;
|
|
42
|
+
setTranslateX(x);
|
|
43
|
+
setTranslateY(y);
|
|
44
|
+
},
|
|
45
|
+
}, {
|
|
46
|
+
drag: {
|
|
47
|
+
delay: true,
|
|
48
|
+
preventDefault: true,
|
|
49
|
+
},
|
|
50
|
+
pinch: {
|
|
51
|
+
scaleBounds: { min: 0.6, max: 5 },
|
|
52
|
+
pointer: {
|
|
53
|
+
touch: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
if (platform === 'h5' || !imgPreview || isError) {
|
|
58
|
+
return (React.createElement(React.Fragment, null,
|
|
59
|
+
React.createElement("img", { style: {
|
|
60
|
+
objectFit,
|
|
61
|
+
...style,
|
|
62
|
+
}, className: className, alt: alt, src: src, onLoad: (e) => {
|
|
63
|
+
const img = e.target;
|
|
64
|
+
const { naturalHeight, naturalWidth } = img;
|
|
65
|
+
realHeight.current = naturalHeight;
|
|
66
|
+
realWidth.current = naturalWidth;
|
|
67
|
+
setIsError(false);
|
|
68
|
+
events.load && events.load({}, { originEvent: e });
|
|
69
|
+
}, onError: (e) => {
|
|
70
|
+
setIsError(true);
|
|
71
|
+
events.error && events.error({}, { originEvent: e });
|
|
72
|
+
}, onClick: (e) => {
|
|
73
|
+
if (imgPreview && !isError) {
|
|
74
|
+
setTranslateX(0);
|
|
75
|
+
setTranslateY(0);
|
|
76
|
+
setPreviewScale(1);
|
|
77
|
+
const windowHeight = window.innerHeight;
|
|
78
|
+
const windowWidth = window.innerWidth;
|
|
79
|
+
let ratio = realWidth.current / realHeight.current;
|
|
80
|
+
if (Number.isNaN(ratio)) {
|
|
81
|
+
ratio = 1;
|
|
82
|
+
}
|
|
83
|
+
const height = windowWidth / ratio;
|
|
84
|
+
setOffsetHeight(windowHeight / 2 - height / 2);
|
|
85
|
+
setShowHeight(height);
|
|
86
|
+
setImgShow(true);
|
|
87
|
+
}
|
|
88
|
+
events.tap && events.tap({}, { originEvent: e });
|
|
89
|
+
}, loading: lazyLoad ? 'lazy' : undefined }),
|
|
90
|
+
imgShow && (React.createElement("div", { className: "weda-img-mask", onClick: onMaskClick },
|
|
91
|
+
React.createElement("div", { onClick: () => setImgShow(false), className: "weda-img-modal-close-btn" },
|
|
92
|
+
React.createElement("i", { className: "weui-icon-clear", style: { color: 'white' } })),
|
|
93
|
+
React.createElement("div", { ...bind(), className: "weda-img-preview", style: {
|
|
94
|
+
touchAction: 'none',
|
|
95
|
+
backgroundImage: `url(${src})`,
|
|
96
|
+
width: '100%',
|
|
97
|
+
height: showHeight,
|
|
98
|
+
marginTop: offsetHeight,
|
|
99
|
+
transform: `translate(${translateX}px, ${translateY}px) scale(${previewScale})`,
|
|
100
|
+
} })))));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
104
|
+
React.createElement(ImagePreview, { previewSrc: src, maskClosable: maskClosable, className: className, style: { ...style, objectFit } }, (open) => (React.createElement("img", { style: {
|
|
105
|
+
objectFit,
|
|
106
|
+
cursor: 'zoom-in',
|
|
107
|
+
...style,
|
|
108
|
+
}, className: className, alt: alt, src: src, onLoad: (e) => {
|
|
109
|
+
setIsError(false);
|
|
110
|
+
events.load && events.load({}, { originEvent: e });
|
|
111
|
+
}, onError: (e) => {
|
|
112
|
+
setIsError(true);
|
|
113
|
+
events.error && events.error({}, { originEvent: e });
|
|
114
|
+
}, loading: lazyLoad ? 'lazy' : undefined, onClick: (e) => {
|
|
115
|
+
open();
|
|
116
|
+
events.tap && events.tap({}, { originEvent: e });
|
|
117
|
+
} })))));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
import type { CommonPropsType } from '../../types';
|
|
4
|
+
declare type TMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
5
|
+
export interface PropsType extends CommonPropsType, Pick<HTMLImageElement, 'src' | 'alt'> {
|
|
6
|
+
mode: TMode;
|
|
7
|
+
lazyLoad: boolean;
|
|
8
|
+
maskClosable: boolean;
|
|
9
|
+
imgPreview: boolean;
|
|
10
|
+
fit: React.CSSProperties['objectFit'] | ('widthFix' | 'heightFix');
|
|
11
|
+
}
|
|
12
|
+
export default function Image({ className, events, style, src, alt, mode, lazyLoad, imgPreview, maskClosable, fit, }: PropsType): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import { ImageInner } from './image';
|
|
6
|
+
import { emptyObject } from '../../utils/constant';
|
|
7
|
+
import { useTempUrl } from '../../utils/use-cloud-id-temp-url';
|
|
8
|
+
export default function Image({
|
|
9
|
+
// 系统属性
|
|
10
|
+
className, events = emptyObject, style,
|
|
11
|
+
// 组件属性
|
|
12
|
+
src, alt, mode, lazyLoad, imgPreview, maskClosable, fit, }) {
|
|
13
|
+
const [isError, setIsError] = useState(false);
|
|
14
|
+
const cls = classNames({
|
|
15
|
+
'weda-ui': true,
|
|
16
|
+
'weda-image': true,
|
|
17
|
+
'weda-image-error': isError,
|
|
18
|
+
[className]: className,
|
|
19
|
+
});
|
|
20
|
+
const objectFit = fit || getObjectFitByWxImageMode(mode);
|
|
21
|
+
const { data: realSrc } = useTempUrl(src);
|
|
22
|
+
/**
|
|
23
|
+
* 模拟小程序的widthFix、heightFix模式
|
|
24
|
+
*/
|
|
25
|
+
const realFit = useMemo(() => {
|
|
26
|
+
if (objectFit === 'widthFix' || objectFit === 'heightFix') {
|
|
27
|
+
return 'scale-down';
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return objectFit;
|
|
31
|
+
}
|
|
32
|
+
}, [objectFit]);
|
|
33
|
+
const realStyle = useMemo(() => {
|
|
34
|
+
if (objectFit === 'widthFix') {
|
|
35
|
+
return {
|
|
36
|
+
...style,
|
|
37
|
+
height: 'auto',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else if (objectFit === 'heightFix') {
|
|
41
|
+
return {
|
|
42
|
+
...style,
|
|
43
|
+
width: 'auto',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return style;
|
|
48
|
+
}
|
|
49
|
+
}, [style, fit]);
|
|
50
|
+
return src === realSrc || (realSrc !== undefined && src !== realSrc) ? (React.createElement(ImageInner, { objectFit: realFit, style: realStyle, className: cls, alt: alt, src: realSrc, isError: isError, setIsError: setIsError, events: events, lazyLoad: lazyLoad, imgPreview: imgPreview, maskClosable: maskClosable })) : null;
|
|
51
|
+
}
|
|
52
|
+
function getObjectFitByWxImageMode(mode) {
|
|
53
|
+
const array = [
|
|
54
|
+
{
|
|
55
|
+
mode: 'scaleToFill',
|
|
56
|
+
h5: 'fill',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
mode: 'aspectFit',
|
|
60
|
+
h5: 'contain',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
mode: 'aspectFill',
|
|
64
|
+
h5: 'cover',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
mode: 'widthFix',
|
|
68
|
+
h5: 'cover',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
mode: 'heightFix',
|
|
72
|
+
h5: 'contain',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
const item = array.find((item) => item.mode === mode);
|
|
76
|
+
return item === null || item === void 0 ? void 0 : item.h5;
|
|
77
|
+
}
|