@cloudbase/weda-ui 3.3.0 → 3.3.2
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 +281 -47
- package/dist/configs/components/chart/line.json +245 -48
- package/dist/configs/components/chart/pie.json +227 -42
- package/dist/configs/components/dataView.json +9 -1
- package/dist/configs/components/form/form.json +4 -0
- package/dist/configs/components/form/select.json +18 -0
- package/dist/docs/common/tableView.js +0 -3
- package/dist/setupTests.d.ts +2 -1
- package/dist/setupTests.js +6 -1
- package/dist/web/actions/showModal/index.js +0 -1
- package/dist/web/components/calendar/index.js +40 -38
- package/dist/web/components/carousel/index.js +62 -62
- package/dist/web/components/chart/bar/index.d.ts +2 -40
- package/dist/web/components/chart/bar/index.js +44 -55
- package/dist/{src/web → web}/components/chart/bar/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/bar/index.old.js +0 -0
- package/dist/{src/web → web}/components/chart/common/Chart.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/Chart.js +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-custom-connector.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-custom-connector.js +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-error.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-error.js +0 -0
- package/dist/web/components/chart/common/core/eChartBar.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartBar.js +6 -3
- package/dist/web/components/chart/common/core/eChartBase.d.ts +2 -3
- package/dist/web/components/chart/common/core/eChartBase.js +47 -5
- package/dist/web/components/chart/common/core/eChartLine.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartLine.js +6 -3
- package/dist/web/components/chart/common/core/eChartPie.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartPie.js +6 -3
- package/dist/{src/web → web}/components/chart/common/data-transform.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/data-transform.js +0 -0
- package/dist/web/components/chart/common/echarts.d.ts +3 -0
- package/dist/web/components/chart/common/useChart.js +23 -11
- package/dist/web/components/chart/line/index.d.ts +2 -38
- package/dist/web/components/chart/line/index.js +41 -52
- package/dist/{src/web → web}/components/chart/line/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/line/index.old.js +0 -0
- package/dist/web/components/chart/pie/index.d.ts +2 -26
- package/dist/web/components/chart/pie/index.js +41 -39
- package/dist/{src/web → web}/components/chart/pie/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/pie/index.old.js +0 -0
- package/dist/{src/web → web}/components/common/error-boundary.d.ts +0 -0
- package/dist/{src/web → web}/components/common/error-boundary.js +0 -0
- package/dist/{src/web → web}/components/common/portal.d.ts +0 -0
- package/dist/{src/web → web}/components/common/portal.js +0 -0
- package/dist/{src/web → web}/components/common/use-loop-render-detect.d.ts +0 -0
- package/dist/{src/web → web}/components/common/use-loop-render-detect.js +0 -0
- package/dist/web/components/form/checkbox/index.js +29 -29
- package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +2 -2
- package/dist/web/components/form/enumSelect/NormalSelect.d.ts +2 -2
- package/dist/web/components/form/enumSelect/index.d.ts +2 -2
- package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +2 -2
- package/dist/web/components/form/form/index.js +46 -0
- package/dist/web/components/form/input/index.js +13 -5
- package/dist/web/components/form/location/common/mapChoose.js +7 -6
- package/dist/web/components/form/location/common/mapView.js +9 -6
- package/dist/web/components/form/location/common/propsConfig.d.ts +1 -1
- package/dist/{src/web → web}/components/form/location/common/tmap.d.ts +0 -0
- package/dist/{src/web → web}/components/form/location/common/tmap.js +0 -0
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +1 -1
- package/dist/web/components/form/location/common/useLocationInfo.js +3 -2
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +6 -3
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +5 -1
- package/dist/web/components/form/location/index.js +7 -0
- package/dist/web/components/form/radio/index.js +3 -3
- package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.js +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.js +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/index.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/index.js +0 -0
- package/dist/web/components/form/select/h5.d.ts +1 -1
- package/dist/web/components/form/select/h5.js +63 -7
- package/dist/web/components/form/select/index.d.ts +3 -2
- package/dist/web/components/form/select/index.js +25 -2
- package/dist/web/components/form/select/use-options.js +1 -1
- package/dist/web/components/form/select/year.js +1 -1
- package/dist/web/components/form/switch/index.js +2 -2
- package/dist/web/components/form/textarea/index.js +1 -1
- package/dist/web/components/form/uploader/uploader.h5.js +17 -42
- package/dist/web/components/form/uploader/uploader.pc.js +22 -28
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +18 -25
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +12 -23
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +1 -0
- package/dist/web/components/form/userOrgSelect/comTool.js +25 -13
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +2 -3
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +65 -64
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +2 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +41 -37
- package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.d.ts +0 -0
- package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.js +0 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +7 -4
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +62 -58
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +4 -4
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +133 -109
- package/dist/web/components/form/userOrgSelect/utils.d.ts +3 -2
- package/dist/web/components/form/userOrgSelect/utils.js +24 -16
- package/dist/web/components/formdetail/index.js +14 -11
- package/dist/web/components/graphicCard/index.d.ts +16 -1
- package/dist/web/components/graphicCard/index.js +42 -30
- package/dist/web/components/image/index.js +4 -18
- package/dist/web/components/index.js +3 -1
- package/dist/web/components/listView/index.js +20 -9
- package/dist/web/components/lottery/index.js +10 -16
- package/dist/web/components/lottery/lotteryUtil.js +1 -1
- package/dist/web/components/modal/index.js +1 -1
- package/dist/web/components/navLayout/index.d.ts +16 -1
- package/dist/web/components/navLayout/index.js +31 -20
- package/dist/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/web/components/navigationBar/index.js +13 -8
- package/dist/web/components/richText/index.js +1 -2
- package/dist/web/components/richTextView/index.js +20 -18
- package/dist/web/components/scrollView/index.d.ts +1 -2
- package/dist/web/components/scrollView/index.js +7 -5
- package/dist/web/components/swiper/index.js +62 -62
- package/dist/web/components/tabs/index.js +6 -1
- package/dist/web/components/tabs/tabs.h5.js +2 -0
- package/dist/web/components/text/index.js +10 -8
- package/dist/web/components/uploaderFileView/index.js +3 -18
- package/dist/web/components/uploaderView/index.js +1 -1
- package/dist/web/components/wedaVideo/index.js +21 -25
- package/dist/{src/web → web}/utils/console.d.ts +0 -0
- package/dist/{src/web → web}/utils/console.js +0 -0
- package/dist/web/utils/platform.js +1 -1
- package/dist/web/utils/tcb.d.ts +12 -6
- package/dist/web/utils/tcb.js +13 -0
- package/dist/web/utils/use-cloud-id-temp-url.js +3 -1
- package/dist/web/utils/useSyncValue.js +1 -0
- package/package.json +1 -1
- package/dist/cypress/support/commands.d.ts +0 -1
- package/dist/cypress/support/commands.js +0 -40
- package/dist/cypress/support/e2e.d.ts +0 -24
- package/dist/cypress/support/e2e.js +0 -22
- package/dist/src/configs/actions/showModal.json +0 -48
- package/dist/src/configs/actions/showToast.json +0 -41
- package/dist/src/configs/components/auth.json +0 -16
- package/dist/src/configs/components/button.json +0 -239
- package/dist/src/configs/components/calendar.json +0 -81
- package/dist/src/configs/components/carousel.json +0 -292
- package/dist/src/configs/components/chart/bar.json +0 -962
- package/dist/src/configs/components/chart/line.json +0 -878
- package/dist/src/configs/components/chart/pie.json +0 -685
- package/dist/src/configs/components/chart/statisticsCard.json +0 -376
- package/dist/src/configs/components/container.json +0 -50
- package/dist/src/configs/components/dataView.json +0 -247
- package/dist/src/configs/components/drawer.json +0 -115
- package/dist/src/configs/components/form/checkbox.json +0 -179
- package/dist/src/configs/components/form/departTreeSelect.json +0 -124
- package/dist/src/configs/components/form/form.json +0 -73
- package/dist/src/configs/components/form/input.json +0 -154
- package/dist/src/configs/components/form/location.json +0 -216
- package/dist/src/configs/components/form/radio.json +0 -203
- package/dist/src/configs/components/form/richText.json +0 -133
- package/dist/src/configs/components/form/select.json +0 -449
- package/dist/src/configs/components/form/switch.json +0 -58
- package/dist/src/configs/components/form/textarea.json +0 -116
- package/dist/src/configs/components/form/tips.json +0 -34
- package/dist/src/configs/components/form/uploader.json +0 -171
- package/dist/src/configs/components/form/uploaderFile.json +0 -158
- package/dist/src/configs/components/form/userTreeSelect.json +0 -128
- package/dist/src/configs/components/formdetail.json +0 -105
- package/dist/src/configs/components/graphicCard.json +0 -413
- package/dist/src/configs/components/image.json +0 -187
- package/dist/src/configs/components/link.json +0 -79
- package/dist/src/configs/components/listView.json +0 -378
- package/dist/src/configs/components/lottery.json +0 -163
- package/dist/src/configs/components/modal.json +0 -72
- package/dist/src/configs/components/navLayout.json +0 -368
- package/dist/src/configs/components/navigationBar.json +0 -62
- package/dist/src/configs/components/richtextview.json +0 -26
- package/dist/src/configs/components/scrollVeiw.json +0 -253
- package/dist/src/configs/components/slot.json +0 -17
- package/dist/src/configs/components/swiper.json +0 -90
- package/dist/src/configs/components/tabs.json +0 -122
- package/dist/src/configs/components/text.json +0 -95
- package/dist/src/configs/components/wedaVideo.json +0 -89
- package/dist/src/configs/components/wxOpenApi/phone.json +0 -127
- package/dist/src/configs/components/wxOpenApi/phoneCode.json +0 -109
- package/dist/src/configs/components/wxOpenApi/share.json +0 -160
- package/dist/src/configs/components/wxOpenApi/userInfo.json +0 -156
- package/dist/src/configs/index.d.ts +0 -103
- package/dist/src/configs/index.js +0 -111
- package/dist/src/docs/common/format.d.ts +0 -13
- package/dist/src/docs/common/format.js +0 -122
- package/dist/src/docs/common/tableView.d.ts +0 -30
- package/dist/src/docs/common/tableView.js +0 -156
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -3
- package/dist/src/setupTests.d.ts +0 -2
- package/dist/src/setupTests.js +0 -19
- package/dist/src/web/actions/index.d.ts +0 -2
- package/dist/src/web/actions/index.js +0 -2
- package/dist/src/web/actions/showModal/index.d.ts +0 -4
- package/dist/src/web/actions/showModal/index.js +0 -66
- package/dist/src/web/actions/showToast/index.d.ts +0 -1
- package/dist/src/web/actions/showToast/index.js +0 -3
- package/dist/src/web/components/button/index.d.ts +0 -32
- package/dist/src/web/components/button/index.js +0 -48
- package/dist/src/web/components/calendar/index.d.ts +0 -19
- package/dist/src/web/components/calendar/index.js +0 -191
- package/dist/src/web/components/calendar/util.d.ts +0 -13
- package/dist/src/web/components/calendar/util.js +0 -74
- package/dist/src/web/components/carousel/index.d.ts +0 -41
- package/dist/src/web/components/carousel/index.js +0 -244
- package/dist/src/web/components/chart/bar/index.d.ts +0 -3
- package/dist/src/web/components/chart/bar/index.js +0 -45
- package/dist/src/web/components/chart/common/config/bar.d.ts +0 -48
- package/dist/src/web/components/chart/common/config/bar.js +0 -49
- package/dist/src/web/components/chart/common/config/global.d.ts +0 -13
- package/dist/src/web/components/chart/common/config/global.js +0 -16
- package/dist/src/web/components/chart/common/config/line.d.ts +0 -46
- package/dist/src/web/components/chart/common/config/line.js +0 -49
- package/dist/src/web/components/chart/common/config/pie.d.ts +0 -29
- package/dist/src/web/components/chart/common/config/pie.js +0 -36
- package/dist/src/web/components/chart/common/core/eChartBar.d.ts +0 -66
- package/dist/src/web/components/chart/common/core/eChartBar.js +0 -201
- package/dist/src/web/components/chart/common/core/eChartBase.d.ts +0 -127
- package/dist/src/web/components/chart/common/core/eChartBase.js +0 -394
- package/dist/src/web/components/chart/common/core/eChartLine.d.ts +0 -60
- package/dist/src/web/components/chart/common/core/eChartLine.js +0 -173
- package/dist/src/web/components/chart/common/core/eChartPie.d.ts +0 -48
- package/dist/src/web/components/chart/common/core/eChartPie.js +0 -135
- package/dist/src/web/components/chart/common/core/type.d.ts +0 -35
- package/dist/src/web/components/chart/common/core/type.js +0 -9
- package/dist/src/web/components/chart/common/echarts.d.ts +0 -5
- package/dist/src/web/components/chart/common/echarts.js +0 -24
- package/dist/src/web/components/chart/common/error-boundary.d.ts +0 -5
- package/dist/src/web/components/chart/common/error-boundary.js +0 -26
- package/dist/src/web/components/chart/common/useChart.d.ts +0 -8
- package/dist/src/web/components/chart/common/useChart.js +0 -72
- package/dist/src/web/components/chart/line/index.d.ts +0 -3
- package/dist/src/web/components/chart/line/index.js +0 -42
- package/dist/src/web/components/chart/pie/index.d.ts +0 -3
- package/dist/src/web/components/chart/pie/index.js +0 -42
- package/dist/src/web/components/chart/statisticsCard/index.d.ts +0 -85
- package/dist/src/web/components/chart/statisticsCard/index.js +0 -203
- package/dist/src/web/components/chart/statisticsCard/interface.d.ts +0 -13
- package/dist/src/web/components/chart/statisticsCard/interface.js +0 -1
- package/dist/src/web/components/container/index.d.ts +0 -6
- package/dist/src/web/components/container/index.js +0 -6
- package/dist/src/web/components/dataView/index.d.ts +0 -6
- package/dist/src/web/components/dataView/index.js +0 -8
- package/dist/src/web/components/dataView/interface.d.ts +0 -5
- package/dist/src/web/components/dataView/interface.js +0 -1
- package/dist/src/web/components/drawer/index.d.ts +0 -13
- package/dist/src/web/components/drawer/index.js +0 -12
- package/dist/src/web/components/form/checkbox/index.d.ts +0 -13
- package/dist/src/web/components/form/checkbox/index.js +0 -167
- package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +0 -78
- package/dist/src/web/components/form/enumSelect/MultipleSelect.js +0 -52
- package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +0 -83
- package/dist/src/web/components/form/enumSelect/NormalSelect.js +0 -52
- package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +0 -16
- package/dist/src/web/components/form/enumSelect/SelectContainer.js +0 -30
- package/dist/src/web/components/form/enumSelect/index.d.ts +0 -82
- package/dist/src/web/components/form/enumSelect/index.js +0 -6
- package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +0 -34
- package/dist/src/web/components/form/enumSelect/props/defaultProps.js +0 -40
- package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +0 -39
- package/dist/src/web/components/form/enumSelect/props/propsTypes.js +0 -47
- package/dist/src/web/components/form/form/index.d.ts +0 -32
- package/dist/src/web/components/form/form/index.js +0 -150
- package/dist/src/web/components/form/formcell/index.d.ts +0 -8
- package/dist/src/web/components/form/formcell/index.js +0 -40
- package/dist/src/web/components/form/input/index.d.ts +0 -14
- package/dist/src/web/components/form/input/index.js +0 -94
- package/dist/src/web/components/form/location/common/mapChoose.d.ts +0 -15
- package/dist/src/web/components/form/location/common/mapChoose.js +0 -496
- package/dist/src/web/components/form/location/common/mapView.d.ts +0 -19
- package/dist/src/web/components/form/location/common/mapView.js +0 -175
- package/dist/src/web/components/form/location/common/propsConfig.d.ts +0 -59
- package/dist/src/web/components/form/location/common/propsConfig.js +0 -50
- package/dist/src/web/components/form/location/common/selectModal.d.ts +0 -21
- package/dist/src/web/components/form/location/common/selectModal.js +0 -44
- package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +0 -36
- package/dist/src/web/components/form/location/common/useLocationInfo.js +0 -105
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +0 -8
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +0 -328
- package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +0 -12
- package/dist/src/web/components/form/location/components/LocationPC/Header.js +0 -43
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +0 -8
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +0 -228
- package/dist/src/web/components/form/location/constants.d.ts +0 -2
- package/dist/src/web/components/form/location/constants.js +0 -3
- package/dist/src/web/components/form/location/index.d.ts +0 -1
- package/dist/src/web/components/form/location/index.js +0 -24
- package/dist/src/web/components/form/radio/index.d.ts +0 -11
- package/dist/src/web/components/form/radio/index.js +0 -115
- package/dist/src/web/components/form/renderDecorator.d.ts +0 -6
- package/dist/src/web/components/form/renderDecorator.js +0 -20
- package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +0 -15
- package/dist/src/web/components/form/select/dropdown-select/ui.js +0 -55
- package/dist/src/web/components/form/select/h5.d.ts +0 -16
- package/dist/src/web/components/form/select/h5.js +0 -466
- package/dist/src/web/components/form/select/index.d.ts +0 -66
- package/dist/src/web/components/form/select/index.js +0 -255
- package/dist/src/web/components/form/select/region/index.d.ts +0 -6
- package/dist/src/web/components/form/select/region/index.js +0 -147
- package/dist/src/web/components/form/select/time.d.ts +0 -9
- package/dist/src/web/components/form/select/time.js +0 -146
- package/dist/src/web/components/form/select/use-options.d.ts +0 -26
- package/dist/src/web/components/form/select/use-options.js +0 -103
- package/dist/src/web/components/form/select/year.d.ts +0 -7
- package/dist/src/web/components/form/select/year.js +0 -72
- package/dist/src/web/components/form/switch/index.d.ts +0 -6
- package/dist/src/web/components/form/switch/index.js +0 -58
- package/dist/src/web/components/form/textarea/index.d.ts +0 -12
- package/dist/src/web/components/form/textarea/index.js +0 -66
- package/dist/src/web/components/form/tips/index.d.ts +0 -8
- package/dist/src/web/components/form/tips/index.js +0 -17
- package/dist/src/web/components/form/uploader/index.d.ts +0 -3
- package/dist/src/web/components/form/uploader/index.js +0 -42
- package/dist/src/web/components/form/uploader/uploader.h5.d.ts +0 -20
- package/dist/src/web/components/form/uploader/uploader.h5.js +0 -199
- package/dist/src/web/components/form/uploader/uploader.pc.d.ts +0 -29
- package/dist/src/web/components/form/uploader/uploader.pc.js +0 -208
- package/dist/src/web/components/form/uploaderFile/index.d.ts +0 -4
- package/dist/src/web/components/form/uploaderFile/index.js +0 -19
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +0 -23
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +0 -330
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +0 -24
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +0 -302
- package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +0 -8
- package/dist/src/web/components/form/userOrgSelect/comTool.js +0 -101
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +0 -19
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +0 -252
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +0 -4
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -157
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +0 -2
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
- package/dist/src/web/components/form/userOrgSelect/index.d.ts +0 -2
- package/dist/src/web/components/form/userOrgSelect/index.js +0 -17
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +0 -27
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -276
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +0 -9
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +0 -253
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +0 -36
- package/dist/src/web/components/form/userOrgSelect/utils.js +0 -80
- package/dist/src/web/components/formdetail/index.d.ts +0 -28
- package/dist/src/web/components/formdetail/index.js +0 -173
- package/dist/src/web/components/graphicCard/index.d.ts +0 -46
- package/dist/src/web/components/graphicCard/index.js +0 -178
- package/dist/src/web/components/image/image.d.ts +0 -9
- package/dist/src/web/components/image/image.js +0 -119
- package/dist/src/web/components/image/index.d.ts +0 -13
- package/dist/src/web/components/image/index.js +0 -77
- package/dist/src/web/components/index.d.ts +0 -50
- package/dist/src/web/components/index.js +0 -99
- package/dist/src/web/components/link/index.d.ts +0 -24
- package/dist/src/web/components/link/index.js +0 -71
- package/dist/src/web/components/listView/index.d.ts +0 -7
- package/dist/src/web/components/listView/index.js +0 -297
- package/dist/src/web/components/listView/interface.d.ts +0 -127
- package/dist/src/web/components/listView/interface.js +0 -1
- package/dist/src/web/components/lottery/index.d.ts +0 -22
- package/dist/src/web/components/lottery/index.js +0 -385
- package/dist/src/web/components/lottery/lotteryUtil.d.ts +0 -23
- package/dist/src/web/components/lottery/lotteryUtil.js +0 -181
- package/dist/src/web/components/modal/index.d.ts +0 -17
- package/dist/src/web/components/modal/index.js +0 -11
- package/dist/src/web/components/modal/modal.h5.d.ts +0 -4
- package/dist/src/web/components/modal/modal.h5.js +0 -46
- package/dist/src/web/components/modal/modal.pc.d.ts +0 -3
- package/dist/src/web/components/modal/modal.pc.js +0 -31
- package/dist/src/web/components/navLayout/index.d.ts +0 -61
- package/dist/src/web/components/navLayout/index.js +0 -127
- package/dist/src/web/components/navigationBar/common.d.ts +0 -15
- package/dist/src/web/components/navigationBar/common.js +0 -127
- package/dist/src/web/components/navigationBar/h5Menu.d.ts +0 -14
- package/dist/src/web/components/navigationBar/h5Menu.js +0 -72
- package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +0 -12
- package/dist/src/web/components/navigationBar/horizontalMenu.js +0 -99
- package/dist/src/web/components/navigationBar/index.d.ts +0 -13
- package/dist/src/web/components/navigationBar/index.js +0 -157
- package/dist/src/web/components/navigationBar/verticalMenu.d.ts +0 -13
- package/dist/src/web/components/navigationBar/verticalMenu.js +0 -38
- package/dist/src/web/components/phone/index.d.ts +0 -18
- package/dist/src/web/components/phone/index.js +0 -4
- package/dist/src/web/components/phoneCode/index.d.ts +0 -18
- package/dist/src/web/components/phoneCode/index.js +0 -4
- package/dist/src/web/components/picker/datePicker.d.ts +0 -10
- package/dist/src/web/components/picker/datePicker.js +0 -31
- package/dist/src/web/components/picker/picker.d.ts +0 -6
- package/dist/src/web/components/picker/picker.js +0 -45
- package/dist/src/web/components/picker/timePicker.d.ts +0 -7
- package/dist/src/web/components/picker/timePicker.js +0 -42
- package/dist/src/web/components/richText/const.d.ts +0 -1
- package/dist/src/web/components/richText/const.js +0 -2
- package/dist/src/web/components/richText/index.d.ts +0 -50
- package/dist/src/web/components/richText/index.js +0 -351
- package/dist/src/web/components/richTextView/index.d.ts +0 -7
- package/dist/src/web/components/richTextView/index.js +0 -46
- package/dist/src/web/components/scrollView/index.d.ts +0 -26
- package/dist/src/web/components/scrollView/index.js +0 -97
- package/dist/src/web/components/share/index.d.ts +0 -34
- package/dist/src/web/components/share/index.js +0 -4
- package/dist/src/web/components/slot/index.d.ts +0 -6
- package/dist/src/web/components/slot/index.js +0 -9
- package/dist/src/web/components/swiper/index.d.ts +0 -24
- package/dist/src/web/components/swiper/index.js +0 -153
- package/dist/src/web/components/tabs/index.d.ts +0 -13
- package/dist/src/web/components/tabs/index.js +0 -20
- package/dist/src/web/components/tabs/tabs.h5.d.ts +0 -4
- package/dist/src/web/components/tabs/tabs.h5.js +0 -44
- package/dist/src/web/components/tabs/tabs.pc.d.ts +0 -3
- package/dist/src/web/components/tabs/tabs.pc.js +0 -40
- package/dist/src/web/components/text/index.d.ts +0 -14
- package/dist/src/web/components/text/index.js +0 -19
- package/dist/src/web/components/uploaderFileView/index.d.ts +0 -10
- package/dist/src/web/components/uploaderFileView/index.js +0 -46
- package/dist/src/web/components/uploaderView/index.d.ts +0 -17
- package/dist/src/web/components/uploaderView/index.js +0 -48
- package/dist/src/web/components/userInfo/index.d.ts +0 -26
- package/dist/src/web/components/userInfo/index.js +0 -4
- package/dist/src/web/components/wedaVideo/index.d.ts +0 -17
- package/dist/src/web/components/wedaVideo/index.js +0 -156
- package/dist/src/web/index.d.ts +0 -8
- package/dist/src/web/index.js +0 -4
- package/dist/src/web/utils/classnames.d.ts +0 -2
- package/dist/src/web/utils/classnames.js +0 -37
- package/dist/src/web/utils/constant.d.ts +0 -23
- package/dist/src/web/utils/constant.js +0 -24
- package/dist/src/web/utils/debounce.d.ts +0 -2
- package/dist/src/web/utils/debounce.js +0 -92
- package/dist/src/web/utils/getLocalCounter.d.ts +0 -1
- package/dist/src/web/utils/getLocalCounter.js +0 -4
- package/dist/src/web/utils/getUserService.d.ts +0 -11
- package/dist/src/web/utils/getUserService.js +0 -156
- package/dist/src/web/utils/isObjectEqual.d.ts +0 -2
- package/dist/src/web/utils/isObjectEqual.js +0 -12
- package/dist/src/web/utils/loading-fallback.d.ts +0 -2
- package/dist/src/web/utils/loading-fallback.js +0 -2
- package/dist/src/web/utils/lodash.d.ts +0 -1
- package/dist/src/web/utils/lodash.js +0 -2
- package/dist/src/web/utils/platform.d.ts +0 -18
- package/dist/src/web/utils/platform.js +0 -193
- package/dist/src/web/utils/tcb.d.ts +0 -33
- package/dist/src/web/utils/tcb.js +0 -118
- package/dist/src/web/utils/tmap.d.ts +0 -3
- package/dist/src/web/utils/tmap.js +0 -21
- package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +0 -1
- package/dist/src/web/utils/use-cloud-id-temp-url.js +0 -15
- package/dist/src/web/utils/useSetState.d.ts +0 -1
- package/dist/src/web/utils/useSetState.js +0 -8
- package/dist/src/web/utils/useSyncValue.d.ts +0 -4
- package/dist/src/web/utils/useSyncValue.js +0 -16
- package/dist/src/web/utils/weui.d.ts +0 -1
- package/dist/src/web/utils/weui.js +0 -2
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +0 -643
- package/dist/web/utils/getUserService.d.ts +0 -17
- package/dist/web/utils/getUserService.js +0 -148
- package/dist/web/utils/tmap.d.ts +0 -3
- package/dist/web/utils/tmap.js +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
3
|
import classNames from '../../utils/classnames';
|
|
4
4
|
import Swipe from 'react-easy-swipe';
|
|
5
5
|
import { useDebouncedCallback, useEventListener, useResizeObserver, } from '@react-hookz/web';
|
|
@@ -13,6 +13,15 @@ export default function Carousel({ className, style, autoplay, circular, vertica
|
|
|
13
13
|
const [swipeStyle, setSwipeStyle] = useState(null);
|
|
14
14
|
const [height, setHeight] = useState(0);
|
|
15
15
|
const { change = () => { } } = events;
|
|
16
|
+
const setIndex = useCallback((index) => {
|
|
17
|
+
if (index >= itemCount) {
|
|
18
|
+
index = 0;
|
|
19
|
+
}
|
|
20
|
+
if (index < 0) {
|
|
21
|
+
index = itemCount - 1;
|
|
22
|
+
}
|
|
23
|
+
setCurrentIndex(index);
|
|
24
|
+
}, [itemCount, setCurrentIndex]);
|
|
16
25
|
// 自动切换
|
|
17
26
|
useEffect(() => {
|
|
18
27
|
if (autoplay) {
|
|
@@ -23,10 +32,60 @@ export default function Carousel({ className, style, autoplay, circular, vertica
|
|
|
23
32
|
}, interval);
|
|
24
33
|
return () => clearInterval(timer);
|
|
25
34
|
}
|
|
26
|
-
}, [currentIndex, autoplay]);
|
|
35
|
+
}, [currentIndex, autoplay, interval, setIndex]);
|
|
27
36
|
// 触发切换
|
|
28
37
|
const pre = useRef({ index: currentIndex }).current;
|
|
29
38
|
useEffect(() => {
|
|
39
|
+
// 设置容器样式、动画
|
|
40
|
+
// TODO fix settimeout mess
|
|
41
|
+
const updateSwipeStyle = (to, cur, length) => {
|
|
42
|
+
let style = {};
|
|
43
|
+
// 最后向前到最开始
|
|
44
|
+
if (to === 0 && cur === length - 1) {
|
|
45
|
+
circular &&
|
|
46
|
+
setSwipeStyle({
|
|
47
|
+
transform: `translate3d(0, 0, 0)`,
|
|
48
|
+
});
|
|
49
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setSwipeStyle({
|
|
52
|
+
transform: vertical
|
|
53
|
+
? `translate3d(0, -100%, 0)`
|
|
54
|
+
: `translate3d(-100%, 0, 0)`,
|
|
55
|
+
transitionDuration: `${duration}ms`,
|
|
56
|
+
});
|
|
57
|
+
}, 50);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// 第一个后退到最后
|
|
61
|
+
if (to === length - 1 && cur === 0) {
|
|
62
|
+
circular &&
|
|
63
|
+
setSwipeStyle({
|
|
64
|
+
transform: vertical
|
|
65
|
+
? `translate3d(0, -${(to + 2) * 100}%, 0)`
|
|
66
|
+
: `translate3d(-${(to + 2) * 100}%, 0, 0)`,
|
|
67
|
+
});
|
|
68
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
setSwipeStyle({
|
|
71
|
+
transform: vertical
|
|
72
|
+
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
73
|
+
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
74
|
+
transitionDuration: `${duration}ms`,
|
|
75
|
+
});
|
|
76
|
+
}, 50);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
style = {
|
|
80
|
+
transform: vertical
|
|
81
|
+
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
82
|
+
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
83
|
+
};
|
|
84
|
+
if (to !== cur) {
|
|
85
|
+
style.transitionDuration = `${duration}ms`;
|
|
86
|
+
}
|
|
87
|
+
setSwipeStyle(style);
|
|
88
|
+
};
|
|
30
89
|
updateSwipeStyle(currentIndex, pre.index, itemCount);
|
|
31
90
|
change({
|
|
32
91
|
current: currentIndex,
|
|
@@ -34,7 +93,7 @@ export default function Carousel({ className, style, autoplay, circular, vertica
|
|
|
34
93
|
return () => {
|
|
35
94
|
pre.index = currentIndex;
|
|
36
95
|
};
|
|
37
|
-
}, [currentIndex, vertical]);
|
|
96
|
+
}, [currentIndex, vertical, pre, change, itemCount, circular, duration]);
|
|
38
97
|
const outerWrapRef = useRef();
|
|
39
98
|
useEventListener(outerWrapRef, 'load', (e) => {
|
|
40
99
|
setHeight(e.target.clientHeight);
|
|
@@ -46,65 +105,6 @@ export default function Carousel({ className, style, autoplay, circular, vertica
|
|
|
46
105
|
width: x.width ? x.width : '100%',
|
|
47
106
|
} })));
|
|
48
107
|
});
|
|
49
|
-
const setIndex = (index) => {
|
|
50
|
-
if (index >= itemCount) {
|
|
51
|
-
index = 0;
|
|
52
|
-
}
|
|
53
|
-
if (index < 0) {
|
|
54
|
-
index = itemCount - 1;
|
|
55
|
-
}
|
|
56
|
-
setCurrentIndex(index);
|
|
57
|
-
};
|
|
58
|
-
// 设置容器样式、动画
|
|
59
|
-
// TODO fix settimeout mess
|
|
60
|
-
const updateSwipeStyle = (to, cur, length) => {
|
|
61
|
-
let style = {};
|
|
62
|
-
// 最后向前到最开始
|
|
63
|
-
if (to === 0 && cur === length - 1) {
|
|
64
|
-
circular &&
|
|
65
|
-
setSwipeStyle({
|
|
66
|
-
transform: `translate3d(0, 0, 0)`,
|
|
67
|
-
});
|
|
68
|
-
// eslint-disable-next-line rulesdir/no-timer
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
setSwipeStyle({
|
|
71
|
-
transform: vertical
|
|
72
|
-
? `translate3d(0, -100%, 0)`
|
|
73
|
-
: `translate3d(-100%, 0, 0)`,
|
|
74
|
-
transitionDuration: `${duration}ms`,
|
|
75
|
-
});
|
|
76
|
-
}, 50);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
// 第一个后退到最后
|
|
80
|
-
if (to === length - 1 && cur === 0) {
|
|
81
|
-
circular &&
|
|
82
|
-
setSwipeStyle({
|
|
83
|
-
transform: vertical
|
|
84
|
-
? `translate3d(0, -${(to + 2) * 100}%, 0)`
|
|
85
|
-
: `translate3d(-${(to + 2) * 100}%, 0, 0)`,
|
|
86
|
-
});
|
|
87
|
-
// eslint-disable-next-line rulesdir/no-timer
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
setSwipeStyle({
|
|
90
|
-
transform: vertical
|
|
91
|
-
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
92
|
-
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
93
|
-
transitionDuration: `${duration}ms`,
|
|
94
|
-
});
|
|
95
|
-
}, 50);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
style = {
|
|
99
|
-
transform: vertical
|
|
100
|
-
? `translate3d(0, -${(to + 1) * 100}%, 0)`
|
|
101
|
-
: `translate3d(-${(to + 1) * 100}%, 0, 0)`,
|
|
102
|
-
};
|
|
103
|
-
if (to !== cur) {
|
|
104
|
-
style.transitionDuration = `${duration}ms`;
|
|
105
|
-
}
|
|
106
|
-
setSwipeStyle(style);
|
|
107
|
-
};
|
|
108
108
|
return (React.createElement("div", { className: classNames('g-swiper weda-ui g-carousel', className, {
|
|
109
109
|
vertical: vertical,
|
|
110
110
|
}), style: { height: height ? height : 'auto', ...style }, ref: outerWrapRef, id: id, "data-testid": "carousel" },
|
|
@@ -1,41 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
interface PropsType extends Omit<CommonPropsType, 'children'> {
|
|
5
|
-
directionType?: string;
|
|
6
|
-
isPile?: boolean;
|
|
7
|
-
isTitle?: boolean;
|
|
8
|
-
title?: string;
|
|
9
|
-
titleLocation?: string;
|
|
10
|
-
dataSource?: DataSource;
|
|
11
|
-
filterData?: string;
|
|
12
|
-
setColor?: Array<string>;
|
|
13
|
-
xField?: Xfield;
|
|
14
|
-
xStatistics?: string;
|
|
15
|
-
groupKey?: Xfield;
|
|
16
|
-
groupKeyTimeSpan?: string;
|
|
17
|
-
xIsCountEmpty?: boolean;
|
|
18
|
-
yField?: Yfield;
|
|
19
|
-
isLegend?: boolean;
|
|
20
|
-
legend?: string;
|
|
21
|
-
legend2?: string;
|
|
22
|
-
isXaxisName?: boolean;
|
|
23
|
-
xAxisName?: string;
|
|
24
|
-
isXaxisAxisLabelShow?: boolean;
|
|
25
|
-
isXaxisAxisTickShow?: boolean;
|
|
26
|
-
isXaxisAxisLabelRotate?: boolean;
|
|
27
|
-
isYAxisSplitlineLinestyleWidth?: boolean;
|
|
28
|
-
yAxisSplitlineLinestyleType?: string;
|
|
29
|
-
yAxisMax?: number;
|
|
30
|
-
yAxisMin?: number;
|
|
31
|
-
isYAxisName?: boolean;
|
|
32
|
-
yAxisName?: string;
|
|
33
|
-
isSeriesShowSymbol?: boolean;
|
|
34
|
-
isYAxisShow?: boolean;
|
|
35
|
-
isUnit?: boolean;
|
|
36
|
-
unit?: string;
|
|
37
|
-
decimalDigits?: number;
|
|
38
|
-
suffix?: string;
|
|
39
|
-
}
|
|
40
|
-
export default function Bar(opts: PropsType): JSX.Element;
|
|
41
|
-
export {};
|
|
2
|
+
import type { PropsType } from '../common/types';
|
|
3
|
+
export default function Bar(props: PropsType<'bar'>): JSX.Element;
|
|
@@ -1,56 +1,45 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
height: '380px',
|
|
46
|
-
width: '100%',
|
|
47
|
-
backgroundColor: '#ffffff',
|
|
48
|
-
...style,
|
|
49
|
-
};
|
|
50
|
-
return (React.createElement("div", { id: id, "data-testid": "bar", ref: domRef, style: inlineStyle, className: classNames({
|
|
51
|
-
'weda-ui-chart-bar': true,
|
|
52
|
-
'echart-wrapper-canvas': true,
|
|
53
|
-
'echart-dark-body': true,
|
|
54
|
-
[className]: className,
|
|
55
|
-
}) }));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import OldBar from './index.old';
|
|
3
|
+
import { checkIsNewData, transform } from '../common/data-transform';
|
|
4
|
+
import { Chart } from '../common/Chart';
|
|
5
|
+
import { emptyArray } from '../../../utils/constant';
|
|
6
|
+
import { ChartCustomConnector } from '../common/chart-custom-connector';
|
|
7
|
+
import { CommonErrorBoundary } from '../../common/error-boundary';
|
|
8
|
+
import { debug } from '../../../utils/console';
|
|
9
|
+
const logger = debug('bar:impl');
|
|
10
|
+
function BarImpl(props) {
|
|
11
|
+
logger.log(props, checkIsNewData(props));
|
|
12
|
+
if (props.dataSourceType === 'data-model') {
|
|
13
|
+
if (checkIsNewData(props)) {
|
|
14
|
+
props.dataSource = {
|
|
15
|
+
name: props['dataModel'].name,
|
|
16
|
+
type: 'database',
|
|
17
|
+
subType: 'database',
|
|
18
|
+
methodName: 'wedaAggregateData',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const oldBarProps = { ...props };
|
|
22
|
+
oldBarProps['dataModel'] = undefined;
|
|
23
|
+
oldBarProps['datasourceVariable'] = undefined;
|
|
24
|
+
oldBarProps['connectorMethod'] = undefined;
|
|
25
|
+
oldBarProps['connectorParams'] = undefined;
|
|
26
|
+
oldBarProps['connector'] = undefined;
|
|
27
|
+
debug('bar:old').log('OldBar', oldBarProps);
|
|
28
|
+
return React.createElement(OldBar, { ...oldBarProps });
|
|
29
|
+
}
|
|
30
|
+
else if (props.dataSourceType === 'variable') {
|
|
31
|
+
const { datasourceVariable = emptyArray, id, style, className, events, ...rest } = props;
|
|
32
|
+
const chartOptions = transform('bar', datasourceVariable, rest);
|
|
33
|
+
return (React.createElement(Chart, { id: id, "data-testid": "bar", className: className, style: style, events: events, chartOptions: chartOptions }));
|
|
34
|
+
}
|
|
35
|
+
else if (props.dataSourceType === 'custom-connector') {
|
|
36
|
+
return React.createElement(ChartCustomConnector, { "data-testid": "bar", type: "bar", ...props });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return React.createElement(OldBar, { ...props });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export default function Bar(props) {
|
|
43
|
+
return (React.createElement(CommonErrorBoundary, { ...props },
|
|
44
|
+
React.createElement(BarImpl, { ...props })));
|
|
56
45
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -28,13 +28,12 @@ declare class EchartBar extends EchartBase {
|
|
|
28
28
|
setDirectionType({ directionType }: {
|
|
29
29
|
directionType: any;
|
|
30
30
|
}): void;
|
|
31
|
-
setOptions({ directionType, isPile, setColor, isTitle, title,
|
|
31
|
+
setOptions({ directionType, isPile, setColor, isTitle, title, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
|
|
32
32
|
directionType: any;
|
|
33
33
|
isPile: any;
|
|
34
34
|
setColor: any;
|
|
35
35
|
isTitle: any;
|
|
36
36
|
title: any;
|
|
37
|
-
titleLocation: any;
|
|
38
37
|
dataSource: any;
|
|
39
38
|
filterData: any;
|
|
40
39
|
xField: any;
|
|
@@ -45,7 +44,6 @@ declare class EchartBar extends EchartBase {
|
|
|
45
44
|
yField: any;
|
|
46
45
|
isLegend: any;
|
|
47
46
|
legend: any;
|
|
48
|
-
legend2: any;
|
|
49
47
|
isXaxisName: any;
|
|
50
48
|
xAxisName: any;
|
|
51
49
|
isXaxisAxisLabelShow: any;
|
|
@@ -155,8 +155,11 @@ class EchartBar extends EchartBase {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
async setOptions({ directionType, isPile, setColor, isTitle, title,
|
|
159
|
-
|
|
158
|
+
async setOptions({ directionType, isPile, setColor, isTitle, title,
|
|
159
|
+
// titleLocation,
|
|
160
|
+
dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend,
|
|
161
|
+
// legend2,
|
|
162
|
+
isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
|
|
160
163
|
if (dataSource) {
|
|
161
164
|
await this.setSourceData({
|
|
162
165
|
dataSource,
|
|
@@ -171,7 +174,7 @@ class EchartBar extends EchartBase {
|
|
|
171
174
|
});
|
|
172
175
|
}
|
|
173
176
|
this.setColor({ setColor });
|
|
174
|
-
this.setTitle({ isTitle, title
|
|
177
|
+
this.setTitle({ isTitle, title });
|
|
175
178
|
this.setLegend({ isLegend, legend });
|
|
176
179
|
this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
|
|
177
180
|
this.setIsXaxisName({ isXaxisName, xAxisName });
|
|
@@ -26,7 +26,7 @@ declare type IReturnData = {
|
|
|
26
26
|
declare class EchartBase extends AbstractEchartBaseModal {
|
|
27
27
|
config: any;
|
|
28
28
|
constructor();
|
|
29
|
-
setOptions(
|
|
29
|
+
setOptions(_options: any): Promise<void>;
|
|
30
30
|
/** 获取所有配置好的图表数据 */
|
|
31
31
|
getOptions(): any;
|
|
32
32
|
/** 生成后台查询条件 */
|
|
@@ -44,10 +44,9 @@ declare class EchartBase extends AbstractEchartBaseModal {
|
|
|
44
44
|
*
|
|
45
45
|
**/
|
|
46
46
|
protected getSourceData(sourceName: string, methods: string, dataSourceType: string, params: any): Promise<any>;
|
|
47
|
-
protected setTitle({ isTitle, title
|
|
47
|
+
protected setTitle({ isTitle, title }: {
|
|
48
48
|
isTitle: any;
|
|
49
49
|
title: any;
|
|
50
|
-
titleLocation?: string;
|
|
51
50
|
}): void;
|
|
52
51
|
protected setLegend({ isLegend, legend }: {
|
|
53
52
|
isLegend: any;
|
|
@@ -19,7 +19,8 @@ class EchartBase extends AbstractEchartBaseModal {
|
|
|
19
19
|
});
|
|
20
20
|
this.config = getConfig();
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
23
|
+
async setOptions(_options) { }
|
|
23
24
|
/** 获取所有配置好的图表数据 */
|
|
24
25
|
getOptions() {
|
|
25
26
|
return this.config;
|
|
@@ -91,9 +92,10 @@ class EchartBase extends AbstractEchartBaseModal {
|
|
|
91
92
|
**/
|
|
92
93
|
async getSourceData(sourceName = '', methods = '', dataSourceType = '', params) {
|
|
93
94
|
var _a, _b, _c;
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
if (dataSourceType === 'database' &&
|
|
96
|
+
(!sourceName ||
|
|
97
|
+
Object.keys((_a = params === null || params === void 0 ? void 0 : params.dimension) !== null && _a !== void 0 ? _a : {}).length <= 0 ||
|
|
98
|
+
((_b = params.value) !== null && _b !== void 0 ? _b : []).length <= 0)) {
|
|
97
99
|
console.warn('charts 参数不完整');
|
|
98
100
|
return [];
|
|
99
101
|
}
|
|
@@ -121,7 +123,7 @@ class EchartBase extends AbstractEchartBaseModal {
|
|
|
121
123
|
return [];
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
|
-
setTitle({ isTitle, title
|
|
126
|
+
setTitle({ isTitle, title }) {
|
|
125
127
|
this.config.title;
|
|
126
128
|
this.config.title.show = isTitle;
|
|
127
129
|
this.config.title.text = title;
|
|
@@ -182,8 +184,46 @@ class EchartBase extends AbstractEchartBaseModal {
|
|
|
182
184
|
sortXAxisData(arrData, formatType = '') {
|
|
183
185
|
const xFields = [...arrData];
|
|
184
186
|
if (['datetime', 'date', 'time'].includes(formatType)) {
|
|
187
|
+
const monthRegex = /^(\d{4}(?:-\d{2}){0,2}) {0,1}(\d{2})$/;
|
|
188
|
+
const weekRegex = /^(\d{4})W(\d+)$/;
|
|
185
189
|
xFields.sort((a, b) => {
|
|
186
190
|
if (a.XLabel.Value && b.XLabel.Value) {
|
|
191
|
+
const monthMathcA = monthRegex.exec(a.XLabel.Value);
|
|
192
|
+
const monthMatchB = monthRegex.exec(b.XLabel.Value);
|
|
193
|
+
if (monthMatchB &&
|
|
194
|
+
monthMatchB &&
|
|
195
|
+
monthMathcA[1] &&
|
|
196
|
+
monthMatchB[1] &&
|
|
197
|
+
monthMathcA[2] &&
|
|
198
|
+
monthMatchB[2]) {
|
|
199
|
+
// 月的 格式 YYYY-MM-DD HH
|
|
200
|
+
const aDate = new Date(monthMathcA[1]).getTime();
|
|
201
|
+
const bDate = new Date(monthMatchB[1]).getTime();
|
|
202
|
+
const aHour = parseInt(monthMathcA[2], 10);
|
|
203
|
+
const bHour = parseInt(monthMatchB[2], 10);
|
|
204
|
+
if (aDate !== bDate) {
|
|
205
|
+
return aDate - bDate;
|
|
206
|
+
}
|
|
207
|
+
return aHour - bHour;
|
|
208
|
+
}
|
|
209
|
+
const weekMathcA = weekRegex.exec(a.XLabel.Value);
|
|
210
|
+
const weekMatchB = weekRegex.exec(b.XLabel.Value);
|
|
211
|
+
if (weekMatchB &&
|
|
212
|
+
weekMatchB &&
|
|
213
|
+
weekMathcA[1] &&
|
|
214
|
+
weekMatchB[1] &&
|
|
215
|
+
weekMathcA[2] &&
|
|
216
|
+
weekMatchB[2]) {
|
|
217
|
+
// 月的格式 2022W5
|
|
218
|
+
const aYear = parseInt(weekMathcA[1], 10);
|
|
219
|
+
const bYear = parseInt(weekMatchB[1], 10);
|
|
220
|
+
const aWeek = parseInt(weekMathcA[2], 10);
|
|
221
|
+
const bWeek = parseInt(weekMatchB[2], 10);
|
|
222
|
+
if (aYear !== bYear) {
|
|
223
|
+
return aYear - bYear;
|
|
224
|
+
}
|
|
225
|
+
return aWeek - bWeek;
|
|
226
|
+
}
|
|
187
227
|
return (new Date(a.XLabel.Value).getTime() -
|
|
188
228
|
new Date(b.XLabel.Value).getTime());
|
|
189
229
|
}
|
|
@@ -267,6 +307,8 @@ class EchartBase extends AbstractEchartBaseModal {
|
|
|
267
307
|
// 显示 X 轴标签名
|
|
268
308
|
setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow }) {
|
|
269
309
|
this.config.xAxis.axisLabel.show = isXaxisAxisLabelShow;
|
|
310
|
+
// 阻止自动隐藏
|
|
311
|
+
this.config.xAxis.axisLabel.interval = 0;
|
|
270
312
|
}
|
|
271
313
|
// 显示 X 轴名
|
|
272
314
|
setIsXaxisName({ isXaxisName, xAxisName }) {
|
|
@@ -24,11 +24,10 @@ declare class EchartLine extends EchartBase {
|
|
|
24
24
|
decimalDigits: any;
|
|
25
25
|
suffix: any;
|
|
26
26
|
}): void;
|
|
27
|
-
setOptions({ chartType, isTitle, title,
|
|
27
|
+
setOptions({ chartType, isTitle, title, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
28
|
chartType: any;
|
|
29
29
|
isTitle: any;
|
|
30
30
|
title: any;
|
|
31
|
-
titleLocation: any;
|
|
32
31
|
dataSource: any;
|
|
33
32
|
filterData: any;
|
|
34
33
|
xField: any;
|
|
@@ -39,7 +38,6 @@ declare class EchartLine extends EchartBase {
|
|
|
39
38
|
yField: any;
|
|
40
39
|
isLegend: any;
|
|
41
40
|
legend: any;
|
|
42
|
-
legend2: any;
|
|
43
41
|
isXaxisName: any;
|
|
44
42
|
xAxisName: any;
|
|
45
43
|
isXaxisAxisLabelShow: any;
|
|
@@ -130,7 +130,11 @@ class EchartLine extends EchartBase {
|
|
|
130
130
|
this.config.yAxis.axisLabel.formatter = null;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
async setOptions({ chartType, isTitle, title,
|
|
133
|
+
async setOptions({ chartType, isTitle, title,
|
|
134
|
+
// titleLocation,
|
|
135
|
+
dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend,
|
|
136
|
+
// legend2,
|
|
137
|
+
isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
|
|
134
138
|
if (dataSource) {
|
|
135
139
|
await this.setSourceData({
|
|
136
140
|
dataSource,
|
|
@@ -143,9 +147,8 @@ class EchartLine extends EchartBase {
|
|
|
143
147
|
groupKeyTimeSpan,
|
|
144
148
|
});
|
|
145
149
|
}
|
|
146
|
-
legend = document.body.clientWidth < 1024 ? legend : legend2;
|
|
147
150
|
this.setChartType({ chartType });
|
|
148
|
-
this.setTitle({ isTitle, title
|
|
151
|
+
this.setTitle({ isTitle, title });
|
|
149
152
|
this.setLegend({ isLegend, legend });
|
|
150
153
|
this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
|
|
151
154
|
this.setIsXaxisName({ isXaxisName, xAxisName });
|
|
@@ -24,11 +24,10 @@ declare class EchartPie extends EchartBase {
|
|
|
24
24
|
decimalDigits: any;
|
|
25
25
|
suffix: any;
|
|
26
26
|
}): void;
|
|
27
|
-
setOptions({ chartType, isTitle, title,
|
|
27
|
+
setOptions({ chartType, isTitle, title, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
28
|
chartType: any;
|
|
29
29
|
isTitle: any;
|
|
30
30
|
title: any;
|
|
31
|
-
titleLocation: any;
|
|
32
31
|
dataSource: any;
|
|
33
32
|
filterData: any;
|
|
34
33
|
setColor: any;
|
|
@@ -38,7 +37,6 @@ declare class EchartPie extends EchartBase {
|
|
|
38
37
|
yField: any;
|
|
39
38
|
isLegend: any;
|
|
40
39
|
legend: any;
|
|
41
|
-
legend2: any;
|
|
42
40
|
isSeriesShowSymbol: any;
|
|
43
41
|
isPercent: any;
|
|
44
42
|
isUnit: any;
|
|
@@ -103,8 +103,11 @@ class EchartPie extends EchartBase {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
async setOptions({ chartType, isTitle, title,
|
|
107
|
-
|
|
106
|
+
async setOptions({ chartType, isTitle, title,
|
|
107
|
+
// titleLocation,
|
|
108
|
+
dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend,
|
|
109
|
+
// legend2,
|
|
110
|
+
isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
108
111
|
if (dataSource) {
|
|
109
112
|
await this.setSourceData({
|
|
110
113
|
dataSource,
|
|
@@ -117,7 +120,7 @@ class EchartPie extends EchartBase {
|
|
|
117
120
|
});
|
|
118
121
|
}
|
|
119
122
|
this.setChartType({ chartType });
|
|
120
|
-
this.setTitle({ isTitle, title
|
|
123
|
+
this.setTitle({ isTitle, title });
|
|
121
124
|
this.setLegend({ isLegend, legend });
|
|
122
125
|
this.setIsSeriesShowSymbol({
|
|
123
126
|
isSeriesShowSymbol,
|
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import * as echarts from 'echarts/core';
|
|
2
|
+
import type { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts';
|
|
3
|
+
import type { TitleComponentOption, TooltipComponentOption, LegendComponentOption, GridComponentOption } from 'echarts/components';
|
|
2
4
|
export default echarts;
|
|
5
|
+
export declare type ECOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | PieSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, } from '@react-hookz/web';
|
|
2
|
-
import { useEffect,
|
|
1
|
+
import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, useResizeObserver, } from '@react-hookz/web';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { debug } from '../../../utils/console';
|
|
4
|
+
const logger = debug('chart:use-chart');
|
|
3
5
|
export function useChart(ref) {
|
|
4
|
-
const chartRef =
|
|
6
|
+
const [chartRef, setChartRef] = useState(null);
|
|
5
7
|
const isMounted = useIsMounted();
|
|
6
8
|
useMountEffect(async () => {
|
|
7
9
|
if (!ref.current || !isMounted) {
|
|
@@ -9,17 +11,18 @@ export function useChart(ref) {
|
|
|
9
11
|
}
|
|
10
12
|
const echarts = (await import(/* webpackChunkName: "echarts" */ './echarts')).default;
|
|
11
13
|
const echartDom = ref.current;
|
|
12
|
-
|
|
13
|
-
chartRef.current = chart;
|
|
14
|
+
setChartRef(echarts.init(echartDom));
|
|
14
15
|
return () => {
|
|
15
|
-
|
|
16
|
-
chartRef.current = null;
|
|
16
|
+
chartRef.dispose();
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
useEventListener(window, 'resize', () => {
|
|
20
|
-
chartRef
|
|
20
|
+
chartRef && chartRef.resize();
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
useResizeObserver(ref, () => {
|
|
23
|
+
chartRef && chartRef.resize();
|
|
24
|
+
});
|
|
25
|
+
return chartRef;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
* @deprecated The method should not be used
|
|
@@ -29,6 +32,7 @@ export function useWedaChart(domRef, ModalClass, options) {
|
|
|
29
32
|
const getOptions = async () => {
|
|
30
33
|
const chartModal = new ModalClass();
|
|
31
34
|
let finalOptions = await chartModal.setOptions(options);
|
|
35
|
+
logger.log(options, finalOptions);
|
|
32
36
|
if (!finalOptions) {
|
|
33
37
|
finalOptions = chartModal.getOptions();
|
|
34
38
|
}
|
|
@@ -46,8 +50,16 @@ export function useWedaChart(domRef, ModalClass, options) {
|
|
|
46
50
|
actions,
|
|
47
51
|
]);
|
|
48
52
|
useEffect(() => {
|
|
53
|
+
if (state.status === 'loading' || state.status === 'not-executed') {
|
|
54
|
+
chart === null || chart === void 0 ? void 0 : chart.showLoading();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
chart === null || chart === void 0 ? void 0 : chart.hideLoading();
|
|
58
|
+
}, [chart, state.status]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
logger.log(state, state.result);
|
|
49
61
|
if (state.status === 'success' && chart) {
|
|
50
|
-
|
|
62
|
+
logger.log(options, state.result, window.location.href);
|
|
51
63
|
chart.setOption(state.result, true // noMerge 全刷
|
|
52
64
|
);
|
|
53
65
|
}
|
|
@@ -56,5 +68,5 @@ export function useWedaChart(domRef, ModalClass, options) {
|
|
|
56
68
|
console.error(state.error);
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
|
-
}, [state]);
|
|
71
|
+
}, [state, chart, options]);
|
|
60
72
|
}
|