@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,115 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { ConfigProvider, Radio as TeaRadio } from 'tea-component';
|
|
3
|
+
import { usePlatform } from '../../../utils/platform';
|
|
4
|
+
import classNames from '../../../utils/classnames';
|
|
5
|
+
import getLocalCounter from '../../../utils/getLocalCounter';
|
|
6
|
+
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
7
|
+
import { callWedaApi } from '../../../utils/tcb';
|
|
8
|
+
import './index.css';
|
|
9
|
+
import { renderDecorator } from '../renderDecorator';
|
|
10
|
+
import destr from 'destr';
|
|
11
|
+
import { emptyArray, emptyObject } from '../../../utils/constant';
|
|
12
|
+
export default function Radio({
|
|
13
|
+
// 系统属性
|
|
14
|
+
id, className, style, events = emptyObject,
|
|
15
|
+
// 组件属性
|
|
16
|
+
label = '标题', labelVisible = true, format = '', enumName = '', name = 'formRadio', range = emptyArray, layout = 'horizontal', disabled = false, requiredFlag = false, decorator, }) {
|
|
17
|
+
var _a;
|
|
18
|
+
const platform = usePlatform();
|
|
19
|
+
const isH5 = platform === 'h5';
|
|
20
|
+
const cls = classNames({
|
|
21
|
+
'weda-ui': true,
|
|
22
|
+
'weda-radio': true,
|
|
23
|
+
[className]: className,
|
|
24
|
+
});
|
|
25
|
+
const subCls = classNames({
|
|
26
|
+
'weui-cell': isH5,
|
|
27
|
+
'weui-cell_active': isH5,
|
|
28
|
+
'weui-check__label': isH5,
|
|
29
|
+
'weui-cell_disabled': isH5 && disabled,
|
|
30
|
+
});
|
|
31
|
+
const [option, setOption] = useState(range);
|
|
32
|
+
const [checkedItemValue, setCheckedItemValue] = React.useState((_a = option.find((item) => item.checked)) === null || _a === void 0 ? void 0 : _a.value);
|
|
33
|
+
// 两次range不同时, 需要刷新checkedItemValue
|
|
34
|
+
const prevRangeRef = React.useRef();
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!isObjectEqual(prevRangeRef.current, option)) {
|
|
38
|
+
prevRangeRef.current = option;
|
|
39
|
+
setCheckedItemValue((_a = option.find((item) => item.checked)) === null || _a === void 0 ? void 0 : _a.value);
|
|
40
|
+
}
|
|
41
|
+
}, [option]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
// 如果绑定字段类型为枚举,且传入自定义选项集的名称则默认使用自定义选项集的内容作为选项
|
|
44
|
+
if (format === 'x-enum' && enumName) {
|
|
45
|
+
fetchData({ OptNameList: [enumName], PageIndex: 1, PageSize: 10 });
|
|
46
|
+
}
|
|
47
|
+
}, [enumName, format]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (format !== 'x-enum') {
|
|
50
|
+
setOption(range);
|
|
51
|
+
}
|
|
52
|
+
}, [format, range]);
|
|
53
|
+
const fetchData = async (param) => {
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
const data = await callWedaApi({
|
|
56
|
+
action: 'DescribeGeneralOptionsDetailList',
|
|
57
|
+
data: param,
|
|
58
|
+
});
|
|
59
|
+
const config = (_c = destr((_b = (_a = data === null || data === void 0 ? void 0 : data.Items) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.Config)) !== null && _c !== void 0 ? _c : [];
|
|
60
|
+
const enumOption = config.map((item) => {
|
|
61
|
+
return {
|
|
62
|
+
label: item.value,
|
|
63
|
+
value: item.key,
|
|
64
|
+
checked: false,
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
setOption(enumOption);
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 在ios h5端, label和input的绑定不生效
|
|
71
|
+
* 导致 onChange 事件触发有问题, 所以改为监听 onClick 事件
|
|
72
|
+
*/
|
|
73
|
+
const getChangeHandler = function (value) {
|
|
74
|
+
const onChange = function (e) {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
if (!disabled) {
|
|
77
|
+
setCheckedItemValue(value);
|
|
78
|
+
events.change({ value }, { originEvent: e });
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return onChange;
|
|
82
|
+
};
|
|
83
|
+
// 现在低码组件往源码组件传入的id不唯一, 暂时使用hashcode替代
|
|
84
|
+
const hashcode = React.useMemo(() => getLocalCounter(), []);
|
|
85
|
+
let radioElement;
|
|
86
|
+
if (isH5) {
|
|
87
|
+
radioElement = option.map(({ label, value }, index) => {
|
|
88
|
+
const _id = `radio-${hashcode}-${index}`;
|
|
89
|
+
const _name = `radio-${hashcode}-${name}`;
|
|
90
|
+
return (React.createElement("div", { className: subCls, key: _id, onClickCapture: getChangeHandler(value) },
|
|
91
|
+
React.createElement("div", { className: "weui-cell__hd" },
|
|
92
|
+
React.createElement("input", { type: "radio", className: "weui-check", value: value, name: _name, id: _id, checked: checkedItemValue === value, disabled: disabled, onClick: (e) => e.stopPropagation() }),
|
|
93
|
+
React.createElement("i", { className: "weui-icon-checked" })),
|
|
94
|
+
React.createElement("div", { className: "weui-cell__bd" },
|
|
95
|
+
React.createElement("p", null, label))));
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// pc
|
|
100
|
+
radioElement = (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
101
|
+
React.createElement(TeaRadio.Group, { disabled: disabled, value: checkedItemValue, onChange: (value, { event }) => getChangeHandler(value)(event) }, option.map(({ value, label }, index) => {
|
|
102
|
+
const _id = `radio-${hashcode}-${index}`;
|
|
103
|
+
return (React.createElement(TeaRadio, { key: _id, name: value, id: _id }, label));
|
|
104
|
+
}))));
|
|
105
|
+
}
|
|
106
|
+
return renderDecorator(radioElement, decorator)({
|
|
107
|
+
id,
|
|
108
|
+
className: cls,
|
|
109
|
+
style,
|
|
110
|
+
label: labelVisible ? label : null,
|
|
111
|
+
layout,
|
|
112
|
+
multiCell: true,
|
|
113
|
+
requiredFlag,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import FormCell from './formcell';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @returns {(props: any) => JSX.Element}
|
|
6
|
+
*/
|
|
7
|
+
export function renderDecorator(filedNode, DecoratorComponent = FormCell) {
|
|
8
|
+
if (!DecoratorComponent) {
|
|
9
|
+
return function WedaFormField() {
|
|
10
|
+
return React.createElement(React.Fragment, null, filedNode);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return function WedaFormFiled(decoratorProps) {
|
|
14
|
+
if (Array.isArray(DecoratorComponent) && DecoratorComponent.length === 2) {
|
|
15
|
+
decoratorProps = DecoratorComponent[1];
|
|
16
|
+
DecoratorComponent = DecoratorComponent[0];
|
|
17
|
+
}
|
|
18
|
+
return (React.createElement(DecoratorComponent, { ...decoratorProps }, filedNode));
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './calendar.css';
|
|
3
|
+
/**
|
|
4
|
+
* 日历组件
|
|
5
|
+
*/
|
|
6
|
+
export default function Calendar({ startTime, endTime, selectYear, selectMonth, setCurrentDay, defaultSelectDay, }: {
|
|
7
|
+
startTime: any;
|
|
8
|
+
endTime: any;
|
|
9
|
+
selectYear: any;
|
|
10
|
+
selectMonth: any;
|
|
11
|
+
setCurrentDay: any;
|
|
12
|
+
defaultSelectDay: any;
|
|
13
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './calendar.css';
|
|
3
|
+
import { weeks } from './dataUtils';
|
|
4
|
+
/**
|
|
5
|
+
* 日历组件
|
|
6
|
+
*/
|
|
7
|
+
export default function Calendar({ startTime, endTime, selectYear, selectMonth, setCurrentDay, defaultSelectDay, }) {
|
|
8
|
+
const [selectDay, setSelectDay] = React.useState(new Date().getDate());
|
|
9
|
+
/**
|
|
10
|
+
* 设置默认数据
|
|
11
|
+
*/
|
|
12
|
+
const fnDaysSpliceWeeks = (number, len = 7) => {
|
|
13
|
+
const arrLen = Math.ceil(number.length / len);
|
|
14
|
+
const newArr = [];
|
|
15
|
+
for (let i = 0; i < arrLen; i++) {
|
|
16
|
+
newArr.push(number.slice(i * len, (i + 1) * len));
|
|
17
|
+
}
|
|
18
|
+
return newArr;
|
|
19
|
+
};
|
|
20
|
+
const days = () => {
|
|
21
|
+
const selectYearNumber = parseInt(selectYear);
|
|
22
|
+
const selectMonthNumber = parseInt(selectMonth);
|
|
23
|
+
const firstDay = new Date(selectYearNumber, selectMonthNumber - 1, 1);
|
|
24
|
+
const lastDay = new Date(selectYearNumber, selectMonthNumber, 0);
|
|
25
|
+
const arr = [];
|
|
26
|
+
for (let i = 1; i <= firstDay.getDay(); i++) {
|
|
27
|
+
arr.push('');
|
|
28
|
+
}
|
|
29
|
+
for (let i = 1; i <= lastDay.getDate(); i++) {
|
|
30
|
+
arr.push(i + '');
|
|
31
|
+
}
|
|
32
|
+
for (let i = 1; i <= 6 - lastDay.getDay(); i++) {
|
|
33
|
+
arr.push('');
|
|
34
|
+
}
|
|
35
|
+
return arr;
|
|
36
|
+
};
|
|
37
|
+
// 日历翻页触发改变
|
|
38
|
+
React.useEffect(() => {
|
|
39
|
+
setSelectDay(defaultSelectDay);
|
|
40
|
+
}, [defaultSelectDay]);
|
|
41
|
+
/**
|
|
42
|
+
* 选择天数
|
|
43
|
+
*/
|
|
44
|
+
const dayClick = (item) => {
|
|
45
|
+
// 没有开始和结束时间
|
|
46
|
+
if (startTime.length === 0 && endTime.length === 0) {
|
|
47
|
+
setSelectDay(item);
|
|
48
|
+
setCurrentDay(item);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const current = parseInt(item);
|
|
52
|
+
const year = parseInt(selectYear);
|
|
53
|
+
const month = parseInt(selectMonth);
|
|
54
|
+
// 匹配到开始时间
|
|
55
|
+
if (startTime.length > 0 &&
|
|
56
|
+
startTime[0] === year &&
|
|
57
|
+
startTime[1] === month) {
|
|
58
|
+
if (startTime[2] <= current) {
|
|
59
|
+
setSelectDay(item);
|
|
60
|
+
setCurrentDay(item);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// 匹配到开结束时间
|
|
65
|
+
if (endTime.length > 0 && endTime[0] === year && endTime[1] === month) {
|
|
66
|
+
if (endTime[2] >= current) {
|
|
67
|
+
setSelectDay(item);
|
|
68
|
+
setCurrentDay(item);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// 在开始时间和结束时间之间
|
|
73
|
+
setSelectDay(item);
|
|
74
|
+
setCurrentDay(item);
|
|
75
|
+
};
|
|
76
|
+
return (React.createElement("div", { className: "weda-ui-custom-calendar" },
|
|
77
|
+
React.createElement("div", { className: " weda-ui-custom-calendar__weeks" }, weeks.map((week, index) => (React.createElement("span", { key: index, className: "weda-ui-custom-calendar__weeks-item" }, week)))),
|
|
78
|
+
React.createElement("div", { className: "weda-ui-custom-calendar__days" }, fnDaysSpliceWeeks(days(), 7).map((day, index) => {
|
|
79
|
+
return (React.createElement("div", { key: index, className: "weda-ui-custom-calendar__days-row" }, day.map((item, index) => {
|
|
80
|
+
let canStartSelect = true;
|
|
81
|
+
let canEndSelect = true;
|
|
82
|
+
const selectYearNumber = parseInt(selectYear);
|
|
83
|
+
const selectMonthNumber = parseInt(selectMonth);
|
|
84
|
+
if (startTime.length > 0 && item !== '') {
|
|
85
|
+
if (startTime[0] === selectYearNumber &&
|
|
86
|
+
startTime[1] === selectMonthNumber) {
|
|
87
|
+
canStartSelect = parseInt(item) >= startTime[2];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (endTime.length > 0 && item !== '') {
|
|
91
|
+
if (endTime[0] === selectYearNumber &&
|
|
92
|
+
endTime[1] === selectMonthNumber) {
|
|
93
|
+
canEndSelect = parseInt(item) <= endTime[2];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return (React.createElement("span", { key: index, "data-testid": "allTime-click-day", className: `weda-ui-custom-calendar__days-item ${item == selectDay ? 'is-current' : ''} ${!canEndSelect || !canStartSelect ? 'no-select' : ''}`, onClick: () => {
|
|
97
|
+
if (item === '') {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
dayClick(parseInt(item));
|
|
101
|
+
} }, item));
|
|
102
|
+
})));
|
|
103
|
+
}))));
|
|
104
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const weeks: string[];
|
|
2
|
+
export declare const defaultData: () => {
|
|
3
|
+
id: string;
|
|
4
|
+
value: any[];
|
|
5
|
+
}[];
|
|
6
|
+
export declare const defaultDateTime: {
|
|
7
|
+
id: string;
|
|
8
|
+
value: string[];
|
|
9
|
+
}[];
|
|
10
|
+
export declare const getIndex: (index: any) => any;
|
|
11
|
+
export declare const getLast: (index: any, array: any) => any;
|
|
12
|
+
export declare const getFormatData: (data: any) => any;
|
|
13
|
+
/**
|
|
14
|
+
* 动态获取日期时间数组的下标
|
|
15
|
+
*/
|
|
16
|
+
export declare const getCurrentYearIndex: () => any;
|
|
17
|
+
export declare const getCurrentMonthIndex: () => any;
|
|
18
|
+
export declare const getCurrentHoursIndex: () => any;
|
|
19
|
+
export declare const getCurrentMinutesIndex: () => any;
|
|
20
|
+
export declare const getCurrentSecondsIndex: () => number;
|
|
21
|
+
export declare const isSpace: (str: any) => boolean;
|
|
22
|
+
export declare const getIOSNotNaNDate: (data: any) => any;
|
|
23
|
+
export declare const getLastDate: () => string;
|
|
24
|
+
export declare const getStartDate: () => string;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
export const weeks = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
2
|
+
export const defaultData = () => {
|
|
3
|
+
const year = [];
|
|
4
|
+
for (let i = 0; i < 500; i++) {
|
|
5
|
+
year.push(1900 + i + '年');
|
|
6
|
+
}
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
id: 'column1',
|
|
10
|
+
value: [' ', ' ', ...year, ' ', ' '],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'column2',
|
|
14
|
+
value: [
|
|
15
|
+
' ',
|
|
16
|
+
' ',
|
|
17
|
+
'01月',
|
|
18
|
+
'02月',
|
|
19
|
+
'03月',
|
|
20
|
+
'04月',
|
|
21
|
+
'05月',
|
|
22
|
+
'06月',
|
|
23
|
+
'07月',
|
|
24
|
+
'08月',
|
|
25
|
+
'09月',
|
|
26
|
+
'10月',
|
|
27
|
+
'11月',
|
|
28
|
+
'12月',
|
|
29
|
+
' ',
|
|
30
|
+
' ',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
};
|
|
35
|
+
export const defaultDateTime = [
|
|
36
|
+
{
|
|
37
|
+
id: 'column1',
|
|
38
|
+
value: [
|
|
39
|
+
' ',
|
|
40
|
+
' ',
|
|
41
|
+
'00时',
|
|
42
|
+
'01时',
|
|
43
|
+
'02时',
|
|
44
|
+
'03时',
|
|
45
|
+
'04时',
|
|
46
|
+
'05时',
|
|
47
|
+
'06时',
|
|
48
|
+
'07时',
|
|
49
|
+
'08时',
|
|
50
|
+
'09时',
|
|
51
|
+
'10时',
|
|
52
|
+
'11时',
|
|
53
|
+
'12时',
|
|
54
|
+
'13时',
|
|
55
|
+
'14时',
|
|
56
|
+
'15时',
|
|
57
|
+
'16时',
|
|
58
|
+
'17时',
|
|
59
|
+
'18时',
|
|
60
|
+
'19时',
|
|
61
|
+
'20时',
|
|
62
|
+
'21时',
|
|
63
|
+
'22时',
|
|
64
|
+
'23时',
|
|
65
|
+
' ',
|
|
66
|
+
' ',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'column2',
|
|
71
|
+
value: [
|
|
72
|
+
' ',
|
|
73
|
+
' ',
|
|
74
|
+
'00分',
|
|
75
|
+
'01分',
|
|
76
|
+
'02分',
|
|
77
|
+
'03分',
|
|
78
|
+
'04分',
|
|
79
|
+
'05分',
|
|
80
|
+
'06分',
|
|
81
|
+
'07分',
|
|
82
|
+
'08分',
|
|
83
|
+
'09分',
|
|
84
|
+
'10分',
|
|
85
|
+
'11分',
|
|
86
|
+
'12分',
|
|
87
|
+
'13分',
|
|
88
|
+
'14分',
|
|
89
|
+
'15分',
|
|
90
|
+
'16分',
|
|
91
|
+
'17分',
|
|
92
|
+
'18分',
|
|
93
|
+
'19分',
|
|
94
|
+
'20分',
|
|
95
|
+
'21分',
|
|
96
|
+
'22分',
|
|
97
|
+
'23分',
|
|
98
|
+
'24分',
|
|
99
|
+
'25分',
|
|
100
|
+
'26分',
|
|
101
|
+
'27分',
|
|
102
|
+
'28分',
|
|
103
|
+
'29分',
|
|
104
|
+
'30分',
|
|
105
|
+
'31分',
|
|
106
|
+
'32分',
|
|
107
|
+
'33分',
|
|
108
|
+
'34分',
|
|
109
|
+
'35分',
|
|
110
|
+
'36分',
|
|
111
|
+
'37分',
|
|
112
|
+
'38分',
|
|
113
|
+
'39分',
|
|
114
|
+
'40分',
|
|
115
|
+
'41分',
|
|
116
|
+
'42分',
|
|
117
|
+
'43分',
|
|
118
|
+
'44分',
|
|
119
|
+
'45分',
|
|
120
|
+
'46分',
|
|
121
|
+
'47分',
|
|
122
|
+
'48分',
|
|
123
|
+
'49分',
|
|
124
|
+
'50分',
|
|
125
|
+
'51分',
|
|
126
|
+
'52分',
|
|
127
|
+
'53分',
|
|
128
|
+
'54分',
|
|
129
|
+
'55分',
|
|
130
|
+
'56分',
|
|
131
|
+
'57分',
|
|
132
|
+
'58分',
|
|
133
|
+
'59分',
|
|
134
|
+
' ',
|
|
135
|
+
' ',
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'column3',
|
|
140
|
+
value: [
|
|
141
|
+
' ',
|
|
142
|
+
' ',
|
|
143
|
+
'00秒',
|
|
144
|
+
'01秒',
|
|
145
|
+
'02秒',
|
|
146
|
+
'03秒',
|
|
147
|
+
'04秒',
|
|
148
|
+
'05秒',
|
|
149
|
+
'06秒',
|
|
150
|
+
'07秒',
|
|
151
|
+
'08秒',
|
|
152
|
+
'09秒',
|
|
153
|
+
'10秒',
|
|
154
|
+
'11秒',
|
|
155
|
+
'12秒',
|
|
156
|
+
'13秒',
|
|
157
|
+
'14秒',
|
|
158
|
+
'15秒',
|
|
159
|
+
'16秒',
|
|
160
|
+
'17秒',
|
|
161
|
+
'18秒',
|
|
162
|
+
'19秒',
|
|
163
|
+
'20秒',
|
|
164
|
+
'21秒',
|
|
165
|
+
'22秒',
|
|
166
|
+
'23秒',
|
|
167
|
+
'24秒',
|
|
168
|
+
'25秒',
|
|
169
|
+
'26秒',
|
|
170
|
+
'27秒',
|
|
171
|
+
'28秒',
|
|
172
|
+
'29秒',
|
|
173
|
+
'30秒',
|
|
174
|
+
'31秒',
|
|
175
|
+
'32秒',
|
|
176
|
+
'33秒',
|
|
177
|
+
'34秒',
|
|
178
|
+
'35秒',
|
|
179
|
+
'36秒',
|
|
180
|
+
'37秒',
|
|
181
|
+
'38秒',
|
|
182
|
+
'39秒',
|
|
183
|
+
'40秒',
|
|
184
|
+
'41秒',
|
|
185
|
+
'42秒',
|
|
186
|
+
'43秒',
|
|
187
|
+
'44秒',
|
|
188
|
+
'45秒',
|
|
189
|
+
'46秒',
|
|
190
|
+
'47秒',
|
|
191
|
+
'48秒',
|
|
192
|
+
'49秒',
|
|
193
|
+
'50秒',
|
|
194
|
+
'51秒',
|
|
195
|
+
'52秒',
|
|
196
|
+
'53秒',
|
|
197
|
+
'54秒',
|
|
198
|
+
'55秒',
|
|
199
|
+
'56秒',
|
|
200
|
+
'57秒',
|
|
201
|
+
'58秒',
|
|
202
|
+
'59秒',
|
|
203
|
+
' ',
|
|
204
|
+
' ',
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
const currentData = new Date();
|
|
209
|
+
export const getIndex = (index) => {
|
|
210
|
+
return index < 2 ? 2 : index;
|
|
211
|
+
};
|
|
212
|
+
export const getLast = (index, array) => {
|
|
213
|
+
return index < 0 ? array.length - 1 : index;
|
|
214
|
+
};
|
|
215
|
+
export const getFormatData = (data) => {
|
|
216
|
+
return data < 10 ? '0' + data : data;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* 动态获取日期时间数组的下标
|
|
220
|
+
*/
|
|
221
|
+
export const getCurrentYearIndex = () => {
|
|
222
|
+
const year = currentData.getFullYear();
|
|
223
|
+
return getIndex(defaultData()[0].value.indexOf(getFormatData(year) + '年'));
|
|
224
|
+
};
|
|
225
|
+
export const getCurrentMonthIndex = () => {
|
|
226
|
+
const month = currentData.getMonth() + 1;
|
|
227
|
+
return getIndex(defaultData()[1].value.indexOf(getFormatData(month) + '月'));
|
|
228
|
+
};
|
|
229
|
+
export const getCurrentHoursIndex = () => {
|
|
230
|
+
const hours = currentData.getHours();
|
|
231
|
+
return getIndex(defaultDateTime[0].value.indexOf(getFormatData(hours) + '时'));
|
|
232
|
+
};
|
|
233
|
+
export const getCurrentMinutesIndex = () => {
|
|
234
|
+
const minutes = currentData.getMinutes();
|
|
235
|
+
return getIndex(defaultDateTime[1].value.indexOf(getFormatData(minutes) + '分'));
|
|
236
|
+
};
|
|
237
|
+
export const getCurrentSecondsIndex = () => {
|
|
238
|
+
const seconds = currentData.getSeconds();
|
|
239
|
+
return defaultDateTime[2].value.indexOf(getFormatData(seconds) + '秒');
|
|
240
|
+
};
|
|
241
|
+
export const isSpace = (str) => {
|
|
242
|
+
const reg = /^\s+$/g;
|
|
243
|
+
const re = new RegExp(reg);
|
|
244
|
+
return re.test(str);
|
|
245
|
+
};
|
|
246
|
+
export const getIOSNotNaNDate = (data) => {
|
|
247
|
+
if (!data || typeof data === 'number') {
|
|
248
|
+
return data;
|
|
249
|
+
}
|
|
250
|
+
return data.replace(/-/g, '/');
|
|
251
|
+
};
|
|
252
|
+
export const getLastDate = () => {
|
|
253
|
+
const date = defaultData();
|
|
254
|
+
const year = date[0].value[date[0].value.length - 3].replace('年', '');
|
|
255
|
+
const month = 12;
|
|
256
|
+
const day = new Date(year, 11, 0).getDate();
|
|
257
|
+
return year + '-' + month + '-' + day + ' ' + '59:59:59';
|
|
258
|
+
};
|
|
259
|
+
export const getStartDate = () => {
|
|
260
|
+
const date = defaultData();
|
|
261
|
+
const year = date[0].value[2].replace('年', '');
|
|
262
|
+
const month = '01';
|
|
263
|
+
const day = '01';
|
|
264
|
+
return year + '-' + month + '-' + day + ' ' + '00:00:00';
|
|
265
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonFormPropsType } from '../../types';
|
|
3
|
+
import './index.css';
|
|
4
|
+
/**
|
|
5
|
+
* 年月日时分秒日期选择器
|
|
6
|
+
*/
|
|
7
|
+
export default function AllTimePicker({ startDate, endDate, defaultDate, title, onAllTimeCallback, }: PropsType): JSX.Element;
|
|
8
|
+
export interface PropsType extends CommonFormPropsType {
|
|
9
|
+
title?: string;
|
|
10
|
+
startDate?: string;
|
|
11
|
+
endDate?: string;
|
|
12
|
+
defaultDate?: string;
|
|
13
|
+
onAllTimeCallback: (val: string[]) => void;
|
|
14
|
+
}
|