@zhenliang/sheet 0.1.84 → 0.1.85

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.
package/dist/core/util.js CHANGED
@@ -97,7 +97,11 @@ export function stringToClipboardData(str, count) {
97
97
  });
98
98
  }
99
99
  export var defaultParsePaste = function defaultParsePaste(str) {
100
- return str.split(/\r\n|\n|\r/).map(function (row) {
100
+ var cleanStr = str;
101
+ if (str.endsWith('\r\n')) {
102
+ cleanStr = str.slice(0, -2);
103
+ }
104
+ return cleanStr.split(/\r\n|\n|\r/).map(function (row) {
101
105
  return row.split('\t');
102
106
  });
103
107
  };
@@ -19,17 +19,32 @@ import 'antd/dist/antd.css';
19
19
  import React, { useCallback, useState } from 'react';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  var columns = [{
22
- title: 'Name',
23
- dataIndex: 'name',
22
+ title: '#',
23
+ dataIndex: 'index',
24
24
  render: function render(_ref) {
25
25
  var value = _ref.value;
26
26
  return /*#__PURE__*/_jsx("a", {
27
27
  children: value
28
28
  });
29
29
  }
30
+ }, {
31
+ title: 'Name',
32
+ dataIndex: 'name',
33
+ render: function render(_ref2) {
34
+ var value = _ref2.value;
35
+ return /*#__PURE__*/_jsx("a", {
36
+ children: value
37
+ });
38
+ }
30
39
  }, {
31
40
  title: 'Age',
32
41
  dataIndex: 'age'
42
+ }, {
43
+ title: 'Age1',
44
+ dataIndex: 'age1'
45
+ }, {
46
+ title: 'Age2',
47
+ dataIndex: 'age2'
33
48
  }, {
34
49
  title: 'Address',
35
50
  dataIndex: 'address'
@@ -62,10 +77,10 @@ var App = function App() {
62
77
  setData = _useState2[1];
63
78
  var onChange = useCallback(function (changes) {
64
79
  var newData = _toConsumableArray(dataSource);
65
- changes.forEach(function (_ref2) {
66
- var row = _ref2.row,
67
- key = _ref2.key,
68
- value = _ref2.value;
80
+ changes.forEach(function (_ref3) {
81
+ var row = _ref3.row,
82
+ key = _ref3.key,
83
+ value = _ref3.value;
69
84
  newData[row] = _objectSpread(_objectSpread({}, newData[row]), {}, _defineProperty({}, key, key === 'tags' ? value.split(',') : value));
70
85
  });
71
86
  setData(newData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.84",
3
+ "version": "0.1.85",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",