@univerjs/sheets-data-validation 0.10.4-nightly.202508220605 → 0.10.4
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/LICENSE +176 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +208 -210
- package/lib/index.js +208 -210
- package/lib/types/services/dv-cache.service.d.ts +1 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/es/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
var Rt = Object.defineProperty;
|
|
2
2
|
var St = (o, a, e) => a in o ? Rt(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
|
|
3
3
|
var m = (o, a, e) => St(o, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
-
import { Inject as R, ICommandService as
|
|
5
|
-
import { DataValidationModel as
|
|
6
|
-
import { ERROR_TYPE_SET as
|
|
7
|
-
import { SetRangeValuesMutation as se, RemoveSheetMutation as lt, getSheetCommandTarget as
|
|
8
|
-
import { Subject as
|
|
4
|
+
import { Inject as R, ICommandService as U, IUniverInstanceService as w, Disposable as W, ObjectMatrix as Se, UniverInstanceType as C, Range as b, Rectangle as I, isFormulaString as S, DataValidationType as T, getOriginCellValue as Et, RBush as Vt, debounce as Mt, Tools as E, DataValidationStatus as N, WrapStrategy as Re, DataValidationOperator as h, numfmt as H, dayjs as it, DataValidationRenderMode as xe, CommandType as z, IUndoRedoService as Z, sequenceExecute as De, isRangesEqual as ot, IPermissionService as yt, generateRandomId as st, toDisposable as qe, Injector as Ge, CellValueType as Tt, RxDisposable as Ft, LifecycleService as Ct, LifecycleStages as Ze, bufferDebounceTime as Ot, DependentOn as wt, IConfigService as At, Plugin as It, merge as Dt } from "@univerjs/core";
|
|
5
|
+
import { DataValidationModel as Ye, DataValidatorRegistryService as q, UpdateRuleType as M, BaseDataValidator as G, TextLengthErrorTitleMap as Nt, AddDataValidationMutation as L, RemoveDataValidationMutation as D, UpdateDataValidationMutation as y, getRuleSetting as bt, getRuleOptions as Lt, UniverDataValidationPlugin as Ut } from "@univerjs/data-validation";
|
|
6
|
+
import { ERROR_TYPE_SET as Bt, LexerTreeBuilder as Y, isReferenceString as nt, sequenceNodeType as xt, deserializeRangeWithSheet as Ht, deserializeRangeWithSheetWithCache as Pt, operatorToken as Wt } from "@univerjs/engine-formula";
|
|
7
|
+
import { SetRangeValuesMutation as se, RemoveSheetMutation as lt, getSheetCommandTarget as Xe, SetRangeValuesUndoMutationFactory as ut, WorksheetViewPermission as $t, RefRangeService as kt, handleCommonDefaultRangeChangeWithEffectRefCommands as jt, SheetInterceptorService as dt, RemoveSheetCommand as Qt, SheetsSelectionsService as ct, ClearSelectionAllCommand as qt } from "@univerjs/sheets";
|
|
8
|
+
import { Subject as Qe, bufferWhen as Gt, filter as Je } from "rxjs";
|
|
9
9
|
import { RegisterOtherFormulaService as ht, FormulaRefRangeService as mt } from "@univerjs/sheets-formula";
|
|
10
|
-
var
|
|
11
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
10
|
+
var Yt = Object.getOwnPropertyDescriptor, Xt = (o, a, e, t) => {
|
|
11
|
+
for (var r = t > 1 ? void 0 : t ? Yt(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
|
+
}, et = (o, a) => (e, t) => a(e, t, o);
|
|
15
15
|
let Q = class extends W {
|
|
16
|
-
constructor(a, e
|
|
16
|
+
constructor(a, e) {
|
|
17
17
|
super();
|
|
18
18
|
m(this, "_cacheMatrix", /* @__PURE__ */ new Map());
|
|
19
|
-
m(this, "_dirtyRanges$", new
|
|
19
|
+
m(this, "_dirtyRanges$", new Qe());
|
|
20
20
|
m(this, "dirtyRanges$", this._dirtyRanges$.asObservable());
|
|
21
|
-
this._commandService = a, this._univerInstanceService = e, this.
|
|
21
|
+
this._commandService = a, this._univerInstanceService = e, this._initDirtyRanges(), this._initSheetRemove();
|
|
22
22
|
}
|
|
23
23
|
_initDirtyRanges() {
|
|
24
24
|
this.disposeWithMe(this._commandService.onCommandExecuted((a) => {
|
|
@@ -27,8 +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
|
-
|
|
31
|
-
l.length && this.markRangeDirty(t, r, l, !0);
|
|
30
|
+
this.markRangeDirty(t, r, [i], !0);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
}));
|
|
@@ -79,10 +78,9 @@ let Q = class extends W {
|
|
|
79
78
|
return this._ensureCache(a, e).getValue(t, r);
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
|
-
Q =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Pe(2, R(Ne))
|
|
81
|
+
Q = Xt([
|
|
82
|
+
et(0, R(U)),
|
|
83
|
+
et(1, R(w))
|
|
86
84
|
], Q);
|
|
87
85
|
function oe(o) {
|
|
88
86
|
var a, e;
|
|
@@ -93,15 +91,15 @@ function _e(o) {
|
|
|
93
91
|
return (a = o == null ? void 0 : o[0]) == null ? void 0 : a[0];
|
|
94
92
|
}
|
|
95
93
|
function O(o) {
|
|
96
|
-
return !
|
|
94
|
+
return !Bt.has(o);
|
|
97
95
|
}
|
|
98
96
|
function de(o, a) {
|
|
99
97
|
var t;
|
|
100
98
|
const e = a.getValidatorItem(o);
|
|
101
99
|
return (t = e == null ? void 0 : e.offsetFormulaByRange) != null ? t : !1;
|
|
102
100
|
}
|
|
103
|
-
var
|
|
104
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
101
|
+
var Kt = Object.getOwnPropertyDescriptor, zt = (o, a, e, t) => {
|
|
102
|
+
for (var r = t > 1 ? void 0 : t ? Kt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
105
103
|
(s = o[i]) && (r = s(r) || r);
|
|
106
104
|
return r;
|
|
107
105
|
}, re = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -231,15 +229,15 @@ let P = class extends W {
|
|
|
231
229
|
r && this._registerOtherFormulaService.markFormulaDirty(a, e, r.formulaId), i && this._registerOtherFormulaService.markFormulaDirty(a, e, i.formulaId);
|
|
232
230
|
}
|
|
233
231
|
};
|
|
234
|
-
P =
|
|
232
|
+
P = zt([
|
|
235
233
|
re(0, w),
|
|
236
234
|
re(1, R(ht)),
|
|
237
|
-
re(2, R(
|
|
235
|
+
re(2, R(Ye)),
|
|
238
236
|
re(3, R(Q)),
|
|
239
237
|
re(4, R(q))
|
|
240
238
|
], P);
|
|
241
|
-
var
|
|
242
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
239
|
+
var Zt = Object.getOwnPropertyDescriptor, Jt = (o, a, e, t) => {
|
|
240
|
+
for (var r = t > 1 ? void 0 : t ? Zt(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
243
241
|
(s = o[i]) && (r = s(r) || r);
|
|
244
242
|
return r;
|
|
245
243
|
}, ie = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -323,24 +321,24 @@ let K = class extends W {
|
|
|
323
321
|
return this._ensureRuleFormulaMap(a, e).get(t);
|
|
324
322
|
}
|
|
325
323
|
};
|
|
326
|
-
K =
|
|
324
|
+
K = Jt([
|
|
327
325
|
ie(0, w),
|
|
328
326
|
ie(1, R(ht)),
|
|
329
327
|
ie(2, R(Q)),
|
|
330
|
-
ie(3, R(
|
|
328
|
+
ie(3, R(Ye)),
|
|
331
329
|
ie(4, R(q))
|
|
332
330
|
], K);
|
|
333
331
|
function ne(o) {
|
|
334
|
-
return
|
|
332
|
+
return Et(o);
|
|
335
333
|
}
|
|
336
334
|
function gt(o) {
|
|
337
335
|
var a;
|
|
338
336
|
return String((a = ne(o)) != null ? a : "");
|
|
339
337
|
}
|
|
340
|
-
class
|
|
338
|
+
class Ke {
|
|
341
339
|
constructor(a, e, t, r, i = !1) {
|
|
342
340
|
m(this, "_map");
|
|
343
|
-
m(this, "_tree", new
|
|
341
|
+
m(this, "_tree", new Vt());
|
|
344
342
|
m(this, "_dirty", !0);
|
|
345
343
|
m(this, "_buildTree", () => {
|
|
346
344
|
if (!this._dirty || this._disableTree)
|
|
@@ -359,7 +357,7 @@ class ze {
|
|
|
359
357
|
});
|
|
360
358
|
}), this._tree.load(a), this._dirty = !1;
|
|
361
359
|
});
|
|
362
|
-
m(this, "_debonceBuildTree",
|
|
360
|
+
m(this, "_debonceBuildTree", Mt(this._buildTree, 0));
|
|
363
361
|
this._unitId = e, this._subUnitId = t, this._univerInstanceService = r, this._disableTree = i, this._map = a, this._buildTree();
|
|
364
362
|
}
|
|
365
363
|
get _worksheet() {
|
|
@@ -458,7 +456,7 @@ class ze {
|
|
|
458
456
|
}), t;
|
|
459
457
|
}
|
|
460
458
|
clone() {
|
|
461
|
-
return new
|
|
459
|
+
return new Ke(
|
|
462
460
|
new Map(E.deepClone(Array.from(this._map.entries()))),
|
|
463
461
|
this._unitId,
|
|
464
462
|
this._subUnitId,
|
|
@@ -478,8 +476,8 @@ class ze {
|
|
|
478
476
|
return t.length > 0 ? t[0].ruleId : void 0;
|
|
479
477
|
}
|
|
480
478
|
}
|
|
481
|
-
var
|
|
482
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
479
|
+
var ea = Object.getOwnPropertyDescriptor, ta = (o, a, e, t) => {
|
|
480
|
+
for (var r = t > 1 ? void 0 : t ? ea(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
483
481
|
(s = o[i]) && (r = s(r) || r);
|
|
484
482
|
return r;
|
|
485
483
|
}, X = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -487,8 +485,8 @@ let F = class extends W {
|
|
|
487
485
|
constructor(a, e, t, r, i, s, n) {
|
|
488
486
|
super();
|
|
489
487
|
m(this, "_ruleMatrixMap", /* @__PURE__ */ new Map());
|
|
490
|
-
m(this, "_validStatusChange$", new
|
|
491
|
-
m(this, "_ruleChange$", new
|
|
488
|
+
m(this, "_validStatusChange$", new Qe());
|
|
489
|
+
m(this, "_ruleChange$", new Qe());
|
|
492
490
|
m(this, "ruleChange$", this._ruleChange$.asObservable());
|
|
493
491
|
m(this, "validStatusChange$", this._validStatusChange$.asObservable());
|
|
494
492
|
this._dataValidationModel = a, this._univerInstanceService = e, this._dataValidatorRegistryService = t, this._dataValidationCacheService = r, this._dataValidationFormulaService = i, this._dataValidationCustomFormulaService = s, this._commandService = n, this._initRuleUpdateListener(), this.disposeWithMe(() => {
|
|
@@ -542,7 +540,7 @@ let F = class extends W {
|
|
|
542
540
|
let t = this._ruleMatrixMap.get(a);
|
|
543
541
|
t || (t = /* @__PURE__ */ new Map(), this._ruleMatrixMap.set(a, t));
|
|
544
542
|
let r = t.get(e);
|
|
545
|
-
return r || (r = new
|
|
543
|
+
return r || (r = new Ke(/* @__PURE__ */ new Map(), a, e, this._univerInstanceService), t.set(e, r)), r;
|
|
546
544
|
}
|
|
547
545
|
_addRuleSideEffect(a, e, t) {
|
|
548
546
|
this._ensureRuleMatrix(a, e).addRule(t), this._dataValidationCacheService.addRule(a, e, t), this._dataValidationFormulaService.addRule(a, e, t), this._dataValidationCustomFormulaService.addRule(a, e, t);
|
|
@@ -631,21 +629,21 @@ let F = class extends W {
|
|
|
631
629
|
return this._dataValidationModel.getAll();
|
|
632
630
|
}
|
|
633
631
|
};
|
|
634
|
-
F =
|
|
635
|
-
X(0, R(
|
|
632
|
+
F = ta([
|
|
633
|
+
X(0, R(Ye)),
|
|
636
634
|
X(1, w),
|
|
637
635
|
X(2, R(q)),
|
|
638
636
|
X(3, R(Q)),
|
|
639
637
|
X(4, R(K)),
|
|
640
638
|
X(5, R(P)),
|
|
641
|
-
X(6,
|
|
639
|
+
X(6, U)
|
|
642
640
|
], F);
|
|
643
641
|
const Ee = 1, Ve = 0;
|
|
644
642
|
function tt(o, a) {
|
|
645
643
|
return E.isBlank(o) ? a.t("dataValidation.validFail.value") : S(o) ? a.t("dataValidation.validFail.primitive") : "";
|
|
646
644
|
}
|
|
647
645
|
const pe = (o) => E.isDefine(o) && String(o).toLowerCase() === "true" ? "1" : String(o).toLowerCase() === "false" ? "0" : o;
|
|
648
|
-
class
|
|
646
|
+
class aa extends G {
|
|
649
647
|
constructor() {
|
|
650
648
|
super(...arguments);
|
|
651
649
|
m(this, "id", T.CHECKBOX);
|
|
@@ -717,7 +715,7 @@ class ra extends G {
|
|
|
717
715
|
return this.titleStr;
|
|
718
716
|
}
|
|
719
717
|
}
|
|
720
|
-
const
|
|
718
|
+
const ra = {
|
|
721
719
|
[h.BETWEEN]: "dataValidation.date.operators.between",
|
|
722
720
|
[h.EQUAL]: "dataValidation.date.operators.equal",
|
|
723
721
|
[h.GREATER_THAN]: "dataValidation.date.operators.greaterThan",
|
|
@@ -738,7 +736,7 @@ const at = {
|
|
|
738
736
|
[h.NOT_BETWEEN]: "dataValidation.date.ruleName.notBetween",
|
|
739
737
|
[h.NOT_EQUAL]: "dataValidation.date.ruleName.notEqual",
|
|
740
738
|
NONE: "dataValidation.date.ruleName.legal"
|
|
741
|
-
},
|
|
739
|
+
}, ia = {
|
|
742
740
|
[h.BETWEEN]: "dataValidation.date.errorMsg.between",
|
|
743
741
|
[h.EQUAL]: "dataValidation.date.errorMsg.equal",
|
|
744
742
|
[h.GREATER_THAN]: "dataValidation.date.errorMsg.greaterThan",
|
|
@@ -748,28 +746,28 @@ const at = {
|
|
|
748
746
|
[h.NOT_BETWEEN]: "dataValidation.date.errorMsg.notBetween",
|
|
749
747
|
[h.NOT_EQUAL]: "dataValidation.date.errorMsg.notEqual",
|
|
750
748
|
NONE: "dataValidation.date.errorMsg.legal"
|
|
751
|
-
},
|
|
749
|
+
}, Ne = [
|
|
752
750
|
h.BETWEEN,
|
|
753
751
|
h.NOT_BETWEEN
|
|
754
752
|
], le = "{FORMULA1}", ue = "{FORMULA2}";
|
|
755
|
-
function
|
|
753
|
+
function Ya(o) {
|
|
756
754
|
return o.filter(Boolean).join(",");
|
|
757
755
|
}
|
|
758
756
|
function fe(o) {
|
|
759
757
|
return o.split(",").filter(Boolean);
|
|
760
758
|
}
|
|
761
|
-
function
|
|
759
|
+
function Xa(o) {
|
|
762
760
|
const a = ne(o);
|
|
763
761
|
return a == null ? "" : a.toString();
|
|
764
762
|
}
|
|
765
|
-
function
|
|
763
|
+
function be(o, a, e) {
|
|
766
764
|
const { formula1: t, formula2: r } = a, i = a.ranges[0].startRow, s = a.ranges[0].startColumn, n = e.row - i, l = e.col - s, u = S(t) ? o.moveFormulaRefOffset(t, l, n, !0) : t, d = S(r) ? o.moveFormulaRefOffset(r, l, n, !0) : r;
|
|
767
765
|
return {
|
|
768
766
|
transformedFormula1: u,
|
|
769
767
|
transformedFormula2: d
|
|
770
768
|
};
|
|
771
769
|
}
|
|
772
|
-
const
|
|
770
|
+
const He = (o) => {
|
|
773
771
|
var e, t;
|
|
774
772
|
if (o == null || typeof o == "boolean")
|
|
775
773
|
return;
|
|
@@ -778,7 +776,7 @@ const We = (o) => {
|
|
|
778
776
|
const a = (e = H.parseDate(o)) == null ? void 0 : e.v;
|
|
779
777
|
return E.isDefine(a) ? a : (t = H.parseDate(it(o).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
|
|
780
778
|
};
|
|
781
|
-
class
|
|
779
|
+
class oa extends G {
|
|
782
780
|
constructor() {
|
|
783
781
|
super(...arguments);
|
|
784
782
|
m(this, "id", T.DATE);
|
|
@@ -801,8 +799,8 @@ class sa extends G {
|
|
|
801
799
|
async parseFormula(e, t, r, i, s) {
|
|
802
800
|
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, s), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, s), { formula1: u, formula2: d } = e, c = O(String(n == null ? void 0 : n.v)) && O(String(l == null ? void 0 : l.v));
|
|
803
801
|
return {
|
|
804
|
-
formula1:
|
|
805
|
-
formula2:
|
|
802
|
+
formula1: He(S(u) ? n == null ? void 0 : n.v : u),
|
|
803
|
+
formula2: He(S(d) ? l == null ? void 0 : l.v : d),
|
|
806
804
|
isFormulaValid: c
|
|
807
805
|
};
|
|
808
806
|
}
|
|
@@ -820,7 +818,7 @@ class sa extends G {
|
|
|
820
818
|
success: !0
|
|
821
819
|
};
|
|
822
820
|
const s = this._validatorSingleFormula(e.formula1), n = this.localeService.t("dataValidation.validFail.date");
|
|
823
|
-
if (
|
|
821
|
+
if (Ne.includes(i)) {
|
|
824
822
|
const u = this._validatorSingleFormula(e.formula2);
|
|
825
823
|
return {
|
|
826
824
|
success: s && u,
|
|
@@ -858,11 +856,11 @@ class sa extends G {
|
|
|
858
856
|
const { value: i } = e;
|
|
859
857
|
return {
|
|
860
858
|
...e,
|
|
861
|
-
value:
|
|
859
|
+
value: He(i)
|
|
862
860
|
};
|
|
863
861
|
}
|
|
864
862
|
get operatorNames() {
|
|
865
|
-
return this.operators.map((e) => this.localeService.t(
|
|
863
|
+
return this.operators.map((e) => this.localeService.t(ra[e]));
|
|
866
864
|
}
|
|
867
865
|
generateRuleName(e) {
|
|
868
866
|
var r, i;
|
|
@@ -874,8 +872,8 @@ class sa extends G {
|
|
|
874
872
|
generateRuleErrorMessage(e, t) {
|
|
875
873
|
if (!e.operator)
|
|
876
874
|
return this.titleStr;
|
|
877
|
-
const { transformedFormula1: r, transformedFormula2: i } =
|
|
878
|
-
return `${this.localeService.t(
|
|
875
|
+
const { transformedFormula1: r, transformedFormula2: i } = be(this._lexerTreeBuilder, e, t);
|
|
876
|
+
return `${this.localeService.t(ia[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
879
877
|
}
|
|
880
878
|
}
|
|
881
879
|
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 + "";
|
|
@@ -894,7 +892,7 @@ const Me = {
|
|
|
894
892
|
function ye(o) {
|
|
895
893
|
return +o;
|
|
896
894
|
}
|
|
897
|
-
class
|
|
895
|
+
class sa extends G {
|
|
898
896
|
constructor() {
|
|
899
897
|
super(...arguments);
|
|
900
898
|
m(this, "_customFormulaService", this.injector.get(P));
|
|
@@ -945,7 +943,7 @@ class na extends G {
|
|
|
945
943
|
return {
|
|
946
944
|
success: !0
|
|
947
945
|
};
|
|
948
|
-
const s = E.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l =
|
|
946
|
+
const s = E.isDefine(e.formula1) && this._isFormulaOrNumber(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrNumber(e.formula2), l = Ne.includes(i), u = this.localeService.t("dataValidation.validFail.number");
|
|
949
947
|
return l ? {
|
|
950
948
|
success: s && n,
|
|
951
949
|
formula1: s ? void 0 : u,
|
|
@@ -958,11 +956,11 @@ class na extends G {
|
|
|
958
956
|
generateRuleErrorMessage(e, t) {
|
|
959
957
|
if (!e.operator)
|
|
960
958
|
return this.localeService.t(Me.NONE).replace("{TYPE}", this.titleStr);
|
|
961
|
-
const { transformedFormula1: r, transformedFormula2: i } =
|
|
959
|
+
const { transformedFormula1: r, transformedFormula2: i } = be(this._lexerTreeBuilder, e, t);
|
|
962
960
|
return `${this.localeService.t(Me[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
963
961
|
}
|
|
964
962
|
}
|
|
965
|
-
function
|
|
963
|
+
function Pe(o) {
|
|
966
964
|
if (!o)
|
|
967
965
|
return [];
|
|
968
966
|
const a = /* @__PURE__ */ new Set();
|
|
@@ -982,22 +980,22 @@ function $e(o) {
|
|
|
982
980
|
}
|
|
983
981
|
), [...a];
|
|
984
982
|
}
|
|
985
|
-
const
|
|
983
|
+
const na = [
|
|
986
984
|
"if",
|
|
987
985
|
"indirect",
|
|
988
986
|
"choose",
|
|
989
987
|
"offset"
|
|
990
988
|
];
|
|
991
|
-
function
|
|
989
|
+
function la(o, a) {
|
|
992
990
|
if (!S(o) || nt(o.slice(1)))
|
|
993
991
|
return !0;
|
|
994
992
|
const t = a.sequenceNodesBuilder(o);
|
|
995
|
-
return t && t.some((r) => typeof r == "object" && r.nodeType ===
|
|
993
|
+
return t && t.some((r) => typeof r == "object" && r.nodeType === xt.FUNCTION && na.indexOf(r.token.toLowerCase()) > -1);
|
|
996
994
|
}
|
|
997
|
-
function
|
|
995
|
+
function ua(o, a) {
|
|
998
996
|
const { formula1: e = "", ranges: t } = o;
|
|
999
997
|
if (nt(e.slice(1))) {
|
|
1000
|
-
const i =
|
|
998
|
+
const i = Ht(e.slice(1));
|
|
1001
999
|
if ((!i.sheetName || i.sheetName === a) && t.some((s) => I.intersects(s, i.range)))
|
|
1002
1000
|
return !0;
|
|
1003
1001
|
}
|
|
@@ -1015,11 +1013,11 @@ class _t extends G {
|
|
|
1015
1013
|
m(this, "title", "dataValidation.list.title");
|
|
1016
1014
|
m(this, "operators", []);
|
|
1017
1015
|
m(this, "scopes", ["sheet"]);
|
|
1018
|
-
m(this, "skipDefaultFontRender", (e) => e.renderMode !==
|
|
1016
|
+
m(this, "skipDefaultFontRender", (e) => e.renderMode !== xe.TEXT);
|
|
1019
1017
|
}
|
|
1020
1018
|
validatorFormula(e, t, r) {
|
|
1021
1019
|
var u, d, c;
|
|
1022
|
-
const i = !E.isBlank(e.formula1), s =
|
|
1020
|
+
const i = !E.isBlank(e.formula1), s = la((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 = ua(e, n != null ? n : "");
|
|
1023
1021
|
return {
|
|
1024
1022
|
success: !!(i && s && !l),
|
|
1025
1023
|
formula1: i ? s ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
|
|
@@ -1028,7 +1026,7 @@ class _t extends G {
|
|
|
1028
1026
|
getExtraStyle(e, t, { style: r }) {
|
|
1029
1027
|
var s;
|
|
1030
1028
|
const i = (s = r.tb !== Re.OVERFLOW ? r.tb : Re.CLIP) != null ? s : Re.WRAP;
|
|
1031
|
-
if (e.type === T.LIST && (e.renderMode ===
|
|
1029
|
+
if (e.type === T.LIST && (e.renderMode === xe.ARROW || e.renderMode === xe.TEXT)) {
|
|
1032
1030
|
const n = this.getListWithColorMap(e), l = `${t != null ? t : ""}`, u = n[l];
|
|
1033
1031
|
if (u)
|
|
1034
1032
|
return {
|
|
@@ -1057,7 +1055,7 @@ class _t extends G {
|
|
|
1057
1055
|
}
|
|
1058
1056
|
async isValidType(e, t, r) {
|
|
1059
1057
|
var g, p;
|
|
1060
|
-
const { value: i, unitId: s, subUnitId: n } = e, { formula1: l = "" } = r, u = await this.formulaService.getRuleFormulaResult(s, n, r.uid), d = S(l) ?
|
|
1058
|
+
const { value: i, unitId: s, subUnitId: n } = e, { formula1: l = "" } = r, u = await this.formulaService.getRuleFormulaResult(s, n, r.uid), d = S(l) ? Pe((p = (g = u == null ? void 0 : u[0]) == null ? void 0 : g.result) == null ? void 0 : p[0][0]) : fe(l);
|
|
1061
1059
|
return this.parseCellValue(i).every((_) => d.includes(_));
|
|
1062
1060
|
}
|
|
1063
1061
|
generateRuleName() {
|
|
@@ -1073,7 +1071,7 @@ class _t extends G {
|
|
|
1073
1071
|
const l = (p = r ? n.getSheetBySheetId(r) : void 0) != null ? p : n.getActiveSheet();
|
|
1074
1072
|
if (!l) return [];
|
|
1075
1073
|
const u = n.getUnitId(), d = l.getSheetId(), c = this.formulaService.getRuleFormulaResultSync(u, d, e.uid);
|
|
1076
|
-
return S(i) ?
|
|
1074
|
+
return S(i) ? Pe((v = (_ = c == null ? void 0 : c[0]) == null ? void 0 : _.result) == null ? void 0 : v[0][0]) : fe(i);
|
|
1077
1075
|
}
|
|
1078
1076
|
async getListAsync(e, t, r) {
|
|
1079
1077
|
var g, p, _, v;
|
|
@@ -1082,7 +1080,7 @@ class _t extends G {
|
|
|
1082
1080
|
const l = (p = r ? n.getSheetBySheetId(r) : void 0) != null ? p : n.getActiveSheet();
|
|
1083
1081
|
if (!l) return [];
|
|
1084
1082
|
const u = n.getUnitId(), d = l.getSheetId(), c = await this.formulaService.getRuleFormulaResult(u, d, e.uid);
|
|
1085
|
-
return S(i) ?
|
|
1083
|
+
return S(i) ? Pe((v = (_ = c == null ? void 0 : c[0]) == null ? void 0 : _.result) == null ? void 0 : v[0][0]) : fe(i);
|
|
1086
1084
|
}
|
|
1087
1085
|
getListWithColor(e, t, r) {
|
|
1088
1086
|
const i = this.getList(e, t, r), s = (e.formula2 || "").split(",");
|
|
@@ -1095,7 +1093,7 @@ class _t extends G {
|
|
|
1095
1093
|
}), s;
|
|
1096
1094
|
}
|
|
1097
1095
|
}
|
|
1098
|
-
class
|
|
1096
|
+
class da extends G {
|
|
1099
1097
|
constructor() {
|
|
1100
1098
|
super(...arguments);
|
|
1101
1099
|
m(this, "id", T.TEXT_LENGTH);
|
|
@@ -1124,7 +1122,7 @@ class ca extends G {
|
|
|
1124
1122
|
return {
|
|
1125
1123
|
success: !1
|
|
1126
1124
|
};
|
|
1127
|
-
const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l =
|
|
1125
|
+
const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ne.includes(i), u = this.localeService.t("dataValidation.validFail.number");
|
|
1128
1126
|
return l ? {
|
|
1129
1127
|
success: s && n,
|
|
1130
1128
|
formula1: s ? void 0 : u,
|
|
@@ -1158,16 +1156,16 @@ class ca extends G {
|
|
|
1158
1156
|
generateRuleErrorMessage(e, t) {
|
|
1159
1157
|
if (!e.operator)
|
|
1160
1158
|
return this.titleStr;
|
|
1161
|
-
const { transformedFormula1: r, transformedFormula2: i } =
|
|
1162
|
-
return `${this.localeService.t(
|
|
1159
|
+
const { transformedFormula1: r, transformedFormula2: i } = be(this._lexerTreeBuilder, e, t);
|
|
1160
|
+
return `${this.localeService.t(Nt[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
1163
1161
|
}
|
|
1164
1162
|
}
|
|
1165
1163
|
function pt(o) {
|
|
1166
1164
|
var e, t;
|
|
1167
1165
|
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;
|
|
1168
1166
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(w), g =
|
|
1167
|
+
function Le(o, a, e, t, r = "command", i = !0) {
|
|
1168
|
+
const s = t.get(Y), n = t.get(q), l = [], u = [], d = t.get(F), c = t.get(w), g = Xe(c, { unitId: o, subUnitId: a });
|
|
1171
1169
|
if (!g)
|
|
1172
1170
|
return {
|
|
1173
1171
|
redoMutations: l,
|
|
@@ -1177,9 +1175,9 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1177
1175
|
let v = !1;
|
|
1178
1176
|
function V(f, A) {
|
|
1179
1177
|
i && f.forEach(($) => {
|
|
1180
|
-
b.foreach($, (
|
|
1181
|
-
const x = p.getCellRaw(
|
|
1182
|
-
(pt(x) || J === A) && !(x != null && x.p) && (v = !0, _.setValue(
|
|
1178
|
+
b.foreach($, (B, k) => {
|
|
1179
|
+
const x = p.getCellRaw(B, k), J = gt(x);
|
|
1180
|
+
(pt(x) || J === A) && !(x != null && x.p) && (v = !0, _.setValue(B, k, {
|
|
1183
1181
|
v: A,
|
|
1184
1182
|
p: null
|
|
1185
1183
|
}));
|
|
@@ -1210,7 +1208,7 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1210
1208
|
break;
|
|
1211
1209
|
case "update": {
|
|
1212
1210
|
if (de(f.rule.type, n)) {
|
|
1213
|
-
const $ = f.oldRanges[0].startRow,
|
|
1211
|
+
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;
|
|
1214
1212
|
he !== f.rule.formula1 || me !== f.rule.formula2 || !ot(f.newRanges, f.oldRanges) ? (l.push({
|
|
1215
1213
|
id: y.id,
|
|
1216
1214
|
params: {
|
|
@@ -1294,8 +1292,8 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1294
1292
|
});
|
|
1295
1293
|
const A = d.getRuleById(o, a, f.ruleId);
|
|
1296
1294
|
if (A && A.type === T.CHECKBOX) {
|
|
1297
|
-
const
|
|
1298
|
-
V(f.newRanges,
|
|
1295
|
+
const B = d.getValidator(T.CHECKBOX).parseFormulaSync(A, o, a);
|
|
1296
|
+
V(f.newRanges, B.formula2);
|
|
1299
1297
|
}
|
|
1300
1298
|
break;
|
|
1301
1299
|
}
|
|
@@ -1342,31 +1340,31 @@ function Be(o, a, e, t, r = "command", i = !0) {
|
|
|
1342
1340
|
undoMutations: u
|
|
1343
1341
|
};
|
|
1344
1342
|
}
|
|
1345
|
-
const
|
|
1343
|
+
const ca = {
|
|
1346
1344
|
type: z.COMMAND,
|
|
1347
1345
|
id: "sheet.command.updateDataValidationRuleRange",
|
|
1348
1346
|
handler(o, a) {
|
|
1349
1347
|
if (!a)
|
|
1350
1348
|
return !1;
|
|
1351
|
-
const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(
|
|
1349
|
+
const { unitId: e, subUnitId: t, ranges: r, ruleId: i } = a, s = o.get(F), n = o.get(U), l = o.get(Z);
|
|
1352
1350
|
if (!s.getRuleById(e, t, i))
|
|
1353
1351
|
return !1;
|
|
1354
1352
|
const d = s.getRuleObjectMatrix(e, t).clone();
|
|
1355
1353
|
d.updateRange(i, r);
|
|
1356
|
-
const c = d.diff(s.getRules(e, t)), { redoMutations: g, undoMutations: p } =
|
|
1354
|
+
const c = d.diff(s.getRules(e, t)), { redoMutations: g, undoMutations: p } = Le(e, t, c, o);
|
|
1357
1355
|
return l.pushUndoRedo({
|
|
1358
1356
|
undoMutations: p,
|
|
1359
1357
|
redoMutations: g,
|
|
1360
1358
|
unitID: e
|
|
1361
1359
|
}), De(g, n), !0;
|
|
1362
1360
|
}
|
|
1363
|
-
},
|
|
1361
|
+
}, ha = {
|
|
1364
1362
|
type: z.COMMAND,
|
|
1365
1363
|
id: "sheet.command.addDataValidation",
|
|
1366
1364
|
handler(o, a) {
|
|
1367
1365
|
if (!a)
|
|
1368
1366
|
return !1;
|
|
1369
|
-
const { unitId: e, subUnitId: t, rule: r } = a, i = o.get(F), s = o.get(
|
|
1367
|
+
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();
|
|
1370
1368
|
l.addRule(r);
|
|
1371
1369
|
const u = l.diff(i.getRules(e, t)), d = i.getValidator(r.type), c = {
|
|
1372
1370
|
unitId: e,
|
|
@@ -1375,7 +1373,7 @@ const ha = {
|
|
|
1375
1373
|
...r,
|
|
1376
1374
|
...d == null ? void 0 : d.normalizeFormula(r, e, t)
|
|
1377
1375
|
}
|
|
1378
|
-
}, { redoMutations: g, undoMutations: p } =
|
|
1376
|
+
}, { redoMutations: g, undoMutations: p } = Le(e, t, u, o);
|
|
1379
1377
|
return g.push({
|
|
1380
1378
|
id: L.id,
|
|
1381
1379
|
params: c
|
|
@@ -1392,14 +1390,14 @@ const ha = {
|
|
|
1392
1390
|
undoMutations: p
|
|
1393
1391
|
}), De(g, s), !0;
|
|
1394
1392
|
}
|
|
1395
|
-
},
|
|
1393
|
+
}, ma = {
|
|
1396
1394
|
type: z.COMMAND,
|
|
1397
1395
|
id: "sheets.command.update-data-validation-setting",
|
|
1398
1396
|
// eslint-disable-next-line max-lines-per-function
|
|
1399
1397
|
handler(o, a) {
|
|
1400
1398
|
if (!a)
|
|
1401
1399
|
return !1;
|
|
1402
|
-
const e = o.get(
|
|
1400
|
+
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);
|
|
1403
1401
|
if (!d)
|
|
1404
1402
|
return !1;
|
|
1405
1403
|
const c = r.getRuleById(s, n, l);
|
|
@@ -1428,24 +1426,24 @@ const ha = {
|
|
|
1428
1426
|
ruleId: l,
|
|
1429
1427
|
payload: {
|
|
1430
1428
|
type: M.SETTING,
|
|
1431
|
-
payload:
|
|
1429
|
+
payload: bt(c)
|
|
1432
1430
|
}
|
|
1433
1431
|
}, V = [{
|
|
1434
1432
|
id: y.id,
|
|
1435
1433
|
params: v
|
|
1436
1434
|
}];
|
|
1437
1435
|
if (u.type === T.CHECKBOX) {
|
|
1438
|
-
const A = c.ranges, $ = o.get(w),
|
|
1439
|
-
if (
|
|
1440
|
-
const k = new Se(), { worksheet: x } =
|
|
1436
|
+
const A = c.ranges, $ = o.get(w), B = Xe($, { unitId: s, subUnitId: n });
|
|
1437
|
+
if (B) {
|
|
1438
|
+
const k = new Se(), { worksheet: x } = B, { formula2: J = Ve, formula1: ce = Ee } = c, { formula2: he = Ve, formula1: me = Ee } = u;
|
|
1441
1439
|
let Ue = !1;
|
|
1442
1440
|
if (A.forEach((ge) => {
|
|
1443
|
-
b.foreach(ge, (ae,
|
|
1444
|
-
const j = x.getCellRaw(ae,
|
|
1445
|
-
(pt(j) ||
|
|
1441
|
+
b.foreach(ge, (ae, Be) => {
|
|
1442
|
+
const j = x.getCellRaw(ae, Be), ze = gt(j);
|
|
1443
|
+
(pt(j) || ze === String(J)) && !(j != null && j.p) ? (k.setValue(ae, Be, {
|
|
1446
1444
|
v: he,
|
|
1447
1445
|
p: null
|
|
1448
|
-
}), Ue = !0) :
|
|
1446
|
+
}), Ue = !0) : ze === String(ce) && !(j != null && j.p) && (k.setValue(ae, Be, {
|
|
1449
1447
|
v: me,
|
|
1450
1448
|
p: null
|
|
1451
1449
|
}), Ue = !0);
|
|
@@ -1472,13 +1470,13 @@ const ha = {
|
|
|
1472
1470
|
undoMutations: V
|
|
1473
1471
|
}), !0) : !1;
|
|
1474
1472
|
}
|
|
1475
|
-
},
|
|
1473
|
+
}, ga = {
|
|
1476
1474
|
type: z.COMMAND,
|
|
1477
1475
|
id: "sheets.command.update-data-validation-options",
|
|
1478
1476
|
handler(o, a) {
|
|
1479
1477
|
if (!a)
|
|
1480
1478
|
return !1;
|
|
1481
|
-
const e = o.get(
|
|
1479
|
+
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);
|
|
1482
1480
|
if (!u)
|
|
1483
1481
|
return !1;
|
|
1484
1482
|
const d = {
|
|
@@ -1498,7 +1496,7 @@ const ha = {
|
|
|
1498
1496
|
ruleId: n,
|
|
1499
1497
|
payload: {
|
|
1500
1498
|
type: M.OPTIONS,
|
|
1501
|
-
payload:
|
|
1499
|
+
payload: Lt(u)
|
|
1502
1500
|
}
|
|
1503
1501
|
}, p = [{
|
|
1504
1502
|
id: y.id,
|
|
@@ -1510,30 +1508,30 @@ const ha = {
|
|
|
1510
1508
|
undoMutations: p
|
|
1511
1509
|
}), e.executeCommand(y.id, d), !0;
|
|
1512
1510
|
}
|
|
1513
|
-
},
|
|
1511
|
+
}, _a = {
|
|
1514
1512
|
type: z.COMMAND,
|
|
1515
1513
|
id: "sheets.command.clear-range-data-validation",
|
|
1516
1514
|
handler(o, a) {
|
|
1517
1515
|
if (!a)
|
|
1518
1516
|
return !1;
|
|
1519
|
-
const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(
|
|
1517
|
+
const { unitId: e, subUnitId: t, ranges: r } = a, i = o.get(U), s = o.get(w), n = Xe(s, { unitId: e, subUnitId: t }), l = o.get(F);
|
|
1520
1518
|
if (!n) return !1;
|
|
1521
1519
|
const u = o.get(Z), d = l.getRuleObjectMatrix(e, t).clone();
|
|
1522
1520
|
d.removeRange(r);
|
|
1523
|
-
const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: p } =
|
|
1521
|
+
const c = d.diff(l.getRules(e, t)), { redoMutations: g, undoMutations: p } = Le(e, t, c, o);
|
|
1524
1522
|
return u.pushUndoRedo({
|
|
1525
1523
|
unitID: e,
|
|
1526
1524
|
redoMutations: g,
|
|
1527
1525
|
undoMutations: p
|
|
1528
1526
|
}), De(g, i).result;
|
|
1529
1527
|
}
|
|
1530
|
-
},
|
|
1528
|
+
}, pa = {
|
|
1531
1529
|
type: z.COMMAND,
|
|
1532
1530
|
id: "sheet.command.remove-all-data-validation",
|
|
1533
1531
|
handler(o, a) {
|
|
1534
1532
|
if (!a)
|
|
1535
1533
|
return !1;
|
|
1536
|
-
const { unitId: e, subUnitId: t } = a, r = o.get(
|
|
1534
|
+
const { unitId: e, subUnitId: t } = a, r = o.get(U), i = o.get(F), s = o.get(Z), n = [...i.getRules(e, t)], l = {
|
|
1537
1535
|
unitId: e,
|
|
1538
1536
|
subUnitId: t,
|
|
1539
1537
|
ruleId: n.map((c) => c.uid)
|
|
@@ -1554,7 +1552,7 @@ const ha = {
|
|
|
1554
1552
|
unitID: e
|
|
1555
1553
|
}), r.executeCommand(D.id, l), !0;
|
|
1556
1554
|
}
|
|
1557
|
-
},
|
|
1555
|
+
}, fa = (o, a) => {
|
|
1558
1556
|
const e = o.get(F), { unitId: t, subUnitId: r, ruleId: i, source: s } = a;
|
|
1559
1557
|
if (Array.isArray(i)) {
|
|
1560
1558
|
const l = i.map((u) => e.getRuleById(t, r, u)).filter(Boolean);
|
|
@@ -1579,13 +1577,13 @@ const ha = {
|
|
|
1579
1577
|
index: e.getRuleIndex(t, r, i)
|
|
1580
1578
|
}
|
|
1581
1579
|
}];
|
|
1582
|
-
},
|
|
1580
|
+
}, va = {
|
|
1583
1581
|
type: z.COMMAND,
|
|
1584
1582
|
id: "sheet.command.remove-data-validation-rule",
|
|
1585
1583
|
handler(o, a) {
|
|
1586
1584
|
if (!a)
|
|
1587
1585
|
return !1;
|
|
1588
|
-
const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(
|
|
1586
|
+
const { unitId: e, subUnitId: t, ruleId: r } = a, i = o.get(U), s = o.get(Z), n = o.get(F), l = [{
|
|
1589
1587
|
id: D.id,
|
|
1590
1588
|
params: a
|
|
1591
1589
|
}], u = [{
|
|
@@ -1605,12 +1603,12 @@ const ha = {
|
|
|
1605
1603
|
unitID: a.unitId
|
|
1606
1604
|
}), i.executeCommand(D.id, a), !0;
|
|
1607
1605
|
}
|
|
1608
|
-
},
|
|
1609
|
-
var ft = /* @__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))(ft || {}),
|
|
1610
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1606
|
+
}, Ra = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
1607
|
+
var ft = /* @__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))(ft || {}), Sa = Object.getOwnPropertyDescriptor, Ea = (o, a, e, t) => {
|
|
1608
|
+
for (var r = t > 1 ? void 0 : t ? Sa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1611
1609
|
(s = o[i]) && (r = s(r) || r);
|
|
1612
1610
|
return r;
|
|
1613
|
-
},
|
|
1611
|
+
}, We = (o, a) => (e, t) => a(e, t, o);
|
|
1614
1612
|
let Te = class extends W {
|
|
1615
1613
|
constructor(o, a, e) {
|
|
1616
1614
|
super(), this._univerInstanceService = o, this._permissionService = a, this._lexerTreeBuilder = e;
|
|
@@ -1624,14 +1622,14 @@ let Te = class extends W {
|
|
|
1624
1622
|
const i = a[r];
|
|
1625
1623
|
if (typeof i == "string")
|
|
1626
1624
|
continue;
|
|
1627
|
-
const { token: s } = i, n =
|
|
1625
|
+
const { token: s } = i, n = Pt(s), l = this._univerInstanceService.getCurrentUnitForType(C.UNIVER_SHEET);
|
|
1628
1626
|
let u = l.getActiveSheet();
|
|
1629
1627
|
const d = l.getUnitId();
|
|
1630
1628
|
if (n.sheetName) {
|
|
1631
1629
|
if (u = l.getSheetBySheetName(n.sheetName), !u)
|
|
1632
1630
|
return !1;
|
|
1633
1631
|
const v = u == null ? void 0 : u.getSheetId();
|
|
1634
|
-
if (!this._permissionService.getPermissionPoint(new
|
|
1632
|
+
if (!this._permissionService.getPermissionPoint(new $t(d, v).id)) return !1;
|
|
1635
1633
|
}
|
|
1636
1634
|
if (!u)
|
|
1637
1635
|
return !1;
|
|
@@ -1646,17 +1644,17 @@ let Te = class extends W {
|
|
|
1646
1644
|
return !0;
|
|
1647
1645
|
}
|
|
1648
1646
|
};
|
|
1649
|
-
Te =
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1647
|
+
Te = Ea([
|
|
1648
|
+
We(0, w),
|
|
1649
|
+
We(1, yt),
|
|
1650
|
+
We(2, R(Y))
|
|
1653
1651
|
], Te);
|
|
1654
|
-
const
|
|
1655
|
-
var
|
|
1656
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1652
|
+
const Va = "sheets-data-validation.config", rt = {};
|
|
1653
|
+
var Ma = Object.getOwnPropertyDescriptor, ya = (o, a, e, t) => {
|
|
1654
|
+
for (var r = t > 1 ? void 0 : t ? Ma(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1657
1655
|
(s = o[i]) && (r = s(r) || r);
|
|
1658
1656
|
return r;
|
|
1659
|
-
},
|
|
1657
|
+
}, $e = (o, a) => (e, t) => a(e, t, o);
|
|
1660
1658
|
let Fe = class extends W {
|
|
1661
1659
|
constructor(a, e, t) {
|
|
1662
1660
|
super();
|
|
@@ -1787,20 +1785,20 @@ let Fe = class extends W {
|
|
|
1787
1785
|
}
|
|
1788
1786
|
}
|
|
1789
1787
|
})
|
|
1790
|
-
), this.disposeWithMe(
|
|
1788
|
+
), this.disposeWithMe(qe(() => {
|
|
1791
1789
|
this._disposableMap.forEach((e) => {
|
|
1792
1790
|
e.dispose();
|
|
1793
1791
|
}), this._disposableMap.clear();
|
|
1794
1792
|
}));
|
|
1795
1793
|
}
|
|
1796
1794
|
};
|
|
1797
|
-
Fe =
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1795
|
+
Fe = ya([
|
|
1796
|
+
$e(0, R(F)),
|
|
1797
|
+
$e(1, R(mt)),
|
|
1798
|
+
$e(2, R(q))
|
|
1801
1799
|
], Fe);
|
|
1802
|
-
var
|
|
1803
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1800
|
+
var Ta = Object.getOwnPropertyDescriptor, Fa = (o, a, e, t) => {
|
|
1801
|
+
for (var r = t > 1 ? void 0 : t ? Ta(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1804
1802
|
(s = o[i]) && (r = s(r) || r);
|
|
1805
1803
|
return r;
|
|
1806
1804
|
}, ee = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -1891,7 +1889,7 @@ let Ce = class extends W {
|
|
|
1891
1889
|
register(a, e, t) {
|
|
1892
1890
|
var l;
|
|
1893
1891
|
const r = (u) => {
|
|
1894
|
-
const d = [...t.ranges], g = d.map((_) =>
|
|
1892
|
+
const d = [...t.ranges], g = d.map((_) => jt(_, u)).filter((_) => !!_).flat();
|
|
1895
1893
|
if (ot(g, d))
|
|
1896
1894
|
return { redos: [], undos: [] };
|
|
1897
1895
|
if (g.length) {
|
|
@@ -1919,7 +1917,7 @@ let Ce = class extends W {
|
|
|
1919
1917
|
}];
|
|
1920
1918
|
return { redos: v, undos: V };
|
|
1921
1919
|
} else {
|
|
1922
|
-
const _ = { unitId: a, subUnitId: e, ruleId: t.uid }, v = [{ id: D.id, params: _ }], V =
|
|
1920
|
+
const _ = { unitId: a, subUnitId: e, ruleId: t.uid }, v = [{ id: D.id, params: _ }], V = fa(this._injector, _);
|
|
1923
1921
|
return { redos: v, undos: V };
|
|
1924
1922
|
}
|
|
1925
1923
|
}, i = [];
|
|
@@ -1957,26 +1955,26 @@ let Ce = class extends W {
|
|
|
1957
1955
|
}
|
|
1958
1956
|
}
|
|
1959
1957
|
})
|
|
1960
|
-
), this.disposeWithMe(
|
|
1958
|
+
), this.disposeWithMe(qe(() => {
|
|
1961
1959
|
this._disposableMap.forEach((e) => {
|
|
1962
1960
|
e.forEach((t) => t());
|
|
1963
1961
|
}), this._disposableMap.clear();
|
|
1964
1962
|
}));
|
|
1965
1963
|
}
|
|
1966
1964
|
};
|
|
1967
|
-
Ce =
|
|
1965
|
+
Ce = Fa([
|
|
1968
1966
|
ee(0, R(F)),
|
|
1969
|
-
ee(1, R(
|
|
1970
|
-
ee(2, R(
|
|
1967
|
+
ee(1, R(Ge)),
|
|
1968
|
+
ee(2, R(kt)),
|
|
1971
1969
|
ee(3, R(K)),
|
|
1972
1970
|
ee(4, R(mt)),
|
|
1973
1971
|
ee(5, R(q))
|
|
1974
1972
|
], Ce);
|
|
1975
|
-
var
|
|
1976
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1973
|
+
var Ca = Object.getOwnPropertyDescriptor, Oa = (o, a, e, t) => {
|
|
1974
|
+
for (var r = t > 1 ? void 0 : t ? Ca(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
1977
1975
|
(s = o[i]) && (r = s(r) || r);
|
|
1978
1976
|
return r;
|
|
1979
|
-
},
|
|
1977
|
+
}, ke = (o, a) => (e, t) => a(e, t, o);
|
|
1980
1978
|
let Oe = class extends W {
|
|
1981
1979
|
constructor(o, a, e) {
|
|
1982
1980
|
super(), this._sheetInterceptorService = o, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
|
|
@@ -1986,7 +1984,7 @@ let Oe = class extends W {
|
|
|
1986
1984
|
this._sheetInterceptorService.interceptCommand({
|
|
1987
1985
|
getMutations: (o) => {
|
|
1988
1986
|
var a;
|
|
1989
|
-
if (o.id ===
|
|
1987
|
+
if (o.id === Qt.id) {
|
|
1990
1988
|
const e = o.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(C.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
|
|
1991
1989
|
if (!r)
|
|
1992
1990
|
return { redos: [], undos: [] };
|
|
@@ -2024,12 +2022,12 @@ let Oe = class extends W {
|
|
|
2024
2022
|
);
|
|
2025
2023
|
}
|
|
2026
2024
|
};
|
|
2027
|
-
Oe =
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2025
|
+
Oe = Oa([
|
|
2026
|
+
ke(0, R(dt)),
|
|
2027
|
+
ke(1, R(w)),
|
|
2028
|
+
ke(2, R(F))
|
|
2031
2029
|
], Oe);
|
|
2032
|
-
class
|
|
2030
|
+
class wa extends G {
|
|
2033
2031
|
constructor() {
|
|
2034
2032
|
super(...arguments);
|
|
2035
2033
|
m(this, "id", T.ANY);
|
|
@@ -2058,7 +2056,7 @@ class Aa extends G {
|
|
|
2058
2056
|
return this.localeService.t("dataValidation.any.error");
|
|
2059
2057
|
}
|
|
2060
2058
|
}
|
|
2061
|
-
class
|
|
2059
|
+
class Aa extends G {
|
|
2062
2060
|
constructor() {
|
|
2063
2061
|
super(...arguments);
|
|
2064
2062
|
m(this, "id", T.CUSTOM);
|
|
@@ -2071,7 +2069,7 @@ class Ia extends G {
|
|
|
2071
2069
|
}
|
|
2072
2070
|
validatorFormula(e, t, r) {
|
|
2073
2071
|
var u;
|
|
2074
|
-
const i = S(e.formula1), s = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(s) === 0 && s.startsWith(
|
|
2072
|
+
const i = S(e.formula1), s = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(s) === 0 && s.startsWith(Wt.EQUALS);
|
|
2075
2073
|
return {
|
|
2076
2074
|
success: i && l,
|
|
2077
2075
|
formula1: i && l ? "" : this.localeService.t("dataValidation.validFail.formula")
|
|
@@ -2086,7 +2084,7 @@ class Ia extends G {
|
|
|
2086
2084
|
}
|
|
2087
2085
|
async isValidType(e, t, r) {
|
|
2088
2086
|
const { column: i, row: s, unitId: n, subUnitId: l } = e, u = await this._customFormulaService.getCellFormulaValue(n, l, r.uid, s, i), d = u == null ? void 0 : u.v;
|
|
2089
|
-
return O(String(d)) && E.isDefine(d) && d !== "" ? u.t ===
|
|
2087
|
+
return O(String(d)) && E.isDefine(d) && d !== "" ? u.t === Tt.BOOLEAN ? !!d : typeof d == "boolean" ? d : typeof d == "number" ? !!d : typeof d == "string" ? O(d) : !!d : !1;
|
|
2090
2088
|
}
|
|
2091
2089
|
generateRuleErrorMessage(e) {
|
|
2092
2090
|
return this.localeService.t("dataValidation.custom.error");
|
|
@@ -2096,7 +2094,7 @@ class Ia extends G {
|
|
|
2096
2094
|
return this.localeService.t("dataValidation.custom.ruleName").replace("{FORMULA1}", (t = e.formula1) != null ? t : "");
|
|
2097
2095
|
}
|
|
2098
2096
|
}
|
|
2099
|
-
class
|
|
2097
|
+
class Ia extends _t {
|
|
2100
2098
|
constructor() {
|
|
2101
2099
|
super(...arguments);
|
|
2102
2100
|
m(this, "id", T.LIST_MULTIPLE);
|
|
@@ -2105,7 +2103,7 @@ class Da extends _t {
|
|
|
2105
2103
|
m(this, "skipDefaultFontRender", () => !0);
|
|
2106
2104
|
}
|
|
2107
2105
|
}
|
|
2108
|
-
class
|
|
2106
|
+
class Da extends G {
|
|
2109
2107
|
constructor() {
|
|
2110
2108
|
super(...arguments);
|
|
2111
2109
|
m(this, "_customFormulaService", this.injector.get(P));
|
|
@@ -2156,7 +2154,7 @@ class Na extends G {
|
|
|
2156
2154
|
return {
|
|
2157
2155
|
success: !0
|
|
2158
2156
|
};
|
|
2159
|
-
const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l =
|
|
2157
|
+
const s = E.isDefine(e.formula1) && this._isFormulaOrInt(e.formula1), n = E.isDefine(e.formula2) && this._isFormulaOrInt(e.formula2), l = Ne.includes(i), u = this.localeService.t("dataValidation.validFail.number");
|
|
2160
2158
|
return l ? {
|
|
2161
2159
|
success: s && n,
|
|
2162
2160
|
formula1: s ? void 0 : u,
|
|
@@ -2169,16 +2167,16 @@ class Na extends G {
|
|
|
2169
2167
|
generateRuleErrorMessage(e, t) {
|
|
2170
2168
|
if (!e.operator)
|
|
2171
2169
|
return this.localeService.t(Me.NONE).replace("{TYPE}", this.titleStr);
|
|
2172
|
-
const { transformedFormula1: r, transformedFormula2: i } =
|
|
2170
|
+
const { transformedFormula1: r, transformedFormula2: i } = be(this._lexerTreeBuilder, e, t);
|
|
2173
2171
|
return `${this.localeService.t(Me[e.operator]).replace(le, r != null ? r : "").replace(ue, i != null ? i : "")}`;
|
|
2174
2172
|
}
|
|
2175
2173
|
}
|
|
2176
|
-
var
|
|
2177
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2174
|
+
var Na = Object.getOwnPropertyDescriptor, ba = (o, a, e, t) => {
|
|
2175
|
+
for (var r = t > 1 ? void 0 : t ? Na(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2178
2176
|
(s = o[i]) && (r = s(r) || r);
|
|
2179
2177
|
return r;
|
|
2180
2178
|
}, te = (o, a) => (e, t) => a(e, t, o);
|
|
2181
|
-
let we = class extends
|
|
2179
|
+
let we = class extends Ft {
|
|
2182
2180
|
constructor(o, a, e, t, r, i) {
|
|
2183
2181
|
super(), this._univerInstanceService = o, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
|
|
2184
2182
|
}
|
|
@@ -2187,31 +2185,31 @@ let we = class extends Ct {
|
|
|
2187
2185
|
}
|
|
2188
2186
|
_registerValidators() {
|
|
2189
2187
|
[
|
|
2190
|
-
|
|
2191
|
-
na,
|
|
2192
|
-
Na,
|
|
2193
|
-
ca,
|
|
2188
|
+
wa,
|
|
2194
2189
|
sa,
|
|
2195
|
-
ra,
|
|
2196
|
-
_t,
|
|
2197
2190
|
Da,
|
|
2198
|
-
|
|
2191
|
+
da,
|
|
2192
|
+
oa,
|
|
2193
|
+
aa,
|
|
2194
|
+
_t,
|
|
2195
|
+
Ia,
|
|
2196
|
+
Aa
|
|
2199
2197
|
].forEach((o) => {
|
|
2200
2198
|
const a = this._injector.createInstance(o);
|
|
2201
|
-
this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(
|
|
2199
|
+
this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(qe(() => this._injector.delete(o)));
|
|
2202
2200
|
});
|
|
2203
2201
|
}
|
|
2204
2202
|
_initCommandInterceptor() {
|
|
2205
2203
|
this._sheetInterceptorService.interceptCommand({
|
|
2206
2204
|
getMutations: (o) => {
|
|
2207
2205
|
var a;
|
|
2208
|
-
if (o.id ===
|
|
2206
|
+
if (o.id === qt.id) {
|
|
2209
2207
|
const e = this._univerInstanceService.getCurrentUnitForType(C.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
|
|
2210
2208
|
if (!r)
|
|
2211
2209
|
throw new Error("No active sheet found");
|
|
2212
2210
|
const i = r.getSheetId(), s = (a = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : a.map((c) => c.range), n = this._sheetDataValidationModel.getRuleObjectMatrix(t, i).clone();
|
|
2213
2211
|
s && n.removeRange(s);
|
|
2214
|
-
const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } =
|
|
2212
|
+
const l = n.diff(this._sheetDataValidationModel.getRules(t, i)), { redoMutations: u, undoMutations: d } = Le(t, i, l, this._injector, "patched");
|
|
2215
2213
|
return {
|
|
2216
2214
|
undos: d,
|
|
2217
2215
|
redos: u
|
|
@@ -2225,16 +2223,16 @@ let we = class extends Ct {
|
|
|
2225
2223
|
});
|
|
2226
2224
|
}
|
|
2227
2225
|
};
|
|
2228
|
-
we =
|
|
2226
|
+
we = ba([
|
|
2229
2227
|
te(0, w),
|
|
2230
2228
|
te(1, R(q)),
|
|
2231
|
-
te(2, R(
|
|
2229
|
+
te(2, R(Ge)),
|
|
2232
2230
|
te(3, R(ct)),
|
|
2233
2231
|
te(4, R(dt)),
|
|
2234
2232
|
te(5, R(F))
|
|
2235
2233
|
], we);
|
|
2236
|
-
var
|
|
2237
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2234
|
+
var La = Object.getOwnPropertyDescriptor, Ua = (o, a, e, t) => {
|
|
2235
|
+
for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2238
2236
|
(s = o[i]) && (r = s(r) || r);
|
|
2239
2237
|
return r;
|
|
2240
2238
|
}, ve = (o, a) => (e, t) => a(e, t, o);
|
|
@@ -2259,7 +2257,7 @@ let Ae = class extends W {
|
|
|
2259
2257
|
});
|
|
2260
2258
|
});
|
|
2261
2259
|
};
|
|
2262
|
-
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(
|
|
2260
|
+
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Gt(() => this._lifecycleService.lifecycle$.pipe(Je((a) => a === Ze.Rendered)))).subscribe(o)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(Je(() => this._lifecycleService.stage >= Ze.Rendered), Ot(20)).subscribe(o));
|
|
2263
2261
|
}
|
|
2264
2262
|
async _validatorByCell(o, a, e, t) {
|
|
2265
2263
|
const r = o.getUnitId(), i = a.getSheetId();
|
|
@@ -2335,22 +2333,22 @@ Ae = Ua([
|
|
|
2335
2333
|
ve(0, w),
|
|
2336
2334
|
ve(1, R(F)),
|
|
2337
2335
|
ve(2, R(Q)),
|
|
2338
|
-
ve(3, R(
|
|
2336
|
+
ve(3, R(Ct))
|
|
2339
2337
|
], Ae);
|
|
2340
|
-
var
|
|
2341
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2338
|
+
var Ba = Object.defineProperty, xa = Object.getOwnPropertyDescriptor, Ha = (o, a, e) => a in o ? Ba(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e, Pa = (o, a, e, t) => {
|
|
2339
|
+
for (var r = t > 1 ? void 0 : t ? xa(a, e) : a, i = o.length - 1, s; i >= 0; i--)
|
|
2342
2340
|
(s = o[i]) && (r = s(r) || r);
|
|
2343
2341
|
return r;
|
|
2344
|
-
},
|
|
2345
|
-
let Ie = class extends
|
|
2342
|
+
}, je = (o, a) => (e, t) => a(e, t, o), vt = (o, a, e) => Ha(o, typeof a != "symbol" ? a + "" : a, e);
|
|
2343
|
+
let Ie = class extends It {
|
|
2346
2344
|
constructor(o = rt, a, e, t) {
|
|
2347
2345
|
super(), this._config = o, this._injector = a, this._commandService = e, this._configService = t;
|
|
2348
|
-
const { ...r } =
|
|
2346
|
+
const { ...r } = Dt(
|
|
2349
2347
|
{},
|
|
2350
2348
|
rt,
|
|
2351
2349
|
this._config
|
|
2352
2350
|
);
|
|
2353
|
-
this._configService.setConfig(
|
|
2351
|
+
this._configService.setConfig(Va, r);
|
|
2354
2352
|
}
|
|
2355
2353
|
onStarting() {
|
|
2356
2354
|
[
|
|
@@ -2367,13 +2365,13 @@ let Ie = class extends Dt {
|
|
|
2367
2365
|
].forEach((o) => {
|
|
2368
2366
|
this._injector.add(o);
|
|
2369
2367
|
}), [
|
|
2370
|
-
ma,
|
|
2371
2368
|
ha,
|
|
2369
|
+
ca,
|
|
2370
|
+
ma,
|
|
2372
2371
|
ga,
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
pa
|
|
2372
|
+
va,
|
|
2373
|
+
pa,
|
|
2374
|
+
_a
|
|
2377
2375
|
].forEach((o) => {
|
|
2378
2376
|
this._commandService.registerCommand(o);
|
|
2379
2377
|
}), this._injector.get(Q), this._injector.get(Ae), this._injector.get(we), this._injector.get(Fe), this._injector.get(Ce);
|
|
@@ -2385,15 +2383,15 @@ let Ie = class extends Dt {
|
|
|
2385
2383
|
this._injector.get(Te);
|
|
2386
2384
|
}
|
|
2387
2385
|
};
|
|
2388
|
-
vt(Ie, "pluginName",
|
|
2386
|
+
vt(Ie, "pluginName", Ra);
|
|
2389
2387
|
vt(Ie, "type", C.UNIVER_SHEET);
|
|
2390
|
-
Ie =
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2388
|
+
Ie = Pa([
|
|
2389
|
+
wt(Ut),
|
|
2390
|
+
je(1, R(Ge)),
|
|
2391
|
+
je(2, U),
|
|
2392
|
+
je(3, At)
|
|
2395
2393
|
], Ie);
|
|
2396
|
-
function
|
|
2394
|
+
function Ka(o) {
|
|
2397
2395
|
const e = o.get(ct).getCurrentSelections().map((i) => i.range);
|
|
2398
2396
|
return {
|
|
2399
2397
|
uid: st(6),
|
|
@@ -2403,43 +2401,43 @@ function za(o) {
|
|
|
2403
2401
|
ranges: e != null ? e : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
|
|
2404
2402
|
};
|
|
2405
2403
|
}
|
|
2406
|
-
const
|
|
2404
|
+
const za = "data-validation.custom-formula-input", Za = "data-validation.formula-input", Ja = "data-validation.list-formula-input", er = "data-validation.checkbox-formula-input";
|
|
2407
2405
|
export {
|
|
2408
|
-
|
|
2409
|
-
|
|
2406
|
+
ha as AddSheetDataValidationCommand,
|
|
2407
|
+
Za as BASE_FORMULA_INPUT_NAME,
|
|
2410
2408
|
Ee as CHECKBOX_FORMULA_1,
|
|
2411
2409
|
Ve as CHECKBOX_FORMULA_2,
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2410
|
+
er as CHECKBOX_FORMULA_INPUT_NAME,
|
|
2411
|
+
za as CUSTOM_FORMULA_INPUT_NAME,
|
|
2412
|
+
aa as CheckboxValidator,
|
|
2413
|
+
_a as ClearRangeDataValidationCommand,
|
|
2414
|
+
Ra as DATA_VALIDATION_PLUGIN_NAME,
|
|
2417
2415
|
Q as DataValidationCacheService,
|
|
2418
2416
|
P as DataValidationCustomFormulaService,
|
|
2419
2417
|
Te as DataValidationFormulaController,
|
|
2420
2418
|
K as DataValidationFormulaService,
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2419
|
+
oa as DateValidator,
|
|
2420
|
+
Ja as LIST_FORMULA_INPUT_NAME,
|
|
2421
|
+
Ia as ListMultipleValidator,
|
|
2424
2422
|
_t as ListValidator,
|
|
2425
|
-
|
|
2426
|
-
|
|
2423
|
+
pa as RemoveSheetAllDataValidationCommand,
|
|
2424
|
+
va as RemoveSheetDataValidationCommand,
|
|
2427
2425
|
F as SheetDataValidationModel,
|
|
2428
2426
|
Ae as SheetsDataValidationValidatorService,
|
|
2429
2427
|
Ie as UniverSheetsDataValidationPlugin,
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2428
|
+
ga as UpdateSheetDataValidationOptionsCommand,
|
|
2429
|
+
ca as UpdateSheetDataValidationRangeCommand,
|
|
2430
|
+
ma as UpdateSheetDataValidationSettingCommand,
|
|
2431
|
+
Ka as createDefaultNewRule,
|
|
2434
2432
|
fe as deserializeListOptions,
|
|
2435
2433
|
ye as getCellValueNumber,
|
|
2436
2434
|
ne as getCellValueOrigin,
|
|
2437
|
-
|
|
2438
|
-
|
|
2435
|
+
Xa as getDataValidationCellValue,
|
|
2436
|
+
Le as getDataValidationDiffMutations,
|
|
2439
2437
|
_e as getFormulaCellData,
|
|
2440
2438
|
oe as getFormulaResult,
|
|
2441
|
-
|
|
2439
|
+
be as getTransformedFormula,
|
|
2442
2440
|
O as isLegalFormulaResult,
|
|
2443
|
-
|
|
2441
|
+
Ya as serializeListOptions,
|
|
2444
2442
|
pe as transformCheckboxValue
|
|
2445
2443
|
};
|