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