@oceanbase/ui 0.4.19 → 0.4.21
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/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +121 -15
- 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/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/es/BatchOperationBar/locale/ja-JP.js +6 -0
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/DateRanger/Ranger.d.ts +4 -0
- package/es/DateRanger/Ranger.js +158 -14
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.less +23 -0
- package/es/DateRanger/locale/ja-JP.d.ts +56 -0
- package/es/DateRanger/locale/ja-JP.js +20 -0
- package/es/Dialog/locale/ja-JP.d.ts +5 -0
- package/es/Dialog/locale/ja-JP.js +4 -0
- package/es/DocDialog/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.js +1 -0
- package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/es/FullscreenBox/locale/ja-JP.js +1 -0
- package/es/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/es/GraphToolbar/locale/ja-JP.js +8 -0
- package/es/Highlight/locale/ja-JP.d.ts +4 -0
- package/es/Highlight/locale/ja-JP.js +3 -0
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/PageContainer/locale/ja-JP.d.ts +4 -0
- package/es/PageContainer/locale/ja-JP.js +3 -0
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/ProTable/index.js +4 -1
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/SideTip/locale/ja-JP.d.ts +2 -0
- package/es/SideTip/locale/ja-JP.js +1 -0
- package/es/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/es/TaskGraph/locale/ja-JP.js +12 -0
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +42 -0
- package/lib/Action/Group.js +122 -46
- package/lib/Action/Item.js +14 -9
- 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/BatchOperationBar/index.js +59 -44
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +30 -0
- package/lib/Boundary/Components/Code.js +11 -5
- package/lib/Boundary/Components/Exception.js +33 -23
- package/lib/Boundary/Components/Function.js +11 -5
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +34 -0
- package/lib/ContentWithIcon/index.js +30 -22
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +235 -217
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +396 -227
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +23 -0
- package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +49 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/Dialog/locale/ja-JP.js +28 -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/FullscreenBox/index.js +16 -7
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +25 -0
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/lib/GraphToolbar/locale/ja-JP.js +32 -0
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.js +35 -31
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.js +15 -14
- package/lib/Highlight/index.js +50 -45
- package/lib/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/Highlight/locale/ja-JP.js +27 -0
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +13 -20
- package/lib/Login/ActivateForm.js +53 -60
- package/lib/Login/LoginForm.js +118 -109
- package/lib/Login/RegisterForm.js +79 -86
- package/lib/Login/index.js +92 -64
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +51 -0
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +8 -4
- package/lib/PageContainer/locale/ja-JP.d.ts +4 -0
- package/lib/PageContainer/locale/ja-JP.js +27 -0
- 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.js +4 -3
- package/lib/ProTable/index.js +10 -5
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +53 -0
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +25 -0
- package/lib/TagSelect/Group.js +9 -5
- package/lib/TagSelect/Item.js +22 -18
- package/lib/TaskGraph/Graph.js +29 -24
- package/lib/TaskGraph/index.js +56 -50
- package/lib/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/lib/TaskGraph/locale/ja-JP.js +36 -0
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +28 -0
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +71 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
usernamePlaceholder: string;
|
|
3
|
+
usernameMessage: string;
|
|
4
|
+
passwordPlaceholder: string;
|
|
5
|
+
passwordMessage: string;
|
|
6
|
+
loginText: string;
|
|
7
|
+
otherLoginText: string;
|
|
8
|
+
isLoadingWarn: string;
|
|
9
|
+
usernameLabel: string;
|
|
10
|
+
switchLoginLabel: string;
|
|
11
|
+
switchRegisterLabel: string;
|
|
12
|
+
userExistMessage: string;
|
|
13
|
+
usernameFormatMessage: string;
|
|
14
|
+
samePasswordMessage: string;
|
|
15
|
+
usernameHelp: string;
|
|
16
|
+
usernameLengthMessage: string;
|
|
17
|
+
passwordLabel: string;
|
|
18
|
+
passwordHelp: string;
|
|
19
|
+
confirmPwdLabel: string;
|
|
20
|
+
confirmPwdMessage: string;
|
|
21
|
+
registerBtn: string;
|
|
22
|
+
registerTitle: string;
|
|
23
|
+
activeTitle: string;
|
|
24
|
+
activeTitleDescrition: string;
|
|
25
|
+
activeSubmitBtn: string;
|
|
26
|
+
activeBackBtn: string;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
usernamePlaceholder: 'アカウントを入力してください',
|
|
3
|
+
usernameMessage: 'アカウントを入力してください',
|
|
4
|
+
passwordPlaceholder: 'パスワードを入力してください',
|
|
5
|
+
passwordMessage: 'パスワードを入力してください',
|
|
6
|
+
loginText: 'ログイン',
|
|
7
|
+
otherLoginText: 'サードパーティログイン',
|
|
8
|
+
isLoadingWarn: '実行中',
|
|
9
|
+
usernameLabel: 'ユーザー名',
|
|
10
|
+
switchLoginLabel: '既存アカウントでログイン',
|
|
11
|
+
switchRegisterLabel: 'アカウント登録',
|
|
12
|
+
userExistMessage: 'ユーザー名は既に存在します',
|
|
13
|
+
usernameFormatMessage: 'ユーザー名の形式が要件を満たしていません',
|
|
14
|
+
samePasswordMessage: '確認パスワードが一致しません',
|
|
15
|
+
usernameHelp: '英字、数字、アンダースコア、特殊文字 (._+@#$%) をサポート、長さ 4~48 文字',
|
|
16
|
+
usernameLengthMessage: 'ユーザー名の長さは 4~48 文字',
|
|
17
|
+
passwordLabel: 'パスワード',
|
|
18
|
+
passwordHelp: '少なくとも 2 桁の数字、2 文字の大文字、2 文字の小文字、2 文字の特殊文字 (._+@#$%) を含み、長さ 8~32 文字',
|
|
19
|
+
confirmPwdLabel: 'パスワード確認',
|
|
20
|
+
confirmPwdMessage: 'パスワードを再度入力してください',
|
|
21
|
+
registerBtn: '今すぐ登録',
|
|
22
|
+
registerTitle: 'アカウント登録',
|
|
23
|
+
activeTitle: 'パスワードを設定してアカウントを有効化',
|
|
24
|
+
activeTitleDescrition: 'アカウントのセキュリティのため、パスワードを設定してアカウントを有効化する必要があります',
|
|
25
|
+
activeSubmitBtn: '有効化',
|
|
26
|
+
activeBackBtn: '前のステップに戻る'
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
lengthRuleMessage: string;
|
|
3
|
+
charRuleMessage: string;
|
|
4
|
+
strengthRuleMessage: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
generatePlaceholder: string;
|
|
7
|
+
randomlyGenerate: string;
|
|
8
|
+
pleaseRememberYourPassword: string;
|
|
9
|
+
copySuccessfully: string;
|
|
10
|
+
copyPassword: string;
|
|
11
|
+
andKeepItProperly: string;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
lengthRuleMessage: '長さは 8~32 文字',
|
|
3
|
+
charRuleMessage: '英字、数字、特殊文字(~!@#%^&*_-+=|(){}[]:;,.?/`$"<>\\)のみを含むことができます',
|
|
4
|
+
strengthRuleMessage: '大文字、小文字、数字、特殊文字をそれぞれ少なくとも 2 文字含む必要があります',
|
|
5
|
+
placeholder: 'パスワードを入力してください',
|
|
6
|
+
generatePlaceholder: '入力するかランダム生成',
|
|
7
|
+
randomlyGenerate: 'ランダム生成',
|
|
8
|
+
pleaseRememberYourPassword: 'パスワードを覚えて適切に保存してください',
|
|
9
|
+
copySuccessfully: 'コピー成功',
|
|
10
|
+
copyPassword: 'パスワードをコピー',
|
|
11
|
+
andKeepItProperly: '適切に保存'
|
|
12
|
+
};
|
package/es/ProTable/index.js
CHANGED
|
@@ -80,7 +80,10 @@ function ProTable(_ref) {
|
|
|
80
80
|
toolbar: toolbar,
|
|
81
81
|
toolBarRender: toolBarRender,
|
|
82
82
|
cardProps: _objectSpread(_objectSpread({}, cardProps), {}, {
|
|
83
|
-
className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(proCardCls, "-has-title"), !!headerTitle || options || options === undefined || optionsRender || toolbar || toolBarRender), "".concat(proCardCls, "-no-divider"), !(cardProps !== null && cardProps !== void 0 && cardProps.headerBordered)), "".concat(proCardCls, "-no-padding"), true), "".concat(proCardCls, "-contain-tabs"), !!(cardProps !== null && cardProps !== void 0 && cardProps.tabs)), cardProps === null || cardProps === void 0 ? void 0 : cardProps.className)
|
|
83
|
+
className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(proCardCls, "-has-title"), !!headerTitle || options || options === undefined || optionsRender || toolbar || toolBarRender), "".concat(proCardCls, "-no-divider"), !(cardProps !== null && cardProps !== void 0 && cardProps.headerBordered)), "".concat(proCardCls, "-no-padding"), true), "".concat(proCardCls, "-contain-tabs"), !!(cardProps !== null && cardProps !== void 0 && cardProps.tabs)), cardProps === null || cardProps === void 0 ? void 0 : cardProps.className),
|
|
84
|
+
bodyStyle: _objectSpread({
|
|
85
|
+
paddingBlock: 0
|
|
86
|
+
}, cardProps === null || cardProps === void 0 ? void 0 : cardProps.bodyStyle)
|
|
84
87
|
}),
|
|
85
88
|
expandable: expandable ? _objectSpread({
|
|
86
89
|
columnWidth: !size || size === 'large' ? 40 : 32
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
customize: string;
|
|
3
|
+
'\u8FD1 1 \u5206\u949F': string;
|
|
4
|
+
'\u8FD1 5 \u5206\u949F': string;
|
|
5
|
+
'\u8FD1 10 \u5206\u949F': string;
|
|
6
|
+
'\u8FD1 20 \u5206\u949F': string;
|
|
7
|
+
'\u8FD1 30 \u5206\u949F': string;
|
|
8
|
+
'\u8FD1 1 \u5C0F\u65F6': string;
|
|
9
|
+
'\u8FD1 2 \u5C0F\u65F6': string;
|
|
10
|
+
'\u8FD1 3 \u5C0F\u65F6': string;
|
|
11
|
+
'\u8FD1 6 \u5C0F\u65F6': string;
|
|
12
|
+
今天: string;
|
|
13
|
+
昨天: string;
|
|
14
|
+
明天: string;
|
|
15
|
+
本周: string;
|
|
16
|
+
上周: string;
|
|
17
|
+
下周: string;
|
|
18
|
+
本月: string;
|
|
19
|
+
上月: string;
|
|
20
|
+
下月: string;
|
|
21
|
+
本季度: string;
|
|
22
|
+
上季度: string;
|
|
23
|
+
下季度: string;
|
|
24
|
+
今年: string;
|
|
25
|
+
去年: string;
|
|
26
|
+
明年: string;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
customize: 'カスタム時間',
|
|
3
|
+
// 为保证和之前的逻辑兼容,仍然使用中文作为 key
|
|
4
|
+
// TODO: 后续需要替换为英文 key
|
|
5
|
+
'近 1 分钟': '過去 1 分',
|
|
6
|
+
'近 5 分钟': '過去 5 分',
|
|
7
|
+
'近 10 分钟': '過去 10 分',
|
|
8
|
+
'近 20 分钟': '過去 20 分',
|
|
9
|
+
'近 30 分钟': '過去 30 分',
|
|
10
|
+
'近 1 小时': '過去 1 時間',
|
|
11
|
+
'近 2 小时': '過去 2 時間',
|
|
12
|
+
'近 3 小时': '過去 3 時間',
|
|
13
|
+
'近 6 小时': '過去 6 時間',
|
|
14
|
+
今天: '今日',
|
|
15
|
+
昨天: '昨日',
|
|
16
|
+
明天: '明日',
|
|
17
|
+
本周: '今週',
|
|
18
|
+
上周: '先週',
|
|
19
|
+
下周: '来週',
|
|
20
|
+
本月: '今月',
|
|
21
|
+
上月: '先月',
|
|
22
|
+
下月: '来月',
|
|
23
|
+
本季度: '今四半期',
|
|
24
|
+
上季度: '前四半期',
|
|
25
|
+
下季度: '次四半期',
|
|
26
|
+
今年: '今年',
|
|
27
|
+
去年: '去年',
|
|
28
|
+
明年: '来年'
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import jaJP from '@oceanbase/design/es/locale/ja-JP';
|
|
8
|
+
import BasicLayout from "../BasicLayout/locale/ja-JP";
|
|
9
|
+
import BatchOperationBar from "../BatchOperationBar/locale/ja-JP";
|
|
10
|
+
import Boundary from "../Boundary/locale/ja-JP";
|
|
11
|
+
import Dialog from "../Dialog/locale/ja-JP";
|
|
12
|
+
import DocDialog from "../DocDialog/locale/ja-JP";
|
|
13
|
+
import FullscreenBox from "../FullscreenBox/locale/ja-JP";
|
|
14
|
+
import GraphToolbar from "../GraphToolbar/locale/ja-JP";
|
|
15
|
+
import Highlight from "../Highlight/locale/ja-JP";
|
|
16
|
+
import Login from "../Login/locale/ja-JP";
|
|
17
|
+
import PageContainer from "../PageContainer/locale/ja-JP";
|
|
18
|
+
import Password from "../Password/locale/ja-JP";
|
|
19
|
+
import Ranger from "../Ranger/locale/ja-JP";
|
|
20
|
+
import DateRanger from "../DateRanger/locale/ja-JP";
|
|
21
|
+
import SideTip from "../SideTip/locale/ja-JP";
|
|
22
|
+
import TaskGraph from "../TaskGraph/locale/ja-JP";
|
|
23
|
+
import Welcome from "../Welcome/locale/ja-JP";
|
|
24
|
+
export default _objectSpread(_objectSpread({}, jaJP), {}, {
|
|
25
|
+
// 业务组件
|
|
26
|
+
BasicLayout: BasicLayout,
|
|
27
|
+
PageContainer: PageContainer,
|
|
28
|
+
Login: Login,
|
|
29
|
+
Welcome: Welcome,
|
|
30
|
+
GraphToolbar: GraphToolbar,
|
|
31
|
+
TaskGraph: TaskGraph,
|
|
32
|
+
Ranger: Ranger,
|
|
33
|
+
Password: Password,
|
|
34
|
+
Boundary: Boundary,
|
|
35
|
+
Dialog: Dialog,
|
|
36
|
+
SideTip: SideTip,
|
|
37
|
+
DocDialog: DocDialog,
|
|
38
|
+
Highlight: Highlight,
|
|
39
|
+
FullscreenBox: FullscreenBox,
|
|
40
|
+
BatchOperationBar: BatchOperationBar,
|
|
41
|
+
DateRanger: DateRanger
|
|
42
|
+
});
|
package/lib/Action/Group.js
CHANGED
|
@@ -37,6 +37,7 @@ var import_design = require("@oceanbase/design");
|
|
|
37
37
|
var import_icons = require("@oceanbase/icons");
|
|
38
38
|
var import_lodash = require("lodash");
|
|
39
39
|
var import_style = __toESM(require("./style"));
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
41
|
var getOrder = ({ type, fixed }) => {
|
|
41
42
|
const ORDER_SET = { primary: 3, fixed: 2, default: 0 };
|
|
42
43
|
let order = ORDER_SET.default;
|
|
@@ -48,6 +49,64 @@ var getOrder = ({ type, fixed }) => {
|
|
|
48
49
|
}
|
|
49
50
|
return order;
|
|
50
51
|
};
|
|
52
|
+
var findActionComponent = (element, depth = 0) => {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
if (!import_react.default.isValidElement(element)) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (((_a = element.type) == null ? void 0 : _a.__DISPLAY_NAME) === "button" || ((_b = element.type) == null ? void 0 : _b.__DISPLAY_NAME) === "link") {
|
|
58
|
+
return { action: element, wrapper: null };
|
|
59
|
+
}
|
|
60
|
+
if (depth > 10) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const elementChildren = (_c = element.props) == null ? void 0 : _c.children;
|
|
64
|
+
if (elementChildren) {
|
|
65
|
+
const child = import_react.default.Children.only(elementChildren);
|
|
66
|
+
if (import_react.default.isValidElement(child)) {
|
|
67
|
+
const result = findActionComponent(child, depth + 1);
|
|
68
|
+
if (result) {
|
|
69
|
+
return { action: result.action, wrapper: element };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
};
|
|
75
|
+
var renderMenuItemContent = (action, actionProps, enableLoading) => {
|
|
76
|
+
const { loading, children, tooltip } = actionProps;
|
|
77
|
+
const result = findActionComponent(action);
|
|
78
|
+
if (!result) {
|
|
79
|
+
const content2 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
80
|
+
loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
|
|
81
|
+
" ",
|
|
82
|
+
children || action
|
|
83
|
+
] });
|
|
84
|
+
return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: tooltip, children: content2 }) : content2;
|
|
85
|
+
}
|
|
86
|
+
const { action: actualAction, wrapper } = result;
|
|
87
|
+
const newAction = import_react.default.cloneElement(actualAction, {
|
|
88
|
+
...actualAction.props,
|
|
89
|
+
...actionProps,
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
91
|
+
loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
|
|
92
|
+
" ",
|
|
93
|
+
children || actualAction.props.children
|
|
94
|
+
] })
|
|
95
|
+
});
|
|
96
|
+
if (wrapper) {
|
|
97
|
+
const wrapperProps = wrapper.props;
|
|
98
|
+
return import_react.default.cloneElement(wrapper, {
|
|
99
|
+
...wrapperProps,
|
|
100
|
+
children: newAction
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
104
|
+
loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
|
|
105
|
+
" ",
|
|
106
|
+
children || actualAction.props.children
|
|
107
|
+
] });
|
|
108
|
+
return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: tooltip, children: content }) : content;
|
|
109
|
+
};
|
|
51
110
|
var Group_default = ({
|
|
52
111
|
prefixCls: customizePrefixCls,
|
|
53
112
|
size = 3,
|
|
@@ -95,58 +154,75 @@ var Group_default = ({
|
|
|
95
154
|
const getDefaultDisabled = (key) => (shouldDisabled == null ? void 0 : shouldDisabled(key)) ?? false;
|
|
96
155
|
let moreDom;
|
|
97
156
|
if (ellipsisType === "button") {
|
|
98
|
-
moreDom = /* @__PURE__ */
|
|
157
|
+
moreDom = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
158
|
import_design.Button,
|
|
100
159
|
{
|
|
101
160
|
size: buttonSize,
|
|
102
|
-
icon: moreText ? void 0 : /* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
161
|
+
icon: moreText ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } }),
|
|
162
|
+
children: moreText
|
|
163
|
+
}
|
|
105
164
|
);
|
|
106
165
|
} else {
|
|
107
|
-
moreDom = /* @__PURE__ */
|
|
166
|
+
moreDom = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Link, { children: moreText ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } }) });
|
|
108
167
|
}
|
|
109
168
|
return wrapSSR(
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: ellipsisType === "button" ? 8 : 16, children: [
|
|
170
|
+
mainActions.map((action) => {
|
|
171
|
+
return import_react.default.cloneElement(action, {
|
|
172
|
+
// size should be covered by action props
|
|
173
|
+
size: buttonSize,
|
|
174
|
+
...action.props,
|
|
175
|
+
key: action.key,
|
|
176
|
+
enableLoading,
|
|
177
|
+
disabled: (0, import_lodash.isBoolean)(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key)
|
|
178
|
+
});
|
|
179
|
+
}),
|
|
180
|
+
ellipsisActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
181
|
+
import_design.Dropdown,
|
|
182
|
+
{
|
|
183
|
+
placement: dropDownPlacement,
|
|
184
|
+
overlay: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu, { className: `${prefixCls}-more-menu`, children: ellipsisActions.map((action, index) => {
|
|
185
|
+
const actionKey = action.key;
|
|
186
|
+
const actionResult = findActionComponent(action);
|
|
187
|
+
const actualAction = (actionResult == null ? void 0 : actionResult.action) || action;
|
|
188
|
+
const actionProps = actualAction.props;
|
|
189
|
+
const actionDisabled = actionProps.loading || ((0, import_lodash.isBoolean)(actionProps.disabled) ? actionProps.disabled : getDefaultDisabled(action.key));
|
|
190
|
+
const menuItemProps = (0, import_lodash.omit)(actionProps, [
|
|
191
|
+
"disabled",
|
|
192
|
+
"loading",
|
|
193
|
+
"tooltip",
|
|
194
|
+
"visible",
|
|
195
|
+
"fixed",
|
|
196
|
+
"enableLoading",
|
|
197
|
+
"onClick",
|
|
198
|
+
"children",
|
|
199
|
+
"danger"
|
|
200
|
+
]);
|
|
201
|
+
const handleMenuItemClick = (info) => {
|
|
202
|
+
var _a;
|
|
203
|
+
if (actionResult == null ? void 0 : actionResult.wrapper) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
(_a = actionProps.onClick) == null ? void 0 : _a.call(actionProps, info.domEvent);
|
|
207
|
+
};
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
import_design.Menu.Item,
|
|
211
|
+
{
|
|
212
|
+
onClick: handleMenuItemClick,
|
|
213
|
+
disabled: actionDisabled,
|
|
214
|
+
danger: !!actionProps.danger,
|
|
215
|
+
...menuItemProps,
|
|
216
|
+
children: renderMenuItemContent(action, actionProps, enableLoading)
|
|
217
|
+
},
|
|
218
|
+
actionKey ?? index.toString()
|
|
219
|
+
),
|
|
220
|
+
actionProps.divider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Divider, {})
|
|
221
|
+
] });
|
|
222
|
+
}) }),
|
|
223
|
+
children: moreDom
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] })
|
|
151
227
|
);
|
|
152
228
|
};
|
package/lib/Action/Item.js
CHANGED
|
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(Item_exports);
|
|
|
36
36
|
var import_icons = require("@oceanbase/icons");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
40
|
var ActionButton = class extends import_react.default.PureComponent {
|
|
40
41
|
constructor() {
|
|
41
42
|
super(...arguments);
|
|
@@ -45,7 +46,7 @@ var ActionButton = class extends import_react.default.PureComponent {
|
|
|
45
46
|
}
|
|
46
47
|
render() {
|
|
47
48
|
const { children, onClick, enableLoading = true, tooltip, loading, ...restProps } = this.props;
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { placement: "top", title: tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
50
|
import_design.Button,
|
|
50
51
|
{
|
|
51
52
|
loading: enableLoading && (loading || this.state.loading),
|
|
@@ -58,10 +59,10 @@ var ActionButton = class extends import_react.default.PureComponent {
|
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
|
-
...restProps
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
));
|
|
62
|
+
...restProps,
|
|
63
|
+
children
|
|
64
|
+
}
|
|
65
|
+
) });
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
ActionButton.__DISPLAY_NAME = "button";
|
|
@@ -85,7 +86,7 @@ var ActionLink = class extends import_react.default.PureComponent {
|
|
|
85
86
|
style,
|
|
86
87
|
...restProps
|
|
87
88
|
} = this.props;
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
90
|
import_design.Typography.Link,
|
|
90
91
|
{
|
|
91
92
|
style: { padding: 0, ...style },
|
|
@@ -99,9 +100,13 @@ var ActionLink = class extends import_react.default.PureComponent {
|
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
|
-
...restProps
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
...restProps,
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Tooltip, { placement: "top", title: tooltip, children: [
|
|
105
|
+
loading || this.state.disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}) : "",
|
|
106
|
+
" ",
|
|
107
|
+
children
|
|
108
|
+
] })
|
|
109
|
+
}
|
|
105
110
|
);
|
|
106
111
|
}
|
|
107
112
|
};
|
|
@@ -32,7 +32,6 @@ var genActionStyle = (token) => {
|
|
|
32
32
|
const margin = `-${paddingVertical}px -${paddingHorizontal}px`;
|
|
33
33
|
return {
|
|
34
34
|
[`${componentCls}-more-menu`]: {
|
|
35
|
-
background: "red",
|
|
36
35
|
[`${antCls}-dropdown-menu-item`]: {
|
|
37
36
|
[`${antCls}-typography`]: {
|
|
38
37
|
display: "block",
|
|
@@ -61,6 +60,22 @@ var genActionStyle = (token) => {
|
|
|
61
60
|
[`${antCls}-wave`]: {
|
|
62
61
|
display: "none"
|
|
63
62
|
}
|
|
63
|
+
},
|
|
64
|
+
// 确保 danger 状态的样式能够正确显示,不覆盖 Menu.Item 的默认 danger 颜色
|
|
65
|
+
[`&${antCls}-dropdown-menu-item-danger`]: {
|
|
66
|
+
[`${antCls}-typography`]: {
|
|
67
|
+
[`&:not(${antCls}-typography-disabled)`]: {
|
|
68
|
+
color: "unset"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[`${antCls}-btn`]: {
|
|
72
|
+
[`&:not(:disabled):not(${antCls}-btn-disabled)`]: {
|
|
73
|
+
color: "unset",
|
|
74
|
+
[`&:hover`]: {
|
|
75
|
+
color: "unset"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
64
79
|
}
|
|
65
80
|
}
|
|
66
81
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/BackgroundTaskManager/RefreshMan.tsx
|
|
@@ -34,8 +24,9 @@ __export(RefreshMan_exports, {
|
|
|
34
24
|
module.exports = __toCommonJS(RefreshMan_exports);
|
|
35
25
|
var import_ahooks = require("ahooks");
|
|
36
26
|
var import_design = require("@oceanbase/design");
|
|
37
|
-
var import_react =
|
|
27
|
+
var import_react = require("react");
|
|
38
28
|
var import_constants = require("./constants");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
30
|
var RefreshMan = (0, import_react.forwardRef)((props, ref) => {
|
|
40
31
|
const {
|
|
41
32
|
run,
|
|
@@ -78,7 +69,7 @@ var RefreshMan = (0, import_react.forwardRef)((props, ref) => {
|
|
|
78
69
|
stopLoop();
|
|
79
70
|
};
|
|
80
71
|
}, [startLoop, stopLoop, timeout]);
|
|
81
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Spin, { spinning: spinning && refreshManLoading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }) });
|
|
82
73
|
});
|
|
83
74
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
75
|
0 && (module.exports = {
|