@oceanbase/ui 0.2.22 → 0.2.23

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.
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ContentWithQuestionProps {
4
+ content?: React.ReactNode;
5
+ tooltip?: any;
6
+ prefixIcon?: React.ReactNode | boolean;
7
+ suffixIcon?: React.ReactNode;
8
+ className?: string;
9
+ style?: React.CSSProperties;
10
+ onClick?: (e: React.SyntheticEvent) => void;
11
+ }
12
+ declare const ContentWithQuestion: React.FC<ContentWithQuestionProps>;
13
+ export default ContentWithQuestion;
@@ -0,0 +1,56 @@
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
+ var _excluded = ["content", "tooltip", "prefixIcon", "suffixIcon", "className", "children"];
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); }
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
+ 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 { QuestionCircleOutlined } from '@oceanbase/icons';
11
+ import { Space, Tooltip } from '@oceanbase/design';
12
+ import classNames from 'classnames';
13
+ import React, { isValidElement } from 'react';
14
+ import { getPrefix } from "../_util";
15
+ import "./index.less";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ var prefix = getPrefix('content-with-question');
19
+ var ContentWithQuestion = function ContentWithQuestion(_ref) {
20
+ var _classNames;
21
+ var content = _ref.content,
22
+ tooltip = _ref.tooltip,
23
+ _ref$prefixIcon = _ref.prefixIcon,
24
+ prefixIcon = _ref$prefixIcon === void 0 ? null : _ref$prefixIcon,
25
+ _ref$suffixIcon = _ref.suffixIcon,
26
+ suffixIcon = _ref$suffixIcon === void 0 ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
27
+ className: "".concat(prefix, "-help")
28
+ }) : _ref$suffixIcon,
29
+ className = _ref.className,
30
+ children = _ref.children,
31
+ restProps = _objectWithoutProperties(_ref, _excluded);
32
+ // FIXME: antd 已经废弃 icon type 的用法,该组件也需要做相应处理,后面将会是传入 Icon 的形式而非 type
33
+ var getIcon = function getIcon(iconConfig) {
34
+ return iconConfig ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
35
+ children: /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : /*#__PURE__*/_jsx(QuestionCircleOutlined, {
36
+ className: "".concat(prefix, "-help")
37
+ })
38
+ })) : null;
39
+ };
40
+ return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
41
+ className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
42
+ }, restProps), {}, {
43
+ children: /*#__PURE__*/_jsxs(Space, {
44
+ children: [getIcon(prefixIcon === true ? /*#__PURE__*/_jsx(QuestionCircleOutlined, {
45
+ className: "".concat(prefix, "-help"),
46
+ style: {
47
+ marginRight: 4
48
+ }
49
+ }) : prefixIcon), /*#__PURE__*/_jsx("span", {
50
+ "data-testid": "content",
51
+ children: content !== null && content !== void 0 ? content : children
52
+ }), getIcon(suffixIcon)]
53
+ })
54
+ }));
55
+ };
56
+ export default ContentWithQuestion;
@@ -0,0 +1,19 @@
1
+ @prefix: ob-content-with-question;
2
+
3
+ .@{prefix}-item {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ .@{prefix}-prefix {
7
+ margin-right: 8px;
8
+ }
9
+ .@{prefix}-suffix {
10
+ margin-left: 8px;
11
+ }
12
+ .@{prefix}-help {
13
+ cursor: help;
14
+ }
15
+ .@{prefix}-color {
16
+ color: red;
17
+
18
+ }
19
+ }
@@ -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" | "go" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "json" | "css" | "sql" | "tsx" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -1,2 +1,2 @@
1
- declare const _default: () => import("packages/design/es/config-provider").NavigateFunction;
1
+ declare const _default: () => import("../../../design/src/config-provider").NavigateFunction;
2
2
  export default _default;
package/es/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { default as BasicLayout } from './BasicLayout';
8
8
  export { default as BatchOperationBar } from './BatchOperationBar';
9
9
  export { default as Boundary } from './Boundary';
10
10
  export * from './constant';
11
+ export { default as ContentWithQuestion } from './ContentWithQuestion';
11
12
  export { default as ContentWithIcon } from './ContentWithIcon';
12
13
  export { default as Dialog } from './Dialog';
13
14
  export { default as DocDialog } from './DocDialog';
package/es/index.js CHANGED
@@ -7,6 +7,7 @@ export { default as BasicLayout } from "./BasicLayout";
7
7
  export { default as BatchOperationBar } from "./BatchOperationBar";
8
8
  export { default as Boundary } from "./Boundary";
9
9
  export * from "./constant";
10
+ export { default as ContentWithQuestion } from "./ContentWithQuestion";
10
11
  export { default as ContentWithIcon } from "./ContentWithIcon";
11
12
  export { default as Dialog } from "./Dialog";
