@leankylin-sheet/react 3.1.15 → 3.1.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.
package/dist/index.esm.js CHANGED
@@ -2101,7 +2101,8 @@ var NotationBoxes = function NotationBoxes() {
2101
2101
  height = commentBox.height,
2102
2102
  value = commentBox.value,
2103
2103
  autoFocus = commentBox.autoFocus,
2104
- size = commentBox.size;
2104
+ size = commentBox.size,
2105
+ preValue = commentBox.preValue;
2105
2106
  var isEditing = ((_context$editingComme2 = context.editingCommentBox) === null || _context$editingComme2 === void 0 ? void 0 : _context$editingComme2.rc) === rc;
2106
2107
  var commentId = "comment-box-".concat(rc);
2107
2108
  return /*#__PURE__*/React.createElement("div", {
@@ -2131,7 +2132,7 @@ var NotationBoxes = function NotationBoxes() {
2131
2132
  x1: size.fromX,
2132
2133
  y1: size.fromY,
2133
2134
  x2: size.toX,
2134
- y2: size.toY,
2135
+ y2: size.toY + 4,
2135
2136
  stroke: "#333",
2136
2137
  strokeWidth: "1",
2137
2138
  markerEnd: "url(#arrowhead)"
@@ -2196,15 +2197,17 @@ var NotationBoxes = function NotationBoxes() {
2196
2197
  height: "100%",
2197
2198
  overflow: "hidden"
2198
2199
  }
2199
- }, /*#__PURE__*/React.createElement(ContentEditable, {
2200
+ }, /*#__PURE__*/React.createElement("div", {
2201
+ dangerouslySetInnerHTML: {
2202
+ __html: preValue
2203
+ }
2204
+ }), /*#__PURE__*/React.createElement(ContentEditable, {
2200
2205
  id: "comment-editor-".concat(rc),
2201
2206
  autoFocus: autoFocus,
2202
2207
  style: {
2203
2208
  width: "100%",
2204
- height: "100%",
2205
2209
  lineHeight: "20px",
2206
2210
  boxSizing: "border-box",
2207
- textAlign: "center",
2208
2211
  wordBreak: "break-all",
2209
2212
  outline: "none"
2210
2213
  },
@@ -7406,24 +7409,35 @@ var ContextMenu = function ContextMenu() {
7406
7409
  });
7407
7410
  }
7408
7411
  if (name === "insert-comment") {
7409
- var _flowdata$row_index, _flowdata$row_index$c;
7412
+ var _flowdata$row_index, _flowdata$row_index$c, _flowdata$row_index$c2, _flowdata$row_index2, _flowdata$row_index2$, _flowdata$row_index2$2;
7410
7413
  var flowdata = getFlowdata(context);
7411
7414
  var row_index = selection === null || selection === void 0 ? void 0 : selection.row[0];
7412
7415
  var col_index = selection === null || selection === void 0 ? void 0 : selection.column[0];
7413
- var hasPs = (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : _flowdata$row_index$c.ps) != null;
7414
- var itemData = hasPs ? [{
7415
- text: "编辑批注",
7416
- onClick: editComment
7416
+ var hasPsValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : (_flowdata$row_index$c2 = _flowdata$row_index$c.ps) === null || _flowdata$row_index$c2 === void 0 ? void 0 : _flowdata$row_index$c2.value;
7417
+ var hasPsPreValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : (_flowdata$row_index2$2 = _flowdata$row_index2$.ps) === null || _flowdata$row_index2$2 === void 0 ? void 0 : _flowdata$row_index2$2.preValue;
7418
+ var canAddPs = !hasPsValue;
7419
+ var canEditPs = hasPsValue;
7420
+ var canDeletePs = hasPsValue;
7421
+ var canShowHidePs = hasPsValue || hasPsPreValue;
7422
+ var itemData = [{
7423
+ text: "新建说明",
7424
+ onClick: newComment,
7425
+ show: canAddPs
7417
7426
  }, {
7418
- text: "删除批注",
7419
- onClick: deleteComment
7427
+ text: "编辑说明",
7428
+ onClick: editComment,
7429
+ show: canEditPs
7420
7430
  }, {
7421
- text: "显示/隐藏批注",
7422
- onClick: showHideComment
7423
- }] : [{
7424
- text: "新建批注",
7425
- onClick: newComment
7426
- }];
7431
+ text: "删除说明",
7432
+ onClick: deleteComment,
7433
+ show: canDeletePs
7434
+ }, {
7435
+ text: "显示/隐藏说明",
7436
+ onClick: showHideComment,
7437
+ show: canShowHidePs
7438
+ }].filter(function (item) {
7439
+ return item.show;
7440
+ });
7427
7441
  return itemData.map(function (item) {
7428
7442
  return /*#__PURE__*/React.createElement(Menu, {
7429
7443
  key: item.text,
package/dist/index.js CHANGED
@@ -2111,7 +2111,8 @@ var NotationBoxes = function NotationBoxes() {
2111
2111
  height = commentBox.height,
2112
2112
  value = commentBox.value,
2113
2113
  autoFocus = commentBox.autoFocus,
2114
- size = commentBox.size;
2114
+ size = commentBox.size,
2115
+ preValue = commentBox.preValue;
2115
2116
  var isEditing = ((_context$editingComme2 = context.editingCommentBox) === null || _context$editingComme2 === void 0 ? void 0 : _context$editingComme2.rc) === rc;
2116
2117
  var commentId = "comment-box-".concat(rc);
2117
2118
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -2141,7 +2142,7 @@ var NotationBoxes = function NotationBoxes() {
2141
2142
  x1: size.fromX,
2142
2143
  y1: size.fromY,
2143
2144
  x2: size.toX,
2144
- y2: size.toY,
2145
+ y2: size.toY + 4,
2145
2146
  stroke: "#333",
2146
2147
  strokeWidth: "1",
2147
2148
  markerEnd: "url(#arrowhead)"
@@ -2206,15 +2207,17 @@ var NotationBoxes = function NotationBoxes() {
2206
2207
  height: "100%",
2207
2208
  overflow: "hidden"
2208
2209
  }
2209
- }, /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
2210
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2211
+ dangerouslySetInnerHTML: {
2212
+ __html: preValue
2213
+ }
2214
+ }), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
2210
2215
  id: "comment-editor-".concat(rc),
2211
2216
  autoFocus: autoFocus,
2212
2217
  style: {
2213
2218
  width: "100%",
2214
- height: "100%",
2215
2219
  lineHeight: "20px",
2216
2220
  boxSizing: "border-box",
2217
- textAlign: "center",
2218
2221
  wordBreak: "break-all",
2219
2222
  outline: "none"
2220
2223
  },
@@ -7416,24 +7419,35 @@ var ContextMenu = function ContextMenu() {
7416
7419
  });
7417
7420
  }
7418
7421
  if (name === "insert-comment") {
7419
- var _flowdata$row_index, _flowdata$row_index$c;
7422
+ var _flowdata$row_index, _flowdata$row_index$c, _flowdata$row_index$c2, _flowdata$row_index2, _flowdata$row_index2$, _flowdata$row_index2$2;
7420
7423
  var flowdata = core.getFlowdata(context);
7421
7424
  var row_index = selection === null || selection === void 0 ? void 0 : selection.row[0];
7422
7425
  var col_index = selection === null || selection === void 0 ? void 0 : selection.column[0];
7423
- var hasPs = (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : _flowdata$row_index$c.ps) != null;
7424
- var itemData = hasPs ? [{
7425
- text: "编辑批注",
7426
- onClick: core.editComment
7426
+ var hasPsValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : (_flowdata$row_index$c2 = _flowdata$row_index$c.ps) === null || _flowdata$row_index$c2 === void 0 ? void 0 : _flowdata$row_index$c2.value;
7427
+ var hasPsPreValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : (_flowdata$row_index2$2 = _flowdata$row_index2$.ps) === null || _flowdata$row_index2$2 === void 0 ? void 0 : _flowdata$row_index2$2.preValue;
7428
+ var canAddPs = !hasPsValue;
7429
+ var canEditPs = hasPsValue;
7430
+ var canDeletePs = hasPsValue;
7431
+ var canShowHidePs = hasPsValue || hasPsPreValue;
7432
+ var itemData = [{
7433
+ text: "新建说明",
7434
+ onClick: core.newComment,
7435
+ show: canAddPs
7427
7436
  }, {
7428
- text: "删除批注",
7429
- onClick: core.deleteComment
7437
+ text: "编辑说明",
7438
+ onClick: core.editComment,
7439
+ show: canEditPs
7430
7440
  }, {
7431
- text: "显示/隐藏批注",
7432
- onClick: core.showHideComment
7433
- }] : [{
7434
- text: "新建批注",
7435
- onClick: core.newComment
7436
- }];
7441
+ text: "删除说明",
7442
+ onClick: core.deleteComment,
7443
+ show: canDeletePs
7444
+ }, {
7445
+ text: "显示/隐藏说明",
7446
+ onClick: core.showHideComment,
7447
+ show: canShowHidePs
7448
+ }].filter(function (item) {
7449
+ return item.show;
7450
+ });
7437
7451
  return itemData.map(function (item) {
7438
7452
  return /*#__PURE__*/React__default['default'].createElement(Menu, {
7439
7453
  key: item.text,
package/dist/index.umd.js CHANGED
@@ -105147,7 +105147,8 @@
105147
105147
  height = commentBox.height,
105148
105148
  value = commentBox.value,
105149
105149
  autoFocus = commentBox.autoFocus,
105150
- size = commentBox.size;
105150
+ size = commentBox.size,
105151
+ preValue = commentBox.preValue;
105151
105152
  var isEditing = ((_context$editingComme2 = context.editingCommentBox) === null || _context$editingComme2 === void 0 ? void 0 : _context$editingComme2.rc) === rc;
105152
105153
  var commentId = "comment-box-".concat(rc);
105153
105154
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -105177,7 +105178,7 @@
105177
105178
  x1: size.fromX,
105178
105179
  y1: size.fromY,
105179
105180
  x2: size.toX,
105180
- y2: size.toY,
105181
+ y2: size.toY + 4,
105181
105182
  stroke: "#333",
105182
105183
  strokeWidth: "1",
105183
105184
  markerEnd: "url(#arrowhead)"
@@ -105242,15 +105243,17 @@
105242
105243
  height: "100%",
105243
105244
  overflow: "hidden"
105244
105245
  }
105245
- }, /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
105246
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
105247
+ dangerouslySetInnerHTML: {
105248
+ __html: preValue
105249
+ }
105250
+ }), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
105246
105251
  id: "comment-editor-".concat(rc),
105247
105252
  autoFocus: autoFocus,
105248
105253
  style: {
105249
105254
  width: "100%",
105250
- height: "100%",
105251
105255
  lineHeight: "20px",
105252
105256
  boxSizing: "border-box",
105253
- textAlign: "center",
105254
105257
  wordBreak: "break-all",
105255
105258
  outline: "none"
105256
105259
  },
@@ -110452,24 +110455,35 @@
110452
110455
  });
110453
110456
  }
110454
110457
  if (name === "insert-comment") {
110455
- var _flowdata$row_index, _flowdata$row_index$c;
110458
+ var _flowdata$row_index, _flowdata$row_index$c, _flowdata$row_index$c2, _flowdata$row_index2, _flowdata$row_index2$, _flowdata$row_index2$2;
110456
110459
  var flowdata = getFlowdata(context);
110457
110460
  var row_index = selection === null || selection === void 0 ? void 0 : selection.row[0];
110458
110461
  var col_index = selection === null || selection === void 0 ? void 0 : selection.column[0];
110459
- var hasPs = (flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : _flowdata$row_index$c.ps) != null;
110460
- var itemData = hasPs ? [{
110461
- text: "编辑批注",
110462
- onClick: editComment
110462
+ var hasPsValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index = flowdata[row_index]) === null || _flowdata$row_index === void 0 ? void 0 : (_flowdata$row_index$c = _flowdata$row_index[col_index]) === null || _flowdata$row_index$c === void 0 ? void 0 : (_flowdata$row_index$c2 = _flowdata$row_index$c.ps) === null || _flowdata$row_index$c2 === void 0 ? void 0 : _flowdata$row_index$c2.value;
110463
+ var hasPsPreValue = flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$row_index2 = flowdata[row_index]) === null || _flowdata$row_index2 === void 0 ? void 0 : (_flowdata$row_index2$ = _flowdata$row_index2[col_index]) === null || _flowdata$row_index2$ === void 0 ? void 0 : (_flowdata$row_index2$2 = _flowdata$row_index2$.ps) === null || _flowdata$row_index2$2 === void 0 ? void 0 : _flowdata$row_index2$2.preValue;
110464
+ var canAddPs = !hasPsValue;
110465
+ var canEditPs = hasPsValue;
110466
+ var canDeletePs = hasPsValue;
110467
+ var canShowHidePs = hasPsValue || hasPsPreValue;
110468
+ var itemData = [{
110469
+ text: "新建说明",
110470
+ onClick: newComment,
110471
+ show: canAddPs
110463
110472
  }, {
110464
- text: "删除批注",
110465
- onClick: deleteComment
110473
+ text: "编辑说明",
110474
+ onClick: editComment,
110475
+ show: canEditPs
110466
110476
  }, {
110467
- text: "显示/隐藏批注",
110468
- onClick: showHideComment
110469
- }] : [{
110470
- text: "新建批注",
110471
- onClick: newComment
110472
- }];
110477
+ text: "删除说明",
110478
+ onClick: deleteComment,
110479
+ show: canDeletePs
110480
+ }, {
110481
+ text: "显示/隐藏说明",
110482
+ onClick: showHideComment,
110483
+ show: canShowHidePs
110484
+ }].filter(function (item) {
110485
+ return item.show;
110486
+ });
110473
110487
  return itemData.map(function (item) {
110474
110488
  return /*#__PURE__*/React__default['default'].createElement(Menu, {
110475
110489
  key: item.text,