@leankylin-sheet/react 5.1.2 → 5.1.3

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.
Files changed (2) hide show
  1. package/dist/index.umd.js +144 -144
  2. package/package.json +3 -3
package/dist/index.umd.js CHANGED
@@ -42168,11 +42168,11 @@
42168
42168
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
42169
42169
  }
42170
42170
 
42171
- /**
42172
- * Convert value into number.
42173
- *
42174
- * @param {String|Number} number
42175
- * @returns {*}
42171
+ /**
42172
+ * Convert value into number.
42173
+ *
42174
+ * @param {String|Number} number
42175
+ * @returns {*}
42176
42176
  */
42177
42177
  function toNumber(number) {
42178
42178
  var _result;
@@ -42188,11 +42188,11 @@
42188
42188
  return (_result = result) !== null && _result !== void 0 ? _result : 0;
42189
42189
  }
42190
42190
 
42191
- /**
42192
- * Invert provided number.
42193
- *
42194
- * @param {Number} number
42195
- * @returns {Number} Returns inverted number.
42191
+ /**
42192
+ * Invert provided number.
42193
+ *
42194
+ * @param {Number} number
42195
+ * @returns {Number} Returns inverted number.
42196
42196
  */
42197
42197
  function invertNumber(number) {
42198
42198
  return -1 * toNumber(number);
@@ -42225,11 +42225,11 @@
42225
42225
  var errors_formula_map = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, ERROR$1, utils.errors.error), ERROR_DIV_ZERO, utils.errors.div0), ERROR_NAME, utils.errors.name), ERROR_NOT_AVAILABLE, utils.errors.na), ERROR_NULL, utils.errors.nil), ERROR_NUM, utils.errors.num), ERROR_REF, utils.errors.ref), ERROR_VALUE, utils.errors.value);
42226
42226
  var errors$1 = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, ERROR$1, '#ERROR!'), ERROR_DIV_ZERO, '#DIV/0!'), ERROR_NAME, '#NAME?'), ERROR_NOT_AVAILABLE, '#N/A'), ERROR_NULL, '#NULL!'), ERROR_NUM, '#NUM!'), ERROR_REF, '#REF!'), ERROR_VALUE, '#VALUE!');
42227
42227
 
42228
- /**
42229
- * Return error type based on provided error id.
42230
- *
42231
- * @param {String} type Error type.
42232
- * @returns {String|null} Returns error id.
42228
+ /**
42229
+ * Return error type based on provided error id.
42230
+ *
42231
+ * @param {String} type Error type.
42232
+ * @returns {String|null} Returns error id.
42233
42233
  */
42234
42234
  function error$1(type) {
42235
42235
  var result;
@@ -42240,11 +42240,11 @@
42240
42240
  return result ? result : null;
42241
42241
  }
42242
42242
 
42243
- /**
42244
- * Check if error type is strict valid with knows errors.
42245
- *
42246
- * @param {String} Error type.
42247
- * @return {Boolean}
42243
+ /**
42244
+ * Check if error type is strict valid with knows errors.
42245
+ *
42246
+ * @param {String} Error type.
42247
+ * @return {Boolean}
42248
42248
  */
42249
42249
  function isValidStrict(type) {
42250
42250
  var valid = false;
@@ -42463,12 +42463,12 @@
42463
42463
  }
42464
42464
  func$9.SYMBOL = SYMBOL$9;
42465
42465
 
42466
- /**
42467
- * 解决js处理精度问题
42468
- * 0.3 * 0.1 = 0.03
42469
- * @param num1
42470
- * @param num2
42471
- * @returns
42466
+ /**
42467
+ * 解决js处理精度问题
42468
+ * 0.3 * 0.1 = 0.03
42469
+ * @param num1
42470
+ * @param num2
42471
+ * @returns
42472
42472
  */
