@oceanbase/ui 1.0.0-alpha.1 → 1.0.0-alpha.11
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/static/Inter-Medium.ea234620.woff2 +0 -0
- package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
- package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +122 -15
- package/es/Action/Item.d.ts +6 -15
- package/es/Action/Item.js +86 -128
- package/es/Action/index.d.ts +6 -3
- package/es/Action/index.js +1 -0
- package/es/Action/style/index.d.ts +2 -2
- package/es/Action/style/index.js +8 -4
- package/es/BackgroundTaskManager/RefreshMan.js +1 -0
- package/es/BackgroundTaskManager/index.js +1 -0
- package/es/BasicLayout/Header.js +1 -0
- package/es/BasicLayout/index.js +1 -0
- package/es/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/es/BasicLayout/locale/ja-JP.js +12 -0
- package/es/BasicLayout/style/index.js +35 -23
- package/es/BatchOperationBar/index.d.ts +0 -1
- package/es/BatchOperationBar/index.js +18 -13
- package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/es/BatchOperationBar/locale/ja-JP.js +6 -0
- package/es/BatchOperationBar/style/index.d.ts +10 -0
- package/es/BatchOperationBar/style/index.js +51 -0
- package/es/Boundary/Components/Code.js +12 -5
- package/es/Boundary/Components/Exception.js +86 -74
- package/es/Boundary/Components/Function.js +12 -5
- package/es/Boundary/index.d.ts +0 -1
- package/es/Boundary/index.js +1 -1
- package/es/Boundary/locale/en-US.js +1 -1
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/Boundary/locale/zh-CN.js +1 -1
- package/es/Boundary/locale/zh-TW.js +1 -1
- package/es/Boundary/style/index.d.ts +10 -0
- package/es/Boundary/style/index.js +46 -0
- package/es/ContentWithIcon/index.d.ts +0 -1
- package/es/ContentWithIcon/index.js +30 -29
- package/es/ContentWithIcon/style/index.d.ts +10 -0
- package/es/ContentWithIcon/style/index.js +26 -0
- package/es/ContentWithQuestion/index.js +1 -0
- package/es/DateRanger/PickerPanel.js +6 -4
- package/es/DateRanger/Ranger.d.ts +4 -1
- package/es/DateRanger/Ranger.js +169 -19
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.js +1 -0
- package/es/DateRanger/locale/ja-JP.d.ts +56 -0
- package/es/DateRanger/locale/ja-JP.js +20 -0
- package/es/DateRanger/style/index.d.ts +10 -0
- package/es/DateRanger/style/index.js +126 -0
- package/es/Dialog/Anchor.d.ts +2 -10
- package/es/Dialog/Anchor.js +68 -96
- package/es/Dialog/EventProxy.js +1 -0
- package/es/Dialog/index.d.ts +0 -1
- package/es/Dialog/index.js +538 -578
- package/es/Dialog/locale/ja-JP.d.ts +5 -0
- package/es/Dialog/locale/ja-JP.js +4 -0
- package/es/Dialog/locale/zh-CN.js +1 -1
- package/es/Dialog/locale/zh-TW.js +1 -1
- package/es/Dialog/style/index.d.ts +10 -0
- package/es/Dialog/style/index.js +97 -0
- package/es/DocDialog/index.js +1 -0
- package/es/DocDialog/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.js +1 -0
- package/es/FooterToolbar/index.js +1 -0
- package/es/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +7 -13
- package/es/FullscreenBox/index.d.ts +0 -1
- package/es/FullscreenBox/index.js +47 -37
- package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/es/FullscreenBox/locale/ja-JP.js +1 -0
- package/es/FullscreenBox/style/index.d.ts +10 -0
- package/es/FullscreenBox/style/index.js +53 -0
- package/es/Highlight/DiffView/DiffCells.js +1 -0
- package/es/Highlight/DiffView/index.d.ts +0 -1
- package/es/Highlight/DiffView/index.js +6 -5
- package/es/Highlight/HighlightCell.js +1 -0
- package/es/Highlight/JsonView.d.ts +0 -1
- package/es/Highlight/JsonView.js +6 -5
- package/es/Highlight/index.d.ts +0 -1
- package/es/Highlight/index.js +24 -23
- package/es/Highlight/locale/ja-JP.d.ts +4 -0
- package/es/Highlight/locale/ja-JP.js +3 -0
- package/es/Highlight/style/index.d.ts +10 -0
- package/es/Highlight/style/index.js +213 -0
- package/es/Highlight/useKeyDownCopyEvent.js +1 -0
- package/es/IconFont/index.js +1 -0
- package/es/LightFilter/index.js +1 -0
- package/es/LocaleDropdown/index.js +5 -2
- package/es/Login/ActivateForm.d.ts +0 -1
- package/es/Login/ActivateForm.js +13 -9
- package/es/Login/LoginForm.d.ts +0 -1
- package/es/Login/LoginForm.js +21 -15
- package/es/Login/RegisterForm.d.ts +0 -1
- package/es/Login/RegisterForm.js +15 -11
- package/es/Login/index.d.ts +0 -1
- package/es/Login/index.js +25 -22
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/Login/locale/zh-CN.js +2 -2
- package/es/Login/style/index.d.ts +10 -0
- package/es/Login/style/index.js +182 -0
- package/es/Lottie/index.js +1 -0
- package/es/NavMenu/index.d.ts +1 -2
- package/es/NavMenu/index.js +12 -8
- package/es/NavMenu/style/index.d.ts +10 -0
- package/es/NavMenu/style/index.js +47 -0
- package/es/PageContainer/ItemRender.js +1 -0
- package/es/PageContainer/index.d.ts +2 -0
- package/es/PageContainer/index.js +103 -25
- package/es/PageContainer/locale/en-US.d.ts +1 -0
- package/es/PageContainer/locale/en-US.js +2 -1
- package/es/PageContainer/locale/ja-JP.d.ts +5 -0
- package/es/PageContainer/locale/ja-JP.js +4 -0
- package/es/PageContainer/locale/zh-CN.d.ts +1 -0
- package/es/PageContainer/locale/zh-CN.js +2 -1
- package/es/PageContainer/locale/zh-TW.d.ts +1 -0
- package/es/PageContainer/locale/zh-TW.js +2 -1
- package/es/PageContainer/style/index.js +41 -16
- package/es/PageLoading/index.js +1 -0
- package/es/Password/Content.js +1 -0
- package/es/Password/index.js +2 -1
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/ProCard/index.js +12 -3
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +13 -5
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +21 -7
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +12 -5
- package/es/Ranger/QuickPicker.js +9 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +13 -9
- package/es/Ranger/index.js +1 -0
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/Ranger/style/index.d.ts +10 -0
- package/es/Ranger/style/index.js +44 -0
- package/es/SideTip/Dragger.js +1 -0
- package/es/SideTip/IconLoading.js +1 -0
- package/es/SideTip/index.d.ts +0 -1
- package/es/SideTip/index.js +25 -22
- package/es/SideTip/locale/ja-JP.d.ts +2 -0
- package/es/SideTip/locale/ja-JP.js +1 -0
- package/es/SideTip/style/index.d.ts +10 -0
- package/es/SideTip/style/index.js +162 -0
- package/es/TagSelect/Group.d.ts +6 -6
- package/es/TagSelect/Group.js +6 -3
- package/es/TagSelect/Item.js +6 -3
- package/es/TagSelect/index.js +1 -0
- package/es/TreeSearch/index.js +1 -0
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +31 -26
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/Welcome/step/style/index.d.ts +10 -0
- package/es/Welcome/step/style/index.js +44 -0
- package/es/Welcome/step.d.ts +0 -1
- package/es/Welcome/step.js +18 -14
- package/es/Welcome/style/index.d.ts +10 -0
- package/es/Welcome/style/index.js +141 -0
- package/es/_util/genComponentStyleHook.d.ts +4 -3
- package/es/_util/genComponentStyleHook.js +1 -1
- package/es/_util/index.js +1 -0
- package/es/constant/index.js +1 -0
- package/es/index.d.ts +0 -5
- package/es/index.js +1 -3
- package/es/locale/LocaleWrapper.js +1 -0
- package/es/locale/en-US.js +0 -4
- package/es/locale/index.js +1 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +38 -0
- package/es/locale/zh-CN.js +0 -4
- package/es/locale/zh-TW.js +0 -4
- package/lib/Action/Group.js +211 -108
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +81 -109
- package/lib/Action/index.d.ts +6 -3
- package/lib/Action/index.js +13 -35
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/Action/style/index.js +38 -41
- package/lib/BackgroundTaskManager/RefreshMan.js +34 -59
- package/lib/BackgroundTaskManager/constants.js +10 -32
- package/lib/BackgroundTaskManager/index.js +118 -135
- package/lib/BasicLayout/Header.js +238 -138
- package/lib/BasicLayout/index.js +264 -283
- package/lib/BasicLayout/locale/en-US.js +16 -34
- package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/lib/BasicLayout/locale/ja-JP.js +18 -0
- package/lib/BasicLayout/locale/zh-CN.js +16 -34
- package/lib/BasicLayout/locale/zh-TW.js +16 -34
- package/lib/BasicLayout/style/Header.js +41 -60
- package/lib/BasicLayout/style/index.js +192 -204
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +108 -131
- package/lib/BatchOperationBar/locale/en-US.js +10 -28
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +12 -0
- package/lib/BatchOperationBar/locale/zh-CN.js +10 -28
- package/lib/BatchOperationBar/locale/zh-TW.js +10 -28
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +66 -0
- package/lib/Boundary/Components/Code.js +57 -63
- package/lib/Boundary/Components/Exception.js +117 -116
- package/lib/Boundary/Components/Function.js +47 -50
- package/lib/Boundary/Components/index.js +36 -25
- package/lib/Boundary/IBoundary.js +4 -16
- package/lib/Boundary/constant.js +16 -38
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +11 -25
- package/lib/Boundary/locale/en-US.js +14 -32
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +16 -0
- package/lib/Boundary/locale/zh-CN.js +14 -32
- package/lib/Boundary/locale/zh-TW.js +14 -32
- package/lib/Boundary/style/index.d.ts +10 -0
- package/lib/Boundary/style/index.js +55 -0
- package/lib/Boundary/utils.js +9 -31
- package/lib/ContentWithIcon/index.d.ts +0 -1
- package/lib/ContentWithIcon/index.js +99 -101
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +38 -0
- package/lib/ContentWithQuestion/index.js +40 -47
- package/lib/ContentWithQuestion/style/index.js +16 -35
- package/lib/DateRanger/PickerPanel.js +322 -286
- package/lib/DateRanger/Ranger.d.ts +4 -1
- package/lib/DateRanger/Ranger.js +381 -292
- package/lib/DateRanger/constant/index.js +188 -376
- package/lib/DateRanger/index.js +45 -64
- package/lib/DateRanger/locale/en-US.js +20 -47
- package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +22 -0
- package/lib/DateRanger/locale/zh-CN.js +20 -47
- package/lib/DateRanger/locale/zh-TW.js +20 -47
- package/lib/DateRanger/style/index.d.ts +10 -0
- package/lib/DateRanger/style/index.js +174 -0
- package/lib/DateRanger/typing.js +4 -16
- package/lib/Dialog/Anchor.d.ts +2 -10
- package/lib/Dialog/Anchor.js +80 -104
- package/lib/Dialog/Dock.js +14 -36
- package/lib/Dialog/EventProxy.js +21 -48
- package/lib/Dialog/index.d.ts +0 -1
- package/lib/Dialog/index.js +526 -521
- package/lib/Dialog/locale/en-US.js +8 -26
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/Dialog/locale/ja-JP.js +10 -0
- package/lib/Dialog/locale/zh-CN.js +8 -26
- package/lib/Dialog/locale/zh-TW.js +8 -26
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +117 -0
- package/lib/DocDialog/index.js +51 -76
- package/lib/DocDialog/locale/en-US.js +5 -23
- package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
- package/lib/DocDialog/locale/ja-JP.js +7 -0
- package/lib/DocDialog/locale/zh-CN.js +5 -23
- package/lib/DocDialog/locale/zh-TW.js +5 -23
- package/lib/FooterToolbar/index.js +27 -44
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +26 -52
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +151 -120
- package/lib/FullscreenBox/locale/en-US.js +5 -23
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +7 -0
- package/lib/FullscreenBox/locale/zh-CN.js +5 -23
- package/lib/FullscreenBox/locale/zh-TW.js +5 -23
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +68 -0
- package/lib/Highlight/DiffView/DiffCells.js +35 -48
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +154 -148
- package/lib/Highlight/HighlightCell.js +29 -45
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +45 -73
- package/lib/Highlight/index.d.ts +0 -1
- package/lib/Highlight/index.js +197 -203
- package/lib/Highlight/languages/bash.js +7 -34
- package/lib/Highlight/languages/cpp.js +7 -34
- package/lib/Highlight/languages/css.js +7 -34
- package/lib/Highlight/languages/dockerfile.js +7 -34
- package/lib/Highlight/languages/go.js +7 -34
- package/lib/Highlight/languages/groovy.js +7 -34
- package/lib/Highlight/languages/http.js +7 -34
- package/lib/Highlight/languages/java.js +7 -34
- package/lib/Highlight/languages/javascript.js +7 -34
- package/lib/Highlight/languages/json.js +7 -34
- package/lib/Highlight/languages/markdown.js +7 -34
- package/lib/Highlight/languages/nginx.js +7 -34
- package/lib/Highlight/languages/python.js +7 -34
- package/lib/Highlight/languages/ruby.js +7 -34
- package/lib/Highlight/languages/solidity.js +7 -34
- package/lib/Highlight/languages/sql.js +7 -34
- package/lib/Highlight/languages/typescript.js +7 -34
- package/lib/Highlight/languages/xml.js +7 -34
- package/lib/Highlight/languages/yaml.js +7 -34
- package/lib/Highlight/locale/en-US.js +7 -25
- package/lib/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/Highlight/locale/ja-JP.js +9 -0
- package/lib/Highlight/locale/zh-CN.js +7 -25
- package/lib/Highlight/locale/zh-TW.js +7 -25
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +277 -0
- package/lib/Highlight/useKeyDownCopyEvent.js +40 -64
- package/lib/IconFont/index.js +23 -38
- package/lib/LightFilter/index.js +29 -42
- package/lib/LightFilter/style/index.js +15 -33
- package/lib/LocaleDropdown/index.js +44 -60
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +93 -118
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +135 -149
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +122 -162
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +156 -132
- package/lib/Login/locale/en-US.js +31 -49
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +33 -0
- package/lib/Login/locale/zh-CN.js +31 -49
- package/lib/Login/locale/zh-TW.js +30 -48
- package/lib/Login/style/index.d.ts +10 -0
- package/lib/Login/style/index.js +246 -0
- package/lib/Lottie/index.js +7 -24
- package/lib/NavMenu/index.d.ts +1 -2
- package/lib/NavMenu/index.js +102 -101
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +60 -0
- package/lib/PageContainer/ItemRender.js +27 -45
- package/lib/PageContainer/index.d.ts +2 -0
- package/lib/PageContainer/index.js +154 -93
- package/lib/PageContainer/locale/en-US.d.ts +1 -0
- package/lib/PageContainer/locale/en-US.js +8 -25
- package/lib/PageContainer/locale/ja-JP.d.ts +5 -0
- package/lib/PageContainer/locale/ja-JP.js +10 -0
- package/lib/PageContainer/locale/zh-CN.d.ts +1 -0
- package/lib/PageContainer/locale/zh-CN.js +8 -25
- package/lib/PageContainer/locale/zh-TW.d.ts +1 -0
- package/lib/PageContainer/locale/zh-TW.js +8 -25
- package/lib/PageContainer/style/index.js +59 -49
- package/lib/PageLoading/index.js +32 -63
- package/lib/Password/Content.js +91 -83
- package/lib/Password/index.js +118 -138
- package/lib/Password/locale/en-US.js +14 -32
- package/lib/Password/locale/ja-JP.d.ts +13 -0
- package/lib/Password/locale/ja-JP.js +18 -0
- package/lib/Password/locale/zh-CN.js +15 -33
- package/lib/Password/locale/zh-TW.js +14 -32
- package/lib/ProCard/index.js +78 -96
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +35 -38
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +103 -112
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +36 -37
- package/lib/Ranger/QuickPicker.js +91 -82
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +98 -127
- package/lib/Ranger/constant/index.js +115 -266
- package/lib/Ranger/index.js +61 -69
- package/lib/Ranger/locale/en-US.js +31 -49
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +35 -0
- package/lib/Ranger/locale/zh-CN.js +7 -25
- package/lib/Ranger/locale/zh-TW.js +7 -25
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +64 -0
- package/lib/Ranger/typing.js +4 -16
- package/lib/SideTip/Dragger.js +259 -218
- package/lib/SideTip/IconLoading.js +43 -74
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +129 -114
- package/lib/SideTip/locale/en-US.js +5 -23
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +7 -0
- package/lib/SideTip/locale/zh-CN.js +5 -23
- package/lib/SideTip/locale/zh-TW.js +5 -23
- package/lib/SideTip/style/index.d.ts +10 -0
- package/lib/SideTip/style/index.js +195 -0
- package/lib/SideTip/utils.js +40 -61
- package/lib/TagSelect/Group.d.ts +6 -6
- package/lib/TagSelect/Group.js +64 -78
- package/lib/TagSelect/Item.js +67 -85
- package/lib/TagSelect/TagSelectContext.js +7 -25
- package/lib/TagSelect/index.js +12 -35
- package/lib/TagSelect/style/index.js +41 -64
- package/lib/TreeSearch/index.js +133 -132
- package/lib/TreeSearch/util.js +52 -70
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +140 -83
- package/lib/Welcome/locale/en-US.js +8 -26
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +10 -0
- package/lib/Welcome/locale/zh-CN.js +8 -26
- package/lib/Welcome/locale/zh-TW.js +8 -26
- package/lib/Welcome/step/style/index.d.ts +10 -0
- package/lib/Welcome/step/style/index.js +58 -0
- package/lib/Welcome/step.d.ts +0 -1
- package/lib/Welcome/step.js +63 -48
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +176 -0
- package/lib/_util/genComponentStyleHook.d.ts +4 -3
- package/lib/_util/genComponentStyleHook.js +15 -43
- package/lib/_util/index.js +38 -43
- package/lib/_util/useNavigate.js +11 -26
- package/lib/constant/index.js +23 -49
- package/lib/index.d.ts +0 -5
- package/lib/index.js +283 -136
- package/lib/interface.js +4 -16
- package/lib/locale/LocaleWrapper.js +52 -61
- package/lib/locale/en-US.js +37 -68
- package/lib/locale/index.js +5 -16
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +40 -0
- package/lib/locale/zh-CN.js +36 -67
- package/lib/locale/zh-TW.js +32 -63
- package/package.json +7 -10
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/BatchOperationBar/index.less +0 -46
- package/es/BatchOperationBar/index.less.d.ts +0 -15
- package/es/Boundary/index.less +0 -36
- package/es/ContentWithIcon/index.less +0 -21
- package/es/DateRanger/index.less +0 -157
- package/es/Dialog/index.less +0 -116
- package/es/FullscreenBox/index.less +0 -49
- package/es/GraphToolbar/index.d.ts +0 -26
- package/es/GraphToolbar/index.js +0 -146
- package/es/GraphToolbar/index.less +0 -65
- package/es/GraphToolbar/locale/en-US.d.ts +0 -9
- package/es/GraphToolbar/locale/en-US.js +0 -8
- package/es/GraphToolbar/locale/zh-CN.d.ts +0 -9
- package/es/GraphToolbar/locale/zh-CN.js +0 -8
- package/es/GraphToolbar/locale/zh-TW.d.ts +0 -9
- package/es/GraphToolbar/locale/zh-TW.js +0 -8
- package/es/Highlight/index.less +0 -381
- package/es/Login/index.less +0 -268
- package/es/NavMenu/index.less +0 -50
- package/es/Ranger/index.less +0 -57
- package/es/SideTip/index.less +0 -180
- package/es/TaskGraph/Graph.d.ts +0 -24
- package/es/TaskGraph/Graph.js +0 -271
- package/es/TaskGraph/graph.less +0 -23
- package/es/TaskGraph/index.d.ts +0 -16
- package/es/TaskGraph/index.js +0 -178
- package/es/TaskGraph/index.less +0 -117
- package/es/TaskGraph/locale/en-US.d.ts +0 -13
- package/es/TaskGraph/locale/en-US.js +0 -12
- package/es/TaskGraph/locale/zh-CN.d.ts +0 -13
- package/es/TaskGraph/locale/zh-CN.js +0 -12
- package/es/TaskGraph/locale/zh-TW.d.ts +0 -13
- package/es/TaskGraph/locale/zh-TW.js +0 -12
- package/es/TaskGraph/register.d.ts +0 -7
- package/es/TaskGraph/register.js +0 -200
- package/es/Welcome/index.less +0 -185
- package/es/index.less +0 -1
- package/es/variable.less +0 -54
- package/lib/BatchOperationBar/index.less +0 -46
- package/lib/BatchOperationBar/index.less.d.ts +0 -15
- package/lib/Boundary/index.less +0 -36
- package/lib/ContentWithIcon/index.less +0 -21
- package/lib/DateRanger/index.less +0 -157
- package/lib/Dialog/index.less +0 -116
- package/lib/FullscreenBox/index.less +0 -49
- package/lib/GraphToolbar/index.d.ts +0 -26
- package/lib/GraphToolbar/index.js +0 -154
- package/lib/GraphToolbar/index.less +0 -65
- package/lib/GraphToolbar/locale/en-US.d.ts +0 -9
- package/lib/GraphToolbar/locale/en-US.js +0 -32
- package/lib/GraphToolbar/locale/zh-CN.d.ts +0 -9
- package/lib/GraphToolbar/locale/zh-CN.js +0 -32
- package/lib/GraphToolbar/locale/zh-TW.d.ts +0 -9
- package/lib/GraphToolbar/locale/zh-TW.js +0 -32
- package/lib/Highlight/index.less +0 -381
- package/lib/Login/index.less +0 -268
- package/lib/NavMenu/index.less +0 -50
- package/lib/Ranger/index.less +0 -57
- package/lib/SideTip/index.less +0 -180
- package/lib/TaskGraph/Graph.d.ts +0 -24
- package/lib/TaskGraph/Graph.js +0 -261
- package/lib/TaskGraph/graph.less +0 -23
- package/lib/TaskGraph/index.d.ts +0 -16
- package/lib/TaskGraph/index.js +0 -164
- package/lib/TaskGraph/index.less +0 -117
- package/lib/TaskGraph/locale/en-US.d.ts +0 -13
- package/lib/TaskGraph/locale/en-US.js +0 -36
- package/lib/TaskGraph/locale/zh-CN.d.ts +0 -13
- package/lib/TaskGraph/locale/zh-CN.js +0 -36
- package/lib/TaskGraph/locale/zh-TW.d.ts +0 -13
- package/lib/TaskGraph/locale/zh-TW.js +0 -36
- package/lib/TaskGraph/register.d.ts +0 -7
- package/lib/TaskGraph/register.js +0 -205
- package/lib/Welcome/index.less +0 -185
- package/lib/index.less +0 -1
- package/lib/variable.less +0 -54
package/es/Dialog/index.js
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
"use client";
|
|
17
14
|
import { CloseOutlined, ExpandAltOutlined, FullscreenExitOutlined, FullscreenOutlined, MinusOutlined } from '@oceanbase/icons';
|
|
18
|
-
import React from 'react';
|
|
15
|
+
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
|
+
import { ConfigProvider } from '@oceanbase/design';
|
|
19
17
|
import { createPortal } from 'react-dom';
|
|
20
18
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
21
|
-
import { getPrefix } from "../_util";
|
|
22
19
|
import { Anchor } from "./Anchor";
|
|
23
20
|
import { Dock } from "./Dock";
|
|
24
21
|
import { EventProxy } from "./EventProxy";
|
|
25
22
|
import zhCN from "./locale/zh-CN";
|
|
26
|
-
import "./
|
|
23
|
+
import useStyle from "./style";
|
|
27
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
var prefix = getPrefix('dialog');
|
|
30
26
|
var DEFAULT_LEFT = 0.1;
|
|
31
27
|
var DEFAULT_TOP = 0.1;
|
|
32
28
|
var MINIMIZE_HEIGHT = 36;
|
|
@@ -37,598 +33,562 @@ var DEFAULT_HEIGHT_MEMBER = 600;
|
|
|
37
33
|
var DEFAULT_BORDER_WIDTH = 24;
|
|
38
34
|
// 预留滚动条宽度
|
|
39
35
|
var SCROLL_BAR_WIDTH = 1;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
// Static container for portal
|
|
37
|
+
var _container = null;
|
|
38
|
+
var getContainer = function getContainer() {
|
|
39
|
+
if (!_container) {
|
|
40
|
+
_container = document.createElement('div');
|
|
41
|
+
document.body.appendChild(_container);
|
|
42
|
+
}
|
|
43
|
+
return _container;
|
|
44
|
+
};
|
|
45
|
+
var DialogComp = function DialogComp(props) {
|
|
46
|
+
var className = props.className,
|
|
47
|
+
visible = props.visible,
|
|
48
|
+
children = props.children,
|
|
49
|
+
_props$min = props.min,
|
|
50
|
+
min = _props$min === void 0 ? DEFAULT_MIN : _props$min,
|
|
51
|
+
max = props.max,
|
|
52
|
+
width = props.width,
|
|
53
|
+
height = props.height,
|
|
54
|
+
left = props.left,
|
|
55
|
+
top = props.top,
|
|
56
|
+
title = props.title,
|
|
57
|
+
onClose = props.onClose,
|
|
58
|
+
clientWidth = props.clientWidth,
|
|
59
|
+
clientHeight = props.clientHeight,
|
|
60
|
+
_props$resizable = props.resizable,
|
|
61
|
+
resizable = _props$resizable === void 0 ? true : _props$resizable,
|
|
62
|
+
_props$draggable = props.draggable,
|
|
63
|
+
draggable = _props$draggable === void 0 ? true : _props$draggable,
|
|
64
|
+
_props$enableMaximiza = props.enableMaximization,
|
|
65
|
+
enableMaximization = _props$enableMaximiza === void 0 ? true : _props$enableMaximiza,
|
|
66
|
+
locale = props.locale,
|
|
67
|
+
extLink = props.extLink,
|
|
68
|
+
setRootWidth = props.setRootWidth,
|
|
69
|
+
_props$isEmbed = props.isEmbed,
|
|
70
|
+
isEmbed = _props$isEmbed === void 0 ? false : _props$isEmbed;
|
|
71
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
72
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
73
|
+
var prefixCls = getPrefixCls('dialog');
|
|
74
|
+
var _useStyle = useStyle(prefixCls),
|
|
75
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
76
|
+
|
|
77
|
+
// Refs for instance properties
|
|
78
|
+
var hostRef = useRef(null);
|
|
79
|
+
var clientXRef = useRef(0);
|
|
80
|
+
var clientYRef = useRef(0);
|
|
81
|
+
var isPointDownRef = useRef(false);
|
|
82
|
+
var originInfoRef = useRef({});
|
|
83
|
+
|
|
84
|
+
// State
|
|
85
|
+
var _useState = useState(true),
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
mask = _useState2[0],
|
|
88
|
+
setMask = _useState2[1];
|
|
89
|
+
var _useState3 = useState(width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER),
|
|
90
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
91
|
+
dialogWidth = _useState4[0],
|
|
92
|
+
setDialogWidth = _useState4[1];
|
|
93
|
+
var _useState5 = useState(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER),
|
|
94
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
95
|
+
dialogHeight = _useState6[0],
|
|
96
|
+
setDialogHeight = _useState6[1];
|
|
97
|
+
var _useState7 = useState(left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH),
|
|
98
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
99
|
+
dialogLeft = _useState8[0],
|
|
100
|
+
setDialogLeft = _useState8[1];
|
|
101
|
+
var _useState9 = useState(top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH),
|
|
102
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
103
|
+
dialogTop = _useState10[0],
|
|
104
|
+
setDialogTop = _useState10[1];
|
|
105
|
+
var _useState11 = useState(0),
|
|
106
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
107
|
+
moveX = _useState12[0],
|
|
108
|
+
setMoveX = _useState12[1];
|
|
109
|
+
var _useState13 = useState(0),
|
|
110
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
111
|
+
moveY = _useState14[0],
|
|
112
|
+
setMoveY = _useState14[1];
|
|
113
|
+
var _useState15 = useState(isEmbed),
|
|
114
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
115
|
+
maximization = _useState16[0],
|
|
116
|
+
setMaximization = _useState16[1];
|
|
117
|
+
var _useState17 = useState(false),
|
|
118
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
119
|
+
minimize = _useState18[0],
|
|
120
|
+
setMinimize = _useState18[1];
|
|
121
|
+
var _useState19 = useState({}),
|
|
122
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
123
|
+
headerStyle = _useState20[0],
|
|
124
|
+
setHeaderStyle = _useState20[1];
|
|
125
|
+
|
|
126
|
+
// Computed values
|
|
127
|
+
var maxSize = useMemo(function () {
|
|
128
|
+
if (max) return max;
|
|
129
|
+
return [clientWidth, clientHeight];
|
|
130
|
+
}, [max, clientWidth, clientHeight]);
|
|
131
|
+
var minSize = useMemo(function () {
|
|
132
|
+
return min;
|
|
133
|
+
}, [min]);
|
|
134
|
+
var getDefaultEmbedState = useCallback(function () {
|
|
135
|
+
return {
|
|
136
|
+
width: width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER,
|
|
137
|
+
height: height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER,
|
|
138
|
+
left: left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
|
|
139
|
+
top: top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
|
|
140
|
+
};
|
|
141
|
+
}, [width, height, left, top, clientWidth, clientHeight]);
|
|
142
|
+
var setRootWidthInEmbedMode = useCallback(function (newWidth) {
|
|
143
|
+
var restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
|
|
144
|
+
var rootWidth = (clientWidth - restWidth) / clientWidth;
|
|
145
|
+
setRootWidth === null || setRootWidth === void 0 || setRootWidth("".concat(rootWidth * 100, "%"));
|
|
146
|
+
}, [clientWidth, setRootWidth]);
|
|
147
|
+
var compatClonedModel = useCallback(function (model) {
|
|
148
|
+
return _objectSpread({
|
|
149
|
+
left: DEFAULT_LEFT,
|
|
150
|
+
top: DEFAULT_TOP,
|
|
151
|
+
width: DEFAULT_WIDTH_MEMBER / clientWidth,
|
|
152
|
+
height: DEFAULT_HEIGHT_MEMBER / clientHeight,
|
|
60
153
|
minimize: false,
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "onDragMove", function (event) {
|
|
98
|
-
if (!_this.props.draggable || !_this.isPointDown) return;
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
_this.setState({
|
|
101
|
-
moveX: event.clientX - _this.clientX,
|
|
102
|
-
moveY: event.clientY - _this.clientY
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
_defineProperty(_assertThisInitialized(_this), "onDragEnd", function () {
|
|
106
|
-
var draggable = _this.props.draggable;
|
|
107
|
-
if (!draggable) return;
|
|
108
|
-
_this.isPointDown = false;
|
|
109
|
-
if (_this.state.moveX === 0 && _this.state.moveY === 0) return;
|
|
110
|
-
_this.setState({
|
|
111
|
-
mask: false,
|
|
112
|
-
left: _this.state.left + _this.state.moveX,
|
|
113
|
-
top: _this.state.top + _this.state.moveY,
|
|
114
|
-
moveX: 0,
|
|
115
|
-
moveY: 0
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
_defineProperty(_assertThisInitialized(_this), "toggleMinimize", function () {
|
|
119
|
-
_this.setState({
|
|
120
|
-
maximization: false,
|
|
121
|
-
minimize: !_this.state.minimize
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
_defineProperty(_assertThisInitialized(_this), "toggleMaximization", function () {
|
|
125
|
-
// 嵌入模式不支持toggleMaximization
|
|
126
|
-
var enable = _this.props.resizable && _this.props.enableMaximization && !_this.props.isEmbed;
|
|
127
|
-
if (!enable) return;
|
|
128
|
-
_this.setState({
|
|
129
|
-
maximization: !_this.state.maximization,
|
|
130
|
-
minimize: false
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
_defineProperty(_assertThisInitialized(_this), "onClose", function (event) {
|
|
134
|
-
var _this$props$onClose, _this$props2;
|
|
135
|
-
event.stopPropagation();
|
|
136
|
-
(_this$props$onClose = (_this$props2 = _this.props).onClose) === null || _this$props$onClose === void 0 || _this$props$onClose.call(_this$props2);
|
|
137
|
-
});
|
|
138
|
-
_defineProperty(_assertThisInitialized(_this), "getBaseStyle", function () {
|
|
139
|
-
var visible = _this.props.visible;
|
|
140
|
-
// 通过样式控制显隐
|
|
141
|
-
var baseStyle = {
|
|
142
|
-
visibility: visible ? 'visible' : 'hidden',
|
|
143
|
-
opacity: visible ? 1 : 0
|
|
144
|
-
};
|
|
145
|
-
return baseStyle;
|
|
146
|
-
});
|
|
147
|
-
_defineProperty(_assertThisInitialized(_this), "getStyle", function () {
|
|
148
|
-
var _this$state = _this.state,
|
|
149
|
-
maximization = _this$state.maximization,
|
|
150
|
-
minimize = _this$state.minimize,
|
|
151
|
-
headerStyle = _this$state.headerStyle;
|
|
152
|
-
var transform = "translate(".concat(_this.state.moveX, "px, ").concat(_this.state.moveY, "px)");
|
|
153
|
-
var baseStyle = _this.getBaseStyle();
|
|
154
|
-
if (maximization && !_this.props.isEmbed) {
|
|
155
|
-
return _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
156
|
-
top: 0,
|
|
157
|
-
bottom: 0,
|
|
158
|
-
right: 0,
|
|
159
|
-
width: _this.props.width || DEFAULT_WIDTH_MEMBER,
|
|
160
|
-
height: 'auto',
|
|
161
|
-
borderRadius: 0
|
|
162
|
-
});
|
|
163
|
-
} else if (minimize) {
|
|
164
|
-
var _ref = headerStyle,
|
|
165
|
-
height = _ref.height;
|
|
166
|
-
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
|
|
167
|
-
width: MINIMIZE_WIDTH,
|
|
168
|
-
height: height || MINIMIZE_HEIGHT,
|
|
169
|
-
transform: transform
|
|
170
|
-
});
|
|
171
|
-
} else {
|
|
172
|
-
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
|
|
173
|
-
transform: transform
|
|
174
|
-
});
|
|
154
|
+
maximization: false
|
|
155
|
+
}, model);
|
|
156
|
+
}, [clientWidth, clientHeight]);
|
|
157
|
+
var checkSize = function checkSize(w, h) {
|
|
158
|
+
var newModel = {};
|
|
159
|
+
var result = {
|
|
160
|
+
widthShouldChange: true,
|
|
161
|
+
heightShouldChange: true
|
|
162
|
+
};
|
|
163
|
+
if (minSize && w < minSize[0]) {
|
|
164
|
+
newModel.width = minSize[0];
|
|
165
|
+
result.widthShouldChange = false;
|
|
166
|
+
}
|
|
167
|
+
if (minSize && h < minSize[1]) {
|
|
168
|
+
newModel.height = minSize[1];
|
|
169
|
+
result.heightShouldChange = false;
|
|
170
|
+
}
|
|
171
|
+
if (maxSize && w > maxSize[0]) {
|
|
172
|
+
newModel.width = maxSize[0];
|
|
173
|
+
result.widthShouldChange = false;
|
|
174
|
+
}
|
|
175
|
+
if (maxSize && h > maxSize[1]) {
|
|
176
|
+
newModel.height = maxSize[1];
|
|
177
|
+
result.heightShouldChange = false;
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// componentDidMount
|
|
183
|
+
useEffect(function () {
|
|
184
|
+
var host = document.createElement('div');
|
|
185
|
+
hostRef.current = host;
|
|
186
|
+
getContainer().appendChild(host);
|
|
187
|
+
return function () {
|
|
188
|
+
if (hostRef.current && getContainer().contains(hostRef.current)) {
|
|
189
|
+
getContainer().removeChild(hostRef.current);
|
|
175
190
|
}
|
|
191
|
+
};
|
|
192
|
+
}, []);
|
|
193
|
+
|
|
194
|
+
// componentDidUpdate
|
|
195
|
+
useEffect(function () {
|
|
196
|
+
if (!visible) {
|
|
197
|
+
setRootWidthInEmbedMode(0);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
var tempState = getDefaultEmbedState();
|
|
201
|
+
setDialogWidth(tempState.width);
|
|
202
|
+
setDialogHeight(tempState.height);
|
|
203
|
+
setDialogLeft(tempState.left);
|
|
204
|
+
setDialogTop(tempState.top);
|
|
205
|
+
setRootWidthInEmbedMode(tempState.width);
|
|
206
|
+
}, [visible, clientWidth, clientHeight, getDefaultEmbedState, setRootWidthInEmbedMode]);
|
|
207
|
+
useEffect(function () {
|
|
208
|
+
if (isEmbed) {
|
|
209
|
+
setMinimize(false);
|
|
210
|
+
setMaximization(true);
|
|
211
|
+
} else {
|
|
212
|
+
setMinimize(false);
|
|
213
|
+
setMaximization(false);
|
|
214
|
+
if (height) setDialogHeight(height);
|
|
215
|
+
if (width) setDialogWidth(width);
|
|
216
|
+
if (top !== undefined) setDialogTop(top);
|
|
217
|
+
if (left !== undefined) setDialogLeft(left);
|
|
218
|
+
}
|
|
219
|
+
}, [isEmbed, height, width, top, left]);
|
|
220
|
+
|
|
221
|
+
// Drag handlers
|
|
222
|
+
var onDragStart = function onDragStart(event) {
|
|
223
|
+
if (!draggable) return;
|
|
224
|
+
if (maximization) return;
|
|
225
|
+
setMask(true);
|
|
226
|
+
if (dialogLeft === undefined) {
|
|
227
|
+
setDialogLeft(DEFAULT_LEFT);
|
|
228
|
+
}
|
|
229
|
+
if (dialogTop === undefined) {
|
|
230
|
+
setDialogTop(DEFAULT_TOP);
|
|
231
|
+
}
|
|
232
|
+
clientXRef.current = event.clientX;
|
|
233
|
+
clientYRef.current = event.clientY;
|
|
234
|
+
isPointDownRef.current = true;
|
|
235
|
+
};
|
|
236
|
+
var onDragMove = function onDragMove(event) {
|
|
237
|
+
if (!draggable || !isPointDownRef.current) return;
|
|
238
|
+
event.preventDefault();
|
|
239
|
+
setMoveX(event.clientX - clientXRef.current);
|
|
240
|
+
setMoveY(event.clientY - clientYRef.current);
|
|
241
|
+
};
|
|
242
|
+
var onDragEnd = function onDragEnd() {
|
|
243
|
+
if (!draggable) return;
|
|
244
|
+
isPointDownRef.current = false;
|
|
245
|
+
if (moveX === 0 && moveY === 0) return;
|
|
246
|
+
setMask(false);
|
|
247
|
+
setDialogLeft(function (prev) {
|
|
248
|
+
return (prev !== null && prev !== void 0 ? prev : 0) + moveX;
|
|
176
249
|
});
|
|
177
|
-
|
|
178
|
-
return
|
|
179
|
-
left: DEFAULT_LEFT,
|
|
180
|
-
top: DEFAULT_TOP,
|
|
181
|
-
width: DEFAULT_WIDTH_MEMBER / _this.props.clientWidth,
|
|
182
|
-
height: DEFAULT_HEIGHT_MEMBER / _this.props.clientHeight,
|
|
183
|
-
minimize: false,
|
|
184
|
-
maximization: false
|
|
185
|
-
}, model);
|
|
186
|
-
});
|
|
187
|
-
_defineProperty(_assertThisInitialized(_this), "detectPointUp", function () {
|
|
188
|
-
_this.setState({
|
|
189
|
-
mask: false
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
_defineProperty(_assertThisInitialized(_this), "originInfo", void 0);
|
|
193
|
-
_defineProperty(_assertThisInitialized(_this), "setRootWidthInEmbedMode", function (newWidth) {
|
|
194
|
-
var setRootWidth = _this.props.setRootWidth;
|
|
195
|
-
var restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
|
|
196
|
-
var rootWidth = (_this.props.clientWidth - restWidth) / _this.props.clientWidth;
|
|
197
|
-
setRootWidth === null || setRootWidth === void 0 || setRootWidth("".concat(rootWidth * 100, "%"));
|
|
250
|
+
setDialogTop(function (prev) {
|
|
251
|
+
return (prev !== null && prev !== void 0 ? prev : 0) + moveY;
|
|
198
252
|
});
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
253
|
+
setMoveX(0);
|
|
254
|
+
setMoveY(0);
|
|
255
|
+
};
|
|
256
|
+
var detectPointUp = function detectPointUp() {
|
|
257
|
+
setMask(false);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// Resize handlers
|
|
261
|
+
var onResizeStart = function onResizeStart() {
|
|
262
|
+
if (minimize || !resizable) return;
|
|
263
|
+
originInfoRef.current = compatClonedModel({
|
|
264
|
+
width: dialogWidth,
|
|
265
|
+
height: dialogHeight,
|
|
266
|
+
left: dialogLeft,
|
|
267
|
+
top: dialogTop,
|
|
268
|
+
minimize: minimize,
|
|
269
|
+
maximization: maximization
|
|
205
270
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
271
|
+
setMask(true);
|
|
272
|
+
};
|
|
273
|
+
var onResizeMove = function onResizeMove(event) {
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
if (minimize || !resizable) return;
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
var newWidth = originInfoRef.current.width + event.moveRight;
|
|
278
|
+
// @ts-ignore
|
|
279
|
+
var newHeight = originInfoRef.current.height + event.moveBottom;
|
|
280
|
+
var checkResult = checkSize(newWidth, newHeight);
|
|
281
|
+
if (checkResult.widthShouldChange) {
|
|
282
|
+
setRootWidthInEmbedMode(newWidth);
|
|
283
|
+
}
|
|
284
|
+
if (checkResult.widthShouldChange) {
|
|
211
285
|
// @ts-ignore
|
|
212
|
-
|
|
286
|
+
setDialogLeft(originInfoRef.current.left + event.moveLeft);
|
|
287
|
+
setDialogWidth(newWidth);
|
|
288
|
+
}
|
|
289
|
+
if (checkResult.heightShouldChange) {
|
|
213
290
|
// @ts-ignore
|
|
214
|
-
|
|
215
|
-
|
|
291
|
+
setDialogTop(originInfoRef.current.top + event.moveTop);
|
|
292
|
+
setDialogHeight(newHeight);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var onResizeEnd = function onResizeEnd() {
|
|
296
|
+
if (!mask || !resizable) return;
|
|
297
|
+
setMask(false);
|
|
298
|
+
};
|
|
216
299
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// @ts-ignore
|
|
223
|
-
left: _this.originInfo.left + event.moveLeft,
|
|
224
|
-
width: newWidth
|
|
225
|
-
} : {}), checkResult.heightShouldChange ? {
|
|
226
|
-
// @ts-ignore
|
|
227
|
-
top: _this.originInfo.top + event.moveTop,
|
|
228
|
-
height: newHeight
|
|
229
|
-
} : {}));
|
|
300
|
+
// Toggle handlers
|
|
301
|
+
var toggleMinimize = function toggleMinimize() {
|
|
302
|
+
setMaximization(false);
|
|
303
|
+
setMinimize(function (prev) {
|
|
304
|
+
return !prev;
|
|
230
305
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
306
|
+
};
|
|
307
|
+
var toggleMaximization = function toggleMaximization() {
|
|
308
|
+
var enable = resizable && enableMaximization && !isEmbed;
|
|
309
|
+
if (!enable) return;
|
|
310
|
+
setMaximization(function (prev) {
|
|
311
|
+
return !prev;
|
|
237
312
|
});
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
313
|
+
setMinimize(false);
|
|
314
|
+
};
|
|
315
|
+
var handleClose = function handleClose(event) {
|
|
316
|
+
event.stopPropagation();
|
|
317
|
+
onClose === null || onClose === void 0 || onClose();
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
// Style calculations
|
|
321
|
+
var getBaseStyle = useCallback(function () {
|
|
322
|
+
return {
|
|
323
|
+
visibility: visible ? 'visible' : 'hidden',
|
|
324
|
+
opacity: visible ? 1 : 0
|
|
325
|
+
};
|
|
326
|
+
}, [visible]);
|
|
327
|
+
var getCompatAbsPostion = useCallback(function (info) {
|
|
328
|
+
var compatInfo = compatClonedModel(info);
|
|
329
|
+
var isMinimize = compatInfo.minimize;
|
|
330
|
+
var ret = {};
|
|
331
|
+
['left', 'width', 'top', 'height'].forEach(function (key) {
|
|
332
|
+
ret[key] = compatInfo[key];
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Apply min/max constraints
|
|
336
|
+
if (maxSize && ret.width > maxSize[0]) {
|
|
337
|
+
ret.width = maxSize[0];
|
|
244
338
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
value: function componentDidUpdate(prevProps, _) {
|
|
248
|
-
var preVisible = prevProps.visible,
|
|
249
|
-
preClientWidth = prevProps.clientWidth,
|
|
250
|
-
preClientHeight = prevProps.clientHeight,
|
|
251
|
-
preIsEmbed = prevProps.isEmbed;
|
|
252
|
-
var _this$props3 = this.props,
|
|
253
|
-
visible = _this$props3.visible,
|
|
254
|
-
isEmbed = _this$props3.isEmbed,
|
|
255
|
-
clientWidth = _this$props3.clientWidth,
|
|
256
|
-
clientHeight = _this$props3.clientHeight,
|
|
257
|
-
height = _this$props3.height,
|
|
258
|
-
width = _this$props3.width,
|
|
259
|
-
top = _this$props3.top,
|
|
260
|
-
left = _this$props3.left;
|
|
261
|
-
// 嵌入式切换非嵌入式,属性重置
|
|
262
|
-
if (preIsEmbed && !isEmbed) {
|
|
263
|
-
this.setRootWidthInEmbedMode(0);
|
|
264
|
-
this.setState(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
265
|
-
minimize: false,
|
|
266
|
-
maximization: false
|
|
267
|
-
}, height ? {
|
|
268
|
-
height: height
|
|
269
|
-
} : {}), width ? {
|
|
270
|
-
width: width
|
|
271
|
-
} : {}), top ? {
|
|
272
|
-
top: top
|
|
273
|
-
} : {}), left ? {
|
|
274
|
-
left: left
|
|
275
|
-
} : {}));
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
// 非嵌入式切换嵌入式,属性重置
|
|
279
|
-
if (!preIsEmbed && isEmbed) {
|
|
280
|
-
this.setState({
|
|
281
|
-
minimize: false,
|
|
282
|
-
maximization: true
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
if (visible) {
|
|
286
|
-
if (!preVisible || clientWidth !== preClientWidth || clientHeight !== preClientHeight) {
|
|
287
|
-
var tempState = this.getDefaultEmbedState();
|
|
288
|
-
this.setState(tempState);
|
|
289
|
-
this.setRootWidthInEmbedMode(tempState === null || tempState === void 0 ? void 0 : tempState.width);
|
|
290
|
-
}
|
|
291
|
-
} else if (preVisible && !visible) {
|
|
292
|
-
this.setRootWidthInEmbedMode(0);
|
|
293
|
-
}
|
|
339
|
+
if (maxSize && ret.height > maxSize[1]) {
|
|
340
|
+
ret.height = maxSize[1];
|
|
294
341
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
value: function componentWillUnmount() {
|
|
298
|
-
DialogComp.container.removeChild(this.host);
|
|
342
|
+
if (minSize && ret.width < minSize[0]) {
|
|
343
|
+
ret.width = minSize[0];
|
|
299
344
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
get: function get() {
|
|
303
|
-
var max = this.props.max;
|
|
304
|
-
if (!max) {
|
|
305
|
-
var _this$props4 = this.props,
|
|
306
|
-
clientWidth = _this$props4.clientWidth,
|
|
307
|
-
clientHeight = _this$props4.clientHeight;
|
|
308
|
-
max = [clientWidth, clientHeight];
|
|
309
|
-
}
|
|
310
|
-
return max;
|
|
345
|
+
if (minSize && ret.height < minSize[1]) {
|
|
346
|
+
ret.height = minSize[1];
|
|
311
347
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
348
|
+
ret.width = isMinimize ? MINIMIZE_WIDTH : ret.width;
|
|
349
|
+
ret.height = isMinimize ? MINIMIZE_HEIGHT : ret.height;
|
|
350
|
+
|
|
351
|
+
// Adjust position if out of bounds (calculate but don't setState here)
|
|
352
|
+
if (ret.left + ret.width > clientWidth) {
|
|
353
|
+
ret.left = clientWidth - ret.width;
|
|
316
354
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
get: function get() {
|
|
320
|
-
return this.state.mask;
|
|
355
|
+
if (ret.left < 0) {
|
|
356
|
+
ret.left = 0;
|
|
321
357
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
value: function renderHeader() {
|
|
325
|
-
var _this$props5 = this.props,
|
|
326
|
-
locale = _this$props5.locale,
|
|
327
|
-
title = _this$props5.title,
|
|
328
|
-
isEmbed = _this$props5.isEmbed;
|
|
329
|
-
var _this$state2 = this.state,
|
|
330
|
-
headerStyle = _this$state2.headerStyle,
|
|
331
|
-
minimize = _this$state2.minimize;
|
|
332
|
-
var style = _objectSpread(_objectSpread(_objectSpread({}, headerStyle), minimize ? {
|
|
333
|
-
boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
|
|
334
|
-
} : {}), isEmbed ? {
|
|
335
|
-
cursor: 'initial'
|
|
336
|
-
} : {});
|
|
337
|
-
return /*#__PURE__*/_jsxs("header", {
|
|
338
|
-
className: "".concat(prefix, "-header"),
|
|
339
|
-
style: style,
|
|
340
|
-
onPointerDown: this.onDragStart,
|
|
341
|
-
onDoubleClick: this.toggleMaximization,
|
|
342
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
343
|
-
className: "".concat(prefix, "-title"),
|
|
344
|
-
children: title || locale.helpDocument
|
|
345
|
-
}), this.renderControls()]
|
|
346
|
-
});
|
|
358
|
+
if (ret.top < 0) {
|
|
359
|
+
ret.top = 0;
|
|
347
360
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
value: function renderControlLink() {
|
|
351
|
-
var extLink = this.props.extLink;
|
|
352
|
-
return /*#__PURE__*/_jsx("span", {
|
|
353
|
-
className: "".concat(prefix, "-item"),
|
|
354
|
-
children: /*#__PURE__*/_jsx("a", {
|
|
355
|
-
className: "".concat(prefix, "-item-link"),
|
|
356
|
-
href: extLink === null || extLink === void 0 ? void 0 : extLink.link,
|
|
357
|
-
target: "_blank",
|
|
358
|
-
rel: "noopener noreferrer",
|
|
359
|
-
children: /*#__PURE__*/_jsx("svg", {
|
|
360
|
-
// t="1679557306532"
|
|
361
|
-
className: "icon",
|
|
362
|
-
viewBox: "0 0 1024 1024",
|
|
363
|
-
version: "1.1",
|
|
364
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
365
|
-
// p-id="2545"
|
|
366
|
-
,
|
|
367
|
-
width: "16",
|
|
368
|
-
height: "16",
|
|
369
|
-
children: /*#__PURE__*/_jsx("path", {
|
|
370
|
-
d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z"
|
|
371
|
-
// p-id="2546"
|
|
372
|
-
})
|
|
373
|
-
})
|
|
374
|
-
})
|
|
375
|
-
});
|
|
361
|
+
if (ret.top + ret.height > clientHeight) {
|
|
362
|
+
ret.top = clientHeight - ret.height;
|
|
376
363
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
children: /*#__PURE__*/_jsx(CloseOutlined, {})
|
|
393
|
-
})]
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
return /*#__PURE__*/_jsxs("span", {
|
|
397
|
-
className: "".concat(prefix, "-controls"),
|
|
398
|
-
children: [this.renderControlLink(), /*#__PURE__*/_jsx("span", {
|
|
399
|
-
className: "".concat(prefix, "-item"),
|
|
400
|
-
onClick: this.toggleMinimize,
|
|
401
|
-
children: minimize ? /*#__PURE__*/_jsx(ExpandAltOutlined, {}) : /*#__PURE__*/_jsx(MinusOutlined, {})
|
|
402
|
-
}), enableMaximization && /*#__PURE__*/_jsx("span", {
|
|
403
|
-
className: "".concat(prefix, "-item"),
|
|
404
|
-
onClick: this.toggleMaximization,
|
|
405
|
-
children: maximization ? /*#__PURE__*/_jsx(FullscreenExitOutlined, {}) : /*#__PURE__*/_jsx(FullscreenOutlined, {})
|
|
406
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
407
|
-
className: "".concat(prefix, "-item"),
|
|
408
|
-
onClick: this.onClose,
|
|
409
|
-
children: /*#__PURE__*/_jsx(CloseOutlined, {})
|
|
410
|
-
})]
|
|
411
|
-
});
|
|
364
|
+
return ret;
|
|
365
|
+
}, [maxSize, minSize, clientWidth, clientHeight, compatClonedModel]);
|
|
366
|
+
|
|
367
|
+
// Adjust position if out of bounds
|
|
368
|
+
useEffect(function () {
|
|
369
|
+
if (!visible) return;
|
|
370
|
+
var adjusted = getCompatAbsPostion({
|
|
371
|
+
width: dialogWidth,
|
|
372
|
+
height: dialogHeight,
|
|
373
|
+
left: dialogLeft,
|
|
374
|
+
top: dialogTop,
|
|
375
|
+
minimize: minimize
|
|
376
|
+
});
|
|
377
|
+
if (adjusted.left !== dialogLeft) {
|
|
378
|
+
setDialogLeft(adjusted.left);
|
|
412
379
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
value: function renderContent() {
|
|
416
|
-
var children = this.props.children;
|
|
417
|
-
return /*#__PURE__*/_jsxs("main", {
|
|
418
|
-
className: "".concat(prefix, "-main"),
|
|
419
|
-
style: this.state.minimize ? {
|
|
420
|
-
visibility: 'hidden'
|
|
421
|
-
} : {},
|
|
422
|
-
children: [this.renderMask(), children]
|
|
423
|
-
});
|
|
380
|
+
if (adjusted.top !== dialogTop) {
|
|
381
|
+
setDialogTop(adjusted.top);
|
|
424
382
|
}
|
|
425
|
-
},
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
383
|
+
}, [dialogWidth, dialogHeight, dialogLeft, dialogTop, minimize, visible, getCompatAbsPostion]);
|
|
384
|
+
var getStyle = useMemo(function () {
|
|
385
|
+
var transform = "translate(".concat(moveX, "px, ").concat(moveY, "px)");
|
|
386
|
+
var baseStyle = getBaseStyle();
|
|
387
|
+
if (maximization && !isEmbed) {
|
|
388
|
+
return _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
389
|
+
top: 0,
|
|
390
|
+
bottom: 0,
|
|
391
|
+
right: 0,
|
|
392
|
+
width: width || DEFAULT_WIDTH_MEMBER,
|
|
393
|
+
height: 'auto',
|
|
394
|
+
borderRadius: 0
|
|
431
395
|
});
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
clientWidth = _this$props7.clientWidth,
|
|
442
|
-
clientHeight = _this$props7.clientHeight;
|
|
443
|
-
var ret = {};
|
|
444
|
-
['left', 'width', 'top', 'height'].forEach(function (key) {
|
|
445
|
-
ret[key] = compatInfo[key];
|
|
396
|
+
} else if (minimize) {
|
|
397
|
+
var _ref = headerStyle,
|
|
398
|
+
headerHeight = _ref.height;
|
|
399
|
+
var position = getCompatAbsPostion({
|
|
400
|
+
width: dialogWidth,
|
|
401
|
+
height: dialogHeight,
|
|
402
|
+
left: dialogLeft,
|
|
403
|
+
top: dialogTop,
|
|
404
|
+
minimize: minimize
|
|
446
405
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
ret.width = max[0];
|
|
452
|
-
}
|
|
453
|
-
if (max && ret.height > max[1]) {
|
|
454
|
-
ret.height = max[1];
|
|
455
|
-
}
|
|
456
|
-
if (min && ret.width < min[0]) {
|
|
457
|
-
ret.width = min[0];
|
|
458
|
-
}
|
|
459
|
-
if (min && ret.height < min[1]) {
|
|
460
|
-
ret.height = min[1];
|
|
461
|
-
}
|
|
462
|
-
ret.width = minimize ? MINIMIZE_WIDTH : ret.width;
|
|
463
|
-
ret.height = minimize ? MINIMIZE_HEIGHT : ret.height;
|
|
464
|
-
if (ret.left + ret.width > clientWidth) {
|
|
465
|
-
ret.left = clientWidth - ret.width;
|
|
466
|
-
this.setState({
|
|
467
|
-
left: ret.left
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
if (ret.left < 0) {
|
|
471
|
-
this.setState({
|
|
472
|
-
left: 0
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
if (ret.top < 0) {
|
|
476
|
-
this.setState({
|
|
477
|
-
top: 0
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
if (ret.top + ret.height > clientHeight) {
|
|
481
|
-
ret.top = clientHeight - ret.height;
|
|
482
|
-
this.setState({
|
|
483
|
-
top: ret.top
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
return ret;
|
|
487
|
-
}
|
|
488
|
-
}, {
|
|
489
|
-
key: "renderDialog",
|
|
490
|
-
value: function renderDialog() {
|
|
491
|
-
var style = this.getStyle();
|
|
492
|
-
var _this$props8 = this.props,
|
|
493
|
-
className = _this$props8.className,
|
|
494
|
-
isEmbed = _this$props8.isEmbed;
|
|
495
|
-
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
496
|
-
children: /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
497
|
-
className: "".concat(prefix, "-container ").concat(className, " ").concat(isEmbed ? "".concat(prefix, "-container-embed") : ''),
|
|
498
|
-
style: style
|
|
499
|
-
}, this.state.minimize ? {} : {
|
|
500
|
-
tabIndex: 0
|
|
501
|
-
}), {}, {
|
|
502
|
-
children: [this.renderHeader(), this.renderContent(), isEmbed ? this.renderEmbedBorders() : this.renderBorders(), /*#__PURE__*/_jsx(EventProxy, {
|
|
503
|
-
onPointerMove: this.onDragMove,
|
|
504
|
-
onPointerUp: this.onDragEnd
|
|
505
|
-
}), /*#__PURE__*/_jsx(EventProxy, {
|
|
506
|
-
onPointerUp: this.detectPointUp
|
|
507
|
-
})]
|
|
508
|
-
}))
|
|
406
|
+
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), position), {}, {
|
|
407
|
+
width: MINIMIZE_WIDTH,
|
|
408
|
+
height: headerHeight || MINIMIZE_HEIGHT,
|
|
409
|
+
transform: transform
|
|
509
410
|
});
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
var min = this.min;
|
|
520
|
-
var newModel = {};
|
|
521
|
-
var result = {
|
|
522
|
-
widthShouldChange: true,
|
|
523
|
-
heightShouldChange: true
|
|
524
|
-
};
|
|
525
|
-
if (min && width < min[0]) {
|
|
526
|
-
newModel.width = min[0];
|
|
527
|
-
result.widthShouldChange = false;
|
|
528
|
-
}
|
|
529
|
-
if (min && height < min[1]) {
|
|
530
|
-
newModel.height = min[1];
|
|
531
|
-
result.heightShouldChange = false;
|
|
532
|
-
}
|
|
533
|
-
if (max && width > max[0]) {
|
|
534
|
-
newModel.width = max[0];
|
|
535
|
-
result.widthShouldChange = false;
|
|
536
|
-
}
|
|
537
|
-
if (max && height > max[1]) {
|
|
538
|
-
newModel.height = max[1];
|
|
539
|
-
result.heightShouldChange = false;
|
|
540
|
-
}
|
|
541
|
-
return result;
|
|
542
|
-
}
|
|
543
|
-
}, {
|
|
544
|
-
key: "renderEmbedBorders",
|
|
545
|
-
value: function renderEmbedBorders() {
|
|
546
|
-
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
547
|
-
children: /*#__PURE__*/_jsx(Anchor, {
|
|
548
|
-
dock: Dock.left,
|
|
549
|
-
onStart: this.onResizeStart,
|
|
550
|
-
onMove: this.onResizeMove,
|
|
551
|
-
onEnd: this.onResizeEnd
|
|
552
|
-
})
|
|
411
|
+
} else {
|
|
412
|
+
var _position = getCompatAbsPostion({
|
|
413
|
+
width: dialogWidth,
|
|
414
|
+
height: dialogHeight,
|
|
415
|
+
left: dialogLeft,
|
|
416
|
+
top: dialogTop
|
|
417
|
+
});
|
|
418
|
+
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _position), {}, {
|
|
419
|
+
transform: transform
|
|
553
420
|
});
|
|
554
421
|
}
|
|
555
|
-
},
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
onEnd: this.onResizeEnd
|
|
589
|
-
}), /*#__PURE__*/_jsx(Anchor, {
|
|
590
|
-
dock: Dock.bottomLeft,
|
|
591
|
-
onStart: this.onResizeStart,
|
|
592
|
-
onMove: this.onResizeMove,
|
|
593
|
-
onEnd: this.onResizeEnd
|
|
594
|
-
}), /*#__PURE__*/_jsx(Anchor, {
|
|
595
|
-
dock: Dock.bottomRight,
|
|
596
|
-
onStart: this.onResizeStart,
|
|
597
|
-
onMove: this.onResizeMove,
|
|
598
|
-
onEnd: this.onResizeEnd
|
|
422
|
+
}, [maximization, isEmbed, minimize, moveX, moveY, width, headerStyle, dialogWidth, dialogHeight, dialogLeft, dialogTop, getCompatAbsPostion, getBaseStyle]);
|
|
423
|
+
|
|
424
|
+
// Render methods
|
|
425
|
+
var renderControlLink = function renderControlLink() {
|
|
426
|
+
return /*#__PURE__*/_jsx("span", {
|
|
427
|
+
className: "".concat(prefixCls, "-item"),
|
|
428
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
429
|
+
className: "".concat(prefixCls, "-item-link"),
|
|
430
|
+
href: extLink === null || extLink === void 0 ? void 0 : extLink.link,
|
|
431
|
+
target: "_blank",
|
|
432
|
+
rel: "noopener noreferrer",
|
|
433
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
434
|
+
className: "icon",
|
|
435
|
+
viewBox: "0 0 1024 1024",
|
|
436
|
+
version: "1.1",
|
|
437
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
438
|
+
width: "16",
|
|
439
|
+
height: "16",
|
|
440
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
441
|
+
d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z"
|
|
442
|
+
})
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
var renderControls = function renderControls() {
|
|
448
|
+
if (isEmbed) {
|
|
449
|
+
return /*#__PURE__*/_jsxs("span", {
|
|
450
|
+
className: "".concat(prefixCls, "-controls"),
|
|
451
|
+
children: [renderControlLink(), /*#__PURE__*/_jsx("span", {
|
|
452
|
+
className: "".concat(prefixCls, "-item"),
|
|
453
|
+
onClick: handleClose,
|
|
454
|
+
children: /*#__PURE__*/_jsx(CloseOutlined, {})
|
|
599
455
|
})]
|
|
600
456
|
});
|
|
601
457
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
458
|
+
return /*#__PURE__*/_jsxs("span", {
|
|
459
|
+
className: "".concat(prefixCls, "-controls"),
|
|
460
|
+
children: [renderControlLink(), /*#__PURE__*/_jsx("span", {
|
|
461
|
+
className: "".concat(prefixCls, "-item"),
|
|
462
|
+
onClick: toggleMinimize,
|
|
463
|
+
children: minimize ? /*#__PURE__*/_jsx(ExpandAltOutlined, {}) : /*#__PURE__*/_jsx(MinusOutlined, {})
|
|
464
|
+
}), enableMaximization && /*#__PURE__*/_jsx("span", {
|
|
465
|
+
className: "".concat(prefixCls, "-item"),
|
|
466
|
+
onClick: toggleMaximization,
|
|
467
|
+
children: maximization ? /*#__PURE__*/_jsx(FullscreenExitOutlined, {}) : /*#__PURE__*/_jsx(FullscreenOutlined, {})
|
|
468
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
469
|
+
className: "".concat(prefixCls, "-item"),
|
|
470
|
+
onClick: handleClose,
|
|
471
|
+
children: /*#__PURE__*/_jsx(CloseOutlined, {})
|
|
472
|
+
})]
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
var renderHeader = function renderHeader() {
|
|
476
|
+
var headerStyleObj = _objectSpread(_objectSpread(_objectSpread({}, headerStyle), minimize ? {
|
|
477
|
+
boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
|
|
478
|
+
} : {}), isEmbed ? {
|
|
479
|
+
cursor: 'initial'
|
|
480
|
+
} : {});
|
|
481
|
+
return /*#__PURE__*/_jsxs("header", {
|
|
482
|
+
className: "".concat(prefixCls, "-header"),
|
|
483
|
+
style: headerStyleObj,
|
|
484
|
+
onPointerDown: onDragStart,
|
|
485
|
+
onDoubleClick: toggleMaximization,
|
|
486
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
487
|
+
className: "".concat(prefixCls, "-title"),
|
|
488
|
+
children: title || (locale === null || locale === void 0 ? void 0 : locale.helpDocument)
|
|
489
|
+
}), renderControls()]
|
|
490
|
+
});
|
|
491
|
+
};
|
|
492
|
+
var renderMask = function renderMask() {
|
|
493
|
+
if (!mask) return null;
|
|
494
|
+
return /*#__PURE__*/_jsx("div", {
|
|
495
|
+
className: "".concat(prefixCls, "-mask")
|
|
496
|
+
});
|
|
497
|
+
};
|
|
498
|
+
var renderContent = function renderContent() {
|
|
499
|
+
return /*#__PURE__*/_jsxs("main", {
|
|
500
|
+
className: "".concat(prefixCls, "-main"),
|
|
501
|
+
style: minimize ? {
|
|
502
|
+
visibility: 'hidden'
|
|
503
|
+
} : {},
|
|
504
|
+
children: [renderMask(), children]
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
var renderEmbedBorders = function renderEmbedBorders() {
|
|
508
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
509
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
510
|
+
prefixCls: prefixCls,
|
|
511
|
+
dock: Dock.left,
|
|
512
|
+
onStart: onResizeStart,
|
|
513
|
+
onMove: onResizeMove,
|
|
514
|
+
onEnd: onResizeEnd
|
|
515
|
+
})
|
|
516
|
+
});
|
|
517
|
+
};
|
|
518
|
+
var renderBorders = function renderBorders() {
|
|
519
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
520
|
+
children: [/*#__PURE__*/_jsx(Anchor, {
|
|
521
|
+
prefixCls: prefixCls,
|
|
522
|
+
dock: Dock.top,
|
|
523
|
+
onStart: onResizeStart,
|
|
524
|
+
onMove: onResizeMove,
|
|
525
|
+
onEnd: onResizeEnd
|
|
526
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
527
|
+
prefixCls: prefixCls,
|
|
528
|
+
dock: Dock.right,
|
|
529
|
+
onStart: onResizeStart,
|
|
530
|
+
onMove: onResizeMove,
|
|
531
|
+
onEnd: onResizeEnd
|
|
532
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
533
|
+
prefixCls: prefixCls,
|
|
534
|
+
dock: Dock.bottom,
|
|
535
|
+
onStart: onResizeStart,
|
|
536
|
+
onMove: onResizeMove,
|
|
537
|
+
onEnd: onResizeEnd
|
|
538
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
539
|
+
prefixCls: prefixCls,
|
|
540
|
+
dock: Dock.left,
|
|
541
|
+
onStart: onResizeStart,
|
|
542
|
+
onMove: onResizeMove,
|
|
543
|
+
onEnd: onResizeEnd
|
|
544
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
545
|
+
prefixCls: prefixCls,
|
|
546
|
+
dock: Dock.topLeft,
|
|
547
|
+
onStart: onResizeStart,
|
|
548
|
+
onMove: onResizeMove,
|
|
549
|
+
onEnd: onResizeEnd
|
|
550
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
551
|
+
prefixCls: prefixCls,
|
|
552
|
+
dock: Dock.topRight,
|
|
553
|
+
onStart: onResizeStart,
|
|
554
|
+
onMove: onResizeMove,
|
|
555
|
+
onEnd: onResizeEnd
|
|
556
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
557
|
+
prefixCls: prefixCls,
|
|
558
|
+
dock: Dock.bottomLeft,
|
|
559
|
+
onStart: onResizeStart,
|
|
560
|
+
onMove: onResizeMove,
|
|
561
|
+
onEnd: onResizeEnd
|
|
562
|
+
}), /*#__PURE__*/_jsx(Anchor, {
|
|
563
|
+
prefixCls: prefixCls,
|
|
564
|
+
dock: Dock.bottomRight,
|
|
565
|
+
onStart: onResizeStart,
|
|
566
|
+
onMove: onResizeMove,
|
|
567
|
+
onEnd: onResizeEnd
|
|
568
|
+
})]
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
var renderDialog = function renderDialog() {
|
|
572
|
+
var style = getStyle;
|
|
573
|
+
return wrapSSR( /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
574
|
+
className: "".concat(prefixCls, "-container ").concat(className || '', " ").concat(isEmbed ? "".concat(prefixCls, "-container-embed") : ''),
|
|
575
|
+
style: style
|
|
576
|
+
}, minimize ? {} : {
|
|
577
|
+
tabIndex: 0
|
|
578
|
+
}), {}, {
|
|
579
|
+
children: [renderHeader(), renderContent(), isEmbed ? renderEmbedBorders() : renderBorders(), /*#__PURE__*/_jsx(EventProxy, {
|
|
580
|
+
onPointerMove: onDragMove,
|
|
581
|
+
onPointerUp: onDragEnd
|
|
582
|
+
}), /*#__PURE__*/_jsx(EventProxy, {
|
|
583
|
+
onPointerUp: detectPointUp
|
|
584
|
+
})]
|
|
585
|
+
})));
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
// 嵌入模式通过style控制显隐
|
|
589
|
+
if (!visible && !isEmbed) return /*#__PURE__*/_jsx(React.Fragment, {});
|
|
590
|
+
return /*#__PURE__*/createPortal(renderDialog(), getContainer());
|
|
591
|
+
};
|
|
632
592
|
export default LocaleWrapper({
|
|
633
593
|
componentName: 'Dialog',
|
|
634
594
|
defaultLocale: zhCN
|