@zhenliang/sheet 0.1.42 → 0.1.43

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,4 +1,5 @@
1
1
  import React from "react";
2
+ import './index.less';
2
3
  export declare const AddButton: React.FC<{
3
4
  handleAdd?: () => void;
4
5
  handleBatchAdd?: (count: number) => void;
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { MoreOutlined } from "@ant-design/icons";
8
8
  import { Form, InputNumber, Popover, Button } from "antd";
9
9
  import React, { useEffect, useRef, useState } from "react";
10
+ import "./index.less";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  var RowPop = function RowPop(props) {
@@ -42,7 +43,6 @@ var RowPop = function RowPop(props) {
42
43
  min: 1,
43
44
  max: 100,
44
45
  onClick: function onClick(e) {
45
- e.nativeEvent.target.focus();
46
46
  e.stopPropagation();
47
47
  }
48
48
  })
@@ -51,12 +51,12 @@ var RowPop = function RowPop(props) {
51
51
  };
52
52
  export var AddButton = function AddButton(props) {
53
53
  var handleAdd = props.handleAdd,
54
- handleBatchAdd = props.handleBatchAdd;
54
+ _handleBatchAdd = props.handleBatchAdd;
55
55
  var _useState = useState(false),
56
56
  _useState2 = _slicedToArray(_useState, 2),
57
57
  open = _useState2[0],
58
58
  setOpen = _useState2[1];
59
- if (!handleAdd && !handleBatchAdd) {
59
+ if (!handleAdd && !_handleBatchAdd) {
60
60
  return null;
61
61
  }
62
62
  return /*#__PURE__*/_jsxs(Button, {
@@ -70,14 +70,21 @@ export var AddButton = function AddButton(props) {
70
70
  },
71
71
  children: ["+ \u6DFB\u52A0", /*#__PURE__*/_jsx(Popover, {
72
72
  open: open,
73
- getPopupContainer: function getPopupContainer(node) {
74
- return node.parentNode;
75
- },
76
73
  onOpenChange: setOpen,
77
74
  trigger: ['click'],
78
75
  destroyTooltipOnHide: true,
79
- content: /*#__PURE__*/_jsx(RowPop, {
80
- handleBatchAdd: handleBatchAdd
76
+ overlayClassName: "batch-add-pop",
77
+ content: /*#__PURE__*/_jsx("div", {
78
+ className: "batch-add-pop-content",
79
+ onClick: function onClick(e) {
80
+ return e.stopPropagation();
81
+ },
82
+ children: /*#__PURE__*/_jsx(RowPop, {
83
+ handleBatchAdd: function handleBatchAdd(value) {
84
+ _handleBatchAdd && _handleBatchAdd(value);
85
+ setOpen(false);
86
+ }
87
+ })
81
88
  }),
82
89
  children: /*#__PURE__*/_jsx(MoreOutlined, {
83
90
  style: {
@@ -0,0 +1,12 @@
1
+
2
+ .batch-add-pop{
3
+ .ant-popover-inner{
4
+ .ant-popover-inner-content{
5
+ padding: 0;
6
+
7
+ .batch-add-pop-content{
8
+ padding: 14px 16px;
9
+ }
10
+ }
11
+ }
12
+ }
package/dist/core/util.js CHANGED
@@ -202,6 +202,7 @@ export function formatDataToCell(_ref2) {
202
202
  } else {
203
203
  // 选中多个单元格,粘贴多个数据
204
204
  if (actualRowCount !== pasteData.length || cells.length / rowCount * actualRowCount !== pasteData.length * pasteData[0].length) {
205
+ message.warning('选中单元格数量与粘贴数据不匹配');
205
206
  // 单元格数量不对
206
207
  return;
207
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",