@lemon-fe/components 0.1.28 → 0.1.39

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.
@@ -198,9 +198,15 @@ function BaseTable(props) {
198
198
  setScrollY(calcScrollY() || undefined);
199
199
  };
200
200
 
201
+ var hasPagination = false;
202
+
203
+ if (paginationProp !== false) {
204
+ hasPagination = paginationProp !== undefined && !!paginationProp.total || dataSource.length > 0;
205
+ }
206
+
201
207
  useLayoutEffect(function () {
202
208
  setScrollY(calcScrollY() || undefined);
203
- }, [paginationProp !== false && !!(paginationProp === null || paginationProp === void 0 ? void 0 : paginationProp.total)]);
209
+ }, [hasPagination]);
204
210
  useEffect(function () {
205
211
  if (scrollYProp !== true) {
206
212
  setScrollY(scrollYProp);
@@ -116,6 +116,7 @@
116
116
  height: 65px;
117
117
  padding: @space;
118
118
  background: #fff;
119
+ border-top: 1px solid #dfdfdf;
119
120
  }
120
121
 
121
122
  &-spin {
@@ -1,4 +1,5 @@
1
1
  import { CSSProperties, Key, ReactElement } from 'react';
2
+ import type { TableRowSelection } from 'antd/lib/table/interface';
2
3
  import type { FilterItemType } from '../Filter/typings';
3
4
  import type { ColumnType } from '../BaseTable/typings';
4
5
  interface Props<RecordType, ParamsType> {
@@ -45,6 +46,7 @@ interface Props<RecordType, ParamsType> {
45
46
  style?: CSSProperties;
46
47
  }) => ReactElement;
47
48
  };
49
+ rowSelection?: TableRowSelection<RecordType>;
48
50
  }
49
51
  export default function SelectView<RecordType, ParamsType extends Record<string, any>>(props: Props<RecordType, ParamsType>): JSX.Element;
50
52
  export {};
@@ -41,7 +41,8 @@ export default function SelectView(props) {
41
41
  multiple = _props$multiple === void 0 ? true : _props$multiple,
42
42
  rowKey = props.rowKey,
43
43
  filter = props.filter,
44
- dataSource = props.dataSource;
44
+ dataSource = props.dataSource,
45
+ rowSelection = props.rowSelection;
45
46
  var prefixCls = "".concat(PREFIX_CLS, "-select-view");
46
47
 
47
48
  var _useState = useState(value || []),
@@ -170,14 +171,14 @@ export default function SelectView(props) {
170
171
  }, /*#__PURE__*/React.createElement(Table, {
171
172
  actionRef: list,
172
173
  rowKey: rowKey,
173
- rowSelection: {
174
+ rowSelection: _objectSpread({
174
175
  type: multiple ? 'checkbox' : 'radio',
175
176
  preserveSelectedRowKeys: true,
176
177
  selectedRowKeys: dataKeys,
177
178
  onChange: function onChange(keys, rows) {
178
179
  return handleChangeData(keys, rows);
179
180
  }
180
- },
181
+ }, rowSelection),
181
182
  onRow: function onRow(row) {
182
183
  return {
183
184
  onClick: function onClick() {
@@ -235,13 +236,13 @@ export default function SelectView(props) {
235
236
  }, /*#__PURE__*/React.createElement(Table, {
236
237
  dataSource: data,
237
238
  columns: selectedColumns,
238
- rowSelection: {
239
+ rowSelection: _objectSpread({
239
240
  preserveSelectedRowKeys: true,
240
241
  selectedRowKeys: selectedKeys,
241
242
  onChange: function onChange(_, rows) {
242
243
  return setSelected(rows);
243
244
  }
244
- },
245
+ }, rowSelection),
245
246
  rowKey: rowKey
246
247
  }))))));
247
248
  }
package/es/init.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export default function init(opts?: {
2
- enableCNZZ?: boolean;
2
+ enableCNZZ?: boolean | string;
3
3
  }): void;
package/es/init.js CHANGED
@@ -24,7 +24,13 @@ export default function init() {
24
24
  _node.innerHTML = "\n var _czc = _czc || [];\n window._czc&&window._czc.push(['_setAutoPageview', false]);\n ";
25
25
  document.body.appendChild(_node);
26
26
  _node = document.createElement('script');
27
- _node.src = '//v1.cnzz.com/z_stat.php?id=1280732258&web_id=1280732258';
27
+
28
+ if (typeof opts.enableCNZZ === 'string') {
29
+ _node.src = opts.enableCNZZ;
30
+ } else {
31
+ _node.src = '//v1.cnzz.com/z_stat.php?id=1280732258&web_id=1280732258';
32
+ }
33
+
28
34
  document.body.appendChild(_node);
29
35
  }
30
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.28",
3
+ "version": "0.1.39",
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": "330d5bb83412a5e0aa718ef098a8c1644b4777c1"
44
+ "gitHead": "2236e4c1e4669264f267723a9f22f1e2f740a263"
45
45
  }