@oceanbase/ui 0.2.19 → 0.2.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.
Files changed (100) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.d.ts +1 -1
  3. package/es/Action/Group.js +50 -41
  4. package/es/Action/Item.d.ts +2 -2
  5. package/es/Action/Item.js +32 -26
  6. package/es/Action/index.d.ts +1 -2
  7. package/es/BackgroundTaskManager/RefreshMan.js +8 -3
  8. package/es/BackgroundTaskManager/index.js +8 -4
  9. package/es/BasicLayout/Header.js +193 -140
  10. package/es/BasicLayout/index.js +149 -108
  11. package/es/BatchOperationBar/index.js +46 -29
  12. package/es/Boundary/Components/Code.js +17 -10
  13. package/es/Boundary/Components/Exception.js +46 -31
  14. package/es/Boundary/Components/Function.js +17 -10
  15. package/es/ContentWithIcon/index.js +42 -26
  16. package/es/ContentWithIcon/index.less +0 -1
  17. package/es/Dialog/Anchor.d.ts +1 -1
  18. package/es/Dialog/Anchor.js +9 -6
  19. package/es/Dialog/EventProxy.d.ts +1 -1
  20. package/es/Dialog/EventProxy.js +3 -2
  21. package/es/Dialog/index.js +129 -108
  22. package/es/Dialog/index.less +3 -1
  23. package/es/DocDialog/index.d.ts +1 -1
  24. package/es/DocDialog/index.js +8 -3
  25. package/es/FullscreenBox/index.d.ts +1 -1
  26. package/es/FullscreenBox/index.js +22 -16
  27. package/es/GraphToolbar/index.js +79 -65
  28. package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
  29. package/es/Highlight/DiffView/DiffCells.js +22 -15
  30. package/es/Highlight/DiffView/index.js +49 -40
  31. package/es/Highlight/HighlightCell.d.ts +1 -1
  32. package/es/Highlight/HighlightCell.js +19 -13
  33. package/es/Highlight/JsonView.d.ts +1 -2
  34. package/es/Highlight/JsonView.js +15 -13
  35. package/es/Highlight/index.d.ts +1 -1
  36. package/es/Highlight/index.js +66 -54
  37. package/es/IconFont/index.d.ts +1 -1
  38. package/es/IconFont/index.js +9 -3
  39. package/es/LocaleDropdown/index.js +38 -26
  40. package/es/Login/ActivateForm.js +63 -50
  41. package/es/Login/LoginForm.js +115 -99
  42. package/es/Login/RegisterForm.js +78 -67
  43. package/es/Login/index.js +122 -91
  44. package/es/Lottie/index.js +2 -1
  45. package/es/NavMenu/index.d.ts +2 -2
  46. package/es/NavMenu/index.js +34 -29
  47. package/es/PageContainer/ItemRender.d.ts +1 -2
  48. package/es/PageContainer/ItemRender.js +7 -3
  49. package/es/PageContainer/index.js +13 -10
  50. package/es/Password/Content.js +55 -47
  51. package/es/Password/index.js +62 -45
  52. package/es/Ranger/QuickPicker.d.ts +1 -2
  53. package/es/Ranger/QuickPicker.js +42 -31
  54. package/es/Ranger/Ranger.js +31 -27
  55. package/es/SideTip/Dragger.d.ts +1 -1
  56. package/es/SideTip/Dragger.js +5 -3
  57. package/es/SideTip/IconLoading.d.ts +1 -2
  58. package/es/SideTip/IconLoading.js +28 -20
  59. package/es/SideTip/index.js +43 -30
  60. package/es/SideTip/index.less +4 -1
  61. package/es/TagSelect/Group.d.ts +1 -1
  62. package/es/TagSelect/Group.js +16 -11
  63. package/es/TagSelect/Item.d.ts +1 -1
  64. package/es/TagSelect/Item.js +30 -23
  65. package/es/TagSelect/style/index.d.ts +1 -1
  66. package/es/TaskGraph/Graph.js +39 -31
  67. package/es/TaskGraph/index.js +68 -57
  68. package/es/TreeSearch/index.js +36 -32
  69. package/es/Welcome/index.js +113 -83
  70. package/es/Welcome/step.js +31 -23
  71. package/es/locale/LocaleWrapper.js +3 -3
  72. package/lib/Action/Group.d.ts +1 -1
  73. package/lib/Action/Item.d.ts +2 -2
  74. package/lib/Action/index.d.ts +1 -2
  75. package/lib/ContentWithIcon/index.less +0 -1
  76. package/lib/Dialog/Anchor.d.ts +1 -1
  77. package/lib/Dialog/EventProxy.d.ts +1 -1
  78. package/lib/Dialog/EventProxy.js +12 -2
  79. package/lib/Dialog/index.less +3 -1
  80. package/lib/DocDialog/index.d.ts +1 -1
  81. package/lib/FullscreenBox/index.d.ts +1 -1
  82. package/lib/FullscreenBox/index.js +76 -74
  83. package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
  84. package/lib/Highlight/DiffView/index.js +1 -1
  85. package/lib/Highlight/HighlightCell.d.ts +1 -1
  86. package/lib/Highlight/JsonView.d.ts +1 -2
  87. package/lib/Highlight/JsonView.js +3 -3
  88. package/lib/Highlight/index.d.ts +1 -1
  89. package/lib/IconFont/index.d.ts +1 -1
  90. package/lib/NavMenu/index.d.ts +2 -2
  91. package/lib/PageContainer/ItemRender.d.ts +1 -2
  92. package/lib/Ranger/QuickPicker.d.ts +1 -2
  93. package/lib/SideTip/Dragger.d.ts +1 -1
  94. package/lib/SideTip/IconLoading.d.ts +1 -2
  95. package/lib/SideTip/index.less +4 -1
  96. package/lib/TagSelect/Group.d.ts +1 -1
  97. package/lib/TagSelect/Group.js +4 -6
  98. package/lib/TagSelect/Item.d.ts +1 -1
  99. package/lib/TagSelect/style/index.d.ts +1 -1
  100. package/package.json +10 -9
