@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,153 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState, useEffect, useRef } from 'react';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import Swipe from 'react-easy-swipe';
|
|
5
|
+
import { useDebouncedCallback, useEventListener, useResizeObserver, } from '@react-hookz/web';
|
|
6
|
+
import './index.css';
|
|
7
|
+
import { emptyObject } from '../../utils/constant';
|
|
8
|
+
export default function Swiper({ children, className, style, autoplay = true, circular = true, vertical = false, indicatorDots, indicatorColor = 'rgba(200, 200, 200, 0.9)', indicatorActiveColor = 'rgba(0, 0, 0, 0.9)', duration = 500, interval = 5000, current = 0, events = emptyObject, id, }) {
|
|
9
|
+
const itemCount = React.Children.count(children);
|
|
10
|
+
current = Math.max(0, Math.min(itemCount - 1, current));
|
|
11
|
+
const [currentIndex, setCurrentIndex] = useState(current);
|
|
12
|
+
const [swipeStyle, setSwipeStyle] = useState(null);
|
|
13
|
+
const [height, setHeight] = useState(0);
|
|
14
|
+
const { change = () => { } } = events;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (autoplay) {
|
|
17
|
+
// 自动切换
|
|
18
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
19
|
+
const timer = setInterval(() => {
|
|
20
|
+
setIndex(currentIndex + 1);
|
|
21
|
+
}, interval);
|
|
22
|
+
return () => clearInterval(timer);
|
|
23
|
+
}
|
|
24
|
+
}, [currentIndex, autoplay, itemCount]);
|
|
25
|
+
// 触发切换
|
|
26
|
+
const pre = useRef({ index: currentIndex }).current;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
updateSwipeStyle(currentIndex, pre.index, itemCount);
|
|
29
|
+
change({
|
|
30
|
+
current: currentIndex,
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
pre.index = currentIndex;
|
|
34
|
+
};
|
|
35
|
+
}, [currentIndex, vertical]);
|
|
36
|
+
const outerWrapRef = useRef();
|
|
37
|
+
useEventListener(outerWrapRef, 'load', (e) => {
|
|
38
|
+
setHeight(e.target.clientHeight);
|
|
39
|
+
});
|
|
40
|
+
const itemsClone = React.Children.map(children, (x, i) => {
|
|
41
|
+
return (React.createElement("div", { className: "g-swiper-item", "data-index": i }, x));
|
|
42
|
+
});
|
|
43
|
+
const setIndex = (index) => {
|
|
44
|
+
if (index >= itemCount) {
|
|
45
|
+
index = 0;
|
|
46
|
+
}
|
|
47
|
+
if (index < 0) {
|
|
48
|
+
index = itemCount - 1;
|
|
49
|
+
}
|
|
50
|
+
setCurrentIndex(index);
|
|
51
|
+
};
|
|
52
|
+
// 设置容器样式、动画
|
|
53
|
+
// TODO fix settimeout mess
|
|
54
|
+
const updateSwipeStyle = (to, cur, length) => {
|
|
55
|
+
// 最后向前到最开始
|
|
56
|
+
if (to === 0 && cur === length - 1) {
|
|
57
|
+
circular &&
|
|
58
|
+
setSwipeStyle({
|
|
59
|
+
transform: `translate3d(0, 0, 0)`,
|
|
60
|
+
});
|
|
61
|
+
// 不知道
|
|
62
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
setSwipeStyle({
|
|
65
|
+
transform: vertical
|
|
66
|
+
? `translate3d(0, -100%, 0)`
|
|
67
|
+
: `translate3d(-100%, 0, 0)`,
|
|
68
|
+
transitionDuration: `${duration}ms`,
|
|
69
|
+
});
|
|
70
|
+
}, 50);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// 第一个后退到最后
|
|
74
|
+
if (to === length - 1 && cur === 0) {
|
|
75
|
+
circular &&
|
|
76
|
+
setSwipeStyle({
|
|
77
|
+
transform: vertical
|
|
78
|
+
? `translate3d(0, -${(to + 2) * 100}%, 0)`
|
|
79
|
+
: `translate3d(-${(to + 2) * 100}%, 0, 0)`,
|
|
80
|
+
});
|
|
81
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
setSwipeStyle({
|
|
84
|
+
transform: vertical
|
|
85
|
+
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
86
|
+
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
87
|
+
transitionDuration: `${duration}ms`,
|
|
88
|
+
});
|
|
89
|
+
}, 50);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const style = {
|
|
93
|
+
transform: vertical
|
|
94
|
+
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
95
|
+
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
96
|
+
};
|
|
97
|
+
if (to !== cur) {
|
|
98
|
+
style.transitionDuration = `${duration}ms`;
|
|
99
|
+
}
|
|
100
|
+
setSwipeStyle(style);
|
|
101
|
+
};
|
|
102
|
+
return (React.createElement("div", { className: classNames('g-swiper weda-ui', className, {
|
|
103
|
+
vertical: vertical,
|
|
104
|
+
}), style: { height: height ? height : 'auto', ...style }, ref: outerWrapRef, id: id },
|
|
105
|
+
itemCount > 0 ? (React.createElement(Swipe, { className: "g-swiper-list", style: swipeStyle, tolerance: 20, onSwipeLeft: () => {
|
|
106
|
+
vertical || setIndex(currentIndex + 1);
|
|
107
|
+
}, onSwipeRight: () => {
|
|
108
|
+
vertical || setIndex(currentIndex - 1);
|
|
109
|
+
}, onSwipeDown: () => {
|
|
110
|
+
vertical && setIndex(currentIndex - 1);
|
|
111
|
+
}, onSwipeUp: () => {
|
|
112
|
+
vertical && setIndex(currentIndex + 1);
|
|
113
|
+
} },
|
|
114
|
+
itemsClone[itemCount - 1],
|
|
115
|
+
React.Children.map(children, (x, i) => {
|
|
116
|
+
return (React.createElement(SwiperItem, { height: height, setHeight: setHeight, currentIndex: currentIndex, index: i }, x));
|
|
117
|
+
}),
|
|
118
|
+
itemsClone[0])) : null,
|
|
119
|
+
indicatorDots ? (React.createElement("div", { className: "g-swiper__pagination" }, React.Children.map(children, (x, i) => {
|
|
120
|
+
return (React.createElement("a", { href: "#", className: "g-swiper__pagination-bulletm", style: {
|
|
121
|
+
backgroundColor: currentIndex === i ? indicatorActiveColor : indicatorColor,
|
|
122
|
+
}, onClick: (e) => {
|
|
123
|
+
setIndex(i);
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
}, "data-index": i }));
|
|
126
|
+
}))) : (false),
|
|
127
|
+
React.createElement("a", { href: "#", className: "g-swiper__turn-pre", onClick: (ev) => {
|
|
128
|
+
ev.preventDefault();
|
|
129
|
+
setIndex(currentIndex - 1);
|
|
130
|
+
} }, "\u4E0A\u4E00\u9875"),
|
|
131
|
+
React.createElement("a", { href: "#", className: "g-swiper__turn-next", onClick: (ev) => {
|
|
132
|
+
ev.preventDefault();
|
|
133
|
+
setIndex(currentIndex + 1);
|
|
134
|
+
} }, "\u4E0B\u4E00\u9875")));
|
|
135
|
+
}
|
|
136
|
+
const SwiperItem = ({ height, setHeight, children, currentIndex, index }) => {
|
|
137
|
+
const firstChildRef = useRef(null);
|
|
138
|
+
const syncHeight = useDebouncedCallback((e) => {
|
|
139
|
+
setHeight(e.contentRect.height);
|
|
140
|
+
}, [setHeight], 500, 2000); // 必须debounce延迟,让resize完成后再设置高度
|
|
141
|
+
// 因为有loading 所以得用resizeobserver
|
|
142
|
+
useResizeObserver(firstChildRef, (e) => {
|
|
143
|
+
if (currentIndex === index) {
|
|
144
|
+
syncHeight(e);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return (React.createElement("div", { className: classNames('g-swiper-item', {
|
|
148
|
+
current: index === currentIndex,
|
|
149
|
+
}), "data-index": index },
|
|
150
|
+
React.createElement("div", { ref: firstChildRef, style: {
|
|
151
|
+
height: height > 0 ? '100%' : 'auto',
|
|
152
|
+
} }, children)));
|
|
153
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { CommonPropsType } from '../../types';
|
|
3
|
+
export interface PropsType extends CommonPropsType {
|
|
4
|
+
tabs: Readonly<{
|
|
5
|
+
title: string;
|
|
6
|
+
value: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}[]>;
|
|
9
|
+
selectedIndex: number | string;
|
|
10
|
+
isMultipleSlot: boolean;
|
|
11
|
+
[key: string]: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export default function Tabs(props: PropsType): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { usePlatform } from '../../utils/platform';
|
|
3
|
+
// import { fallback } from '../../utils/loading-fallback';
|
|
4
|
+
import TabsH5 from './tabs.h5';
|
|
5
|
+
import TabsPc from './tabs.pc';
|
|
6
|
+
export default function Tabs(props) {
|
|
7
|
+
const platform = usePlatform();
|
|
8
|
+
if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
|
|
9
|
+
return React.createElement(TabsPc, { ...props });
|
|
10
|
+
}
|
|
11
|
+
if ((props === null || props === void 0 ? void 0 : props.showType) === 'h5') {
|
|
12
|
+
return React.createElement(TabsH5, { ...props });
|
|
13
|
+
}
|
|
14
|
+
return platform === 'h5' ? React.createElement(TabsH5, { ...props }) : React.createElement(TabsPc, { ...props });
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import { useSyncValue } from '../../utils/useSyncValue';
|
|
5
|
+
import { useCustomCompareEffect, useSyncedRef } from '@react-hookz/web';
|
|
6
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
7
|
+
import { emptyArray } from '../../utils/constant';
|
|
8
|
+
export default function TabsH5({ tabs = emptyArray, selectedIndex, events, className, style, isMultipleSlot = true, ...restProps }) {
|
|
9
|
+
const [currentIndex, setCurrentIndex] = useSyncValue(typeof selectedIndex === 'string' ? parseInt(selectedIndex) : selectedIndex);
|
|
10
|
+
const stickyStyle = useMemo(() => {
|
|
11
|
+
const length = tabs.length;
|
|
12
|
+
return {
|
|
13
|
+
width: `${(1 / length) * 100}%`,
|
|
14
|
+
transform: `translate3d( ${currentIndex * 100}%, 0, 0)`,
|
|
15
|
+
};
|
|
16
|
+
}, [tabs, currentIndex]);
|
|
17
|
+
const eventRef = useSyncedRef(events);
|
|
18
|
+
useCustomCompareEffect(() => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
eventRef.current.change({
|
|
21
|
+
id: currentIndex,
|
|
22
|
+
label: (_a = tabs[currentIndex]) === null || _a === void 0 ? void 0 : _a.title,
|
|
23
|
+
value: (_b = tabs[currentIndex]) === null || _b === void 0 ? void 0 : _b.value,
|
|
24
|
+
});
|
|
25
|
+
}, [currentIndex, tabs], isObjectEqual);
|
|
26
|
+
return (React.createElement("div", { "data-testid": "tabs", className: classNames('weda-tabs weda-ui', {
|
|
27
|
+
[className]: className,
|
|
28
|
+
}), style: style },
|
|
29
|
+
React.createElement("div", { className: "weda-tabs__nav" }, tabs === null || tabs === void 0 ? void 0 :
|
|
30
|
+
tabs.map(({ name, title }, index) => (React.createElement("div", { className: classNames('weda-tabs__nav-cell', {
|
|
31
|
+
active: currentIndex === index,
|
|
32
|
+
scroll: currentIndex > 5,
|
|
33
|
+
}), key: name || index, onClick: () => {
|
|
34
|
+
setCurrentIndex(index);
|
|
35
|
+
} }, title))),
|
|
36
|
+
React.createElement("div", { className: "weda-tabs__nav-sticky", style: stickyStyle })),
|
|
37
|
+
React.createElement("div", { className: classNames({
|
|
38
|
+
'weda-tabs__panel': true,
|
|
39
|
+
}) }, isMultipleSlot
|
|
40
|
+
? restProps[`panel${currentIndex + 1}`]
|
|
41
|
+
: restProps['panel1'])));
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useCustomCompareEffect, useSyncedRef } from '@react-hookz/web';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Tabs as TeaTabs, TabPanel, ConfigProvider } from 'tea-component';
|
|
4
|
+
import classNames from '../../utils/classnames';
|
|
5
|
+
import { emptyArray } from '../../utils/constant';
|
|
6
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
7
|
+
import { useSyncValue } from '../../utils/useSyncValue';
|
|
8
|
+
export default function TabsPc({ tabs = emptyArray, selectedIndex, events, className, style, isMultipleSlot = true, ...restProps }) {
|
|
9
|
+
const [activeIndex, setActiveIndex] = useSyncValue(selectedIndex);
|
|
10
|
+
const _tabs = React.useMemo(() => {
|
|
11
|
+
return (Array.isArray(tabs) &&
|
|
12
|
+
tabs.length &&
|
|
13
|
+
tabs.map((item, index) => {
|
|
14
|
+
return {
|
|
15
|
+
id: index.toString(),
|
|
16
|
+
label: item.title,
|
|
17
|
+
value: item.value,
|
|
18
|
+
};
|
|
19
|
+
}));
|
|
20
|
+
}, [tabs]);
|
|
21
|
+
const eventsRef = useSyncedRef(events);
|
|
22
|
+
useCustomCompareEffect(() => {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
eventsRef.current &&
|
|
25
|
+
eventsRef.current.change({
|
|
26
|
+
id: (_a = _tabs[activeIndex]) === null || _a === void 0 ? void 0 : _a.id,
|
|
27
|
+
label: (_b = _tabs[activeIndex]) === null || _b === void 0 ? void 0 : _b.label,
|
|
28
|
+
value: (_c = _tabs[activeIndex]) === null || _c === void 0 ? void 0 : _c.value,
|
|
29
|
+
});
|
|
30
|
+
}, [activeIndex, _tabs], isObjectEqual);
|
|
31
|
+
const onActive = (e) => {
|
|
32
|
+
setActiveIndex(e.id);
|
|
33
|
+
};
|
|
34
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
35
|
+
React.createElement(TeaTabs, { style: style, tabs: _tabs, activeId: String(activeIndex), onActive: onActive, className: classNames('weda-tabs_pc', {
|
|
36
|
+
[className]: className,
|
|
37
|
+
}) }, _tabs === null || _tabs === void 0 ? void 0 : _tabs.map((item, index) => (React.createElement(TabPanel, { key: item.id, id: item.id }, isMultipleSlot
|
|
38
|
+
? restProps[`panel${index + 1}`]
|
|
39
|
+
: restProps['panel1']))))));
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType, unknownFunction } from '../../types';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export interface PropsType extends CommonPropsType {
|
|
5
|
+
text: string;
|
|
6
|
+
level: string;
|
|
7
|
+
maxLines: number;
|
|
8
|
+
space: boolean;
|
|
9
|
+
userSelect: boolean;
|
|
10
|
+
contenteditable: HTMLParagraphElement['contentEditable'];
|
|
11
|
+
onInput?: unknownFunction;
|
|
12
|
+
onBlur?: unknownFunction;
|
|
13
|
+
}
|
|
14
|
+
export default function Text({ text, maxLines, space, userSelect, style, className, events, id, level, contenteditable, onInput, onBlur, }: PropsType): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classNames from '../../utils/classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export default function Text({ text, maxLines, space, userSelect, style, className, events, id, level, contenteditable, onInput, onBlur, }) {
|
|
5
|
+
const textStyle = {
|
|
6
|
+
WebkitLineClamp: maxLines,
|
|
7
|
+
whiteSpace: space ? 'pre-wrap' : 'pre-line',
|
|
8
|
+
};
|
|
9
|
+
if (!userSelect) {
|
|
10
|
+
textStyle.userSelect = 'none';
|
|
11
|
+
}
|
|
12
|
+
const levelName = level === '0' || !level ? '' : `level_${level}`;
|
|
13
|
+
const inlineStyle = React.useMemo(() => ({ ...textStyle, ...style }), [textStyle, style]);
|
|
14
|
+
return (React.createElement("p", {
|
|
15
|
+
//@ts-expect-error contentEditable type def sucks
|
|
16
|
+
contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, style: inlineStyle, className: classNames('weda-text', 'weda-ui', className, levelName), id: id, onClick: (e) => events.tap({}, { originEvent: e }) }, text));
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { UploadFilePc } from '../form/uploaderFile/uploadFile.pc';
|
|
3
|
+
import { UploadFileH5 } from '../form/uploaderFile/uploadFile.h5';
|
|
4
|
+
import { filterStrList, isCloudFileID, downloadFile, usePlatform, transFileCloudidToName, } from '../../utils/platform';
|
|
5
|
+
import './index.css';
|
|
6
|
+
import { useTempUrl } from '../../utils/use-cloud-id-temp-url';
|
|
7
|
+
const CLASS_PREFIX = 'weda-uploader-file-view';
|
|
8
|
+
/**
|
|
9
|
+
* 上传文件回显,传showType强制展示某端样式,否则根据平台自动判断
|
|
10
|
+
*/
|
|
11
|
+
export default function UploaderFileView({ value, className, single = true, // 展示为单行 a 标签
|
|
12
|
+
showType, // 展示端为 pc 还是 h5 样式
|
|
13
|
+
...rest }) {
|
|
14
|
+
const fileIDList = filterStrList(value);
|
|
15
|
+
if (single) {
|
|
16
|
+
return React.createElement(FileView, { fileID: fileIDList[0] });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const platform = usePlatform();
|
|
20
|
+
const showTypeMix = showType ? (showType === 'h5' ? 'h5' : 'pc') : platform;
|
|
21
|
+
const uploadFileProps = {
|
|
22
|
+
...rest,
|
|
23
|
+
className: `${CLASS_PREFIX} ${className}`,
|
|
24
|
+
decorator: null,
|
|
25
|
+
labelVisible: false,
|
|
26
|
+
value: fileIDList,
|
|
27
|
+
isEdit: false,
|
|
28
|
+
};
|
|
29
|
+
return showTypeMix === 'pc' ? (React.createElement(UploadFilePc, { ...uploadFileProps })) : (React.createElement(UploadFileH5, { ...uploadFileProps }));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 单个文件回显,用在表格里面
|
|
34
|
+
*/
|
|
35
|
+
const FileView = ({ fileID }) => {
|
|
36
|
+
const { data: src } = useTempUrl(fileID);
|
|
37
|
+
const title = React.useMemo(() => {
|
|
38
|
+
if (isCloudFileID(fileID)) {
|
|
39
|
+
return transFileCloudidToName(fileID);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return fileID;
|
|
43
|
+
}
|
|
44
|
+
}, [fileID]);
|
|
45
|
+
return (React.createElement("a", { title: title, onClick: () => downloadFile(src), className: `${CLASS_PREFIX}__single` }, title));
|
|
46
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './index.css';
|
|
3
|
+
import type { CommonPropsType } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* 图片上传-展示组件
|
|
6
|
+
*/
|
|
7
|
+
export default function UploaderView({ srcList, // 兼容 cloud:和https: 协议,兼容 字符串和字符串数组
|
|
8
|
+
alt, gutter, height, width, events, isZoom, isEmptyPlace, className, id, style, }: PropsType): JSX.Element;
|
|
9
|
+
export interface PropsType extends CommonPropsType {
|
|
10
|
+
srcList?: string[] | string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
isZoom?: boolean;
|
|
13
|
+
gutter?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
width?: number;
|
|
16
|
+
isEmptyPlace?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TcbImage } from '../form/uploader/uploader.pc';
|
|
3
|
+
import classNames from '../../utils/classnames';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import { emptyObject } from '../../utils/constant';
|
|
6
|
+
const CLASS_PREFIX = 'g-uploader-view';
|
|
7
|
+
/**
|
|
8
|
+
* 图片上传-展示组件
|
|
9
|
+
*/
|
|
10
|
+
export default function UploaderView({ srcList, // 兼容 cloud:和https: 协议,兼容 字符串和字符串数组
|
|
11
|
+
alt = '[加载失败]', gutter = 8, height = 100, width = 100, events = emptyObject, isZoom = true, isEmptyPlace = true, className, id, style, }) {
|
|
12
|
+
const cls = classNames({
|
|
13
|
+
[CLASS_PREFIX]: true,
|
|
14
|
+
[className]: className,
|
|
15
|
+
});
|
|
16
|
+
// 成功事件,返回加载成功的链接
|
|
17
|
+
const [successList, setSuccessList] = React.useState([]);
|
|
18
|
+
// 失败事件,返回加载失败的链接
|
|
19
|
+
const [errorList, setErrorList] = React.useState([]);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
events.load && events.load({ success: successList, error: errorList });
|
|
22
|
+
}, [successList, errorList]);
|
|
23
|
+
const boxStyle = {
|
|
24
|
+
marginRight: gutter,
|
|
25
|
+
marginBottom: gutter,
|
|
26
|
+
height: height,
|
|
27
|
+
width: width,
|
|
28
|
+
};
|
|
29
|
+
const values = []
|
|
30
|
+
.concat(srcList)
|
|
31
|
+
.filter((d) => typeof d === 'string' && d !== '');
|
|
32
|
+
return (React.createElement("div", { className: cls, id: id, style: style },
|
|
33
|
+
React.createElement("div", { className: `${CLASS_PREFIX}__image-list` },
|
|
34
|
+
values.map((d, i) => {
|
|
35
|
+
const imgProps = {
|
|
36
|
+
fileID: d,
|
|
37
|
+
className: `${CLASS_PREFIX}__image`,
|
|
38
|
+
alt: alt,
|
|
39
|
+
isZoom,
|
|
40
|
+
onLoad: () => setSuccessList((list) => [...list, d]),
|
|
41
|
+
onError: () => setErrorList((list) => [...list, d]),
|
|
42
|
+
};
|
|
43
|
+
return (React.createElement("div", { className: `${CLASS_PREFIX}__image-box`, key: `${d}-${i}`, style: boxStyle, title: d },
|
|
44
|
+
React.createElement(TcbImage, { ...imgProps })));
|
|
45
|
+
}),
|
|
46
|
+
values.length === 0 && isEmptyPlace && (React.createElement("div", { className: `${CLASS_PREFIX}__image-box`, style: boxStyle },
|
|
47
|
+
React.createElement("img", { className: `${CLASS_PREFIX}__image`, alt: "\u6682\u65E0\u56FE\u7247" }))))));
|
|
48
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../types';
|
|
3
|
+
declare const UserInfo: (props: PropsType) => JSX.Element;
|
|
4
|
+
export interface PropsType extends CommonPropsType {
|
|
5
|
+
/**
|
|
6
|
+
* 按钮标题
|
|
7
|
+
*/
|
|
8
|
+
text?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 按钮风格
|
|
11
|
+
*/
|
|
12
|
+
type?: 'primary' | 'warn' | 'wechat' | 'default';
|
|
13
|
+
/**
|
|
14
|
+
* 按钮大小
|
|
15
|
+
*/
|
|
16
|
+
size?: 'default' | 'mini' | 'large';
|
|
17
|
+
/**
|
|
18
|
+
* 信息用途
|
|
19
|
+
*/
|
|
20
|
+
usage?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 语言
|
|
23
|
+
*/
|
|
24
|
+
language?: string;
|
|
25
|
+
}
|
|
26
|
+
export default UserInfo;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import 'video.js/dist/video-js.css';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import type { CommonPropsType } from '../../types';
|
|
5
|
+
export interface VideoProps {
|
|
6
|
+
videoDataSource: string;
|
|
7
|
+
posterImage: string;
|
|
8
|
+
autoPlay: boolean;
|
|
9
|
+
loopPlay: boolean;
|
|
10
|
+
mutePlay: boolean;
|
|
11
|
+
controlBarStatus: boolean;
|
|
12
|
+
startTime: number;
|
|
13
|
+
endTime: number;
|
|
14
|
+
}
|
|
15
|
+
export declare type WedaVideoProps = Partial<CommonPropsType & VideoProps>;
|
|
16
|
+
declare const WedaVideo: React.FC<WedaVideoProps>;
|
|
17
|
+
export default WedaVideo;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import videojs from 'video.js';
|
|
3
|
+
import 'video.js/dist/video-js.css';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import { usePlatform, isCloudFileID, isInIde } from '../../utils/platform';
|
|
6
|
+
import classNames from '../../utils/classnames';
|
|
7
|
+
import { ConfigProvider, Icon } from 'tea-component';
|
|
8
|
+
import { useTempUrl } from '../../utils/use-cloud-id-temp-url';
|
|
9
|
+
const { useEffect, useRef, useMemo, useState } = React;
|
|
10
|
+
const MimetypesKind = {
|
|
11
|
+
opus: 'video/ogg',
|
|
12
|
+
ogv: 'video/ogg',
|
|
13
|
+
mp4: 'video/mp4',
|
|
14
|
+
mov: 'video/mp4',
|
|
15
|
+
m4v: 'video/mp4',
|
|
16
|
+
mkv: 'video/x-matroska',
|
|
17
|
+
m4a: 'audio/mp4',
|
|
18
|
+
mp3: 'audio/mpeg',
|
|
19
|
+
aac: 'audio/aac',
|
|
20
|
+
caf: 'audio/x-caf',
|
|
21
|
+
flac: 'audio/flac',
|
|
22
|
+
oga: 'audio/ogg',
|
|
23
|
+
wav: 'audio/wav',
|
|
24
|
+
m3u8: 'application/x-mpegURL',
|
|
25
|
+
jpg: 'image/jpeg',
|
|
26
|
+
jpeg: 'image/jpeg',
|
|
27
|
+
gif: 'image/gif',
|
|
28
|
+
png: 'image/png',
|
|
29
|
+
svg: 'image/svg+xml',
|
|
30
|
+
webp: 'image/webp',
|
|
31
|
+
};
|
|
32
|
+
const CLASS_PREFIX = 'weda-ui_video';
|
|
33
|
+
const WedaVideo = ({ className, style, id, videoDataSource, posterImage, autoPlay, loopPlay, mutePlay, controlBarStatus, startTime, endTime, }) => {
|
|
34
|
+
const platform = usePlatform();
|
|
35
|
+
const cls = classNames({
|
|
36
|
+
[className]: className,
|
|
37
|
+
[CLASS_PREFIX]: true,
|
|
38
|
+
[`${CLASS_PREFIX}-h5`]: platform === 'h5',
|
|
39
|
+
'weda-ui_video_control': !controlBarStatus,
|
|
40
|
+
});
|
|
41
|
+
const videoRef = useRef(null);
|
|
42
|
+
const playerRef = useRef(null);
|
|
43
|
+
const [videoModalStatus, setVideoModalStatus] = useState(true);
|
|
44
|
+
const [videoErrMsg, setVideoErrMsg] = useState('');
|
|
45
|
+
const { data: realSrc, error } = useTempUrl(videoDataSource);
|
|
46
|
+
const videoType = useMemo(() => {
|
|
47
|
+
return realSrc === null || realSrc === void 0 ? void 0 : realSrc.substring(realSrc.lastIndexOf('.') + 1).toLowerCase();
|
|
48
|
+
}, [realSrc]);
|
|
49
|
+
if (error) {
|
|
50
|
+
console.error('getCloudUrl error', error);
|
|
51
|
+
setVideoErrMsg('获取云文件资源失败');
|
|
52
|
+
}
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const videoElement = videoRef.current;
|
|
55
|
+
if (!playerRef.current) {
|
|
56
|
+
const videoOptions = {
|
|
57
|
+
poster: posterImage,
|
|
58
|
+
autoplay: autoPlay,
|
|
59
|
+
bigPlayButton: true,
|
|
60
|
+
loop: loopPlay,
|
|
61
|
+
muted: mutePlay,
|
|
62
|
+
controls: controlBarStatus,
|
|
63
|
+
language: 'zh-CN',
|
|
64
|
+
fluid: true,
|
|
65
|
+
controlBar: {
|
|
66
|
+
children: [
|
|
67
|
+
{ name: 'playToggle' },
|
|
68
|
+
{ name: 'currentTimeDisplay' },
|
|
69
|
+
{ name: 'progressControl' },
|
|
70
|
+
{ name: 'durationDisplay' },
|
|
71
|
+
{
|
|
72
|
+
name: 'volumePanel',
|
|
73
|
+
inline: false, // 不使用水平方式
|
|
74
|
+
},
|
|
75
|
+
{ name: 'FullscreenToggle' }, // 全屏按钮
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
sources: [
|
|
79
|
+
{
|
|
80
|
+
src: realSrc || 'no',
|
|
81
|
+
type: MimetypesKind[videoType] || 'video/mp4',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
playerRef.current = videojs(videoElement, videoOptions, () => {
|
|
86
|
+
players.currentTime(startTime); //指定播放时间
|
|
87
|
+
setVideoModalStatus(false);
|
|
88
|
+
setVideoErrMsg('');
|
|
89
|
+
});
|
|
90
|
+
const players = playerRef.current;
|
|
91
|
+
// 指定结束时间
|
|
92
|
+
if (endTime) {
|
|
93
|
+
players.on('timeupdate', () => {
|
|
94
|
+
//播放时间改变
|
|
95
|
+
const currentTime = players.currentTime();
|
|
96
|
+
if (startTime >= endTime)
|
|
97
|
+
return;
|
|
98
|
+
if (currentTime > endTime) {
|
|
99
|
+
players.currentTime(startTime);
|
|
100
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
!loopPlay && players.pause();
|
|
103
|
+
}, 200);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
players.on('canplaythrough', function () {
|
|
108
|
+
setVideoModalStatus(false);
|
|
109
|
+
setVideoErrMsg('');
|
|
110
|
+
});
|
|
111
|
+
players.on('error', function () {
|
|
112
|
+
let errorMsg = `视频资源加载出错,错误信息:${players === null || players === void 0 ? void 0 : players.error().message}`;
|
|
113
|
+
const pattern = new RegExp('^(((https?)://)|/resources/)[^\\s]+$');
|
|
114
|
+
if (isInIde() &&
|
|
115
|
+
!pattern.test(videoDataSource) &&
|
|
116
|
+
!isCloudFileID(videoDataSource)) {
|
|
117
|
+
errorMsg = '请在预览区查看视频效果';
|
|
118
|
+
}
|
|
119
|
+
console.log('player error', errorMsg);
|
|
120
|
+
setVideoErrMsg(errorMsg);
|
|
121
|
+
setVideoModalStatus(true);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}, [videoRef]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
// 切换视频源
|
|
127
|
+
if (playerRef.current && videoType) {
|
|
128
|
+
const srcOption = [
|
|
129
|
+
{
|
|
130
|
+
src: realSrc,
|
|
131
|
+
type: MimetypesKind[videoType],
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
playerRef.current.src(srcOption);
|
|
135
|
+
playerRef.current.load(realSrc);
|
|
136
|
+
}
|
|
137
|
+
}, [realSrc]);
|
|
138
|
+
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
139
|
+
React.createElement("div", { className: cls, id: id, style: style, "data-testid": "wedaVideo" },
|
|
140
|
+
React.createElement("div", { "data-vjs-player": true },
|
|
141
|
+
React.createElement("video", { ref: videoRef, className: `video-js vjs-big-play-centered ${CLASS_PREFIX}__video-wrap` })),
|
|
142
|
+
videoModalStatus && (React.createElement("div", { className: `${CLASS_PREFIX}__video-loading` }, realSrc === null ? React.createElement(Icon, { type: "loading" }) : videoErrMsg)))));
|
|
143
|
+
};
|
|
144
|
+
export default WedaVideo;
|