@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,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
3
|
import classNames from '../../utils/classnames';
|
|
4
4
|
import './index.css';
|
|
5
5
|
import { ImageInner } from './image';
|
|
6
6
|
import { emptyObject } from '../../utils/constant';
|
|
7
|
+
import { useTempUrl } from '../../utils/use-cloud-id-temp-url';
|
|
7
8
|
export default function Image({
|
|
8
9
|
// 系统属性
|
|
9
10
|
className, events = emptyObject, style,
|
|
@@ -17,22 +18,7 @@ src, alt, mode, lazyLoad, imgPreview, maskClosable, fit, }) {
|
|
|
17
18
|
[className]: className,
|
|
18
19
|
});
|
|
19
20
|
const objectFit = fit || getObjectFitByWxImageMode(mode);
|
|
20
|
-
const
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (/^cloud:\/\//.test(src)) {
|
|
23
|
-
window.app.cloud
|
|
24
|
-
.getTempFileURL(src)
|
|
25
|
-
.then((res) => {
|
|
26
|
-
setRealSrc(res || '');
|
|
27
|
-
})
|
|
28
|
-
.catch(() => {
|
|
29
|
-
setRealSrc('');
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
setRealSrc(src);
|
|
34
|
-
}
|
|
35
|
-
}, [src]);
|
|
21
|
+
const { data: realSrc } = useTempUrl(src);
|
|
36
22
|
/**
|
|
37
23
|
* 模拟小程序的widthFix、heightFix模式
|
|
38
24
|
*/
|
|
@@ -60,7 +46,7 @@ src, alt, mode, lazyLoad, imgPreview, maskClosable, fit, }) {
|
|
|
60
46
|
else {
|
|
61
47
|
return style;
|
|
62
48
|
}
|
|
63
|
-
}, [
|
|
49
|
+
}, [objectFit, style]);
|
|
64
50
|
return src === realSrc || (realSrc !== undefined && src !== realSrc) ? (React.createElement(ImageInner, { objectFit: realFit, style: realStyle, className: cls, alt: alt, src: realSrc, isError: isError, setIsError: setIsError, events: events, lazyLoad: lazyLoad, imgPreview: imgPreview, maskClosable: maskClosable })) : null;
|
|
65
51
|
}
|
|
66
52
|
function getObjectFitByWxImageMode(mode) {
|
|
@@ -80,7 +80,9 @@ export { default as NavigationBar } from './navigationBar';
|
|
|
80
80
|
// export { default as Bar } from './chart/bar';
|
|
81
81
|
// export { default as Pie } from './chart/pie';
|
|
82
82
|
export const Line = loadable(() => import('./chart/line'), { fallback });
|
|
83
|
-
export const Bar = loadable(() => import('./chart/bar'), {
|
|
83
|
+
export const Bar = loadable(() => import('./chart/bar/index'), {
|
|
84
|
+
fallback,
|
|
85
|
+
});
|
|
84
86
|
export const Pie = loadable(() => import('./chart/pie'), { fallback });
|
|
85
87
|
export { default as DataView } from './dataView';
|
|
86
88
|
export { default as StatisticsCard } from './chart/statisticsCard';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
3
|
import { callDataSource } from '../../utils/tcb';
|
|
3
4
|
import { isInIde, getWhereList } from '../../utils/platform';
|
|
4
5
|
import classNames from '../../utils/classnames';
|
|
@@ -184,7 +185,8 @@ export default function ListView(props) {
|
|
|
184
185
|
* 根据fetchData方法返回值,回调给外部事件
|
|
185
186
|
*/
|
|
186
187
|
const onEnvets = (data, datasource) => {
|
|
187
|
-
var _a, _b, _c, _d, _e
|
|
188
|
+
var _a, _b, _c, _d, _e;
|
|
189
|
+
const bottomLoadTimer = 150;
|
|
188
190
|
const fetchRecords = [].concat(!isRecords && !isModel ? data : (data === null || data === void 0 ? void 0 : data.records) || []);
|
|
189
191
|
const total = (_a = data === null || data === void 0 ? void 0 : data.total) !== null && _a !== void 0 ? _a : fetchRecords.length;
|
|
190
192
|
if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
|
|
@@ -200,20 +202,29 @@ export default function ListView(props) {
|
|
|
200
202
|
data: beforeDataChange(dataRef.current.records || []),
|
|
201
203
|
});
|
|
202
204
|
if (total === 0) {
|
|
205
|
+
setStatus(isModel ? 'empty' : '');
|
|
203
206
|
(_c = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _c === void 0 ? void 0 : _c.call(events, {
|
|
204
207
|
datasource,
|
|
205
208
|
data: beforeDataChange([]),
|
|
206
209
|
});
|
|
207
|
-
setStatus(isModel ? 'empty' : '');
|
|
208
210
|
}
|
|
209
211
|
else {
|
|
210
|
-
|
|
212
|
+
const statusCb = () => setStatus('success');
|
|
213
|
+
pagination === 'bottomLoad'
|
|
214
|
+
? window.setTimeout(statusCb, bottomLoadTimer)
|
|
215
|
+
: statusCb();
|
|
211
216
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
const successCb = () => {
|
|
218
|
+
var _a;
|
|
219
|
+
(_a = events === null || events === void 0 ? void 0 : events.querySuccess) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
220
|
+
datasource,
|
|
221
|
+
data: beforeDataChange(dataRef.current.records),
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
pagination === 'bottomLoad'
|
|
225
|
+
? window.setTimeout(successCb, bottomLoadTimer + 50)
|
|
226
|
+
: successCb();
|
|
227
|
+
setPageNo(((_e = (_d = paramRef.current) === null || _d === void 0 ? void 0 : _d.params) === null || _e === void 0 ? void 0 : _e.pageNo) || 1);
|
|
217
228
|
};
|
|
218
229
|
/**
|
|
219
230
|
* 分页,加载更多
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-key */
|
|
2
|
-
import React, { useState, useEffect, useCallback, useImperativeHandle, } from 'react';
|
|
2
|
+
import React, { useState, useEffect, useCallback, useImperativeHandle, useMemo, } from 'react';
|
|
3
3
|
import { usePlatform } from '../../utils/platform';
|
|
4
4
|
import classNames from '../../utils/classnames';
|
|
5
5
|
import './index.css';
|
|
@@ -14,7 +14,7 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
14
14
|
const [lotteryList, setLotteryList] = useState([]);
|
|
15
15
|
const [btnActived, setBtnActived] = useState(false);
|
|
16
16
|
//获取初始化默认数据,数据不足8条设置默认,超过8条获取前8条
|
|
17
|
-
const lotteryListDefault = () => {
|
|
17
|
+
const lotteryListDefault = useMemo(() => {
|
|
18
18
|
const list = [];
|
|
19
19
|
if (prizeList == null) {
|
|
20
20
|
return list;
|
|
@@ -39,21 +39,15 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return list;
|
|
42
|
-
};
|
|
42
|
+
}, [prizeList]);
|
|
43
43
|
const startLottery = useCallback(() => {
|
|
44
|
-
setLotteryList(lotteryListDefault
|
|
44
|
+
setLotteryList(lotteryListDefault);
|
|
45
45
|
setBtnActived(true);
|
|
46
46
|
if (lotteryAction.isStart)
|
|
47
47
|
return;
|
|
48
48
|
events === null || events === void 0 ? void 0 : events.clickLotteryButton();
|
|
49
49
|
setIsStartLottery(true);
|
|
50
|
-
}, [
|
|
51
|
-
lotteryAction.isStart,
|
|
52
|
-
setIsStartLottery,
|
|
53
|
-
setBtnActived,
|
|
54
|
-
lotteryListDefault,
|
|
55
|
-
setLotteryList,
|
|
56
|
-
]);
|
|
50
|
+
}, [lotteryListDefault, events]);
|
|
57
51
|
useImperativeHandle(ref, () => {
|
|
58
52
|
return {
|
|
59
53
|
methods: {
|
|
@@ -62,8 +56,8 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
62
56
|
};
|
|
63
57
|
}, [startLottery]);
|
|
64
58
|
useEffect(() => {
|
|
65
|
-
setLotteryList(lotteryListDefault
|
|
66
|
-
}, [
|
|
59
|
+
setLotteryList(lotteryListDefault);
|
|
60
|
+
}, [lotteryListDefault]);
|
|
67
61
|
useEffect(() => {
|
|
68
62
|
lotteryAction.animationCallback = ({ idx, isEnd }) => {
|
|
69
63
|
setActivedId(idx == -1 ? 0 : idx);
|
|
@@ -90,7 +84,7 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
90
84
|
}, 700);
|
|
91
85
|
}
|
|
92
86
|
};
|
|
93
|
-
}, [lotteryList]);
|
|
87
|
+
}, [events, lotteryList]);
|
|
94
88
|
useEffect(() => {
|
|
95
89
|
// 当满足开启抽奖条件并且点击了开奖开关时,启用抽奖
|
|
96
90
|
if (enablePrize && isStartLottery) {
|
|
@@ -108,7 +102,7 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
108
102
|
//立马停止抽奖
|
|
109
103
|
lotteryAction.stop();
|
|
110
104
|
}
|
|
111
|
-
}, [isStartLottery, enablePrize]);
|
|
105
|
+
}, [isStartLottery, enablePrize, prizeResult]);
|
|
112
106
|
useEffect(() => {
|
|
113
107
|
// 设置抽奖结果
|
|
114
108
|
lotteryAction.end(prizeResult);
|
|
@@ -188,7 +182,7 @@ export default React.forwardRef(function Lottery({ className, id, style, prizeLi
|
|
|
188
182
|
setDotHeight(dotHeight);
|
|
189
183
|
}
|
|
190
184
|
}
|
|
191
|
-
}, [style]);
|
|
185
|
+
}, [platform, style]);
|
|
192
186
|
const renderDot = (direction, list) => {
|
|
193
187
|
return (React.createElement(React.Fragment, null,
|
|
194
188
|
React.createElement("div", { className: classNames(`${CLASS_PREFIX}__dot`, `${CLASS_PREFIX}__dot-${direction}`) }, list.map((item, index) => {
|
|
@@ -7,5 +7,5 @@ export default React.forwardRef(function WeDaModal(props, ref) {
|
|
|
7
7
|
if (platform === 'h5') {
|
|
8
8
|
return React.createElement(ModalH5, { ...props, outerRef: ref });
|
|
9
9
|
}
|
|
10
|
-
return React.createElement(ModalPc, { ...props, outerRef: ref });
|
|
10
|
+
return React.createElement(ModalPc, { size: "auto", ...props, outerRef: ref });
|
|
11
11
|
});
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import './index.css';
|
|
4
|
+
export declare type INavOption = {
|
|
5
|
+
params: Array<{
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}>;
|
|
9
|
+
paramObj?: any;
|
|
10
|
+
icon?: string;
|
|
11
|
+
iconSrc?: string;
|
|
12
|
+
title: string;
|
|
13
|
+
tapStatus: 'tap' | 'inside' | 'outer';
|
|
14
|
+
insideUrl?: string;
|
|
15
|
+
outerUrl?: string;
|
|
16
|
+
newPage?: boolean;
|
|
17
|
+
withParams?: boolean;
|
|
18
|
+
};
|
|
4
19
|
export default function NavLayout({ navOption, mobileCol, pcCol, iconSize, textColor, fontSize, lineHeight, fontWeight, maxLines, className, style, }: H5NavLayoutProps): JSX.Element;
|
|
5
20
|
export interface H5NavLayoutProps extends CommonPropsType {
|
|
6
21
|
/**
|
|
7
22
|
* 导航配置
|
|
8
23
|
*/
|
|
9
|
-
navOption?:
|
|
24
|
+
navOption?: Readonly<INavOption[]>;
|
|
10
25
|
/**
|
|
11
26
|
* 移动端每行列数
|
|
12
27
|
*/
|
|
@@ -5,14 +5,19 @@ import { usePlatform } from '../../utils/platform';
|
|
|
5
5
|
import './index.css';
|
|
6
6
|
import { IconFont } from 'tdesign-icons-react';
|
|
7
7
|
import Image from '../image';
|
|
8
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
9
|
+
import { emptyArray } from '../../utils/constant';
|
|
8
10
|
/**
|
|
9
11
|
* Web端
|
|
10
12
|
*/
|
|
11
13
|
const CLASS_PREFIX = 'weda-grid-navigation';
|
|
12
|
-
export default function NavLayout({ navOption, mobileCol, pcCol, iconSize, textColor, fontSize, lineHeight, fontWeight, maxLines, className, style, }) {
|
|
14
|
+
export default function NavLayout({ navOption = emptyArray, mobileCol, pcCol, iconSize, textColor, fontSize, lineHeight, fontWeight, maxLines, className, style, }) {
|
|
13
15
|
const platform = usePlatform();
|
|
16
|
+
// 两次默认值不同, 需要刷新
|
|
17
|
+
const prevNavOptionRef = React.useRef(null);
|
|
14
18
|
// 等分列占比
|
|
15
19
|
const [colCount, setColCount] = React.useState(4);
|
|
20
|
+
const prevColRef = React.useRef(0);
|
|
16
21
|
const cls = classNames({
|
|
17
22
|
[CLASS_PREFIX]: true,
|
|
18
23
|
[className]: className,
|
|
@@ -20,30 +25,36 @@ export default function NavLayout({ navOption, mobileCol, pcCol, iconSize, textC
|
|
|
20
25
|
});
|
|
21
26
|
const navList = React.useMemo(() => {
|
|
22
27
|
const list = [];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
for (const info of item.params) {
|
|
36
|
-
paramObj[info.key] = info.value;
|
|
28
|
+
if (prevColRef.current !== colCount ||
|
|
29
|
+
(navOption.length > 0 &&
|
|
30
|
+
!isObjectEqual(prevNavOptionRef.current !== navOption))) {
|
|
31
|
+
list.length = Math.floor(navOption.length / colCount);
|
|
32
|
+
list.forEach((item, index) => {
|
|
33
|
+
list[index] = [];
|
|
34
|
+
});
|
|
35
|
+
navOption.forEach((item, index) => {
|
|
36
|
+
const _index = Math.floor(index / colCount);
|
|
37
|
+
if (!list[_index] || list[_index].length <= 0) {
|
|
38
|
+
// 保证每个col 的数据都是有的,列入总共7个数据,那么第二行的3, 4,5数据是undefined, 占位
|
|
39
|
+
list[_index] = Array(colCount).fill(null);
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
const paramObj = {};
|
|
42
|
+
if (item === null || item === void 0 ? void 0 : item.params) {
|
|
43
|
+
for (const info of item.params) {
|
|
44
|
+
paramObj[info.key] = info.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
item.paramObj = paramObj;
|
|
48
|
+
list[_index][index - _index * colCount] = item;
|
|
49
|
+
prevNavOptionRef.current = [...navOption];
|
|
50
|
+
prevColRef.current = colCount;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
42
53
|
return list;
|
|
43
54
|
}, [colCount, navOption]);
|
|
44
55
|
React.useEffect(() => {
|
|
45
56
|
setColCount(platform === 'h5' ? mobileCol : pcCol);
|
|
46
|
-
}, [mobileCol, pcCol]);
|
|
57
|
+
}, [mobileCol, pcCol, platform]);
|
|
47
58
|
// 每个col的宽度百分比
|
|
48
59
|
const colStyle = {
|
|
49
60
|
width: `${(1 / colCount) * 100}%`,
|
|
@@ -48,7 +48,7 @@ const HorizontalMenu = ({ menuData, navigationStyle, selected, setSelected }) =>
|
|
|
48
48
|
if (platform !== 'h5' && isHorizontal && ((_a = navWrapRef === null || navWrapRef === void 0 ? void 0 : navWrapRef.current) === null || _a === void 0 ? void 0 : _a.children)) {
|
|
49
49
|
getMenuOffset();
|
|
50
50
|
}
|
|
51
|
-
}, [platform, isHorizontal, navWrapRef]);
|
|
51
|
+
}, [platform, isHorizontal, navWrapRef, getMenuOffset]);
|
|
52
52
|
// 渲染下拉菜单
|
|
53
53
|
const renderMenuList = (item, navigationStyle) => {
|
|
54
54
|
return (React.createElement(List, { type: "option", className: `${CLASS_PREFIX}__dropdown-menu-list`, style: { background: navigationStyle.menuBackgroundColor } }, item === null || item === void 0 ? void 0 : item.map((menu) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import classNames from '../../utils/classnames';
|
|
3
3
|
import { ConfigProvider } from 'tea-component';
|
|
4
4
|
import { usePlatform, isInIde } from '../../utils/platform';
|
|
@@ -8,6 +8,7 @@ import VerticalMenu from './verticalMenu';
|
|
|
8
8
|
import HorizontalMenu from './horizontalMenu';
|
|
9
9
|
import H5Menu from './h5Menu';
|
|
10
10
|
import { expandMenu, findMenuItemByPath } from './common';
|
|
11
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
11
12
|
import destr from 'destr';
|
|
12
13
|
/**
|
|
13
14
|
* Web端
|
|
@@ -55,6 +56,7 @@ const defaultSelectedMenu = (menu) => {
|
|
|
55
56
|
const defaultCallApi = { getAppCustomNav };
|
|
56
57
|
export default function NavigationBar({ navigationbar, contentSlot, className, style, callApi = defaultCallApi, }) {
|
|
57
58
|
const platform = usePlatform();
|
|
59
|
+
const [preNavigationbar, setPreNavigationbar] = useState(navigationbar);
|
|
58
60
|
const [menuData, setMenuData] = useState([]);
|
|
59
61
|
const [mobileMenuData, setMobileMenuData] = useState([]);
|
|
60
62
|
// 是否启用多端
|
|
@@ -79,13 +81,14 @@ export default function NavigationBar({ navigationbar, contentSlot, className, s
|
|
|
79
81
|
...style,
|
|
80
82
|
};
|
|
81
83
|
// 更新导航菜单
|
|
82
|
-
const updateNavigationData = () => {
|
|
84
|
+
const updateNavigationData = useCallback(() => {
|
|
83
85
|
callApi
|
|
84
86
|
.getAppCustomNav()
|
|
85
87
|
.then((res) => {
|
|
86
88
|
var _a;
|
|
87
89
|
const { Content } = res;
|
|
88
90
|
const navigationData = destr(Content);
|
|
91
|
+
setPreNavigationbar(navigationData);
|
|
89
92
|
if (navigationData === null || navigationData === void 0 ? void 0 : navigationData.navigationStyle) {
|
|
90
93
|
// 设置默认选中
|
|
91
94
|
let selectedKey = '';
|
|
@@ -111,22 +114,24 @@ export default function NavigationBar({ navigationbar, contentSlot, className, s
|
|
|
111
114
|
}
|
|
112
115
|
})
|
|
113
116
|
.catch((error) => {
|
|
114
|
-
console.
|
|
117
|
+
console.error(error);
|
|
115
118
|
});
|
|
116
|
-
};
|
|
119
|
+
}, [callApi]);
|
|
117
120
|
/**
|
|
118
121
|
* 每次渲染组件通过接口拉取数据
|
|
119
122
|
*/
|
|
120
123
|
useEffect(() => {
|
|
124
|
+
// 仅执行一次
|
|
121
125
|
updateNavigationData();
|
|
126
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
122
127
|
}, []);
|
|
123
128
|
useEffect(() => {
|
|
124
|
-
if (
|
|
125
|
-
// setMenuData(navigationbar?.menuData);
|
|
126
|
-
// setNavigationStyle(navigationbar?.navigationStyle);
|
|
129
|
+
if (!isObjectEqual(navigationbar, preNavigationbar)) {
|
|
127
130
|
updateNavigationData();
|
|
128
131
|
}
|
|
129
|
-
|
|
132
|
+
// 检查navigationbar更新之后,重新渲染
|
|
133
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
|
+
}, [navigationbar, updateNavigationData]);
|
|
130
135
|
// 初始化css变量
|
|
131
136
|
useEffect(() => {
|
|
132
137
|
if (navigationStyle.menuHoverColor) {
|
|
@@ -92,7 +92,7 @@ label, labelVisible, value: initialValue, readOnly, layout, requiredFlag, onChan
|
|
|
92
92
|
useEffect(() => {
|
|
93
93
|
const state = createStateFromContent(initialValue, {});
|
|
94
94
|
setEditorState(state);
|
|
95
|
-
}, []);
|
|
95
|
+
}, [initialValue]);
|
|
96
96
|
const excludeControls = useMemo(() => {
|
|
97
97
|
const result = [
|
|
98
98
|
'media',
|
|
@@ -134,7 +134,6 @@ label, labelVisible, value: initialValue, readOnly, layout, requiredFlag, onChan
|
|
|
134
134
|
maxSize,
|
|
135
135
|
cloudPath,
|
|
136
136
|
latestEditorState,
|
|
137
|
-
insertMedias,
|
|
138
137
|
setEditorState,
|
|
139
138
|
isH5,
|
|
140
139
|
]);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import classNames from '../../utils/classnames';
|
|
3
3
|
import { getTempFileURL } from '../../utils/tcb';
|
|
4
4
|
import './index.css';
|
|
5
5
|
import { LOAD_ERR_IMG_BASE64 } from '../../utils/constant';
|
|
6
6
|
import destr from 'destr';
|
|
7
|
+
const imgRegex = new RegExp(/<img [^>]*src=\\*"([^"]*?)\\*"/g);
|
|
7
8
|
export default function RichTextView({ value = '', className, style, id, }) {
|
|
8
9
|
const parseValue = destr(value);
|
|
9
10
|
const cls = classNames({
|
|
@@ -12,25 +13,26 @@ export default function RichTextView({ value = '', className, style, id, }) {
|
|
|
12
13
|
[className]: className,
|
|
13
14
|
});
|
|
14
15
|
const [displayValue, setDisplayValue] = useState('');
|
|
15
|
-
const regex = new RegExp(/<img [^>]*src=\\*"([^"]*?)\\*"/g);
|
|
16
16
|
const iferror = `javascript:this.width='80';this.src='${LOAD_ERR_IMG_BASE64}';this.onerror=null`;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (img.includes('cloud://')) {
|
|
23
|
-
const newURL = await getTempFileURL(url);
|
|
24
|
-
if (newURL) {
|
|
25
|
-
tempValue = tempValue.replace(new RegExp(url, 'g'), newURL);
|
|
26
|
-
setDisplayValue(tempValue);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
17
|
+
const valueWithErrorHandle = useMemo(() => {
|
|
18
|
+
return parseValue
|
|
19
|
+
.toString()
|
|
20
|
+
.replace(/<img /g, `<img onerror=${iferror} style="max-width:100%" `);
|
|
21
|
+
}, [iferror, parseValue]);
|
|
30
22
|
useEffect(() => {
|
|
31
|
-
|
|
23
|
+
const getSrc = async (img) => {
|
|
24
|
+
const url = img.replace(imgRegex, '$1');
|
|
25
|
+
if (img.includes('cloud://')) {
|
|
26
|
+
const newURL = await getTempFileURL(url);
|
|
27
|
+
if (newURL) {
|
|
28
|
+
const htmlWithTempUrl = valueWithErrorHandle.replace(new RegExp(url, 'g'), newURL);
|
|
29
|
+
setDisplayValue(htmlWithTempUrl);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
setDisplayValue(valueWithErrorHandle);
|
|
32
34
|
try {
|
|
33
|
-
const imgs = parseValue.match(
|
|
35
|
+
const imgs = parseValue.match(imgRegex);
|
|
34
36
|
if (imgs && imgs.length > 0) {
|
|
35
37
|
imgs.forEach((img) => {
|
|
36
38
|
getSrc(img);
|
|
@@ -38,7 +40,7 @@ export default function RichTextView({ value = '', className, style, id, }) {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
catch (e) { }
|
|
41
|
-
}, [
|
|
43
|
+
}, [parseValue, valueWithErrorHandle]);
|
|
42
44
|
return (displayValue && (React.createElement("div", { className: cls, style: style, id: id },
|
|
43
45
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: displayValue } }))));
|
|
44
46
|
}
|
|
@@ -10,7 +10,7 @@ export interface PropsType extends CommonPropsType {
|
|
|
10
10
|
lowerThreshold?: number;
|
|
11
11
|
domRef?: any;
|
|
12
12
|
}
|
|
13
|
-
export default function ScrollView({ id, scrollX, scrollY, style, scrollTop, scrollLeft, scrollIntoView, className, children, upperThreshold, lowerThreshold,
|
|
13
|
+
export default function ScrollView({ id, scrollX, scrollY, style, scrollTop, scrollLeft, scrollIntoView, className, children, upperThreshold, lowerThreshold, events, }: {
|
|
14
14
|
id: any;
|
|
15
15
|
scrollX?: boolean;
|
|
16
16
|
scrollY?: boolean;
|
|
@@ -22,6 +22,5 @@ export default function ScrollView({ id, scrollX, scrollY, style, scrollTop, scr
|
|
|
22
22
|
children: any;
|
|
23
23
|
upperThreshold?: number;
|
|
24
24
|
lowerThreshold?: number;
|
|
25
|
-
domRef: any;
|
|
26
25
|
events: any;
|
|
27
26
|
}): JSX.Element;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import classNames from '../../utils/classnames';
|
|
3
|
-
export default function ScrollView({ id, scrollX = false, scrollY = true, style, scrollTop, scrollLeft, scrollIntoView, className, children, upperThreshold = 50, lowerThreshold = 50,
|
|
3
|
+
export default function ScrollView({ id, scrollX = false, scrollY = true, style, scrollTop, scrollLeft, scrollIntoView, className, children, upperThreshold = 50, lowerThreshold = 50,
|
|
4
|
+
// domRef,
|
|
5
|
+
events, }) {
|
|
4
6
|
const [toUpper, setToUpper] = React.useState(false);
|
|
5
7
|
const [toLower, setToLower] = React.useState(false);
|
|
6
8
|
const [scrollLeftPos, setScrollLeftPos] = React.useState(0);
|
|
7
9
|
const [scrollTopPos, setScrollTopPos] = React.useState(0);
|
|
8
|
-
const scrollViewRef =
|
|
10
|
+
const scrollViewRef = React.useRef(null);
|
|
9
11
|
const handleOnScroll = function (e) {
|
|
10
12
|
const detail = {
|
|
11
13
|
scrollLeft: e.target.scrollLeft,
|
|
@@ -64,10 +66,10 @@ export default function ScrollView({ id, scrollX = false, scrollY = true, style,
|
|
|
64
66
|
}, [scrollLeft]);
|
|
65
67
|
React.useEffect(() => {
|
|
66
68
|
toUpper && events.scrolltoupper();
|
|
67
|
-
}, [toUpper]);
|
|
69
|
+
}, [events, toUpper]);
|
|
68
70
|
React.useEffect(() => {
|
|
69
71
|
toLower && events.scrolltolower();
|
|
70
|
-
}, [toLower]);
|
|
72
|
+
}, [events, toLower]);
|
|
71
73
|
React.useEffect(() => {
|
|
72
74
|
if (scrollIntoView) {
|
|
73
75
|
const children = scrollViewRef.current.children;
|
|
@@ -76,7 +78,7 @@ export default function ScrollView({ id, scrollX = false, scrollY = true, style,
|
|
|
76
78
|
scrollX && (scrollViewRef.current.scrollLeft = item.offsetLeft);
|
|
77
79
|
// console.log('children', children, item)
|
|
78
80
|
}
|
|
79
|
-
}, [scrollIntoView]);
|
|
81
|
+
}, [scrollIntoView, scrollX, scrollY]);
|
|
80
82
|
const webStyles = {
|
|
81
83
|
position: 'relative',
|
|
82
84
|
width: '100%',
|