@lemon-fe/kits 1.0.0-70 → 1.0.0-72

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.
@@ -13,13 +13,16 @@ interface ActionBtn extends ButtonProps {
13
13
  text: string | ReactElement;
14
14
  onClick?: () => void;
15
15
  disabled?: boolean;
16
- } | ReactElement | null)[];
16
+ } | ReactElement | null)[] | ReactElement;
17
17
  }
18
18
  interface Props {
19
19
  actions: (ActionBtn | ReactElement | null)[];
20
20
  style?: CSSProperties;
21
21
  className?: string;
22
22
  prefixCls?: string;
23
+ /**
24
+ * @description 默认无限大
25
+ */
23
26
  maxShowCount?: number;
24
27
  }
25
28
  declare function Actions(props: Props): JSX.Element;
@@ -33,7 +33,7 @@ function Actions(props) {
33
33
  _props$prefixCls = props.prefixCls,
34
34
  prefixCls = _props$prefixCls === void 0 ? PREFIX_CLS : _props$prefixCls,
35
35
  _props$maxShowCount = props.maxShowCount,
36
- maxShowCount = _props$maxShowCount === void 0 ? 3 : _props$maxShowCount;
36
+ maxShowCount = _props$maxShowCount === void 0 ? Infinity : _props$maxShowCount;
37
37
 
38
38
  var _useState = useState(false),
39
39
  _useState2 = _slicedToArray(_useState, 2),
@@ -75,25 +75,31 @@ function Actions(props) {
75
75
 
76
76
  var handleClick = onClick || action;
77
77
 
78
- if (Array.isArray(dropDown)) {
79
- var overlay = /*#__PURE__*/React.createElement(Menu, {
80
- items: dropDown.filter(Boolean).map(function (subItem, idx) {
81
- if ( /*#__PURE__*/isValidElement(subItem)) {
78
+ if (dropDown !== undefined) {
79
+ var overlay;
80
+
81
+ if (Array.isArray(dropDown)) {
82
+ overlay = /*#__PURE__*/React.createElement(Menu, {
83
+ items: dropDown.filter(Boolean).map(function (subItem, idx) {
84
+ if ( /*#__PURE__*/isValidElement(subItem)) {
85
+ return {
86
+ label: subItem,
87
+ key: idx
88
+ };
89
+ }
90
+
91
+ var target = subItem;
82
92
  return {
83
- label: subItem,
84
- key: idx
93
+ label: target.text,
94
+ key: idx,
95
+ disabled: target.disabled,
96
+ onClick: target.onClick
85
97
  };
86
- }
87
-
88
- var target = subItem;
89
- return {
90
- label: target.text,
91
- key: idx,
92
- disabled: target.disabled,
93
- onClick: target.onClick
94
- };
95
- })
96
- });
98
+ })
99
+ });
100
+ } else {
101
+ overlay = dropDown;
102
+ }
97
103
 
98
104
  if (handleClick !== undefined) {
99
105
  return /*#__PURE__*/React.createElement(Dropdown.Button, _extends({
@@ -121,7 +127,8 @@ function Actions(props) {
121
127
  return /*#__PURE__*/React.createElement(Dropdown, {
122
128
  key: text,
123
129
  disabled: disabled,
124
- overlay: overlay
130
+ overlay: overlay,
131
+ trigger: ['click']
125
132
  }, /*#__PURE__*/React.createElement(Button, _extends({
126
133
  disabled: disabled,
127
134
  icon: icon
@@ -1139,7 +1139,6 @@ var DataGrid = /*#__PURE__*/function (_Component) {
1139
1139
  singleClickEdit: true,
1140
1140
  suppressPaginationPanel: true,
1141
1141
  suppressCopyRowsToClipboard: true,
1142
- suppressColumnVirtualisation: true,
1143
1142
  loadingOverlayComponent: this.LoadingOverlay,
1144
1143
  noRowsOverlayComponent: this.NoRowsOverlay,
1145
1144
  getMainMenuItems: this.getMainMenuItems,
package/es/init.js CHANGED
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  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); }
8
8
 
9
9
  import React from 'react';
10
- import { message, Modal, Select, ConfigProvider, Result, Button, version, DatePicker, Cascader, TreeSelect, Empty } from 'antd';
10
+ import { message, Modal, Select, ConfigProvider, Result, Button, version, DatePicker, Cascader, TreeSelect, Empty, Menu } from 'antd';
11
11
  import { config } from '@lemon-fe/hooks';
12
12
  import PageLoading from "./components/PageLoading";
13
13
  import Icons from "./components/Icons";
@@ -131,6 +131,16 @@ export default function init() {
131
131
  };
132
132
  DatePicker.defaultProps = {
133
133
  suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
134
+ }; //@ts-ignore
135
+
136
+ Menu.defaultProps = {
137
+ expandIcon: /*#__PURE__*/React.createElement(Down, {
138
+ style: {
139
+ transform: 'rotate(-90deg)',
140
+ top: 9,
141
+ color: '#666'
142
+ }
143
+ })
134
144
  };
135
145
  config({
136
146
  showToast: function showToast() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-70",
3
+ "version": "1.0.0-72",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",