@@ -1,6 +1,10 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
  var _excluded = ["isUserExists", "locale", "loading", "passwordRule", "errorMessage"];
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
4
8
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
10
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -22,6 +26,8 @@ import "./index.less";
22
26
  * 冗余的转义符可以增强正则的可读性
23
27
  */
24
28
  // eslint-disable-next-line
29
+ import { jsx as _jsx } from "react/jsx-runtime";
30
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
31
  export var PASSWORD_REGEX = /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/;
26
32
  var prefix = getPrefix('login');
27
33
  var Register = function Register(_ref) {
@@ -81,75 +87,80 @@ var Register = function Register(_ref) {
81
87
  pattern: PASSWORD_REGEX,
82
88
  message: locale.passwordHelp
83
89
  };
84
- return /*#__PURE__*/React.createElement(Form, _extends({
90
+ return /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
85
91
  layout: "vertical",
86
92
  requiredMark: false,
87
93
  className: "".concat(prefix, "-form"),
88
94
  form: form
89
- }, restProps, {
90
- "data-testid": "login.register"
91
- }), errorMessage && /*#__PURE__*/React.createElement(Alert, {
92
- type: "error",
93
- showIcon: true,
94
- className: "".concat(prefix, "-alert"),
95
- message: errorMessage
96
- }), /*#__PURE__*/React.createElement(Form.Item, {
97
- name: "username",
98
- label: locale.usernameLabel,
99
- extra: locale.usernameHelp,
100
- validateFirst: true,
101
- rules: [{
102
- required: true,
103
- whitespace: true,
104
- message: locale.usernameMessage
105
- }, {
106
- min: 4,
107
- max: 48,
108
- message: locale.usernameLengthMessage
109
- }, {
110
- pattern: /^[a-zA-Z0-9_.+@#$%]+$/,
111
- message: locale.usernameFormatMessage
112
- }, {
113
- validator: handleValidateAccount
114
- }]
115
- }, /*#__PURE__*/React.createElement(Input, {
116
- autoComplete: "new-account",
117
- autoFocus: true
118
- })), /*#__PURE__*/React.createElement(Form.Item, {
119
- name: "password",
120
- label: locale.passwordLabel,
121
- dependencies: ['confirmPassword'],
122
- help: passwordRegexpRule.message,
123
- validateFirst: true,
124
- rules: [{
125
- required: true,
126
- message: locale.passwordMessage
127
- }, passwordRegexpRule]
128
- }, /*#__PURE__*/React.createElement(Input.Password, {
129
- visibilityToggle: true,
130
- autoComplete: "new-password"
131
- })), /*#__PURE__*/React.createElement(Form.Item, {
132
- name: "confirmPassword",
133
- label: locale.confirmPwdLabel,
134
- dependencies: ['password'],
135
- validateFirst: true,
136
- rules: [{
137
- required: true,
138
- message: locale.confirmPwdMessage
139
- }, {
140
- validator: handleValidateConfirmPassword
141
- }]
142
- }, /*#__PURE__*/React.createElement(Input.Password, {
143
- visibilityToggle: true,
144
- autoComplete: "new-password"
145
- })), /*#__PURE__*/React.createElement(Button
146
- // 按下回车键,即可触发点击事件
147
- , {
148
- htmlType: "submit",
149
- loading: loading,
150
- type: "primary",
151
- block: true,
152
- className: "".concat(prefix, "-submit-btn")
153
- }, locale.registerBtn));
95
+ }, restProps), {}, {
96
+ "data-testid": "login.register",
97
+ children: [errorMessage && /*#__PURE__*/_jsx(Alert, {
98
+ type: "error",
99
+ showIcon: true,
100
+ className: "".concat(prefix, "-alert"),
101
+ message: errorMessage
102
+ }), /*#__PURE__*/_jsx(Form.Item, {
103
+ name: "username",
104
+ label: locale.usernameLabel,
105
+ extra: locale.usernameHelp,
106
+ validateFirst: true,
107
+ rules: [{
108
+ required: true,
109
+ whitespace: true,
110
+ message: locale.usernameMessage
111
+ }, {
112
+ min: 4,
113
+ max: 48,
114
+ message: locale.usernameLengthMessage
115
+ }, {
116
+ pattern: /^[a-zA-Z0-9_.+@#$%]+$/,
117
+ message: locale.usernameFormatMessage
118
+ }, {
119
+ validator: handleValidateAccount
120
+ }],
121
+ children: /*#__PURE__*/_jsx(Input, {
122
+ autoComplete: "new-account",
123
+ autoFocus: true
124
+ })
125
+ }), /*#__PURE__*/_jsx(Form.Item, {
126
+ name: "password",
127
+ label: locale.passwordLabel,
128
+ dependencies: ['confirmPassword'],
129
+ help: passwordRegexpRule.message,
130
+ validateFirst: true,
131
+ rules: [{
132
+ required: true,
133
+ message: locale.passwordMessage
134
+ }, passwordRegexpRule],
135
+ children: /*#__PURE__*/_jsx(Input.Password, {
136
+ visibilityToggle: true,
137
+ autoComplete: "new-password"
138
+ })
139
+ }), /*#__PURE__*/_jsx(Form.Item, {
140
+ name: "confirmPassword",
141
+ label: locale.confirmPwdLabel,
142
+ dependencies: ['password'],
143
+ validateFirst: true,
144
+ rules: [{
145
+ required: true,
146
+ message: locale.confirmPwdMessage
147
+ }, {
148
+ validator: handleValidateConfirmPassword
149
+ }],
150
+ children: /*#__PURE__*/_jsx(Input.Password, {
151
+ visibilityToggle: true,
152
+ autoComplete: "new-password"
153
+ })
154
+ }), /*#__PURE__*/_jsx(Button
155
+ // 按下回车键,即可触发点击事件
156
+ , {
157
+ htmlType: "submit",
158
+ loading: loading,
159
+ type: "primary",
160
+ block: true,
161
+ className: "".concat(prefix, "-submit-btn"),
162
+ children: locale.registerBtn
163
+ })]
164
+ }));
154
165
  };