42473
42473
  var multiplyNumber = function multiplyNumber() {
42474
42474
  var num1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -42537,12 +42537,12 @@
42537
42537
 
42538
42538
  var availableOperators = Object.create(null);
42539
42539
 
42540
- /**
42541
- * Evaluate values by operator id.git
42542
- *
42543
- * @param {String} operator Operator id.
42544
- * @param {Array} [params=[]] Arguments to evaluate.
42545
- * @returns {*}
42540
+ /**
42541
+ * Evaluate values by operator id.git
42542
+ *
42543
+ * @param {String} operator Operator id.
42544
+ * @param {Array} [params=[]] Arguments to evaluate.
42545
+ * @returns {*}
42546
42546
  */
42547
42547
  function evaluateByOperator(operator) {
42548
42548
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -42553,11 +42553,11 @@
42553
42553
  return availableOperators[operator].apply(availableOperators, _toConsumableArray$1(params));
42554
42554
  }
42555
42555
 
42556
- /**
42557
- * Register operator.
42558
- *
42559
- * @param {String|Array} symbol Symbol to register.
42560
- * @param {Function} func Logic to register for this symbol.
42556
+ /**
42557
+ * Register operator.
42558
+ *
42559
+ * @param {String|Array} symbol Symbol to register.
42560
+ * @param {Function} func Logic to register for this symbol.
42561
42561
  */
42562
42562
  function registerOperation(symbol, func) {
42563
42563
  if (!Array.isArray(symbol)) {
@@ -43993,12 +43993,12 @@
43993
43993
  parser.Parser = Parser;
43994
43994
 
43995
43995
  /* eslint-disable import/prefer-default-export */
43996
- /**
43997
- * Trim value by cutting character starting from the beginning and ending at the same time.
43998
- *
43999
- * @param {String} string String to trimming.
44000
- * @param {Number} [margin=1] Number of character to cut.
44001
- * @returns {String}
43996
+ /**
43997
+ * Trim value by cutting character starting from the beginning and ending at the same time.
43998
+ *
43999
+ * @param {String} string String to trimming.
44000
+ * @param {Number} [margin=1] Number of character to cut.
44001
+ * @returns {String}
44002
44002
  */
44003
44003
  function trimEdges(string) {
44004
44004
  var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
@@ -44006,11 +44006,11 @@
44006
44006
  return string;
44007
44007
  }
44008
44008
 
44009
- /**
44010
- * Convert row label to index.
44011
- *
44012
- * @param {String} label Row label (eq. '1', '5')
44013
- * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.
44009
+ /**
44010
+ * Convert row label to index.
44011
+ *
44012
+ * @param {String} label Row label (eq. '1', '5')
44013
+ * @returns {Number} Returns -1 if label is not recognized otherwise proper row index.
44014
44014
  */
44015
44015
  function rowLabelToIndex(label) {
44016
44016
  var result = parseInt(label, 10);
@@ -44022,11 +44022,11 @@
44022
44022
  return result;
44023
44023
  }
44024
44024
 
44025
- /**
44026
- * Convert row index to label.
44027
- *
44028
- * @param {Number} row Row index.
44029
- * @returns {String} Returns row label (eq. '1', '7').
44025
+ /**
44026
+ * Convert row index to label.
44027
+ *
44028
+ * @param {Number} row Row index.
44029
+ * @returns {String} Returns row label (eq. '1', '7').
44030
44030
  */
44031
44031
  function rowIndexToLabel(row) {
44032
44032
  var result = "";
@@ -44038,11 +44038,11 @@
44038
44038
  var COLUMN_LABEL_BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
44039
44039
  var COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;
44040
44040
 
44041
- /**
44042
- * Convert column label to index.
44043
- *
44044
- * @param {String} label Column label (eq. 'ABB', 'CNQ')
44045
- * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.
44041
+ /**
44042
+ * Convert column label to index.
44043
+ *
44044
+ * @param {String} label Column label (eq. 'ABB', 'CNQ')
44045
+ * @returns {Number} Returns -1 if label is not recognized otherwise proper column index.
44046
44046
  */
44047
44047
  function columnLabelToIndex(label) {
44048
44048
  var result = 0;
@@ -44056,11 +44056,11 @@
44056
44056
  return result;
44057
44057
  }
44058
44058
 
44059
- /**
44060
- * Convert column index to label.
44061
- *
44062
- * @param {Number} column Column index.
44063
- * @returns {String} Returns column label (eq. 'ABB', 'CNQ').
44059
+ /**
44060
+ * Convert column index to label.
44061
+ *
44062
+ * @param {Number} column Column index.
44063
+ * @returns {String} Returns column label (eq. 'ABB', 'CNQ').
44064
44064
  */
44065
44065
  function columnIndexToLabel(column) {
44066
44066
  var result = "";
@@ -44075,11 +44075,11 @@
44075
44075
  var sheetNameRegexp$1 = "(".concat(simpleSheetName$1, "|").concat(quotedSheetName$1, ")!");
44076
44076
  var LABEL_EXTRACT_REGEXP = new RegExp("^(?:".concat(sheetNameRegexp$1, ")?([$])?([A-Za-z]*)([$])?([0-9]*)$"));
44077
44077
 
44078
- /**
44079
- * Extract cell coordinates.
44080
- *
44081
- * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').
44082
- * @returns {Array} Returns an array of objects.
44078
+ /**
44079
+ * Extract cell coordinates.
44080
+ *
44081
+ * @param {String} label Cell coordinates (eq. 'A1', '$B6', '$N$98').
44082
+ * @returns {Array} Returns an array of objects.
44083
44083
  */
44084
44084
  function extractLabel(label) {
44085
44085
  if (typeof label !== "string" || !LABEL_EXTRACT_REGEXP.test(label)) {
@@ -44105,12 +44105,12 @@
44105
44105
  }, sheetName];
44106
44106
  }
44107
44107
 
44108
- /**
44109
- * Convert row and column indexes into cell label.
44110
- *
44111
- * @param {Object} row Object with `index` and `isAbsolute` properties.
44112
- * @param {Object} column Object with `index` and `isAbsolute` properties.
44113
- * @returns {String} Returns cell label.
44108
+ /**
44109
+ * Convert row and column indexes into cell label.
44110
+ *
44111
+ * @param {Object} row Object with `index` and `isAbsolute` properties.
44112
+ * @param {Object} column Object with `index` and `isAbsolute` properties.
44113
+ * @returns {String} Returns cell label.
44114
44114
  */
44115
44115
  function toLabel(row, column) {
44116
44116
  var rowLabel = (row.isAbsolute ? "$" : "") + rowIndexToLabel(row.index);
@@ -44118,8 +44118,8 @@
44118
44118
  return columnLabel + rowLabel;
44119
44119
  }
44120
44120
 
44121
- /**
44122
- * @class Parser
44121
+ /**
44122
+ * @class Parser
44123
44123
  */
44124
44124
  var Parser$1 = /*#__PURE__*/function (_Emitter) {
44125
44125
  function Parser$1() {
@@ -44155,13 +44155,13 @@
44155
44155
  return _this;
44156
44156
  }
44157
44157
 
44158
- /**
44159
- * Parse formula expression.
44160
- *
44161
- * @param {string} expression to parse.
44162
- * @param {object} options additional params.
44163
- * @param {string} options.sheetId id of sheet which the formula expression belongs to.
44164
- * @return {*} Returns an object with tow properties `error` and `result`.
44158
+ /**
44159
+ * Parse formula expression.
44160
+ *
44161
+ * @param {string} expression to parse.
44162
+ * @param {object} options additional params.
44163
+ * @param {string} options.sheetId id of sheet which the formula expression belongs to.
44164
+ * @return {*} Returns an object with tow properties `error` and `result`.
44165
44165
  */
44166
44166
  _inherits(Parser$1, _Emitter);
44167
44167
  return _createClass(Parser$1, [{
@@ -44197,12 +44197,12 @@
44197
44197
  };
44198
44198
  }
44199
44199
 
44200
- /**
44201
- * Set predefined variable name which can be visible while parsing formula expression.
44202
- *
44203
- * @param {String} name Variable name.
44204
- * @param {*} value Variable value.
44205
- * @returns {Parser}
44200
+ /**
44201
+ * Set predefined variable name which can be visible while parsing formula expression.
44202
+ *
44203
+ * @param {String} name Variable name.
44204
+ * @param {*} value Variable value.
44205
+ * @returns {Parser}
44206
44206
  */
44207
44207
  }, {
44208
44208
  key: "setVariable",
@@ -44215,11 +44215,11 @@
44215
44215
  value: function replaceVariables(variables) {
44216
44216
  this.variables = variables;
44217
44217
  }
44218
- /**
44219
- * Get variable name.
44220
- *
44221
- * @param {String} name Variable name.
44222
- * @returns {*}
44218
+ /**
44219
+ * Get variable name.
44220
+ *
44221
+ * @param {String} name Variable name.
44222
+ * @returns {*}
44223
44223
  */
44224
44224
  }, {
44225
44225
  key: "getVariable",
@@ -44233,12 +44233,12 @@
44233
44233
  return this.variables[name];
44234
44234
  }
44235
44235
 
44236
- /**
44237
- * Retrieve variable value by its name.
44238
- *
44239
- * @param name Variable name.
44240
- * @returns {*}
44241
- * @private
44236
+ /**
44237
+ * Retrieve variable value by its name.
44238
+ *
44239
+ * @param name Variable name.
44240
+ * @returns {*}
44241
+ * @private
44242
44242
  */
44243
44243
  }, {
44244
44244
  key: "_callVariable",
@@ -44255,12 +44255,12 @@
44255
44255
  return value;
44256
44256
  }
44257
44257
 
44258
- /**
44259
- * Set custom function which can be visible while parsing formula expression.
44260
- *
44261
- * @param {String} name Custom function name.
44262
- * @param {Function} fn Custom function.
44263
- * @returns {Parser}
44258
+ /**
44259
+ * Set custom function which can be visible while parsing formula expression.
44260
+ *
44261
+ * @param {String} name Custom function name.
44262
+ * @param {Function} fn Custom function.
44263
+ * @returns {Parser}
44264
44264
  */
44265
44265
  }, {
44266
44266
  key: "setFunction",
@@ -44269,11 +44269,11 @@
44269
44269
  return this;
44270
44270
  }
44271
44271
 
44272
- /**
44273
- * Get custom function.
44274
- *
44275
- * @param {String} name Custom function name.
44276
- * @returns {*}
44272
+ /**
44273
+ * Get custom function.
44274
+ *
44275
+ * @param {String} name Custom function name.
44276
+ * @returns {*}
44277
44277
  */
44278
44278
  }, {
44279
44279
  key: "getFunction",
@@ -44281,13 +44281,13 @@
44281
44281
  return this.functions[name];
44282
44282
  }
44283
44283
 
44284
- /**
44285
- * Call function with provided params.
44286
- *
44287
- * @param name Function name.
44288
- * @param params Function params.
44289
- * @returns {*}
44290
- * @private
44284
+ /**
44285
+ * Call function with provided params.
44286
+ *
44287
+ * @param name Function name.
44288
+ * @param params Function params.
44289
+ * @returns {*}
44290
+ * @private
44291
44291
  */
44292
44292
  }, {
44293
44293
  key: "_callFunction",
@@ -44306,12 +44306,12 @@
44306
44306
  return value === void 0 ? evaluateByOperator(name, params) : value;
44307
44307
  }
44308
44308
 
44309
- /**
44310
- * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).
44311
- *
44312
- * @param {String} label Coordinates.
44313
- * @returns {*}
44314
- * @private
44309
+ /**
44310
+ * Retrieve value by its label (`B3`, `B$3`, `B$3`, `$B$3`).
44311
+ *
44312
+ * @param {String} label Coordinates.
44313
+ * @returns {*}
44314
+ * @private
44315
44315
  */
44316
44316
  }, {
44317
44317
  key: "_callCellValue",
@@ -44341,13 +44341,13 @@
44341
44341
  return value;
44342
44342
  }
