@kdcloudjs/kdesign 1.7.33-stable.14 → 1.7.33-stable.16

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.
@@ -245,6 +245,10 @@ function usePopper(locatorElement, popperElement, props) {
245
245
  right = _realDom$getBoundingC.right,
246
246
  height = _realDom$getBoundingC.height,
247
247
  width = _realDom$getBoundingC.width;
248
+ if (height === 0 && width === 0) {
249
+ hidePopper();
250
+ return;
251
+ }
248
252
  var _getOffsetPos = getOffsetPos(container),
249
253
  containerTop = _getOffsetPos.top,
250
254
  containerLeft = _getOffsetPos.left;
package/es/table/api.js CHANGED
@@ -132,6 +132,10 @@ export default function getApi(pipelineRef) {
132
132
  var pipeline = pipelineRef.current;
133
133
  return (_a = pipeline.ref) === null || _a === void 0 ? void 0 : _a.current.rowHeightManager.cache;
134
134
  }
135
+ function getFeatureApi(featureName) {
136
+ var pipeline = pipelineRef.current;
137
+ return pipeline.getFeatureApi(featureName);
138
+ }
135
139
  return {
136
140
  getColumns: getColumns,
137
141
  getDataSource: getDataSource,
@@ -139,6 +143,7 @@ export default function getApi(pipelineRef) {
139
143
  clearRangeSelection: clearRangeSelection,
140
144
  ensureRowIndexVisible: ensureRowIndexVisible,
141
145
  ensureColumnVisible: ensureColumnVisible,
142
- getHeightCache: getHeightCache
146
+ getHeightCache: getHeightCache,
147
+ getFeatureApi: getFeatureApi
143
148
  };
144
149
  }
@@ -1,3 +1,3 @@
1
1
  import { TableRowDrag, TablePipeline } from '../interface';
2
- declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag, estimatedRowHeight?: number): void;
2
+ declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag): void;
3
3
  export default useRowDrag;
@@ -1,10 +1,8 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/extends";
2
2
  import { features } from '@kdcloudjs/table';