155
166
  export default Register;
package/es/Login/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3
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; }
4
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
6
  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); }
@@ -25,6 +26,9 @@ import RegisterForm from "./RegisterForm";
25
26
  import logoImg from "../assets/logo/oceanbase_logo.svg";
26
27
  import LocaleDropdown from "../LocaleDropdown";
27
28
  import "./index.less";
29
+ import { jsx as _jsx } from "react/jsx-runtime";
30
+ import { jsxs as _jsxs } from "react/jsx-runtime";
31
+ import { Fragment as _Fragment } from "react/jsx-runtime";
28
32
  var prefix = getPrefix('login');
29
33
  var Login = function Login(props) {
30
34
  var logo = props.logo,
@@ -76,100 +80,127 @@ var Login = function Login(props) {
76
80
  }
77
81
  setShowActivate(!showActivate);
78
82
  }, [showActivate, isLoading]);
79
- var localeMenu = /*#__PURE__*/React.createElement(Menu, {
83
+ var localeMenu = /*#__PURE__*/_jsx(Menu, {
80
84
  onClick: function onClick(_ref) {
81
85
  var key = _ref.key;
82
86
  setLocale(key);
83
- }
84
- }, LOCALE_LIST.filter(function (item) {
85
- return !locales || locales.includes(item.value);
86
- }).map(function (item) {
87
- return /*#__PURE__*/React.createElement(Menu.Item, {
88
- key: item.value
89
- }, item.label);
90
- }));
87
+ },
88
+ children: LOCALE_LIST.filter(function (item) {
89
+ return !locales || locales.includes(item.value);
90
+ }).map(function (item) {
91
+ return /*#__PURE__*/_jsx(Menu.Item, {
92
+ children: item.label
93
+ }, item.value);
94
+ })
95
+ });
91
96
  var showWaterMark = !showRegister;
