@oceanbase/ui 0.2.28 → 0.2.30

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.
@@ -1,10 +1,10 @@
1
+ import { TooltipProps } from '@oceanbase/design';
1
2
  import React from 'react';
2
- import './index.less';
3
3
  export interface ContentWithQuestionProps {
4
4
  content?: React.ReactNode;
5
- tooltip?: any;
5
+ tooltip?: TooltipProps;
6
6
  prefixIcon?: React.ReactNode | boolean;
7
- suffixIcon?: React.ReactNode;
7
+ suffixIcon?: React.ReactNode | boolean;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  onClick?: (e: React.SyntheticEvent) => void;
@@ -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 = ["content", "tooltip", "prefixIcon", "suffixIcon", "className", "children"];
2
+ var _excluded = ["prefixCls", "content", "tooltip", "prefixIcon", "suffixIcon", "className", "children"];
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; }
@@ -8,41 +8,44 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
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
10
  import { QuestionCircleOutlined } from '@oceanbase/icons';
11
- import { Space, Tooltip } from '@oceanbase/design';
11
+ import { ConfigProvider, Space, Tooltip } from '@oceanbase/design';
12
12
  import classNames from 'classnames';
13
- import React, { isValidElement } from 'react';
14
- import { getPrefix } from "../_util";
15
- import "./index.less";
13
+ import React, { useContext, isValidElement } from 'react';
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
- var prefix = getPrefix('content-with-question');
19
17
  var ContentWithQuestion = function ContentWithQuestion(_ref) {
20
18
  var _classNames;
21
- var content = _ref.content,
19
+ var customizePrefixCls = _ref.prefixCls,
20
+ content = _ref.content,
22
21
  tooltip = _ref.tooltip,
23
22
  _ref$prefixIcon = _ref.prefixIcon,
24
23
  prefixIcon = _ref$prefixIcon === void 0 ? null : _ref$prefixIcon,
25
24
  _ref$suffixIcon = _ref.suffixIcon,
26
- suffixIcon = _ref$suffixIcon === void 0 ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
27
- className: "".concat(prefix, "-help")
28
- }) : _ref$suffixIcon,
25
+ suffixIcon = _ref$suffixIcon === void 0 ? true : _ref$suffixIcon,
29
26
  className = _ref.className,
30
27
  children = _ref.children,
31
28
  restProps = _objectWithoutProperties(_ref, _excluded);
32
- // FIXME: antd 已经废弃 icon type 的用法,该组件也需要做相应处理,后面将会是传入 Icon 的形式而非 type
29
+ var _useContext = useContext(ConfigProvider.ConfigContext),
30
+ getPrefixCls = _useContext.getPrefixCls;
31
+ var prefixCls = getPrefixCls('content-with-question', customizePrefixCls);
32
+ var _useStyle = useStyle(prefixCls),
33
+ wrapSSR = _useStyle.wrapSSR;
33
34
  var getIcon = function getIcon(iconConfig) {
34
35
  return iconConfig ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
35
36
  children: /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : /*#__PURE__*/_jsx(QuestionCircleOutlined, {
36
- className: "".concat(prefix, "-help")
37
+ className: "".concat(prefixCls, "-help")
37
38
  })
38
39
  })) : null;
39
40
  };
40
- return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
41
- className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
41
+ return wrapSSR( /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
42
+ // eslint-disable-next-line react/no-unknown-property
43
+ prefixCls: customizePrefixCls,
44
+ className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
42
45
  }, restProps), {}, {
43
46
  children: /*#__PURE__*/_jsxs(Space, {
44
47
  children: [getIcon(prefixIcon === true ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
45
- className: "".concat(prefix, "-help"),
48
+ className: "".concat(prefixCls, "-help"),
46
49
  style: {
47
50
  marginRight: 4
48
51
  }
@@ -51,6 +54,6 @@ var ContentWithQuestion = function ContentWithQuestion(_ref) {
51
54
  children: content !== null && content !== void 0 ? content : children
52
55
  }), getIcon(suffixIcon)]
53
56
  })
54
- }));
57
+ })));
55
58
  };
