@easyv/react-components 0.2.6 → 0.2.8
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.
- package/dist/Menu/index.d.ts +1 -1
- package/dist/Menu/index.js +22 -4
- package/dist/Menu/index.less +28 -0
- package/dist/Menu/interface.d.ts +5 -1
- package/dist/Select/index.less +0 -5
- package/package.json +1 -1
package/dist/Menu/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MenuProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare const XMenu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<unknown>> & {
|
|
4
|
+
declare const XMenu: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuProps & import("react").RefAttributes<unknown>> & {
|
|
5
5
|
Item: import("react").ForwardRefExoticComponent<import("@arco-design/web-react").MenuItemProps & import("react").RefAttributes<unknown>> & {
|
|
6
6
|
menuType: string;
|
|
7
7
|
};
|
package/dist/Menu/index.js
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
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 = ["compact", "className", "triggerProps"];
|
|
2
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; }
|
|
3
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; }
|
|
4
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; }
|
|
5
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
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; }
|
|
7
10
|
import { forwardRef } from 'react';
|
|
8
11
|
import { Menu } from '@arco-design/web-react';
|
|
9
12
|
import { DownOutlined, RightOutlined } from '@easyv/react-icons';
|
|
10
|
-
import
|
|
13
|
+
import classNames from 'classnames';
|
|
11
14
|
import { useTheme } from "../hooks/useTheme";
|
|
15
|
+
import "./index.less";
|
|
12
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
var XMenu = /*#__PURE__*/forwardRef(function (
|
|
17
|
+
var XMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
+
var compact = _ref.compact,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
_ref$triggerProps = _ref.triggerProps,
|
|
21
|
+
triggerProps = _ref$triggerProps === void 0 ? {} : _ref$triggerProps,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
23
|
var theme = useTheme();
|
|
24
|
+
var newTriggerProps = _objectSpread(_objectSpread({}, triggerProps), {}, {
|
|
25
|
+
className: classNames(triggerProps.className, {
|
|
26
|
+
'arco-menu-pop-trigger-compact': compact
|
|
27
|
+
})
|
|
28
|
+
});
|
|
15
29
|
return /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({
|
|
16
|
-
ref: ref
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: classNames(className, {
|
|
32
|
+
'arco-menu-compact': compact
|
|
33
|
+
})
|
|
17
34
|
}, props), {}, {
|
|
18
35
|
theme: theme,
|
|
19
36
|
icons: {
|
|
@@ -27,7 +44,8 @@ var XMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
27
44
|
verticalAlign: -2
|
|
28
45
|
}
|
|
29
46
|
})
|
|
30
|
-
}
|
|
47
|
+
},
|
|
48
|
+
triggerProps: newTriggerProps
|
|
31
49
|
}));
|
|
32
50
|
});
|
|
33
51
|
XMenu.Item = Menu.Item;
|
package/dist/Menu/index.less
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.arco-menu {
|
|
2
|
+
.arco-menu-item,
|
|
3
|
+
.arco-menu-pop-header,
|
|
4
|
+
.arco-menu-inline {
|
|
5
|
+
span.easyv-icon {
|
|
6
|
+
margin-right: 8px;
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
margin-top: -2px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.arco-menu-compact {
|
|
13
|
+
.arco-menu-inner {
|
|
14
|
+
padding-left: 0;
|
|
15
|
+
padding-right: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.arco-menu-item,
|
|
19
|
+
.arco-menu-pop {
|
|
20
|
+
border-radius: 0;
|
|
21
|
+
margin-bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.arco-menu-pop-trigger.arco-trigger[trigger-placement='rt'].arco-menu-pop-trigger-compact {
|
|
27
|
+
transform: translateX(0);
|
|
28
|
+
}
|
package/dist/Menu/interface.d.ts
CHANGED
package/dist/Select/index.less
CHANGED