44343
44343
 
44344
- /**
44345
- * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).
44346
- *
44347
- * @param {String} startLabel Coordinates of the first cell.
44348
- * @param {String} endLabel Coordinates of the last cell.
44349
- * @returns {Array} Returns an array of mixed values.
44350
- * @private
44344
+ /**
44345
+ * Retrieve value by its label (`B3:A1`, `B$3:A1`, `B$3:$A1`, `$B$3:A$1`).
44346
+ *
44347
+ * @param {String} startLabel Coordinates of the first cell.
44348
+ * @param {String} endLabel Coordinates of the last cell.
44349
+ * @returns {Array} Returns an array of mixed values.
44350
+ * @private
44351
44351
  */
44352
44352
  }, {
44353
44353
  key: "_callRangeValue",
@@ -44392,12 +44392,12 @@
44392
44392
  return value;
44393
44393
  }
44394
44394
 
44395
- /**
44396
- * Try to throw error by its name.
44397
- *
44398
- * @param {String} errorName Error name.
44399
- * @returns {String}
44400
- * @private
44395
+ /**
44396
+ * Try to throw error by its name.
44397
+ *
44398
+ * @param {String} errorName Error name.
44399
+ * @returns {String}
44400
+ * @private
44401
44401
  */
44402
44402
  }, {
44403
44403
  key: "_throwError",
@@ -78260,13 +78260,13 @@
78260
78260
  return general_fmt_num_base;
78261
78261
  }();