92
- return /*#__PURE__*/React.createElement(App, null, /*#__PURE__*/React.createElement("div", {
93
- className: classNames("".concat(prefix, "-container"), _defineProperty({}, "".concat(prefix, "-container-with-board"), board)),
94
- style: style
95
- }, /*#__PURE__*/React.createElement("div", {
96
- className: "".concat(prefix, "-bg"),
97
- style: {
98
- backgroundImage: "url(".concat(bgImage, ")")
99
- }
100
- }, /*#__PURE__*/React.createElement("div", {
101
- className: "".concat(prefix, "-info")
102
- }, title && /*#__PURE__*/React.createElement("div", {
103
- className: "".concat(prefix, "-welcome")
104
- }, title), description && /*#__PURE__*/React.createElement("div", {
105
- className: "".concat(prefix, "-start")
106
- }, description))), /*#__PURE__*/React.createElement("div", {
107
- className: "".concat(prefix, "-card")
108
- }, showLocale && /*#__PURE__*/React.createElement("span", {
109
- className: "".concat(prefix, "-locale")
110
- }, /*#__PURE__*/React.createElement(LocaleDropdown, {
111
- locales: locales
112
- })), board && /*#__PURE__*/React.createElement("div", {
113
- className: "".concat(prefix, "-board")
114
- }, board), /*#__PURE__*/React.createElement("div", {
115
- className: "".concat(prefix, "-content")
116
- }, showActivate ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
117
- src: logo,
118
- alt: "",
119
- className: "".concat(prefix, "-activate-logo")
120
- }), /*#__PURE__*/React.createElement(Divider, {
121
- style: {
122
- marginTop: 14,
123
- marginBottom: 20
124
- }
125
- }), /*#__PURE__*/React.createElement(Typography.Title, {
126
- level: 3
127
- }, locale.activeTitle), /*#__PURE__*/React.createElement(Typography.Paragraph, null, locale.activeTitleDescrition), /*#__PURE__*/React.createElement(ActivateForm, _extends({}, activateFormProps, {
128
- locale: locale,
129
- errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message,
130
- goBack: goBack
131
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null, showRegister ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
132
- src: logo,
133
- alt: "",
134
- className: "".concat(prefix, "-reigster-logo")
135
- }), /*#__PURE__*/React.createElement(Divider, {
136
- style: {
137
- marginTop: 14,
138
- marginBottom: 20
139
- }
140
- }), /*#__PURE__*/React.createElement(Typography.Title, {
141
- level: 3
142
- }, locale.registerTitle), /*#__PURE__*/React.createElement(RegisterForm, _extends({}, registerProps, {
143
- locale: locale,
144
- errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message
145
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
146
- src: logo,
147
- alt: "",
148
- className: "".concat(prefix, "-logo")
149
- }), /*#__PURE__*/React.createElement(LoginForm, _extends({}, loginProps, {
150
- otherLoginProps: otherLoginProps,
151
- locale: locale,
152
- errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message,
153
- showAuthCode: showAuthCode,
154
- showOtherLoginButton: showOtherLoginButton,
155
- authCodeImg: authCodeImg,
156
- onAuthCodeImgChange: onAuthCodeImgChange
157
- })))), !!enableRegister && /*#__PURE__*/React.createElement("div", {
158
- className: "".concat(prefix, "-switch-btn")
159
- }, /*#__PURE__*/React.createElement(Button, {
160
- type: "link",
161
- onClick: switchForm,
162
- "data-testid": "login.register.btn"
163
- }, showRegister ? locale.switchLoginLabel : locale.switchRegisterLabel)), showWaterMark ? /*#__PURE__*/React.createElement("div", {
164
- className: "".concat(prefix, "-watermark-wrapper"),
165
- style: {
166
- paddingLeft: showAuthCode ? 96 : 0
167
- }
168
- }, /*#__PURE__*/React.createElement("img", {
169
- src: logoImg,
170
- alt: "",
171
- className: "".concat(prefix, "-watermark")
172
- })) : null))));
97
+ return /*#__PURE__*/_jsx(App, {
98
+ children: /*#__PURE__*/_jsxs("div", {
99
+ className: classNames("".concat(prefix, "-container"), _defineProperty({}, "".concat(prefix, "-container-with-board"), board)),
100
+ style: style,
101
+ children: [/*#__PURE__*/_jsx("div", {
102
+ className: "".concat(prefix, "-bg"),
103
+ style: {
104
+ backgroundImage: "url(".concat(bgImage, ")")
105
+ },
106
+ children: /*#__PURE__*/_jsxs("div", {
107
+ className: "".concat(prefix, "-info"),
108
+ children: [title && /*#__PURE__*/_jsx("div", {
109
+ className: "".concat(prefix, "-welcome"),
110
+ children: title
111
+ }), description && /*#__PURE__*/_jsx("div", {
112
+ className: "".concat(prefix, "-start"),
113
+ children: description
114
+ })]
115
+ })
116
+ }), /*#__PURE__*/_jsxs("div", {
117
+ className: "".concat(prefix, "-card"),
118
+ children: [showLocale && /*#__PURE__*/_jsx("span", {
119
+ className: "".concat(prefix, "-locale"),
120
+ children: /*#__PURE__*/_jsx(LocaleDropdown, {
121
+ locales: locales
122
+ })
123
+ }), board && /*#__PURE__*/_jsx("div", {
124
+ className: "".concat(prefix, "-board"),
125
+ children: board
126
+ }), /*#__PURE__*/_jsxs("div", {
127
+ className: "".concat(prefix, "-content"),
128
+ children: [showActivate ? /*#__PURE__*/_jsxs(_Fragment, {
129
+ children: [/*#__PURE__*/_jsx("img", {
130
+ src: logo,
131
+ alt: "",
132
+ className: "".concat(prefix, "-activate-logo")
133
+ }), /*#__PURE__*/_jsx(Divider, {
134
+ style: {
135
+ marginTop: 14,
136
+ marginBottom: 20
137
+ }
138
+ }), /*#__PURE__*/_jsx(Typography.Title, {
139
+ level: 3,
140
+ children: locale.activeTitle
141
+ }), /*#__PURE__*/_jsx(Typography.Paragraph, {
142
+ children: locale.activeTitleDescrition
143
+ }), /*#__PURE__*/_jsx(ActivateForm, _objectSpread(_objectSpread({}, activateFormProps), {}, {
144
+ locale: locale,
145
+ errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message,
146
+ goBack: goBack
147
+ }))]
148
+ }) : /*#__PURE__*/_jsx(_Fragment, {
149
+ children: showRegister ? /*#__PURE__*/_jsxs(_Fragment, {
150
+ children: [/*#__PURE__*/_jsx("img", {
151
+ src: logo,
152
+ alt: "",
153
+ className: "".concat(prefix, "-reigster-logo")
154
+ }), /*#__PURE__*/_jsx(Divider, {
155
+ style: {
156
+ marginTop: 14,
157
+ marginBottom: 20
158
+ }
159
+ }), /*#__PURE__*/_jsx(Typography.Title, {
160
+ level: 3,
161
+ children: locale.registerTitle
162
+ }), /*#__PURE__*/_jsx(RegisterForm, _objectSpread(_objectSpread({}, registerProps), {}, {
163
+ locale: locale,
164
+ errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message
165
+ }))]
166
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
167
+ children: [/*#__PURE__*/_jsx("img", {
168
+ src: logo,
169
+ alt: "",
170
+ className: "".concat(prefix, "-logo")
171
+ }), /*#__PURE__*/_jsx(LoginForm, _objectSpread(_objectSpread({}, loginProps), {}, {
172
+ otherLoginProps: otherLoginProps,
173
+ locale: locale,
174
+ errorMessage: alertProps === null || alertProps === void 0 ? void 0 : alertProps.message,
175
+ showAuthCode: showAuthCode,
176
+ showOtherLoginButton: showOtherLoginButton,
177
+ authCodeImg: authCodeImg,
178
+ onAuthCodeImgChange: onAuthCodeImgChange
179
+ }))]
180
+ })
181
+ }), !!enableRegister && /*#__PURE__*/_jsx("div", {
182
+ className: "".concat(prefix, "-switch-btn"),
183
+ children: /*#__PURE__*/_jsx(Button, {
184
+ type: "link",
185
+ onClick: switchForm,
186
+ "data-testid": "login.register.btn",
187
+ children: showRegister ? locale.switchLoginLabel : locale.switchRegisterLabel
188
+ })
189
+ }), showWaterMark ? /*#__PURE__*/_jsx("div", {
190
+ className: "".concat(prefix, "-watermark-wrapper"),
191
+ style: {
192
+ paddingLeft: showAuthCode ? 96 : 0
193
+ },
194
+ children: /*#__PURE__*/_jsx("img", {
195
+ src: logoImg,
196
+ alt: "",
197
+ className: "".concat(prefix, "-watermark")
198
+ })
199
+ }) : null]
200
+ })]
201
+ })]
202
+ })
203
+ });
173
204
  };
