vap1 0.2.8 → 0.2.9

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.
@@ -5,6 +5,7 @@ import type { PlainObject, Key } from '../../basetype';
5
5
  export type VTableRef = {
6
6
  getSelected: () => [Key[], PlainObject[]];
7
7
  getParams: () => PlainObject;
8
+ clearSelected: () => void;
8
9
  };
9
10
  export declare const getHeightByTagName: (root: HTMLElement, tagName: string) => number;
10
11
  /**
@@ -286,11 +286,17 @@ var _VTable = (0, react_1.forwardRef)(function (props, ref) {
286
286
  });
287
287
  exports.VTable = (0, react_1.forwardRef)(function (props, ref) {
288
288
  var _a = props.model, isQuerying = _a.isQuerying, pageNo = _a.pageNo, pageSize = _a.pageSize, total = _a.total, totalAcc = _a.totalAcc, param = _a.param, pageTo = _a.pageTo, query = _a.query, cost = _a.cost;
289
+ var update = (0, hooks_1.useUpdate)();
289
290
  // 通过 ref 方式交互,后续扩展方法实现定制联页选择
290
- var selectedRef = (0, react_1.useRef)({ selected: [[], []], onSelected: function () { }, });
291
+ var selectedRef = (0, react_1.useRef)({ selected: [[], []], onSelected: update, });
291
292
  // 对外提供getSelected方法获取当前选择的数据
292
293
  (0, react_1.useImperativeHandle)(ref, function () {
293
294
  return {
295
+ clearSelected: function () {
296
+ selectedRef.current.selected = [[], []];
297
+ update();
298
+ // selectedRef.current.onSelected();
299
+ },
294
300
  getSelected: function () {
295
301
  return selectedRef.current.selected;
296
302
  },
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"vap1","version":"0.2.8","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
1
+ {"name":"vap1","version":"0.2.9","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}