@leankylin-sheet/react 5.2.61 → 5.2.63

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.umd.js CHANGED
@@ -56,6 +56,307 @@
56
56
  }
57
57
  return e;
58
58
  }
59
+ function _regeneratorRuntime() {
60
+ _regeneratorRuntime = function () {
61
+ return e;
62
+ };
63
+ var t,
64
+ e = {},
65
+ r = Object.prototype,
66
+ n = r.hasOwnProperty,
67
+ o = Object.defineProperty || function (t, e, r) {
68
+ t[e] = r.value;
69
+ },
70
+ i = "function" == typeof Symbol ? Symbol : {},
71
+ a = i.iterator || "@@iterator",
72
+ c = i.asyncIterator || "@@asyncIterator",
73
+ u = i.toStringTag || "@@toStringTag";
74
+ function define(t, e, r) {
75
+ return Object.defineProperty(t, e, {
76
+ value: r,
77
+ enumerable: !0,
78
+ configurable: !0,
79
+ writable: !0
80
+ }), t[e];
81
+ }
82
+ try {
83
+ define({}, "");
84
+ } catch (t) {
85
+ define = function (t, e, r) {
86
+ return t[e] = r;
87
+ };
88
+ }
89
+ function wrap(t, e, r, n) {
90
+ var i = e && e.prototype instanceof Generator ? e : Generator,
91
+ a = Object.create(i.prototype),
92
+ c = new Context(n || []);
93
+ return o(a, "_invoke", {
94
+ value: makeInvokeMethod(t, r, c)
95
+ }), a;
96
+ }
97
+ function tryCatch(t, e, r) {
98
+ try {
99
+ return {
100
+ type: "normal",
101
+ arg: t.call(e, r)
102
+ };
103
+ } catch (t) {
104
+ return {
105
+ type: "throw",
106
+ arg: t
107
+ };
108
+ }
109
+ }
110
+ e.wrap = wrap;
111
+ var h = "suspendedStart",
112
+ l = "suspendedYield",
113
+ f = "executing",
114
+ s = "completed",
115
+ y = {};
116
+ function Generator() {}
117
+ function GeneratorFunction() {}
118
+ function GeneratorFunctionPrototype() {}
119
+ var p = {};
120
+ define(p, a, function () {
121
+ return this;
122
+ });
123
+ var d = Object.getPrototypeOf,
124
+ v = d && d(d(values([])));
125
+ v && v !== r && n.call(v, a) && (p = v);
126
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
127
+ function defineIteratorMethods(t) {
128
+ ["next", "throw", "return"].forEach(function (e) {
129
+ define(t, e, function (t) {
130
+ return this._invoke(e, t);
131
+ });
132
+ });
133
+ }
134
+ function AsyncIterator(t, e) {
135
+ function invoke(r, o, i, a) {
136
+ var c = tryCatch(t[r], t, o);
137
+ if ("throw" !== c.type) {
138
+ var u = c.arg,
139
+ h = u.value;
140
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
141
+ invoke("next", t, i, a);
142
+ }, function (t) {
143
+ invoke("throw", t, i, a);
144
+ }) : e.resolve(h).then(function (t) {
145
+ u.value = t, i(u);
146
+ }, function (t) {
147
+ return invoke("throw", t, i, a);
148
+ });
149
+ }
150
+ a(c.arg);
151
+ }
152
+ var r;
153
+ o(this, "_invoke", {
154
+ value: function (t, n) {
155
+ function callInvokeWithMethodAndArg() {
156
+ return new e(function (e, r) {
157
+ invoke(t, n, e, r);
158
+ });
159
+ }
160
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
161
+ }
162
+ });
163
+ }
164
+ function makeInvokeMethod(e, r, n) {
165
+ var o = h;
166
+ return function (i, a) {
167
+ if (o === f) throw Error("Generator is already running");
168
+ if (o === s) {
169
+ if ("throw" === i) throw a;
170
+ return {
171
+ value: t,
172
+ done: !0
173
+ };
174
+ }
175
+ for (n.method = i, n.arg = a;;) {
176
+ var c = n.delegate;
177
+ if (c) {
178
+ var u = maybeInvokeDelegate(c, n);
179
+ if (u) {
180
+ if (u === y) continue;
181
+ return u;
182
+ }
183
+ }
184
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
185
+ if (o === h) throw o = s, n.arg;
186
+ n.dispatchException(n.arg);
187
+ } else "return" === n.method && n.abrupt("return", n.arg);
188
+ o = f;
189
+ var p = tryCatch(e, r, n);
190
+ if ("normal" === p.type) {
191
+ if (o = n.done ? s : l, p.arg === y) continue;
192
+ return {
193
+ value: p.arg,
194
+ done: n.done
195
+ };
196
+ }
197
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
198
+ }
199
+ };
200
+ }
201
+ function maybeInvokeDelegate(e, r) {
202
+ var n = r.method,
203
+ o = e.iterator[n];
204
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
205
+ var i = tryCatch(o, e.iterator, r.arg);
206
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
207
+ var a = i.arg;
208
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
209
+ }
210
+ function pushTryEntry(t) {
211
+ var e = {
212
+ tryLoc: t[0]
213
+ };
214
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
215
+ }
216
+ function resetTryEntry(t) {
217
+ var e = t.completion || {};
218
+ e.type = "normal", delete e.arg, t.completion = e;
219
+ }
220
+ function Context(t) {
221
+ this.tryEntries = [{
222
+ tryLoc: "root"
223
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
224
+ }
225
+ function values(e) {
226
+ if (e || "" === e) {
227
+ var r = e[a];
228
+ if (r) return r.call(e);
229
+ if ("function" == typeof e.next) return e;
230
+ if (!isNaN(e.length)) {
231
+ var o = -1,
232
+ i = function next() {
233
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
234
+ return next.value = t, next.done = !0, next;
235
+ };
236
+ return i.next = i;
237
+ }
238
+ }
239
+ throw new TypeError(typeof e + " is not iterable");
240
+ }
241
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
242
+ value: GeneratorFunctionPrototype,
243
+ configurable: !0
244
+ }), o(GeneratorFunctionPrototype, "constructor", {
245
+ value: GeneratorFunction,
246
+ configurable: !0
247
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
248
+ var e = "function" == typeof t && t.constructor;
249
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
250
+ }, e.mark = function (t) {
251
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
252
+ }, e.awrap = function (t) {
253
+ return {
254
+ __await: t
255
+ };
256
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
257
+ return this;
258
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
259
+ void 0 === i && (i = Promise);
260
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
261
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
262
+ return t.done ? t.value : a.next();
263
+ });
264
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
265
+ return this;
266
+ }), define(g, "toString", function () {
267
+ return "[object Generator]";
268
+ }), e.keys = function (t) {
269
+ var e = Object(t),
270
+ r = [];
271
+ for (var n in e) r.push(n);
272
+ return r.reverse(), function next() {
273
+ for (; r.length;) {
274
+ var t = r.pop();
275
+ if (t in e) return next.value = t, next.done = !1, next;
276
+ }
277
+ return next.done = !0, next;
278
+ };
279
+ }, e.values = values, Context.prototype = {
280
+ constructor: Context,
281
+ reset: function (e) {
282
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
283
+ },
284
+ stop: function () {
285
+ this.done = !0;
286
+ var t = this.tryEntries[0].completion;
287
+ if ("throw" === t.type) throw t.arg;
288
+ return this.rval;
289
+ },
290
+ dispatchException: function (e) {
291
+ if (this.done) throw e;
292
+ var r = this;
293
+ function handle(n, o) {
294
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
295
+ }
296
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
297
+ var i = this.tryEntries[o],
298
+ a = i.completion;
299
+ if ("root" === i.tryLoc) return handle("end");
300
+ if (i.tryLoc <= this.prev) {
301
+ var c = n.call(i, "catchLoc"),
302
+ u = n.call(i, "finallyLoc");
303
+ if (c && u) {
304
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
305
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
306
+ } else if (c) {
307
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
308
+ } else {
309
+ if (!u) throw Error("try statement without catch or finally");
310
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
311
+ }
312
+ }
313
+ }
314
+ },
315
+ abrupt: function (t, e) {
316
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
317
+ var o = this.tryEntries[r];
318
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
319
+ var i = o;
320
+ break;
321
+ }
322
+ }
323
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
324
+ var a = i ? i.completion : {};
325
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
326
+ },
327
+ complete: function (t, e) {
328
+ if ("throw" === t.type) throw t.arg;
329
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
330
+ },
331
+ finish: function (t) {
332
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
333
+ var r = this.tryEntries[e];
334
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
335
+ }
336
+ },
337
+ catch: function (t) {
338
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
339
+ var r = this.tryEntries[e];
340
+ if (r.tryLoc === t) {
341
+ var n = r.completion;
342
+ if ("throw" === n.type) {
343
+ var o = n.arg;
344
+ resetTryEntry(r);
345
+ }
346
+ return o;
347
+ }
348
+ }
349
+ throw Error("illegal catch attempt");
350
+ },
351
+ delegateYield: function (e, r, n) {
352
+ return this.delegate = {
353
+ iterator: values(e),
354
+ resultName: r,
355
+ nextLoc: n
356
+ }, "next" === this.method && (this.arg = t), y;
357
+ }
358
+ }, e;
359
+ }
59
360
  function _toPrimitive(t, r) {
60
361
  if ("object" != typeof t || !t) return t;
61
362
  var e = t[Symbol.toPrimitive];
@@ -70,6 +371,36 @@
70
371
  var i = _toPrimitive(t, "string");
71
372
  return "symbol" == typeof i ? i : i + "";
72
373
  }