174
205
  export default LocaleWrapper({
175
206
  componentName: 'Login',
@@ -17,6 +17,7 @@ import lottie from 'lottie-web';
17
17
  import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
18
18
  import { useUpdateEffect } from 'ahooks';
19
19
  import classNames from 'classnames';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
20
21
  var Lottie = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
22
  var _ref$mode = _ref.mode,
22
23
  mode = _ref$mode === void 0 ? 'default' : _ref$mode,
@@ -54,7 +55,7 @@ var Lottie = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
54
55
  animation: animation
55
56
  };
56
57
  });
57
- return /*#__PURE__*/React.createElement("div", {
58
+ return /*#__PURE__*/_jsx("div", {
58
59
  ref: containerRef,
59
60
  className: classNames(className, _defineProperty({}, 'anticon', mode === 'icon')),
60
61
  style: _objectSpread({
@@ -3,7 +3,7 @@ import './index.less';
3
3
  export interface IMenu {
4
4
  key: string;
5
5
  title: string;
6
- link: string;
6
+ link: string | string[];
7
7
  disabled?: boolean;
8
8
  openNewTab?: boolean;
9
9
  href?: boolean;
@@ -15,5 +15,5 @@ interface MenuProps {
15
15
  className?: string;
16
16
  style?: React.CSSProperties;
17
17
  }
18
- declare const _default: (props: MenuProps) => React.JSX.Element;
18
+ declare const _default: (props: MenuProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
19
19
  export default _default;
@@ -11,6 +11,7 @@ import React, { useCallback, useEffect, useState } from 'react';
11
11
  import { getPrefix } from "../_util";
12
12
  import useNavigate from "../_util/useNavigate";
13
13
  import "./index.less";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
14
15
  var prefix = getPrefix('menu');
15
16
  export default (function (props) {
16
17
  var menuList = props.menuList,
@@ -72,34 +73,38 @@ export default (function (props) {
72
73
  var linkList = isArray(link) ? link : [link];
73
74
  navigate === null || navigate === void 0 ? void 0 : navigate(linkList[0]);
74
75
  }, [navigate]);
75
- return /*#__PURE__*/React.createElement("div", {
76
+ return /*#__PURE__*/_jsx("div", {
76
77
  className: "".concat(prefix, "-container ").concat(className),
77
- style: style
78
- }, /*#__PURE__*/React.createElement(Menu, {
79
- style: {
80
- height: '100%',
81
- borderRight: 0
82
- },
83
- defaultSelectedKeys: ['0'],
84
- selectedKeys: selectedKeys,
85
- onSelect: onMenuItemSelect,
86
- mode: "inline",
87
- theme: "light"
88
- }, menus.map(function (config) {
89
- var _config$disabled;
90
- return /*#__PURE__*/React.createElement(Menu.Item, {
91
- key: config.key,
92
- disabled: (_config$disabled = config.disabled) !== null && _config$disabled !== void 0 ? _config$disabled : false
93
- }, config.openNewTab ? /*#__PURE__*/React.createElement("a", {
94
- id: config.id,
95
- href: config.link,
96
- target: "_blank",
97
- rel: "noreferrer"
98
- }, config.title) : /*#__PURE__*/React.createElement("a", {
99
- id: config.id,
100
- onClick: function onClick() {
101
- return onMenuClick(config.link);
102
- }
103
- }, config.title));
104
- })));
78
+ style: style,
79
+ children: /*#__PURE__*/_jsx(Menu, {
80
+ style: {
81
+ height: '100%',
82
+ borderRight: 0
83
+ },
84
+ defaultSelectedKeys: ['0'],
85
+ selectedKeys: selectedKeys,
86
+ onSelect: onMenuItemSelect,
87
+ mode: "inline",
88
+ theme: "light",
89
+ children: menus.map(function (config) {
90
+ var _config$disabled;
91
+ return /*#__PURE__*/_jsx(Menu.Item, {
92
+ disabled: (_config$disabled = config.disabled) !== null && _config$disabled !== void 0 ? _config$disabled : false,
93
+ children: config.openNewTab ? /*#__PURE__*/_jsx("a", {
94
+ id: config.id,
95
+ href: config.link,
96
+ target: "_blank",
97
+ rel: "noreferrer",
98
+ children: config.title
99
+ }) : /*#__PURE__*/_jsx("a", {
100
+ id: config.id,
101
+ onClick: function onClick() {
102
+ return onMenuClick(config.link);
103
+ },
104
+ children: config.title
105
+ })
106
+ }, config.key);
107
+ })
108
+ })
109
+ });
105
110
  });
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  declare const _default: ({ route, params, routes, paths }: {
3
2
  route: any;
4
3
  params: any;
5
4
  routes: any;
6
5
  paths: any;
7
- }) => React.JSX.Element;
6
+ }) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
8
7
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import useNavigate from "../_util/useNavigate";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
3
4
  export default (function (_ref) {
4
5
  var route = _ref.route,
5
6
  params = _ref.params,
@@ -14,9 +15,12 @@ export default (function (_ref) {
14
15
  return item.path;
15
16
  }).join('/');
16
17
  var navigate = useNavigate();
17
- return last ? /*#__PURE__*/React.createElement("span", null, title) : /*#__PURE__*/React.createElement("a", {
18
+ return last ? /*#__PURE__*/_jsx("span", {
19
+ children: title
20
+ }) : /*#__PURE__*/_jsx("a", {
18
21
  onClick: function onClick() {
19
22
  navigate === null || navigate === void 0 ? void 0 : navigate(path);
20
- }
21
- }, title);
23
+ },
24
+ children: title
25
+ });
22
26
  });