@easyv/react-components 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { ConfirmProps } from '@arco-design/web-react/es/Modal/confirm';
2
2
  import { ModalProps } from './interface';
3
3
  import './index.less';
4
- declare function XModal({ className, simple, size, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
4
+ declare function XModal({ className, simple, contentPadding, size, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
5
5
  declare namespace XModal {
6
6
  var confirm: (props: ConfirmProps) => import("@arco-design/web-react/es/Modal/interface").ModalReturnProps;
7
7
  var error: (props: ConfirmProps) => import("@arco-design/web-react/es/Modal/interface").ModalReturnProps;
@@ -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 = ["className", "simple", "size"];
2
+ var _excluded = ["className", "simple", "contentPadding", "size"];
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; }
@@ -16,13 +16,16 @@ var originModalConfirm = Modal.confirm;
16
16
  export default function XModal(_ref) {
17
17
  var className = _ref.className,
18
18
  simple = _ref.simple,
19
+ _ref$contentPadding = _ref.contentPadding,
20
+ contentPadding = _ref$contentPadding === void 0 ? true : _ref$contentPadding,
19
21
  _ref$size = _ref.size,
20
22
  size = _ref$size === void 0 ? 'default' : _ref$size,
21
23
  props = _objectWithoutProperties(_ref, _excluded);
22
24
  // 重新定义 arco design 的简洁模式(simple), 自己写样式覆盖
23
25
  return /*#__PURE__*/_jsx(Modal, _objectSpread({
24
26
  className: classNames(className, "arco-modal-".concat(size), {
25
- 'arco-modal-borderless': simple
27
+ 'arco-modal-borderless': simple,
28
+ 'arco-modal-content-no-padding': !contentPadding
26
29
  }),
27
30
  closeIcon: /*#__PURE__*/_jsx(CloseOutlined, {})
28
31
  }, props));
@@ -36,11 +36,18 @@
36
36
 
37
37
  .arco-modal-footer {
38
38
  border-top: none;
39
- padding-top: 24px;
39
+ padding-top: 0;
40
40
  padding-bottom: 24px;
41
41
  }
42
42
  }
43
43
 
44
+ &.arco-modal-content-no-padding {
45
+ .arco-modal-content {
46
+ padding-top: 0;
47
+ padding-bottom: 0;
48
+ }
49
+ }
50
+
44
51
  // close
45
52
  .arco-modal-close-icon {
46
53
  line-height: 1;
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import type { ModalProps } from '@arco-design/web-react';
3
3
  interface XModalProps extends ModalProps {
4
4
  size?: 'mini' | 'small' | 'default' | 'medium' | 'large';
5
+ contentPadding?: boolean;
5
6
  children: ReactNode;
6
7
  }
7
8
  export type { XModalProps as ModalProps };
@@ -15,7 +15,7 @@ export function useTheme() {
15
15
  setTheme(getTheme());
16
16
  }, []);
17
17
  useEffect(function () {
18
- var observer = new MutationObserver(function (mutationsList, observer) {
18
+ var observer = new MutationObserver(function (mutationsList) {
19
19
  mutationsList.forEach(function (mutation) {
20
20
  if (mutation.type === 'attributes' && mutation.attributeName === 'arco-theme') {
21
21
  // 处理属性变化的逻辑
@@ -1 +1 @@
1
- export declare function getTheme(): any;
1
+ export declare function getTheme(): 'light' | 'dark';
package/dist/util/util.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export function getTheme() {
2
- return typeof document !== 'undefined' ? document.body.attributes['arco-theme'] || 'light' : 'light';
2
+ var _document$body$attrib;
3
+ var theme = typeof document !== 'undefined' ? ((_document$body$attrib = document.body.attributes['arco-theme']) === null || _document$body$attrib === void 0 ? void 0 : _document$body$attrib.value) || 'light' : 'light';
4
+ return ['light', 'dark'].includes(theme) ? theme : 'light';
3
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/react-components",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "description": "a react component library base on arco design",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import type { MenuProps } from './interface';
3
- import './index.less';
4
- declare const XMenu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<unknown>> & {
5
- Item: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuItemProps & import("react").RefAttributes<unknown>> & {
6
- menuType: string;
7
- };
8
- ItemGroup: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuItemGroupProps & import("react").RefAttributes<unknown>> & {
9
- menuType: string;
10
- };
11
- SubMenu: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuSubMenuProps & import("react").RefAttributes<unknown>> & {
12
- menuType: string;
13
- };
14
- __ARCO_MENU__: boolean;
15
- };
16
- export default XMenu;
17
- export { MenuProps };
@@ -1,3 +0,0 @@
1
- export * from './useClickOutside';
2
- export * from './useEventListener';
3
- export * from './useTheme';