56
59
  export default ContentWithQuestion;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
+ export declare const genContentWithQuestionStyle: GenerateStyle<any>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
6
+ hashId: string;
7
+ };
8
+ export default _default;
@@ -0,0 +1,28 @@
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genContentWithQuestionStyle = function genContentWithQuestionStyle(token) {
7
+ var _$concat;
8
+ var componentCls = token.componentCls,
9
+ paddingSM = token.paddingSM;
10
+ return _defineProperty({}, "".concat(componentCls, "-item"), (_$concat = {
11
+ display: 'inline-flex',
12
+ alignItems: 'center'
13
+ }, _defineProperty(_$concat, "".concat(componentCls, "-prefix"), {
14
+ marginRight: 8
15
+ }), _defineProperty(_$concat, "".concat(componentCls, "-suffix"), {
16
+ marginLeft: 8
17
+ }), _defineProperty(_$concat, "".concat(componentCls, "-help"), {
18
+ cursor: 'help'
19
+ }), _defineProperty(_$concat, "".concat(componentCls, "-color"), {
20
+ color: 'red'
21
+ }), _$concat));
22
+ };
23
+ export default (function (prefixCls) {
24
+ var useStyle = genComponentStyleHook('ContentWithQuestion', function (token) {
25
+ return [genContentWithQuestionStyle(token)];
26
+ });
27
+ return useStyle(prefixCls);
28
+ });
@@ -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" | "css" | "bash" | "json" | "go" | "javascript" | "typescript" | "groovy" | "java" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "css" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -61,6 +61,7 @@ export interface LoginProps extends FormProps {
61
61
  onShowRegisterChange?: (isShow: boolean) => void;
62
62
  onShowActivateChange?: (isShow: boolean) => void;
63
63
  onAuthCodeImgChange?: () => void;
64
+ isMobile?: boolean;
64
65
  }
65
66
  declare const _default: any;
66
67
  export default _default;
package/es/Login/index.js CHANGED
@@ -11,13 +11,12 @@ 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 { useControllableValue } from 'ahooks';
14
- import { App, ConfigProvider, Button, Divider, Menu, Typography } from '@oceanbase/design';
14
+ import { App, ConfigProvider, Button, Divider, Typography } from '@oceanbase/design';
15
15
  import { message } from '@oceanbase/design';
16
16
  import classNames from 'classnames';
17
17
  import React, { useContext, useCallback } from 'react';
18
- import { LOCALE_LIST } from "../constant";
19
18
  import LocaleWrapper from "../locale/LocaleWrapper";
20
- import { getPrefix, setLocale } from "../_util";
19
+ import { getPrefix } from "../_util";
21
20
  import ActivateForm from "./ActivateForm";
22
21
  import zhCN from "./locale/zh-CN";
23
22
  import LoginForm from "./LoginForm";
@@ -33,6 +32,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
33
32
  import { Fragment as _Fragment } from "react/jsx-runtime";
34
33
  var prefix = getPrefix('login');