3
- function useRowDrag(pipeline, rowDrag, estimatedRowHeight) {
3
+ function useRowDrag(pipeline, rowDrag) {
4
4
  if (rowDrag) {
5
- pipeline.use(features.rowDrag(_extends({
6
- rowHeight: estimatedRowHeight
7
- }, rowDrag)));
5
+ pipeline.use(features.rowDrag(_extends({}, rowDrag)));
8
6
  }
9
7
  }
10
8
  export default useRowDrag;
@@ -18,6 +18,7 @@ export declare type TableApi = {
18
18
  getHeightCache: () => number[];
19
19
  ensureRowIndexVisible: (rowIndex: number, position?: string | undefined) => void;
20
20
  ensureColumnVisible: (code: string) => void;
21
+ getFeatureApi: (featureName: string) => any;
21
22
  };
22
23
  export declare type TableInstance = {
23
24
  api: TableApi;
package/es/table/table.js CHANGED
@@ -106,7 +106,7 @@ var Table = /*#__PURE__*/forwardRef(function (props, ref) {
106
106
  useRangeSelection(pipeline, rangeSelection);
107
107
  useMergeCellHover(pipeline);
108
108
  useFooterDataSource(pipeline, footerDataSource);
109
- useRowDrag(pipeline, rowDrag, estimatedRowHeight);
109
+ useRowDrag(pipeline, rowDrag);
110
110
  /* -------------------------------------------------------------------------- */
111
111
  /* after useTablePipeline, merge pipeline.getProps result */
112
112
  /* -------------------------------------------------------------------------- */
@@ -259,6 +259,10 @@ function usePopper(locatorElement, popperElement, props) {
259
259
  right = _realDom$getBoundingC.right,
260
260
  height = _realDom$getBoundingC.height,
261
261
  width = _realDom$getBoundingC.width;
262
+ if (height === 0 && width === 0) {
263
+ hidePopper();
264
+ return;
265
+ }
262
266
  var _getOffsetPos = getOffsetPos(container),
263
267
  containerTop = _getOffsetPos.top,
264
268
  containerLeft = _getOffsetPos.left;
package/lib/table/api.js CHANGED
@@ -139,6 +139,10 @@ function getApi(pipelineRef) {
139
139
  var pipeline = pipelineRef.current;
140
140
  return (_a = pipeline.ref) === null || _a === void 0 ? void 0 : _a.current.rowHeightManager.cache;
141
141
  }
142
+ function getFeatureApi(featureName) {
143
+ var pipeline = pipelineRef.current;
144
+ return pipeline.getFeatureApi(featureName);
145
+ }
142
146
  return {
143
147
  getColumns: getColumns,
144
148
  getDataSource: getDataSource,
@@ -146,6 +150,7 @@ function getApi(pipelineRef) {
146
150
  clearRangeSelection: clearRangeSelection,
147
151
  ensureRowIndexVisible: ensureRowIndexVisible,
148
152
  ensureColumnVisible: ensureColumnVisible,
149
- getHeightCache: getHeightCache
153
+ getHeightCache: getHeightCache,
154
+ getFeatureApi: getFeatureApi
150
155
  };
151
156
  }
@@ -1,3 +1,3 @@
1
1
  import { TableRowDrag, TablePipeline } from '../interface';
2
- declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag, estimatedRowHeight?: number): void;
2
+ declare function useRowDrag(pipeline: TablePipeline, rowDrag?: TableRowDrag): void;
3
3
  export default useRowDrag;
@@ -7,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
9
9
  var _table = require("@kdcloudjs/table");
10
- function useRowDrag(pipeline, rowDrag, estimatedRowHeight) {
10
+ function useRowDrag(pipeline, rowDrag) {
11
11
  if (rowDrag) {
12
- pipeline.use(_table.features.rowDrag((0, _extends2.default)({
13
- rowHeight: estimatedRowHeight
14
- }, rowDrag)));
12
+ pipeline.use(_table.features.rowDrag((0, _extends2.default)({}, rowDrag)));
15
13
  }
16
14
  }
17
15
  var _default = useRowDrag;
@@ -18,6 +18,7 @@ export declare type TableApi = {
18
18
  getHeightCache: () => number[];
19
19
  ensureRowIndexVisible: (rowIndex: number, position?: string | undefined) => void;
20
20
  ensureColumnVisible: (code: string) => void;
21
+ getFeatureApi: (featureName: string) => any;
21
22
  };
22
23
  export declare type TableInstance = {
23
24
  api: TableApi;
@@ -118,7 +118,7 @@ var Table = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
118
118
  (0, _useRangeSelection.default)(pipeline, rangeSelection);
119
119
  (0, _mergeCellHover.default)(pipeline);
120
120
  (0, _useFooterDataSource.default)(pipeline, footerDataSource);
121
- (0, _useRowDrag.default)(pipeline, rowDrag, estimatedRowHeight);
121
+ (0, _useRowDrag.default)(pipeline, rowDrag);
122
122
  /* -------------------------------------------------------------------------- */
123
123
  /* after useTablePipeline, merge pipeline.getProps result */
124
124
  /* -------------------------------------------------------------------------- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.7.33-stable.14",
3
+ "version": "1.7.33-stable.16",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [
@@ -78,11 +78,10 @@
78
78
  "@babel/runtime-corejs3": "^7.11.2",
79
79
  "@babel/standalone": "^7.14.3",
80
80
  "@kdcloudjs/kdesign-icons": "^1.0.0",
81
- "@kdcloudjs/table": "1.2.0-canary.16",
81
+ "@kdcloudjs/table": "1.2.2-canary.8",
82
82
  "@popperjs/core": "^2.5.4",
83
83
  "@types/js-cookie": "^3.0.3",
84
84
  "async-validator": "^3.5.1",
85
- "axios": "^0.21.1",
86
85
  "big.js": "^6.0.2",
87
86
  "classnames": "^2.2.6",
88
87
  "color": "^4.2.3",