@lemon-fe/components 0.1.22 → 0.1.23

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.
@@ -11,7 +11,7 @@ export interface RowAction<T> {
11
11
  /**
12
12
  * @description 当text不为字符串时,建议加上key属性
13
13
  */
14
- text: ReactElement;
14
+ text: string | ReactElement;
15
15
  key?: string;
16
16
  onClick?: (row: T, index: number) => void;
17
17
  disabled?: boolean;
@@ -10,9 +10,9 @@ interface Props {
10
10
  */
11
11
  loading?: boolean;
12
12
  /**
13
+ * @deprecated
13
14
  * @description 高度是否为100%
14
15
  * @default false
15
- * @deprecated
16
16
  */
17
17
  full?: boolean;
18
18
  left?: ReactNode;
@@ -26,11 +26,12 @@ declare namespace Layout {
26
26
  var Content: (props: {
27
27
  children?: React.ReactNode;
28
28
  left?: React.ReactNode;
29
+ tab?: string | undefined;
29
30
  }) => JSX.Element;
30
31
  }
31
32
  export default Layout;
32
33
  declare function LayoutTabs(props: {
33
- tabs: {
34
+ tabs?: {
34
35
  title: string;
35
36
  key?: string;
36
37
  }[];
@@ -25,6 +25,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
25
  import React, { useState } from 'react';
26
26
  import classNames from 'classnames';
27
27
  import { Spin, Tabs } from 'antd';
28
+ import { get } from 'lodash';
28
29
  import { PREFIX_CLS } from '../constants';
29
30
  import { mapChildren } from '../utils';
30
31
  var prefixCls = "".concat(PREFIX_CLS, "-layout");
@@ -131,7 +132,8 @@ export default function Layout(props) {
131
132
  }
132
133
 
133
134
  function LayoutTabs(props) {
134
- var tabs = props.tabs,
135
+ var _props$tabs = props.tabs,
136
+ tabs = _props$tabs === void 0 ? [] : _props$tabs,
135
137
  children = props.children,
136
138
  className = props.className,
137
139
  activeKey = props.activeKey,
@@ -143,10 +145,12 @@ function LayoutTabs(props) {
143
145
  };
144
146
 
145
147
  var nodes = mapChildren(children, function (node, index) {
148
+ var _get, _get2;
149
+
146
150
  var tab = tabs[index];
147
151
  return /*#__PURE__*/React.createElement(Tabs.TabPane, {
148
- tab: tab.title,
149
- key: getKey(tabs[index])
152
+ tab: (_get = get(node, ['props', 'tab'])) !== null && _get !== void 0 ? _get : tab.title,
153
+ key: (_get2 = get(node, 'key')) !== null && _get2 !== void 0 ? _get2 : getKey(tab)
150
154
  }, node);
151
155
  });
152
156
  return /*#__PURE__*/React.createElement(Layout, _objectSpread({
@@ -8,6 +8,7 @@ interface Props<KeyType> extends Omit<TreeProps, 'onSelect' | 'selectedKeys' | '
8
8
  showSearch?: boolean;
9
9
  placeholder?: string;
10
10
  header?: ReactNode;
11
+ footer?: ReactNode;
11
12
  operation?: OperationType<KeyType>;
12
13
  onSelect?: (node: TreeData<KeyType>, info: {
13
14
  event: 'select';
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["tabs", "children"],
2
- _excluded2 = ["data", "showSearch", "placeholder", "onSelect", "operation", "header"];
2
+ _excluded2 = ["data", "showSearch", "placeholder", "onSelect", "operation", "header", "footer"];
3
3
 
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
5
 
@@ -70,6 +70,7 @@ export default function SiderTree(props) {
70
70
  _onSelect = props.onSelect,
71
71
  operation = props.operation,
72
72
  header = props.header,
73
+ footer = props.footer,
73
74
  restProps = _objectWithoutProperties(props, _excluded2);
74
75
 
75
76
  var prefixCls = "".concat(PREFIX_CLS, "-tree");
@@ -213,6 +214,8 @@ export default function SiderTree(props) {
213
214
  d: "M7 3v7H6V3z"
214
215
  })));
215
216
  }
216
- }, restProps))));
217
+ }, restProps))), !!footer && /*#__PURE__*/React.createElement("div", {
218
+ className: "".concat(prefixCls, "-footer")
219
+ }, footer));
217
220
  }
218
221
  SiderTree.Tabs = SiderTreeTabs;
@@ -56,7 +56,6 @@
56
56
  }
57
57
 
58
58
  &-body {
59
- flex: 1;
60
59
  min-height: 0;
61
60
  padding: 0 @space;
62
61
  overflow: auto;
@@ -70,6 +69,11 @@
70
69
  margin-top: 8px;
71
70
  }
72
71
 
72
+ &-footer {
73
+ margin-top: 12px;
74
+ padding: 0 12px;
75
+ }
76
+
73
77
  &-treenode {
74
78
  display: flex;
75
79
  align-items: center;
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 } from 'antd';
10
+ import { message, Modal, Select, ConfigProvider, Result, Button, version, DatePicker, Cascader } from 'antd';
11
11
  import { config } from '@lemon-fe/hooks';
12
12
  import PageLoading from './PageLoading';
13
13
  import Icons from './Icons';
@@ -86,6 +86,10 @@ export default function init() {
86
86
  suffixIcon: version >= '4.18.9' ? node : function () {
87
87
  return node;
88
88
  }
89
+ }; //@ts-ignore
90
+
91
+ Cascader.defaultProps = {
92
+ suffixIcon: node
89
93
  };
90
94
  DatePicker.RangePicker.defaultProps = {
91
95
  suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
package/es/utils.js CHANGED
@@ -9,6 +9,6 @@ export var mapChildren = function mapChildren(children, cb) {
9
9
  }
10
10
 
11
11
  return nodes.filter(function (item) {
12
- return item !== null;
12
+ return item !== null && item !== undefined;
13
13
  }).map(cb);
14
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -41,5 +41,5 @@
41
41
  "react": "^17.0.2",
42
42
  "react-dom": "^17.0.2"
43
43
  },
44
- "gitHead": "ee59debc65be8960fe3250c71c75ec907d616f90"
44
+ "gitHead": "7f04dc0d1db645567e072e718a0965cc8b499d3e"
45
45
  }