@oceanbase/ui 0.2.22 → 0.2.24

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.
@@ -38,7 +38,7 @@ var SubMenu = Menu.SubMenu,
38
38
  Item = Menu.Item;
39
39
  var prefix = getPrefix('layout');
40
40
  var BasicLayout = function BasicLayout(_ref) {
41
- var _classNames2;
41
+ var _classNames, _classNames2;
42
42
  var children = _ref.children,
43
43
  _ref$location = _ref.location,
44
44
  _ref$location2 = _ref$location === void 0 ? {} : _ref$location,
@@ -64,10 +64,10 @@ var BasicLayout = function BasicLayout(_ref) {
64
64
  restProps = _objectWithoutProperties(_ref, _excluded);
65
65
  var _useContext = useContext(ConfigProvider.ConfigContext),
66
66
  getPrefixCls = _useContext.getPrefixCls;
67
- var prefixCls = getPrefixCls('basic-layout', customizePrefixCls);
67
+ var prefixCls = getPrefixCls('pro-basic-layout', customizePrefixCls);
68
68
  var _useStyle = useStyle(prefixCls),
69
69
  wrapSSR = _useStyle.wrapSSR;
70
- var basicLayoutCls = classNames(className);
70
+ var basicLayoutCls = classNames(prefixCls, className);
71
71
  var navigate = useNavigate();
72
72
  // 侧边栏导航是否收起
73
73
  var _useState = useState(defaultCollapsed),
@@ -254,7 +254,7 @@ var BasicLayout = function BasicLayout(_ref) {
254
254
  var siderWidth = 0;
255
255
  // 根据菜单项的配置计算侧边栏的宽度
256
256
  if (subSideMenus && menus) {
257
- siderWidth = collapsed ? 104 : 192;
257
+ siderWidth = collapsed ? 52 * 2 : 208;
258
258
  } else if (subSideMenus && !menus) {
259
259
  siderWidth = 52;
260
260
  } else if (!subSideMenus && menus) {
@@ -267,7 +267,7 @@ var BasicLayout = function BasicLayout(_ref) {
267
267
  className: "".concat(prefix, "-banner-wrapper"),
268
268
  children: banner
269
269
  }), /*#__PURE__*/_jsx(Layout, _objectSpread(_objectSpread({
270
- className: classNames(prefix, className, basicLayoutCls, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
270
+ className: classNames(prefix, className, basicLayoutCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-with-banner"), banner), _defineProperty(_classNames, "".concat(prefixCls, "-sider-").concat(siderWidth), true), _classNames))
271
271
  }, restProps), {}, {
272
272
  children: /*#__PURE__*/_jsxs(React.Fragment, {
273
273
  children: [/*#__PURE__*/_jsx(Header, _objectSpread({
@@ -1,17 +1,27 @@
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 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; }
2
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; }
3
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
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); }
5
7
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
8
  export var genBasicLayoutStyle = function genBasicLayoutStyle(token) {
7
- var _ref;
8
- var proComponentsCls = token.proComponentsCls;
9
- return _ref = {}, _defineProperty(_ref, "".concat(proComponentsCls, "-page-container"), {
9
+ var componentCls = token.componentCls,
10
+ proComponentsCls = token.proComponentsCls,
11
+ motionDurationSlow = token.motionDurationSlow;
12
+ var siderWidthList = [0, 52, 52 * 2, 192, 208];
13
+ var footerBarStyle = {};
14
+ siderWidthList.forEach(function (width) {
15
+ footerBarStyle["".concat(componentCls).concat(componentCls, "-sider-").concat(width)] = _defineProperty({}, "".concat(proComponentsCls, "-footer-bar"), {
16
+ // footer bar width adapt to sider width of BasicLayout
17
+ width: width === 0 ? '100%' : "calc(100% - ".concat(width, "px - 24px)"),
18
+ transition: "width ".concat(motionDurationSlow)
19
+ });
20
+ });
21
+ return _objectSpread(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(proComponentsCls, "-page-container"), {
10
22
  // 48px is the height of BasicLayout header
11
23
  minHeight: 'calc(100vh - 48px)'
12
- }), _defineProperty(_ref, "".concat(proComponentsCls, "-footer-bar"), {
13
- width: "calc(100% - 192px - 24px)"
14
- }), _ref;
24
+ })), footerBarStyle);
15
25
  };
16
26
  export default (function (prefixCls) {
17
27
  var useStyle = genComponentStyleHook('BasicLayout', function (token) {
@@ -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" | "css" | "bash" | "json" | "java" | "go" | "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
  /**
@@ -1,5 +1,5 @@
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
- var _excluded = ["prefixCls", "className", "header", "content", "extraContent", "tabList", "tabBarExtraContent", "locale"];
2
+ var _excluded = ["prefixCls", "className", "header", "content", "extraContent", "tabList", "tabBarExtraContent", "footerToolBarProps", "locale"];
3
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
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
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; }
@@ -27,6 +27,7 @@ var PageContainer = function PageContainer(_ref) {
27
27
  extraContent = _ref.extraContent,
28
28
  tabList = _ref.tabList,
29
29
  tabBarExtraContent = _ref.tabBarExtraContent,
30
+ footerToolBarProps = _ref.footerToolBarProps,
30
31
  locale = _ref.locale,
31
32
  restProps = _objectWithoutProperties(_ref, _excluded);
32
33
  var _useContext = useContext(ConfigProvider.ConfigContext),
@@ -41,7 +42,7 @@ var PageContainer = function PageContainer(_ref) {
41
42
  breadcrumb = _ref2.breadcrumb;
42
43
  var reloadProps = isObject(reload) && ! /*#__PURE__*/React.isValidElement(reload) ? reload : {};
43
44
  var reloadCls = classNames("".concat(rootPrefixCls, "-page-header-heading-reload"), reloadProps.className);
44
- var newSubTitle = subTitle && /*#__PURE__*/_jsxs(Space, {
45
+ var newSubTitle = (reload || subTitle) && /*#__PURE__*/_jsxs(Space, {
45
46
  size: 12,
46
47
  children: [reload && /*#__PURE__*/_jsx(Tooltip, {
47
48
  title: locale.reload,
@@ -63,7 +64,7 @@ var PageContainer = function PageContainer(_ref) {
63
64
  }
64
65
  }, breadcrumb)
65
66
  });
66
- var noHasHeader = ['title', 'subTitle', 'extra', 'tags', 'footer', 'avatar', 'backIcon', 'breadcrumb'].every(function (item) {
67
+ var noHasHeader = ['title', 'subTitle', 'extra', 'tags', 'avatar', 'backIcon', 'breadcrumb'].every(function (item) {
67
68
  return !(newHeader !== null && newHeader !== void 0 && newHeader[item]);
68
69
  }) && !content && !extraContent && !tabList && !tabBarExtraContent;
69
70
  var pageContainerCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-page-header"), noHasHeader), className);
@@ -74,7 +75,11 @@ var PageContainer = function PageContainer(_ref) {
74
75
  content: content,
75
76
  extraContent: extraContent,
76
77
  tabList: tabList,
77
- tabBarExtraContent: tabBarExtraContent
78
+ tabBarExtraContent: tabBarExtraContent,
79
+ footerToolBarProps: _objectSpread(_objectSpread({}, footerToolBarProps), {}, {
80
+ // render footer as same level with PageContainer instead of under body
81
+ portalDom: false
82
+ })
78
83
  }, restProps)));
79
84
  };
80
85
  export default LocaleWrapper({
@@ -24,7 +24,8 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
24
24
  }, _defineProperty(_$concat3, "".concat(proComponentsCls, "-grid-content"), {
25
25
  minHeight: 'auto'
26
26
  }), _defineProperty(_$concat3, "".concat(antCls, "-page-header"), (_$concat2 = {}, _defineProperty(_$concat2, "".concat(antCls, "-page-header-breadcrumb"), {
27
- marginBottom: 6
27
+ // overwritten pro-components style
28
+ paddingBlockStart: 0
28
29
  }), _defineProperty(_$concat2, "".concat(antCls, "-page-header-heading-title"), {
29
30
  fontSize: fontSizeHeading3
30
31
  }), _defineProperty(_$concat2, "".concat(antCls, "-page-header-heading-reload"), {
@@ -44,8 +45,10 @@ export var genPageContainerStyle = function genPageContainerStyle(token) {
44
45
  }), _$concat)), _defineProperty(_$concat2, "".concat(antCls, "-page-header-footer"), {
45
46
  marginBlockStart: 0
46
47
  }), _$concat2)), _defineProperty(_$concat3, "".concat(componentCls, "-warp-page-header"), {
47
- paddingInline: "".concat(paddingLG, "px !important"),
48
- paddingBlock: "".concat(padding, "px !important")
48
+ paddingInlineStart: paddingLG,
49
+ paddingInlineEnd: paddingLG,
50
+ paddingBlockStart: padding,
51
+ paddingBlockEnd: padding
49
52
  }), _defineProperty(_$concat3, "".concat(componentCls, "-children-container"), {
50
53
  paddingInline: paddingLG,
51
54
  paddingBlockStart: 0,
@@ -2,7 +2,7 @@ import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
2
2
  import type { RangeValue } from './Ranger';
3
3
  import type { RangeOption } from './typing';
4
4
  export type QuickType = 'select' | 'dropdown';
5
- interface IProps extends LocaleWrapperProps {
5
+ interface QuickPickerProps extends LocaleWrapperProps {
6
6
  selects: RangeOption[];
7
7
  type?: QuickType;
8
8
  onChange: (range: RangeValue) => void;
@@ -13,5 +13,5 @@ interface IProps extends LocaleWrapperProps {
13
13
  isMoment?: boolean;
14
14
  size?: 'small' | 'large' | 'middle';
15
15
  }
16
- declare const _default: (props: IProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
16
+ declare const _default: (props: QuickPickerProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
17
17
  export default _default;
@@ -1,2 +1,4 @@
1
+ export * from './QuickPicker';
2
+ export * from './Ranger';
1
3
  declare const Ranger: any;
2
4
  export default Ranger;
@@ -1,6 +1,8 @@
1
1
  import { LAST_MONTH, LAST_QUARTER, LAST_WEEK, LAST_YEAR, NEAR_10_MINUTES, NEAR_1_HOURS, NEAR_1_MINUTES, NEAR_20_MINUTES, NEAR_2_HOURS, NEAR_30_MINUTES, NEAR_3_HOURS, NEAR_5_MINUTES, NEAR_6_HOURS, NEXT_MONTH, NEXT_QUARTER, NEXT_WEEK, NEXT_YEAR, THIS_MONTH, THIS_QUARTER, THIS_WEEK, THIS_YEAR, TODAY, TOMORROW, YESTERDAY } from "./constant";
2
2
  import QuickPicker from "./QuickPicker";
3
3
  import InternalRanger from "./Ranger";
4
+ export * from "./QuickPicker";
5
+ export * from "./Ranger";
4
6
  var Ranger = InternalRanger;
5
7
 
6
8
  // 内置 ranges
@@ -17,7 +17,7 @@ export interface TreeSearchRef {
17
17
  checkAll: () => void;
18
18
  invertSelect: () => void;
19
19
  }
20
- interface IProps {
20
+ interface TreeSearchProps {
21
21
  treeData: Node[];
22
22
  titleRender?: (nodeData: DataNode) => React.ReactNode;
23
23
  checkable?: boolean;
@@ -34,5 +34,5 @@ interface IProps {
34
34
  loadData?: (data: unknown) => Promise<void>;
35
35
  searchStyle?: {};
36
36
  }
37
- declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<TreeSearchRef>>;
37
+ declare const _default: React.ForwardRefExoticComponent<TreeSearchProps & React.RefAttributes<TreeSearchRef>>;
38
38
  export default _default;
@@ -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";
@@ -71,9 +71,9 @@ var BasicLayout = ({
71
71
  ...restProps
72
72
  }) => {
73
73
  const { getPrefixCls } = (0, import_react.useContext)(import_design2.ConfigProvider.ConfigContext);
74
- const prefixCls = getPrefixCls("basic-layout", customizePrefixCls);
74
+ const prefixCls = getPrefixCls("pro-basic-layout", customizePrefixCls);
75
75
  const { wrapSSR } = (0, import_style.default)(prefixCls);
76
- const basicLayoutCls = (0, import_classnames.default)(className);
76
+ const basicLayoutCls = (0, import_classnames.default)(prefixCls, className);
77
77
  const navigate = (0, import_useNavigate.default)();
78
78
  const [collapsed, setCollapsed] = (0, import_react.useState)(defaultCollapsed);
79
79
  const [selectedKeys, setSelectedKeys] = (0, import_react.useState)(defaultSelectedKeys);
@@ -233,7 +233,7 @@ var BasicLayout = ({
233
233
  };
234
234
  let siderWidth = 0;
235
235
  if (subSideMenus && menus) {
236
- siderWidth = collapsed ? 104 : 192;
236
+ siderWidth = collapsed ? 52 * 2 : 208;
237
237
  } else if (subSideMenus && !menus) {
238
238
  siderWidth = 52;
239
239
  } else if (!subSideMenus && menus) {
@@ -246,7 +246,8 @@ var BasicLayout = ({
246
246
  import_design2.Layout,
247
247
  {
248
248
  className: (0, import_classnames.default)(prefix, className, basicLayoutCls, {
249
- [`${prefix}-with-banner`]: banner
249
+ [`${prefix}-with-banner`]: banner,
250
+ [`${prefixCls}-sider-${siderWidth}`]: true
250
251
  }),
251
252
  ...restProps
252
253
  },
@@ -25,16 +25,27 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var genBasicLayoutStyle = (token) => {
28
- const { proComponentsCls } = token;
28
+ const { componentCls, proComponentsCls, motionDurationSlow } = token;
29
+ const siderWidthList = [0, 52, 52 * 2, 192, 208];
30
+ const footerBarStyle = {};
31
+ siderWidthList.forEach((width) => {
32
+ footerBarStyle[`${componentCls}${componentCls}-sider-${width}`] = {
33
+ [`${proComponentsCls}-footer-bar`]: {
34
+ // footer bar width adapt to sider width of BasicLayout
35
+ width: width === 0 ? "100%" : `calc(100% - ${width}px - 24px)`,
36
+ transition: `width ${motionDurationSlow}`
37
+ }
38
+ };
39
+ });
29
40
  return {
30
- // Set style of PageContainer in BasicLayout
31
- [`${proComponentsCls}-page-container`]: {
32
- // 48px is the height of BasicLayout header
33
- minHeight: "calc(100vh - 48px)"
41
+ [`${componentCls}`]: {
42
+ // Set style of PageContainer in BasicLayout
43
+ [`${proComponentsCls}-page-container`]: {
44
+ // 48px is the height of BasicLayout header
45
+ minHeight: "calc(100vh - 48px)"
46
+ }
34
47
  },
35
- [`${proComponentsCls}-footer-bar`]: {
36
- width: `calc(100% - 192px - 24px)`
37
- }
48
+ ...footerBarStyle
38
49
  };
39
50
  };
40
51
  var style_default = (prefixCls) => {
@@ -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" | "css" | "java" | "json" | "bash" | "javascript" | "typescript" | "groovy" | "python" | "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
  /**
@@ -50,6 +50,7 @@ var PageContainer = ({
50
50
  extraContent,
51
51
  tabList,
52
52
  tabBarExtraContent,
53
+ footerToolBarProps,
53
54
  locale,
54
55
  ...restProps
55
56
  }) => {
@@ -63,7 +64,7 @@ var PageContainer = ({
63
64
  `${rootPrefixCls}-page-header-heading-reload`,
64
65
  reloadProps.className
65
66
  );
66
- const newSubTitle = subTitle && /* @__PURE__ */ import_react.default.createElement(import_design.Space, { size: 12 }, reload && /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: locale.reload }, (0, import_lodash.isObject)(reload) && import_react.default.isValidElement(reload) ? reload : /* @__PURE__ */ import_react.default.createElement(import_icons.SyncOutlined, { ...reloadProps, className: reloadCls })), subTitle);
67
+ const newSubTitle = (reload || subTitle) && /* @__PURE__ */ import_react.default.createElement(import_design.Space, { size: 12 }, reload && /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: locale.reload }, (0, import_lodash.isObject)(reload) && import_react.default.isValidElement(reload) ? reload : /* @__PURE__ */ import_react.default.createElement(import_icons.SyncOutlined, { ...reloadProps, className: reloadCls })), subTitle);
67
68
  const newHeader = header && {
68
69
  ...header,
69
70
  subTitle: newSubTitle,
@@ -72,7 +73,7 @@ var PageContainer = ({
72
73
  ...breadcrumb
73
74
  }
74
75
  };
75
- const noHasHeader = ["title", "subTitle", "extra", "tags", "footer", "avatar", "backIcon", "breadcrumb"].every(
76
+ const noHasHeader = ["title", "subTitle", "extra", "tags", "avatar", "backIcon", "breadcrumb"].every(
76
77
  (item) => !(newHeader == null ? void 0 : newHeader[item])
77
78
  ) && !content && !extraContent && !tabList && !tabBarExtraContent;
78
79
  const pageContainerCls = (0, import_classnames.default)(
@@ -92,6 +93,11 @@ var PageContainer = ({
92
93
  extraContent,
93
94
  tabList,
94
95
  tabBarExtraContent,
96
+ footerToolBarProps: {
97
+ ...footerToolBarProps,
98
+ // render footer as same level with PageContainer instead of under body
99
+ portalDom: false
100
+ },
95
101
  ...restProps
96
102
  }
97
103
  )
@@ -49,7 +49,8 @@ var genPageContainerStyle = (token) => {
49
49
  },
50
50
  [`${antCls}-page-header`]: {
51
51
  [`${antCls}-page-header-breadcrumb`]: {
52
- marginBottom: 6
52
+ // overwritten pro-components style
53
+ paddingBlockStart: 0
53
54
  },
54
55
  [`${antCls}-page-header-heading-title`]: {
55
56
  fontSize: fontSizeHeading3
@@ -80,8 +81,10 @@ var genPageContainerStyle = (token) => {
80
81
  },
81
82
  // 减小内容区左右两侧间距
82
83
  [`${componentCls}-warp-page-header`]: {
83
- paddingInline: `${paddingLG}px !important`,
84
- paddingBlock: `${padding}px !important`
84
+ paddingInlineStart: paddingLG,
85
+ paddingInlineEnd: paddingLG,
86
+ paddingBlockStart: padding,
87
+ paddingBlockEnd: padding
85
88
  },
86
89
  [`${componentCls}-children-container`]: {
87
90
  paddingInline: paddingLG,
@@ -2,7 +2,7 @@ import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
2
2
  import type { RangeValue } from './Ranger';
3
3
  import type { RangeOption } from './typing';
4
4
  export type QuickType = 'select' | 'dropdown';
5
- interface IProps extends LocaleWrapperProps {
5
+ interface QuickPickerProps extends LocaleWrapperProps {
6
6
  selects: RangeOption[];
7
7
  type?: QuickType;
8
8
  onChange: (range: RangeValue) => void;
@@ -13,5 +13,5 @@ interface IProps extends LocaleWrapperProps {
13
13
  isMoment?: boolean;
14
14
  size?: 'small' | 'large' | 'middle';
15
15
  }
16
- declare const _default: (props: IProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
16
+ declare const _default: (props: QuickPickerProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
17
17
  export default _default;
@@ -1,2 +1,4 @@
1
+ export * from './QuickPicker';
2
+ export * from './Ranger';
1
3
  declare const Ranger: any;
2
4
  export default Ranger;
@@ -16,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  }
17
17
  return to;
18
18
  };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
21
  // If the importer is in node compatibility mode or this is not an ESM
21
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -35,6 +36,8 @@ module.exports = __toCommonJS(Ranger_exports);
35
36
  var import_constant = require("./constant");
36
37
  var import_QuickPicker = __toESM(require("./QuickPicker"));
37
38
  var import_Ranger = __toESM(require("./Ranger"));
39
+ __reExport(Ranger_exports, require("./QuickPicker"), module.exports);
40
+ __reExport(Ranger_exports, require("./Ranger"), module.exports);
38
41
  var Ranger = import_Ranger.default;
39
42
  Ranger.NEAR_1_MINUTES = import_constant.NEAR_1_MINUTES;
40
43
  Ranger.NEAR_5_MINUTES = import_constant.NEAR_5_MINUTES;
@@ -62,3 +65,8 @@ Ranger.LAST_YEAR = import_constant.LAST_YEAR;
62
65
  Ranger.NEXT_YEAR = import_constant.NEXT_YEAR;
63
66
  Ranger.QuickPicker = import_QuickPicker.default;
64
67
  var Ranger_default = Ranger;
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ ...require("./QuickPicker"),
71
+ ...require("./Ranger")
72
+ });