374
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
375
+ try {
376
+ var info = gen[key](arg);
377
+ var value = info.value;
378
+ } catch (error) {
379
+ reject(error);
380
+ return;
381
+ }
382
+ if (info.done) {
383
+ resolve(value);
384
+ } else {
385
+ Promise.resolve(value).then(_next, _throw);
386
+ }
387
+ }
388
+ function _asyncToGenerator(fn) {
389
+ return function () {
390
+ var self = this,
391
+ args = arguments;
392
+ return new Promise(function (resolve, reject) {
393
+ var gen = fn.apply(self, args);
394
+ function _next(value) {
395
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
396
+ }
397
+ function _throw(err) {
398
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
399
+ }
400
+ _next(undefined);
401
+ });
402
+ };
403
+ }
73
404
  function _defineProperty(obj, key, value) {
74
405
  key = _toPropertyKey(key);
75
406
  if (key in obj) {
@@ -29373,16 +29704,49 @@
29373
29704
  return lodash.isUndefined(singleSheet.hide) || singleSheet.hide !== 1;
29374
29705
  });
29375
29706
  if (context.luckysheetfile.length > 1 && shownSheets.length > 1) {
29376
- showAlert("".concat(sheetconfig.confirmDelete, "\"").concat(sheet.name, "\"\uFF1F"), "yesno", function () {
29377
- setContext(function (ctx) {
29378
- core.deleteSheet(ctx, sheet.id);
29379
- }, {
29380
- deleteSheetOp: {
29381
- id: sheet.id
29707
+ showAlert("".concat(sheetconfig.confirmDelete, "\"").concat(sheet.name, "\"\uFF1F"), "yesno", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
29708
+ var onDeleteSheetCheck, isAllowed;
29709
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
29710
+ while (1) switch (_context.prev = _context.next) {
29711
+ case 0:
29712
+ onDeleteSheetCheck = settings.onDeleteSheetCheck;
29713
+ if (!onDeleteSheetCheck) {
29714
+ _context.next = 14;
29715
+ break;
29716
+ }
29717
+ _context.prev = 2;
29718
+ _context.next = 5;
29719
+ return onDeleteSheetCheck(sheet.id, sheet);
29720
+ case 5:
29721
+ isAllowed = _context.sent;
29722
+ _context.next = 12;
29723
+ break;
29724
+ case 8:
29725
+ _context.prev = 8;
29726
+ _context.t0 = _context["catch"](2);
29727
+ console.error(_context.t0);
29728
+ isAllowed = false;
29729
+ case 12:
29730
+ if (isAllowed) {
29731
+ _context.next = 14;
29732
+ break;
29733
+ }
29734
+ return _context.abrupt("return");
29735
+ case 14:
29736
+ setContext(function (ctx) {
29737
+ core.deleteSheet(ctx, sheet.id);
29738
+ }, {
29739
+ deleteSheetOp: {
29740
+ id: sheet.id
29741
+ }
29742
+ });
29743
+ hideAlert();
29744
+ case 16:
29745
+ case "end":
29746
+ return _context.stop();
29382
29747
  }
29383
- });
29384
- hideAlert();
29385
- }, undefined, {
29748
+ }, _callee, null, [[2, 8]]);
29749
+ })), undefined, {
29386
29750
  confirmText: sheetconfig.delete,
29387
29751
  danger: true
29388
29752
  });
@@ -29514,11 +29878,15 @@
29514
29878
  getRefs: function getRefs() {
29515
29879
  return refs;
29516
29880
  },
29517
- setCellOptions: function setCellOptions(cellOptions) {
29881
+ setCellOptions: function setCellOptions(cellOptions, sheetId) {
29518
29882
  return setContext(function (ctx) {
29519
- ctx.cellOptions = cellOptions;
29520
- var index = core.getSheetIndex(ctx, context.currentSheetId);
29883
+ var targetSheetId = sheetId !== null && sheetId !== void 0 ? sheetId : ctx.currentSheetId;
29884
+ var index = core.getSheetIndex(ctx, targetSheetId);
29885
+ if (index == null) return;
29521
29886
  ctx.luckysheetfile[index].cellOptions = cellOptions;
29887
+ if (targetSheetId === ctx.currentSheetId) {
29888
+ ctx.cellOptions = cellOptions;
29889
+ }
29522
29890
  });
29523
29891
  },
29524
29892
  applyOp: function applyOp(ops) {