78262
78262
  SSF._general_num = general_fmt_num;
78263
- /*
78264
- "General" rules:
78265
- - text is passed through ("@")
78266
- - booleans are rendered as TRUE/FALSE
78267
- - "up to 11 characters" displayed for numbers
78268
- - Default date format (code 14) used for Dates
78269
- TODO: technically the display depends on the width of the cell
78263
+ /*
78264
+ "General" rules:
78265
+ - text is passed through ("@")
78266
+ - booleans are rendered as TRUE/FALSE
78267
+ - "up to 11 characters" displayed for numbers
78268
+ - Default date format (code 14) used for Dates
78269
+ TODO: technically the display depends on the width of the cell
78270
78270
  */
78271
78271
  function general_fmt(v, opts) {
78272
78272
  switch (_typeof(v)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/react",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.esm.js",
@@ -14,8 +14,8 @@
14
14
  "tsc": "tsc"
15
15
  },
16
16
  "dependencies": {
17
- "@leankylin-sheet/core": "5.1.2",
18
- "@leankylin-sheet/formula-parser": "5.1.2",
17
+ "@leankylin-sheet/core": "5.1.3",
18
+ "@leankylin-sheet/formula-parser": "5.1.3",
19
19
  "@types/react-dom": "^18.3.0",
20
20
  "ahooks": "^3.8.4",
21
21
  "immer": "^9.0.12",