@lemon-fe/components 1.1.1 → 1.1.2

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.
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties, ReactElement } from 'react';
2
- import type { ColType, DataGridProps, PaginationType, SortType } from '../data-grid/typings';
2
+ import type { ColType, CustomColumnData, DataGridProps, PaginationType, SortType } from '../data-grid/typings';
3
3
  import type { FilterProps } from '../filter/typings';
4
+ import type { SideBarDef } from '@ag-grid-community/core';
4
5
  interface Props<RecordType, ParamsType extends Record<string, any>> extends Pick<DataGridProps<RecordType>, 'defaultColDef' | 'rowHeight' | 'cellDisplayFlex' | 'isRowSelectable'> {
5
6
  value?: RecordType[];
6
7
  onChange?: (value: RecordType[], rowDoubleClicked?: boolean) => void;
@@ -58,6 +59,19 @@ interface Props<RecordType, ParamsType extends Record<string, any>> extends Pick
58
59
  checkSearchParams?: (params: ParamsType) => boolean;
59
60
  loading?: boolean;
60
61
  readOnly?: boolean;
62
+ /**
63
+ * @description 表格控制栏 Specifies the side bar components.
64
+ */
65
+ sideBar?: SideBarDef | string | string[] | boolean | null;
66
+ /**
67
+ * @description 自定义列保存
68
+ * suppressFieldValueGetter 自定义列是否计算
69
+ */
70
+ customColumnPanelStorage?: {
71
+ suppressFieldValueGetter?: boolean;
72
+ set: (data: CustomColumnData) => Promise<void> | void;
73
+ get: () => Promise<CustomColumnData | null | undefined> | CustomColumnData | null | undefined;
74
+ };
61
75
  }
62
76
  export default function SelectView<RecordType extends Record<string | number, any>, ParamsType extends Record<string, any>>(props: Props<RecordType, ParamsType>): JSX.Element;
63
77
  export {};
@@ -15,11 +15,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
15
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ import { Spin, Tabs } from 'antd';
18
19
  import React, { useEffect, useMemo, useRef, useState } from 'react';
19
20
  import DataGrid from "../data-grid";
20
21
  import Filter from "../filter";
21
22
  import { prefixClassName } from "../utils";
22
- import { Spin, Tabs } from 'antd';
23
23
  import { get } from 'lodash';
24
24
  export default function SelectView(props) {
25
25
  var emptyValue = useMemo(function () {
@@ -45,7 +45,9 @@ export default function SelectView(props) {
45
45
  rowHeight = props.rowHeight,
46
46
  cellDisplayFlex = props.cellDisplayFlex,
47
47
  isRowSelectable = props.isRowSelectable,
48
- checkSearchParams = props.checkSearchParams;
48
+ checkSearchParams = props.checkSearchParams,
49
+ sideBar = props.sideBar,
50
+ customColumnPanelStorage = props.customColumnPanelStorage;
49
51
  var prefix = prefixClassName("select-view");
50
52
  var _useState = useState(value || emptyValue),
51
53
  _useState2 = _slicedToArray(_useState, 2),
@@ -200,6 +202,7 @@ export default function SelectView(props) {
200
202
  handleChangeData([node.id], [node.data], true);
201
203
  }
202
204
  },
205
+ sideBar: sideBar,
203
206
  rowHeight: rowHeight,
204
207
  defaultColDef: defaultColDef,
205
208
  cellDisplayFlex: cellDisplayFlex,
@@ -208,7 +211,8 @@ export default function SelectView(props) {
208
211
  columns: columns,
209
212
  onLoading: setLoading,
210
213
  fetch: request,
211
- pagination: pagination
214
+ pagination: pagination,
215
+ customColumnPanelStorage: customColumnPanelStorage
212
216
  }))));
213
217
  };
214
218
  var renderSelected = function renderSelected() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "registry": "https://registry.npmjs.org"
64
64
  },
65
- "gitHead": "0d2b6f86e1c9d9998a77bce4b00f4daaef969bcd"
65
+ "gitHead": "37ad5368a2c745b0bea0bfe9e5ad2c4aeffe1635"
66
66
  }