12
13
  export { default as DocDialog } from "./DocDialog";
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ContentWithQuestionProps {
4
+ content?: React.ReactNode;
5
+ tooltip?: any;
6
+ prefixIcon?: React.ReactNode | boolean;
7
+ suffixIcon?: React.ReactNode;
8
+ className?: string;
9
+ style?: React.CSSProperties;
10
+ onClick?: (e: React.SyntheticEvent) => void;
11
+ }
12
+ declare const ContentWithQuestion: React.FC<ContentWithQuestionProps>;
13
+ export default ContentWithQuestion;
@@ -0,0 +1,76 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/ContentWithQuestion/index.tsx
30
+ var ContentWithQuestion_exports = {};
31
+ __export(ContentWithQuestion_exports, {
32
+ default: () => ContentWithQuestion_default
33
+ });
34
+ module.exports = __toCommonJS(ContentWithQuestion_exports);
35
+ var import_icons = require("@oceanbase/icons");
36
+ var import_design = require("@oceanbase/design");
37
+ var import_classnames = __toESM(require("classnames"));
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");
42
+ var ContentWithQuestion = ({
43
+ content,
44
+ tooltip,
45
+ prefixIcon = null,
46
+ suffixIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefix}-help` }),
47
+ className,
48
+ children,
49
+ ...restProps
50
+ }) => {
51
+ 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;
53
+ };
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
70
+ }
71
+ }
72
+ ) : prefixIcon
73
+ ), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon))
74
+ );
75
+ };
76
+ var ContentWithQuestion_default = ContentWithQuestion;
@@ -0,0 +1,19 @@
1
+ @prefix: ob-content-with-question;
2
+
3
+ .@{prefix}-item {
4
+ display: inline-flex;
5
+ align-items: center;
6
+ .@{prefix}-prefix {
7
+ margin-right: 8px;
8
+ }
9
+ .@{prefix}-suffix {
10
+ margin-left: 8px;
11
+ }
12
+ .@{prefix}-help {
13
+ cursor: help;
14
+ }
15
+ .@{prefix}-color {
16
+ color: red;
17
+
18
+ }
19
+ }
@@ -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" | "go" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "json" | "css" | "sql" | "tsx" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -1,2 +1,2 @@
1
- declare const _default: () => import("packages/design/es/config-provider").NavigateFunction;
1
+ declare const _default: () => import("../../../design/src/config-provider").NavigateFunction;
2
2
  export default _default;
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { default as BasicLayout } from './BasicLayout';
8
8
  export { default as BatchOperationBar } from './BatchOperationBar';
9
9
  export { default as Boundary } from './Boundary';
10
10
  export * from './constant';
11
+ export { default as ContentWithQuestion } from './ContentWithQuestion';
11
12
  export { default as ContentWithIcon } from './ContentWithIcon';
12
13
  export { default as Dialog } from './Dialog';
13
14
  export { default as DocDialog } from './DocDialog';
package/lib/index.js CHANGED
@@ -37,6 +37,7 @@ __export(src_exports, {
37
37
  BatchOperationBar: () => import_BatchOperationBar.default,
38
38
  Boundary: () => import_Boundary.default,
39
39
  ContentWithIcon: () => import_ContentWithIcon.default,
40
+ ContentWithQuestion: () => import_ContentWithQuestion.default,
40
41
  Dialog: () => import_Dialog.default,
41
42
  DocDialog: () => import_DocDialog.default,
42
43
  FullscreenBox: () => import_FullscreenBox.default,
@@ -66,6 +67,7 @@ var import_BasicLayout = __toESM(require("./BasicLayout"));
66
67
  var import_BatchOperationBar = __toESM(require("./BatchOperationBar"));
67
68
  var import_Boundary = __toESM(require("./Boundary"));
68
69
  __reExport(src_exports, require("./constant"), module.exports);
70
+ var import_ContentWithQuestion = __toESM(require("./ContentWithQuestion"));
69
71
  var import_ContentWithIcon = __toESM(require("./ContentWithIcon"));
70
72
  var import_Dialog = __toESM(require("./Dialog"));
71
73
  var import_DocDialog = __toESM(require("./DocDialog"));
@@ -94,6 +96,7 @@ var import_TagSelect = __toESM(require("./TagSelect"));
94
96
  BatchOperationBar,
95
97
  Boundary,
96
98
  ContentWithIcon,
99
+ ContentWithQuestion,
97
100
  Dialog,
98
101
  DocDialog,
99
102
  FullscreenBox,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/ui",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "The UI library based on OceanBase Design",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -31,20 +31,20 @@
31
31
  "LICENSE"
32
32
  ],
33
33
  "scripts": {
34
- "build": "father build"
34
+ "build": "NODE_OPTIONS=--max_old_space_size=4096 father build"
35
35
  },
36
36
  "dependencies": {
37
- "@ant-design/cssinjs": "^1.17.0",
38
- "@ant-design/pro-components": "^2.6.28",
39
- "@ant-design/pro-layout": "^7.17.4",
40
- "@oceanbase/design": "^0.2.21",
41
- "@oceanbase/icons": "^0.2.7",
42
- "@oceanbase/util": "^0.2.9",
37
+ "@ant-design/cssinjs": "^1.17.2",
38
+ "@ant-design/pro-components": "^2.6.30",
39
+ "@ant-design/pro-layout": "^7.17.8",
40
+ "@oceanbase/design": "^0.2.22",
41
+ "@oceanbase/icons": "^0.2.8",
42
+ "@oceanbase/util": "^0.2.10",
43
43
  "ahooks": "^2.10.14",
44
44
  "classnames": "^2.3.2",
45
45
  "dayjs": "^1.11.10",
46
46
  "diff": "^5.1.0",
47
- "highlight.js": "^11.8.0",
47
+ "highlight.js": "^11.9.0",
48
48
  "highlightjs-solidity": "^2.0.6",
49
49
  "hoist-non-react-statics": "^3.3.2",
50
50
  "lodash": "^4.17.21",
@@ -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.37.0",
55
+ "rc-util": "^5.38.0",
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": "38becd333620011d0d084df62b1131135a396abb"
69
+ "gitHead": "265c33e6cc878f7b00c14518850c93c91749353b"
70
70
  }