@oceanbase/ui 0.4.12 → 0.4.13
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/Boundary/index.less +10 -18
- package/es/DateRanger/Ranger.js +2 -2
- package/es/Highlight/index.d.ts +1 -1
- package/es/Login/LoginForm.d.ts +8 -1
- package/es/Login/LoginForm.js +11 -8
- package/es/Login/index.less +1 -1
- package/lib/Boundary/index.less +10 -18
- package/lib/DateRanger/Ranger.js +2 -2
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/Login/LoginForm.d.ts +8 -1
- package/lib/Login/LoginForm.js +9 -4
- package/lib/Login/index.less +1 -1
- package/package.json +2 -2
package/es/Boundary/index.less
CHANGED
|
@@ -5,37 +5,29 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
height: 100%;
|
|
8
|
-
|
|
9
|
-
color: @colorTextTertiary;
|
|
10
|
-
font-size: 14px;
|
|
11
|
-
text-align: center;
|
|
12
|
-
}
|
|
13
|
-
.@{prefixCls}-btn-primary {
|
|
14
|
-
span {
|
|
15
|
-
color: #fff;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
8
|
+
|
|
18
9
|
.empty {
|
|
19
10
|
display: flex;
|
|
20
11
|
flex-direction: column;
|
|
21
12
|
align-items: center;
|
|
22
13
|
justify-content: center;
|
|
23
14
|
padding-bottom: 60px;
|
|
24
|
-
img {
|
|
15
|
+
> img {
|
|
25
16
|
height: 102px;
|
|
26
17
|
margin-bottom: 24px;
|
|
27
18
|
}
|
|
28
|
-
h4 {
|
|
19
|
+
> h4 {
|
|
29
20
|
margin: 0;
|
|
30
|
-
margin-bottom: 8px;
|
|
31
21
|
font-size: 18px;
|
|
32
22
|
}
|
|
33
|
-
|
|
23
|
+
> span {
|
|
24
|
+
margin-top: 8px;
|
|
25
|
+
color: @colorTextTertiary;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
text-align: center;
|
|
28
|
+
}
|
|
29
|
+
> button {
|
|
34
30
|
margin-top: 24px;
|
|
35
|
-
span {
|
|
36
|
-
padding: 0 6px;
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
}
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
33
|
}
|
package/es/DateRanger/Ranger.js
CHANGED
|
@@ -250,7 +250,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
250
250
|
return diffMs > differenceMs;
|
|
251
251
|
}) : selects[rangeNameIndex + 1];
|
|
252
252
|
return /*#__PURE__*/_jsxs(Space, {
|
|
253
|
-
className: classNames(_defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
253
|
+
className: classNames(rest.className, _defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
254
254
|
style: rest.style,
|
|
255
255
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
256
256
|
size: 0,
|
|
@@ -382,7 +382,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
382
382
|
size: size,
|
|
383
383
|
suffixIcon: null
|
|
384
384
|
// 透传 props 到 antd Ranger
|
|
385
|
-
}, omit(rest, 'value', 'onChange')), {}, {
|
|
385
|
+
}, omit(rest, 'value', 'onChange', 'style', 'className')), {}, {
|
|
386
386
|
open: false
|
|
387
387
|
}))
|
|
388
388
|
})]
|
package/es/Highlight/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
|
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
31
|
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
-
declare const supportedLanguages: ("ruby" | "
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "go" | "css" | "java" | "json" | "bash" | "javascript" | "typescript" | "groovy" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
|
|
33
33
|
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
package/es/Login/LoginForm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FormProps } from '@oceanbase/design
|
|
1
|
+
import type { FormProps, InputProps } from '@oceanbase/design';
|
|
2
|
+
import type { PasswordProps } from '@oceanbase/design/es/input';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import type { LoginLocale } from '.';
|
|
4
5
|
import './index.less';
|
|
@@ -15,6 +16,12 @@ export interface ILoginFormProps extends FormProps {
|
|
|
15
16
|
authCodeImg?: string;
|
|
16
17
|
otherLoginProps?: any;
|
|
17
18
|
onAuthCodeImgChange?: () => void;
|
|
19
|
+
passwordOptional?: boolean;
|
|
20
|
+
componentProps?: {
|
|
21
|
+
username: InputProps;
|
|
22
|
+
password: PasswordProps;
|
|
23
|
+
authCode: InputProps;
|
|
24
|
+
};
|
|
18
25
|
}
|
|
19
26
|
declare const Login: React.FC<ILoginFormProps>;
|
|
20
27
|
export default Login;
|
package/es/Login/LoginForm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["loading", "locale", "errorMessage", "showAuthCode", "showOtherLoginButton", "authCodeImg", "otherLoginProps", "onAuthCodeImgChange"];
|
|
2
|
+
var _excluded = ["loading", "locale", "errorMessage", "showAuthCode", "showOtherLoginButton", "authCodeImg", "otherLoginProps", "onAuthCodeImgChange", "componentProps", "passwordOptional"];
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -32,6 +32,9 @@ var Login = function Login(_ref) {
|
|
|
32
32
|
authCodeImg = _ref.authCodeImg,
|
|
33
33
|
otherLoginProps = _ref.otherLoginProps,
|
|
34
34
|
onAuthCodeImgChange = _ref.onAuthCodeImgChange,
|
|
35
|
+
componentProps = _ref.componentProps,
|
|
36
|
+
_ref$passwordOptional = _ref.passwordOptional,
|
|
37
|
+
passwordOptional = _ref$passwordOptional === void 0 ? false : _ref$passwordOptional,
|
|
35
38
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
36
39
|
var _theme$useToken = theme.useToken(),
|
|
37
40
|
token = _theme$useToken.token;
|
|
@@ -59,7 +62,7 @@ var Login = function Login(_ref) {
|
|
|
59
62
|
required: true,
|
|
60
63
|
message: locale.usernameMessage
|
|
61
64
|
}],
|
|
62
|
-
children: /*#__PURE__*/_jsx(Input, {
|
|
65
|
+
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
63
66
|
prefix: /*#__PURE__*/_jsx(UserOutlined, {
|
|
64
67
|
style: {
|
|
65
68
|
color: token.colorIcon
|
|
@@ -73,14 +76,14 @@ var Login = function Login(_ref) {
|
|
|
73
76
|
setFocusInput('');
|
|
74
77
|
},
|
|
75
78
|
className: classNames(_defineProperty({}, "".concat(prefix, "-focus-input"), focusInput === 'username'))
|
|
76
|
-
})
|
|
79
|
+
}, (componentProps === null || componentProps === void 0 ? void 0 : componentProps.username) || {}))
|
|
77
80
|
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
78
81
|
name: "password",
|
|
79
|
-
rules: [{
|
|
82
|
+
rules: passwordOptional ? [] : [{
|
|
80
83
|
required: true,
|
|
81
84
|
message: locale.passwordMessage
|
|
82
85
|
}],
|
|
83
|
-
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
86
|
+
children: /*#__PURE__*/_jsx(Input.Password, _objectSpread({
|
|
84
87
|
visibilityToggle: true,
|
|
85
88
|
autoComplete: "current-password",
|
|
86
89
|
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
|
@@ -96,7 +99,7 @@ var Login = function Login(_ref) {
|
|
|
96
99
|
setFocusInput('');
|
|
97
100
|
},
|
|
98
101
|
className: focusInput === 'password' ? "".concat(prefix, "-focus-input") : ''
|
|
99
|
-
})
|
|
102
|
+
}, (componentProps === null || componentProps === void 0 ? void 0 : componentProps.password) || {}))
|
|
100
103
|
}), showAuthCode && /*#__PURE__*/_jsxs(Space, {
|
|
101
104
|
className: "".concat(prefix, "-auth-code"),
|
|
102
105
|
children: [/*#__PURE__*/_jsx(Form.Item, {
|
|
@@ -105,7 +108,7 @@ var Login = function Login(_ref) {
|
|
|
105
108
|
required: true,
|
|
106
109
|
message: '验证码不能为空'
|
|
107
110
|
}],
|
|
108
|
-
children: /*#__PURE__*/_jsx(Input, {
|
|
111
|
+
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
109
112
|
prefix: /*#__PURE__*/_jsx(SafetyCertificateOutlined, {
|
|
110
113
|
style: {
|
|
111
114
|
color: token.colorIcon
|
|
@@ -119,7 +122,7 @@ var Login = function Login(_ref) {
|
|
|
119
122
|
setFocusInput('');
|
|
120
123
|
},
|
|
121
124
|
className: classNames(_defineProperty({}, "".concat(prefix, "-focus-input"), focusInput === 'authCode'))
|
|
122
|
-
})
|
|
125
|
+
}, (componentProps === null || componentProps === void 0 ? void 0 : componentProps.authCode) || {}))
|
|
123
126
|
}), /*#__PURE__*/_jsxs("div", {
|
|
124
127
|
className: classNames("".concat(prefix, "-code-btn")),
|
|
125
128
|
children: [/*#__PURE__*/_jsx("img", {
|
package/es/Login/index.less
CHANGED
package/lib/Boundary/index.less
CHANGED
|
@@ -5,37 +5,29 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
height: 100%;
|
|
8
|
-
|
|
9
|
-
color: @colorTextTertiary;
|
|
10
|
-
font-size: 14px;
|
|
11
|
-
text-align: center;
|
|
12
|
-
}
|
|
13
|
-
.@{prefixCls}-btn-primary {
|
|
14
|
-
span {
|
|
15
|
-
color: #fff;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
8
|
+
|
|
18
9
|
.empty {
|
|
19
10
|
display: flex;
|
|
20
11
|
flex-direction: column;
|
|
21
12
|
align-items: center;
|
|
22
13
|
justify-content: center;
|
|
23
14
|
padding-bottom: 60px;
|
|
24
|
-
img {
|
|
15
|
+
> img {
|
|
25
16
|
height: 102px;
|
|
26
17
|
margin-bottom: 24px;
|
|
27
18
|
}
|
|
28
|
-
h4 {
|
|
19
|
+
> h4 {
|
|
29
20
|
margin: 0;
|
|
30
|
-
margin-bottom: 8px;
|
|
31
21
|
font-size: 18px;
|
|
32
22
|
}
|
|
33
|
-
|
|
23
|
+
> span {
|
|
24
|
+
margin-top: 8px;
|
|
25
|
+
color: @colorTextTertiary;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
text-align: center;
|
|
28
|
+
}
|
|
29
|
+
> button {
|
|
34
30
|
margin-top: 24px;
|
|
35
|
-
span {
|
|
36
|
-
padding: 0 6px;
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
}
|
|
39
31
|
}
|
|
40
32
|
}
|
|
41
33
|
}
|
package/lib/DateRanger/Ranger.js
CHANGED
|
@@ -230,7 +230,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
230
230
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
231
231
|
import_design.Space,
|
|
232
232
|
{
|
|
233
|
-
className: (0, import_classnames.default)({
|
|
233
|
+
className: (0, import_classnames.default)(rest.className, {
|
|
234
234
|
[prefix]: true,
|
|
235
235
|
[`${prefix}-show-range`]: true,
|
|
236
236
|
[`${prefix}-back-radio-focused`]: backRadioFocused
|
|
@@ -358,7 +358,7 @@ var Ranger = import_react.default.forwardRef((props, ref) => {
|
|
|
358
358
|
allowClear: false,
|
|
359
359
|
size,
|
|
360
360
|
suffixIcon: null,
|
|
361
|
-
...(0, import_lodash.omit)(rest, "value", "onChange"),
|
|
361
|
+
...(0, import_lodash.omit)(rest, "value", "onChange", "style", "className"),
|
|
362
362
|
open: false
|
|
363
363
|
}
|
|
364
364
|
)
|
package/lib/Highlight/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
|
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
31
|
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
-
declare const supportedLanguages: ("ruby" | "
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "go" | "css" | "java" | "json" | "bash" | "javascript" | "typescript" | "groovy" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
|
|
33
33
|
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
package/lib/Login/LoginForm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FormProps } from '@oceanbase/design
|
|
1
|
+
import type { FormProps, InputProps } from '@oceanbase/design';
|
|
2
|
+
import type { PasswordProps } from '@oceanbase/design/es/input';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import type { LoginLocale } from '.';
|
|
4
5
|
import './index.less';
|
|
@@ -15,6 +16,12 @@ export interface ILoginFormProps extends FormProps {
|
|
|
15
16
|
authCodeImg?: string;
|
|
16
17
|
otherLoginProps?: any;
|
|
17
18
|
onAuthCodeImgChange?: () => void;
|
|
19
|
+
passwordOptional?: boolean;
|
|
20
|
+
componentProps?: {
|
|
21
|
+
username: InputProps;
|
|
22
|
+
password: PasswordProps;
|
|
23
|
+
authCode: InputProps;
|
|
24
|
+
};
|
|
18
25
|
}
|
|
19
26
|
declare const Login: React.FC<ILoginFormProps>;
|
|
20
27
|
export default Login;
|
package/lib/Login/LoginForm.js
CHANGED
|
@@ -49,6 +49,8 @@ var Login = ({
|
|
|
49
49
|
authCodeImg,
|
|
50
50
|
otherLoginProps,
|
|
51
51
|
onAuthCodeImgChange,
|
|
52
|
+
componentProps,
|
|
53
|
+
passwordOptional = false,
|
|
52
54
|
...restProps
|
|
53
55
|
}) => {
|
|
54
56
|
const { token } = import_design2.theme.useToken();
|
|
@@ -88,7 +90,8 @@ var Login = ({
|
|
|
88
90
|
},
|
|
89
91
|
className: (0, import_classnames.default)({
|
|
90
92
|
[`${prefix}-focus-input`]: focusInput === "username"
|
|
91
|
-
})
|
|
93
|
+
}),
|
|
94
|
+
...(componentProps == null ? void 0 : componentProps.username) || {}
|
|
92
95
|
}
|
|
93
96
|
)
|
|
94
97
|
),
|
|
@@ -96,7 +99,7 @@ var Login = ({
|
|
|
96
99
|
import_design.Form.Item,
|
|
97
100
|
{
|
|
98
101
|
name: "password",
|
|
99
|
-
rules: [
|
|
102
|
+
rules: passwordOptional ? [] : [
|
|
100
103
|
{
|
|
101
104
|
required: true,
|
|
102
105
|
message: locale.passwordMessage
|
|
@@ -116,7 +119,8 @@ var Login = ({
|
|
|
116
119
|
onBlur: () => {
|
|
117
120
|
setFocusInput("");
|
|
118
121
|
},
|
|
119
|
-
className: focusInput === "password" ? `${prefix}-focus-input` : ""
|
|
122
|
+
className: focusInput === "password" ? `${prefix}-focus-input` : "",
|
|
123
|
+
...(componentProps == null ? void 0 : componentProps.password) || {}
|
|
120
124
|
}
|
|
121
125
|
)
|
|
122
126
|
),
|
|
@@ -144,7 +148,8 @@ var Login = ({
|
|
|
144
148
|
},
|
|
145
149
|
className: (0, import_classnames.default)({
|
|
146
150
|
[`${prefix}-focus-input`]: focusInput === "authCode"
|
|
147
|
-
})
|
|
151
|
+
}),
|
|
152
|
+
...(componentProps == null ? void 0 : componentProps.authCode) || {}
|
|
148
153
|
}
|
|
149
154
|
)
|
|
150
155
|
), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}-code-btn`) }, /* @__PURE__ */ import_react.default.createElement("img", { src: authCodeImg, alt: "", width: "96", height: "38" }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-code-mask`, onClick: onAuthCodeImgChange }, /* @__PURE__ */ import_react.default.createElement(import_icons.SyncOutlined, null)))),
|
package/lib/Login/index.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "The UI library based on OceanBase Design",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": ">=16.9.0",
|
|
72
72
|
"react-dom": ">=16.9.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "84305961875cebaf02361d907dc1db3a1871d1f5"
|
|
75
75
|
}
|