@cloudbase/weda-ui 3.2.1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/configs/components/chart/bar.json +9 -1
- package/dist/src/configs/components/chart/line.json +8 -0
- package/dist/src/configs/components/chart/pie.json +8 -0
- package/dist/src/web/actions/showModal/index.js +0 -1
- package/dist/src/web/components/calendar/index.js +39 -37
- package/dist/src/web/components/carousel/index.js +62 -62
- package/dist/src/web/components/chart/bar/index.js +6 -2
- package/dist/src/web/components/chart/common/Chart.d.ts +1 -0
- package/dist/src/web/components/chart/common/Chart.js +9 -1
- package/dist/src/web/components/chart/common/chart-custom-connector.js +1 -1
- package/dist/src/web/components/chart/common/core/eChartBase.js +1 -1
- package/dist/src/web/components/chart/common/data-transform.js +3 -1
- package/dist/src/web/components/chart/common/useChart.js +13 -2
- package/dist/src/web/components/chart/line/index.js +2 -2
- package/dist/src/web/components/chart/pie/index.js +2 -2
- package/dist/src/web/components/common/error-boundary.d.ts +5 -0
- package/dist/src/web/components/common/error-boundary.js +33 -0
- package/dist/src/web/components/common/use-loop-render-detect.d.ts +11 -0
- package/dist/src/web/components/common/use-loop-render-detect.js +124 -0
- package/dist/src/web/components/form/checkbox/index.js +29 -29
- package/dist/src/web/components/form/form/index.js +39 -26
- package/dist/src/web/components/form/input/index.js +11 -3
- package/dist/src/web/components/form/location/common/mapChoose.js +6 -5
- package/dist/src/web/components/form/location/common/mapView.js +9 -6
- package/dist/src/web/{utils → components/form/location/common}/tmap.d.ts +0 -0
- package/dist/src/web/{utils → components/form/location/common}/tmap.js +0 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.js +3 -2
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +6 -3
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +5 -1
- package/dist/src/web/components/form/location/index.js +7 -0
- package/dist/src/web/components/form/radio/index.js +3 -3
- package/dist/src/web/components/form/select/allTimePicker/index.js +1 -0
- package/dist/src/web/components/form/select/h5.js +18 -4
- package/dist/src/web/components/form/select/index.js +15 -1
- package/dist/src/web/components/form/select/use-options.js +1 -1
- package/dist/src/web/components/form/uploader/uploader.h5.js +2 -2
- package/dist/src/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +9 -7
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +9 -6
- package/dist/src/web/components/form/userOrgSelect/comTool.js +3 -9
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +47 -34
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +1 -1
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +35 -36
- package/dist/src/web/{utils → components/form/userOrgSelect}/getUserService.d.ts +0 -0
- package/dist/src/web/{utils → components/form/userOrgSelect}/getUserService.js +8 -5
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +3 -2
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +42 -20
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +1 -1
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +111 -129
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +3 -2
- package/dist/src/web/components/form/userOrgSelect/utils.js +24 -16
- package/dist/src/web/components/formdetail/index.js +14 -11
- package/dist/src/web/components/graphicCard/index.js +5 -6
- package/dist/src/web/components/image/index.js +1 -1
- package/dist/src/web/components/listView/index.js +1 -0
- package/dist/src/web/components/lottery/index.js +10 -16
- package/dist/src/web/components/navLayout/index.js +1 -1
- package/dist/src/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/src/web/components/navigationBar/index.js +13 -8
- package/dist/src/web/components/richText/index.js +1 -2
- package/dist/src/web/components/richTextView/index.js +20 -18
- package/dist/src/web/components/scrollView/index.d.ts +1 -2
- package/dist/src/web/components/scrollView/index.js +7 -5
- package/dist/src/web/components/swiper/index.js +62 -62
- package/dist/src/web/components/tabs/index.js +6 -1
- package/dist/src/web/components/tabs/tabs.h5.js +2 -0
- package/dist/src/web/components/text/index.js +10 -8
- package/dist/src/web/components/uploaderFileView/index.js +1 -1
- package/dist/src/web/components/uploaderView/index.js +1 -1
- package/dist/src/web/components/wedaVideo/index.js +15 -3
- package/dist/src/web/utils/console.d.ts +3 -0
- package/dist/src/web/utils/console.js +26 -0
- package/dist/src/web/utils/platform.js +1 -1
- package/dist/src/web/utils/tcb.js +1 -1
- package/dist/src/web/utils/useSyncValue.js +1 -0
- package/dist/web/components/form/input/index.css +16 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.css +4 -0
- package/package.json +22 -22
- package/dist/configs/actions/showModal.json +0 -48
- package/dist/configs/actions/showToast.json +0 -41
- package/dist/configs/components/auth.json +0 -16
- package/dist/configs/components/button.json +0 -239
- package/dist/configs/components/calendar.json +0 -81
- package/dist/configs/components/carousel.json +0 -292
- package/dist/configs/components/chart/bar.json +0 -728
- package/dist/configs/components/chart/line.json +0 -681
- package/dist/configs/components/chart/pie.json +0 -500
- package/dist/configs/components/chart/statisticsCard.json +0 -376
- package/dist/configs/components/container.json +0 -50
- package/dist/configs/components/dataView.json +0 -239
- package/dist/configs/components/drawer.json +0 -115
- package/dist/configs/components/form/checkbox.json +0 -179
- package/dist/configs/components/form/departTreeSelect.json +0 -124
- package/dist/configs/components/form/form.json +0 -69
- package/dist/configs/components/form/input.json +0 -154
- package/dist/configs/components/form/location.json +0 -216
- package/dist/configs/components/form/radio.json +0 -203
- package/dist/configs/components/form/richText.json +0 -133
- package/dist/configs/components/form/select.json +0 -431
- package/dist/configs/components/form/switch.json +0 -58
- package/dist/configs/components/form/textarea.json +0 -116
- package/dist/configs/components/form/tips.json +0 -34
- package/dist/configs/components/form/uploader.json +0 -171
- package/dist/configs/components/form/uploaderFile.json +0 -158
- package/dist/configs/components/form/userTreeSelect.json +0 -128
- package/dist/configs/components/formdetail.json +0 -105
- package/dist/configs/components/graphicCard.json +0 -413
- package/dist/configs/components/image.json +0 -187
- package/dist/configs/components/link.json +0 -79
- package/dist/configs/components/listView.json +0 -378
- package/dist/configs/components/lottery.json +0 -163
- package/dist/configs/components/modal.json +0 -72
- package/dist/configs/components/navLayout.json +0 -368
- package/dist/configs/components/navigationBar.json +0 -62
- package/dist/configs/components/richtextview.json +0 -26
- package/dist/configs/components/scrollVeiw.json +0 -253
- package/dist/configs/components/slot.json +0 -17
- package/dist/configs/components/swiper.json +0 -90
- package/dist/configs/components/tabs.json +0 -122
- package/dist/configs/components/text.json +0 -95
- package/dist/configs/components/wedaVideo.json +0 -89
- package/dist/configs/components/wxOpenApi/phone.json +0 -127
- package/dist/configs/components/wxOpenApi/phoneCode.json +0 -109
- package/dist/configs/components/wxOpenApi/share.json +0 -160
- package/dist/configs/components/wxOpenApi/userInfo.json +0 -156
- package/dist/configs/index.d.ts +0 -103
- package/dist/configs/index.js +0 -111
- package/dist/docs/common/format.d.ts +0 -13
- package/dist/docs/common/format.js +0 -122
- package/dist/docs/common/tableView.d.ts +0 -30
- package/dist/docs/common/tableView.js +0 -159
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -3
- package/dist/setupTests.d.ts +0 -1
- package/dist/setupTests.js +0 -14
- 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/web/actions/index.d.ts +0 -2
- package/dist/web/actions/index.js +0 -2
- package/dist/web/actions/showModal/index.d.ts +0 -4
- package/dist/web/actions/showModal/index.js +0 -67
- package/dist/web/actions/showToast/index.d.ts +0 -1
- package/dist/web/actions/showToast/index.js +0 -3
- package/dist/web/components/button/index.d.ts +0 -32
- package/dist/web/components/button/index.js +0 -48
- package/dist/web/components/calendar/index.d.ts +0 -19
- package/dist/web/components/calendar/index.js +0 -189
- package/dist/web/components/calendar/util.d.ts +0 -13
- package/dist/web/components/calendar/util.js +0 -74
- package/dist/web/components/carousel/index.d.ts +0 -41
- package/dist/web/components/carousel/index.js +0 -244
- package/dist/web/components/chart/bar/index.d.ts +0 -41
- package/dist/web/components/chart/bar/index.js +0 -56
- package/dist/web/components/chart/common/config/bar.d.ts +0 -48
- package/dist/web/components/chart/common/config/bar.js +0 -49
- package/dist/web/components/chart/common/config/global.d.ts +0 -13
- package/dist/web/components/chart/common/config/global.js +0 -16
- package/dist/web/components/chart/common/config/line.d.ts +0 -46
- package/dist/web/components/chart/common/config/line.js +0 -49
- package/dist/web/components/chart/common/config/pie.d.ts +0 -29
- package/dist/web/components/chart/common/config/pie.js +0 -36
- package/dist/web/components/chart/common/core/eChartBar.d.ts +0 -68
- package/dist/web/components/chart/common/core/eChartBar.js +0 -198
- package/dist/web/components/chart/common/core/eChartBase.d.ts +0 -128
- package/dist/web/components/chart/common/core/eChartBase.js +0 -352
- package/dist/web/components/chart/common/core/eChartLine.d.ts +0 -62
- package/dist/web/components/chart/common/core/eChartLine.js +0 -170
- package/dist/web/components/chart/common/core/eChartPie.d.ts +0 -50
- package/dist/web/components/chart/common/core/eChartPie.js +0 -132
- package/dist/web/components/chart/common/core/type.d.ts +0 -35
- package/dist/web/components/chart/common/core/type.js +0 -9
- package/dist/web/components/chart/common/echarts.d.ts +0 -2
- package/dist/web/components/chart/common/echarts.js +0 -24
- package/dist/web/components/chart/common/useChart.d.ts +0 -8
- package/dist/web/components/chart/common/useChart.js +0 -60
- package/dist/web/components/chart/line/index.d.ts +0 -39
- package/dist/web/components/chart/line/index.js +0 -53
- package/dist/web/components/chart/pie/index.d.ts +0 -27
- package/dist/web/components/chart/pie/index.js +0 -40
- package/dist/web/components/chart/statisticsCard/index.d.ts +0 -85
- package/dist/web/components/chart/statisticsCard/index.js +0 -203
- package/dist/web/components/chart/statisticsCard/interface.d.ts +0 -13
- package/dist/web/components/chart/statisticsCard/interface.js +0 -1
- package/dist/web/components/container/index.d.ts +0 -6
- package/dist/web/components/container/index.js +0 -6
- package/dist/web/components/dataView/index.d.ts +0 -6
- package/dist/web/components/dataView/index.js +0 -8
- package/dist/web/components/dataView/interface.d.ts +0 -5
- package/dist/web/components/dataView/interface.js +0 -1
- package/dist/web/components/drawer/index.d.ts +0 -13
- package/dist/web/components/drawer/index.js +0 -12
- package/dist/web/components/form/checkbox/index.d.ts +0 -13
- package/dist/web/components/form/checkbox/index.js +0 -167
- package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +0 -78
- package/dist/web/components/form/enumSelect/MultipleSelect.js +0 -52
- package/dist/web/components/form/enumSelect/NormalSelect.d.ts +0 -83
- package/dist/web/components/form/enumSelect/NormalSelect.js +0 -52
- package/dist/web/components/form/enumSelect/SelectContainer.d.ts +0 -16
- package/dist/web/components/form/enumSelect/SelectContainer.js +0 -30
- package/dist/web/components/form/enumSelect/index.d.ts +0 -82
- package/dist/web/components/form/enumSelect/index.js +0 -6
- package/dist/web/components/form/enumSelect/props/defaultProps.d.ts +0 -34
- package/dist/web/components/form/enumSelect/props/defaultProps.js +0 -40
- package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +0 -39
- package/dist/web/components/form/enumSelect/props/propsTypes.js +0 -47
- package/dist/web/components/form/form/index.d.ts +0 -32
- package/dist/web/components/form/form/index.js +0 -108
- package/dist/web/components/form/formcell/index.d.ts +0 -8
- package/dist/web/components/form/formcell/index.js +0 -40
- package/dist/web/components/form/input/index.d.ts +0 -14
- package/dist/web/components/form/input/index.js +0 -86
- package/dist/web/components/form/location/common/mapChoose.d.ts +0 -15
- package/dist/web/components/form/location/common/mapChoose.js +0 -495
- package/dist/web/components/form/location/common/mapView.d.ts +0 -19
- package/dist/web/components/form/location/common/mapView.js +0 -172
- package/dist/web/components/form/location/common/propsConfig.d.ts +0 -59
- package/dist/web/components/form/location/common/propsConfig.js +0 -50
- package/dist/web/components/form/location/common/selectModal.d.ts +0 -21
- package/dist/web/components/form/location/common/selectModal.js +0 -44
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +0 -36
- package/dist/web/components/form/location/common/useLocationInfo.js +0 -104
- package/dist/web/components/form/location/components/LocationH5/location.h5.d.ts +0 -8
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +0 -325
- package/dist/web/components/form/location/components/LocationPC/Header.d.ts +0 -12
- package/dist/web/components/form/location/components/LocationPC/Header.js +0 -43
- package/dist/web/components/form/location/components/LocationPC/location.PC.d.ts +0 -8
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +0 -224
- package/dist/web/components/form/location/constants.d.ts +0 -2
- package/dist/web/components/form/location/constants.js +0 -3
- package/dist/web/components/form/location/index.d.ts +0 -1
- package/dist/web/components/form/location/index.js +0 -17
- package/dist/web/components/form/radio/index.d.ts +0 -11
- package/dist/web/components/form/radio/index.js +0 -115
- package/dist/web/components/form/renderDecorator.d.ts +0 -6
- package/dist/web/components/form/renderDecorator.js +0 -20
- package/dist/web/components/form/select/dropdown-select/ui.d.ts +0 -15
- package/dist/web/components/form/select/dropdown-select/ui.js +0 -55
- package/dist/web/components/form/select/h5.d.ts +0 -16
- package/dist/web/components/form/select/h5.js +0 -410
- package/dist/web/components/form/select/index.d.ts +0 -65
- package/dist/web/components/form/select/index.js +0 -232
- package/dist/web/components/form/select/region/index.d.ts +0 -6
- package/dist/web/components/form/select/region/index.js +0 -147
- package/dist/web/components/form/select/time.d.ts +0 -9
- package/dist/web/components/form/select/time.js +0 -146
- package/dist/web/components/form/select/use-options.d.ts +0 -26
- package/dist/web/components/form/select/use-options.js +0 -103
- package/dist/web/components/form/select/year.d.ts +0 -7
- package/dist/web/components/form/select/year.js +0 -72
- package/dist/web/components/form/switch/index.d.ts +0 -6
- package/dist/web/components/form/switch/index.js +0 -58
- package/dist/web/components/form/textarea/index.d.ts +0 -12
- package/dist/web/components/form/textarea/index.js +0 -66
- package/dist/web/components/form/tips/index.d.ts +0 -8
- package/dist/web/components/form/tips/index.js +0 -17
- package/dist/web/components/form/uploader/index.d.ts +0 -3
- package/dist/web/components/form/uploader/index.js +0 -42
- package/dist/web/components/form/uploader/uploader.h5.d.ts +0 -20
- package/dist/web/components/form/uploader/uploader.h5.js +0 -224
- package/dist/web/components/form/uploader/uploader.pc.d.ts +0 -29
- package/dist/web/components/form/uploader/uploader.pc.js +0 -214
- package/dist/web/components/form/uploaderFile/index.d.ts +0 -4
- package/dist/web/components/form/uploaderFile/index.js +0 -19
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +0 -23
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +0 -337
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +0 -24
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +0 -313
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +0 -7
- package/dist/web/components/form/userOrgSelect/comTool.js +0 -89
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +0 -20
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +0 -259
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +0 -4
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -153
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +0 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
- package/dist/web/components/form/userOrgSelect/index.d.ts +0 -2
- package/dist/web/components/form/userOrgSelect/index.js +0 -17
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +0 -643
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +0 -24
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -276
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +0 -9
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +0 -229
- package/dist/web/components/form/userOrgSelect/utils.d.ts +0 -35
- package/dist/web/components/form/userOrgSelect/utils.js +0 -72
- package/dist/web/components/formdetail/index.d.ts +0 -28
- package/dist/web/components/formdetail/index.js +0 -170
- package/dist/web/components/graphicCard/index.d.ts +0 -31
- package/dist/web/components/graphicCard/index.js +0 -166
- package/dist/web/components/image/image.d.ts +0 -9
- package/dist/web/components/image/image.js +0 -119
- package/dist/web/components/image/index.d.ts +0 -13
- package/dist/web/components/image/index.js +0 -91
- package/dist/web/components/index.d.ts +0 -50
- package/dist/web/components/index.js +0 -97
- package/dist/web/components/link/index.d.ts +0 -24
- package/dist/web/components/link/index.js +0 -71
- package/dist/web/components/listView/index.d.ts +0 -7
- package/dist/web/components/listView/index.js +0 -286
- package/dist/web/components/listView/interface.d.ts +0 -127
- package/dist/web/components/listView/interface.js +0 -1
- package/dist/web/components/lottery/index.d.ts +0 -22
- package/dist/web/components/lottery/index.js +0 -391
- package/dist/web/components/lottery/lotteryUtil.d.ts +0 -23
- package/dist/web/components/lottery/lotteryUtil.js +0 -181
- package/dist/web/components/modal/index.d.ts +0 -17
- package/dist/web/components/modal/index.js +0 -11
- package/dist/web/components/modal/modal.h5.d.ts +0 -4
- package/dist/web/components/modal/modal.h5.js +0 -46
- package/dist/web/components/modal/modal.pc.d.ts +0 -3
- package/dist/web/components/modal/modal.pc.js +0 -31
- package/dist/web/components/navLayout/index.d.ts +0 -46
- package/dist/web/components/navLayout/index.js +0 -116
- package/dist/web/components/navigationBar/common.d.ts +0 -15
- package/dist/web/components/navigationBar/common.js +0 -127
- package/dist/web/components/navigationBar/h5Menu.d.ts +0 -14
- package/dist/web/components/navigationBar/h5Menu.js +0 -72
- package/dist/web/components/navigationBar/horizontalMenu.d.ts +0 -12
- package/dist/web/components/navigationBar/horizontalMenu.js +0 -99
- package/dist/web/components/navigationBar/index.d.ts +0 -13
- package/dist/web/components/navigationBar/index.js +0 -157
- package/dist/web/components/navigationBar/verticalMenu.d.ts +0 -13
- package/dist/web/components/navigationBar/verticalMenu.js +0 -38
- package/dist/web/components/phone/index.d.ts +0 -18
- package/dist/web/components/phone/index.js +0 -4
- package/dist/web/components/phoneCode/index.d.ts +0 -18
- package/dist/web/components/phoneCode/index.js +0 -4
- package/dist/web/components/picker/datePicker.d.ts +0 -10
- package/dist/web/components/picker/datePicker.js +0 -31
- package/dist/web/components/picker/picker.d.ts +0 -6
- package/dist/web/components/picker/picker.js +0 -45
- package/dist/web/components/picker/timePicker.d.ts +0 -7
- package/dist/web/components/picker/timePicker.js +0 -42
- package/dist/web/components/richText/const.d.ts +0 -1
- package/dist/web/components/richText/const.js +0 -2
- package/dist/web/components/richText/index.d.ts +0 -50
- package/dist/web/components/richText/index.js +0 -352
- package/dist/web/components/richTextView/index.d.ts +0 -7
- package/dist/web/components/richTextView/index.js +0 -44
- package/dist/web/components/scrollView/index.d.ts +0 -27
- package/dist/web/components/scrollView/index.js +0 -95
- package/dist/web/components/share/index.d.ts +0 -34
- package/dist/web/components/share/index.js +0 -4
- package/dist/web/components/slot/index.d.ts +0 -6
- package/dist/web/components/slot/index.js +0 -9
- package/dist/web/components/swiper/index.d.ts +0 -24
- package/dist/web/components/swiper/index.js +0 -153
- package/dist/web/components/tabs/index.d.ts +0 -13
- package/dist/web/components/tabs/index.js +0 -15
- package/dist/web/components/tabs/tabs.h5.d.ts +0 -4
- package/dist/web/components/tabs/tabs.h5.js +0 -42
- package/dist/web/components/tabs/tabs.pc.d.ts +0 -3
- package/dist/web/components/tabs/tabs.pc.js +0 -40
- package/dist/web/components/text/index.d.ts +0 -14
- package/dist/web/components/text/index.js +0 -17
- package/dist/web/components/uploaderFileView/index.d.ts +0 -10
- package/dist/web/components/uploaderFileView/index.js +0 -61
- package/dist/web/components/uploaderView/index.d.ts +0 -17
- package/dist/web/components/uploaderView/index.js +0 -48
- package/dist/web/components/userInfo/index.d.ts +0 -26
- package/dist/web/components/userInfo/index.js +0 -4
- package/dist/web/components/wedaVideo/index.d.ts +0 -17
- package/dist/web/components/wedaVideo/index.js +0 -160
- package/dist/web/index.d.ts +0 -8
- package/dist/web/index.js +0 -4
- package/dist/web/utils/classnames.d.ts +0 -2
- package/dist/web/utils/classnames.js +0 -37
- package/dist/web/utils/constant.d.ts +0 -23
- package/dist/web/utils/constant.js +0 -24
- package/dist/web/utils/debounce.d.ts +0 -2
- package/dist/web/utils/debounce.js +0 -92
- package/dist/web/utils/getLocalCounter.d.ts +0 -1
- package/dist/web/utils/getLocalCounter.js +0 -4
- package/dist/web/utils/getUserService.d.ts +0 -17
- package/dist/web/utils/getUserService.js +0 -148
- package/dist/web/utils/isObjectEqual.d.ts +0 -2
- package/dist/web/utils/isObjectEqual.js +0 -12
- package/dist/web/utils/loading-fallback.d.ts +0 -2
- package/dist/web/utils/loading-fallback.js +0 -2
- package/dist/web/utils/lodash.d.ts +0 -1
- package/dist/web/utils/lodash.js +0 -2
- package/dist/web/utils/platform.d.ts +0 -18
- package/dist/web/utils/platform.js +0 -193
- package/dist/web/utils/tcb.d.ts +0 -27
- package/dist/web/utils/tcb.js +0 -105
- package/dist/web/utils/tmap.d.ts +0 -3
- package/dist/web/utils/tmap.js +0 -21
- package/dist/web/utils/use-cloud-id-temp-url.d.ts +0 -1
- package/dist/web/utils/use-cloud-id-temp-url.js +0 -13
- package/dist/web/utils/useSetState.d.ts +0 -1
- package/dist/web/utils/useSetState.js +0 -8
- package/dist/web/utils/useSyncValue.d.ts +0 -4
- package/dist/web/utils/useSyncValue.js +0 -15
- package/dist/web/utils/weui.d.ts +0 -1
- package/dist/web/utils/weui.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { Checkbox as TeaCheckbox, ConfigProvider } from 'tea-component';
|
|
3
3
|
import classNames from '../../../utils/classnames';
|
|
4
4
|
import getLocalCounter from '../../../utils/getLocalCounter';
|
|
@@ -39,33 +39,8 @@ name = 'formCheckbox', label = '标题', labelVisible = true, format = '', enumN
|
|
|
39
39
|
prevRangeRef.current = JSON.parse(JSON.stringify(option));
|
|
40
40
|
setCheckedItems(fromEntries(option.map(({ value, checked }) => [value, !!checked])));
|
|
41
41
|
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// 如果绑定字段类型为枚举,且传入自定义选项集的名称则默认使用自定义选项集的内容作为选项
|
|
45
|
-
if (format === 'x-enum' && enumName) {
|
|
46
|
-
fetchData({ OptNameList: [enumName], PageIndex: 1, PageSize: 10 });
|
|
47
|
-
}
|
|
48
|
-
}, []);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (format === 'x-enum') {
|
|
51
|
-
const opt = enumOptions &&
|
|
52
|
-
enumOptions.map((item) => {
|
|
53
|
-
const checked = controlValue && controlValue.find((val) => val === item.value);
|
|
54
|
-
return {
|
|
55
|
-
value: item.value,
|
|
56
|
-
label: item.label,
|
|
57
|
-
checked: !!checked,
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
setOption(opt);
|
|
61
|
-
}
|
|
62
|
-
}, [controlValue]);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (format !== 'x-enum') {
|
|
65
|
-
setOption(range);
|
|
66
|
-
}
|
|
67
|
-
}, [range]);
|
|
68
|
-
const fetchData = async (param) => {
|
|
42
|
+
}, [option]);
|
|
43
|
+
const fetchData = useCallback(async (param) => {
|
|
69
44
|
var _a, _b, _c;
|
|
70
45
|
const data = await callWedaApi({
|
|
71
46
|
action: 'DescribeGeneralOptionsDetailList',
|
|
@@ -91,7 +66,32 @@ name = 'formCheckbox', label = '标题', labelVisible = true, format = '', enumN
|
|
|
91
66
|
};
|
|
92
67
|
});
|
|
93
68
|
setOption(opt);
|
|
94
|
-
};
|
|
69
|
+
}, [controlValue]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
// 如果绑定字段类型为枚举,且传入自定义选项集的名称则默认使用自定义选项集的内容作为选项
|
|
72
|
+
if (format === 'x-enum' && enumName) {
|
|
73
|
+
fetchData({ OptNameList: [enumName], PageIndex: 1, PageSize: 10 });
|
|
74
|
+
}
|
|
75
|
+
}, [enumName, fetchData, format]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (format === 'x-enum') {
|
|
78
|
+
const opt = enumOptions &&
|
|
79
|
+
enumOptions.map((item) => {
|
|
80
|
+
const checked = controlValue && controlValue.find((val) => val === item.value);
|
|
81
|
+
return {
|
|
82
|
+
value: item.value,
|
|
83
|
+
label: item.label,
|
|
84
|
+
checked: !!checked,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
setOption(opt);
|
|
88
|
+
}
|
|
89
|
+
}, [controlValue, enumOptions, format]);
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (format !== 'x-enum') {
|
|
92
|
+
setOption(range);
|
|
93
|
+
}
|
|
94
|
+
}, [format, range]);
|
|
95
95
|
/**
|
|
96
96
|
* 在ios h5端, label和input的绑定不生效
|
|
97
97
|
* 导致 onChange 事件触发有问题, 所以改为监听 onClick 事件
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import classNames from '../../../utils/classnames';
|
|
3
3
|
import { ConfigProvider, Form as TeaForm, message as TeaMessage, } from 'tea-component';
|
|
4
4
|
import { usePlatform, isInIde } from '../../../utils/platform';
|
|
5
|
-
import { callDataSource, callConnector
|
|
5
|
+
import { callDataSource, callConnector } from '../../../utils/tcb';
|
|
6
6
|
import weui from '../../../utils/weui';
|
|
7
7
|
import './index.css';
|
|
8
8
|
const formTypeWithInitValue = ['edit', 'read'];
|
|
@@ -80,40 +80,53 @@ export default function Form({ className, contentSlot, style, id, layout, formTy
|
|
|
80
80
|
platform,
|
|
81
81
|
methodGetItem,
|
|
82
82
|
paramGetItem,
|
|
83
|
+
appCloud,
|
|
84
|
+
events,
|
|
83
85
|
]);
|
|
84
86
|
React.useEffect(() => {
|
|
87
|
+
// 因编辑器render时序问题暂不上线
|
|
85
88
|
// 获取字段权限
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
//
|
|
89
|
+
// const authValue = {
|
|
90
|
+
// isDataModel,
|
|
91
|
+
// dataSourceFields: [],
|
|
92
|
+
// dataSourceFieldsWidthAuthList: [],
|
|
93
|
+
// };
|
|
94
|
+
// const getDataSourceFieldsWithAuth = async () => {
|
|
95
|
+
// try {
|
|
96
|
+
// const datasource = await getDataSourceByName(dataSourceName);
|
|
97
|
+
// if (!isInIde()) {
|
|
98
|
+
// // 判断是否是预览区,编辑器编辑区 dataSourceName 查询的返回一致,编辑区用的本地的数据源数据返回固定
|
|
99
|
+
// authValue.dataSourceFieldsWidthAuthList =
|
|
100
|
+
// datasource?.resourceCheckInfos?.map((item) => item.ReadWrite);
|
|
101
|
+
// authValue.dataSourceFields = Object.keys(
|
|
102
|
+
// datasource?.schema?.properties || {}
|
|
103
|
+
// );
|
|
104
|
+
// }
|
|
105
|
+
// events?.onInitDataSourceFieldsWithAuth?.(authValue);
|
|
106
|
+
// } catch (err) {
|
|
107
|
+
// events?.onInitDataSourceFieldsWithAuth?.(authValue);
|
|
108
|
+
// alertError(
|
|
109
|
+
// platform,
|
|
110
|
+
// `获取数据源字段权限信息失败,字段权限可能无法正确展示,错误信息:${err}`
|
|
111
|
+
// );
|
|
112
|
+
// console.error('getDataSourceFieldsWithAuth err', err);
|
|
113
|
+
// }
|
|
114
|
+
// };
|
|
115
|
+
// // 兼容私有环境,新接口不存在的情况,产品策略完善后移除
|
|
116
|
+
// if (
|
|
117
|
+
// window?.['_isPrivate'] &&
|
|
118
|
+
// !window?.app?.cloud?.getDataSourceProfileAsync
|
|
119
|
+
// ) {
|
|
120
|
+
// events?.onInitDataSourceFieldsWithAuth?.({ isDataModel });
|
|
121
|
+
// return;
|
|
122
|
+
// }
|
|
110
123
|
// if (isDataModel && dataSourceName) {
|
|
111
124
|
// getDataSourceFieldsWithAuth();
|
|
112
125
|
// } else {
|
|
113
126
|
// // 在表单容器里面的表单元素 if 默认是 false,需要通过onInitDataSourceFieldsWithAuth设置为true
|
|
114
127
|
// events?.onInitDataSourceFieldsWithAuth?.({ isDataModel });
|
|
115
128
|
// }
|
|
116
|
-
}, [formType, isDataModel, platform, dataSourceName]);
|
|
129
|
+
}, [formType, isDataModel, platform, dataSourceName, events]);
|
|
117
130
|
// pc 渲染
|
|
118
131
|
const renderPc = () => {
|
|
119
132
|
return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import classNames from '../../../utils/classnames';
|
|
3
3
|
import { usePlatform } from '../../../utils/platform';
|
|
4
|
-
import { Input as TeaInput, ConfigProvider } from 'tea-component';
|
|
4
|
+
import { Input as TeaInput, ConfigProvider, Icon } from 'tea-component';
|
|
5
5
|
import { renderDecorator } from '../renderDecorator';
|
|
6
6
|
import { useSyncValue } from '../../../utils/useSyncValue';
|
|
7
7
|
import './index.css';
|
|
@@ -23,7 +23,11 @@ label = '标题', labelVisible = true, name = 'formInput', defaultValue = '', pa
|
|
|
23
23
|
});
|
|
24
24
|
const inputType = getInputType(type, password);
|
|
25
25
|
// 两次默认值不同时, 需要刷新value
|
|
26
|
-
const [value, setValue] = useSyncValue(defaultValue);
|
|
26
|
+
const [value, setValue] = useSyncValue(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
27
|
+
const [isFocus, setIsFocus] = React.useState(false);
|
|
28
|
+
const showPcClear = React.useMemo(() => {
|
|
29
|
+
return platform === 'pc' && clearable && isFocus && (value === null || value === void 0 ? void 0 : value.length) > 0;
|
|
30
|
+
}, [platform, clearable, isFocus, value === null || value === void 0 ? void 0 : value.length]);
|
|
27
31
|
const onChange = function (e) {
|
|
28
32
|
const text = typeof e === 'string' ? e : e.target.value;
|
|
29
33
|
if (maxLength > 0 && text.length > maxLength) {
|
|
@@ -50,16 +54,20 @@ label = '标题', labelVisible = true, name = 'formInput', defaultValue = '', pa
|
|
|
50
54
|
};
|
|
51
55
|
const onFocus = function (e) {
|
|
52
56
|
events.focus({ value: e.target.value }, { originEvent: e });
|
|
57
|
+
setIsFocus(true);
|
|
53
58
|
};
|
|
54
59
|
const onBlur = function (e) {
|
|
55
60
|
events.blur({ value: e.target.value }, { originEvent: e });
|
|
61
|
+
setIsFocus(false);
|
|
56
62
|
};
|
|
57
63
|
const fieldEl = platform === 'h5' ? (React.createElement("div", { className: subCls },
|
|
58
64
|
React.createElement("div", { className: "weui-cell__bd weui-flex" },
|
|
59
65
|
React.createElement("input", { className: "weui-input", "data-testid": "weui-input-test", type: inputType, placeholder: placeholder, value: value, disabled: disabled, name: name, autoFocus: autoFocus, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, role: "input" }),
|
|
60
66
|
clearable && (React.createElement("button", { "data-testid": "weui-btn_input-clear-test", className: "weui-btn_reset weui-btn_icon weui-btn_input-clear", onMouseDown: onClear },
|
|
61
67
|
React.createElement("i", { className: "weui-icon-clear" })))))) : (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
62
|
-
React.createElement(
|
|
68
|
+
React.createElement("div", { className: 'weui-pc-input' },
|
|
69
|
+
React.createElement(TeaInput, { "data-testid": "weui-input-test-pc", className: 'pc-input', size: size, type: inputType, placeholder: placeholder, value: value, disabled: disabled, name: name, autoFocus: autoFocus, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown }),
|
|
70
|
+
showPcClear && (React.createElement(Icon, { "data-testid": "weui-input-test-pc-clear", className: 'pc-clear', type: "dismiss", size: "s", onMouseDown: onClear })))));
|
|
63
71
|
return renderDecorator(fieldEl, decorator)({
|
|
64
72
|
id,
|
|
65
73
|
className: cls,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
1
2
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
3
|
// @ts-nocheck
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import classNames from '../../../../utils/classnames';
|
|
5
6
|
import debounce from '../../../../utils/debounce';
|
|
6
7
|
import { tmapApiUrl } from '../constants';
|
|
7
|
-
import { getTMap, calculateDistance, base64LocationIcon
|
|
8
|
+
import { getTMap, calculateDistance, base64LocationIcon } from './tmap';
|
|
8
9
|
import './mapChoose.css';
|
|
9
10
|
import { Icon } from 'tea-component';
|
|
10
11
|
const { useEffect, useState, useRef, useMemo } = React;
|
|
@@ -54,7 +55,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
54
55
|
initMap();
|
|
55
56
|
};
|
|
56
57
|
script.onerror = (error) => {
|
|
57
|
-
console.
|
|
58
|
+
console.error(' load mapchoose error success', APIKEY, error);
|
|
58
59
|
};
|
|
59
60
|
document.body.appendChild(script);
|
|
60
61
|
}
|
|
@@ -229,7 +230,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
229
230
|
.catch((error) => {
|
|
230
231
|
setSearchLoadingStatus(false);
|
|
231
232
|
setRealLocation({ lat, lng }, []);
|
|
232
|
-
console.
|
|
233
|
+
console.error('explore error', error);
|
|
233
234
|
});
|
|
234
235
|
}, 500);
|
|
235
236
|
// 逆解析查询当前经纬度地址
|
|
@@ -260,7 +261,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
260
261
|
}
|
|
261
262
|
})
|
|
262
263
|
.catch((error) => {
|
|
263
|
-
console.
|
|
264
|
+
console.error('getAddress error', error);
|
|
264
265
|
let item = {
|
|
265
266
|
id: 'current-location',
|
|
266
267
|
location: {
|
|
@@ -317,7 +318,7 @@ export default function MapChoose({ changeLocation, onConfirm, onClose, currentL
|
|
|
317
318
|
}
|
|
318
319
|
})
|
|
319
320
|
.catch((error) => {
|
|
320
|
-
console.
|
|
321
|
+
console.error('error', error);
|
|
321
322
|
});
|
|
322
323
|
}
|
|
323
324
|
else {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as PropTypes from 'prop-types';
|
|
5
5
|
import { tmapApiUrl } from '../constants';
|
|
6
|
-
import { getTMap } from '
|
|
6
|
+
import { getTMap } from '../common/tmap';
|
|
7
7
|
const { useEffect, useRef, useState } = React;
|
|
8
8
|
const defaultLatLng = {
|
|
9
9
|
lat: null,
|
|
@@ -36,7 +36,7 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
36
36
|
setMapStatus(true);
|
|
37
37
|
}
|
|
38
38
|
catch (error) {
|
|
39
|
-
console.
|
|
39
|
+
console.error('initMap error', error);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
const initMarker = () => {
|
|
@@ -64,7 +64,7 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
catch (err) {
|
|
67
|
-
console.
|
|
67
|
+
console.error('initMarker err', err);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
useEffect(() => {
|
|
@@ -83,7 +83,7 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
83
83
|
initMap();
|
|
84
84
|
};
|
|
85
85
|
script.onerror = (err) => {
|
|
86
|
-
console.
|
|
86
|
+
console.error('loadScript err', err);
|
|
87
87
|
};
|
|
88
88
|
document.body.appendChild(script);
|
|
89
89
|
}
|
|
@@ -97,12 +97,15 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
97
97
|
mapRef.current = null;
|
|
98
98
|
setMapStatus(false);
|
|
99
99
|
};
|
|
100
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
101
|
}, [APIKEY]);
|
|
101
102
|
useEffect(() => {
|
|
102
103
|
mapRef.current && mapRef.current.setDraggable(drag);
|
|
104
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
105
|
}, [drag, mapRef.current]);
|
|
104
106
|
useEffect(() => {
|
|
105
107
|
mapRef.current && getTMap() && removeOrAddZoom(mapRef.current, getTMap());
|
|
108
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
109
|
}, [zoom, mapRef.current]);
|
|
107
110
|
useEffect(() => {
|
|
108
111
|
const TMap = getTMap();
|
|
@@ -121,7 +124,7 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
121
124
|
]);
|
|
122
125
|
}
|
|
123
126
|
catch (error) {
|
|
124
|
-
console.
|
|
127
|
+
console.error('updateGeometries error view', error);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
}, [lat, lng, mapStatus]);
|
|
@@ -144,7 +147,7 @@ export default function MapView({ APIKEY = '', drag = true, zoom = true, latlng
|
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
catch (error) {
|
|
147
|
-
console.
|
|
150
|
+
console.error('removeOrAddZoom error', error);
|
|
148
151
|
}
|
|
149
152
|
};
|
|
150
153
|
// 移除缩放控件
|
|
File without changes
|
|
File without changes
|
|
@@ -63,7 +63,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
63
63
|
longitude: lng,
|
|
64
64
|
}, locationType === 1);
|
|
65
65
|
}, (error) => {
|
|
66
|
-
console.
|
|
66
|
+
console.error('error loc', error);
|
|
67
67
|
currentLocations.current = null;
|
|
68
68
|
setApiKeyStatus({
|
|
69
69
|
status: false,
|
|
@@ -75,7 +75,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
script.onerror = (error) => {
|
|
78
|
-
console.
|
|
78
|
+
console.error('Geolocation script onerror', error);
|
|
79
79
|
setApiKeyStatus({
|
|
80
80
|
status: false,
|
|
81
81
|
message: '定位失败',
|
|
@@ -90,6 +90,7 @@ export default function useLocationInfo({ apiKey: APIKEY, locationType, eventsCh
|
|
|
90
90
|
document.body.appendChild(script);
|
|
91
91
|
}
|
|
92
92
|
loadScript();
|
|
93
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
94
|
}, [APIKEY, locationType]);
|
|
94
95
|
return {
|
|
95
96
|
location,
|
|
@@ -69,6 +69,7 @@ export default function LocationH5(props) {
|
|
|
69
69
|
events.change && events.change(res);
|
|
70
70
|
}
|
|
71
71
|
setLocation(location);
|
|
72
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
73
|
}, [value, locationType]);
|
|
73
74
|
useEffect(() => {
|
|
74
75
|
let loc = {
|
|
@@ -83,6 +84,7 @@ export default function LocationH5(props) {
|
|
|
83
84
|
setLocation(loc);
|
|
84
85
|
// 暂不支持自定位置,初始化表单值都是{}
|
|
85
86
|
events.change({ value: {} });
|
|
87
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
88
|
}, [locationType]);
|
|
87
89
|
useEffect(() => {
|
|
88
90
|
if (checkCustomLocation(value)) {
|
|
@@ -150,7 +152,7 @@ export default function LocationH5(props) {
|
|
|
150
152
|
});
|
|
151
153
|
}
|
|
152
154
|
}, (error) => {
|
|
153
|
-
console.
|
|
155
|
+
console.error('error loc', error);
|
|
154
156
|
currentLocations.current = null;
|
|
155
157
|
setApiKeyStatus({
|
|
156
158
|
status: false,
|
|
@@ -162,7 +164,7 @@ export default function LocationH5(props) {
|
|
|
162
164
|
});
|
|
163
165
|
};
|
|
164
166
|
script.onerror = (error) => {
|
|
165
|
-
console.
|
|
167
|
+
console.error('Geolocation script onerror', error);
|
|
166
168
|
setApiKeyStatus({
|
|
167
169
|
status: false,
|
|
168
170
|
message: '定位失败',
|
|
@@ -177,6 +179,7 @@ export default function LocationH5(props) {
|
|
|
177
179
|
document.body.appendChild(script);
|
|
178
180
|
}
|
|
179
181
|
loadScript();
|
|
182
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
183
|
}, [APIKEY, locationType, dataSourceStatus]);
|
|
181
184
|
useEffect(() => {
|
|
182
185
|
// 调用连接器数据源方法
|
|
@@ -199,7 +202,7 @@ export default function LocationH5(props) {
|
|
|
199
202
|
}
|
|
200
203
|
})
|
|
201
204
|
.catch((error) => {
|
|
202
|
-
console.
|
|
205
|
+
console.error('datasources error', error);
|
|
203
206
|
setDataSourceStatus({
|
|
204
207
|
status: false,
|
|
205
208
|
message: error,
|
|
@@ -66,6 +66,7 @@ export default function LocationPC(props) {
|
|
|
66
66
|
customLocation.current = value;
|
|
67
67
|
setLocation(loc);
|
|
68
68
|
}
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, [value]);
|
|
70
71
|
useEffect(() => {
|
|
71
72
|
if (value || !currentLocations.current)
|
|
@@ -91,6 +92,7 @@ export default function LocationPC(props) {
|
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
setLocation(location);
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
96
|
}, [value, locationType]);
|
|
95
97
|
const showToast = (message) => {
|
|
96
98
|
weui.toast(message, {
|
|
@@ -142,7 +144,7 @@ export default function LocationPC(props) {
|
|
|
142
144
|
}
|
|
143
145
|
})
|
|
144
146
|
.catch((error) => {
|
|
145
|
-
console.
|
|
147
|
+
console.error('datasources error', error);
|
|
146
148
|
setDataSourceStatus({
|
|
147
149
|
status: false,
|
|
148
150
|
message: error,
|
|
@@ -156,6 +158,7 @@ export default function LocationPC(props) {
|
|
|
156
158
|
});
|
|
157
159
|
showToast('请配置地图连接器');
|
|
158
160
|
}
|
|
161
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
159
162
|
}, [dataSource]);
|
|
160
163
|
useEffect(() => {
|
|
161
164
|
let loc = {
|
|
@@ -187,6 +190,7 @@ export default function LocationPC(props) {
|
|
|
187
190
|
poiname: loc.poiname,
|
|
188
191
|
detailedAddress: loc.detailedAddress,
|
|
189
192
|
}, true);
|
|
193
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
190
194
|
}, [locationType]);
|
|
191
195
|
const getIsShowMap = () => {
|
|
192
196
|
let status = showMap;
|
|
@@ -4,8 +4,15 @@ import './index.css';
|
|
|
4
4
|
import { usePlatform } from '../../../utils/platform';
|
|
5
5
|
import LocationH5 from './components/LocationH5/location.h5';
|
|
6
6
|
import LocationPC from './components/LocationPC/location.PC';
|
|
7
|
+
import { CommonErrorBoundary } from '../../common/error-boundary';
|
|
8
|
+
import { useLoopRenderDetect } from '../../common/use-loop-render-detect';
|
|
7
9
|
export default function Location(props) {
|
|
10
|
+
return (React.createElement(CommonErrorBoundary, null,
|
|
11
|
+
React.createElement(LocationImpl, { ...props })));
|
|
12
|
+
}
|
|
13
|
+
function LocationImpl(props) {
|
|
8
14
|
const platform = usePlatform();
|
|
15
|
+
useLoopRenderDetect();
|
|
9
16
|
if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
|
|
10
17
|
return React.createElement(LocationPC, { ...props });
|
|
11
18
|
}
|
|
@@ -38,18 +38,18 @@ label = '标题', labelVisible = true, format = '', enumName = '', name = 'formR
|
|
|
38
38
|
prevRangeRef.current = option;
|
|
39
39
|
setCheckedItemValue((_a = option.find((item) => item.checked)) === null || _a === void 0 ? void 0 : _a.value);
|
|
40
40
|
}
|
|
41
|
-
});
|
|
41
|
+
}, [option]);
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
// 如果绑定字段类型为枚举,且传入自定义选项集的名称则默认使用自定义选项集的内容作为选项
|
|
44
44
|
if (format === 'x-enum' && enumName) {
|
|
45
45
|
fetchData({ OptNameList: [enumName], PageIndex: 1, PageSize: 10 });
|
|
46
46
|
}
|
|
47
|
-
}, []);
|
|
47
|
+
}, [enumName, format]);
|
|
48
48
|
useEffect(() => {
|
|
49
49
|
if (format !== 'x-enum') {
|
|
50
50
|
setOption(range);
|
|
51
51
|
}
|
|
52
|
-
}, [range]);
|
|
52
|
+
}, [format, range]);
|
|
53
53
|
const fetchData = async (param) => {
|
|
54
54
|
var _a, _b, _c;
|
|
55
55
|
const data = await callWedaApi({
|
|
@@ -75,9 +75,17 @@ defaultRegion, defaultMutiRegion, separator, regionType, onChange, }) {
|
|
|
75
75
|
defaultMutiRegion,
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
}
|
|
78
|
+
}, [
|
|
79
|
+
defaultValue,
|
|
80
|
+
defaultDate,
|
|
81
|
+
defaultTime,
|
|
82
|
+
defaultRegion,
|
|
83
|
+
defaultMutiRegion,
|
|
84
|
+
regionType,
|
|
85
|
+
dateMode,
|
|
86
|
+
]);
|
|
79
87
|
//实现初始值触发change事件
|
|
80
|
-
const defaultMutiRegionChange = function (treeValue, defaultMutiRegion) {
|
|
88
|
+
const defaultMutiRegionChange = React.useCallback(function (treeValue, defaultMutiRegion) {
|
|
81
89
|
var _a;
|
|
82
90
|
const defaultValue = defaultMutiRegion
|
|
83
91
|
? defaultMutiRegion.split(',')
|
|
@@ -96,7 +104,7 @@ defaultRegion, defaultMutiRegion, separator, regionType, onChange, }) {
|
|
|
96
104
|
});
|
|
97
105
|
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: defaultMutiRegion, result: changeValue });
|
|
98
106
|
}
|
|
99
|
-
};
|
|
107
|
+
}, [events]);
|
|
100
108
|
React.useEffect(() => {
|
|
101
109
|
if (mode == 'region' || mode == 'mutiRegion') {
|
|
102
110
|
if (regionData.length < 1) {
|
|
@@ -131,7 +139,13 @@ defaultRegion, defaultMutiRegion, separator, regionType, onChange, }) {
|
|
|
131
139
|
break;
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
}, [
|
|
142
|
+
}, [
|
|
143
|
+
regionType,
|
|
144
|
+
mode,
|
|
145
|
+
regionData,
|
|
146
|
+
defaultMutiRegionChange,
|
|
147
|
+
defaultMutiRegion,
|
|
148
|
+
]);
|
|
135
149
|
const onDateclick = function () {
|
|
136
150
|
const options = {
|
|
137
151
|
className: 'weda-ui weda-picker',
|
|
@@ -12,11 +12,18 @@ import { emptyObject } from '../../../utils/constant';
|
|
|
12
12
|
import { PureSelectPc } from './dropdown-select/ui';
|
|
13
13
|
import { useOptions } from './use-options';
|
|
14
14
|
import { getRegionTree, getAreaCode } from './region';
|
|
15
|
+
import { CommonErrorBoundary } from '../../common/error-boundary';
|
|
16
|
+
import { useLoopRenderDetect } from '../../common/use-loop-render-detect';
|
|
15
17
|
// @ts-ignore TODO: fix 与plugin构建阶段效果不同
|
|
16
18
|
export const moment = (typeof _moment === 'function' ? _moment : _moment.default);
|
|
17
19
|
export default function Select(props) {
|
|
20
|
+
return (React.createElement(CommonErrorBoundary, null,
|
|
21
|
+
React.createElement(SelectImpl, { ...props })));
|
|
22
|
+
}
|
|
23
|
+
function SelectImpl(props) {
|
|
18
24
|
const { id, style, className, label = '标题', labelVisible = true, layout = 'horizontal', requiredFlag = false, size = 'l', decorator, } = props;
|
|
19
25
|
const platform = usePlatform();
|
|
26
|
+
useLoopRenderDetect();
|
|
20
27
|
let selectEl;
|
|
21
28
|
if (platform === 'h5') {
|
|
22
29
|
selectEl = React.createElement(SelectH5, { ...props });
|
|
@@ -125,7 +132,14 @@ function SelectPc({ where, dataSourceName, viewId, format, primaryField, enumNam
|
|
|
125
132
|
defaultMutiRegion,
|
|
126
133
|
};
|
|
127
134
|
}
|
|
128
|
-
}
|
|
135
|
+
}, [
|
|
136
|
+
defaultValue,
|
|
137
|
+
defaultDate,
|
|
138
|
+
defaultTime,
|
|
139
|
+
defaultRegion,
|
|
140
|
+
defaultMutiRegion,
|
|
141
|
+
dateMode,
|
|
142
|
+
]);
|
|
129
143
|
React.useEffect(() => {
|
|
130
144
|
if (mode == 'region' || mode == 'mutiRegion') {
|
|
131
145
|
if (regionData.length < 1) {
|
|
@@ -36,7 +36,7 @@ export function ImageUploaderH5({ title, maxUploadCount, maxSize = 10, acceptTyp
|
|
|
36
36
|
return inputValue;
|
|
37
37
|
}
|
|
38
38
|
return [];
|
|
39
|
-
}, [inputValue]);
|
|
39
|
+
}, [inputValue, setInputValue]);
|
|
40
40
|
const finalMaxImgCount = React.useMemo(() => {
|
|
41
41
|
if (single)
|
|
42
42
|
return 1;
|
|
@@ -59,7 +59,7 @@ export function ImageUploaderH5({ title, maxUploadCount, maxSize = 10, acceptTyp
|
|
|
59
59
|
onChange && onChange(fileIdList);
|
|
60
60
|
events.change && events.change({ value: fileIdList });
|
|
61
61
|
}
|
|
62
|
-
}, [fileIdList]);
|
|
62
|
+
}, [events, fileIdList, onChange, single]);
|
|
63
63
|
const onProgress = (progressEvent) => {
|
|
64
64
|
let percentCompleted = 0;
|
|
65
65
|
try {
|
|
@@ -53,7 +53,7 @@ export function UploaderPCInner(props) {
|
|
|
53
53
|
initialValue = initialValue[0] ? [initialValue[0]] : [];
|
|
54
54
|
}
|
|
55
55
|
setfileIDList(initialValue);
|
|
56
|
-
}, [defaultValue]);
|
|
56
|
+
}, [defaultValue, single]);
|
|
57
57
|
// 值变化事件
|
|
58
58
|
React.useEffect(() => {
|
|
59
59
|
if (!isObjectEqual(fileRef.current, fileIDList)) {
|
|
@@ -70,7 +70,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
70
70
|
(_c = events === null || events === void 0 ? void 0 : events.success) === null || _c === void 0 ? void 0 : _c.call(events, { value: pureFileIDList });
|
|
71
71
|
fileRef.current = fileIDList;
|
|
72
72
|
}
|
|
73
|
-
}, [fileIDList]);
|
|
73
|
+
}, [events, fileIDList, onChange, single]);
|
|
74
74
|
// 外层组件类
|
|
75
75
|
const cls = classNames({
|
|
76
76
|
'weda-ui': true,
|
|
@@ -218,12 +218,9 @@ const TcbFileUpload = ({ file, disabled }) => {
|
|
|
218
218
|
const title = (file === null || file === void 0 ? void 0 : file.name) || '';
|
|
219
219
|
const uuid = file === null || file === void 0 ? void 0 : file._uuid;
|
|
220
220
|
return { size, title, uuid };
|
|
221
|
-
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
222
|
-
React.useEffect(() => {
|
|
223
|
-
handleUpload(file);
|
|
224
|
-
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
221
|
+
}, [file === null || file === void 0 ? void 0 : file._uuid, file === null || file === void 0 ? void 0 : file.name, file === null || file === void 0 ? void 0 : file.size]);
|
|
225
222
|
// 上传过程
|
|
226
|
-
const handleUpload = async (file) => {
|
|
223
|
+
const handleUpload = React.useCallback(async (file) => {
|
|
227
224
|
var _a;
|
|
228
225
|
const tcb = await getCloudInstance();
|
|
229
226
|
try {
|
|
@@ -245,7 +242,12 @@ const TcbFileUpload = ({ file, disabled }) => {
|
|
|
245
242
|
setStatus('UPLOAD_STATUS_ERROR');
|
|
246
243
|
(_a = events === null || events === void 0 ? void 0 : events.error) === null || _a === void 0 ? void 0 : _a.call(events, err);
|
|
247
244
|
}
|
|
248
|
-
}
|
|
245
|
+
},
|
|
246
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
247
|
+
[size, uploadPath, uuid]);
|
|
248
|
+
React.useEffect(() => {
|
|
249
|
+
handleUpload(file);
|
|
250
|
+
}, [file, file._uuid, handleUpload]);
|
|
249
251
|
return (React.createElement("div", { className: `${CLASS_PREFIX}__item`, role: "TcbFileUpload" },
|
|
250
252
|
React.createElement("div", { className: `${CLASS_PREFIX}__item-left` },
|
|
251
253
|
React.createElement(UploadFileStatus, { status: status, percent: percent, size: size, title: title, percentSize: (((file === null || file === void 0 ? void 0 : file.size) / 1024) * percent) / 100 })),
|