@oceanbase/ui 0.2.0
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/iconfont.22caa259.woff +0 -0
- package/dist/static/iconfont.bf41d69a.woff2 +0 -0
- package/dist/static/iconfont.d8ca098f.ttf +0 -0
- package/dist/ui.min.css +1 -0
- package/dist/ui.min.js +1 -0
- package/es/Action/Group.d.ts +14 -0
- package/es/Action/Group.js +112 -0
- package/es/Action/Item.d.ts +31 -0
- package/es/Action/Item.js +136 -0
- package/es/Action/index.d.ts +8 -0
- package/es/Action/index.js +7 -0
- package/es/BackgroundTaskManager/RefreshMan.d.ts +11 -0
- package/es/BackgroundTaskManager/RefreshMan.js +66 -0
- package/es/BackgroundTaskManager/constants.js +10 -0
- package/es/BackgroundTaskManager/index.d.ts +49 -0
- package/es/BackgroundTaskManager/index.js +155 -0
- package/es/BasicLayout/Header.d.ts +45 -0
- package/es/BasicLayout/Header.js +228 -0
- package/es/BasicLayout/Header.less +134 -0
- package/es/BasicLayout/index.d.ts +45 -0
- package/es/BasicLayout/index.js +312 -0
- package/es/BasicLayout/index.less +400 -0
- package/es/BasicLayout/locale/en-US.js +11 -0
- package/es/BasicLayout/locale/zh-CN.js +11 -0
- package/es/BasicLayout/locale/zh-TW.js +11 -0
- package/es/BatchOperationBar/index.d.ts +33 -0
- package/es/BatchOperationBar/index.js +126 -0
- package/es/BatchOperationBar/index.less +46 -0
- package/es/BatchOperationBar/index.less.d.ts +15 -0
- package/es/BatchOperationBar/locale/en-US.js +6 -0
- package/es/BatchOperationBar/locale/zh-CN.js +6 -0
- package/es/BatchOperationBar/locale/zh-TW.js +6 -0
- package/es/Boundary/Components/Code.d.ts +14 -0
- package/es/Boundary/Components/Code.js +32 -0
- package/es/Boundary/Components/Exception.d.ts +17 -0
- package/es/Boundary/Components/Exception.js +129 -0
- package/es/Boundary/Components/Function.d.ts +9 -0
- package/es/Boundary/Components/Function.js +21 -0
- package/es/Boundary/Components/index.d.ts +3 -0
- package/es/Boundary/Components/index.js +3 -0
- package/es/Boundary/IBoundary.js +1 -0
- package/es/Boundary/constant.js +41 -0
- package/es/Boundary/index.d.ts +8 -0
- package/es/Boundary/index.js +7 -0
- package/es/Boundary/index.less +44 -0
- package/es/Boundary/locale/en-US.js +10 -0
- package/es/Boundary/locale/zh-CN.js +10 -0
- package/es/Boundary/locale/zh-TW.js +10 -0
- package/es/Boundary/utils.js +18 -0
- package/es/ContentWithQuestion/index.d.ts +13 -0
- package/es/ContentWithQuestion/index.js +46 -0
- package/es/ContentWithQuestion/index.less +18 -0
- package/es/Dialog/Anchor.js +104 -0
- package/es/Dialog/Dock.js +84 -0
- package/es/Dialog/EventProxy.js +50 -0
- package/es/Dialog/index.d.ts +35 -0
- package/es/Dialog/index.js +614 -0
- package/es/Dialog/index.less +114 -0
- package/es/Dialog/locale/en-US.js +4 -0
- package/es/Dialog/locale/zh-CN.js +4 -0
- package/es/Dialog/locale/zh-TW.js +4 -0
- package/es/DocDialog/index.d.ts +24 -0
- package/es/DocDialog/index.js +115 -0
- package/es/DocDialog/locale/en-US.js +1 -0
- package/es/DocDialog/locale/zh-CN.js +1 -0
- package/es/DocDialog/locale/zh-TW.js +1 -0
- package/es/FullscreenBox/index.d.ts +42 -0
- package/es/FullscreenBox/index.js +145 -0
- package/es/FullscreenBox/index.less +49 -0
- package/es/FullscreenBox/locale/en-US.js +1 -0
- package/es/FullscreenBox/locale/zh-CN.js +1 -0
- package/es/FullscreenBox/locale/zh-TW.js +1 -0
- package/es/GraphToolbar/index.d.ts +26 -0
- package/es/GraphToolbar/index.js +132 -0
- package/es/GraphToolbar/index.less +65 -0
- package/es/GraphToolbar/locale/en-US.js +8 -0
- package/es/GraphToolbar/locale/zh-CN.js +8 -0
- package/es/GraphToolbar/locale/zh-TW.js +8 -0
- package/es/Highlight/DiffView/DiffCells.js +43 -0
- package/es/Highlight/DiffView/index.d.ts +44 -0
- package/es/Highlight/DiffView/index.js +317 -0
- package/es/Highlight/HighlightCell.js +29 -0
- package/es/Highlight/JsonView.d.ts +8 -0
- package/es/Highlight/JsonView.js +44 -0
- package/es/Highlight/index.d.ts +97 -0
- package/es/Highlight/index.js +257 -0
- package/es/Highlight/index.less +381 -0
- package/es/Highlight/languages/bash.js +2 -0
- package/es/Highlight/languages/cpp.js +2 -0
- package/es/Highlight/languages/css.js +2 -0
- package/es/Highlight/languages/dockerfile.js +2 -0
- package/es/Highlight/languages/go.js +2 -0
- package/es/Highlight/languages/groovy.js +2 -0
- package/es/Highlight/languages/http.js +2 -0
- package/es/Highlight/languages/java.js +2 -0
- package/es/Highlight/languages/javascript.js +2 -0
- package/es/Highlight/languages/json.js +2 -0
- package/es/Highlight/languages/markdown.js +2 -0
- package/es/Highlight/languages/nginx.js +2 -0
- package/es/Highlight/languages/python.js +2 -0
- package/es/Highlight/languages/ruby.js +2 -0
- package/es/Highlight/languages/solidity.js +2 -0
- package/es/Highlight/languages/sql.js +2 -0
- package/es/Highlight/languages/typescript.js +2 -0
- package/es/Highlight/languages/xml.js +2 -0
- package/es/Highlight/languages/yaml.js +2 -0
- package/es/Highlight/locale/en-US.js +1 -0
- package/es/Highlight/locale/zh-CN.js +1 -0
- package/es/Highlight/locale/zh-TW.js +1 -0
- package/es/Highlight/useKeyDownCopyEvent.js +54 -0
- package/es/IconFont/font/iconfont.css +503 -0
- package/es/IconFont/font/iconfont.ttf +0 -0
- package/es/IconFont/font/iconfont.woff +0 -0
- package/es/IconFont/font/iconfont.woff2 +0 -0
- package/es/IconFont/index.d.ts +9 -0
- package/es/IconFont/index.js +26 -0
- package/es/LocaleDropdown/index.d.ts +9 -0
- package/es/LocaleDropdown/index.js +47 -0
- package/es/Login/ActivateForm.d.ts +19 -0
- package/es/Login/ActivateForm.js +98 -0
- package/es/Login/LoginForm.d.ts +20 -0
- package/es/Login/LoginForm.js +142 -0
- package/es/Login/RegisterForm.d.ts +23 -0
- package/es/Login/RegisterForm.js +155 -0
- package/es/Login/index.d.ts +66 -0
- package/es/Login/index.js +177 -0
- package/es/Login/index.less +325 -0
- package/es/Login/locale/en-US.js +26 -0
- package/es/Login/locale/zh-CN.js +27 -0
- package/es/Login/locale/zh-TW.js +26 -0
- package/es/Lottie/index.js +37 -0
- package/es/NavMenu/index.d.ts +19 -0
- package/es/NavMenu/index.js +99 -0
- package/es/NavMenu/index.less +50 -0
- package/es/PageContainer/ItemRender.js +21 -0
- package/es/PageContainer/index.d.ts +16 -0
- package/es/PageContainer/index.js +71 -0
- package/es/PageContainer/locale/en-US.js +3 -0
- package/es/PageContainer/locale/zh-CN.js +3 -0
- package/es/PageContainer/locale/zh-TW.js +3 -0
- package/es/PageContainer/style/index.d.ts +5 -0
- package/es/PageContainer/style/index.js +72 -0
- package/es/Password/Content.d.ts +14 -0
- package/es/Password/Content.js +92 -0
- package/es/Password/index.d.ts +25 -0
- package/es/Password/index.js +137 -0
- package/es/Password/locale/en-US.js +12 -0
- package/es/Password/locale/zh-CN.js +12 -0
- package/es/Password/locale/zh-TW.js +12 -0
- package/es/Ranger/QuickPicker.d.ts +4 -0
- package/es/Ranger/QuickPicker.js +123 -0
- package/es/Ranger/Ranger.d.ts +11 -0
- package/es/Ranger/Ranger.js +140 -0
- package/es/Ranger/constant/index.js +187 -0
- package/es/Ranger/index.d.ts +33 -0
- package/es/Ranger/index.js +32 -0
- package/es/Ranger/index.less +55 -0
- package/es/Ranger/locale/en-US.js +29 -0
- package/es/Ranger/locale/zh-CN.js +3 -0
- package/es/Ranger/locale/zh-TW.js +3 -0
- package/es/Ranger/typing.js +1 -0
- package/es/SideTip/Dragger.d.ts +45 -0
- package/es/SideTip/Dragger.js +293 -0
- package/es/SideTip/IconLoading.d.ts +3 -0
- package/es/SideTip/IconLoading.js +37 -0
- package/es/SideTip/index.d.ts +156 -0
- package/es/SideTip/index.js +177 -0
- package/es/SideTip/index.less +177 -0
- package/es/SideTip/locale/en-US.js +1 -0
- package/es/SideTip/locale/zh-CN.js +1 -0
- package/es/SideTip/locale/zh-TW.js +1 -0
- package/es/SideTip/utils.js +80 -0
- package/es/TaskGraph/Graph.d.ts +24 -0
- package/es/TaskGraph/Graph.js +260 -0
- package/es/TaskGraph/graph.less +23 -0
- package/es/TaskGraph/index.d.ts +16 -0
- package/es/TaskGraph/index.js +165 -0
- package/es/TaskGraph/index.less +117 -0
- package/es/TaskGraph/locale/en-US.js +12 -0
- package/es/TaskGraph/locale/zh-CN.js +12 -0
- package/es/TaskGraph/locale/zh-TW.js +12 -0
- package/es/TaskGraph/register.d.ts +7 -0
- package/es/TaskGraph/register.js +200 -0
- package/es/TreeSearch/index.d.ts +38 -0
- package/es/TreeSearch/index.js +168 -0
- package/es/TreeSearch/util.d.ts +21 -0
- package/es/TreeSearch/util.js +111 -0
- package/es/Welcome/index.d.ts +38 -0
- package/es/Welcome/index.js +140 -0
- package/es/Welcome/index.less +186 -0
- package/es/Welcome/locale/en-US.js +4 -0
- package/es/Welcome/locale/zh-CN.js +4 -0
- package/es/Welcome/locale/zh-TW.js +4 -0
- package/es/Welcome/step.d.ts +18 -0
- package/es/Welcome/step.js +42 -0
- package/es/_util/genComponentStyleHook.d.ts +14 -0
- package/es/_util/genComponentStyleHook.js +27 -0
- package/es/_util/index.js +54 -0
- package/es/_util/useHistory.js +9 -0
- package/es/assets/background_img.svg +30 -0
- package/es/assets/graph_fit_view_icon.svg +14 -0
- package/es/assets/graph_reset_icon.svg +14 -0
- package/es/assets/logo/oceanbase_logo.svg +29 -0
- package/es/assets/logo/oceanbase_watermark.svg +31 -0
- package/es/assets/monitor.svg +21 -0
- package/es/assets/user.svg +16 -0
- package/es/constant/index.js +18 -0
- package/es/index.d.ts +28 -0
- package/es/index.js +27 -0
- package/es/index.less +14 -0
- package/es/interface.js +1 -0
- package/es/locale/LocaleWrapper.d.ts +10 -0
- package/es/locale/LocaleWrapper.js +69 -0
- package/es/locale/en-US.js +38 -0
- package/es/locale/index.js +1 -0
- package/es/locale/zh-CN.js +39 -0
- package/es/locale/zh-TW.js +33 -0
- package/es/variable.less +54 -0
- package/lib/Action/Group.d.ts +14 -0
- package/lib/Action/Group.js +124 -0
- package/lib/Action/Item.d.ts +31 -0
- package/lib/Action/Item.js +126 -0
- package/lib/Action/index.d.ts +8 -0
- package/lib/Action/index.js +37 -0
- package/lib/BackgroundTaskManager/RefreshMan.d.ts +11 -0
- package/lib/BackgroundTaskManager/RefreshMan.js +86 -0
- package/lib/BackgroundTaskManager/constants.js +38 -0
- package/lib/BackgroundTaskManager/index.d.ts +49 -0
- package/lib/BackgroundTaskManager/index.js +161 -0
- package/lib/BasicLayout/Header.d.ts +45 -0
- package/lib/BasicLayout/Header.js +177 -0
- package/lib/BasicLayout/Header.less +134 -0
- package/lib/BasicLayout/index.d.ts +45 -0
- package/lib/BasicLayout/index.js +346 -0
- package/lib/BasicLayout/index.less +400 -0
- package/lib/BasicLayout/locale/en-US.js +35 -0
- package/lib/BasicLayout/locale/zh-CN.js +35 -0
- package/lib/BasicLayout/locale/zh-TW.js +35 -0
- package/lib/BatchOperationBar/index.d.ts +33 -0
- package/lib/BatchOperationBar/index.js +165 -0
- package/lib/BatchOperationBar/index.less +46 -0
- package/lib/BatchOperationBar/index.less.d.ts +15 -0
- package/lib/BatchOperationBar/locale/en-US.js +30 -0
- package/lib/BatchOperationBar/locale/zh-CN.js +30 -0
- package/lib/BatchOperationBar/locale/zh-TW.js +30 -0
- package/lib/Boundary/Components/Code.d.ts +14 -0
- package/lib/Boundary/Components/Code.js +55 -0
- package/lib/Boundary/Components/Exception.d.ts +17 -0
- package/lib/Boundary/Components/Exception.js +114 -0
- package/lib/Boundary/Components/Function.d.ts +9 -0
- package/lib/Boundary/Components/Function.js +47 -0
- package/lib/Boundary/Components/index.d.ts +3 -0
- package/lib/Boundary/Components/index.js +27 -0
- package/lib/Boundary/IBoundary.js +17 -0
- package/lib/Boundary/constant.js +71 -0
- package/lib/Boundary/index.d.ts +8 -0
- package/lib/Boundary/index.js +27 -0
- package/lib/Boundary/index.less +44 -0
- package/lib/Boundary/locale/en-US.js +34 -0
- package/lib/Boundary/locale/zh-CN.js +34 -0
- package/lib/Boundary/locale/zh-TW.js +34 -0
- package/lib/Boundary/utils.js +46 -0
- package/lib/ContentWithQuestion/index.d.ts +13 -0
- package/lib/ContentWithQuestion/index.js +76 -0
- package/lib/ContentWithQuestion/index.less +18 -0
- package/lib/Dialog/Anchor.js +107 -0
- package/lib/Dialog/Dock.js +112 -0
- package/lib/Dialog/EventProxy.js +59 -0
- package/lib/Dialog/index.d.ts +35 -0
- package/lib/Dialog/index.js +558 -0
- package/lib/Dialog/index.less +114 -0
- package/lib/Dialog/locale/en-US.js +28 -0
- package/lib/Dialog/locale/zh-CN.js +28 -0
- package/lib/Dialog/locale/zh-TW.js +28 -0
- package/lib/DocDialog/index.d.ts +24 -0
- package/lib/DocDialog/index.js +135 -0
- package/lib/DocDialog/locale/en-US.js +25 -0
- package/lib/DocDialog/locale/zh-CN.js +25 -0
- package/lib/DocDialog/locale/zh-TW.js +25 -0
- package/lib/FullscreenBox/index.d.ts +42 -0
- package/lib/FullscreenBox/index.js +126 -0
- package/lib/FullscreenBox/index.less +49 -0
- package/lib/FullscreenBox/locale/en-US.js +25 -0
- package/lib/FullscreenBox/locale/zh-CN.js +25 -0
- package/lib/FullscreenBox/locale/zh-TW.js +25 -0
- package/lib/GraphToolbar/index.d.ts +26 -0
- package/lib/GraphToolbar/index.js +154 -0
- package/lib/GraphToolbar/index.less +65 -0
- package/lib/GraphToolbar/locale/en-US.js +32 -0
- package/lib/GraphToolbar/locale/zh-CN.js +32 -0
- package/lib/GraphToolbar/locale/zh-TW.js +32 -0
- package/lib/Highlight/DiffView/DiffCells.js +70 -0
- package/lib/Highlight/DiffView/index.d.ts +44 -0
- package/lib/Highlight/DiffView/index.js +297 -0
- package/lib/Highlight/HighlightCell.js +58 -0
- package/lib/Highlight/JsonView.d.ts +8 -0
- package/lib/Highlight/JsonView.js +83 -0
- package/lib/Highlight/index.d.ts +97 -0
- package/lib/Highlight/index.js +263 -0
- package/lib/Highlight/index.less +381 -0
- package/lib/Highlight/languages/bash.js +36 -0
- package/lib/Highlight/languages/cpp.js +36 -0
- package/lib/Highlight/languages/css.js +36 -0
- package/lib/Highlight/languages/dockerfile.js +36 -0
- package/lib/Highlight/languages/go.js +36 -0
- package/lib/Highlight/languages/groovy.js +36 -0
- package/lib/Highlight/languages/http.js +36 -0
- package/lib/Highlight/languages/java.js +36 -0
- package/lib/Highlight/languages/javascript.js +36 -0
- package/lib/Highlight/languages/json.js +36 -0
- package/lib/Highlight/languages/markdown.js +36 -0
- package/lib/Highlight/languages/nginx.js +36 -0
- package/lib/Highlight/languages/python.js +36 -0
- package/lib/Highlight/languages/ruby.js +36 -0
- package/lib/Highlight/languages/solidity.js +36 -0
- package/lib/Highlight/languages/sql.js +36 -0
- package/lib/Highlight/languages/typescript.js +36 -0
- package/lib/Highlight/languages/xml.js +36 -0
- package/lib/Highlight/languages/yaml.js +36 -0
- package/lib/Highlight/locale/en-US.js +25 -0
- package/lib/Highlight/locale/zh-CN.js +25 -0
- package/lib/Highlight/locale/zh-TW.js +25 -0
- package/lib/Highlight/useKeyDownCopyEvent.js +86 -0
- package/lib/IconFont/font/iconfont.css +503 -0
- package/lib/IconFont/font/iconfont.ttf +0 -0
- package/lib/IconFont/font/iconfont.woff +0 -0
- package/lib/IconFont/font/iconfont.woff2 +0 -0
- package/lib/IconFont/index.d.ts +9 -0
- package/lib/IconFont/index.js +82 -0
- package/lib/LocaleDropdown/index.d.ts +9 -0
- package/lib/LocaleDropdown/index.js +70 -0
- package/lib/Login/ActivateForm.d.ts +19 -0
- package/lib/Login/ActivateForm.js +132 -0
- package/lib/Login/LoginForm.d.ts +20 -0
- package/lib/Login/LoginForm.js +175 -0
- package/lib/Login/RegisterForm.d.ts +23 -0
- package/lib/Login/RegisterForm.js +177 -0
- package/lib/Login/index.d.ts +66 -0
- package/lib/Login/index.js +171 -0
- package/lib/Login/index.less +325 -0
- package/lib/Login/locale/en-US.js +50 -0
- package/lib/Login/locale/zh-CN.js +51 -0
- package/lib/Login/locale/zh-TW.js +50 -0
- package/lib/Lottie/index.js +62 -0
- package/lib/NavMenu/index.d.ts +19 -0
- package/lib/NavMenu/index.js +104 -0
- package/lib/NavMenu/index.less +50 -0
- package/lib/PageContainer/ItemRender.js +51 -0
- package/lib/PageContainer/index.d.ts +16 -0
- package/lib/PageContainer/index.js +88 -0
- package/lib/PageContainer/locale/en-US.js +27 -0
- package/lib/PageContainer/locale/zh-CN.js +27 -0
- package/lib/PageContainer/locale/zh-TW.js +27 -0
- package/lib/PageContainer/style/index.d.ts +5 -0
- package/lib/PageContainer/style/index.js +120 -0
- package/lib/Password/Content.d.ts +14 -0
- package/lib/Password/Content.js +106 -0
- package/lib/Password/index.d.ts +25 -0
- package/lib/Password/index.js +162 -0
- package/lib/Password/locale/en-US.js +36 -0
- package/lib/Password/locale/zh-CN.js +36 -0
- package/lib/Password/locale/zh-TW.js +36 -0
- package/lib/Ranger/QuickPicker.d.ts +4 -0
- package/lib/Ranger/QuickPicker.js +106 -0
- package/lib/Ranger/Ranger.d.ts +11 -0
- package/lib/Ranger/Ranger.js +153 -0
- package/lib/Ranger/constant/index.js +268 -0
- package/lib/Ranger/index.d.ts +33 -0
- package/lib/Ranger/index.js +64 -0
- package/lib/Ranger/index.less +55 -0
- package/lib/Ranger/locale/en-US.js +53 -0
- package/lib/Ranger/locale/zh-CN.js +27 -0
- package/lib/Ranger/locale/zh-TW.js +27 -0
- package/lib/Ranger/typing.js +17 -0
- package/lib/SideTip/Dragger.d.ts +45 -0
- package/lib/SideTip/Dragger.js +259 -0
- package/lib/SideTip/IconLoading.d.ts +3 -0
- package/lib/SideTip/IconLoading.js +75 -0
- package/lib/SideTip/index.d.ts +156 -0
- package/lib/SideTip/index.js +182 -0
- package/lib/SideTip/index.less +177 -0
- package/lib/SideTip/locale/en-US.js +25 -0
- package/lib/SideTip/locale/zh-CN.js +25 -0
- package/lib/SideTip/locale/zh-TW.js +25 -0
- package/lib/SideTip/utils.js +112 -0
- package/lib/TaskGraph/Graph.d.ts +24 -0
- package/lib/TaskGraph/Graph.js +259 -0
- package/lib/TaskGraph/graph.less +23 -0
- package/lib/TaskGraph/index.d.ts +16 -0
- package/lib/TaskGraph/index.js +163 -0
- package/lib/TaskGraph/index.less +117 -0
- package/lib/TaskGraph/locale/en-US.js +36 -0
- package/lib/TaskGraph/locale/zh-CN.js +36 -0
- package/lib/TaskGraph/locale/zh-TW.js +36 -0
- package/lib/TaskGraph/register.d.ts +7 -0
- package/lib/TaskGraph/register.js +205 -0
- package/lib/TreeSearch/index.d.ts +38 -0
- package/lib/TreeSearch/index.js +135 -0
- package/lib/TreeSearch/util.d.ts +21 -0
- package/lib/TreeSearch/util.js +110 -0
- package/lib/Welcome/index.d.ts +38 -0
- package/lib/Welcome/index.js +102 -0
- package/lib/Welcome/index.less +186 -0
- package/lib/Welcome/locale/en-US.js +28 -0
- package/lib/Welcome/locale/zh-CN.js +28 -0
- package/lib/Welcome/locale/zh-TW.js +28 -0
- package/lib/Welcome/step.d.ts +18 -0
- package/lib/Welcome/step.js +51 -0
- package/lib/_util/genComponentStyleHook.d.ts +14 -0
- package/lib/_util/genComponentStyleHook.js +58 -0
- package/lib/_util/index.js +67 -0
- package/lib/_util/useHistory.js +30 -0
- package/lib/assets/background_img.svg +30 -0
- package/lib/assets/graph_fit_view_icon.svg +14 -0
- package/lib/assets/graph_reset_icon.svg +14 -0
- package/lib/assets/logo/oceanbase_logo.svg +29 -0
- package/lib/assets/logo/oceanbase_watermark.svg +31 -0
- package/lib/assets/monitor.svg +21 -0
- package/lib/assets/user.svg +16 -0
- package/lib/constant/index.js +51 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.js +115 -0
- package/lib/index.less +14 -0
- package/lib/interface.js +17 -0
- package/lib/locale/LocaleWrapper.d.ts +10 -0
- package/lib/locale/LocaleWrapper.js +69 -0
- package/lib/locale/en-US.js +67 -0
- package/lib/locale/index.js +17 -0
- package/lib/locale/zh-CN.js +68 -0
- package/lib/locale/zh-TW.js +62 -0
- package/lib/variable.less +54 -0
- package/package.json +70 -0
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
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); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
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); }
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
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); }; }
|
|
11
|
+
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); }
|
|
12
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
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; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
import { CloseOutlined, ExpandAltOutlined, FullscreenExitOutlined, FullscreenOutlined, MinusOutlined } from '@ant-design/icons';
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import { createPortal } from 'react-dom';
|
|
21
|
+
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
22
|
+
import { getPrefix } from "../_util";
|
|
23
|
+
import { Anchor } from "./Anchor";
|
|
24
|
+
import { Dock } from "./Dock";
|
|
25
|
+
import { EventProxy } from "./EventProxy";
|
|
26
|
+
import zhCN from "./locale/zh-CN";
|
|
27
|
+
import "./index.less";
|
|
28
|
+
var prefix = getPrefix('dialog');
|
|
29
|
+
var DEFAULT_LEFT = 0.1;
|
|
30
|
+
var DEFAULT_TOP = 0.1;
|
|
31
|
+
var MINIMIZE_HEIGHT = 36;
|
|
32
|
+
var MINIMIZE_WIDTH = 320;
|
|
33
|
+
var DEFAULT_MIN = [320, 256];
|
|
34
|
+
var DEFAULT_WIDTH_MEMBER = 520;
|
|
35
|
+
var DEFAULT_HEIGHT_MEMBER = 600;
|
|
36
|
+
var DEFAULT_BORDER_WIDTH = 24;
|
|
37
|
+
// 预留滚动条宽度
|
|
38
|
+
var SCROLL_BAR_WIDTH = 1;
|
|
39
|
+
var DialogComp = /*#__PURE__*/function (_React$PureComponent) {
|
|
40
|
+
_inherits(DialogComp, _React$PureComponent);
|
|
41
|
+
var _super = _createSuper(DialogComp);
|
|
42
|
+
function DialogComp() {
|
|
43
|
+
var _this$props$width, _this$props$height, _this$props$left, _this$props$width2, _this$props$top, _this$props$height2;
|
|
44
|
+
var _this;
|
|
45
|
+
_classCallCheck(this, DialogComp);
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
51
|
+
mask: true,
|
|
52
|
+
width: (_this$props$width = _this.props.width) !== null && _this$props$width !== void 0 ? _this$props$width : DEFAULT_WIDTH_MEMBER,
|
|
53
|
+
height: (_this$props$height = _this.props.height) !== null && _this$props$height !== void 0 ? _this$props$height : DEFAULT_HEIGHT_MEMBER,
|
|
54
|
+
left: (_this$props$left = _this.props.left) !== null && _this$props$left !== void 0 ? _this$props$left : _this.props.clientWidth - ((_this$props$width2 = _this.props.width) !== null && _this$props$width2 !== void 0 ? _this$props$width2 : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
|
|
55
|
+
top: (_this$props$top = _this.props.top) !== null && _this$props$top !== void 0 ? _this$props$top : _this.props.clientHeight - ((_this$props$height2 = _this.props.height) !== null && _this$props$height2 !== void 0 ? _this$props$height2 : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH,
|
|
56
|
+
moveX: 0,
|
|
57
|
+
moveY: 0,
|
|
58
|
+
maximization: _this.props.isEmbed,
|
|
59
|
+
minimize: false,
|
|
60
|
+
headerStyle: {}
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "clientX", 0);
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "clientY", 0);
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "getDefaultEmbedState", function () {
|
|
65
|
+
var _this$props = _this.props,
|
|
66
|
+
clientHeight = _this$props.clientHeight,
|
|
67
|
+
clientWidth = _this$props.clientWidth,
|
|
68
|
+
width = _this$props.width,
|
|
69
|
+
height = _this$props.height,
|
|
70
|
+
left = _this$props.left,
|
|
71
|
+
top = _this$props.top;
|
|
72
|
+
return {
|
|
73
|
+
width: width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER,
|
|
74
|
+
height: height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER,
|
|
75
|
+
left: left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
|
|
76
|
+
top: top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "host", document.createElement('div'));
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "isPointDown", false);
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "onDragStart", function (event) {
|
|
82
|
+
if (!_this.props.draggable) return;
|
|
83
|
+
var maximization = _this.state.maximization;
|
|
84
|
+
if (maximization) return;
|
|
85
|
+
_this.setState(_objectSpread(_objectSpread({
|
|
86
|
+
mask: true
|
|
87
|
+
}, _this.state.left === undefined ? {
|
|
88
|
+
left: DEFAULT_LEFT
|
|
89
|
+
} : {}), _this.state.top === undefined ? {
|
|
90
|
+
top: DEFAULT_TOP
|
|
91
|
+
} : {}));
|
|
92
|
+
_this.clientX = event.clientX;
|
|
93
|
+
_this.clientY = event.clientY;
|
|
94
|
+
_this.isPointDown = true;
|
|
95
|
+
});
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "onDragMove", function (event) {
|
|
97
|
+
if (!_this.props.draggable || !_this.isPointDown) return;
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
_this.setState({
|
|
100
|
+
moveX: event.clientX - _this.clientX,
|
|
101
|
+
moveY: event.clientY - _this.clientY
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "onDragEnd", function () {
|
|
105
|
+
var draggable = _this.props.draggable;
|
|
106
|
+
if (!draggable) return;
|
|
107
|
+
_this.isPointDown = false;
|
|
108
|
+
if (_this.state.moveX === 0 && _this.state.moveY === 0) return;
|
|
109
|
+
_this.setState({
|
|
110
|
+
mask: false,
|
|
111
|
+
left: _this.state.left + _this.state.moveX,
|
|
112
|
+
top: _this.state.top + _this.state.moveY,
|
|
113
|
+
moveX: 0,
|
|
114
|
+
moveY: 0
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
_defineProperty(_assertThisInitialized(_this), "toggleMinimize", function () {
|
|
118
|
+
_this.setState({
|
|
119
|
+
maximization: false,
|
|
120
|
+
minimize: !_this.state.minimize
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
_defineProperty(_assertThisInitialized(_this), "toggleMaximization", function () {
|
|
124
|
+
// 嵌入模式不支持toggleMaximization
|
|
125
|
+
var enable = _this.props.resizable && _this.props.enableMaximization && !_this.props.isEmbed;
|
|
126
|
+
if (!enable) return;
|
|
127
|
+
_this.setState({
|
|
128
|
+
maximization: !_this.state.maximization,
|
|
129
|
+
minimize: false
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
_defineProperty(_assertThisInitialized(_this), "onClose", function (event) {
|
|
133
|
+
var _this$props$onClose, _this$props2;
|
|
134
|
+
event.stopPropagation();
|
|
135
|
+
(_this$props$onClose = (_this$props2 = _this.props).onClose) === null || _this$props$onClose === void 0 ? void 0 : _this$props$onClose.call(_this$props2);
|
|
136
|
+
});
|
|
137
|
+
_defineProperty(_assertThisInitialized(_this), "getBaseStyle", function () {
|
|
138
|
+
var visible = _this.props.visible;
|
|
139
|
+
// 通过样式控制显隐
|
|
140
|
+
var baseStyle = {
|
|
141
|
+
visibility: visible ? 'visible' : 'hidden',
|
|
142
|
+
opacity: visible ? 1 : 0
|
|
143
|
+
};
|
|
144
|
+
return baseStyle;
|
|
145
|
+
});
|
|
146
|
+
_defineProperty(_assertThisInitialized(_this), "getStyle", function () {
|
|
147
|
+
var _this$state = _this.state,
|
|
148
|
+
maximization = _this$state.maximization,
|
|
149
|
+
minimize = _this$state.minimize,
|
|
150
|
+
headerStyle = _this$state.headerStyle;
|
|
151
|
+
var transform = "translate(".concat(_this.state.moveX, "px, ").concat(_this.state.moveY, "px)");
|
|
152
|
+
var baseStyle = _this.getBaseStyle();
|
|
153
|
+
if (maximization && !_this.props.isEmbed) {
|
|
154
|
+
return _objectSpread(_objectSpread({}, baseStyle), {}, {
|
|
155
|
+
top: 0,
|
|
156
|
+
bottom: 0,
|
|
157
|
+
right: 0,
|
|
158
|
+
width: _this.props.width || DEFAULT_WIDTH_MEMBER,
|
|
159
|
+
height: 'auto',
|
|
160
|
+
borderRadius: 0
|
|
161
|
+
});
|
|
162
|
+
} else if (minimize) {
|
|
163
|
+
var _ref = headerStyle,
|
|
164
|
+
height = _ref.height;
|
|
165
|
+
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
|
|
166
|
+
width: MINIMIZE_WIDTH,
|
|
167
|
+
height: height || MINIMIZE_HEIGHT,
|
|
168
|
+
transform: transform
|
|
169
|
+
});
|
|
170
|
+
} else {
|
|
171
|
+
return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
|
|
172
|
+
transform: transform
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
_defineProperty(_assertThisInitialized(_this), "compatClonedModel", function (model) {
|
|
177
|
+
return _objectSpread({
|
|
178
|
+
left: DEFAULT_LEFT,
|
|
179
|
+
top: DEFAULT_TOP,
|
|
180
|
+
width: DEFAULT_WIDTH_MEMBER / _this.props.clientWidth,
|
|
181
|
+
height: DEFAULT_HEIGHT_MEMBER / _this.props.clientHeight,
|
|
182
|
+
minimize: false,
|
|
183
|
+
maximization: false
|
|
184
|
+
}, model);
|
|
185
|
+
});
|
|
186
|
+
_defineProperty(_assertThisInitialized(_this), "detectPointUp", function () {
|
|
187
|
+
_this.setState({
|
|
188
|
+
mask: false
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
_defineProperty(_assertThisInitialized(_this), "originInfo", void 0);
|
|
192
|
+
_defineProperty(_assertThisInitialized(_this), "setRootWidthInEmbedMode", function (newWidth) {
|
|
193
|
+
var setRootWidth = _this.props.setRootWidth;
|
|
194
|
+
var restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
|
|
195
|
+
var rootWidth = (_this.props.clientWidth - restWidth) / _this.props.clientWidth;
|
|
196
|
+
setRootWidth === null || setRootWidth === void 0 ? void 0 : setRootWidth("".concat(rootWidth * 100, "%"));
|
|
197
|
+
});
|
|
198
|
+
_defineProperty(_assertThisInitialized(_this), "onResizeStart", function () {
|
|
199
|
+
if (_this.state.minimize || !_this.props.resizable) return;
|
|
200
|
+
_this.originInfo = _this.compatClonedModel(_this.state);
|
|
201
|
+
_this.setState({
|
|
202
|
+
mask: true
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
_defineProperty(_assertThisInitialized(_this), "onResizeMove", function (event) {
|
|
206
|
+
var resizable = _this.props.resizable;
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
if (_this.state.minimize || !resizable) return;
|
|
209
|
+
// 以下PointerEvent没有moveRight属性,通过event传递,所以加上了ts-ignore
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
var newWidth = _this.originInfo.width + event.moveRight;
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
var newHeight = _this.originInfo.height + event.moveBottom;
|
|
214
|
+
var checkResult = _this.checkSize(newWidth, newHeight);
|
|
215
|
+
|
|
216
|
+
// 只在宽度允许发生改变时设置外部width
|
|
217
|
+
if (checkResult.widthShouldChange) {
|
|
218
|
+
_this.setRootWidthInEmbedMode(newWidth);
|
|
219
|
+
}
|
|
220
|
+
_this.setState(_objectSpread(_objectSpread({}, checkResult.widthShouldChange ? {
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
left: _this.originInfo.left + event.moveLeft,
|
|
223
|
+
width: newWidth
|
|
224
|
+
} : {}), checkResult.heightShouldChange ? {
|
|
225
|
+
// @ts-ignore
|
|
226
|
+
top: _this.originInfo.top + event.moveTop,
|
|
227
|
+
height: newHeight
|
|
228
|
+
} : {}));
|
|
229
|
+
});
|
|
230
|
+
_defineProperty(_assertThisInitialized(_this), "onResizeEnd", function () {
|
|
231
|
+
var mask = _this.state.mask;
|
|
232
|
+
if (!mask || !_this.props.resizable) return;
|
|
233
|
+
_this.setState({
|
|
234
|
+
mask: false
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
return _this;
|
|
238
|
+
}
|
|
239
|
+
_createClass(DialogComp, [{
|
|
240
|
+
key: "componentDidMount",
|
|
241
|
+
value: function componentDidMount() {
|
|
242
|
+
DialogComp.container.appendChild(this.host);
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
key: "componentDidUpdate",
|
|
246
|
+
value: function componentDidUpdate(prevProps, _) {
|
|
247
|
+
var preVisible = prevProps.visible,
|
|
248
|
+
preClientWidth = prevProps.clientWidth,
|
|
249
|
+
preClientHeight = prevProps.clientHeight,
|
|
250
|
+
preIsEmbed = prevProps.isEmbed;
|
|
251
|
+
var _this$props3 = this.props,
|
|
252
|
+
visible = _this$props3.visible,
|
|
253
|
+
isEmbed = _this$props3.isEmbed,
|
|
254
|
+
clientWidth = _this$props3.clientWidth,
|
|
255
|
+
clientHeight = _this$props3.clientHeight,
|
|
256
|
+
height = _this$props3.height,
|
|
257
|
+
width = _this$props3.width,
|
|
258
|
+
top = _this$props3.top,
|
|
259
|
+
left = _this$props3.left;
|
|
260
|
+
// 嵌入式切换非嵌入式,属性重置
|
|
261
|
+
if (preIsEmbed && !isEmbed) {
|
|
262
|
+
this.setRootWidthInEmbedMode(0);
|
|
263
|
+
this.setState(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
264
|
+
minimize: false,
|
|
265
|
+
maximization: false
|
|
266
|
+
}, height ? {
|
|
267
|
+
height: height
|
|
268
|
+
} : {}), width ? {
|
|
269
|
+
width: width
|
|
270
|
+
} : {}), top ? {
|
|
271
|
+
top: top
|
|
272
|
+
} : {}), left ? {
|
|
273
|
+
left: left
|
|
274
|
+
} : {}));
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
// 非嵌入式切换嵌入式,属性重置
|
|
278
|
+
if (!preIsEmbed && isEmbed) {
|
|
279
|
+
this.setState({
|
|
280
|
+
minimize: false,
|
|
281
|
+
maximization: true
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
if (visible) {
|
|
285
|
+
if (!preVisible || clientWidth !== preClientWidth || clientHeight !== preClientHeight) {
|
|
286
|
+
var tempState = this.getDefaultEmbedState();
|
|
287
|
+
this.setState(tempState);
|
|
288
|
+
this.setRootWidthInEmbedMode(tempState === null || tempState === void 0 ? void 0 : tempState.width);
|
|
289
|
+
}
|
|
290
|
+
} else if (preVisible && !visible) {
|
|
291
|
+
this.setRootWidthInEmbedMode(0);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
key: "componentWillUnmount",
|
|
296
|
+
value: function componentWillUnmount() {
|
|
297
|
+
DialogComp.container.removeChild(this.host);
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
key: "max",
|
|
301
|
+
get: function get() {
|
|
302
|
+
var max = this.props.max;
|
|
303
|
+
if (!max) {
|
|
304
|
+
var _this$props4 = this.props,
|
|
305
|
+
clientWidth = _this$props4.clientWidth,
|
|
306
|
+
clientHeight = _this$props4.clientHeight;
|
|
307
|
+
max = [clientWidth, clientHeight];
|
|
308
|
+
}
|
|
309
|
+
return max;
|
|
310
|
+
}
|
|
311
|
+
}, {
|
|
312
|
+
key: "min",
|
|
313
|
+
get: function get() {
|
|
314
|
+
return this.props.min;
|
|
315
|
+
}
|
|
316
|
+
}, {
|
|
317
|
+
key: "hasMask",
|
|
318
|
+
get: function get() {
|
|
319
|
+
return this.state.mask;
|
|
320
|
+
}
|
|
321
|
+
}, {
|
|
322
|
+
key: "renderHeader",
|
|
323
|
+
value: function renderHeader() {
|
|
324
|
+
var _this$props5 = this.props,
|
|
325
|
+
locale = _this$props5.locale,
|
|
326
|
+
title = _this$props5.title,
|
|
327
|
+
isEmbed = _this$props5.isEmbed;
|
|
328
|
+
var _this$state2 = this.state,
|
|
329
|
+
headerStyle = _this$state2.headerStyle,
|
|
330
|
+
minimize = _this$state2.minimize;
|
|
331
|
+
var style = _objectSpread(_objectSpread(_objectSpread({}, headerStyle), minimize ? {
|
|
332
|
+
boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
|
|
333
|
+
} : {}), isEmbed ? {
|
|
334
|
+
cursor: 'initial'
|
|
335
|
+
} : {});
|
|
336
|
+
return /*#__PURE__*/React.createElement("header", {
|
|
337
|
+
className: "".concat(prefix, "-header"),
|
|
338
|
+
style: style,
|
|
339
|
+
onPointerDown: this.onDragStart,
|
|
340
|
+
onDoubleClick: this.toggleMaximization
|
|
341
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
342
|
+
className: "".concat(prefix, "-title")
|
|
343
|
+
}, title || locale.helpDocument), this.renderControls());
|
|
344
|
+
}
|
|
345
|
+
}, {
|
|
346
|
+
key: "renderControlLink",
|
|
347
|
+
value: function renderControlLink() {
|
|
348
|
+
var extLink = this.props.extLink;
|
|
349
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
350
|
+
className: "".concat(prefix, "-item")
|
|
351
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
352
|
+
className: "".concat(prefix, "-item-link"),
|
|
353
|
+
href: extLink === null || extLink === void 0 ? void 0 : extLink.link,
|
|
354
|
+
target: "_blank",
|
|
355
|
+
rel: "noopener noreferrer"
|
|
356
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
357
|
+
// t="1679557306532"
|
|
358
|
+
className: "icon",
|
|
359
|
+
viewBox: "0 0 1024 1024",
|
|
360
|
+
version: "1.1",
|
|
361
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
362
|
+
// p-id="2545"
|
|
363
|
+
,
|
|
364
|
+
width: "16",
|
|
365
|
+
height: "16"
|
|
366
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
367
|
+
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"
|
|
368
|
+
// p-id="2546"
|
|
369
|
+
}))));
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
key: "renderControls",
|
|
373
|
+
value: function renderControls() {
|
|
374
|
+
var _this$state3 = this.state,
|
|
375
|
+
maximization = _this$state3.maximization,
|
|
376
|
+
minimize = _this$state3.minimize;
|
|
377
|
+
var _this$props6 = this.props,
|
|
378
|
+
enableMaximization = _this$props6.enableMaximization,
|
|
379
|
+
isEmbed = _this$props6.isEmbed;
|
|
380
|
+
if (isEmbed) {
|
|
381
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
382
|
+
className: "".concat(prefix, "-controls")
|
|
383
|
+
}, this.renderControlLink(), /*#__PURE__*/React.createElement("span", {
|
|
384
|
+
className: "".concat(prefix, "-item"),
|
|
385
|
+
onClick: this.onClose
|
|
386
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null)));
|
|
387
|
+
}
|
|
388
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
389
|
+
className: "".concat(prefix, "-controls")
|
|
390
|
+
}, this.renderControlLink(), /*#__PURE__*/React.createElement("span", {
|
|
391
|
+
className: "".concat(prefix, "-item"),
|
|
392
|
+
onClick: this.toggleMinimize
|
|
393
|
+
}, minimize ? /*#__PURE__*/React.createElement(ExpandAltOutlined, null) : /*#__PURE__*/React.createElement(MinusOutlined, null)), enableMaximization && /*#__PURE__*/React.createElement("span", {
|
|
394
|
+
className: "".concat(prefix, "-item"),
|
|
395
|
+
onClick: this.toggleMaximization
|
|
396
|
+
}, maximization ? /*#__PURE__*/React.createElement(FullscreenExitOutlined, null) : /*#__PURE__*/React.createElement(FullscreenOutlined, null)), /*#__PURE__*/React.createElement("span", {
|
|
397
|
+
className: "".concat(prefix, "-item"),
|
|
398
|
+
onClick: this.onClose
|
|
399
|
+
}, /*#__PURE__*/React.createElement(CloseOutlined, null)));
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "renderContent",
|
|
403
|
+
value: function renderContent() {
|
|
404
|
+
var children = this.props.children;
|
|
405
|
+
return /*#__PURE__*/React.createElement("main", {
|
|
406
|
+
className: "".concat(prefix, "-main"),
|
|
407
|
+
style: this.state.minimize ? {
|
|
408
|
+
visibility: 'hidden'
|
|
409
|
+
} : {}
|
|
410
|
+
}, this.renderMask(), children);
|
|
411
|
+
}
|
|
412
|
+
}, {
|
|
413
|
+
key: "renderMask",
|
|
414
|
+
value: function renderMask() {
|
|
415
|
+
if (!this.hasMask) return;
|
|
416
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
417
|
+
className: "".concat(prefix, "-mask")
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}, {
|
|
421
|
+
key: "getCompatAbsPostion",
|
|
422
|
+
value:
|
|
423
|
+
// 将比例转换为绝对数值,各个端的渲染依据视口大小会有不同
|
|
424
|
+
function getCompatAbsPostion(info) {
|
|
425
|
+
var compatInfo = this.compatClonedModel(info);
|
|
426
|
+
var minimize = compatInfo.minimize;
|
|
427
|
+
var _this$props7 = this.props,
|
|
428
|
+
clientWidth = _this$props7.clientWidth,
|
|
429
|
+
clientHeight = _this$props7.clientHeight;
|
|
430
|
+
var ret = {};
|
|
431
|
+
['left', 'width', 'top', 'height'].forEach(function (key) {
|
|
432
|
+
ret[key] = compatInfo[key];
|
|
433
|
+
});
|
|
434
|
+
var max = this.max;
|
|
435
|
+
var min = this.min;
|
|
436
|
+
// 最小宽度
|
|
437
|
+
if (max && ret.width > max[0]) {
|
|
438
|
+
ret.width = max[0];
|
|
439
|
+
}
|
|
440
|
+
if (max && ret.height > max[1]) {
|
|
441
|
+
ret.height = max[1];
|
|
442
|
+
}
|
|
443
|
+
if (min && ret.width < min[0]) {
|
|
444
|
+
ret.width = min[0];
|
|
445
|
+
}
|
|
446
|
+
if (min && ret.height < min[1]) {
|
|
447
|
+
ret.height = min[1];
|
|
448
|
+
}
|
|
449
|
+
ret.width = minimize ? MINIMIZE_WIDTH : ret.width;
|
|
450
|
+
ret.height = minimize ? MINIMIZE_HEIGHT : ret.height;
|
|
451
|
+
if (ret.left + ret.width > clientWidth) {
|
|
452
|
+
ret.left = clientWidth - ret.width;
|
|
453
|
+
this.setState({
|
|
454
|
+
left: ret.left
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
if (ret.left < 0) {
|
|
458
|
+
this.setState({
|
|
459
|
+
left: 0
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
if (ret.top < 0) {
|
|
463
|
+
this.setState({
|
|
464
|
+
top: 0
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
if (ret.top + ret.height > clientHeight) {
|
|
468
|
+
ret.top = clientHeight - ret.height;
|
|
469
|
+
this.setState({
|
|
470
|
+
top: ret.top
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
return ret;
|
|
474
|
+
}
|
|
475
|
+
}, {
|
|
476
|
+
key: "renderDialog",
|
|
477
|
+
value: function renderDialog() {
|
|
478
|
+
var style = this.getStyle();
|
|
479
|
+
var _this$props8 = this.props,
|
|
480
|
+
className = _this$props8.className,
|
|
481
|
+
isEmbed = _this$props8.isEmbed;
|
|
482
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
483
|
+
className: "".concat(prefix, "-container ").concat(className, " ").concat(isEmbed ? "".concat(prefix, "-container-embed") : ''),
|
|
484
|
+
style: style
|
|
485
|
+
}, this.state.minimize ? {} : {
|
|
486
|
+
tabIndex: 0
|
|
487
|
+
}), this.renderHeader(), this.renderContent(), isEmbed ? this.renderEmbedBorders() : this.renderBorders(), /*#__PURE__*/React.createElement(EventProxy, {
|
|
488
|
+
onPointerMove: this.onDragMove,
|
|
489
|
+
onPointerUp: this.onDragEnd
|
|
490
|
+
}), /*#__PURE__*/React.createElement(EventProxy, {
|
|
491
|
+
onPointerUp: this.detectPointUp
|
|
492
|
+
})));
|
|
493
|
+
}
|
|
494
|
+
}, {
|
|
495
|
+
key: "checkSize",
|
|
496
|
+
value:
|
|
497
|
+
/**
|
|
498
|
+
* width,height 是否在最大最小值的范围内
|
|
499
|
+
*/
|
|
500
|
+
function checkSize(width, height) {
|
|
501
|
+
var max = this.max;
|
|
502
|
+
var min = this.min;
|
|
503
|
+
var newModel = {};
|
|
504
|
+
var result = {
|
|
505
|
+
widthShouldChange: true,
|
|
506
|
+
heightShouldChange: true
|
|
507
|
+
};
|
|
508
|
+
if (min && width < min[0]) {
|
|
509
|
+
newModel.width = min[0];
|
|
510
|
+
result.widthShouldChange = false;
|
|
511
|
+
}
|
|
512
|
+
if (min && height < min[1]) {
|
|
513
|
+
newModel.height = min[1];
|
|
514
|
+
result.heightShouldChange = false;
|
|
515
|
+
}
|
|
516
|
+
if (max && width > max[0]) {
|
|
517
|
+
newModel.width = max[0];
|
|
518
|
+
result.widthShouldChange = false;
|
|
519
|
+
}
|
|
520
|
+
if (max && height > max[1]) {
|
|
521
|
+
newModel.height = max[1];
|
|
522
|
+
result.heightShouldChange = false;
|
|
523
|
+
}
|
|
524
|
+
return result;
|
|
525
|
+
}
|
|
526
|
+
}, {
|
|
527
|
+
key: "renderEmbedBorders",
|
|
528
|
+
value: function renderEmbedBorders() {
|
|
529
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
|
|
530
|
+
dock: Dock.left,
|
|
531
|
+
onStart: this.onResizeStart,
|
|
532
|
+
onMove: this.onResizeMove,
|
|
533
|
+
onEnd: this.onResizeEnd
|
|
534
|
+
}));
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
key: "renderBorders",
|
|
538
|
+
value: function renderBorders() {
|
|
539
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
|
|
540
|
+
dock: Dock.top,
|
|
541
|
+
onStart: this.onResizeStart,
|
|
542
|
+
onMove: this.onResizeMove,
|
|
543
|
+
onEnd: this.onResizeEnd
|
|
544
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
545
|
+
dock: Dock.right,
|
|
546
|
+
onStart: this.onResizeStart,
|
|
547
|
+
onMove: this.onResizeMove,
|
|
548
|
+
onEnd: this.onResizeEnd
|
|
549
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
550
|
+
dock: Dock.bottom,
|
|
551
|
+
onStart: this.onResizeStart,
|
|
552
|
+
onMove: this.onResizeMove,
|
|
553
|
+
onEnd: this.onResizeEnd
|
|
554
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
555
|
+
dock: Dock.left,
|
|
556
|
+
onStart: this.onResizeStart,
|
|
557
|
+
onMove: this.onResizeMove,
|
|
558
|
+
onEnd: this.onResizeEnd
|
|
559
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
560
|
+
dock: Dock.topLeft,
|
|
561
|
+
onStart: this.onResizeStart,
|
|
562
|
+
onMove: this.onResizeMove,
|
|
563
|
+
onEnd: this.onResizeEnd
|
|
564
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
565
|
+
dock: Dock.topRight,
|
|
566
|
+
onStart: this.onResizeStart,
|
|
567
|
+
onMove: this.onResizeMove,
|
|
568
|
+
onEnd: this.onResizeEnd
|
|
569
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
570
|
+
dock: Dock.bottomLeft,
|
|
571
|
+
onStart: this.onResizeStart,
|
|
572
|
+
onMove: this.onResizeMove,
|
|
573
|
+
onEnd: this.onResizeEnd
|
|
574
|
+
}), /*#__PURE__*/React.createElement(Anchor, {
|
|
575
|
+
dock: Dock.bottomRight,
|
|
576
|
+
onStart: this.onResizeStart,
|
|
577
|
+
onMove: this.onResizeMove,
|
|
578
|
+
onEnd: this.onResizeEnd
|
|
579
|
+
}));
|
|
580
|
+
}
|
|
581
|
+
}, {
|
|
582
|
+
key: "render",
|
|
583
|
+
value: function render() {
|
|
584
|
+
var _this$props9 = this.props,
|
|
585
|
+
visible = _this$props9.visible,
|
|
586
|
+
isEmbed = _this$props9.isEmbed;
|
|
587
|
+
// 嵌入模式通过style控制显隐
|
|
588
|
+
if (!visible && !isEmbed) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
589
|
+
return /*#__PURE__*/createPortal(this.renderDialog(), DialogComp.container);
|
|
590
|
+
}
|
|
591
|
+
}], [{
|
|
592
|
+
key: "container",
|
|
593
|
+
get: function get() {
|
|
594
|
+
if (!this._container) {
|
|
595
|
+
this._container = document.createElement('div');
|
|
596
|
+
document.body.appendChild(this._container);
|
|
597
|
+
}
|
|
598
|
+
return this._container;
|
|
599
|
+
}
|
|
600
|
+
}]);
|
|
601
|
+
return DialogComp;
|
|
602
|
+
}(React.PureComponent);
|
|
603
|
+
_defineProperty(DialogComp, "defaultProps", {
|
|
604
|
+
min: DEFAULT_MIN,
|
|
605
|
+
resizable: true,
|
|
606
|
+
draggable: true,
|
|
607
|
+
enableMaximization: true,
|
|
608
|
+
isEmbed: false
|
|
609
|
+
});
|
|
610
|
+
_defineProperty(DialogComp, "_container", void 0);
|
|
611
|
+
export default LocaleWrapper({
|
|
612
|
+
componentName: 'Dialog',
|
|
613
|
+
defaultLocale: zhCN
|
|
614
|
+
})(DialogComp);
|