@oceanbase/ui 1.0.0-alpha.4 → 1.0.0-alpha.6
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/Item.d.ts +6 -15
- package/es/Action/Item.js +85 -128
- package/es/Action/index.d.ts +6 -3
- package/es/BasicLayout/style/index.js +30 -18
- package/es/BatchOperationBar/index.d.ts +0 -1
- package/es/BatchOperationBar/index.js +17 -13
- 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/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 +0 -1
- package/es/DateRanger/Ranger.js +13 -8
- 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/style/index.d.ts +10 -0
- package/es/Dialog/style/index.js +97 -0
- package/es/FullscreenBox/index.d.ts +0 -1
- package/es/FullscreenBox/index.js +46 -37
- package/es/FullscreenBox/style/index.d.ts +10 -0
- package/es/FullscreenBox/style/index.js +53 -0
- package/es/GraphToolbar/index.d.ts +0 -1
- package/es/GraphToolbar/index.js +19 -16
- package/es/GraphToolbar/style/index.d.ts +10 -0
- package/es/GraphToolbar/style/index.js +60 -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/style/index.d.ts +10 -0
- package/es/Highlight/style/index.js +213 -0
- 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/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/Ranger/QuickPicker.js +8 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +12 -9
- 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/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/TaskGraph/Graph/style/index.d.ts +10 -0
- package/es/TaskGraph/Graph/style/index.js +28 -0
- package/es/TaskGraph/Graph.d.ts +0 -1
- package/es/TaskGraph/Graph.js +26 -10
- package/es/TaskGraph/index.d.ts +0 -1
- package/es/TaskGraph/index.js +10 -7
- package/es/TaskGraph/style/index.d.ts +10 -0
- package/es/TaskGraph/style/index.js +102 -0
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +30 -26
- 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/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +66 -81
- package/lib/Action/index.d.ts +6 -3
- package/lib/BasicLayout/style/index.js +27 -18
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +54 -50
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +82 -0
- package/lib/Boundary/Components/Code.js +23 -17
- package/lib/Boundary/Components/Exception.js +40 -29
- package/lib/Boundary/Components/Function.js +18 -12
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +0 -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 +35 -32
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +57 -0
- package/lib/DateRanger/PickerPanel.js +2 -2
- package/lib/DateRanger/Ranger.d.ts +0 -1
- package/lib/DateRanger/Ranger.js +353 -348
- 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 +58 -60
- package/lib/Dialog/index.d.ts +0 -1
- package/lib/Dialog/index.js +446 -422
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +135 -0
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +47 -38
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +86 -0
- package/lib/GraphToolbar/index.d.ts +0 -1
- package/lib/GraphToolbar/index.js +69 -66
- package/lib/GraphToolbar/style/index.d.ts +10 -0
- package/lib/GraphToolbar/style/index.js +91 -0
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +3 -3
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +0 -1
- package/lib/Highlight/index.js +32 -29
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +293 -0
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +17 -9
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +25 -13
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +17 -9
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +96 -94
- 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 +20 -17
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +78 -0
- package/lib/Ranger/QuickPicker.js +4 -2
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +48 -45
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +82 -0
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +46 -38
- 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 +3 -2
- package/lib/TagSelect/Item.js +3 -2
- package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
- package/lib/TaskGraph/Graph/style/index.js +56 -0
- package/lib/TaskGraph/Graph.d.ts +0 -1
- package/lib/TaskGraph/Graph.js +16 -7
- package/lib/TaskGraph/index.d.ts +0 -1
- package/lib/TaskGraph/index.js +6 -5
- package/lib/TaskGraph/style/index.d.ts +10 -0
- package/lib/TaskGraph/style/index.js +143 -0
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +64 -59
- 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 +17 -13
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +188 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +4 -7
- 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 -180
- package/es/Dialog/index.less +0 -116
- package/es/FullscreenBox/index.less +0 -51
- package/es/GraphToolbar/index.less +0 -65
- 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.less +0 -23
- package/es/TaskGraph/index.less +0 -117
- 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 -180
- package/lib/Dialog/index.less +0 -116
- package/lib/FullscreenBox/index.less +0 -51
- package/lib/GraphToolbar/index.less +0 -65
- 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.less +0 -23
- package/lib/TaskGraph/index.less +0 -117
- package/lib/Welcome/index.less +0 -185
- package/lib/index.less +0 -1
- package/lib/variable.less +0 -54
|
@@ -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
|
@@ -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
|
+
});
|
|
@@ -7,16 +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 React, { isValidElement } from 'react';
|
|
11
|
-
import { Tooltip, Space, Popover } from 'antd';
|
|
10
|
+
import React, { isValidElement, useContext } from 'react';
|
|
11
|
+
import { Tooltip, Space, Popover, ConfigProvider } from 'antd';
|
|
12
12
|
import { ExclamationCircleFilled, InfoCircleFilled, InfoCircleOutlined, QuestionCircleOutlined } from '@oceanbase/icons';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import
|
|
15
|
-
import "./index.less";
|
|
14
|
+
import useStyle from "./style";
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
var prefix = getPrefix('content-with-question');
|
|
20
17
|
var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
21
18
|
var content = _ref.content,
|
|
22
19
|
tooltip = _ref.tooltip,
|
|
@@ -38,6 +35,11 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
38
35
|
_ref$exclamationColor = _ref.exclamationColor,
|
|
39
36
|
exclamationColor = _ref$exclamationColor === void 0 ? '#FAAD14' : _ref$exclamationColor,
|
|
40
37
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
39
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
40
|
+
var prefixCls = getPrefixCls('content-with-icon');
|
|
41
|
+
var _useStyle = useStyle(prefixCls),
|
|
42
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
41
43
|
var defaultIconType = function defaultIconType() {
|
|
42
44
|
if (iconType === 'question') {
|
|
43
45
|
return /*#__PURE__*/_jsx(QuestionCircleOutlined, {
|
|
@@ -45,7 +47,7 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
45
47
|
color: color === 'default' ? '#132039' : color,
|
|
46
48
|
fontSize: size
|
|
47
49
|
},
|
|
48
|
-
className: "".concat(
|
|
50
|
+
className: "".concat(prefixCls, "-help")
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
if (iconType === 'info') {
|
|
@@ -55,7 +57,7 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
55
57
|
color: infoColor,
|
|
56
58
|
fontSize: size
|
|
57
59
|
},
|
|
58
|
-
className: "".concat(
|
|
60
|
+
className: "".concat(prefixCls, "-help")
|
|
59
61
|
});
|
|
60
62
|
} else {
|
|
61
63
|
return /*#__PURE__*/_jsx(InfoCircleOutlined, {
|
|
@@ -63,7 +65,7 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
63
65
|
color: '3333333',
|
|
64
66
|
fontSize: size
|
|
65
67
|
},
|
|
66
|
-
className: "".concat(
|
|
68
|
+
className: "".concat(prefixCls, "-help")
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -73,7 +75,7 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
73
75
|
color: exclamationColor,
|
|
74
76
|
fontSize: size
|
|
75
77
|
},
|
|
76
|
-
className: "".concat(
|
|
78
|
+
className: "".concat(prefixCls, "-help")
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
};
|
|
@@ -102,24 +104,22 @@ var ContentWithIcon = function ContentWithIcon(_ref) {
|
|
|
102
104
|
children: /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : defaultIconType()
|
|
103
105
|
})) : null;
|
|
104
106
|
};
|
|
105
|
-
return /*#__PURE__*/_jsx(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}))
|
|
123
|
-
});
|
|
107
|
+
return wrapSSR( /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
|
|
108
|
+
className: classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-item"), true), className, !!className))
|
|
109
|
+
}, restProps), {}, {
|
|
110
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
111
|
+
size: 4,
|
|
112
|
+
children: [getIcon(
|
|
113
|
+
// 图标在文字前
|
|
114
|
+
prefixIcon === true ? defaultIconType() : prefixIcon), /*#__PURE__*/_jsx("span", {
|
|
115
|
+
"data-testid": "content",
|
|
116
|
+
style: {
|
|
117
|
+
color: color === 'default' ? '#5C6B8A' : color,
|
|
118
|
+
fontSize: size
|
|
119
|
+
},
|
|
120
|
+
children: content !== null && content !== void 0 ? content : children
|
|
121
|
+
}), getIcon(suffixIcon)]
|
|
122
|
+
})
|
|
123
|
+
})));
|
|
124
124
|
};
|
|
125
125
|
export default ContentWithIcon;
|
|
@@ -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 ContentWithIconToken = OBToken;
|
|
5
|
+
export declare const genContentWithIconStyle: GenerateStyle<ContentWithIconToken>;
|
|
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,26 @@
|
|
|
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 genContentWithIconStyle = function genContentWithIconStyle(token) {
|
|
7
|
+
var componentCls = token.componentCls;
|
|
8
|
+
return _defineProperty({}, "".concat(componentCls, "-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
9
|
+
display: 'inline-flex',
|
|
10
|
+
alignItems: 'center'
|
|
11
|
+
}, "".concat(componentCls, "-prefix"), {
|
|
12
|
+
marginRight: 8
|
|
13
|
+
}), "".concat(componentCls, "-suffix"), {
|
|
14
|
+
marginLeft: 8
|
|
15
|
+
}), "".concat(componentCls, "-help"), {
|
|
16
|
+
cursor: 'help'
|
|
17
|
+
}), "".concat(componentCls, "-color"), {
|
|
18
|
+
color: 'red'
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
export default (function (prefixCls) {
|
|
22
|
+
var useStyle = genComponentStyleHook('ContentWithIcon', function (token) {
|
|
23
|
+
return [genContentWithIconStyle(token)];
|
|
24
|
+
});
|
|
25
|
+
return useStyle(prefixCls);
|
|
26
|
+
});
|
|
@@ -8,18 +8,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
11
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
12
12
|
import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
|
|
13
13
|
import momentGenerateConfig from 'rc-picker/es/generate/moment';
|
|
14
14
|
import useCSSVarCls from 'antd/es/config-provider/hooks/useCSSVarCls';
|
|
15
15
|
import useStyle from 'antd/es/date-picker/style/index';
|
|
16
16
|
import { PickerPanel } from 'rc-picker';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
|
-
import { Alert, Button, Col, DatePicker, Divider, Form, Row, Space, TimePicker } from '@oceanbase/design';
|
|
18
|
+
import { Alert, Button, Col, ConfigProvider, DatePicker, Divider, Form, Row, Space, TimePicker } from '@oceanbase/design';
|
|
19
19
|
import { noop } from 'lodash';
|
|
20
20
|
import moment from 'moment';
|
|
21
21
|
import dayjs from 'dayjs';
|
|
22
|
-
import { getPrefix } from "../_util";
|
|
23
22
|
import { DATE_TIME_MONTH_FORMAT, DATE_TIME_MONTH_FORMAT_CN } from "./constant";
|
|
24
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -46,7 +45,6 @@ var useClickFSA = function useClickFSA() {
|
|
|
46
45
|
};
|
|
47
46
|
return [state, next];
|
|
48
47
|
};
|
|
49
|
-
var prefix = getPrefix('ranger-picker-panel');
|
|
50
48
|
var prefixCls = 'ant-picker';
|
|
51
49
|
var TIME_FORMAT = 'HH:mm:ss';
|
|
52
50
|
var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
@@ -63,6 +61,9 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
63
61
|
onCancel = _props$onCancel === void 0 ? noop : _props$onCancel,
|
|
64
62
|
disabledDate = props.disabledDate,
|
|
65
63
|
hideSecond = props.hideSecond;
|
|
64
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
65
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
66
|
+
var prefix = getPrefixCls('ranger-picker-panel');
|
|
66
67
|
var rootCls = useCSSVarCls(prefixCls);
|
|
67
68
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
68
69
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -5,7 +5,6 @@ import type { Dayjs } from 'dayjs';
|
|
|
5
5
|
import type { Moment } from 'moment';
|
|
6
6
|
import type { RangeOption } from './typing';
|
|
7
7
|
import type { Rule } from './PickerPanel';
|
|
8
|
-
import './index.less';
|
|
9
8
|
export type RangeName = 'customize' | string;
|
|
10
9
|
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs] | [] | null;
|
|
11
10
|
export type RangeValueFormat = [string, string] | [] | null;
|
package/es/DateRanger/Ranger.js
CHANGED
|
@@ -17,27 +17,31 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
|
-
import React, { useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
21
|
-
import { Button, DatePicker, Divider, Dropdown, Flex, Menu, Radio, Space, Tooltip, message, theme } from '@oceanbase/design';
|
|
20
|
+
import React, { useContext, useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
21
|
+
import { Button, ConfigProvider, DatePicker, Divider, Dropdown, Flex, Menu, Radio, Space, Tooltip, message, theme } from '@oceanbase/design';
|
|
22
22
|
import { LeftOutlined, RightOutlined, ZoomOutOutlined, SyncOutlined, ArrowLeftOutlined, CopyOutlined, DeleteOutlined } from '@oceanbase/icons';
|
|
23
23
|
import dayjs from 'dayjs';
|
|
24
24
|
import { findIndex, isEqual as _isEqual, isNil, noop, omit } from 'lodash';
|
|
25
25
|
import moment from 'moment';
|
|
26
26
|
import classNames from 'classnames';
|
|
27
27
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
28
|
-
import { getPrefix } from "../_util";
|
|
29
28
|
import { CUSTOMIZE, DATE_TIME_FORMAT, NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY, YEAR_DATE_TIME_FORMAT, LAST_3_DAYS, DATE_TIME_SECOND_FORMAT, YEAR_DATE_TIME_SECOND_FORMAT, DATE_TIME_FORMAT_CN, DATE_TIME_SECOND_FORMAT_CN, YEAR_DATE_TIME_FORMAT_CN, YEAR_DATE_TIME_SECOND_FORMAT_CN } from "./constant";
|
|
30
29
|
import InternalPickerPanel from "./PickerPanel";
|
|
31
30
|
import zhCN from "./locale/zh-CN";
|
|
32
|
-
import "./
|
|
31
|
+
import useStyle from "./style";
|
|
33
32
|
import { useClickAway } from 'ahooks';
|
|
34
33
|
import { useLocalStorageState } from '@oceanbase/util';
|
|
35
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
36
35
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
36
|
var DefaultMaxHistoryCapacity = 20;
|
|
38
|
-
var prefix = getPrefix('date-ranger');
|
|
39
37
|
var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
40
38
|
var _selects$;
|
|
39
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
40
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
41
|
+
var prefixCls = getPrefixCls('date-ranger');
|
|
42
|
+
var _useStyle = useStyle(prefixCls),
|
|
43
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
44
|
+
var prefix = prefixCls;
|
|
41
45
|
var _props$selects = props.selects,
|
|
42
46
|
selects = _props$selects === void 0 ? [NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY, LAST_3_DAYS] : _props$selects,
|
|
43
47
|
value = props.value,
|
|
@@ -141,7 +145,8 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
141
145
|
}
|
|
142
146
|
return false;
|
|
143
147
|
}, [historyProp]);
|
|
144
|
-
var
|
|
148
|
+
var localStorageKey = "".concat(prefixCls, "-date-ranger-history");
|
|
149
|
+
var _useLocalStorageState = useLocalStorageState(localStorageKey, {
|
|
145
150
|
defaultValue: [],
|
|
146
151
|
listenStorageChange: true
|
|
147
152
|
}),
|
|
@@ -309,7 +314,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
309
314
|
var diffMs = e.diff(s);
|
|
310
315
|
return diffMs > differenceMs;
|
|
311
316
|
}) : selects[rangeNameIndex + 1];
|
|
312
|
-
return /*#__PURE__*/_jsxs(Space, {
|
|
317
|
+
return wrapSSR( /*#__PURE__*/_jsxs(Space, {
|
|
313
318
|
className: classNames(rest.className, _defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
314
319
|
style: rest.style,
|
|
315
320
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
@@ -631,7 +636,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
631
636
|
},
|
|
632
637
|
icon: /*#__PURE__*/_jsx(ZoomOutOutlined, {})
|
|
633
638
|
})]
|
|
634
|
-
});
|
|
639
|
+
}));
|
|
635
640
|
});
|
|
636
641
|
export default LocaleWrapper({
|
|
637
642
|
componentName: 'DateRanger',
|
|
@@ -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 DateRangerToken = OBToken;
|
|
5
|
+
export declare const genDateRangerStyle: GenerateStyle<DateRangerToken>;
|
|
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;
|