@univerjs/sheets-data-validation 0.10.12 → 0.10.13
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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +246 -212
- package/lib/index.js +246 -212
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var St = Object.defineProperty;
|
|
2
2
|
var Et = (o, a, e) => a in o ? St(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
|
|
3
3
|
var m = (o, a, e) => Et(o, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
-
import { Inject as v, ICommandService as
|
|
5
|
-
import { DataValidationModel as Ne, DataValidatorRegistryService as q, UpdateRuleType as M, BaseDataValidator as G, TextLengthErrorTitleMap as bt, AddDataValidationMutation as
|
|
4
|
+
import { Inject as v, ICommandService as U, IUniverInstanceService as w, Disposable as W, ObjectMatrix as Se, getIntersectRange as ot, UniverInstanceType as C, Range as L, Rectangle as A, isFormulaString as S, DataValidationType as T, getOriginCellValue as Vt, RBush as Mt, debounce as yt, Tools as E, DataValidationStatus as b, WrapStrategy as ve, DataValidationOperator as h, numfmt as P, dayjs as st, DataValidationRenderMode as Pe, CommandType as z, IUndoRedoService as Z, sequenceExecute as De, isRangesEqual as nt, IPermissionService as Tt, generateRandomId as Ye, toDisposable as Xe, Injector as Ke, CellValueType as Ft, RxDisposable as Ct, LifecycleService as Ot, LifecycleStages as et, bufferDebounceTime as wt, DependentOn as It, IConfigService as At, Plugin as Dt, merge as Nt } from "@univerjs/core";
|
|
5
|
+
import { DataValidationModel as Ne, DataValidatorRegistryService as q, UpdateRuleType as M, BaseDataValidator as G, TextLengthErrorTitleMap as bt, AddDataValidationMutation as N, RemoveDataValidationMutation as D, UpdateDataValidationMutation as y, getRuleSetting as Lt, getRuleOptions as Ut, UniverDataValidationPlugin as Bt } from "@univerjs/data-validation";
|
|
6
6
|
import { ERROR_TYPE_SET as xt, LexerTreeBuilder as Y, isReferenceString as lt, sequenceNodeType as Pt, deserializeRangeWithSheet as Ht, deserializeRangeWithSheetWithCache as Wt, operatorToken as $t } from "@univerjs/engine-formula";
|
|
7
|
-
import { SetRangeValuesMutation as se, RemoveSheetMutation as ut, getSheetCommandTarget as
|
|
8
|
-
import { Subject as Ge, bufferWhen as
|
|
7
|
+
import { SetRangeValuesMutation as se, RemoveSheetMutation as ut, getSheetCommandTarget as ze, SetRangeValuesUndoMutationFactory as dt, WorksheetViewPermission as kt, RefRangeService as jt, handleCommonDefaultRangeChangeWithEffectRefCommands as Qt, SheetInterceptorService as ct, RemoveSheetCommand as qt, CopySheetCommand as Gt, SheetsSelectionsService as ht, ClearSelectionAllCommand as Yt } from "@univerjs/sheets";
|
|
8
|
+
import { Subject as Ge, bufferWhen as Xt, filter as tt } from "rxjs";
|
|
9
9
|
import { RegisterOtherFormulaService as mt, FormulaRefRangeService as gt } from "@univerjs/sheets-formula";
|
|
10
|
-
var
|
|
11
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
10
|
+
var Kt = Object.getOwnPropertyDescriptor, zt = (o, a, e, t) => {
|
|
11
|
+
for (var r = t > 1 ? void 0 : t ? Kt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
12
12
|
(s = o[i]) && (r = s(r) || r);
|
|
13
13
|
return r;
|
|
14
14
|
}, He = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -27,7 +27,7 @@ let Q = class extends W {
|
|
|
27
27
|
if (e) {
|
|
28
28
|
const i = new Se(e).getDataRange();
|
|
29
29
|
if (i.endRow === -1) return;
|
|
30
|
-
const l = this._sheetDataValidationModel.getRules(t, r).map((u) => u.ranges).flat().map((u) =>
|
|
30
|
+
const l = this._sheetDataValidationModel.getRules(t, r).map((u) => u.ranges).flat().map((u) => ot(u, i)).filter(Boolean);
|
|
31
31
|
l.length && this.markRangeDirty(t, r, l, !0);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -62,7 +62,7 @@ let Q = class extends W {
|
|
|
62
62
|
markRangeDirty(a, e, t, r) {
|
|
63
63
|
const i = this._ensureCache(a, e);
|
|
64
64
|
t.forEach((s) => {
|
|
65
|
-
|
|
65
|
+
L.foreach(s, (n, l) => {
|
|
66
66
|
i.getValue(n, l) !== void 0 && i.setValue(n, l, void 0);
|
|
67
67
|
});
|
|
68
68
|
}), this._dirtyRanges$.next({ unitId: a, subUnitId: e, ranges: t, isSetRange: r });
|
|
@@ -70,7 +70,7 @@ let Q = class extends W {
|
|
|
70
70
|
_deleteRange(a, e, t) {
|
|
71
71
|
const r = this._ensureCache(a, e);
|
|
72
72
|
t.forEach((i) => {
|
|
73
|
-
|
|
73
|
+
L.foreach(i, (s, n) => {
|
|
74
74
|
r.realDeleteValue(s, n);
|
|
75
75
|
});
|
|
76
76
|
}), this._dirtyRanges$.next({ unitId: a, subUnitId: e, ranges: t });
|
|
@@ -79,8 +79,8 @@ let Q = class extends W {
|
|
|
79
79
|
return this._ensureCache(a, e).getValue(t, r);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
Q =
|
|
83
|
-
He(0, v(
|
|
82
|
+
Q = zt([
|
|
83
|
+
He(0, v(U)),
|
|
84
84
|
He(1, v(w)),
|
|
85
85
|
He(2, v(Ne))
|
|
86
86
|
], Q);
|
|
@@ -100,8 +100,8 @@ function de(o, a) {
|
|
|
100
100
|
const e = a.getValidatorItem(o);
|
|
101
101
|
return (t = e == null ? void 0 : e.offsetFormulaByRange) != null ? t : !1;
|
|
102
102
|
}
|
|
103
|
-
var
|
|
104
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
103
|
+
var Zt = Object.getOwnPropertyDescriptor, Jt = (o, a, e, t) => {
|
|
104
|
+
for (var r = t > 1 ? void 0 : t ? Zt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
105
105
|
(s = o[i]) && (r = s(r) || r);
|
|
106
106
|
return r;
|
|
107
107
|
}, re = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -148,7 +148,7 @@ let H = class extends W {
|
|
|
148
148
|
_handleDirtyRanges(a, e, t) {
|
|
149
149
|
this._dataValidationModel.getRules(a, e).forEach((i) => {
|
|
150
150
|
const s = i.ranges;
|
|
151
|
-
|
|
151
|
+
A.doAnyRangesIntersect(s, t) && this.makeRuleDirty(a, e, i.uid);
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
_initDirtyRanges() {
|
|
@@ -234,15 +234,15 @@ let H = class extends W {
|
|
|
234
234
|
r && this._registerOtherFormulaService.markFormulaDirty(a, e, r.formulaId), i && this._registerOtherFormulaService.markFormulaDirty(a, e, i.formulaId);
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
H =
|
|
237
|
+
H = Jt([
|
|
238
238
|
re(0, w),
|
|
239
239
|
re(1, v(mt)),
|
|
240
240
|
re(2, v(Ne)),
|
|
241
241
|
re(3, v(Q)),
|
|
242
242
|
re(4, v(q))
|
|
243
243
|
], H);
|
|
244
|
-
var
|
|
245
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
244
|
+
var ea = Object.getOwnPropertyDescriptor, ta = (o, a, e, t) => {
|
|
245
|
+
for (var r = t > 1 ? void 0 : t ? ea(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
246
246
|
(s = o[i]) && (r = s(r) || r);
|
|
247
247
|
return r;
|
|
248
248
|
}, ie = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -326,7 +326,7 @@ let K = class extends W {
|
|
|
326
326
|
return this._ensureRuleFormulaMap(a, e).get(t);
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
|
-
K =
|
|
329
|
+
K = ta([
|
|
330
330
|
ie(0, w),
|
|
331
331
|
ie(1, v(mt)),
|
|
332
332
|
ie(2, v(Q)),
|
|
@@ -340,7 +340,7 @@ function _t(o) {
|
|
|
340
340
|
var a;
|
|
341
341
|
return String((a = ne(o)) != null ? a : "");
|
|
342
342
|
}
|
|
343
|
-
class
|
|
343
|
+
class Ze {
|
|
344
344
|
constructor(a, e, t, r, i = !1) {
|
|
345
345
|
m(this, "_map");
|
|
346
346
|
m(this, "_tree", new Mt());
|
|
@@ -372,9 +372,9 @@ class ze {
|
|
|
372
372
|
_addRule(a, e) {
|
|
373
373
|
if (!this._worksheet)
|
|
374
374
|
return;
|
|
375
|
-
const t =
|
|
375
|
+
const t = A.mergeRanges(e.map((r) => L.transformRange(r, this._worksheet)));
|
|
376
376
|
this._map.forEach((r, i) => {
|
|
377
|
-
const s =
|
|
377
|
+
const s = A.subtractMulti(r, t);
|
|
378
378
|
s.length === 0 ? this._map.delete(i) : this._map.set(i, s);
|
|
379
379
|
}), this._dirty = !0, this._map.set(a, t), this._debonceBuildTree();
|
|
380
380
|
}
|
|
@@ -384,9 +384,9 @@ class ze {
|
|
|
384
384
|
removeRange(a) {
|
|
385
385
|
if (!this._worksheet)
|
|
386
386
|
return;
|
|
387
|
-
const e = a.map((t) =>
|
|
387
|
+
const e = a.map((t) => L.transformRange(t, this._worksheet));
|
|
388
388
|
this._map.forEach((t, r) => {
|
|
389
|
-
const i =
|
|
389
|
+
const i = A.subtractMulti(t, e);
|
|
390
390
|
i.length === 0 ? this._map.delete(r) : this._map.set(r, i);
|
|
391
391
|
}), this._dirty = !0, this._debonceBuildTree();
|
|
392
392
|
}
|
|
@@ -404,10 +404,10 @@ class ze {
|
|
|
404
404
|
if (!t.length)
|
|
405
405
|
return;
|
|
406
406
|
let r = this._map.get(e);
|
|
407
|
-
r ? (this._map.set(e,
|
|
407
|
+
r ? (this._map.set(e, A.mergeRanges([...r, ...t])), r = this._map.get(e)) : (r = t, this._map.set(e, r)), this._map.forEach((i, s) => {
|
|
408
408
|
if (s === e)
|
|
409
409
|
return;
|
|
410
|
-
const n =
|
|
410
|
+
const n = A.subtractMulti(i, t);
|
|
411
411
|
n.length === 0 ? this._map.delete(s) : this._map.set(s, n);
|
|
412
412
|
});
|
|
413
413
|
}), this._dirty = !0, this._debonceBuildTree();
|
|
@@ -418,11 +418,11 @@ class ze {
|
|
|
418
418
|
return a.forEach((r, i) => {
|
|
419
419
|
var l;
|
|
420
420
|
const s = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
|
|
421
|
-
s.length !== 0 && (s.length !== n.length || s.some((u, d) => !
|
|
421
|
+
s.length !== 0 && (s.length !== n.length || s.some((u, d) => !A.equals(u, n[d]))) && e.push({
|
|
422
422
|
type: "update",
|
|
423
423
|
ruleId: r.uid,
|
|
424
424
|
oldRanges: n,
|
|
425
|
-
newRanges:
|
|
425
|
+
newRanges: A.sort(s),
|
|
426
426
|
rule: r
|
|
427
427
|
}), s.length === 0 && (e.push({
|
|
428
428
|
type: "delete",
|
|
@@ -437,11 +437,11 @@ class ze {
|
|
|
437
437
|
return a.forEach((i, s) => {
|
|
438
438
|
var u;
|
|
439
439
|
const n = (u = this._map.get(i.uid)) != null ? u : [], l = i.ranges;
|
|
440
|
-
n.length !== 0 && (n.length !== l.length || n.some((d, c) => !
|
|
440
|
+
n.length !== 0 && (n.length !== l.length || n.some((d, c) => !A.equals(d, l[c]))) && t.push({
|
|
441
441
|
type: "update",
|
|
442
442
|
ruleId: i.uid,
|
|
443
443
|
oldRanges: l,
|
|
444
|
-
newRanges:
|
|
444
|
+
newRanges: A.sort(n),
|
|
445
445
|
rule: i
|
|
446
446
|
}), n.length === 0 && (t.push({
|
|
447
447
|
type: "delete",
|
|
@@ -455,13 +455,13 @@ class ze {
|
|
|
455
455
|
type: "add",
|
|
456
456
|
rule: {
|
|
457
457
|
...i,
|
|
458
|
-
ranges:
|
|
458
|
+
ranges: A.sort(s)
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
461
|
}), t;
|
|
462
462
|
}
|
|
463
463
|
clone() {
|
|
464
|
-
return new
|
|
464
|
+
return new Ze(
|
|
465
465
|
new Map(E.deepClone(Array.from(this._map.entries()))),
|
|
466
466
|
this._unitId,
|
|
467
467
|
this._subUnitId,
|
|
@@ -481,8 +481,8 @@ class ze {
|
|
|
481
481
|
return t.length > 0 ? t[0].ruleId : void 0;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
484
|
+
var aa = Object.getOwnPropertyDescriptor, ra = (o, a, e, t) => {
|
|
485
|
+
for (var r = t > 1 ? void 0 : t ? aa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
486
486
|
(s = o[i]) && (r = s(r) || r);
|
|
487
487
|
return r;
|
|
488
488
|
}, X = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -545,7 +545,7 @@ let F = class extends W {
|
|
|
545
545
|
let t = this._ruleMatrixMap.get(a);
|
|
546
546
|
t || (t = /* @__PURE__ */ new Map(), this._ruleMatrixMap.set(a, t));
|
|
547
547
|
let r = t.get(e);
|
|
548
|
-
return r || (r = new
|
|
548
|
+
return r || (r = new Ze(/* @__PURE__ */ new Map(), a, e, this._univerInstanceService), t.set(e, r)), r;
|
|
549
549
|
}
|
|
550
550
|
_addRuleSideEffect(a, e, t) {
|
|
551
551
|
this._ensureRuleMatrix(a, e).addRule(t), this._dataValidationCacheService.addRule(a, e, t), this._dataValidationFormulaService.addRule(a, e, t), this._dataValidationCustomFormulaService.addRule(a, e, t);
|
|
@@ -589,7 +589,7 @@ let F = class extends W {
|
|
|
589
589
|
}, d = l.getCellValueOnly(i, r), c = this.getValidator(a.type), g = l.getCellRaw(i, r), p = ne(g);
|
|
590
590
|
if (c) {
|
|
591
591
|
const _ = this._dataValidationCacheService.ensureCache(s, n), R = _.getValue(i, r);
|
|
592
|
-
return R == null ? (_.setValue(i, r,
|
|
592
|
+
return R == null ? (_.setValue(i, r, b.VALIDATING), c.validator(
|
|
593
593
|
{
|
|
594
594
|
value: p,
|
|
595
595
|
unitId: s,
|
|
@@ -603,11 +603,11 @@ let F = class extends W {
|
|
|
603
603
|
},
|
|
604
604
|
a
|
|
605
605
|
).then((V) => {
|
|
606
|
-
const f = V ?
|
|
607
|
-
f ===
|
|
608
|
-
}),
|
|
606
|
+
const f = V ? b.VALID : b.INVALID, I = _.getValue(i, r);
|
|
607
|
+
f === b.VALID ? _.realDeleteValue(i, r) : _.setValue(i, r, f), u(f, R !== I);
|
|
608
|
+
}), b.VALIDATING) : (u(R != null ? R : b.VALID, !1), R != null ? R : b.VALID);
|
|
609
609
|
} else
|
|
610
|
-
return u(
|
|
610
|
+
return u(b.VALID, !1), b.VALID;
|
|
611
611
|
}
|
|
612
612
|
getRuleObjectMatrix(a, e) {
|
|
613
613
|
return this._ensureRuleMatrix(a, e);
|
|
@@ -634,21 +634,21 @@ let F = class extends W {
|
|
|
634
634
|
return this._dataValidationModel.getAll();
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
|
-
F =
|
|
637
|
+
F = ra([
|
|
638
638
|
X(0, v(Ne)),
|
|
639
639
|
X(1, w),
|
|
640
640
|
X(2, v(q)),
|
|
641
641
|
X(3, v(Q)),
|
|
642
642
|
X(4, v(K)),
|
|
643
643
|
X(5, v(H)),
|
|
644
|
-
X(6,
|
|
644
|
+
X(6, U)
|
|
645
645
|
], F);
|
|
646
646
|
const Ee = 1, Ve = 0;
|
|
647
|
-
function
|
|
647
|
+
function at(o, a) {
|
|
648
648
|
return E.isBlank(o) ? a.t("dataValidation.validFail.value") : S(o) ? a.t("dataValidation.validFail.primitive") : "";
|
|
649
649
|
}
|
|
650
650
|
const pe = (o) => E.isDefine(o) && String(o).toLowerCase() === "true" ? "1" : String(o).toLowerCase() === "false" ? "0" : o;
|
|
651
|
-
class
|
|
651
|
+
class ia extends G {
|
|
652
652
|
constructor() {
|
|
653
653
|
super(...arguments);
|
|
654
654
|
m(this, "id", T.CHECKBOX);
|
|
@@ -675,7 +675,7 @@ class ra extends G {
|
|
|
675
675
|
formula1: this.localeService.t("dataValidation.validFail.checkboxEqual"),
|
|
676
676
|
formula2: this.localeService.t("dataValidation.validFail.checkboxEqual")
|
|
677
677
|
};
|
|
678
|
-
const l =
|
|
678
|
+
const l = at(i, this.localeService), u = at(s, this.localeService);
|
|
679
679
|
return {
|
|
680
680
|
success: !l && !u,
|
|
681
681
|
formula1: l,
|
|
@@ -720,7 +720,7 @@ class ra extends G {
|
|
|
720
720
|
return this.titleStr;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
const
|
|
723
|
+
const oa = {
|
|
724
724
|
[h.BETWEEN]: "dataValidation.date.operators.between",
|
|
725
725
|
[h.EQUAL]: "dataValidation.date.operators.equal",
|
|
726
726
|
[h.GREATER_THAN]: "dataValidation.date.operators.greaterThan",
|
|
@@ -731,7 +731,7 @@ const ia = {
|
|
|
731
731
|
[h.NOT_EQUAL]: "dataValidation.date.operators.notEqual"
|
|
732
732
|
};
|
|
733
733
|
h.BETWEEN + "", h.EQUAL + "", h.GREATER_THAN + "", h.GREATER_THAN_OR_EQUAL + "", h.LESS_THAN + "", h.LESS_THAN_OR_EQUAL + "", h.NOT_BETWEEN + "", h.NOT_EQUAL + "";
|
|
734
|
-
const
|
|
734
|
+
const rt = {
|
|
735
735
|
[h.BETWEEN]: "dataValidation.date.ruleName.between",
|
|
736
736
|
[h.EQUAL]: "dataValidation.date.ruleName.equal",
|
|
737
737
|
[h.GREATER_THAN]: "dataValidation.date.ruleName.greaterThan",
|
|
@@ -741,7 +741,7 @@ const at = {
|
|
|
741
741
|
[h.NOT_BETWEEN]: "dataValidation.date.ruleName.notBetween",
|
|
742
742
|
[h.NOT_EQUAL]: "dataValidation.date.ruleName.notEqual",
|
|
743
743
|
NONE: "dataValidation.date.ruleName.legal"
|
|
744
|
-
},
|
|
744
|
+
}, sa = {
|
|
745
745
|
[h.BETWEEN]: "dataValidation.date.errorMsg.between",
|
|
746
746
|
[h.EQUAL]: "dataValidation.date.errorMsg.equal",
|
|
747
747
|
[h.GREATER_THAN]: "dataValidation.date.errorMsg.greaterThan",
|
|
@@ -755,13 +755,13 @@ const at = {
|
|
|
755
755
|
h.BETWEEN,
|
|
756
756
|
h.NOT_BETWEEN
|
|
757
757
|
], le = "{FORMULA1}", ue = "{FORMULA2}";
|
|
758
|
-
function
|
|
758
|
+
function Ka(o) {
|
|
759
759
|
return o.filter(Boolean).join(",");
|
|
760
760
|
}
|
|
761
761
|
function fe(o) {
|
|
762
762
|
return o.split(",").filter(Boolean);
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function za(o) {
|
|
765
765
|
const a = ne(o);
|
|
766
766
|
return a == null ? "" : a.toString();
|
|
767
767
|
}
|
|
@@ -779,9 +779,9 @@ const We = (o) => {
|
|
|
779
779
|
if (typeof o == "number" || !Number.isNaN(+o))
|
|
780
780
|
return +o;
|
|
781
781
|
const a = (e = P.parseDate(o)) == null ? void 0 : e.v;
|
|
782
|
-
return E.isDefine(a) ? a : (t = P.parseDate(
|
|
782
|
+
return E.isDefine(a) ? a : (t = P.parseDate(st(o).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
|
|
783
783
|
};
|
|
784
|
-
class
|
|
784
|
+
class na extends G {
|
|
785
785
|
constructor() {
|
|
786
786
|
super(...arguments);
|
|
787
787
|
m(this, "id", T.DATE);
|
|
@@ -850,7 +850,7 @@ class sa extends G {
|
|
|
850
850
|
return "";
|
|
851
851
|
d = P.dateFromSerial(g);
|
|
852
852
|
}
|
|
853
|
-
return
|
|
853
|
+
return st(`${d[0]}/${d[1]}/${d[2]} ${d[3]}:${d[4]}:${d[5]}`).format(n != null && n.showTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD");
|
|
854
854
|
};
|
|
855
855
|
return {
|
|
856
856
|
formula1: S(i) ? i : l(`${i}`),
|
|
@@ -865,20 +865,20 @@ class sa extends G {
|
|
|
865
865
|
};
|
|
866
866
|
}
|
|
867
867
|
get operatorNames() {
|
|
868
|
-
return this.operators.map((e) => this.localeService.t(
|
|
868
|
+
return this.operators.map((e) => this.localeService.t(oa[e]));
|
|
869
869
|
}
|
|
870
870
|
generateRuleName(e) {
|
|
871
871
|
var r, i;
|
|
872
872
|
if (!e.operator)
|
|
873
|
-
return this.localeService.t(
|
|
874
|
-
const t = this.localeService.t(
|
|
873
|
+
return this.localeService.t(rt.NONE);
|
|
874
|
+
const t = this.localeService.t(rt[e.operator]).replace(le, (r = e.formula1) != null ? r : "").replace(ue, (i = e.formula2) != null ? i : "");
|
|
875
875
|
return `${this.titleStr} ${t}`;
|
|
876
876
|
}
|
|
877
877
|
generateRuleErrorMessage(e, t) {
|
|
878
878
|
if (!e.operator)
|
|
879
879
|
return this.titleStr;
|
|
880
880
|
const { transformedFormula1: r, transformedFormula2: i } = Le(this._lexerTreeBuilder, e, t);
|
|
881
|
-
return `${this.localeService.t(
|
|
881
|
+
return `${this.localeService.t(sa[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
h.BETWEEN + "", h.EQUAL + "", h.GREATER_THAN + "", h.GREATER_THAN_OR_EQUAL + "", h.LESS_THAN + "", h.LESS_THAN_OR_EQUAL + "", h.NOT_BETWEEN + "", h.NOT_EQUAL + "";
|
|
@@ -897,7 +897,7 @@ const Me = {
|
|
|
897
897
|
function ye(o) {
|
|
898
898
|
return +o;
|
|
899
899
|
}
|
|
900
|
-
class
|
|
900
|
+
class la extends G {
|
|
901
901
|
constructor() {
|
|
902
902
|
super(...arguments);
|
|
903
903
|
m(this, "_customFormulaService", this.injector.get(H));
|
|
@@ -985,23 +985,23 @@ function $e(o) {
|
|
|
985
985
|
}
|
|
986
986
|
), [...a];
|
|
987
987
|
}
|
|
988
|
-
const
|
|
988
|
+
const ua = [
|
|
989
989
|
"if",
|
|
990
990
|
"indirect",
|
|
991
991
|
"choose",
|
|
992
992
|
"offset"
|
|
993
993
|
];
|
|
994
|
-
function
|
|
994
|
+
function da(o, a) {
|
|
995
995
|
if (!S(o) || lt(o.slice(1)))
|
|
996
996
|
return !0;
|
|
997
997
|
const t = a.sequenceNodesBuilder(o);
|
|
998
|
-
return t && t.some((r) => typeof r == "object" && r.nodeType === Pt.FUNCTION &&
|
|
998
|
+
return t && t.some((r) => typeof r == "object" && r.nodeType === Pt.FUNCTION && ua.indexOf(r.token.toLowerCase()) > -1);
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function ca(o, a) {
|
|
1001
1001
|
const { formula1: e = "", ranges: t } = o;
|
|
1002
1002
|
if (lt(e.slice(1))) {
|
|
1003
1003
|
const i = Ht(e.slice(1));
|
|
1004
|
-
if ((!i.sheetName || i.sheetName === a) && t.some((s) =>
|
|
1004
|
+
if ((!i.sheetName || i.sheetName === a) && t.some((s) => A.intersects(s, i.range)))
|
|
1005
1005
|
return !0;
|
|
1006
1006
|
}
|
|
1007
1007
|
return !1;
|
|
@@ -1022,7 +1022,7 @@ class pt extends G {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
validatorFormula(e, t, r) {
|
|
1024
1024
|
var u, d, c;
|
|
1025
|
-
const i = !E.isBlank(e.formula1), s =
|
|
1025
|
+
const i = !E.isBlank(e.formula1), s = da((u = e.formula1) != null ? u : "", this._lexer), n = (c = (d = this._univerInstanceService.getUnit(t, C.UNIVER_SHEET)) == null ? void 0 : d.getSheetBySheetId(r)) == null ? void 0 : c.getName(), l = ca(e, n != null ? n : "");
|
|
1026
1026
|
return {
|
|
1027
1027
|
success: !!(i && s && !l),
|
|
1028
1028
|
formula1: i ? s ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
|
|
@@ -1098,7 +1098,7 @@ class pt extends G {
|
|
|
1098
1098
|
}), s;
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
class
|
|
1101
|
+
class ha extends G {
|
|
1102
1102
|
constructor() {
|
|
1103
1103
|
super(...arguments);
|
|
1104
1104
|
m(this, "id", T.TEXT_LENGTH);
|
|
@@ -1169,8 +1169,8 @@ function ft(o) {
|
|
|
1169
1169
|
var e, t;
|
|
1170
1170
|
return o ? o.p ? !((t = (e = o.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : E.isBlank(o.v) : !0;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(w), g =
|
|
1172
|
+
function Ue(o, a, e, t, r = "command", i = !0) {
|
|
1173
|
+
const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(w), g = ze(c, { unitId: o, subUnitId: a });
|
|
1174
1174
|
if (!g)
|
|
1175
1175
|
return {
|
|
1176
1176
|
redoMutations: l,
|
|
@@ -1178,12 +1178,12 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1178
1178
|
};
|
|
1179
1179
|
const { worksheet: p } = g, _ = new Se();
|
|
1180
1180
|
let R = !1;
|
|
1181
|
-
function V(f,
|
|
1181
|
+
function V(f, I) {
|
|
1182
1182
|
i && f.forEach(($) => {
|
|
1183
|
-
|
|
1184
|
-
const x = p.getCellRaw(
|
|
1185
|
-
(ft(x) || J ===
|
|
1186
|
-
v:
|
|
1183
|
+
L.foreach($, (B, k) => {
|
|
1184
|
+
const x = p.getCellRaw(B, k), J = _t(x);
|
|
1185
|
+
(ft(x) || J === I) && !(x != null && x.p) && (R = !0, _.setValue(B, k, {
|
|
1186
|
+
v: I,
|
|
1187
1187
|
p: null
|
|
1188
1188
|
}));
|
|
1189
1189
|
});
|
|
@@ -1201,7 +1201,7 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1201
1201
|
source: r
|
|
1202
1202
|
}
|
|
1203
1203
|
}), u.unshift({
|
|
1204
|
-
id:
|
|
1204
|
+
id: N.id,
|
|
1205
1205
|
params: {
|
|
1206
1206
|
unitId: o,
|
|
1207
1207
|
subUnitId: a,
|
|
@@ -1213,8 +1213,8 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1213
1213
|
break;
|
|
1214
1214
|
case "update": {
|
|
1215
1215
|
if (de(f.rule.type, n)) {
|
|
1216
|
-
const $ = f.oldRanges[0].startRow,
|
|
1217
|
-
he !== f.rule.formula1 || me !== f.rule.formula2 || !
|
|
1216
|
+
const $ = f.oldRanges[0].startRow, B = f.oldRanges[0].startColumn, k = f.newRanges[0].startRow, x = f.newRanges[0].startColumn, J = k - $, ce = x - B, he = S(f.rule.formula1) ? s.moveFormulaRefOffset(f.rule.formula1, ce, J) : f.rule.formula1, me = S(f.rule.formula2) ? s.moveFormulaRefOffset(f.rule.formula2, ce, J) : f.rule.formula2;
|
|
1217
|
+
he !== f.rule.formula1 || me !== f.rule.formula2 || !nt(f.newRanges, f.oldRanges) ? (l.push({
|
|
1218
1218
|
id: y.id,
|
|
1219
1219
|
params: {
|
|
1220
1220
|
unitId: o,
|
|
@@ -1295,16 +1295,16 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1295
1295
|
source: r
|
|
1296
1296
|
}
|
|
1297
1297
|
});
|
|
1298
|
-
const
|
|
1299
|
-
if (
|
|
1300
|
-
const
|
|
1301
|
-
V(f.newRanges,
|
|
1298
|
+
const I = d.getRuleById(o, a, f.ruleId);
|
|
1299
|
+
if (I && I.type === T.CHECKBOX) {
|
|
1300
|
+
const B = d.getValidator(T.CHECKBOX).parseFormulaSync(I, o, a);
|
|
1301
|
+
V(f.newRanges, B.formula2);
|
|
1302
1302
|
}
|
|
1303
1303
|
break;
|
|
1304
1304
|
}
|
|
1305
1305
|
case "add": {
|
|
1306
1306
|
if (l.push({
|
|
1307
|
-
id:
|
|
1307
|
+
id: N.id,
|
|
1308
1308
|
params: {
|
|
1309
1309
|
unitId: o,
|
|
1310
1310
|
subUnitId: a,
|
|
@@ -1334,42 +1334,42 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1334
1334
|
subUnitId: a,
|
|
1335
1335
|
cellValue: _.getData()
|
|
1336
1336
|
}
|
|
1337
|
-
},
|
|
1337
|
+
}, I = {
|
|
1338
1338
|
id: se.id,
|
|
1339
1339
|
params: dt(t, f.params)
|
|
1340
1340
|
};
|
|
1341
|
-
l.push(f), u.push(
|
|
1341
|
+
l.push(f), u.push(I);
|
|
1342
1342
|
}
|
|
1343
1343
|
return {
|
|
1344
1344
|
redoMutations: l,
|
|
1345
1345
|
undoMutations: u
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
|
-
const
|
|
1348
|
+
const ma = {
|
|
1349
1349
|
type: z.COMMAND,
|
|
1350
1350
|
id: "sheet.command.updateDataValidationRuleRange",
|
|
1351
1351
|
handler(o, a) {
|
|
1352
1352
|
if (!a)
|
|
1353
1353
|
return !1;
|
|
1354
|
-
const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(
|
|
1354
|
+
const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(U), l = o.get(Z);
|
|
1355
1355
|
if (!s.getRuleById(e, t, i))
|
|
1356
1356
|
return !1;
|
|
1357
1357
|
const d = s.getRuleObjectMatrix(e, t).clone();
|
|
1358
1358
|
d.updateRange(i, r);
|
|
1359
|
-
const c = d.diff(s.getRules(e, t)), { redoMutations: g, undoMutations: p } =
|
|
1359
|
+
const c = d.diff(s.getRules(e, t)), { redoMutations: g, undoMutations: p } = Ue(e, t, c, o);
|
|
1360
1360
|
return l.pushUndoRedo({
|
|
1361
1361
|
undoMutations: p,
|
|
1362
1362
|
redoMutations: g,
|
|
1363
1363
|
unitID: e
|
|
1364
1364
|
}), De(g, n), !0;
|
|
1365
1365
|
}
|
|
1366
|
-
},
|
|
1366
|
+
}, ga = {
|
|
1367
1367
|
type: z.COMMAND,
|
|
1368
1368
|
id: "sheet.command.addDataValidation",
|
|
1369
1369
|
handler(o, a) {
|
|
1370
1370
|
if (!a)
|
|
1371
1371
|
return !1;
|
|
1372
|
-
const { unitId: e, subUnitId: t, rule: r } = a, i = o.get(F), s = o.get(
|
|
1372
|
+
const { unitId: e, subUnitId: t, rule: r } = a, i = o.get(F), s = o.get(U), n = o.get(Z), l = i.getRuleObjectMatrix(e, t).clone();
|
|
1373
1373
|
l.addRule(r);
|
|
1374
1374
|
const u = l.diff(i.getRules(e, t)), d = i.getValidator(r.type), c = {
|
|
1375
1375
|
unitId: e,
|
|
@@ -1378,9 +1378,9 @@ const ha = {
|
|
|
1378
1378
|
...r,
|
|
1379
1379
|
...d == null ? void 0 : d.normalizeFormula(r, e, t)
|
|
1380
1380
|
}
|
|
1381
|
-
}, { redoMutations: g, undoMutations: p } =
|
|
1381
|
+
}, { redoMutations: g, undoMutations: p } = Ue(e, t, u, o);
|
|
1382
1382
|
return g.push({
|
|
1383
|
-
id:
|
|
1383
|
+
id: N.id,
|
|
1384
1384
|
params: c
|
|
1385
1385
|
}), p.unshift({
|
|
1386
1386
|
id: D.id,
|
|
@@ -1395,14 +1395,14 @@ const ha = {
|
|
|
1395
1395
|
undoMutations: p
|
|
1396
1396
|
}), De(g, s), !0;
|
|
1397
1397
|
}
|
|
1398
|
-
},
|
|
1398
|
+
}, _a = {
|
|
1399
1399
|
type: z.COMMAND,
|
|
1400
1400
|
id: "sheets.command.update-data-validation-setting",
|
|
1401
1401
|
// eslint-disable-next-line max-lines-per-function
|
|
1402
1402
|
handler(o, a) {
|
|
1403
1403
|
if (!a)
|
|
1404
1404
|
return !1;
|
|
1405
|
-
const e = o.get(
|
|
1405
|
+
const e = o.get(U), t = o.get(Z), r = o.get(F), i = o.get(q), { unitId: s, subUnitId: n, ruleId: l, setting: u } = a, d = i.getValidatorItem(u.type);
|
|
1406
1406
|
if (!d)
|
|
1407
1407
|
return !1;
|
|
1408
1408
|
const c = r.getRuleById(s, n, l);
|
|
@@ -1438,22 +1438,22 @@ const ha = {
|
|
|
1438
1438
|
params: R
|
|
1439
1439
|
}];
|
|
1440
1440
|
if (u.type === T.CHECKBOX) {
|
|
1441
|
-
const
|
|
1442
|
-
if (
|
|
1443
|
-
const k = new Se(), { worksheet: x } =
|
|
1444
|
-
let
|
|
1445
|
-
if (
|
|
1446
|
-
|
|
1447
|
-
const j = x.getCellRaw(ae, xe),
|
|
1448
|
-
(ft(j) ||
|
|
1441
|
+
const I = c.ranges, $ = o.get(w), B = ze($, { unitId: s, subUnitId: n });
|
|
1442
|
+
if (B) {
|
|
1443
|
+
const k = new Se(), { worksheet: x } = B, { formula2: J = Ve, formula1: ce = Ee } = c, { formula2: he = Ve, formula1: me = Ee } = u;
|
|
1444
|
+
let Be = !1;
|
|
1445
|
+
if (I.forEach((ge) => {
|
|
1446
|
+
L.foreach(ge, (ae, xe) => {
|
|
1447
|
+
const j = x.getCellRaw(ae, xe), Je = _t(j);
|
|
1448
|
+
(ft(j) || Je === String(J)) && !(j != null && j.p) ? (k.setValue(ae, xe, {
|
|
1449
1449
|
v: he,
|
|
1450
1450
|
p: null
|
|
1451
|
-
}),
|
|
1451
|
+
}), Be = !0) : Je === String(ce) && !(j != null && j.p) && (k.setValue(ae, xe, {
|
|
1452
1452
|
v: me,
|
|
1453
1453
|
p: null
|
|
1454
|
-
}),
|
|
1454
|
+
}), Be = !0);
|
|
1455
1455
|
});
|
|
1456
|
-
}),
|
|
1456
|
+
}), Be) {
|
|
1457
1457
|
const ge = {
|
|
1458
1458
|
id: se.id,
|
|
1459
1459
|
params: {
|
|
@@ -1475,13 +1475,13 @@ const ha = {
|
|
|
1475
1475
|
undoMutations: V
|
|
1476
1476
|
}), !0) : !1;
|
|
1477
1477
|
}
|
|
1478
|
-
},
|
|
1478
|
+
}, pa = {
|
|
1479
1479
|
type: z.COMMAND,
|
|
1480
1480
|
id: "sheets.command.update-data-validation-options",
|
|
1481
1481
|
handler(o, a) {
|
|
1482
1482
|
if (!a)
|
|
1483
1483
|
return !1;
|
|
1484
|
-
const e = o.get(
|
|
1484
|
+
const e = o.get(U), t = o.get(Z), r = o.get(F), { unitId: i, subUnitId: s, ruleId: n, options: l } = a, u = r.getRuleById(i, s, n);
|
|
1485
1485
|
if (!u)
|
|
1486
1486
|
return !1;
|
|
1487
1487
|
const d = {
|
|
@@ -1501,7 +1501,7 @@ const ha = {
|
|
|
1501
1501
|
ruleId: n,
|
|
1502
1502
|
payload: {
|
|
1503
1503
|
type: M.OPTIONS,
|
|
1504
|
-
payload:
|
|
1504
|
+
payload: Ut(u)
|
|
1505
1505
|
}
|
|
1506
1506
|
}, p = [{
|
|
1507
1507
|
id: y.id,
|
|
@@ -1513,30 +1513,30 @@ const ha = {
|
|
|
1513
1513
|
undoMutations: p
|
|
1514
1514
|
}), e.executeCommand(y.id, d), !0;
|
|
1515
1515
|
}
|
|
1516
|
-
},
|
|
1516
|
+
}, fa = {
|
|
1517
1517
|
type: z.COMMAND,
|
|
1518
1518
|
id: "sheets.command.clear-range-data-validation",
|
|
1519
1519
|
handler(o, a) {
|
|
1520
1520
|
if (!a)
|
|
1521
1521
|
return !1;
|
|
1522
|
-
const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(
|
|
1522
|
+
const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(U), s = o.get(w), n = ze(s, { unitId: e, subUnitId: t }), l = o.get(F);
|
|
1523
1523
|
if (!n) return !1;
|
|
1524
1524
|
const u = o.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
|
|
1525
1525
|
d.removeRange(r);
|
|
1526
|
-
const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: p } =
|
|
1526
|
+
const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: p } = Ue(e, t, c, o);
|
|
1527
1527
|
return u.pushUndoRedo({
|
|
1528
1528
|
unitID: e,
|
|
1529
1529
|
redoMutations: g,
|
|
1530
1530
|
undoMutations: p
|
|
1531
1531
|
}), De(g, i).result;
|
|
1532
1532
|
}
|
|
1533
|
-
},
|
|
1533
|
+
}, Ra = {
|
|
1534
1534
|
type: z.COMMAND,
|
|
1535
1535
|
id: "sheet.command.remove-all-data-validation",
|
|
1536
1536
|
handler(o, a) {
|
|
1537
1537
|
if (!a)
|
|
1538
1538
|
return !1;
|
|
1539
|
-
const { unitId: e, subUnitId: t } = a, r = o.get(
|
|
1539
|
+
const { unitId: e, subUnitId: t } = a, r = o.get(U), i = o.get(F), s = o.get(Z), n = [...i.getRules(e, t)], l = {
|
|
1540
1540
|
unitId: e,
|
|
1541
1541
|
subUnitId: t,
|
|
1542
1542
|
ruleId: n.map((c) => c.uid)
|
|
@@ -1544,7 +1544,7 @@ const ha = {
|
|
|
1544
1544
|
id: D.id,
|
|
1545
1545
|
params: l
|
|
1546
1546
|
}], d = [{
|
|
1547
|
-
id:
|
|
1547
|
+
id: N.id,
|
|
1548
1548
|
params: {
|
|
1549
1549
|
unitId: e,
|
|
1550
1550
|
subUnitId: t,
|
|
@@ -1557,12 +1557,12 @@ const ha = {
|
|
|
1557
1557
|
unitID: e
|
|
1558
1558
|
}), r.executeCommand(D.id, l), !0;
|
|
1559
1559
|
}
|
|
1560
|
-
},
|
|
1560
|
+
}, va = (o, a) => {
|
|
1561
1561
|
const e = o.get(F), { unitId: t, subUnitId: r, ruleId: i, source: s } = a;
|
|
1562
1562
|
if (Array.isArray(i)) {
|
|
1563
1563
|
const l = i.map((u) => e.getRuleById(t, r, u)).filter(Boolean);
|
|
1564
1564
|
return [{
|
|
1565
|
-
id:
|
|
1565
|
+
id: N.id,
|
|
1566
1566
|
params: {
|
|
1567
1567
|
unitId: t,
|
|
1568
1568
|
subUnitId: r,
|
|
@@ -1572,7 +1572,7 @@ const ha = {
|
|
|
1572
1572
|
}];
|
|
1573
1573
|
}
|
|
1574
1574
|
return [{
|
|
1575
|
-
id:
|
|
1575
|
+
id: N.id,
|
|
1576
1576
|
params: {
|
|
1577
1577
|
unitId: t,
|
|
1578
1578
|
subUnitId: r,
|
|
@@ -1582,17 +1582,17 @@ const ha = {
|
|
|
1582
1582
|
index: e.getRuleIndex(t, r, i)
|
|
1583
1583
|
}
|
|
1584
1584
|
}];
|
|
1585
|
-
},
|
|
1585
|
+
}, Sa = {
|
|
1586
1586
|
type: z.COMMAND,
|
|
1587
1587
|
id: "sheet.command.remove-data-validation-rule",
|
|
1588
1588
|
handler(o, a) {
|
|
1589
1589
|
if (!a)
|
|
1590
1590
|
return !1;
|
|
1591
|
-
const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(
|
|
1591
|
+
const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(U), s = o.get(Z), n = o.get(F), l = [{
|
|
1592
1592
|
id: D.id,
|
|
1593
1593
|
params: a
|
|
1594
1594
|
}], u = [{
|
|
1595
|
-
id:
|
|
1595
|
+
id: N.id,
|
|
1596
1596
|
params: {
|
|
1597
1597
|
unitId: e,
|
|
1598
1598
|
subUnitId: t,
|
|
@@ -1608,9 +1608,9 @@ const ha = {
|
|
|
1608
1608
|
unitID: a.unitId
|
|
1609
1609
|
}), i.executeCommand(D.id, a), !0;
|
|
1610
1610
|
}
|
|
1611
|
-
},
|
|
1612
|
-
var Rt = /* @__PURE__ */ ((o) => (o[o.View = 0] = "View", o[o.Edit = 1] = "Edit", o[o.ManageCollaborator = 2] = "ManageCollaborator", o[o.Print = 3] = "Print", o[o.Duplicate = 4] = "Duplicate", o[o.Comment = 5] = "Comment", o[o.Copy = 6] = "Copy", o[o.Share = 7] = "Share", o[o.Export = 8] = "Export", o[o.MoveWorksheet = 9] = "MoveWorksheet", o[o.DeleteWorksheet = 10] = "DeleteWorksheet", o[o.HideWorksheet = 11] = "HideWorksheet", o[o.RenameWorksheet = 12] = "RenameWorksheet", o[o.CreateWorksheet = 13] = "CreateWorksheet", o[o.SetWorksheetStyle = 14] = "SetWorksheetStyle", o[o.EditWorksheetCell = 15] = "EditWorksheetCell", o[o.InsertHyperlink = 16] = "InsertHyperlink", o[o.Sort = 17] = "Sort", o[o.Filter = 18] = "Filter", o[o.PivotTable = 19] = "PivotTable", o[o.FloatImg = 20] = "FloatImg", o[o.History = 21] = "History", o[o.RwHgtClWdt = 22] = "RwHgtClWdt", o[o.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", o[o.ViewFilter = 24] = "ViewFilter", o[o.MoveSheet = 25] = "MoveSheet", o[o.DeleteSheet = 26] = "DeleteSheet", o[o.HideSheet = 27] = "HideSheet", o[o.CopySheet = 28] = "CopySheet", o[o.RenameSheet = 29] = "RenameSheet", o[o.CreateSheet = 30] = "CreateSheet", o[o.SelectProtectedCells = 31] = "SelectProtectedCells", o[o.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", o[o.SetCellStyle = 33] = "SetCellStyle", o[o.SetCellValue = 34] = "SetCellValue", o[o.SetRowStyle = 35] = "SetRowStyle", o[o.SetColumnStyle = 36] = "SetColumnStyle", o[o.InsertRow = 37] = "InsertRow", o[o.InsertColumn = 38] = "InsertColumn", o[o.DeleteRow = 39] = "DeleteRow", o[o.DeleteColumn = 40] = "DeleteColumn", o[o.EditExtraObject = 41] = "EditExtraObject", o[o.Delete = 42] = "Delete", o[o.RecoverHistory = 43] = "RecoverHistory", o[o.ViewHistory = 44] = "ViewHistory", o[o.CreatePermissionObject = 45] = "CreatePermissionObject", o[o.UNRECOGNIZED = -1] = "UNRECOGNIZED", o))(Rt || {}),
|
|
1613
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1611
|
+
}, Ea = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
1612
|
+
var Rt = /* @__PURE__ */ ((o) => (o[o.View = 0] = "View", o[o.Edit = 1] = "Edit", o[o.ManageCollaborator = 2] = "ManageCollaborator", o[o.Print = 3] = "Print", o[o.Duplicate = 4] = "Duplicate", o[o.Comment = 5] = "Comment", o[o.Copy = 6] = "Copy", o[o.Share = 7] = "Share", o[o.Export = 8] = "Export", o[o.MoveWorksheet = 9] = "MoveWorksheet", o[o.DeleteWorksheet = 10] = "DeleteWorksheet", o[o.HideWorksheet = 11] = "HideWorksheet", o[o.RenameWorksheet = 12] = "RenameWorksheet", o[o.CreateWorksheet = 13] = "CreateWorksheet", o[o.SetWorksheetStyle = 14] = "SetWorksheetStyle", o[o.EditWorksheetCell = 15] = "EditWorksheetCell", o[o.InsertHyperlink = 16] = "InsertHyperlink", o[o.Sort = 17] = "Sort", o[o.Filter = 18] = "Filter", o[o.PivotTable = 19] = "PivotTable", o[o.FloatImg = 20] = "FloatImg", o[o.History = 21] = "History", o[o.RwHgtClWdt = 22] = "RwHgtClWdt", o[o.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", o[o.ViewFilter = 24] = "ViewFilter", o[o.MoveSheet = 25] = "MoveSheet", o[o.DeleteSheet = 26] = "DeleteSheet", o[o.HideSheet = 27] = "HideSheet", o[o.CopySheet = 28] = "CopySheet", o[o.RenameSheet = 29] = "RenameSheet", o[o.CreateSheet = 30] = "CreateSheet", o[o.SelectProtectedCells = 31] = "SelectProtectedCells", o[o.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", o[o.SetCellStyle = 33] = "SetCellStyle", o[o.SetCellValue = 34] = "SetCellValue", o[o.SetRowStyle = 35] = "SetRowStyle", o[o.SetColumnStyle = 36] = "SetColumnStyle", o[o.InsertRow = 37] = "InsertRow", o[o.InsertColumn = 38] = "InsertColumn", o[o.DeleteRow = 39] = "DeleteRow", o[o.DeleteColumn = 40] = "DeleteColumn", o[o.EditExtraObject = 41] = "EditExtraObject", o[o.Delete = 42] = "Delete", o[o.RecoverHistory = 43] = "RecoverHistory", o[o.ViewHistory = 44] = "ViewHistory", o[o.CreatePermissionObject = 45] = "CreatePermissionObject", o[o.UNRECOGNIZED = -1] = "UNRECOGNIZED", o))(Rt || {}), Va = Object.getOwnPropertyDescriptor, Ma = (o, a, e, t) => {
|
|
1613
|
+
for (var r = t > 1 ? void 0 : t ? Va(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1614
1614
|
(s = o[i]) && (r = s(r) || r);
|
|
1615
1615
|
return r;
|
|
1616
1616
|
}, ke = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -1649,14 +1649,14 @@ let Te = class extends W {
|
|
|
1649
1649
|
return !0;
|
|
1650
1650
|
}
|
|
1651
1651
|
};
|
|
1652
|
-
Te =
|
|
1652
|
+
Te = Ma([
|
|
1653
1653
|
ke(0, w),
|
|
1654
1654
|
ke(1, Tt),
|
|
1655
1655
|
ke(2, v(Y))
|
|
1656
1656
|
], Te);
|
|
1657
|
-
const
|
|
1658
|
-
var
|
|
1659
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1657
|
+
const ya = "sheets-data-validation.config", it = {};
|
|
1658
|
+
var Ta = Object.getOwnPropertyDescriptor, Fa = (o, a, e, t) => {
|
|
1659
|
+
for (var r = t > 1 ? void 0 : t ? Ta(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1660
1660
|
(s = o[i]) && (r = s(r) || r);
|
|
1661
1661
|
return r;
|
|
1662
1662
|
}, je = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -1678,7 +1678,7 @@ let Fe = class extends W {
|
|
|
1678
1678
|
if (u.length === 0)
|
|
1679
1679
|
return {
|
|
1680
1680
|
undos: [{
|
|
1681
|
-
id:
|
|
1681
|
+
id: N.id,
|
|
1682
1682
|
params: {
|
|
1683
1683
|
unitId: a,
|
|
1684
1684
|
subUnitId: e,
|
|
@@ -1731,9 +1731,9 @@ let Fe = class extends W {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
});
|
|
1733
1733
|
for (let p = 1; p < u.length; p++) {
|
|
1734
|
-
const _ = u[p], R =
|
|
1734
|
+
const _ = u[p], R = Ye();
|
|
1735
1735
|
d.push({
|
|
1736
|
-
id:
|
|
1736
|
+
id: N.id,
|
|
1737
1737
|
params: {
|
|
1738
1738
|
unitId: a,
|
|
1739
1739
|
subUnitId: e,
|
|
@@ -1790,20 +1790,20 @@ let Fe = class extends W {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
1792
|
})
|
|
1793
|
-
), this.disposeWithMe(
|
|
1793
|
+
), this.disposeWithMe(Xe(() => {
|
|
1794
1794
|
this._disposableMap.forEach((e) => {
|
|
1795
1795
|
e.dispose();
|
|
1796
1796
|
}), this._disposableMap.clear();
|
|
1797
1797
|
}));
|
|
1798
1798
|
}
|
|
1799
1799
|
};
|
|
1800
|
-
Fe =
|
|
1800
|
+
Fe = Fa([
|
|
1801
1801
|
je(0, v(F)),
|
|
1802
1802
|
je(1, v(gt)),
|
|
1803
1803
|
je(2, v(q))
|
|
1804
1804
|
], Fe);
|
|
1805
|
-
var
|
|
1806
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1805
|
+
var Ca = Object.getOwnPropertyDescriptor, Oa = (o, a, e, t) => {
|
|
1806
|
+
for (var r = t > 1 ? void 0 : t ? Ca(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1807
1807
|
(s = o[i]) && (r = s(r) || r);
|
|
1808
1808
|
return r;
|
|
1809
1809
|
}, ee = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -1895,7 +1895,7 @@ let Ce = class extends W {
|
|
|
1895
1895
|
var l;
|
|
1896
1896
|
const r = (u) => {
|
|
1897
1897
|
const d = [...t.ranges], g = d.map((_) => Qt(_, u)).filter((_) => !!_).flat();
|
|
1898
|
-
if (
|
|
1898
|
+
if (nt(g, d))
|
|
1899
1899
|
return { redos: [], undos: [] };
|
|
1900
1900
|
if (g.length) {
|
|
1901
1901
|
const _ = {
|
|
@@ -1922,7 +1922,7 @@ let Ce = class extends W {
|
|
|
1922
1922
|
}];
|
|
1923
1923
|
return { redos: R, undos: V };
|
|
1924
1924
|
} else {
|
|
1925
|
-
const _ = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: D.id, params: _ }], V =
|
|
1925
|
+
const _ = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: D.id, params: _ }], V = va(this._injector, _);
|
|
1926
1926
|
return { redos: R, undos: V };
|
|
1927
1927
|
}
|
|
1928
1928
|
}, i = [];
|
|
@@ -1960,23 +1960,23 @@ let Ce = class extends W {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
}
|
|
1962
1962
|
})
|
|
1963
|
-
), this.disposeWithMe(
|
|
1963
|
+
), this.disposeWithMe(Xe(() => {
|
|
1964
1964
|
this._disposableMap.forEach((e) => {
|
|
1965
1965
|
e.forEach((t) => t());
|
|
1966
1966
|
}), this._disposableMap.clear();
|
|
1967
1967
|
}));
|
|
1968
1968
|
}
|
|
1969
1969
|
};
|
|
1970
|
-
Ce =
|
|
1970
|
+
Ce = Oa([
|
|
1971
1971
|
ee(0, v(F)),
|
|
1972
|
-
ee(1, v(
|
|
1972
|
+
ee(1, v(Ke)),
|
|
1973
1973
|
ee(2, v(jt)),
|
|
1974
1974
|
ee(3, v(K)),
|
|
1975
1975
|
ee(4, v(gt)),
|
|
1976
1976
|
ee(5, v(q))
|
|
1977
1977
|
], Ce);
|
|
1978
|
-
var
|
|
1979
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1978
|
+
var wa = Object.getOwnPropertyDescriptor, Ia = (o, a, e, t) => {
|
|
1979
|
+
for (var r = t > 1 ? void 0 : t ? wa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1980
1980
|
(s = o[i]) && (r = s(r) || r);
|
|
1981
1981
|
return r;
|
|
1982
1982
|
}, Qe = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -1984,9 +1984,11 @@ let Oe = class extends W {
|
|
|
1984
1984
|
constructor(o, a, e) {
|
|
1985
1985
|
super(), this._sheetInterceptorService = o, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
|
|
1986
1986
|
}
|
|
1987
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1987
1988
|
_initSheetChange() {
|
|
1988
1989
|
this.disposeWithMe(
|
|
1989
1990
|
this._sheetInterceptorService.interceptCommand({
|
|
1991
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1990
1992
|
getMutations: (o) => {
|
|
1991
1993
|
var a;
|
|
1992
1994
|
if (o.id === qt.id) {
|
|
@@ -2016,10 +2018,42 @@ let Oe = class extends W {
|
|
|
2016
2018
|
params: l
|
|
2017
2019
|
}],
|
|
2018
2020
|
undos: [{
|
|
2019
|
-
id:
|
|
2021
|
+
id: N.id,
|
|
2020
2022
|
params: u
|
|
2021
2023
|
}]
|
|
2022
2024
|
};
|
|
2025
|
+
} else if (o.id === Gt.id) {
|
|
2026
|
+
const e = o.params, { unitId: t, subUnitId: r, targetSubUnitId: i } = e;
|
|
2027
|
+
if (!t || !r || !i)
|
|
2028
|
+
return { redos: [], undos: [] };
|
|
2029
|
+
const s = this._sheetDataValidationModel.getRules(t, r);
|
|
2030
|
+
if (s.length === 0)
|
|
2031
|
+
return { redos: [], undos: [] };
|
|
2032
|
+
const n = s.map((l) => ({ ...l, uid: Ye(6) }));
|
|
2033
|
+
return {
|
|
2034
|
+
redos: [
|
|
2035
|
+
{
|
|
2036
|
+
id: N.id,
|
|
2037
|
+
params: {
|
|
2038
|
+
unitId: t,
|
|
2039
|
+
subUnitId: i,
|
|
2040
|
+
rule: n,
|
|
2041
|
+
source: "patched"
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
],
|
|
2045
|
+
undos: [
|
|
2046
|
+
{
|
|
2047
|
+
id: D.id,
|
|
2048
|
+
params: {
|
|
2049
|
+
unitId: t,
|
|
2050
|
+
subUnitId: i,
|
|
2051
|
+
ruleId: n.map((l) => l.uid),
|
|
2052
|
+
source: "patched"
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
]
|
|
2056
|
+
};
|
|
2023
2057
|
}
|
|
2024
2058
|
return { redos: [], undos: [] };
|
|
2025
2059
|
}
|
|
@@ -2027,7 +2061,7 @@ let Oe = class extends W {
|
|
|
2027
2061
|
);
|
|
2028
2062
|
}
|
|
2029
2063
|
};
|
|
2030
|
-
Oe =
|
|
2064
|
+
Oe = Ia([
|
|
2031
2065
|
Qe(0, v(ct)),
|
|
2032
2066
|
Qe(1, v(w)),
|
|
2033
2067
|
Qe(2, v(F))
|
|
@@ -2061,7 +2095,7 @@ class Aa extends G {
|
|
|
2061
2095
|
return this.localeService.t("dataValidation.any.error");
|
|
2062
2096
|
}
|
|
2063
2097
|
}
|
|
2064
|
-
class
|
|
2098
|
+
class Da extends G {
|
|
2065
2099
|
constructor() {
|
|
2066
2100
|
super(...arguments);
|
|
2067
2101
|
m(this, "id", T.CUSTOM);
|
|
@@ -2099,7 +2133,7 @@ class Ia extends G {
|
|
|
2099
2133
|
return this.localeService.t("dataValidation.custom.ruleName").replace("{FORMULA1}", (t = e.formula1) != null ? t : "");
|
|
2100
2134
|
}
|
|
2101
2135
|
}
|
|
2102
|
-
class
|
|
2136
|
+
class Na extends pt {
|
|
2103
2137
|
constructor() {
|
|
2104
2138
|
super(...arguments);
|
|
2105
2139
|
m(this, "id", T.LIST_MULTIPLE);
|
|
@@ -2108,7 +2142,7 @@ class Da extends pt {
|
|
|
2108
2142
|
m(this, "skipDefaultFontRender", () => !0);
|
|
2109
2143
|
}
|
|
2110
2144
|
}
|
|
2111
|
-
class
|
|
2145
|
+
class ba extends G {
|
|
2112
2146
|
constructor() {
|
|
2113
2147
|
super(...arguments);
|
|
2114
2148
|
m(this, "_customFormulaService", this.injector.get(H));
|
|
@@ -2176,8 +2210,8 @@ class Na extends G {
|
|
|
2176
2210
|
return `${this.localeService.t(Me[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
2177
2211
|
}
|
|
2178
2212
|
}
|
|
2179
|
-
var
|
|
2180
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2213
|
+
var La = Object.getOwnPropertyDescriptor, Ua = (o, a, e, t) => {
|
|
2214
|
+
for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2181
2215
|
(s = o[i]) && (r = s(r) || r);
|
|
2182
2216
|
return r;
|
|
2183
2217
|
}, te = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -2191,30 +2225,30 @@ let we = class extends Ct {
|
|
|
2191
2225
|
_registerValidators() {
|
|
2192
2226
|
[
|
|
2193
2227
|
Aa,
|
|
2228
|
+
la,
|
|
2229
|
+
ba,
|
|
2230
|
+
ha,
|
|
2194
2231
|
na,
|
|
2195
|
-
|
|
2196
|
-
ca,
|
|
2197
|
-
sa,
|
|
2198
|
-
ra,
|
|
2232
|
+
ia,
|
|
2199
2233
|
pt,
|
|
2200
|
-
|
|
2201
|
-
|
|
2234
|
+
Na,
|
|
2235
|
+
Da
|
|
2202
2236
|
].forEach((o) => {
|
|
2203
2237
|
const a = this._injector.createInstance(o);
|
|
2204
|
-
this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(
|
|
2238
|
+
this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(Xe(() => this._injector.delete(o)));
|
|
2205
2239
|
});
|
|
2206
2240
|
}
|
|
2207
2241
|
_initCommandInterceptor() {
|
|
2208
2242
|
this._sheetInterceptorService.interceptCommand({
|
|
2209
2243
|
getMutations: (o) => {
|
|
2210
2244
|
var a;
|
|
2211
|
-
if (o.id ===
|
|
2245
|
+
if (o.id === Yt.id) {
|
|
2212
2246
|
const e = this._univerInstanceService.getCurrentUnitForType(C.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
|
|
2213
2247
|
if (!r)
|
|
2214
2248
|
throw new Error("No active sheet found");
|
|
2215
2249
|
const i = r.getSheetId(), s = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
|
|
2216
2250
|
s && n.removeRange(s);
|
|
2217
|
-
const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } =
|
|
2251
|
+
const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = Ue(t, i, l, this._injector, "patched");
|
|
2218
2252
|
return {
|
|
2219
2253
|
undos: d,
|
|
2220
2254
|
redos: u
|
|
@@ -2228,20 +2262,20 @@ let we = class extends Ct {
|
|
|
2228
2262
|
});
|
|
2229
2263
|
}
|
|
2230
2264
|
};
|
|
2231
|
-
we =
|
|
2265
|
+
we = Ua([
|
|
2232
2266
|
te(0, w),
|
|
2233
2267
|
te(1, v(q)),
|
|
2234
|
-
te(2, v(
|
|
2268
|
+
te(2, v(Ke)),
|
|
2235
2269
|
te(3, v(ht)),
|
|
2236
2270
|
te(4, v(ct)),
|
|
2237
2271
|
te(5, v(F))
|
|
2238
2272
|
], we);
|
|
2239
|
-
var Ba = Object.getOwnPropertyDescriptor,
|
|
2273
|
+
var Ba = Object.getOwnPropertyDescriptor, xa = (o, a, e, t) => {
|
|
2240
2274
|
for (var r = t > 1 ? void 0 : t ? Ba(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2241
2275
|
(s = o[i]) && (r = s(r) || r);
|
|
2242
2276
|
return r;
|
|
2243
2277
|
}, Re = (o, a) => (e, t) => a(e, t, o);
|
|
2244
|
-
let
|
|
2278
|
+
let Ie = class extends W {
|
|
2245
2279
|
constructor(o, a, e, t) {
|
|
2246
2280
|
super(), this._univerInstanceService = o, this._sheetDataValidationModel = a, this._dataValidationCacheService = e, this._lifecycleService = t, this._initRecalculate();
|
|
2247
2281
|
}
|
|
@@ -2253,7 +2287,7 @@ let Ae = class extends W {
|
|
|
2253
2287
|
a.flat().forEach((i) => {
|
|
2254
2288
|
r[i.unitId] || (r[i.unitId] = {}), r[i.unitId][i.subUnitId] || (r[i.unitId][i.subUnitId] = []);
|
|
2255
2289
|
const s = this._univerInstanceService.getUnit(i.unitId, C.UNIVER_SHEET), n = s == null ? void 0 : s.getSheetBySheetId(i.subUnitId);
|
|
2256
|
-
n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) =>
|
|
2290
|
+
n && r[i.unitId][i.subUnitId].push(...i.ranges.map((l) => L.transformRange(l, n)));
|
|
2257
2291
|
}), Object.entries(r).forEach(([i, s]) => {
|
|
2258
2292
|
Object.entries(s).forEach(([n, l]) => {
|
|
2259
2293
|
(e == null ? void 0 : e.getUnitId()) === i && (t == null ? void 0 : t.getSheetId()) === n ? this.validatorRanges(i, n, l) : requestIdleCallback(() => {
|
|
@@ -2262,7 +2296,7 @@ let Ae = class extends W {
|
|
|
2262
2296
|
});
|
|
2263
2297
|
});
|
|
2264
2298
|
};
|
|
2265
|
-
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(
|
|
2299
|
+
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Xt(() => this._lifecycleService.lifecycle$.pipe(tt((a) => a === et.Rendered)))).subscribe(o)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(tt(() => this._lifecycleService.stage >= et.Rendered), wt(20)).subscribe(o));
|
|
2266
2300
|
}
|
|
2267
2301
|
async _validatorByCell(o, a, e, t) {
|
|
2268
2302
|
const r = o.getUnitId(), i = a.getSheetId();
|
|
@@ -2273,7 +2307,7 @@ let Ae = class extends W {
|
|
|
2273
2307
|
this._sheetDataValidationModel.validator(s, { unitId: r, subUnitId: i, row: e, col: t, worksheet: a, workbook: o }, (l) => {
|
|
2274
2308
|
n(l);
|
|
2275
2309
|
});
|
|
2276
|
-
}) :
|
|
2310
|
+
}) : b.VALID;
|
|
2277
2311
|
}
|
|
2278
2312
|
async validatorCell(o, a, e, t) {
|
|
2279
2313
|
const r = this._univerInstanceService.getUnit(o, C.UNIVER_SHEET);
|
|
@@ -2293,10 +2327,10 @@ let Ae = class extends W {
|
|
|
2293
2327
|
const r = t.getSheetBySheetId(a);
|
|
2294
2328
|
if (!r)
|
|
2295
2329
|
throw new Error(`cannot find current worksheet, sheetId: ${a}`);
|
|
2296
|
-
const s = this._sheetDataValidationModel.getRules(o, a).map((l) => l.ranges).flat(), n = e.map((l) => s.map((u) =>
|
|
2330
|
+
const s = this._sheetDataValidationModel.getRules(o, a).map((l) => l.ranges).flat(), n = e.map((l) => s.map((u) => ot(l, u))).flat().filter(Boolean);
|
|
2297
2331
|
return Promise.all(n.map((l) => {
|
|
2298
2332
|
const u = [];
|
|
2299
|
-
return
|
|
2333
|
+
return L.foreach(l, (d, c) => {
|
|
2300
2334
|
u.push(this._validatorByCell(t, r, d, c));
|
|
2301
2335
|
}), Promise.all(u);
|
|
2302
2336
|
}));
|
|
@@ -2313,7 +2347,7 @@ let Ae = class extends W {
|
|
|
2313
2347
|
r.map((i) => Promise.all(
|
|
2314
2348
|
i.ranges.map((s) => {
|
|
2315
2349
|
const n = [];
|
|
2316
|
-
return
|
|
2350
|
+
return L.foreach(s, (l, u) => {
|
|
2317
2351
|
n.push(this._validatorByCell(e, t, l, u));
|
|
2318
2352
|
}), Promise.all(n);
|
|
2319
2353
|
})
|
|
@@ -2329,7 +2363,7 @@ let Ae = class extends W {
|
|
|
2329
2363
|
getDataValidations(o, a, e) {
|
|
2330
2364
|
const t = this._sheetDataValidationModel.getRuleObjectMatrix(o, a), r = /* @__PURE__ */ new Set();
|
|
2331
2365
|
return e.forEach((s) => {
|
|
2332
|
-
|
|
2366
|
+
L.foreach(s, (n, l) => {
|
|
2333
2367
|
const u = t.getValue(n, l);
|
|
2334
2368
|
u && r.add(u);
|
|
2335
2369
|
});
|
|
@@ -2339,33 +2373,33 @@ let Ae = class extends W {
|
|
|
2339
2373
|
return this.getDataValidations(o, a, e)[0];
|
|
2340
2374
|
}
|
|
2341
2375
|
};
|
|
2342
|
-
|
|
2376
|
+
Ie = xa([
|
|
2343
2377
|
Re(0, w),
|
|
2344
2378
|
Re(1, v(F)),
|
|
2345
2379
|
Re(2, v(Q)),
|
|
2346
2380
|
Re(3, v(Ot))
|
|
2347
|
-
],
|
|
2348
|
-
var
|
|
2349
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2381
|
+
], Ie);
|
|
2382
|
+
var Pa = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Wa = (o, a, e) => a in o ? Pa(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e, $a = (o, a, e, t) => {
|
|
2383
|
+
for (var r = t > 1 ? void 0 : t ? Ha(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2350
2384
|
(s = o[i]) && (r = s(r) || r);
|
|
2351
2385
|
return r;
|
|
2352
|
-
}, qe = (o, a) => (e, t) => a(e, t, o), vt = (o, a, e) =>
|
|
2353
|
-
let
|
|
2354
|
-
constructor(o =
|
|
2386
|
+
}, qe = (o, a) => (e, t) => a(e, t, o), vt = (o, a, e) => Wa(o, typeof a != "symbol" ? a + "" : a, e);
|
|
2387
|
+
let Ae = class extends Dt {
|
|
2388
|
+
constructor(o = it, a, e, t) {
|
|
2355
2389
|
super(), this._config = o, this._injector = a, this._commandService = e, this._configService = t;
|
|
2356
2390
|
const { ...r } = Nt(
|
|
2357
2391
|
{},
|
|
2358
|
-
|
|
2392
|
+
it,
|
|
2359
2393
|
this._config
|
|
2360
2394
|
);
|
|
2361
|
-
this._configService.setConfig(
|
|
2395
|
+
this._configService.setConfig(ya, r);
|
|
2362
2396
|
}
|
|
2363
2397
|
onStarting() {
|
|
2364
2398
|
[
|
|
2365
2399
|
[Q],
|
|
2366
2400
|
[K],
|
|
2367
2401
|
[H],
|
|
2368
|
-
[
|
|
2402
|
+
[Ie],
|
|
2369
2403
|
[F],
|
|
2370
2404
|
[we],
|
|
2371
2405
|
[Te],
|
|
@@ -2375,16 +2409,16 @@ let Ie = class extends Dt {
|
|
|
2375
2409
|
].forEach((o) => {
|
|
2376
2410
|
this._injector.add(o);
|
|
2377
2411
|
}), [
|
|
2378
|
-
ma,
|
|
2379
|
-
ha,
|
|
2380
2412
|
ga,
|
|
2413
|
+
ma,
|
|
2381
2414
|
_a,
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2415
|
+
pa,
|
|
2416
|
+
Sa,
|
|
2417
|
+
Ra,
|
|
2418
|
+
fa
|
|
2385
2419
|
].forEach((o) => {
|
|
2386
2420
|
this._commandService.registerCommand(o);
|
|
2387
|
-
}), this._injector.get(Q), this._injector.get(
|
|
2421
|
+
}), this._injector.get(Q), this._injector.get(Ie), this._injector.get(we), this._injector.get(Fe), this._injector.get(Ce);
|
|
2388
2422
|
}
|
|
2389
2423
|
onReady() {
|
|
2390
2424
|
this._injector.get(Oe);
|
|
@@ -2393,61 +2427,61 @@ let Ie = class extends Dt {
|
|
|
2393
2427
|
this._injector.get(Te);
|
|
2394
2428
|
}
|
|
2395
2429
|
};
|
|
2396
|
-
vt(
|
|
2397
|
-
vt(
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
qe(1, v(
|
|
2401
|
-
qe(2,
|
|
2402
|
-
qe(3,
|
|
2403
|
-
],
|
|
2404
|
-
function
|
|
2430
|
+
vt(Ae, "pluginName", Ea);
|
|
2431
|
+
vt(Ae, "type", C.UNIVER_SHEET);
|
|
2432
|
+
Ae = $a([
|
|
2433
|
+
It(Bt),
|
|
2434
|
+
qe(1, v(Ke)),
|
|
2435
|
+
qe(2, U),
|
|
2436
|
+
qe(3, At)
|
|
2437
|
+
], Ae);
|
|
2438
|
+
function Za(o) {
|
|
2405
2439
|
const e = o.get(ht).getCurrentSelections().map((i) => i.range);
|
|
2406
2440
|
return {
|
|
2407
|
-
uid:
|
|
2441
|
+
uid: Ye(6),
|
|
2408
2442
|
type: T.DECIMAL,
|
|
2409
2443
|
operator: h.EQUAL,
|
|
2410
2444
|
formula1: "100",
|
|
2411
2445
|
ranges: e != null ? e : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
|
|
2412
2446
|
};
|
|
2413
2447
|
}
|
|
2414
|
-
const
|
|
2448
|
+
const Ja = "data-validation.custom-formula-input", er = "data-validation.formula-input", tr = "data-validation.list-formula-input", ar = "data-validation.checkbox-formula-input";
|
|
2415
2449
|
export {
|
|
2416
|
-
|
|
2417
|
-
|
|
2450
|
+
ga as AddSheetDataValidationCommand,
|
|
2451
|
+
er as BASE_FORMULA_INPUT_NAME,
|
|
2418
2452
|
Ee as CHECKBOX_FORMULA_1,
|
|
2419
2453
|
Ve as CHECKBOX_FORMULA_2,
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2454
|
+
ar as CHECKBOX_FORMULA_INPUT_NAME,
|
|
2455
|
+
Ja as CUSTOM_FORMULA_INPUT_NAME,
|
|
2456
|
+
ia as CheckboxValidator,
|
|
2457
|
+
fa as ClearRangeDataValidationCommand,
|
|
2458
|
+
Ea as DATA_VALIDATION_PLUGIN_NAME,
|
|
2425
2459
|
Q as DataValidationCacheService,
|
|
2426
2460
|
H as DataValidationCustomFormulaService,
|
|
2427
2461
|
Te as DataValidationFormulaController,
|
|
2428
2462
|
K as DataValidationFormulaService,
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2463
|
+
na as DateValidator,
|
|
2464
|
+
tr as LIST_FORMULA_INPUT_NAME,
|
|
2465
|
+
Na as ListMultipleValidator,
|
|
2432
2466
|
pt as ListValidator,
|
|
2433
|
-
|
|
2434
|
-
|
|
2467
|
+
Ra as RemoveSheetAllDataValidationCommand,
|
|
2468
|
+
Sa as RemoveSheetDataValidationCommand,
|
|
2435
2469
|
F as SheetDataValidationModel,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2470
|
+
Ie as SheetsDataValidationValidatorService,
|
|
2471
|
+
Ae as UniverSheetsDataValidationPlugin,
|
|
2472
|
+
pa as UpdateSheetDataValidationOptionsCommand,
|
|
2473
|
+
ma as UpdateSheetDataValidationRangeCommand,
|
|
2474
|
+
_a as UpdateSheetDataValidationSettingCommand,
|
|
2475
|
+
Za as createDefaultNewRule,
|
|
2442
2476
|
fe as deserializeListOptions,
|
|
2443
2477
|
ye as getCellValueNumber,
|
|
2444
2478
|
ne as getCellValueOrigin,
|
|
2445
|
-
|
|
2446
|
-
|
|
2479
|
+
za as getDataValidationCellValue,
|
|
2480
|
+
Ue as getDataValidationDiffMutations,
|
|
2447
2481
|
_e as getFormulaCellData,
|
|
2448
2482
|
oe as getFormulaResult,
|
|
2449
2483
|
Le as getTransformedFormula,
|
|
2450
2484
|
O as isLegalFormulaResult,
|
|
2451
|
-
|
|
2485
|
+
Ka as serializeListOptions,
|
|
2452
2486
|
pe as transformCheckboxValue
|
|
2453
2487
|
};
|