@lemon-fe/components 1.4.22-alpha.5 → 1.4.22-alpha.7

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.
@@ -25,16 +25,18 @@ export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Search(props,
25
25
  searchFields = props.searchFields,
26
26
  focusColumn = props.focusColumn,
27
27
  _props$clearSelection = props.clearSelection,
28
- clearSelection = _props$clearSelection === void 0 ? true : _props$clearSelection;
28
+ clearSelection = _props$clearSelection === void 0 ? true : _props$clearSelection,
29
+ defaultValue = props.defaultValue,
30
+ onValueChange = props.onValueChange;
29
31
  // 单行搜索大致耗时
30
32
  var duration = useRef(0);
31
33
  var defaultState = useMemo(function () {
32
34
  return {
33
- keywords: '',
35
+ keywords: defaultValue || '',
34
36
  nodes: [],
35
37
  index: -1
36
38
  };
37
- }, []);
39
+ }, [defaultValue]);
38
40
  var grid = useGridStore(function (state) {
39
41
  return state.grid;
40
42
  });
@@ -75,6 +77,7 @@ export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Search(props,
75
77
  var handleSearch = useDebounce(function (str, prevState) {
76
78
  var keywords = str.trim();
77
79
  var start = performance.now();
80
+ onValueChange === null || onValueChange === void 0 || onValueChange(keywords);
78
81
  var finish = function finish(newState) {
79
82
  searching.current = false;
80
83
  setState(function (pre) {
@@ -253,6 +256,7 @@ export default /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Search(props,
253
256
  return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
254
257
  placeholder: placeholder || dataGridLocale.searchPlaceholderText,
255
258
  value: state.keywords,
259
+ defaultValue: defaultValue,
256
260
  size: "small",
257
261
  onChange: function onChange(e) {
258
262
  setState(function (prev) {
@@ -1347,6 +1347,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
1347
1347
  colId: '$$selection',
1348
1348
  checkboxSelection: checkboxSelection,
1349
1349
  showDisabledCheckboxes: true,
1350
+ headerCheckboxSelectionFilteredOnly: rowSelection.headerCheckboxSelectionFilteredOnly,
1350
1351
  headerCheckboxSelection: rowSelection.type !== 'radio',
1351
1352
  spanHeaderHeight: true,
1352
1353
  sortable: false,
@@ -83,6 +83,10 @@ export declare type RowSelectionType<T = any> = {
83
83
  * @description 是否隐藏底部已选项
84
84
  */
85
85
  hideFooterSelected?: boolean;
86
+ /**
87
+ * @description 是否按页面显示的数据进行全选
88
+ */
89
+ headerCheckboxSelectionFilteredOnly?: boolean;
86
90
  };
87
91
  export declare type PaginationType = {
88
92
  current?: number;
@@ -146,6 +150,12 @@ export interface DataGridSearch {
146
150
  * 搜索后聚焦到哪个单元格,一般情况不要使用
147
151
  */
148
152
  focusColumn?: string;
153
+ /**
154
+ * @description
155
+ * 关键字默认值
156
+ */
157
+ defaultValue?: string;
158
+ onValueChange?: (value: string) => void;
149
159
  }
150
160
  export interface DataGridSearchRef {
151
161
  reset: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "1.4.22-alpha.5",
3
+ "version": "1.4.22-alpha.7",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "registry": "https://registry.npmjs.org"
60
60
  },
61
- "gitHead": "0c4dc48dacd31fd903bbcbad684f4da20b51b543"
61
+ "gitHead": "b8a1624870c5bbf87f9a3b363e9742269c46b28c"
62
62
  }