@oceanbase/ui 1.0.0-alpha.0 → 1.0.0-alpha.10
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 +121 -15
- package/es/Action/Item.d.ts +6 -15
- package/es/Action/Item.js +85 -128
- package/es/Action/index.d.ts +6 -3
- package/es/Action/style/index.d.ts +2 -2
- package/es/Action/style/index.js +8 -4
- 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 +17 -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 +11 -5
- package/es/Boundary/Components/Exception.js +85 -74
- package/es/Boundary/Components/Function.js +11 -5
- package/es/Boundary/index.d.ts +0 -1
- package/es/Boundary/index.js +0 -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 +29 -29
- package/es/ContentWithIcon/style/index.d.ts +10 -0
- package/es/ContentWithIcon/style/index.js +26 -0
- package/es/DateRanger/PickerPanel.js +5 -4
- package/es/DateRanger/Ranger.d.ts +4 -1
- package/es/DateRanger/Ranger.js +168 -19
- package/es/DateRanger/constant/index.js +1 -1
- 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 +67 -96
- package/es/Dialog/index.d.ts +0 -1
- package/es/Dialog/index.js +537 -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/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.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 +46 -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/index.d.ts +0 -1
- package/es/Highlight/DiffView/index.js +5 -5
- package/es/Highlight/JsonView.d.ts +0 -1
- package/es/Highlight/JsonView.js +5 -5
- package/es/Highlight/index.d.ts +0 -1
- package/es/Highlight/index.js +23 -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/LocaleDropdown/index.js +4 -2
- package/es/Login/ActivateForm.d.ts +0 -1
- package/es/Login/ActivateForm.js +12 -9
- package/es/Login/LoginForm.d.ts +0 -1
- package/es/Login/LoginForm.js +20 -15
- package/es/Login/RegisterForm.d.ts +0 -1
- package/es/Login/RegisterForm.js +14 -11
- package/es/Login/index.d.ts +0 -1
- package/es/Login/index.js +24 -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/NavMenu/index.d.ts +1 -2
- package/es/NavMenu/index.js +11 -8
- package/es/NavMenu/style/index.d.ts +10 -0
- package/es/NavMenu/style/index.js +47 -0
- package/es/PageContainer/index.d.ts +2 -0
- package/es/PageContainer/index.js +102 -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/Password/index.js +1 -1
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/ProCard/index.d.ts +2 -1
- package/es/ProCard/index.js +20 -8
- 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 +23 -8
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +12 -5
- package/es/Ranger/QuickPicker.js +8 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +12 -9
- 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/index.d.ts +0 -1
- package/es/SideTip/index.js +24 -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 +5 -3
- package/es/TagSelect/Item.js +5 -3
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +30 -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 +17 -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/index.d.ts +0 -5
- package/es/index.js +0 -3
- package/es/locale/en-US.js +0 -4
- 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 +122 -46
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +66 -76
- package/lib/Action/index.d.ts +6 -3
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/Action/style/index.js +16 -1
- package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
- package/lib/BackgroundTaskManager/index.js +3 -12
- package/lib/BasicLayout/Header.js +120 -62
- package/lib/BasicLayout/index.js +166 -143
- package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/lib/BasicLayout/locale/ja-JP.js +36 -0
- package/lib/BasicLayout/style/index.js +32 -23
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +70 -51
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/{TaskGraph/locale/en-US.js → BatchOperationBar/locale/ja-JP.js} +10 -16
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +82 -0
- package/lib/Boundary/Components/Code.js +25 -13
- package/lib/Boundary/Components/Exception.js +70 -49
- package/lib/Boundary/Components/Function.js +20 -8
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +0 -1
- package/lib/Boundary/locale/en-US.js +1 -1
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +34 -0
- package/lib/Boundary/locale/zh-CN.js +1 -1
- package/lib/Boundary/locale/zh-TW.js +1 -1
- package/lib/Boundary/style/index.d.ts +10 -0
- package/lib/Boundary/style/index.js +74 -0
- package/lib/ContentWithIcon/index.d.ts +0 -1
- package/lib/ContentWithIcon/index.js +44 -33
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +57 -0
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +237 -219
- package/lib/DateRanger/Ranger.d.ts +4 -1
- package/lib/DateRanger/Ranger.js +413 -239
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +49 -0
- package/lib/DateRanger/style/index.d.ts +10 -0
- package/lib/DateRanger/style/index.js +195 -0
- package/lib/Dialog/Anchor.d.ts +2 -10
- package/lib/Dialog/Anchor.js +59 -58
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.d.ts +0 -1
- package/lib/Dialog/index.js +514 -466
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/{GraphToolbar/locale/en-US.js → Dialog/locale/ja-JP.js} +8 -12
- package/lib/Dialog/locale/zh-CN.js +1 -1
- package/lib/Dialog/locale/zh-TW.js +1 -1
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +135 -0
- package/lib/DocDialog/index.js +3 -2
- package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
- package/lib/DocDialog/locale/ja-JP.js +25 -0
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +7 -18
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +51 -33
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +25 -0
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +86 -0
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +38 -34
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +18 -17
- package/lib/Highlight/index.d.ts +0 -1
- package/lib/Highlight/index.js +60 -52
- package/lib/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/{GraphToolbar/locale/zh-CN.js → Highlight/locale/ja-JP.js} +7 -12
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +293 -0
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +15 -21
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +65 -64
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +134 -113
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +90 -89
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +102 -72
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +51 -0
- package/lib/Login/locale/zh-CN.js +2 -2
- package/lib/Login/style/index.d.ts +10 -0
- package/lib/Login/style/index.js +267 -0
- package/lib/NavMenu/index.d.ts +1 -2
- package/lib/NavMenu/index.js +22 -18
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +78 -0
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.d.ts +2 -0
- package/lib/PageContainer/index.js +86 -10
- package/lib/PageContainer/locale/en-US.d.ts +1 -0
- package/lib/PageContainer/locale/en-US.js +2 -1
- package/lib/PageContainer/locale/ja-JP.d.ts +5 -0
- package/lib/{GraphToolbar/locale/zh-TW.js → PageContainer/locale/ja-JP.js} +8 -12
- package/lib/PageContainer/locale/zh-CN.d.ts +1 -0
- package/lib/PageContainer/locale/zh-CN.js +2 -1
- package/lib/PageContainer/locale/zh-TW.d.ts +1 -0
- package/lib/PageContainer/locale/zh-TW.js +2 -1
- package/lib/PageContainer/style/index.js +44 -13
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/Password/locale/ja-JP.d.ts +13 -0
- package/lib/Password/locale/ja-JP.js +36 -0
- package/lib/ProCard/index.d.ts +2 -1
- package/lib/ProCard/index.js +22 -8
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +18 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +22 -10
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +18 -2
- package/lib/Ranger/QuickPicker.js +28 -17
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +49 -43
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +53 -0
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +82 -0
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +55 -38
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +25 -0
- package/lib/SideTip/style/index.d.ts +10 -0
- package/lib/SideTip/style/index.js +211 -0
- package/lib/TagSelect/Group.d.ts +6 -6
- package/lib/TagSelect/Group.js +12 -7
- package/lib/TagSelect/Item.js +25 -20
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +72 -40
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +28 -0
- package/lib/Welcome/step/style/index.d.ts +10 -0
- package/lib/Welcome/step/style/index.js +74 -0
- package/lib/Welcome/step.d.ts +0 -1
- package/lib/Welcome/step.js +18 -7
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +188 -0
- package/lib/_util/genComponentStyleHook.d.ts +4 -3
- package/lib/_util/genComponentStyleHook.js +1 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -7
- package/lib/locale/LocaleWrapper.js +15 -14
- package/lib/locale/en-US.js +16 -20
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +67 -0
- package/lib/locale/zh-CN.js +17 -21
- package/lib/locale/zh-TW.js +15 -19
- package/package.json +8 -11
- 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/zh-CN.d.ts +0 -9
- package/lib/GraphToolbar/locale/zh-TW.d.ts +0 -9
- 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/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
|
@@ -11,18 +11,22 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { DownOutlined, UpOutlined } from '@oceanbase/icons';
|
|
14
|
-
import { Space } from '@oceanbase/design';
|
|
14
|
+
import { ConfigProvider, Space } from '@oceanbase/design';
|
|
15
15
|
import classnames from 'classnames';
|
|
16
16
|
import { cloneDeep, isEmpty, isEqual, pullAllWith } from 'lodash';
|
|
17
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
18
18
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
19
|
-
import "./
|
|
19
|
+
import useStyle from "./style";
|
|
20
20
|
import zhCN from "./locale/zh-CN";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
-
var prefix = 'ob-batch-operation-bar';
|
|
24
23
|
var BatchOperationBar = function BatchOperationBar(props) {
|
|
25
24
|
var _locale$alertText, _locale$alertText$rep;
|
|
25
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
26
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
27
|
+
var prefixCls = getPrefixCls('batch-operation-bar');
|
|
28
|
+
var _useStyle = useStyle(prefixCls),
|
|
29
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
26
30
|
var locale = props === null || props === void 0 ? void 0 : props.locale;
|
|
27
31
|
var title = props.title,
|
|
28
32
|
_props$open = props.open,
|
|
@@ -86,12 +90,12 @@ var BatchOperationBar = function BatchOperationBar(props) {
|
|
|
86
90
|
var disPlayBtnRender = function disPlayBtnRender() {
|
|
87
91
|
if (!showOpenBtn) return null;
|
|
88
92
|
return /*#__PURE__*/_jsxs("div", {
|
|
89
|
-
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(
|
|
93
|
+
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-open-btn"), isOpen), "".concat(prefixCls, "-close-btn"), !isOpen), "".concat(prefixCls, "-display-btn"), true)),
|
|
90
94
|
onClick: function onClick() {
|
|
91
95
|
return setIsOpen(!isOpen);
|
|
92
96
|
},
|
|
93
97
|
children: [/*#__PURE__*/_jsx("span", {
|
|
94
|
-
className: classnames(_defineProperty({}, "".concat(
|
|
98
|
+
className: classnames(_defineProperty({}, "".concat(prefixCls, "-display-text"), true)),
|
|
95
99
|
children: isOpen ? hiddenText : openText
|
|
96
100
|
}), isOpen ? hiddenIcon : openIcon]
|
|
97
101
|
});
|
|
@@ -99,21 +103,21 @@ var BatchOperationBar = function BatchOperationBar(props) {
|
|
|
99
103
|
useEffect(function () {
|
|
100
104
|
if (isEmpty(selectedRows) || !selectedRows) setSelectedData([]);else setSelectedData(selectedRows);
|
|
101
105
|
}, [selectedRows]);
|
|
102
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
103
|
-
className: classnames(_defineProperty(_defineProperty({}, className, !!className),
|
|
106
|
+
return wrapSSR( /*#__PURE__*/_jsxs("div", {
|
|
107
|
+
className: classnames(_defineProperty(_defineProperty({}, className, !!className), prefixCls, true)),
|
|
104
108
|
style: style,
|
|
105
109
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
106
|
-
className: "".concat(
|
|
110
|
+
className: "".concat(prefixCls, "-header"),
|
|
107
111
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
108
112
|
children: [!!alertRender ? alertRender === null || alertRender === void 0 ? void 0 : alertRender(selectedData) : /*#__PURE__*/_jsxs(Space, {
|
|
109
113
|
children: [title && /*#__PURE__*/_jsx("span", {
|
|
110
|
-
className: "".concat(
|
|
114
|
+
className: "".concat(prefixCls, "-title"),
|
|
111
115
|
children: title
|
|
112
116
|
}), /*#__PURE__*/_jsx("span", {
|
|
113
117
|
children: locale === null || locale === void 0 || (_locale$alertText = locale.alertText) === null || _locale$alertText === void 0 || (_locale$alertText$rep = _locale$alertText.replace) === null || _locale$alertText$rep === void 0 ? void 0 : _locale$alertText$rep.call(_locale$alertText, /\$\{\}/, (selectedData === null || selectedData === void 0 ? void 0 : selectedData.length) || 0)
|
|
114
118
|
})]
|
|
115
119
|
}), !!showCancelBtn && /*#__PURE__*/_jsx("span", {
|
|
116
|
-
className: classnames(_defineProperty({}, "".concat(
|
|
120
|
+
className: classnames(_defineProperty({}, "".concat(prefixCls, "-cancel"), true)),
|
|
117
121
|
onClick: function onClick() {
|
|
118
122
|
return cleanSelectedRows();
|
|
119
123
|
},
|
|
@@ -127,14 +131,14 @@ var BatchOperationBar = function BatchOperationBar(props) {
|
|
|
127
131
|
})
|
|
128
132
|
})]
|
|
129
133
|
}), /*#__PURE__*/_jsx("div", {
|
|
130
|
-
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(
|
|
134
|
+
className: classnames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-content"), true), "".concat(prefixCls, "-content-active"), !!isOpen), "".concat(prefixCls, "-content-hidden"), !isOpen)),
|
|
131
135
|
children: typeof content === 'function' ? content === null || content === void 0 ? void 0 : content({
|
|
132
136
|
selectedRows: selectedData,
|
|
133
137
|
setSelectedRows: setSelectedRows,
|
|
134
138
|
cleanSelectedRows: cleanSelectedRows
|
|
135
139
|
}) : content
|
|
136
140
|
})]
|
|
137
|
-
});
|
|
141
|
+
}));
|
|
138
142
|
};
|
|
139
143
|
export default LocaleWrapper({
|
|
140
144
|
componentName: 'BatchOperationBar',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
+
export type BatchOperationBarToken = OBToken;
|
|
5
|
+
export declare const genBatchOperationBarStyle: GenerateStyle<BatchOperationBarToken>;
|
|
6
|
+
declare const _default: (prefixCls: string) => {
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
8
|
+
hashId: string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
|
+
export var genBatchOperationBarStyle = function genBatchOperationBarStyle(token) {
|
|
7
|
+
var componentCls = token.componentCls,
|
|
8
|
+
colorBgBase = token.colorBgBase,
|
|
9
|
+
boxShadowSecondary = token.boxShadowSecondary,
|
|
10
|
+
fontWeightStrong = token.fontWeightStrong;
|
|
11
|
+
return _defineProperty({}, "".concat(componentCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
12
|
+
position: 'fixed',
|
|
13
|
+
zIndex: 99999,
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
width: '100%',
|
|
17
|
+
color: 'rgba(0, 0, 0, 1)',
|
|
18
|
+
backgroundColor: colorBgBase,
|
|
19
|
+
boxShadow: boxShadowSecondary
|
|
20
|
+
}, "".concat(componentCls, "-header"), _defineProperty(_defineProperty(_defineProperty({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
height: 64,
|
|
25
|
+
margin: '0 24px'
|
|
26
|
+
}, "".concat(componentCls, "-title"), {
|
|
27
|
+
fontWeight: fontWeightStrong
|
|
28
|
+
}), "".concat(componentCls, "-cancel, ").concat(componentCls, "-display-btn"), {
|
|
29
|
+
color: token.colorPrimary,
|
|
30
|
+
cursor: 'pointer'
|
|
31
|
+
}), "".concat(componentCls, "-display-text"), {
|
|
32
|
+
marginRight: 4
|
|
33
|
+
})), "".concat(componentCls, "-content"), {
|
|
34
|
+
maxHeight: 328,
|
|
35
|
+
padding: '0 24px 24px',
|
|
36
|
+
overflow: 'auto'
|
|
37
|
+
}), "".concat(componentCls, "-content-active"), {
|
|
38
|
+
maxHeight: 328,
|
|
39
|
+
transition: 'max-height 0.25s'
|
|
40
|
+
}), "".concat(componentCls, "-content-hidden"), {
|
|
41
|
+
maxHeight: 0,
|
|
42
|
+
padding: 0,
|
|
43
|
+
transition: 'max-height 0.25s'
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
export default (function (prefixCls) {
|
|
47
|
+
var useStyle = genComponentStyleHook('BatchOperationBar', function (token) {
|
|
48
|
+
return [genBatchOperationBarStyle(token)];
|
|
49
|
+
});
|
|
50
|
+
return useStyle(prefixCls);
|
|
51
|
+
});
|
|
@@ -7,12 +7,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
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); }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
import { Button } from '@oceanbase/design';
|
|
11
|
-
import React, { useMemo } from 'react';
|
|
10
|
+
import { Button, ConfigProvider } from '@oceanbase/design';
|
|
11
|
+
import React, { useContext, useMemo } from 'react';
|
|
12
12
|
import LocaleWrapper from "../../locale/LocaleWrapper";
|
|
13
13
|
import { CODE_PRESET } from "../constant";
|
|
14
14
|
import zhCN from "../locale/zh-CN";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
+
import useStyle from "../style";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
var BoundaryCode = function BoundaryCode(props) {
|
|
@@ -25,12 +26,17 @@ var BoundaryCode = function BoundaryCode(props) {
|
|
|
25
26
|
locale = props.locale,
|
|
26
27
|
className = props.className,
|
|
27
28
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
29
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
30
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
31
|
+
var prefixCls = getPrefixCls('boundary');
|
|
32
|
+
var _useStyle = useStyle(prefixCls),
|
|
33
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
28
34
|
var info = useMemo(function () {
|
|
29
35
|
var data = CODE_PRESET(locale);
|
|
30
36
|
return data[code];
|
|
31
37
|
}, [code, locale]);
|
|
32
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
33
|
-
className: classNames('boundary-container', 'boundary-code', "
|
|
38
|
+
return wrapSSR( /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
39
|
+
className: classNames('boundary-container', 'boundary-code', "".concat(prefixCls, "-").concat(code), className)
|
|
34
40
|
}, restProps), {}, {
|
|
35
41
|
children: /*#__PURE__*/_jsxs("div", {
|
|
36
42
|
className: "empty",
|
|
@@ -44,7 +50,7 @@ var BoundaryCode = function BoundaryCode(props) {
|
|
|
44
50
|
children: buttonText || info.buttonText
|
|
45
51
|
})]
|
|
46
52
|
})
|
|
47
|
-
}));
|
|
53
|
+
})));
|
|
48
54
|
};
|
|
49
55
|
export var Code = LocaleWrapper({
|
|
50
56
|
componentName: 'Boundary',
|
|
@@ -17,12 +17,13 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
17
17
|
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; }
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
19
|
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); }
|
|
20
|
-
import { Alert, Button } from '@oceanbase/design';
|
|
21
|
-
import React from 'react';
|
|
20
|
+
import { Alert, Button, ConfigProvider } from '@oceanbase/design';
|
|
21
|
+
import React, { useContext } from 'react';
|
|
22
22
|
import LocaleWrapper from "../../locale/LocaleWrapper";
|
|
23
23
|
import { EXCEPTION_PRESET } from "../constant";
|
|
24
24
|
import zhCN from "../locale/zh-CN";
|
|
25
25
|
import classNames from 'classnames';
|
|
26
|
+
import useStyle from "../style";
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
29
|
var BoundaryException = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -65,78 +66,9 @@ var BoundaryException = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
65
66
|
}, {
|
|
66
67
|
key: "render",
|
|
67
68
|
value: function render() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
imageUrl = _this$props.imageUrl,
|
|
72
|
-
title = _this$props.title,
|
|
73
|
-
buttonText = _this$props.buttonText,
|
|
74
|
-
subscription = _this$props.subscription,
|
|
75
|
-
isNotCompatible = _this$props.isNotCompatible,
|
|
76
|
-
_this$props$showError = _this$props.showError,
|
|
77
|
-
showError = _this$props$showError === void 0 ? false : _this$props$showError,
|
|
78
|
-
_this$props$hasButton = _this$props.hasButton,
|
|
79
|
-
hasButton = _this$props$hasButton === void 0 ? true : _this$props$hasButton,
|
|
80
|
-
locale = _this$props.locale,
|
|
81
|
-
className = _this$props.className,
|
|
82
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
83
|
-
var errorInfo = EXCEPTION_PRESET(locale).ERROR_BOUNDARY;
|
|
84
|
-
var notCompatibleInfo = EXCEPTION_PRESET(locale).INCOMPATIBLE_VERSION;
|
|
85
|
-
var _this$state = this.state,
|
|
86
|
-
error = _this$state.error,
|
|
87
|
-
info = _this$state.info;
|
|
88
|
-
var errorDescription = info === null || info === void 0 ? void 0 : info.componentStack;
|
|
89
|
-
var errorMessage = (error || '').toString();
|
|
90
|
-
if ((_this$state2 = this.state) !== null && _this$state2 !== void 0 && _this$state2.hasError) {
|
|
91
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
92
|
-
className: classNames('boundary-container', 'ob-boundary-error', className)
|
|
93
|
-
}, restProps), {}, {
|
|
94
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
95
|
-
className: "empty",
|
|
96
|
-
children: [/*#__PURE__*/_jsx("img", {
|
|
97
|
-
src: imageUrl || errorInfo.imageUrl
|
|
98
|
-
}), /*#__PURE__*/_jsx("h4", {
|
|
99
|
-
children: title || errorInfo.title
|
|
100
|
-
}), showError ? /*#__PURE__*/_jsx(Alert, {
|
|
101
|
-
type: "error",
|
|
102
|
-
showIcon: true,
|
|
103
|
-
message: errorMessage,
|
|
104
|
-
description: errorDescription,
|
|
105
|
-
style: {
|
|
106
|
-
marginTop: 24,
|
|
107
|
-
overflow: 'auto',
|
|
108
|
-
maxHeight: '50vh',
|
|
109
|
-
// 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
|
|
110
|
-
textAlign: 'left'
|
|
111
|
-
}
|
|
112
|
-
}) : subscription && /*#__PURE__*/_jsx("span", {
|
|
113
|
-
children: subscription
|
|
114
|
-
}), hasButton ? /*#__PURE__*/_jsx(Button, {
|
|
115
|
-
type: "primary",
|
|
116
|
-
onClick: function onClick() {
|
|
117
|
-
return _this2.onClick();
|
|
118
|
-
},
|
|
119
|
-
children: buttonText || errorInfo.buttonText
|
|
120
|
-
}) : '']
|
|
121
|
-
})
|
|
122
|
-
}));
|
|
123
|
-
} else if (isNotCompatible) {
|
|
124
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
125
|
-
className: classNames('boundary-container', 'ob-boundary-browser-not-compatible', className)
|
|
126
|
-
}, restProps), {}, {
|
|
127
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
128
|
-
className: "empty",
|
|
129
|
-
children: [/*#__PURE__*/_jsx("img", {
|
|
130
|
-
src: imageUrl || notCompatibleInfo.imageUrl
|
|
131
|
-
}), /*#__PURE__*/_jsx("h4", {
|
|
132
|
-
children: title || notCompatibleInfo.title
|
|
133
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
134
|
-
children: subscription ? subscription : notCompatibleInfo.subscription
|
|
135
|
-
})]
|
|
136
|
-
})
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
return this.props.children;
|
|
69
|
+
return /*#__PURE__*/_jsx(ExceptionWrapper, {
|
|
70
|
+
component: this
|
|
71
|
+
});
|
|
140
72
|
}
|
|
141
73
|
}], [{
|
|
142
74
|
key: "getDerivedStateFromError",
|
|
@@ -148,6 +80,85 @@ var BoundaryException = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
148
80
|
}]);
|
|
149
81
|
return BoundaryException;
|
|
150
82
|
}(React.PureComponent);
|
|
83
|
+
var ExceptionWrapper = function ExceptionWrapper(_ref) {
|
|
84
|
+
var _component$state2;
|
|
85
|
+
var component = _ref.component;
|
|
86
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
87
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
88
|
+
var prefixCls = getPrefixCls('boundary');
|
|
89
|
+
var _useStyle = useStyle(prefixCls),
|
|
90
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
91
|
+
var _component$props = component.props,
|
|
92
|
+
imageUrl = _component$props.imageUrl,
|
|
93
|
+
title = _component$props.title,
|
|
94
|
+
buttonText = _component$props.buttonText,
|
|
95
|
+
subscription = _component$props.subscription,
|
|
96
|
+
isNotCompatible = _component$props.isNotCompatible,
|
|
97
|
+
_component$props$show = _component$props.showError,
|
|
98
|
+
showError = _component$props$show === void 0 ? false : _component$props$show,
|
|
99
|
+
_component$props$hasB = _component$props.hasButton,
|
|
100
|
+
hasButton = _component$props$hasB === void 0 ? true : _component$props$hasB,
|
|
101
|
+
locale = _component$props.locale,
|
|
102
|
+
className = _component$props.className,
|
|
103
|
+
restProps = _objectWithoutProperties(_component$props, _excluded);
|
|
104
|
+
var errorInfo = EXCEPTION_PRESET(locale).ERROR_BOUNDARY;
|
|
105
|
+
var notCompatibleInfo = EXCEPTION_PRESET(locale).INCOMPATIBLE_VERSION;
|
|
106
|
+
var _component$state = component.state,
|
|
107
|
+
error = _component$state.error,
|
|
108
|
+
info = _component$state.info;
|
|
109
|
+
var errorDescription = info === null || info === void 0 ? void 0 : info.componentStack;
|
|
110
|
+
var errorMessage = (error || '').toString();
|
|
111
|
+
if ((_component$state2 = component.state) !== null && _component$state2 !== void 0 && _component$state2.hasError) {
|
|
112
|
+
return wrapSSR( /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
113
|
+
className: classNames('boundary-container', "".concat(prefixCls, "-error"), className)
|
|
114
|
+
}, restProps), {}, {
|
|
115
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
116
|
+
className: "empty",
|
|
117
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
118
|
+
src: imageUrl || errorInfo.imageUrl
|
|
119
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
120
|
+
children: title || errorInfo.title
|
|
121
|
+
}), showError ? /*#__PURE__*/_jsx(Alert, {
|
|
122
|
+
type: "error",
|
|
123
|
+
showIcon: true,
|
|
124
|
+
message: errorMessage,
|
|
125
|
+
description: errorDescription,
|
|
126
|
+
style: {
|
|
127
|
+
marginTop: 24,
|
|
128
|
+
overflow: 'auto',
|
|
129
|
+
maxHeight: '50vh',
|
|
130
|
+
// 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
|
|
131
|
+
textAlign: 'left'
|
|
132
|
+
}
|
|
133
|
+
}) : subscription && /*#__PURE__*/_jsx("span", {
|
|
134
|
+
children: subscription
|
|
135
|
+
}), hasButton ? /*#__PURE__*/_jsx(Button, {
|
|
136
|
+
type: "primary",
|
|
137
|
+
onClick: function onClick() {
|
|
138
|
+
return component.onClick();
|
|
139
|
+
},
|
|
140
|
+
children: buttonText || errorInfo.buttonText
|
|
141
|
+
}) : '']
|
|
142
|
+
})
|
|
143
|
+
})));
|
|
144
|
+
} else if (isNotCompatible) {
|
|
145
|
+
return wrapSSR( /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
146
|
+
className: classNames('boundary-container', "".concat(prefixCls, "-browser-not-compatible"), className)
|
|
147
|
+
}, restProps), {}, {
|
|
148
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
149
|
+
className: "empty",
|
|
150
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
151
|
+
src: imageUrl || notCompatibleInfo.imageUrl
|
|
152
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
153
|
+
children: title || notCompatibleInfo.title
|
|
154
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
155
|
+
children: subscription ? subscription : notCompatibleInfo.subscription
|
|
156
|
+
})]
|
|
157
|
+
})
|
|
158
|
+
})));
|
|
159
|
+
}
|
|
160
|
+
return component.props.children;
|
|
161
|
+
};
|
|
151
162
|
export var Exception = LocaleWrapper({
|
|
152
163
|
componentName: 'Boundary',
|
|
153
164
|
defaultLocale: zhCN
|
|
@@ -7,9 +7,10 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
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); }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
import { Button } from '@oceanbase/design';
|
|
11
|
-
import React, { useMemo } from 'react';
|
|
10
|
+
import { Button, ConfigProvider } from '@oceanbase/design';
|
|
11
|
+
import React, { useContext, useMemo } from 'react';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
+
import useStyle from "../style";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
export var BoundaryFunction = function BoundaryFunction(props) {
|
|
@@ -19,11 +20,16 @@ export var BoundaryFunction = function BoundaryFunction(props) {
|
|
|
19
20
|
onClick = props.onClick,
|
|
20
21
|
className = props.className,
|
|
21
22
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
24
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
25
|
+
var prefixCls = getPrefixCls('boundary');
|
|
26
|
+
var _useStyle = useStyle(prefixCls),
|
|
27
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
22
28
|
var info = useMemo(function () {
|
|
23
29
|
return state ? config[state] : config[Object.keys(config)[0]];
|
|
24
30
|
}, [config, state]);
|
|
25
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
26
|
-
className: classNames('boundary-container',
|
|
31
|
+
return wrapSSR( /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
32
|
+
className: classNames('boundary-container', "".concat(prefixCls, "-function"), className)
|
|
27
33
|
}, restProps), {}, {
|
|
28
34
|
children: /*#__PURE__*/_jsxs("div", {
|
|
29
35
|
className: "empty",
|
|
@@ -37,5 +43,5 @@ export var BoundaryFunction = function BoundaryFunction(props) {
|
|
|
37
43
|
children: info.buttonText
|
|
38
44
|
})]
|
|
39
45
|
})
|
|
40
|
-
}));
|
|
46
|
+
})));
|
|
41
47
|
};
|
package/es/Boundary/index.d.ts
CHANGED
package/es/Boundary/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
noPage: 'This page was not found',
|
|
5
5
|
normal: 'normal operation',
|
|
6
6
|
test: 'Click to test crash effect',
|
|
7
|
-
collapse: 'The page crashed
|
|
7
|
+
collapse: 'The page crashed',
|
|
8
8
|
incompatible: 'Incompatible browser version',
|
|
9
9
|
proposal: 'The browser version is too low. In order to avoid possible security risks, it is recommended to use Chrome browser version 80 or above'
|
|
10
10
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
goHome: 'ホームに戻る',
|
|
3
|
+
noPermission: 'このページへのアクセス権限がありません',
|
|
4
|
+
noPage: 'このページが見つかりません',
|
|
5
|
+
normal: '正常動作',
|
|
6
|
+
test: 'クリックしてクラッシュをテスト',
|
|
7
|
+
collapse: 'ページがクラッシュしました',
|
|
8
|
+
incompatible: 'ブラウザがサポートされていません',
|
|
9
|
+
proposal: 'ブラウザのバージョンが古すぎます。セキュリティリスクを避けるため、Chrome 80以上のご利用をおすすめします'
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
+
export type BoundaryToken = OBToken;
|
|
5
|
+
export declare const genBoundaryStyle: GenerateStyle<BoundaryToken>;
|
|
6
|
+
declare const _default: (prefixCls: string) => {
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
8
|
+
hashId: string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
|
|
6
|
+
export var genBoundaryStyle = function genBoundaryStyle(token) {
|
|
7
|
+
var colorTextTertiary = token.colorTextTertiary;
|
|
8
|
+
return _defineProperty(_defineProperty({}, ".boundary-container", {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
height: '100%',
|
|
13
|
+
'.empty': {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
paddingBottom: 60,
|
|
19
|
+
'> img': {
|
|
20
|
+
height: 102,
|
|
21
|
+
marginBottom: 24
|
|
22
|
+
},
|
|
23
|
+
'> h4': {
|
|
24
|
+
margin: 0,
|
|
25
|
+
fontSize: 18
|
|
26
|
+
},
|
|
27
|
+
'> span': {
|
|
28
|
+
marginTop: 8,
|
|
29
|
+
color: colorTextTertiary,
|
|
30
|
+
fontSize: 14,
|
|
31
|
+
textAlign: 'center'
|
|
32
|
+
},
|
|
33
|
+
'> button': {
|
|
34
|
+
marginTop: 24
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}), ".boundary-code", {
|
|
38
|
+
minHeight: 'calc(100vh - 120px)'
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export default (function (prefixCls) {
|
|
42
|
+
var useStyle = genComponentStyleHook('Boundary', function (token) {
|
|
43
|
+
return [genBoundaryStyle(token)];
|
|
44
|
+
});
|
|
45
|
+
return useStyle(prefixCls);
|
|
46
|
+
});
|