35
34
  var Login = function Login(props) {
35
+ var _classNames;
36
36
  var logo = props.logo,
37
37
  bgImage = props.bgImage,
38
38
  title = props.title,
@@ -51,6 +51,7 @@ var Login = function Login(props) {
51
51
  showOtherLoginButton = props.showOtherLoginButton,
52
52
  authCodeImg = props.authCodeImg,
53
53
  onAuthCodeImgChange = props.onAuthCodeImgChange,
54
+ isMobile = props.isMobile,
54
55
  _props$style = props.style,
55
56
  style = _props$style === void 0 ? {} : _props$style;
56
57
  var _useControllableValue = useControllableValue(props, {
@@ -84,23 +85,10 @@ var Login = function Login(props) {
84
85
  }
85
86
  setShowActivate(!showActivate);
86
87
  }, [showActivate, isLoading]);
87
- var localeMenu = /*#__PURE__*/_jsx(Menu, {
88
- onClick: function onClick(_ref) {
89
- var key = _ref.key;
90
- setLocale(key);
91
- },
92
- children: LOCALE_LIST.filter(function (item) {
93
- return !locales || locales.includes(item.value);
94
- }).map(function (item) {
95
- return /*#__PURE__*/_jsx(Menu.Item, {
96
- children: item.label
97
- }, item.value);
98
- })
99
- });
100
88
  var showWaterMark = !showRegister;
101
89
  return /*#__PURE__*/_jsx(App, {
102
90
  children: /*#__PURE__*/_jsxs("div", {
103
- className: classNames("".concat(prefix, "-container"), _defineProperty({}, "".concat(prefix, "-container-with-board"), board)),
91
+ className: classNames("".concat(prefix, "-container"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-container-with-board"), board), _defineProperty(_classNames, "".concat(prefix, "-container-mobile"), isMobile), _classNames)),
104
92
  style: style,
105
93
  children: [/*#__PURE__*/_jsx("div", {
106
94
  className: "".concat(prefix, "-bg"),
@@ -42,7 +42,7 @@
42
42
  background-color: #fff;
43
43
 
44
44
  .@{prefix}-locale {
45
- position: fixed;
45
+ position: absolute;
46
46
  top: 24px;
47
47
  right: 24px;
48
48
  color: @colorTextTertiary;
@@ -57,6 +57,7 @@
57
57
 
58
58
  .@{prefix}-content {
59
59
  margin-top: -60px;
60
+ width: 404px;
60
61
  .@{prefix}-logo {
61
62
  display: block;
62
63
  height: 68px;
@@ -86,13 +87,11 @@
86
87
  }
87
88
 
88
89
  .@{prefixCls}-form-item {
89
- width: 404px;
90
90
  margin-bottom: 24px;
91
91
  padding-bottom: 0;
92
92
  }
93
93
 
94
94
  .@{prefixCls}-input-affix-wrapper {
95
- width: 404px;
96
95
  height: 40px;
97
96
  border-radius: 8px;
98
97
 
@@ -177,7 +176,6 @@
177
176
  }
178
177
  }
179
178
  .@{prefix}-submit-btn {
180
- width: 404px;
181
179
  height: 40px;
182
180
  border-radius: 8px;
183
181
  }
@@ -200,7 +198,6 @@
200
198
  }
201
199
 
202
200
  .@{prefix}-alert {
203
- width: 404px;
204
201
  margin-bottom: 24px;
205
202
  border-radius: 8px;
206
203
  }
@@ -225,3 +222,46 @@
225
222
  }
226
223
  }
227
224
  }
225
+
226
+ .@{prefix}-container-mobile {
227
+ flex-direction: column;
228
+ min-width: auto;
229
+ .@{prefix}-banner {
230
+ // 移动端设置百分比高度,避免使用 vh,否则安卓端打开软键盘会重新计算高度,导致 banner 图片高度出现跳变
231
+ height: 25%;
232
+ }
233
+ .@{prefix}-bg {
234
+ width: 100%;
235
+ }
236
+ .@{prefix}-card {
237
+ align-items: start;
238
+ width: 100%;
239
+ height: 75%;
240
+ margin-top: -48px;
241
+ padding: 0 32px;
242
+ border-radius: 16px 16px 0 0;
243
+ position: relative;
244
+ .@{prefix}-board {
245
+ top: 8px;
246
+ left: 24px;
247
+ }
248
+ .@{prefix}-locale {
249
+ top: 8px;
250
+ }
251
+ .@{prefix}-content {
252
+ width: 100%;
253
+ margin-top: 40px;
254
+ .@{prefix}-logo {
255
+ height: 48px;
256
+ margin-bottom: 24px;
257
+ }
258
+ .@{prefix}-watermark-wrapper {
259
+ // 移动端改为正常文档流,避免安卓端被软键盘顶起
260
+ width: calc(100% - 64px);
261
+ position: static;
262
+ width: 100%;
263
+ margin-top: 96px;
264
+ }
265
+ }
266
+ }
267
+ }
@@ -1,10 +1,10 @@
1
+ import { TooltipProps } from '@oceanbase/design';
1
2
  import React from 'react';
2
- import './index.less';
3
3
  export interface ContentWithQuestionProps {
4
4
  content?: React.ReactNode;
5
- tooltip?: any;
5
+ tooltip?: TooltipProps;
6
6
  prefixIcon?: React.ReactNode | boolean;
7
- suffixIcon?: React.ReactNode;
7
+ suffixIcon?: React.ReactNode | boolean;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
10
  onClick?: (e: React.SyntheticEvent) => void;
@@ -36,41 +36,46 @@ var import_icons = require("@oceanbase/icons");
36
36
  var import_design = require("@oceanbase/design");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_react = __toESM(require("react"));
39
- var import_util = require("../_util");
40
- var import_index = require("./index.less");
41
- var prefix = (0, import_util.getPrefix)("content-with-question");
39
+ var import_style = __toESM(require("./style"));
42
40
  var ContentWithQuestion = ({
41
+ prefixCls: customizePrefixCls,
43
42
  content,
44
43
  tooltip,
45
44
  prefixIcon = null,
46
- suffixIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefix}-help` }),
45
+ suffixIcon = true,
47
46
  className,
48
47
  children,
49
48
  ...restProps
50
49
  }) => {
50
+ const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
51
+ const prefixCls = getPrefixCls("content-with-question", customizePrefixCls);
52
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
51
53
  const getIcon = (iconConfig) => {
52
- return iconConfig ? /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefix}-help` })) : null;
54
+ return iconConfig ? /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefixCls}-help` })) : null;
53
55
  };
54
- return /* @__PURE__ */ import_react.default.createElement(
55
- "span",
56
- {
57
- className: (0, import_classnames.default)({
58
- [`${prefix}-item`]: true,
59
- [className]: !!className
60
- }),
61
- ...restProps
62
- },
63
- /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, getIcon(
64
- prefixIcon === true ? /* @__PURE__ */ import_react.default.createElement(
65
- import_icons.QuestionCircleOutlined,
66
- {
67
- className: `${prefix}-help`,
68
- style: {
69
- marginRight: 4
56
+ return wrapSSR(
57
+ /* @__PURE__ */ import_react.default.createElement(
58
+ "span",
59
+ {
60
+ prefixCls: customizePrefixCls,
61
+ className: (0, import_classnames.default)({
62
+ [`${prefixCls}-item`]: true,
63
+ [className]: !!className
64
+ }),
65
+ ...restProps
66
+ },
67
+ /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, getIcon(
68
+ prefixIcon === true ? /* @__PURE__ */ import_react.default.createElement(
69
+ import_icons.QuestionCircleOutlined,
70
+ {
71
+ className: `${prefixCls}-help`,
72
+ style: {
73
+ marginRight: 4
74
+ }
70
75
  }
71
- }
72
- ) : prefixIcon
73
- ), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon))
76
+ ) : prefixIcon
77
+ ), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon))
78
+ )
74
79
  );
75
80
  };
76
81
  var ContentWithQuestion_default = ContentWithQuestion;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
+ export declare const genContentWithQuestionStyle: GenerateStyle<any>;
4
+ declare const _default: (prefixCls: string) => {
5
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
6
+ hashId: string;
7
+ };
8
+ export default _default;
@@ -0,0 +1,57 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ContentWithQuestion/style/index.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ default: () => style_default,
23
+ genContentWithQuestionStyle: () => genContentWithQuestionStyle
24
+ });
25
+ module.exports = __toCommonJS(style_exports);
26
+ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
+ var genContentWithQuestionStyle = (token) => {
28
+ const { componentCls, paddingSM } = token;
29
+ return {
30
+ [`${componentCls}-item`]: {
31
+ display: "inline-flex",
32
+ alignItems: "center",
33
+ [`${componentCls}-prefix`]: {
34
+ marginRight: 8
35
+ },
36
+ [`${componentCls}-suffix`]: {
37
+ marginLeft: 8
38
+ },
39
+ [`${componentCls}-help`]: {
40
+ cursor: "help"
41
+ },
42
+ [`${componentCls}-color`]: {
43
+ color: "red"
44
+ }
45
+ }
46
+ };
47
+ };
48
+ var style_default = (prefixCls) => {
49
+ const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("ContentWithQuestion", (token) => {
50
+ return [genContentWithQuestionStyle(token)];
51
+ });
52
+ return useStyle(prefixCls);
53
+ };
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ genContentWithQuestionStyle
57
+ });
@@ -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" | "css" | "bash" | "json" | "go" | "javascript" | "typescript" | "groovy" | "java" | "python" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "css" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -61,6 +61,7 @@ export interface LoginProps extends FormProps {
61
61
  onShowRegisterChange?: (isShow: boolean) => void;
62
62
  onShowActivateChange?: (isShow: boolean) => void;
63
63
  onAuthCodeImgChange?: () => void;
64
+ isMobile?: boolean;
64
65
  }
65
66
  declare const _default: any;
66
67
  export default _default;
@@ -37,7 +37,6 @@ var import_design = require("@oceanbase/design");
37
37
  var import_design2 = require("@oceanbase/design");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_react = __toESM(require("react"));
40
- var import_constant = require("../constant");
41
40
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
42
41
  var import_util = require("../_util");
43
42
  var import_ActivateForm = __toESM(require("./ActivateForm"));
@@ -69,6 +68,7 @@ var Login = (props) => {
69
68
  showOtherLoginButton,
70
69
  authCodeImg,
71
70
  onAuthCodeImgChange,
71
+ isMobile,
72
72
  style = {}
73
73
  } = props;
74
74
  const [showRegister, setShowRegister] = (0, import_ahooks.useControllableValue)(props, {
@@ -95,21 +95,13 @@ var Login = (props) => {
95
95
  }
96
96
  setShowActivate(!showActivate);
97
97
  }, [showActivate, isLoading]);
98
- const localeMenu = /* @__PURE__ */ import_react.default.createElement(
99
- import_design.Menu,
100
- {
101
- onClick: ({ key }) => {
102
- (0, import_util.setLocale)(key);
103
- }
104
- },
105
- import_constant.LOCALE_LIST.filter((item) => !locales || locales.includes(item.value)).map((item) => /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: item.value }, item.label))
106
- );
107
98
  const showWaterMark = !showRegister;
108
99
  return /* @__PURE__ */ import_react.default.createElement(import_design.App, null, /* @__PURE__ */ import_react.default.createElement(
109
100
  "div",
110
101
  {
111
102
  className: (0, import_classnames.default)(`${prefix}-container`, {
112
- [`${prefix}-container-with-board`]: board
103
+ [`${prefix}-container-with-board`]: board,
104
+ [`${prefix}-container-mobile`]: isMobile
113
105
  }),
114
106
  style
115
107
  },
@@ -42,7 +42,7 @@
42
42
  background-color: #fff;
43
43
 
44
44
  .@{prefix}-locale {
45
- position: fixed;
45
+ position: absolute;
46
46
  top: 24px;
47
47
  right: 24px;
48
48
  color: @colorTextTertiary;
@@ -57,6 +57,7 @@
57
57
 
58
58
  .@{prefix}-content {
59
59
  margin-top: -60px;
60
+ width: 404px;
60
61
  .@{prefix}-logo {
61
62
  display: block;
62
63
  height: 68px;
@@ -86,13 +87,11 @@
86
87
  }
87
88
 
88
89
  .@{prefixCls}-form-item {
89
- width: 404px;
90
90
  margin-bottom: 24px;
91
91
  padding-bottom: 0;
92
92
  }
93
93
 
94
94
  .@{prefixCls}-input-affix-wrapper {
95
- width: 404px;
96
95
  height: 40px;
97
96
  border-radius: 8px;
98
97
 
@@ -177,7 +176,6 @@
177
176
  }
178
177
  }
179
178
  .@{prefix}-submit-btn {
180
- width: 404px;
181
179
  height: 40px;
182
180
  border-radius: 8px;
183
181
  }
@@ -200,7 +198,6 @@
200
198
  }
201
199
 
202
200
  .@{prefix}-alert {
203
- width: 404px;
204
201
  margin-bottom: 24px;
205
202
  border-radius: 8px;
206
203
  }
@@ -225,3 +222,46 @@
225
222
  }
226
223
  }
227
224
  }
225
+
226
+ .@{prefix}-container-mobile {
227
+ flex-direction: column;
228
+ min-width: auto;
229
+ .@{prefix}-banner {
230
+ // 移动端设置百分比高度,避免使用 vh,否则安卓端打开软键盘会重新计算高度,导致 banner 图片高度出现跳变
231
+ height: 25%;
232
+ }
233
+ .@{prefix}-bg {
234
+ width: 100%;
235
+ }
236
+ .@{prefix}-card {
237
+ align-items: start;
238
+ width: 100%;
239
+ height: 75%;
240
+ margin-top: -48px;
241
+ padding: 0 32px;
242
+ border-radius: 16px 16px 0 0;
243
+ position: relative;
244
+ .@{prefix}-board {
245
+ top: 8px;
246
+ left: 24px;
247
+ }
248
+ .@{prefix}-locale {
249
+ top: 8px;
250
+ }
251
+ .@{prefix}-content {
252
+ width: 100%;
253
+ margin-top: 40px;
254
+ .@{prefix}-logo {
255
+ height: 48px;
256
+ margin-bottom: 24px;
257
+ }
258
+ .@{prefix}-watermark-wrapper {
259
+ // 移动端改为正常文档流,避免安卓端被软键盘顶起
260
+ width: calc(100% - 64px);
261
+ position: static;
262
+ width: 100%;
263
+ margin-top: 96px;
264
+ }
265
+ }
266
+ }
267
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/ui",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "The UI library based on OceanBase Design",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -37,7 +37,7 @@
37
37
  "@ant-design/cssinjs": "^1.17.2",
38
38
  "@ant-design/pro-components": "^2.6.34",
39
39
  "@ant-design/pro-layout": "^7.17.8",
40
- "@oceanbase/design": "^0.2.27",
40
+ "@oceanbase/design": "^0.2.29",
41
41
  "@oceanbase/icons": "^0.2.9",
42
42
  "@oceanbase/util": "^0.2.11",
43
43
  "ahooks": "^2.10.14",
@@ -52,7 +52,7 @@
52
52
  "moment": "^2.29.4",
53
53
  "path-to-regexp": "^6.2.1",
54
54
  "randexp": "^0.5.3",
55
- "rc-util": "^5.38.0",
55
+ "rc-util": "^5.38.1",
56
56
  "react-copy-to-clipboard": "^5.1.0",
57
57
  "react-json-view": "^1.21.3",
58
58
  "react-split-pane": "^0.1.92",
@@ -66,5 +66,5 @@
66
66
  "react": ">=16.9.0",
67
67
  "react-dom": ">=16.9.0"
68
68
  },
69
- "gitHead": "debd02b577d782f8a403fe0f6133efb172168898"
69
+ "gitHead": "aeddc96820230db03221e2ee8f5691dcb9179bd2"
70
70
  }