@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,50 +0,0 @@
|
|
|
1
|
-
export { default as Button } from "./button";
|
|
2
|
-
export const Text: any;
|
|
3
|
-
export { default as Container } from "./container";
|
|
4
|
-
export const Image: any;
|
|
5
|
-
export { default as Slot } from "./slot";
|
|
6
|
-
export { default as ScrollView } from "./scrollView";
|
|
7
|
-
export { default as Swiper } from "./swiper";
|
|
8
|
-
export { default as Carousel } from "./carousel";
|
|
9
|
-
export { default as Modal } from "./modal";
|
|
10
|
-
export const RichText: any;
|
|
11
|
-
export { default as RichTextView } from "./richTextView";
|
|
12
|
-
export { default as Link } from "./link";
|
|
13
|
-
export { default as Drawer } from "./drawer";
|
|
14
|
-
export { default as UploaderView } from "./uploaderView";
|
|
15
|
-
export { default as UploaderFileView } from "./uploaderFileView";
|
|
16
|
-
export const WedaVideo: any;
|
|
17
|
-
export { default as Picker } from "./picker/picker";
|
|
18
|
-
export { default as DatePicker } from "./picker/datePicker";
|
|
19
|
-
export { default as TimePicker } from "./picker/timePicker";
|
|
20
|
-
export { default as Form } from "./form/form";
|
|
21
|
-
export { default as Input } from "./form/input";
|
|
22
|
-
export { default as Textarea } from "./form/textarea";
|
|
23
|
-
export { default as Checkbox } from "./form/checkbox";
|
|
24
|
-
export { default as Radio } from "./form/radio";
|
|
25
|
-
export { default as Switch } from "./form/switch";
|
|
26
|
-
export { default as Select } from "./form/select";
|
|
27
|
-
export { default as Uploader } from "./form/uploader";
|
|
28
|
-
export { default as UploaderFile } from "./form/uploaderFile";
|
|
29
|
-
export { default as Tips } from "./form/tips";
|
|
30
|
-
export { default as Tabs } from "./tabs";
|
|
31
|
-
export { default as Location } from "./form/location";
|
|
32
|
-
export const EnumSelect: any;
|
|
33
|
-
export const Calendar: any;
|
|
34
|
-
export { default as NavLayout } from "./navLayout";
|
|
35
|
-
export { default as ListView } from "./listView";
|
|
36
|
-
export { default as NavigationBar } from "./navigationBar";
|
|
37
|
-
export const Line: any;
|
|
38
|
-
export const Bar: any;
|
|
39
|
-
export const Pie: any;
|
|
40
|
-
export { default as DataView } from "./dataView";
|
|
41
|
-
export { default as StatisticsCard } from "./chart/statisticsCard";
|
|
42
|
-
export { default as GraphicCard } from "./graphicCard";
|
|
43
|
-
export { default as UserInfo } from "./userInfo";
|
|
44
|
-
export { default as Phone } from "./phone";
|
|
45
|
-
export { default as PhoneCode } from "./phoneCode";
|
|
46
|
-
export { default as Share } from "./share";
|
|
47
|
-
export { default as Lottery } from "./lottery";
|
|
48
|
-
export { default as UserTreeSelect } from "./form/userOrgSelect/index";
|
|
49
|
-
export { default as DepartTreeSelect } from "./form/userOrgSelect/departTreeSelect/index";
|
|
50
|
-
export { default as FormDetail } from "./formdetail";
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import '@tcwd/style-wedatheme/index.css';
|
|
2
|
-
import loadable from '@loadable/component';
|
|
3
|
-
import { fallback } from '../utils/loading-fallback';
|
|
4
|
-
// export const Button = loadable(() => import('./button'), {fallback});
|
|
5
|
-
// export const Container = loadable(() => import('./container'), {fallback});
|
|
6
|
-
// export const Slot = loadable(() => import('./slot'), {fallback});
|
|
7
|
-
// export const ScrollView = loadable(() => import('./scrollView'), {fallback});
|
|
8
|
-
// export const Swiper = loadable(() => import('./swiper'), {fallback});
|
|
9
|
-
// export const Modal = loadable(() => import('./modal'), {fallback});
|
|
10
|
-
// export const RichText = loadable(() => import('./richText'), {fallback});
|
|
11
|
-
// export const RichTextView = loadable(() => import('./richTextView'), {fallback});
|
|
12
|
-
// export const Link = loadable(() => import('./link'), {fallback});
|
|
13
|
-
// export const Drawer = loadable(() => import('./drawer'), {fallback});
|
|
14
|
-
// export const UploaderView = loadable(() => import('./uploaderView'), {fallback});
|
|
15
|
-
// // picker
|
|
16
|
-
// export const Picker = loadable(() => import('./picker/picker'), {fallback});
|
|
17
|
-
// export const DatePicker = loadable(() => import('./picker/datePicker'), {fallback});
|
|
18
|
-
// export const TimePicker = loadable(() => import('./picker/timePicker'), {fallback});
|
|
19
|
-
// // form
|
|
20
|
-
// export const Form = loadable(() => import('./form/form'), {fallback});
|
|
21
|
-
// export const Input = loadable(() => import('./form/input'), {fallback});
|
|
22
|
-
// export const Textarea = loadable(() => import('./form/textarea'), {fallback});
|
|
23
|
-
// export const Checkbox = loadable(() => import('./form/checkbox'), {fallback});
|
|
24
|
-
// export const Radio = loadable(() => import('./form/radio'), {fallback});
|
|
25
|
-
// export const Switch = loadable(() => import('./form/switch'), {fallback});
|
|
26
|
-
// export const Uploader = loadable(() => import('./form/uploader'), {fallback});
|
|
27
|
-
// export const Tips = loadable(() => import('./form/tips'), {fallback});
|
|
28
|
-
// export const EnumSelect = loadable(() => import('./form/enumSelect'), {fallback});
|
|
29
|
-
// export const Tabs = loadable(() => import('./tabs'), {fallback});
|
|
30
|
-
export { default as Button } from './button';
|
|
31
|
-
// export { default as Text } from './text';
|
|
32
|
-
export const Text = loadable(() => import('./text'), { fallback });
|
|
33
|
-
export { default as Container } from './container';
|
|
34
|
-
// export { default as Image } from './image';
|
|
35
|
-
export const Image = loadable(() => import('./image'), { fallback });
|
|
36
|
-
export { default as Slot } from './slot';
|
|
37
|
-
export { default as ScrollView } from './scrollView';
|
|
38
|
-
export { default as Swiper } from './swiper';
|
|
39
|
-
export { default as Carousel } from './carousel';
|
|
40
|
-
export { default as Modal } from './modal';
|
|
41
|
-
// export { default as RichText } from './richText';
|
|
42
|
-
export const RichText = loadable(() => import('./richText'), { fallback });
|
|
43
|
-
export { default as RichTextView } from './richTextView';
|
|
44
|
-
export { default as Link } from './link';
|
|
45
|
-
export { default as Drawer } from './drawer';
|
|
46
|
-
export { default as UploaderView } from './uploaderView';
|
|
47
|
-
export { default as UploaderFileView } from './uploaderFileView';
|
|
48
|
-
// export { default as WedaVideo } from './wedaVideo/index';
|
|
49
|
-
export const WedaVideo = loadable(() => import('./wedaVideo/index'), {
|
|
50
|
-
fallback,
|
|
51
|
-
});
|
|
52
|
-
export { default as Picker } from './picker/picker';
|
|
53
|
-
export { default as DatePicker } from './picker/datePicker';
|
|
54
|
-
export { default as TimePicker } from './picker/timePicker';
|
|
55
|
-
// form
|
|
56
|
-
export { default as Form } from './form/form';
|
|
57
|
-
export { default as Input } from './form/input';
|
|
58
|
-
export { default as Textarea } from './form/textarea';
|
|
59
|
-
export { default as Checkbox } from './form/checkbox';
|
|
60
|
-
export { default as Radio } from './form/radio';
|
|
61
|
-
export { default as Switch } from './form/switch';
|
|
62
|
-
export { default as Select } from './form/select';
|
|
63
|
-
// export const Select = loadable(() => import('./form/select'), { fallback });
|
|
64
|
-
export { default as Uploader } from './form/uploader';
|
|
65
|
-
export { default as UploaderFile } from './form/uploaderFile';
|
|
66
|
-
export { default as Tips } from './form/tips';
|
|
67
|
-
export { default as Tabs } from './tabs';
|
|
68
|
-
export { default as Location } from './form/location';
|
|
69
|
-
// export { default as EnumSelect } from './form/enumSelect';
|
|
70
|
-
export const EnumSelect = loadable(() => import('./form/enumSelect'), {
|
|
71
|
-
fallback,
|
|
72
|
-
});
|
|
73
|
-
// export { default as Calendar } from './calendar';
|
|
74
|
-
export const Calendar = loadable(() => import('./calendar'), { fallback });
|
|
75
|
-
export { default as NavLayout } from './navLayout';
|
|
76
|
-
// Data Contaier
|
|
77
|
-
export { default as ListView } from './listView';
|
|
78
|
-
export { default as NavigationBar } from './navigationBar';
|
|
79
|
-
// export { default as Line } from './chart/line';
|
|
80
|
-
// export { default as Bar } from './chart/bar';
|
|
81
|
-
// export { default as Pie } from './chart/pie';
|
|
82
|
-
export const Line = loadable(() => import('./chart/line'), { fallback });
|
|
83
|
-
export const Bar = loadable(() => import('./chart/bar'), { fallback });
|
|
84
|
-
export const Pie = loadable(() => import('./chart/pie'), { fallback });
|
|
85
|
-
export { default as DataView } from './dataView';
|
|
86
|
-
export { default as StatisticsCard } from './chart/statisticsCard';
|
|
87
|
-
export { default as GraphicCard } from './graphicCard';
|
|
88
|
-
export { default as UserInfo } from './userInfo';
|
|
89
|
-
export { default as Phone } from './phone';
|
|
90
|
-
export { default as PhoneCode } from './phoneCode';
|
|
91
|
-
export { default as Share } from './share';
|
|
92
|
-
export { default as Lottery } from './lottery';
|
|
93
|
-
export { default as UserTreeSelect } from './form/userOrgSelect/index';
|
|
94
|
-
export { default as DepartTreeSelect } from './form/userOrgSelect/departTreeSelect/index';
|
|
95
|
-
export { default as FormDetail } from './formdetail';
|
|
96
|
-
import 'weui/dist/style/weui.css';
|
|
97
|
-
import '../weda-ui.css';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { CommonPropsType } from '../../types';
|
|
3
|
-
import './index.css';
|
|
4
|
-
export interface PropsType extends CommonPropsType {
|
|
5
|
-
/**
|
|
6
|
-
* 内容
|
|
7
|
-
*/
|
|
8
|
-
content?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 链接地址
|
|
11
|
-
*/
|
|
12
|
-
url?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 参数
|
|
15
|
-
*/
|
|
16
|
-
params?: Readonly<{
|
|
17
|
-
key: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}[]>;
|
|
20
|
-
contentSlot?: React.ReactNode;
|
|
21
|
-
isOpenInNewWindow?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export default function Link({ content, url, events, style, className, contentSlot, params, // TODO 格式定义,
|
|
24
|
-
isOpenInNewWindow, }: PropsType): JSX.Element;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import classNames from '../../utils/classnames';
|
|
3
|
-
import { emptyArray, emptyObject } from '../../utils/constant';
|
|
4
|
-
import './index.css';
|
|
5
|
-
// 所有绝对地址直接交由浏览器,新开窗口交由浏览器
|
|
6
|
-
// 当前窗口相对地址交给平台
|
|
7
|
-
export default function Link({ content, url = '', events = emptyObject, style, className, contentSlot, params = emptyArray, // TODO 格式定义,
|
|
8
|
-
isOpenInNewWindow, }) {
|
|
9
|
-
url = url.trim();
|
|
10
|
-
const cls = classNames({
|
|
11
|
-
'weda-link': true,
|
|
12
|
-
'weda-ui': true,
|
|
13
|
-
[className]: className,
|
|
14
|
-
});
|
|
15
|
-
// URL 构造函数不支持 '//xxx.com' 的格式
|
|
16
|
-
if (url.indexOf('//') === 0) {
|
|
17
|
-
url = location.protocol + url;
|
|
18
|
-
}
|
|
19
|
-
// "proto:" 或 "//" 起头的是绝对路径
|
|
20
|
-
let isAbosolutePath = /^(?:[a-z]+:)/i.test(url);
|
|
21
|
-
let base, path, href, paramObj = {}, urlObj;
|
|
22
|
-
if (!isAbosolutePath) {
|
|
23
|
-
// 相对地址使用站位域名,不实际使用
|
|
24
|
-
base =
|
|
25
|
-
location.origin && location.origin !== 'null'
|
|
26
|
-
? location.origin
|
|
27
|
-
: 'https://we.da';
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
urlObj = new URL(url, base);
|
|
31
|
-
params.forEach((x) => {
|
|
32
|
-
urlObj.searchParams.append(x.key, x.value);
|
|
33
|
-
});
|
|
34
|
-
href = urlObj.href;
|
|
35
|
-
path = urlObj.pathname;
|
|
36
|
-
for (const [key, value] of urlObj.searchParams) {
|
|
37
|
-
paramObj[key] = value;
|
|
38
|
-
}
|
|
39
|
-
// 相对地址去掉站位域名
|
|
40
|
-
if (!isAbosolutePath) {
|
|
41
|
-
href = urlObj.pathname + urlObj.search + urlObj.hash;
|
|
42
|
-
href = href.replace(/^\//, '');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
// 非法 url
|
|
47
|
-
isAbosolutePath = true;
|
|
48
|
-
href = url;
|
|
49
|
-
path = '';
|
|
50
|
-
paramObj = params.reduce((p, x) => {
|
|
51
|
-
p[x.key] = x.value;
|
|
52
|
-
return p;
|
|
53
|
-
}, {});
|
|
54
|
-
}
|
|
55
|
-
return (React.createElement("a", { style: { ...style }, className: cls, target: isOpenInNewWindow ? '_blank' : '_self', href: href, onClick: (e) => {
|
|
56
|
-
events.tap && events.tap({}, { originEvent: e });
|
|
57
|
-
if (!e.defaultPrevented) {
|
|
58
|
-
if (!isAbosolutePath) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
app.navigateTo({
|
|
61
|
-
pageId: path,
|
|
62
|
-
packageName: '',
|
|
63
|
-
mode: 'weDa',
|
|
64
|
-
params: paramObj,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}, rel: "noopener noreferrer" },
|
|
69
|
-
contentSlot && React.createElement("div", { className: "weda-link-slot" }, contentSlot),
|
|
70
|
-
content));
|
|
71
|
-
}
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef, useCallback, } from 'react';
|
|
2
|
-
import { callDataSource } from '../../utils/tcb';
|
|
3
|
-
import { isInIde, getWhereList } from '../../utils/platform';
|
|
4
|
-
import classNames from '../../utils/classnames';
|
|
5
|
-
import isequal from 'lodash.isequal';
|
|
6
|
-
import './index.css';
|
|
7
|
-
import { isNil } from '../../utils/lodash';
|
|
8
|
-
const ORDERTYPE = ['asc', 'desc'];
|
|
9
|
-
const BLOCK_NAME = 'weda-list-view';
|
|
10
|
-
const getIdeMockData = (length = 3) => Array.from({ length }).map(() => Object.create(null));
|
|
11
|
-
/**
|
|
12
|
-
* 数据容器-列表视图
|
|
13
|
-
*/
|
|
14
|
-
export default function ListView(props) {
|
|
15
|
-
var _a, _b, _c;
|
|
16
|
-
const { dataSourceType, bindConnectMetadata, connectorMethod, connectorParams, datasource, orderBy, orderType, where, template, pageSize = 5, pagination, events, className, children, isRecords = true, //是否展示回调recoreds字段
|
|
17
|
-
isSetStatus = false, //是否开启加载状态
|
|
18
|
-
appCloud = { callDataSource, isInIde }, beforeDataChange = (v) => v, ...rest } = props;
|
|
19
|
-
const isModel = dataSourceType !== 'custom-connector';
|
|
20
|
-
const methodName = isModel
|
|
21
|
-
? ((_a = datasource === null || datasource === void 0 ? void 0 : datasource.extra) === null || _a === void 0 ? void 0 : _a.methodName) || 'wedaGetRecords'
|
|
22
|
-
: connectorMethod === null || connectorMethod === void 0 ? void 0 : connectorMethod.name; // 默认方法名
|
|
23
|
-
const dataSourceName = isModel
|
|
24
|
-
? datasource === null || datasource === void 0 ? void 0 : datasource.name
|
|
25
|
-
: (_b = bindConnectMetadata === null || bindConnectMetadata === void 0 ? void 0 : bindConnectMetadata.datasource) === null || _b === void 0 ? void 0 : _b.name;
|
|
26
|
-
const [pageNo, setPageNo] = useState(1); // 分页状态
|
|
27
|
-
const [entry, setEntry] = useState(null); // 触底的observer对象
|
|
28
|
-
const [status, setStatus] = useState(''); // 查询状态
|
|
29
|
-
const paramRef = useRef({
|
|
30
|
-
dataSourceName,
|
|
31
|
-
methodName,
|
|
32
|
-
params: { orderBy, orderType, where, pageNo: 1, pageSize, connectorParams },
|
|
33
|
-
pagination,
|
|
34
|
-
}); // 最新请求参数
|
|
35
|
-
const dataRef = useRef({ total: 0, records: [] }); // 最新数据列表
|
|
36
|
-
const observeRef = useRef(null); // 当前监听对象
|
|
37
|
-
const isIdeMockData = !(dataSourceName && methodName) && ((_c = appCloud === null || appCloud === void 0 ? void 0 : appCloud.isInIde) === null || _c === void 0 ? void 0 : _c.call(appCloud)); // 在ide环境且未绑定数据源时,存在mock数据逻辑
|
|
38
|
-
const shouldBottomLoad = pagination === 'bottomLoad' &&
|
|
39
|
-
(entry === null || entry === void 0 ? void 0 : entry.isIntersecting) &&
|
|
40
|
-
['', 'success'].includes(status); // 能否触底加载
|
|
41
|
-
// 组件卸载时触发
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
return () => {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
(_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
46
|
-
(_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, { data: beforeDataChange([]) });
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
// props 基本类型监听,需重新分页;处于 ide 且未绑定数据源时返回mock数据
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
var _a, _b;
|
|
52
|
-
dataRef.current = { total: 0, records: [] };
|
|
53
|
-
if (!isIdeMockData) {
|
|
54
|
-
fetchData({
|
|
55
|
-
dataSourceName,
|
|
56
|
-
methodName,
|
|
57
|
-
params: {
|
|
58
|
-
...(_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params,
|
|
59
|
-
orderBy,
|
|
60
|
-
orderType,
|
|
61
|
-
pageNo: 1,
|
|
62
|
-
pageSize,
|
|
63
|
-
},
|
|
64
|
-
pagination,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
(_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
|
|
69
|
-
data: beforeDataChange(getIdeMockData(pageSize)),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}, [
|
|
73
|
-
methodName,
|
|
74
|
-
dataSourceName,
|
|
75
|
-
pageSize,
|
|
76
|
-
pagination,
|
|
77
|
-
orderBy,
|
|
78
|
-
orderType,
|
|
79
|
-
isModel,
|
|
80
|
-
]);
|
|
81
|
-
// props 对象类型监听,需重新分页
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
var _a, _b, _c, _d;
|
|
84
|
-
if (isModel) {
|
|
85
|
-
if (!isequal((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.where, where)) {
|
|
86
|
-
dataRef.current = { total: 0, records: [] };
|
|
87
|
-
fetchData({
|
|
88
|
-
params: { pageNo: 1, where },
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
if (!isequal((_d = (_c = paramRef.current) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.connectorParams, connectorParams)) {
|
|
94
|
-
dataRef.current = { total: 0, records: [] };
|
|
95
|
-
fetchData({
|
|
96
|
-
params: { pageNo: 1, connectorParams },
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
// 监听触底加载事件
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
var _a, _b;
|
|
104
|
-
if (shouldBottomLoad && hasNextPage()) {
|
|
105
|
-
fetchData({
|
|
106
|
-
params: { pageNo: (((_b = (_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.pageNo) || 1) + 1 },
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}, [shouldBottomLoad]);
|
|
110
|
-
// 触底监控对象
|
|
111
|
-
const nodeRefCallback = useCallback((node) => {
|
|
112
|
-
var _a;
|
|
113
|
-
if (node) {
|
|
114
|
-
(_a = observeRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
115
|
-
observeRef.current = new IntersectionObserver((entries) => {
|
|
116
|
-
setEntry(entries === null || entries === void 0 ? void 0 : entries[0]);
|
|
117
|
-
});
|
|
118
|
-
observeRef.current.observe(node);
|
|
119
|
-
}
|
|
120
|
-
}, []);
|
|
121
|
-
// 能否点击下一页
|
|
122
|
-
const hasNextPage = () => {
|
|
123
|
-
var _a;
|
|
124
|
-
const { pageNo = 1, pageSize = 5 } = ((_a = paramRef.current) === null || _a === void 0 ? void 0 : _a.params) || {};
|
|
125
|
-
const { total = 0 } = dataRef.current || {};
|
|
126
|
-
return pageNo * pageSize < total;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* 列表视图拉取数据
|
|
130
|
-
* 方法仅依赖入参和paramRef的参数
|
|
131
|
-
*/
|
|
132
|
-
const fetchData = async (param) => {
|
|
133
|
-
var _a;
|
|
134
|
-
// 合并参数
|
|
135
|
-
const fetchParam = {
|
|
136
|
-
...paramRef.current,
|
|
137
|
-
...param,
|
|
138
|
-
params: { ...paramRef.current.params, ...param === null || param === void 0 ? void 0 : param.params },
|
|
139
|
-
};
|
|
140
|
-
const { dataSourceName, methodName, params } = fetchParam;
|
|
141
|
-
const { orderBy, orderType, pageNo, pageSize, where, connectorParams } = params || {};
|
|
142
|
-
if (status === 'loading' || !(dataSourceName && methodName))
|
|
143
|
-
return;
|
|
144
|
-
setStatus('loading');
|
|
145
|
-
let tcbParams = {};
|
|
146
|
-
// tcb分页参数
|
|
147
|
-
if (!isNil(pageNo) && !isNil(pageSize)) {
|
|
148
|
-
tcbParams['pageNo'] = pageNo;
|
|
149
|
-
tcbParams['pageSize'] = pageSize;
|
|
150
|
-
}
|
|
151
|
-
if (isModel) {
|
|
152
|
-
// tcb排序参数
|
|
153
|
-
if (orderBy && ORDERTYPE.includes(orderType)) {
|
|
154
|
-
tcbParams['orderBy'] = orderBy;
|
|
155
|
-
tcbParams['orderType'] = orderType;
|
|
156
|
-
}
|
|
157
|
-
// tcb过滤参数
|
|
158
|
-
const whereEffected = [].concat(getWhereList(where));
|
|
159
|
-
whereEffected.length > 0 && (tcbParams['where'] = whereEffected);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
tcbParams = Object.assign({}, tcbParams, connectorParams);
|
|
163
|
-
}
|
|
164
|
-
// tcb结果和事件
|
|
165
|
-
let data = [];
|
|
166
|
-
const eventDatasource = isModel
|
|
167
|
-
? datasource
|
|
168
|
-
: { ...bindConnectMetadata, ...connectorMethod };
|
|
169
|
-
try {
|
|
170
|
-
data = await (appCloud === null || appCloud === void 0 ? void 0 : appCloud.callDataSource({
|
|
171
|
-
dataSourceName,
|
|
172
|
-
methodName,
|
|
173
|
-
params: tcbParams,
|
|
174
|
-
}, true));
|
|
175
|
-
paramRef.current = fetchParam;
|
|
176
|
-
onEnvets(data, eventDatasource);
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
setStatus(isModel ? 'fail' : '');
|
|
180
|
-
(_a = events === null || events === void 0 ? void 0 : events.queryFail) === null || _a === void 0 ? void 0 : _a.call(events, { datasource: eventDatasource, data: null });
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
/**
|
|
184
|
-
* 根据fetchData方法返回值,回调给外部事件
|
|
185
|
-
*/
|
|
186
|
-
const onEnvets = (data, datasource) => {
|
|
187
|
-
var _a, _b, _c, _d, _e, _f;
|
|
188
|
-
const fetchRecords = [].concat(!isRecords && !isModel ? data : (data === null || data === void 0 ? void 0 : data.records) || []);
|
|
189
|
-
const total = (_a = data === null || data === void 0 ? void 0 : data.total) !== null && _a !== void 0 ? _a : fetchRecords.length;
|
|
190
|
-
if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
|
|
191
|
-
dataRef.current = {
|
|
192
|
-
total,
|
|
193
|
-
records: [...dataRef.current.records, ...fetchRecords],
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
dataRef.current = { total, records: fetchRecords };
|
|
198
|
-
}
|
|
199
|
-
(_b = events === null || events === void 0 ? void 0 : events.onDataChange) === null || _b === void 0 ? void 0 : _b.call(events, {
|
|
200
|
-
data: beforeDataChange(dataRef.current.records || []),
|
|
201
|
-
});
|
|
202
|
-
if (total === 0) {
|
|
203
|
-
(_c = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _c === void 0 ? void 0 : _c.call(events, {
|
|
204
|
-
datasource,
|
|
205
|
-
data: beforeDataChange([]),
|
|
206
|
-
});
|
|
207
|
-
setStatus(isModel ? 'empty' : '');
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
window.setTimeout(() => setStatus('success'), pagination === 'bottomLoad' ? 150 : 0);
|
|
211
|
-
}
|
|
212
|
-
(_d = events === null || events === void 0 ? void 0 : events.querySuccess) === null || _d === void 0 ? void 0 : _d.call(events, {
|
|
213
|
-
datasource,
|
|
214
|
-
data: beforeDataChange(dataRef.current.records),
|
|
215
|
-
});
|
|
216
|
-
setPageNo(((_f = (_e = paramRef.current) === null || _e === void 0 ? void 0 : _e.params) === null || _f === void 0 ? void 0 : _f.pageNo) || 1);
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* 分页,加载更多
|
|
220
|
-
*/
|
|
221
|
-
const renderLoadMore = () => {
|
|
222
|
-
let disabled = !hasNextPage();
|
|
223
|
-
if (isIdeMockData) {
|
|
224
|
-
disabled = false;
|
|
225
|
-
}
|
|
226
|
-
if (status === 'loading')
|
|
227
|
-
return LoadingSymbol;
|
|
228
|
-
return (!disabled && (React.createElement("div", { className: `${BLOCK_NAME}__more-text`, onClick: () => fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u52A0\u8F7D\u66F4\u591A")));
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* 分页,底部刷新
|
|
232
|
-
*/
|
|
233
|
-
const renderBottomLoad = () => {
|
|
234
|
-
return (React.createElement("div", { ref: nodeRefCallback, className: `${BLOCK_NAME}__bottom-load` }, status === 'loading' ? LoadingSymbol : !hasNextPage() && LoadEnd));
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* 分页,分页器,含ideMockData的判断
|
|
238
|
-
*/
|
|
239
|
-
const renderPagination = () => {
|
|
240
|
-
var _a, _b;
|
|
241
|
-
const preDisabeld = pageNo <= 1;
|
|
242
|
-
const nextDisabeld = !hasNextPage();
|
|
243
|
-
const total = (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.total) !== null && _b !== void 0 ? _b : 0;
|
|
244
|
-
return (React.createElement("div", { className: `${BLOCK_NAME}__more-pagination` },
|
|
245
|
-
React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-pre`, preDisabeld ? '' : 'active'), onClick: () => !preDisabeld && fetchData({ params: { pageNo: pageNo - 1 } }) }, "\u4E0A\u4E00\u9875"),
|
|
246
|
-
React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-text`) },
|
|
247
|
-
React.createElement("span", { className: "active" }, isIdeMockData ? 1 : total ? pageNo : 0),
|
|
248
|
-
"/",
|
|
249
|
-
isIdeMockData ? 1 : Math.ceil(total / pageSize)),
|
|
250
|
-
React.createElement("div", { className: classNames(`${BLOCK_NAME}__pagination-next`, nextDisabeld ? '' : 'active'), onClick: () => !nextDisabeld && fetchData({ params: { pageNo: pageNo + 1 } }) }, "\u4E0B\u4E00\u9875")));
|
|
251
|
-
};
|
|
252
|
-
/**
|
|
253
|
-
* 查询状态展示
|
|
254
|
-
*/
|
|
255
|
-
const renderStatus = () => {
|
|
256
|
-
switch (status) {
|
|
257
|
-
case 'empty':
|
|
258
|
-
return React.createElement("div", { className: `${BLOCK_NAME}__empty` }, "\u6682\u65E0\u6570\u636E");
|
|
259
|
-
case 'fail':
|
|
260
|
-
return React.createElement("div", { className: `${BLOCK_NAME}__fail` }, "\u52A0\u8F7D\u5931\u8D25");
|
|
261
|
-
case 'loading':
|
|
262
|
-
return (pagination === 'pagination' && (React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__content-loading`) }, LoadingSymbol)));
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
/**
|
|
266
|
-
* 加载中状态组件
|
|
267
|
-
*/
|
|
268
|
-
const LoadingSymbol = (React.createElement("div", { className: `${BLOCK_NAME}__more-symbol` },
|
|
269
|
-
React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
|
|
270
|
-
React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` }),
|
|
271
|
-
React.createElement("div", { className: `${BLOCK_NAME}__symbol-item` })));
|
|
272
|
-
/**
|
|
273
|
-
* 加载到底状态组件
|
|
274
|
-
*/
|
|
275
|
-
const LoadEnd = React.createElement("div", null);
|
|
276
|
-
return (React.createElement("div", { ...rest, className: classNames('weda-ui', `${BLOCK_NAME}__containor`, className) },
|
|
277
|
-
children && (React.createElement("div", { className: classNames(template === 'cardList' ? `${BLOCK_NAME}-card` : '', `${BLOCK_NAME}__content`, ['empty', 'fail'].includes(status) && isSetStatus
|
|
278
|
-
? `${BLOCK_NAME}__content-blank`
|
|
279
|
-
: '') },
|
|
280
|
-
children,
|
|
281
|
-
isSetStatus && renderStatus())),
|
|
282
|
-
React.createElement("div", { className: classNames(`${BLOCK_NAME}__more`, `${BLOCK_NAME}__more-${pagination}`) },
|
|
283
|
-
pagination === 'bottomLoad' && renderBottomLoad(),
|
|
284
|
-
pagination === 'loadMoreButton' && renderLoadMore(),
|
|
285
|
-
pagination === 'pagination' && renderPagination())));
|
|
286
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* 数据容器公共属性
|
|
4
|
-
*/
|
|
5
|
-
export interface IDataContainer {
|
|
6
|
-
/**
|
|
7
|
-
* 数据源类型
|
|
8
|
-
*/
|
|
9
|
-
dataSourceType: 'data-model' | 'connector' | 'custom-connector';
|
|
10
|
-
/**
|
|
11
|
-
* 连接器
|
|
12
|
-
*/
|
|
13
|
-
bindConnectMetadata?: {
|
|
14
|
-
datasource: {
|
|
15
|
-
name?: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* 连接器方法
|
|
20
|
-
*/
|
|
21
|
-
connectorMethod?: {
|
|
22
|
-
name?: string;
|
|
23
|
-
inParams?: string[];
|
|
24
|
-
outParams?: string[];
|
|
25
|
-
title?: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 数据模型
|
|
29
|
-
*/
|
|
30
|
-
datasource?: {
|
|
31
|
-
name?: string;
|
|
32
|
-
extra?: {
|
|
33
|
-
viewId?: string;
|
|
34
|
-
methodName?: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* 连接器查询入参
|
|
39
|
-
*/
|
|
40
|
-
connectorParams?: object;
|
|
41
|
-
/**
|
|
42
|
-
* 数据筛选
|
|
43
|
-
*/
|
|
44
|
-
where?: {
|
|
45
|
-
groupLogic?: null | 'or' | 'and';
|
|
46
|
-
logicData?: {
|
|
47
|
-
keyType?: 'field' | 'var-font';
|
|
48
|
-
key: string;
|
|
49
|
-
rel: 'eq' | 'neq' | 'lt' | 'gt' | 'gte' | 'lte' | 'in' | 'nin' | 'search';
|
|
50
|
-
value: any;
|
|
51
|
-
valueType?: 'const' | 'var-font' | 'relative-amount' | 'field';
|
|
52
|
-
expression?: string | boolean;
|
|
53
|
-
logic?: null | 'or' | 'and' | string;
|
|
54
|
-
extra?: {
|
|
55
|
-
type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | string;
|
|
56
|
-
format?: string | null;
|
|
57
|
-
isExpression?: boolean;
|
|
58
|
-
};
|
|
59
|
-
}[];
|
|
60
|
-
}[];
|
|
61
|
-
/**
|
|
62
|
-
* 容器事件
|
|
63
|
-
*/
|
|
64
|
-
events?: {
|
|
65
|
-
queryEmpty?: any;
|
|
66
|
-
querySuccess?: any;
|
|
67
|
-
queryFail?: any;
|
|
68
|
-
onDataChange?: (param: any) => any;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* 类
|
|
72
|
-
*/
|
|
73
|
-
className?: string;
|
|
74
|
-
/**
|
|
75
|
-
* app.cloud 对象依赖,默认会从 window.app 取值
|
|
76
|
-
*/
|
|
77
|
-
appCloud?: {
|
|
78
|
-
callDataSource?: any;
|
|
79
|
-
isInIde?: any;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* 子元素
|
|
83
|
-
*/
|
|
84
|
-
children?: React.ReactNode | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* 其他属性
|
|
87
|
-
*/
|
|
88
|
-
[key: string]: any;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* 数据容器-列表视图
|
|
92
|
-
*/
|
|
93
|
-
export interface IListView extends IDataContainer {
|
|
94
|
-
/**
|
|
95
|
-
* 数据字段
|
|
96
|
-
*/
|
|
97
|
-
orderBy?: string;
|
|
98
|
-
/**
|
|
99
|
-
* 数据类型
|
|
100
|
-
*/
|
|
101
|
-
orderType?: 'desc' | 'asc';
|
|
102
|
-
/**
|
|
103
|
-
* 模板
|
|
104
|
-
*/
|
|
105
|
-
template?: 'simpleList' | 'detailList' | 'imageTextList' | 'cardList' | 'none';
|
|
106
|
-
/**
|
|
107
|
-
* 显示行数
|
|
108
|
-
*/
|
|
109
|
-
pageSize?: number;
|
|
110
|
-
/**
|
|
111
|
-
* 分页类型,加载更多|底部刷新|分页器
|
|
112
|
-
*/
|
|
113
|
-
pagination?: 'loadMoreButton' | 'bottomLoad' | 'pagination' | 'none';
|
|
114
|
-
/**
|
|
115
|
-
* 调用 onDataChange 之前的数据转换,如列表视图需要接受 array,而数据视图需要接受 object
|
|
116
|
-
*/
|
|
117
|
-
beforeDataChange?: (param: any) => any;
|
|
118
|
-
/**
|
|
119
|
-
* 是否展示回调recoreds字段
|
|
120
|
-
*/
|
|
121
|
-
isRecords?: boolean;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 查询状态
|
|
125
|
-
* 成功|失败|空|加载中|初始化
|
|
126
|
-
*/
|
|
127
|
-
export declare type IStatus = 'success' | 'fail' | 'empty' | 'loading' | '';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|