@cloudbase/weda-ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +962 -0
- package/dist/src/configs/components/chart/line.json +878 -0
- package/dist/src/configs/components/chart/pie.json +685 -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 +66 -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 +191 -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 +45 -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 +10 -0
- package/dist/src/web/components/chart/common/Chart.js +31 -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 +248 -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 +72 -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/error-boundary.d.ts +5 -0
- package/dist/src/web/components/common/error-boundary.js +33 -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/common/use-loop-render-detect.d.ts +11 -0
- package/dist/src/web/components/common/use-loop-render-detect.js +124 -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 +150 -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 +94 -0
- package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
- package/dist/src/web/components/form/location/common/mapChoose.js +496 -0
- package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
- package/dist/src/web/components/form/location/common/mapView.js +175 -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/tmap.d.ts +3 -0
- package/dist/src/web/components/form/location/common/tmap.js +21 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.js +105 -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 +328 -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 +228 -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 +24 -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 +944 -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 +466 -0
- package/dist/src/web/components/form/select/index.d.ts +66 -0
- package/dist/src/web/components/form/select/index.js +255 -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 +330 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +302 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.js +101 -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 +252 -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 +157 -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/getUserService.d.ts +11 -0
- package/dist/src/web/components/form/userOrgSelect/getUserService.js +159 -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 +27 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +253 -0
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +36 -0
- package/dist/src/web/components/form/userOrgSelect/utils.js +80 -0
- package/dist/src/web/components/formdetail/index.d.ts +28 -0
- package/dist/src/web/components/formdetail/index.js +173 -0
- package/dist/src/web/components/graphicCard/index.d.ts +46 -0
- package/dist/src/web/components/graphicCard/index.js +178 -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 +297 -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 +385 -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 +351 -0
- package/dist/src/web/components/richTextView/index.d.ts +7 -0
- package/dist/src/web/components/richTextView/index.js +46 -0
- package/dist/src/web/components/scrollView/index.d.ts +26 -0
- package/dist/src/web/components/scrollView/index.js +97 -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 +20 -0
- package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
- package/dist/src/web/components/tabs/tabs.h5.js +44 -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 +19 -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 +156 -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/console.d.ts +3 -0
- package/dist/src/web/utils/console.js +26 -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 +16 -0
- package/dist/src/web/utils/weui.d.ts +1 -0
- package/dist/src/web/utils/weui.js +2 -0
- package/dist/web/components/form/input/index.css +16 -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/userOrgSelect/userOrgSelect.css +809 -0
- package/package.json +34 -21
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* eslint-disable rulesdir/no-timer */
|
|
2
|
+
export default class LotteryAction {
|
|
3
|
+
constructor() {
|
|
4
|
+
Object.defineProperty(this, "idx", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true,
|
|
8
|
+
value: void 0
|
|
9
|
+
});
|
|
10
|
+
// 开始抽奖
|
|
11
|
+
Object.defineProperty(this, "isStart", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
// 结束位置
|
|
18
|
+
Object.defineProperty(this, "endId", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
// 抽奖速度
|
|
25
|
+
Object.defineProperty(this, "speed", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
// 持续时长
|
|
32
|
+
Object.defineProperty(this, "duration", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: void 0
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "maxIdx", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: void 0
|
|
43
|
+
});
|
|
44
|
+
// 回调动作
|
|
45
|
+
Object.defineProperty(this, "animationCallback", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: void 0
|
|
50
|
+
});
|
|
51
|
+
// 是否异常
|
|
52
|
+
Object.defineProperty(this, "isError", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: void 0
|
|
57
|
+
});
|
|
58
|
+
// 是否加速
|
|
59
|
+
Object.defineProperty(this, "isSpeedUp", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: void 0
|
|
64
|
+
});
|
|
65
|
+
// 超时时间
|
|
66
|
+
Object.defineProperty(this, "timeout", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: void 0
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(this, "timer", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: void 0
|
|
77
|
+
});
|
|
78
|
+
// 当前位置
|
|
79
|
+
this.idx = -1;
|
|
80
|
+
// 开始抽奖
|
|
81
|
+
this.isStart = false;
|
|
82
|
+
// 结束位置
|
|
83
|
+
this.endId = undefined;
|
|
84
|
+
// 抽奖速度
|
|
85
|
+
this.speed = 0;
|
|
86
|
+
// 持续时长
|
|
87
|
+
this.duration = 2000;
|
|
88
|
+
// 长度
|
|
89
|
+
this.maxIdx = 8;
|
|
90
|
+
// 回调动作
|
|
91
|
+
this.animationCallback = () => { };
|
|
92
|
+
// 是否异常
|
|
93
|
+
this.isError = false;
|
|
94
|
+
// 是否加速
|
|
95
|
+
this.isSpeedUp = false;
|
|
96
|
+
//超时时间
|
|
97
|
+
this.timeout = 6000;
|
|
98
|
+
}
|
|
99
|
+
start(prizeResult, errorCallback) {
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
this.isStart = false;
|
|
102
|
+
const reg = /^\+?[1-9]\d*$/;
|
|
103
|
+
if (!reg.test(prizeResult)) {
|
|
104
|
+
this.isError = true;
|
|
105
|
+
if (errorCallback) {
|
|
106
|
+
errorCallback();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, this.duration);
|
|
110
|
+
// 在转动时长的一半,开始减速转动
|
|
111
|
+
setTimeout(() => {
|
|
112
|
+
this.isSpeedUp = false;
|
|
113
|
+
}, this.duration / 2);
|
|
114
|
+
// 超时,当出现一些意外的情况终止动画
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
if (this.endId === undefined) {
|
|
117
|
+
this.end(prizeResult);
|
|
118
|
+
}
|
|
119
|
+
}, this.timeout);
|
|
120
|
+
this.isStart = true;
|
|
121
|
+
this.isError = false;
|
|
122
|
+
this.isSpeedUp = true;
|
|
123
|
+
this.loop();
|
|
124
|
+
}
|
|
125
|
+
end(prizeResult) {
|
|
126
|
+
this.endId = prizeResult;
|
|
127
|
+
}
|
|
128
|
+
error() {
|
|
129
|
+
this.isError = true;
|
|
130
|
+
}
|
|
131
|
+
stop() {
|
|
132
|
+
this.isStart = false;
|
|
133
|
+
this.end(-1);
|
|
134
|
+
clearTimeout(this.timer);
|
|
135
|
+
}
|
|
136
|
+
pointOnCubicBezier(cp, t) {
|
|
137
|
+
const x = Math.pow(1 - t, 2) * cp[0] +
|
|
138
|
+
2 * t * (1 - t) * cp[1] +
|
|
139
|
+
Math.pow(t, 2) * cp[2];
|
|
140
|
+
return x;
|
|
141
|
+
}
|
|
142
|
+
loop() {
|
|
143
|
+
const { animationCallback } = this;
|
|
144
|
+
this.timer = setTimeout(() => {
|
|
145
|
+
const over = !this.isStart && this.endId !== undefined;
|
|
146
|
+
// emit
|
|
147
|
+
animationCallback({ idx: this.idx, isEnd: false });
|
|
148
|
+
// compare
|
|
149
|
+
if (this.idx < this.maxIdx) {
|
|
150
|
+
this.idx++;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.idx = 1;
|
|
154
|
+
}
|
|
155
|
+
// continue
|
|
156
|
+
if (!(over && String(this.idx) === String(this.endId)) && !this.isError) {
|
|
157
|
+
if (this.isSpeedUp) {
|
|
158
|
+
const point = this.pointOnCubicBezier([500, 50, 100], 1 / 10);
|
|
159
|
+
this.speed = point;
|
|
160
|
+
if (this.speed < 100) {
|
|
161
|
+
this.speed = 100;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const point = this.pointOnCubicBezier([100, 50, 500], 1 / 10);
|
|
166
|
+
this.speed = point;
|
|
167
|
+
if (this.speed > 1000) {
|
|
168
|
+
this.speed = 1000;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
this.loop();
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
if (this.isError)
|
|
175
|
+
return;
|
|
176
|
+
animationCallback({ idx: this.idx, isEnd: true });
|
|
177
|
+
this.idx = -1;
|
|
178
|
+
}
|
|
179
|
+
}, this.speed);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ModalProps } from 'tea-component';
|
|
3
|
+
import type { CommonPropsType, ICompRef } from '../../types';
|
|
4
|
+
export interface PropTypes extends ModalProps, CommonPropsType {
|
|
5
|
+
content: string;
|
|
6
|
+
customButton: React.ReactNode;
|
|
7
|
+
customContent: React.ReactNode;
|
|
8
|
+
isDefaultButton: boolean;
|
|
9
|
+
outerRef: React.Ref<TCompRef>;
|
|
10
|
+
}
|
|
11
|
+
declare type TCompRef = ICompRef<{
|
|
12
|
+
close: () => void;
|
|
13
|
+
open: () => void;
|
|
14
|
+
toggle: () => void;
|
|
15
|
+
}>;
|
|
16
|
+
declare const _default: React.ForwardRefExoticComponent<PropTypes & React.RefAttributes<TCompRef>>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { usePlatform } from '../../utils/platform';
|
|
3
|
+
import { ModalPc } from './modal.pc';
|
|
4
|
+
import { ModalH5 } from './modal.h5';
|
|
5
|
+
export default React.forwardRef(function WeDaModal(props, ref) {
|
|
6
|
+
const platform = usePlatform();
|
|
7
|
+
if (platform === 'h5') {
|
|
8
|
+
return React.createElement(ModalH5, { ...props, outerRef: ref });
|
|
9
|
+
}
|
|
10
|
+
return React.createElement(ModalPc, { size: "auto", ...props, outerRef: ref });
|
|
11
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Container, Text, Button } from '../index';
|
|
3
|
+
import './h5.css';
|
|
4
|
+
import { useSyncValue } from '../../utils/useSyncValue';
|
|
5
|
+
export function ModalH5(props) {
|
|
6
|
+
const { events, visible, content, isDefaultButton, customButton, customContent, outerRef, } = props;
|
|
7
|
+
const [isVisible, setIsVisible] = useSyncValue(visible);
|
|
8
|
+
React.useImperativeHandle(outerRef, () => {
|
|
9
|
+
return {
|
|
10
|
+
methods: {
|
|
11
|
+
close: () => {
|
|
12
|
+
setIsVisible(false);
|
|
13
|
+
},
|
|
14
|
+
open: () => {
|
|
15
|
+
setIsVisible(true);
|
|
16
|
+
},
|
|
17
|
+
toggle: () => {
|
|
18
|
+
setIsVisible((prev) => !prev);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}, [setIsVisible]);
|
|
23
|
+
const buttonEvents = React.useMemo(() => {
|
|
24
|
+
return {
|
|
25
|
+
tap: events.confirm,
|
|
26
|
+
};
|
|
27
|
+
}, [events]);
|
|
28
|
+
const closeEvents = React.useMemo(() => {
|
|
29
|
+
return {
|
|
30
|
+
tap: events.close,
|
|
31
|
+
};
|
|
32
|
+
}, [events]);
|
|
33
|
+
if (!isVisible) {
|
|
34
|
+
return React.createElement(Container, { className: "lcap-modal" });
|
|
35
|
+
}
|
|
36
|
+
return (React.createElement(Container, { className: "lcap-modal" },
|
|
37
|
+
React.createElement(Container, { className: "container" },
|
|
38
|
+
React.createElement(Container, { className: "lcap-modal__mask" }),
|
|
39
|
+
React.createElement(Container, { className: `lcap-modal__dialog ${isVisible ? 'enter' : ''}` },
|
|
40
|
+
React.createElement(Container, { className: "lcap-modal__close_btn", events: closeEvents },
|
|
41
|
+
React.createElement(Container, { className: "lcap-icon-close lcap-icon", style: {
|
|
42
|
+
fontSize: 24,
|
|
43
|
+
} })),
|
|
44
|
+
React.createElement(Container, { title: "modal-header" }, content ? (React.createElement(Text, { level: "0", text: content, maxLines: 2, userSelect: true, space: false, contenteditable: 'false' })) : (customContent)),
|
|
45
|
+
React.createElement(Container, { className: "lcap-modal__confirm_btn" }, isDefaultButton ? (React.createElement(Button, { className: "lcap-modal__default_btn", text: "\u786E\u5B9A", events: buttonEvents })) : (customButton))))));
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Modal, Button, ConfigProvider } from 'tea-component';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import { useSyncValue } from '../../utils/useSyncValue';
|
|
5
|
+
export function ModalPc(props) {
|
|
6
|
+
const { className, content, visible, customButton, customContent, isDefaultButton, size, events, outerRef, ...restProps } = props;
|
|
7
|
+
const [isVisible, setIsVisible] = useSyncValue(visible);
|
|
8
|
+
React.useImperativeHandle(outerRef, () => {
|
|
9
|
+
return {
|
|
10
|
+
methods: {
|
|
11
|
+
close: () => {
|
|
12
|
+
setIsVisible(false);
|
|
13
|
+
},
|
|
14
|
+
open: () => {
|
|
15
|
+
setIsVisible(true);
|
|
16
|
+
},
|
|
17
|
+
toggle: () => {
|
|
18
|
+
setIsVisible((prev) => !prev);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}, [setIsVisible]);
|
|
23
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
24
|
+
React.createElement(Modal, { size: size, className: classNames('weda-ui', 'lcap-modal', 'container', className), visible: isVisible, onClose: () => {
|
|
25
|
+
events.close();
|
|
26
|
+
}, ...restProps },
|
|
27
|
+
React.createElement(Modal.Body, null, content ? content : customContent),
|
|
28
|
+
React.createElement(Modal.Footer, null, isDefaultButton ? (React.createElement(Button, { type: "primary", onClick: () => {
|
|
29
|
+
events.confirm();
|
|
30
|
+
} }, "\u786E\u5B9A")) : (customButton)))));
|
|
31
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../types';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export declare type INavOption = {
|
|
5
|
+
params: Array<{
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}>;
|
|
9
|
+
paramObj?: any;
|
|
10
|
+
icon?: string;
|
|
11
|
+
iconSrc?: string;
|
|
12
|
+
title: string;
|
|
13
|
+
tapStatus: 'tap' | 'inside' | 'outer';
|
|
14
|
+
insideUrl?: string;
|
|
15
|
+
outerUrl?: string;
|
|
16
|
+
newPage?: boolean;
|
|
17
|
+
withParams?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export default function NavLayout({ navOption, mobileCol, pcCol, iconSize, textColor, fontSize, lineHeight, fontWeight, maxLines, className, style, }: H5NavLayoutProps): JSX.Element;
|
|
20
|
+
export interface H5NavLayoutProps extends CommonPropsType {
|
|
21
|
+
/**
|
|
22
|
+
* 导航配置
|
|
23
|
+
*/
|
|
24
|
+
navOption?: Readonly<INavOption[]>;
|
|
25
|
+
/**
|
|
26
|
+
* 移动端每行列数
|
|
27
|
+
*/
|
|
28
|
+
mobileCol?: number;
|
|
29
|
+
/**
|
|
30
|
+
* PC端每行列数
|
|
31
|
+
*/
|
|
32
|
+
pcCol?: number;
|
|
33
|
+
/**
|
|
34
|
+
* icon尺寸
|
|
35
|
+
*/
|
|
36
|
+
iconSize?: 'medium' | 'samll' | 'big';
|
|
37
|
+
/**
|
|
38
|
+
* 标题颜色
|
|
39
|
+
*/
|
|
40
|
+
textColor?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 标题字重
|
|
43
|
+
*/
|
|
44
|
+
fontWeight?: 'lighter' | 'normal' | 'bolder';
|
|
45
|
+
/**
|
|
46
|
+
* 最大行数
|
|
47
|
+
*/
|
|
48
|
+
maxLines?: number;
|
|
49
|
+
/**
|
|
50
|
+
* 字号
|
|
51
|
+
*/
|
|
52
|
+
fontSize?: number;
|
|
53
|
+
/**
|
|
54
|
+
* 行高
|
|
55
|
+
*/
|
|
56
|
+
lineHeight: string;
|
|
57
|
+
/**
|
|
58
|
+
* 点击事件
|
|
59
|
+
*/
|
|
60
|
+
navTap?: (colInfo: any) => void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from '../../utils/classnames';
|
|
3
|
+
import { Row, Col, ConfigProvider } from 'tea-component';
|
|
4
|
+
import { usePlatform } from '../../utils/platform';
|
|
5
|
+
import './index.css';
|
|
6
|
+
import { IconFont } from 'tdesign-icons-react';
|
|
7
|
+
import Image from '../image';
|
|
8
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
9
|
+
import { emptyArray } from '../../utils/constant';
|
|
10
|
+
/**
|
|
11
|
+
* Web端
|
|
12
|
+
*/
|
|
13
|
+
const CLASS_PREFIX = 'weda-grid-navigation';
|
|
14
|
+
export default function NavLayout({ navOption = emptyArray, mobileCol, pcCol, iconSize, textColor, fontSize, lineHeight, fontWeight, maxLines, className, style, }) {
|
|
15
|
+
const platform = usePlatform();
|
|
16
|
+
// 两次默认值不同, 需要刷新
|
|
17
|
+
const prevNavOptionRef = React.useRef(null);
|
|
18
|
+
// 等分列占比
|
|
19
|
+
const [colCount, setColCount] = React.useState(4);
|
|
20
|
+
const prevColRef = React.useRef(0);
|
|
21
|
+
const cls = classNames({
|
|
22
|
+
[CLASS_PREFIX]: true,
|
|
23
|
+
[className]: className,
|
|
24
|
+
[`${CLASS_PREFIX}-mobile`]: platform === 'h5',
|
|
25
|
+
});
|
|
26
|
+
const navList = React.useMemo(() => {
|
|
27
|
+
const list = [];
|
|
28
|
+
if (prevColRef.current !== colCount ||
|
|
29
|
+
(navOption.length > 0 &&
|
|
30
|
+
!isObjectEqual(prevNavOptionRef.current !== navOption))) {
|
|
31
|
+
list.length = Math.floor(navOption.length / colCount);
|
|
32
|
+
list.forEach((item, index) => {
|
|
33
|
+
list[index] = [];
|
|
34
|
+
});
|
|
35
|
+
navOption.forEach((item, index) => {
|
|
36
|
+
const _index = Math.floor(index / colCount);
|
|
37
|
+
if (!list[_index] || list[_index].length <= 0) {
|
|
38
|
+
// 保证每个col 的数据都是有的,列入总共7个数据,那么第二行的3, 4,5数据是undefined, 占位
|
|
39
|
+
list[_index] = Array(colCount).fill(null);
|
|
40
|
+
}
|
|
41
|
+
const paramObj = {};
|
|
42
|
+
if (item === null || item === void 0 ? void 0 : item.params) {
|
|
43
|
+
for (const info of item.params) {
|
|
44
|
+
paramObj[info.key] = info.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
item.paramObj = paramObj;
|
|
48
|
+
list[_index][index - _index * colCount] = item;
|
|
49
|
+
prevNavOptionRef.current = [...navOption];
|
|
50
|
+
prevColRef.current = colCount;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return list;
|
|
54
|
+
}, [colCount, navOption]);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
setColCount(platform === 'h5' ? mobileCol : pcCol);
|
|
57
|
+
}, [mobileCol, pcCol, platform]);
|
|
58
|
+
// 每个col的宽度百分比
|
|
59
|
+
const colStyle = {
|
|
60
|
+
width: `${(1 / colCount) * 100}%`,
|
|
61
|
+
};
|
|
62
|
+
const mutiLabelStyle = {
|
|
63
|
+
width: '100%',
|
|
64
|
+
display: '-webkit-box',
|
|
65
|
+
WebkitLineClamp: `${maxLines ? maxLines : 'inherit'}`,
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
color: `${textColor}`,
|
|
68
|
+
fontWeight: `${fontWeight}`,
|
|
69
|
+
fontSize: `${fontSize}` + 'px',
|
|
70
|
+
lineHeight: `${lineHeight == 'auto' ? 'normal' : lineHeight}`,
|
|
71
|
+
};
|
|
72
|
+
const navTap = (colInfo = navOption[0]) => {
|
|
73
|
+
switch (colInfo === null || colInfo === void 0 ? void 0 : colInfo.tapStatus) {
|
|
74
|
+
case 'tap':
|
|
75
|
+
return null;
|
|
76
|
+
case 'inside':
|
|
77
|
+
if (colInfo.insideUrl) {
|
|
78
|
+
app.navigateTo({
|
|
79
|
+
mode: 'weDa',
|
|
80
|
+
pageId: colInfo.insideUrl,
|
|
81
|
+
params: (colInfo === null || colInfo === void 0 ? void 0 : colInfo.withParams) && (colInfo === null || colInfo === void 0 ? void 0 : colInfo.params.length) > 0
|
|
82
|
+
? colInfo.paramObj
|
|
83
|
+
: null,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case 'outer':
|
|
91
|
+
if (colInfo.newPage) {
|
|
92
|
+
colInfo.outerUrl ? window.open(colInfo.outerUrl) : false;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
colInfo.outerUrl ? (window.location.href = colInfo.outerUrl) : false;
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
default:
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
103
|
+
React.createElement("div", { className: cls, "data-testid": "navLayout", style: style },
|
|
104
|
+
React.createElement("div", { className: `${CLASS_PREFIX}__wrapper` }, navList.map((row, rowIndex) => {
|
|
105
|
+
return (React.createElement(Row, { className: `${CLASS_PREFIX}__row`, key: rowIndex },
|
|
106
|
+
React.createElement(React.Fragment, null, row &&
|
|
107
|
+
row.map((colInfo, colIndex) => {
|
|
108
|
+
return (React.createElement(Col, { style: {
|
|
109
|
+
...colStyle,
|
|
110
|
+
cursor: (colInfo === null || colInfo === void 0 ? void 0 : colInfo.tapStatus) != 'tap'
|
|
111
|
+
? 'pointer'
|
|
112
|
+
: 'auto',
|
|
113
|
+
}, className: `${CLASS_PREFIX}__col ${CLASS_PREFIX}__col--${iconSize}`, key: colIndex },
|
|
114
|
+
React.createElement("div", { "data-testid": `${colIndex}_click`, onClick: () => navTap(colInfo) },
|
|
115
|
+
!(colInfo === null || colInfo === void 0 ? void 0 : colInfo.iconSrc) ? (React.createElement(IconShow, { onIcon: colInfo === null || colInfo === void 0 ? void 0 : colInfo.icon })) : (React.createElement("div", { className: `${CLASS_PREFIX}__img` },
|
|
116
|
+
React.createElement(Image, { mode: 'scaleToFill', lazyLoad: false, maskClosable: false, imgPreview: false, fit: 'cover', alt: '', src: colInfo === null || colInfo === void 0 ? void 0 : colInfo.iconSrc, className: `${CLASS_PREFIX}__icon` }))),
|
|
117
|
+
(colInfo === null || colInfo === void 0 ? void 0 : colInfo.title) && (React.createElement("div", { className: `${CLASS_PREFIX}__text`, style: mutiLabelStyle }, colInfo === null || colInfo === void 0 ? void 0 : colInfo.title)))));
|
|
118
|
+
}))));
|
|
119
|
+
})))));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* icon回显组件
|
|
123
|
+
*/
|
|
124
|
+
const IconShow = ({ onIcon }) => {
|
|
125
|
+
return (React.createElement(React.Fragment, null, (onIcon === null || onIcon === void 0 ? void 0 : onIcon.includes('td:')) ? (React.createElement("div", null,
|
|
126
|
+
React.createElement(IconFont, { name: onIcon === null || onIcon === void 0 ? void 0 : onIcon.split(':')[1], className: `${CLASS_PREFIX}__fonticon` }))) : (React.createElement("div", { className: `${CLASS_PREFIX}__fonticon lcap-icon lcap-icon-${onIcon}` }))));
|
|
127
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IMenuItem, INavigationStyle } from './type';
|
|
3
|
+
export declare const renderTitle: (navigationStyle: INavigationStyle) => JSX.Element;
|
|
4
|
+
export declare const renderMenuTitle: (navigationStyle: INavigationStyle, item: Partial<IMenuItem>, hasIcon: boolean) => JSX.Element;
|
|
5
|
+
export declare const renderLogo: (navigationStyle: INavigationStyle, className: string) => JSX.Element;
|
|
6
|
+
export declare const IconShow: ({ onIcon, menuColor, menuFontSize }: {
|
|
7
|
+
onIcon: any;
|
|
8
|
+
menuColor: any;
|
|
9
|
+
menuFontSize: any;
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export declare const renderMenuIcon: (iconUrl: string, iconPath: string, navigationStyle: INavigationStyle) => JSX.Element;
|
|
12
|
+
export declare const navigateTo: (menu: IMenuItem) => void;
|
|
13
|
+
export declare const hasSelectedMenu: (menu: IMenuItem, selectedkey: string) => boolean;
|
|
14
|
+
export declare const expandMenu: (menuData: IMenuItem[], menuItem: Partial<IMenuItem>, init?: boolean) => any;
|
|
15
|
+
export declare const findMenuItemByPath: (menus: IMenuItem[], targetPath: string) => IMenuItem | null;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isUrl, resolveStaticResourceUrl } from '../../utils/platform';
|
|
3
|
+
import { IconFont } from 'tdesign-icons-react';
|
|
4
|
+
const CLASS_PREFIX = 'weda-menu';
|
|
5
|
+
// 标题
|
|
6
|
+
export const renderTitle = (navigationStyle) => {
|
|
7
|
+
const { title, titleColor, showTitle, titleFontSize } = navigationStyle;
|
|
8
|
+
return (showTitle && (React.createElement("span", { "data-testid": "navigationBar-title", style: {
|
|
9
|
+
display: 'inline-block',
|
|
10
|
+
color: titleColor,
|
|
11
|
+
fontSize: titleFontSize,
|
|
12
|
+
} }, title)));
|
|
13
|
+
};
|
|
14
|
+
// 菜单
|
|
15
|
+
export const renderMenuTitle = (navigationStyle, item, hasIcon) => {
|
|
16
|
+
const { menuColor, menuFontSize, showMenuIcon } = navigationStyle;
|
|
17
|
+
const { title, level, iconUrl, iconPath } = item;
|
|
18
|
+
return (React.createElement("span", { className: "menu-text", style: {
|
|
19
|
+
color: menuColor,
|
|
20
|
+
fontSize: menuFontSize,
|
|
21
|
+
}, "data-testid": "navigationBar-menu" },
|
|
22
|
+
showMenuIcon &&
|
|
23
|
+
level === 0 &&
|
|
24
|
+
hasIcon &&
|
|
25
|
+
renderMenuIcon(iconUrl, iconPath, navigationStyle),
|
|
26
|
+
title));
|
|
27
|
+
};
|
|
28
|
+
// 默认logo
|
|
29
|
+
const defaultLogoUrl = 'https://imgcache.qq.com/qcloud/tcloud_dtc/static/static_source_business/43d3b2b7-445c-4858-8eb0-50ac5d5cc08e.svg';
|
|
30
|
+
// logo
|
|
31
|
+
export const renderLogo = (navigationStyle, className) => {
|
|
32
|
+
const { showLogo, logoHeight, logoWidth, logoUrl, logoPath } = navigationStyle;
|
|
33
|
+
const src = resolveStaticResourceUrl(logoPath) || logoUrl;
|
|
34
|
+
return (showLogo && (React.createElement("img", { "data-testid": "navigationBar-logo", className: className, style: { width: `${logoWidth}px`, height: `${logoHeight}px` }, src: src || defaultLogoUrl, alt: "logo" })));
|
|
35
|
+
};
|
|
36
|
+
// icon回显
|
|
37
|
+
export const IconShow = ({ onIcon, menuColor, menuFontSize }) => {
|
|
38
|
+
return (React.createElement(React.Fragment, null, (onIcon === null || onIcon === void 0 ? void 0 : onIcon.includes('td:')) ? (React.createElement(IconFont, { name: onIcon === null || onIcon === void 0 ? void 0 : onIcon.split(':')[1], className: `${CLASS_PREFIX}__fonticon`, style: { color: menuColor, fontSize: menuFontSize } })) : (React.createElement("div", { className: `${CLASS_PREFIX}__fonticon lcap-icon lcap-icon-${onIcon}`, style: { color: menuColor, fontSize: menuFontSize } }))));
|
|
39
|
+
};
|
|
40
|
+
// 菜单图标
|
|
41
|
+
export const renderMenuIcon = (iconUrl, iconPath, navigationStyle) => {
|
|
42
|
+
const { menuColor, menuFontSize } = navigationStyle;
|
|
43
|
+
let icon = iconUrl || 'td:view-module';
|
|
44
|
+
if (iconUrl && isUrl(iconUrl)) {
|
|
45
|
+
icon = resolveStaticResourceUrl(iconPath) || iconUrl;
|
|
46
|
+
return (React.createElement("img", { className: `${CLASS_PREFIX}__item-icon`, style: { width: 16, height: 16, marginRight: 4 }, src: icon, alt: "logo" }));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return (React.createElement(IconShow, { onIcon: icon, menuColor: menuColor, menuFontSize: menuFontSize }));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// 页面跳转
|
|
53
|
+
export const navigateTo = (menu) => {
|
|
54
|
+
const { path, linkTargetBlank, linkUrl, type, key } = menu;
|
|
55
|
+
localStorage.setItem('selectedKey', key);
|
|
56
|
+
// 存储跳转页面的id
|
|
57
|
+
if (linkUrl && type === 'link') {
|
|
58
|
+
if (linkTargetBlank) {
|
|
59
|
+
window.open(linkUrl);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
window.location.href = linkUrl;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
app.navigateTo({
|
|
67
|
+
pageId: path === null || path === void 0 ? void 0 : path.replace('/', ''),
|
|
68
|
+
packageName: '',
|
|
69
|
+
mode: 'weDa',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
// 菜单是否展开
|
|
74
|
+
export const hasSelectedMenu = (menu, selectedkey) => {
|
|
75
|
+
var _a;
|
|
76
|
+
let opened = false;
|
|
77
|
+
if (menu.key === selectedkey) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
(_a = menu === null || menu === void 0 ? void 0 : menu.children) === null || _a === void 0 ? void 0 : _a.forEach((i) => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (i.key === selectedkey) {
|
|
83
|
+
opened = true;
|
|
84
|
+
}
|
|
85
|
+
if ((_a = i === null || i === void 0 ? void 0 : i.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
86
|
+
opened = hasSelectedMenu(i, selectedkey);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return opened;
|
|
90
|
+
};
|
|
91
|
+
// 点击展开/收起菜单
|
|
92
|
+
export const expandMenu = (menuData, menuItem, init = false) => {
|
|
93
|
+
const menus = JSON.parse(JSON.stringify(menuData));
|
|
94
|
+
return menus.map((i) => {
|
|
95
|
+
if (init) {
|
|
96
|
+
i.opened = hasSelectedMenu(i, menuItem.key);
|
|
97
|
+
}
|
|
98
|
+
else if (i.key === menuItem.key) {
|
|
99
|
+
i.opened = menuItem.opened;
|
|
100
|
+
}
|
|
101
|
+
if (i.children) {
|
|
102
|
+
return { ...i, children: expandMenu(i === null || i === void 0 ? void 0 : i.children, menuItem, init) };
|
|
103
|
+
}
|
|
104
|
+
return i;
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
// 根据path查找菜单
|
|
108
|
+
export const findMenuItemByPath = (menus, targetPath) => {
|
|
109
|
+
var _a;
|
|
110
|
+
const queue = [];
|
|
111
|
+
let targetNode = null;
|
|
112
|
+
menus.forEach((node) => queue.push(node));
|
|
113
|
+
while (queue.length) {
|
|
114
|
+
const node = queue.shift();
|
|
115
|
+
if (!node)
|
|
116
|
+
return null;
|
|
117
|
+
if (node.path === targetPath) {
|
|
118
|
+
// 添加节点
|
|
119
|
+
targetNode = node;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
(_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach((node) => queue.push(node));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return targetNode;
|
|
127
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IMenuItem, INavigationStyle } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* 移动端导航
|
|
5
|
+
*/
|
|
6
|
+
declare const H5Menu: React.FC<{
|
|
7
|
+
menuData: IMenuItem[];
|
|
8
|
+
navigationStyle: INavigationStyle;
|
|
9
|
+
setMenuData: (menus: IMenuItem[]) => void;
|
|
10
|
+
className: string;
|
|
11
|
+
selected: string;
|
|
12
|
+
setSelected: (selectedKey: string) => void;
|
|
13
|
+
}>;
|
|
14
|
+
export default H5Menu;
|