dtable-ui-component 6.0.117-beta.2 → 6.0.117-beta.4

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.
@@ -40,9 +40,10 @@ const DTableDropdownItem = _ref => {
40
40
  'aria-hidden': 'true'
41
41
  });
42
42
  };
43
- let customItemProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, itemProps), {}, {
44
- onClick
45
- });
43
+ let customItemProps = (0, _objectSpread2.default)({}, itemProps);
44
+ if (typeof onClick === 'function') {
45
+ customItemProps.onClick = onClick;
46
+ }
46
47
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.DropdownItem, (0, _objectSpread2.default)((0, _objectSpread2.default)({
47
48
  className: className,
48
49
  disabled: disabled,
@@ -12,12 +12,25 @@ var _jsxRuntime = require("react/jsx-runtime");
12
12
  const DTableDropdownMenu = _ref => {
13
13
  let {
14
14
  className,
15
+ container,
16
+ modifiers,
17
+ style,
15
18
  menuProps,
16
19
  children
17
20
  } = _ref;
21
+ let customMenuProps = (0, _objectSpread2.default)({}, menuProps);
22
+ if (container) {
23
+ customMenuProps.container = container;
24
+ }
25
+ if (style) {
26
+ customMenuProps.style = style;
27
+ }
28
+ if (Array.isArray(modifiers)) {
29
+ customMenuProps.modifiers = modifiers;
30
+ }
18
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownMenu, (0, _objectSpread2.default)((0, _objectSpread2.default)({
19
32
  className: (0, _classnames.default)('dtable-dropdown-menu', className)
20
- }, menuProps), {}, {
33
+ }, customMenuProps), {}, {
21
34
  children: children
22
35
  }));
23
36
  };
@@ -12,18 +12,31 @@ var _jsxRuntime = require("react/jsx-runtime");
12
12
  const DTableSubDropdownMenu = _ref => {
13
13
  let {
14
14
  className,
15
+ container,
16
+ modifiers,
17
+ style,
15
18
  menuProps,
16
19
  children
17
20
  } = _ref;
21
+ let customMenuProps = (0, _objectSpread2.default)({}, menuProps);
22
+ if (container) {
23
+ customMenuProps.container = container;
24
+ }
25
+ if (style) {
26
+ customMenuProps.style = style;
27
+ }
28
+ if (Array.isArray(modifiers)) {
29
+ customMenuProps.modifiers = modifiers;
30
+ }
18
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableDropdownMenu.default, {
19
32
  className: (0, _classnames.default)('dtable-sub-dropdown-menu', className),
20
- menuProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, menuProps), {}, {
33
+ menuProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, customMenuProps), {}, {
21
34
  modifiers: [{
22
35
  name: 'offset',
23
36
  options: {
24
37
  offset: [-8, -1]
25
38
  }
26
- }, ...((menuProps === null || menuProps === void 0 ? void 0 : menuProps.modifiers) || [])]
39
+ }, ...((customMenuProps === null || customMenuProps === void 0 ? void 0 : customMenuProps.modifiers) || [])]
27
40
  }),
28
41
  children: children
29
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.117-beta.2",
3
+ "version": "6.0.117-beta.4",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.8",