@univerjs/sheets-data-validation 0.13.0 → 0.14.0
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 +229 -229
- package/lib/index.js +229 -229
- package/lib/types/services/dv-custom-formula.service.d.ts +1 -1
- package/lib/types/services/dv-formula.service.d.ts +1 -1
- package/lib/types/services/dv-list-cache.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
package/lib/es/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (s, a, e) =>
|
|
4
|
-
import { Inject as v, ICommandService as U, IUniverInstanceService as D, Disposable as B, ObjectMatrix as Me, getIntersectRange as ot, UniverInstanceType as N, Range as H, Rectangle as
|
|
5
|
-
import { DataValidationModel as de, DataValidatorRegistryService as q, UpdateRuleType as V, BaseDataValidator as Y, TextLengthErrorTitleMap as
|
|
6
|
-
import { ERROR_TYPE_SET as
|
|
7
|
-
import { SetRangeValuesMutation as ne, RemoveSheetMutation as
|
|
8
|
-
import { Subject as Ye, bufferWhen as
|
|
9
|
-
import {
|
|
10
|
-
var
|
|
11
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1
|
+
var Mt = Object.defineProperty;
|
|
2
|
+
var Vt = (s, a, e) => a in s ? Mt(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e;
|
|
3
|
+
var m = (s, a, e) => Vt(s, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import { Inject as v, ICommandService as U, IUniverInstanceService as D, Disposable as B, ObjectMatrix as Me, getIntersectRange as ot, UniverInstanceType as N, Range as H, Rectangle as w, isFormulaString as S, getOriginCellValue as yt, Injector as be, numfmt as L, DataValidationType as T, RBush as Tt, debounce as Ct, Tools as M, DataValidationStatus as A, WrapStrategy as Se, DataValidationOperator as h, dayjs as nt, DataValidationRenderMode as We, CommandType as z, IUndoRedoService as Z, sequenceExecute as Le, isRangesEqual as lt, IPermissionService as Ft, generateRandomId as Xe, toDisposable as Ke, CellValueType as Nt, RxDisposable as Ot, LifecycleService as wt, LifecycleStages as et, bufferDebounceTime as At, DependentOn as It, IConfigService as Dt, Plugin as bt, merge as Lt } from "@univerjs/core";
|
|
5
|
+
import { DataValidationModel as de, DataValidatorRegistryService as q, UpdateRuleType as V, BaseDataValidator as Y, TextLengthErrorTitleMap as Ut, AddDataValidationMutation as b, RemoveDataValidationMutation as I, UpdateDataValidationMutation as y, getRuleSetting as Bt, getRuleOptions as xt, UniverDataValidationPlugin as Pt } from "@univerjs/data-validation";
|
|
6
|
+
import { ERROR_TYPE_SET as Ht, RegisterOtherFormulaService as ut, OtherFormulaBizType as ct, LexerTreeBuilder as X, isReferenceString as dt, sequenceNodeType as Wt, deserializeRangeWithSheet as $t, deserializeRangeWithSheetWithCache as kt, operatorToken as jt } from "@univerjs/engine-formula";
|
|
7
|
+
import { SetRangeValuesMutation as ne, RemoveSheetMutation as ht, getSheetCommandTarget as ze, SetRangeValuesUndoMutationFactory as mt, WorksheetViewPermission as Qt, RefRangeService as Gt, handleCommonDefaultRangeChangeWithEffectRefCommands as qt, SheetInterceptorService as gt, RemoveSheetCommand as Yt, CopySheetCommand as Xt, SheetsSelectionsService as pt, ClearSelectionAllCommand as Kt } from "@univerjs/sheets";
|
|
8
|
+
import { Subject as Ye, bufferWhen as zt, filter as tt } from "rxjs";
|
|
9
|
+
import { FormulaRefRangeService as ft, UniverSheetsFormulaPlugin as Zt } from "@univerjs/sheets-formula";
|
|
10
|
+
var Jt = Object.getOwnPropertyDescriptor, ea = (s, a, e, t) => {
|
|
11
|
+
for (var r = t > 1 ? void 0 : t ? Jt(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
12
12
|
(o = s[i]) && (r = o(r) || r);
|
|
13
13
|
return r;
|
|
14
14
|
}, $e = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -36,7 +36,7 @@ let Q = class extends B {
|
|
|
36
36
|
_initSheetRemove() {
|
|
37
37
|
this.disposeWithMe(this._commandService.onCommandExecuted((a) => {
|
|
38
38
|
var e;
|
|
39
|
-
if (a.id ===
|
|
39
|
+
if (a.id === ht.id) {
|
|
40
40
|
const { unitId: t, subUnitId: r } = a.params;
|
|
41
41
|
(e = this._cacheMatrix.get(t)) == null || e.delete(r);
|
|
42
42
|
}
|
|
@@ -79,7 +79,7 @@ let Q = class extends B {
|
|
|
79
79
|
return this._ensureCache(a, e).getValue(t, r);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
Q =
|
|
82
|
+
Q = ea([
|
|
83
83
|
$e(0, v(U)),
|
|
84
84
|
$e(1, v(D)),
|
|
85
85
|
$e(2, v(de))
|
|
@@ -92,16 +92,16 @@ function _e(s) {
|
|
|
92
92
|
var a;
|
|
93
93
|
return (a = s == null ? void 0 : s[0]) == null ? void 0 : a[0];
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return !
|
|
95
|
+
function C(s) {
|
|
96
|
+
return !Ht.has(s);
|
|
97
97
|
}
|
|
98
98
|
function he(s, a) {
|
|
99
99
|
var t;
|
|
100
100
|
const e = a.getValidatorItem(s);
|
|
101
101
|
return (t = e == null ? void 0 : e.offsetFormulaByRange) != null ? t : !1;
|
|
102
102
|
}
|
|
103
|
-
var
|
|
104
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
103
|
+
var ta = Object.getOwnPropertyDescriptor, aa = (s, a, e, t) => {
|
|
104
|
+
for (var r = t > 1 ? void 0 : t ? ta(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
105
105
|
(o = s[i]) && (r = o(r) || r);
|
|
106
106
|
return r;
|
|
107
107
|
}, se = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -143,12 +143,12 @@ let W = class extends B {
|
|
|
143
143
|
return o || (o = /* @__PURE__ */ new Map(), r.set(e, o)), { ruleFormulaMap: i, ruleFormulaMap2: o };
|
|
144
144
|
}
|
|
145
145
|
_registerFormula(a, e, t, r, i) {
|
|
146
|
-
return this._registerOtherFormulaService.registerFormulaWithRange(a, e, r, i, { ruleId: t });
|
|
146
|
+
return this._registerOtherFormulaService.registerFormulaWithRange(a, e, r, i, { ruleId: t }, ct.DATA_VALIDATION_CUSTOM, t);
|
|
147
147
|
}
|
|
148
148
|
_handleDirtyRanges(a, e, t) {
|
|
149
149
|
this._dataValidationModel.getRules(a, e).forEach((i) => {
|
|
150
150
|
const o = i.ranges;
|
|
151
|
-
|
|
151
|
+
w.doAnyRangesIntersect(o, t) && this.makeRuleDirty(a, e, i.uid);
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
_initDirtyRanges() {
|
|
@@ -234,27 +234,27 @@ let W = class extends B {
|
|
|
234
234
|
r && this._registerOtherFormulaService.markFormulaDirty(a, e, r.formulaId), i && this._registerOtherFormulaService.markFormulaDirty(a, e, i.formulaId);
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
W =
|
|
237
|
+
W = aa([
|
|
238
238
|
se(0, D),
|
|
239
|
-
se(1, v(
|
|
239
|
+
se(1, v(ut)),
|
|
240
240
|
se(2, v(de)),
|
|
241
241
|
se(3, v(Q)),
|
|
242
242
|
se(4, v(q))
|
|
243
243
|
], W);
|
|
244
244
|
function re(s) {
|
|
245
|
-
return
|
|
245
|
+
return yt(s);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function _t(s) {
|
|
248
248
|
var a;
|
|
249
249
|
return String((a = re(s)) != null ? a : "");
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function ar(s) {
|
|
252
252
|
return s.filter(Boolean).join(",");
|
|
253
253
|
}
|
|
254
254
|
function Ee(s) {
|
|
255
255
|
return s.split(",").filter(Boolean);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function rr(s) {
|
|
258
258
|
const a = re(s);
|
|
259
259
|
return a == null ? "" : a.toString();
|
|
260
260
|
}
|
|
@@ -265,8 +265,8 @@ function Ue(s, a, e) {
|
|
|
265
265
|
transformedFormula2: c
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
var
|
|
269
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
268
|
+
var ra = Object.getOwnPropertyDescriptor, ia = (s, a, e, t) => {
|
|
269
|
+
for (var r = t > 1 ? void 0 : t ? ra(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
270
270
|
(o = s[i]) && (r = o(r) || r);
|
|
271
271
|
return r;
|
|
272
272
|
}, at = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -357,19 +357,19 @@ let le = class extends B {
|
|
|
357
357
|
continue;
|
|
358
358
|
}
|
|
359
359
|
const g = typeof d == "string" ? d : String(d);
|
|
360
|
-
|
|
360
|
+
C(g) && e.add(g);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
return [...e];
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
|
-
le =
|
|
367
|
+
le = ia([
|
|
368
368
|
at(0, v(be)),
|
|
369
369
|
at(1, v(de))
|
|
370
370
|
], le);
|
|
371
|
-
var
|
|
372
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
371
|
+
var sa = Object.getOwnPropertyDescriptor, oa = (s, a, e, t) => {
|
|
372
|
+
for (var r = t > 1 ? void 0 : t ? sa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
373
373
|
(o = s[i]) && (r = o(r) || r);
|
|
374
374
|
return r;
|
|
375
375
|
}, ee = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -406,10 +406,10 @@ let G = class extends B {
|
|
|
406
406
|
}
|
|
407
407
|
_registerSingleFormula(a, e, t, r) {
|
|
408
408
|
const i = [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }];
|
|
409
|
-
return this._registerOtherFormulaService.registerFormulaWithRange(a, e, t, i, { ruleId: r });
|
|
409
|
+
return this._registerOtherFormulaService.registerFormulaWithRange(a, e, t, i, { ruleId: r }, ct.DATA_VALIDATION, r);
|
|
410
410
|
}
|
|
411
411
|
addRule(a, e, t) {
|
|
412
|
-
if (!he(t.type, this._validatorRegistryService) && t.type !==
|
|
412
|
+
if (!he(t.type, this._validatorRegistryService) && t.type !== T.CHECKBOX) {
|
|
413
413
|
const { formula1: r, formula2: i, uid: o } = t, n = S(r), l = S(i);
|
|
414
414
|
if (!n && !l)
|
|
415
415
|
return;
|
|
@@ -454,9 +454,9 @@ let G = class extends B {
|
|
|
454
454
|
return this._ensureRuleFormulaMap(a, e).get(t);
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
|
-
G =
|
|
457
|
+
G = oa([
|
|
458
458
|
ee(0, D),
|
|
459
|
-
ee(1, v(
|
|
459
|
+
ee(1, v(ut)),
|
|
460
460
|
ee(2, v(Q)),
|
|
461
461
|
ee(3, v(de)),
|
|
462
462
|
ee(4, v(q)),
|
|
@@ -465,7 +465,7 @@ G = ia([
|
|
|
465
465
|
class Ze {
|
|
466
466
|
constructor(a, e, t, r, i = !1) {
|
|
467
467
|
m(this, "_map");
|
|
468
|
-
m(this, "_tree", new
|
|
468
|
+
m(this, "_tree", new Tt());
|
|
469
469
|
m(this, "_dirty", !0);
|
|
470
470
|
m(this, "_buildTree", () => {
|
|
471
471
|
if (!this._dirty || this._disableTree)
|
|
@@ -494,9 +494,9 @@ class Ze {
|
|
|
494
494
|
_addRule(a, e) {
|
|
495
495
|
if (!this._worksheet)
|
|
496
496
|
return;
|
|
497
|
-
const t =
|
|
497
|
+
const t = w.mergeRanges(e.map((r) => H.transformRange(r, this._worksheet)));
|
|
498
498
|
this._map.forEach((r, i) => {
|
|
499
|
-
const o =
|
|
499
|
+
const o = w.subtractMulti(r, t);
|
|
500
500
|
o.length === 0 ? this._map.delete(i) : this._map.set(i, o);
|
|
501
501
|
}), this._dirty = !0, this._map.set(a, t), this._debonceBuildTree();
|
|
502
502
|
}
|
|
@@ -508,7 +508,7 @@ class Ze {
|
|
|
508
508
|
return;
|
|
509
509
|
const e = a.map((t) => H.transformRange(t, this._worksheet));
|
|
510
510
|
this._map.forEach((t, r) => {
|
|
511
|
-
const i =
|
|
511
|
+
const i = w.subtractMulti(t, e);
|
|
512
512
|
i.length === 0 ? this._map.delete(r) : this._map.set(r, i);
|
|
513
513
|
}), this._dirty = !0, this._debonceBuildTree();
|
|
514
514
|
}
|
|
@@ -526,10 +526,10 @@ class Ze {
|
|
|
526
526
|
if (!t.length)
|
|
527
527
|
return;
|
|
528
528
|
let r = this._map.get(e);
|
|
529
|
-
r ? (this._map.set(e,
|
|
529
|
+
r ? (this._map.set(e, w.mergeRanges([...r, ...t])), r = this._map.get(e)) : (r = t, this._map.set(e, r)), this._map.forEach((i, o) => {
|
|
530
530
|
if (o === e)
|
|
531
531
|
return;
|
|
532
|
-
const n =
|
|
532
|
+
const n = w.subtractMulti(i, t);
|
|
533
533
|
n.length === 0 ? this._map.delete(o) : this._map.set(o, n);
|
|
534
534
|
});
|
|
535
535
|
}), this._dirty = !0, this._debonceBuildTree();
|
|
@@ -540,11 +540,11 @@ class Ze {
|
|
|
540
540
|
return a.forEach((r, i) => {
|
|
541
541
|
var l;
|
|
542
542
|
const o = (l = this._map.get(r.uid)) != null ? l : [], n = r.ranges;
|
|
543
|
-
o.length !== 0 && (o.length !== n.length || o.some((u, c) => !
|
|
543
|
+
o.length !== 0 && (o.length !== n.length || o.some((u, c) => !w.equals(u, n[c]))) && e.push({
|
|
544
544
|
type: "update",
|
|
545
545
|
ruleId: r.uid,
|
|
546
546
|
oldRanges: n,
|
|
547
|
-
newRanges:
|
|
547
|
+
newRanges: w.sort(o),
|
|
548
548
|
rule: r
|
|
549
549
|
}), o.length === 0 && (e.push({
|
|
550
550
|
type: "delete",
|
|
@@ -559,11 +559,11 @@ class Ze {
|
|
|
559
559
|
return a.forEach((i, o) => {
|
|
560
560
|
var u;
|
|
561
561
|
const n = (u = this._map.get(i.uid)) != null ? u : [], l = i.ranges;
|
|
562
|
-
n.length !== 0 && (n.length !== l.length || n.some((c, d) => !
|
|
562
|
+
n.length !== 0 && (n.length !== l.length || n.some((c, d) => !w.equals(c, l[d]))) && t.push({
|
|
563
563
|
type: "update",
|
|
564
564
|
ruleId: i.uid,
|
|
565
565
|
oldRanges: l,
|
|
566
|
-
newRanges:
|
|
566
|
+
newRanges: w.sort(n),
|
|
567
567
|
rule: i
|
|
568
568
|
}), n.length === 0 && (t.push({
|
|
569
569
|
type: "delete",
|
|
@@ -577,7 +577,7 @@ class Ze {
|
|
|
577
577
|
type: "add",
|
|
578
578
|
rule: {
|
|
579
579
|
...i,
|
|
580
|
-
ranges:
|
|
580
|
+
ranges: w.sort(o)
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
}), t;
|
|
@@ -603,8 +603,8 @@ class Ze {
|
|
|
603
603
|
return t.length > 0 ? t[0].ruleId : void 0;
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
var
|
|
607
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
606
|
+
var na = Object.getOwnPropertyDescriptor, la = (s, a, e, t) => {
|
|
607
|
+
for (var r = t > 1 ? void 0 : t ? na(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
608
608
|
(o = s[i]) && (r = o(r) || r);
|
|
609
609
|
return r;
|
|
610
610
|
}, K = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -627,7 +627,7 @@ let F = class extends B {
|
|
|
627
627
|
})
|
|
628
628
|
), this.disposeWithMe(
|
|
629
629
|
this._commandService.onCommandExecuted((a) => {
|
|
630
|
-
if (a.id ===
|
|
630
|
+
if (a.id === ht.id) {
|
|
631
631
|
const { unitId: e, subUnitId: t } = a.params, r = this._ruleMatrixMap.get(e);
|
|
632
632
|
r && r.delete(t);
|
|
633
633
|
}
|
|
@@ -725,8 +725,8 @@ let F = class extends B {
|
|
|
725
725
|
},
|
|
726
726
|
a
|
|
727
727
|
).then((E) => {
|
|
728
|
-
const _ = E ? A.VALID : A.INVALID,
|
|
729
|
-
_ === A.VALID ? p.realDeleteValue(i, r) : p.setValue(i, r, _), u(_, R !==
|
|
728
|
+
const _ = E ? A.VALID : A.INVALID, O = p.getValue(i, r);
|
|
729
|
+
_ === A.VALID ? p.realDeleteValue(i, r) : p.setValue(i, r, _), u(_, R !== O);
|
|
730
730
|
}), A.VALIDATING) : (u(R != null ? R : A.VALID, !1), R != null ? R : A.VALID);
|
|
731
731
|
} else
|
|
732
732
|
return u(A.VALID, !1), A.VALID;
|
|
@@ -756,7 +756,7 @@ let F = class extends B {
|
|
|
756
756
|
return this._dataValidationModel.getAll();
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
|
-
F =
|
|
759
|
+
F = la([
|
|
760
760
|
K(0, v(de)),
|
|
761
761
|
K(1, D),
|
|
762
762
|
K(2, v(q)),
|
|
@@ -770,10 +770,10 @@ function rt(s, a) {
|
|
|
770
770
|
return M.isBlank(s) ? a.t("dataValidation.validFail.value") : S(s) ? a.t("dataValidation.validFail.primitive") : "";
|
|
771
771
|
}
|
|
772
772
|
const ve = (s) => M.isDefine(s) && String(s).toLowerCase() === "true" ? "1" : String(s).toLowerCase() === "false" ? "0" : s;
|
|
773
|
-
class
|
|
773
|
+
class ua extends Y {
|
|
774
774
|
constructor() {
|
|
775
775
|
super(...arguments);
|
|
776
|
-
m(this, "id",
|
|
776
|
+
m(this, "id", T.CHECKBOX);
|
|
777
777
|
m(this, "title", "dataValidation.checkbox.title");
|
|
778
778
|
m(this, "operators", []);
|
|
779
779
|
m(this, "scopes", ["sheet"]);
|
|
@@ -806,7 +806,7 @@ class na extends Y {
|
|
|
806
806
|
}
|
|
807
807
|
async parseFormula(e, t, r) {
|
|
808
808
|
var d, g, f, p;
|
|
809
|
-
const { formula1: i = Ve, formula2: o = ye } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = S(i) ? oe((g = (d = n == null ? void 0 : n[0]) == null ? void 0 : d.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : o, c =
|
|
809
|
+
const { formula1: i = Ve, formula2: o = ye } = e, n = await this._formulaService.getRuleFormulaResult(t, r, e.uid), l = S(i) ? oe((g = (d = n == null ? void 0 : n[0]) == null ? void 0 : d.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : o, c = C(String(l)) && C(String(u));
|
|
810
810
|
return {
|
|
811
811
|
formula1: ve(l),
|
|
812
812
|
formula2: ve(u),
|
|
@@ -822,7 +822,7 @@ class na extends Y {
|
|
|
822
822
|
}
|
|
823
823
|
parseFormulaSync(e, t, r) {
|
|
824
824
|
var d, g, f, p;
|
|
825
|
-
const { formula1: i = Ve, formula2: o = ye } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = S(i) ? oe((g = (d = n == null ? void 0 : n[0]) == null ? void 0 : d.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : o, c =
|
|
825
|
+
const { formula1: i = Ve, formula2: o = ye } = e, n = this._formulaService.getRuleFormulaResultSync(t, r, e.uid), l = S(i) ? oe((g = (d = n == null ? void 0 : n[0]) == null ? void 0 : d.result) == null ? void 0 : g[0][0]) : i, u = S(o) ? oe((p = (f = n == null ? void 0 : n[1]) == null ? void 0 : f.result) == null ? void 0 : p[0][0]) : o, c = C(String(l)) && C(String(u));
|
|
826
826
|
return {
|
|
827
827
|
formula1: ve(l),
|
|
828
828
|
formula2: ve(u),
|
|
@@ -842,7 +842,7 @@ class na extends Y {
|
|
|
842
842
|
return this.titleStr;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
const
|
|
845
|
+
const ca = {
|
|
846
846
|
[h.BETWEEN]: "dataValidation.date.operators.between",
|
|
847
847
|
[h.EQUAL]: "dataValidation.date.operators.equal",
|
|
848
848
|
[h.GREATER_THAN]: "dataValidation.date.operators.greaterThan",
|
|
@@ -863,7 +863,7 @@ const it = {
|
|
|
863
863
|
[h.NOT_BETWEEN]: "dataValidation.date.ruleName.notBetween",
|
|
864
864
|
[h.NOT_EQUAL]: "dataValidation.date.ruleName.notEqual",
|
|
865
865
|
NONE: "dataValidation.date.ruleName.legal"
|
|
866
|
-
},
|
|
866
|
+
}, da = {
|
|
867
867
|
[h.BETWEEN]: "dataValidation.date.errorMsg.between",
|
|
868
868
|
[h.EQUAL]: "dataValidation.date.errorMsg.equal",
|
|
869
869
|
[h.GREATER_THAN]: "dataValidation.date.errorMsg.greaterThan",
|
|
@@ -885,10 +885,10 @@ const it = {
|
|
|
885
885
|
const a = (e = L.parseDate(s)) == null ? void 0 : e.v;
|
|
886
886
|
return M.isDefine(a) ? a : (t = L.parseDate(nt(s).format("YYYY-MM-DD HH:mm:ss"))) == null ? void 0 : t.v;
|
|
887
887
|
};
|
|
888
|
-
class
|
|
888
|
+
class ha extends Y {
|
|
889
889
|
constructor() {
|
|
890
890
|
super(...arguments);
|
|
891
|
-
m(this, "id",
|
|
891
|
+
m(this, "id", T.DATE);
|
|
892
892
|
m(this, "title", "dataValidation.date.title");
|
|
893
893
|
m(this, "order", 40);
|
|
894
894
|
m(this, "operators", [
|
|
@@ -906,7 +906,7 @@ class ca extends Y {
|
|
|
906
906
|
m(this, "_lexerTreeBuilder", this.injector.get(X));
|
|
907
907
|
}
|
|
908
908
|
async parseFormula(e, t, r, i, o) {
|
|
909
|
-
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d =
|
|
909
|
+
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
|
|
910
910
|
return {
|
|
911
911
|
formula1: ke(S(u) ? n == null ? void 0 : n.v : u),
|
|
912
912
|
formula2: ke(S(c) ? l == null ? void 0 : l.v : c),
|
|
@@ -969,7 +969,7 @@ class ca extends Y {
|
|
|
969
969
|
};
|
|
970
970
|
}
|
|
971
971
|
get operatorNames() {
|
|
972
|
-
return this.operators.map((e) => this.localeService.t(
|
|
972
|
+
return this.operators.map((e) => this.localeService.t(ca[e]));
|
|
973
973
|
}
|
|
974
974
|
generateRuleName(e) {
|
|
975
975
|
var r, i;
|
|
@@ -982,12 +982,12 @@ class ca extends Y {
|
|
|
982
982
|
if (!e.operator)
|
|
983
983
|
return this.titleStr;
|
|
984
984
|
const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
|
|
985
|
-
return `${this.localeService.t(
|
|
985
|
+
return `${this.localeService.t(da[e.operator]).replace(ue, r != null ? r : "").replace(ce, i != null ? i : "")}`;
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
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 + "";
|
|
989
989
|
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 + "";
|
|
990
|
-
const
|
|
990
|
+
const Te = {
|
|
991
991
|
[h.BETWEEN]: "dataValidation.errorMsg.between",
|
|
992
992
|
[h.EQUAL]: "dataValidation.errorMsg.equal",
|
|
993
993
|
[h.GREATER_THAN]: "dataValidation.errorMsg.greaterThan",
|
|
@@ -998,14 +998,14 @@ const Ce = {
|
|
|
998
998
|
[h.NOT_EQUAL]: "dataValidation.errorMsg.notEqual",
|
|
999
999
|
NONE: "dataValidation.errorMsg.legal"
|
|
1000
1000
|
};
|
|
1001
|
-
function
|
|
1001
|
+
function Ce(s) {
|
|
1002
1002
|
return +s;
|
|
1003
1003
|
}
|
|
1004
|
-
class
|
|
1004
|
+
class ma extends Y {
|
|
1005
1005
|
constructor() {
|
|
1006
1006
|
super(...arguments);
|
|
1007
1007
|
m(this, "_customFormulaService", this.injector.get(W));
|
|
1008
|
-
m(this, "id",
|
|
1008
|
+
m(this, "id", T.DECIMAL);
|
|
1009
1009
|
m(this, "_lexerTreeBuilder", this.injector.get(X));
|
|
1010
1010
|
m(this, "title", "dataValidation.decimal.title");
|
|
1011
1011
|
m(this, "order", 20);
|
|
@@ -1026,20 +1026,20 @@ class da extends Y {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
async isValidType(e, t, r) {
|
|
1028
1028
|
const { value: i } = e;
|
|
1029
|
-
return !Number.isNaN(
|
|
1029
|
+
return !Number.isNaN(Ce(i));
|
|
1030
1030
|
}
|
|
1031
1031
|
transform(e, t, r) {
|
|
1032
1032
|
const { value: i } = e;
|
|
1033
1033
|
return {
|
|
1034
1034
|
...e,
|
|
1035
|
-
value:
|
|
1035
|
+
value: Ce(i)
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
_parseNumber(e) {
|
|
1039
1039
|
return e == null ? Number.NaN : +e;
|
|
1040
1040
|
}
|
|
1041
1041
|
async parseFormula(e, t, r, i, o) {
|
|
1042
|
-
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d =
|
|
1042
|
+
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
|
|
1043
1043
|
return {
|
|
1044
1044
|
formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
|
|
1045
1045
|
formula2: this._parseNumber(S(c) ? l == null ? void 0 : l.v : c),
|
|
@@ -1064,12 +1064,12 @@ class da extends Y {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
generateRuleErrorMessage(e, t) {
|
|
1066
1066
|
if (!e.operator)
|
|
1067
|
-
return this.localeService.t(
|
|
1067
|
+
return this.localeService.t(Te.NONE).replace("{TYPE}", this.titleStr);
|
|
1068
1068
|
const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
|
|
1069
|
-
return `${this.localeService.t(
|
|
1069
|
+
return `${this.localeService.t(Te[e.operator]).replace(ue, r != null ? r : "").replace(ce, i != null ? i : "")}`;
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function ga(s) {
|
|
1073
1073
|
var e, t;
|
|
1074
1074
|
if (!s)
|
|
1075
1075
|
return [];
|
|
@@ -1085,34 +1085,34 @@ function ha(s) {
|
|
|
1085
1085
|
continue;
|
|
1086
1086
|
}
|
|
1087
1087
|
const d = typeof c == "string" ? c : String(c);
|
|
1088
|
-
|
|
1088
|
+
C(d) && a.add(d);
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
1092
|
return [...a];
|
|
1093
1093
|
}
|
|
1094
|
-
const
|
|
1094
|
+
const pa = [
|
|
1095
1095
|
"if",
|
|
1096
1096
|
"indirect",
|
|
1097
1097
|
"choose",
|
|
1098
1098
|
"offset"
|
|
1099
1099
|
];
|
|
1100
|
-
function
|
|
1101
|
-
if (!S(s) ||
|
|
1100
|
+
function fa(s, a) {
|
|
1101
|
+
if (!S(s) || dt(s.slice(1)))
|
|
1102
1102
|
return !0;
|
|
1103
1103
|
const t = a.sequenceNodesBuilder(s);
|
|
1104
|
-
return t && t.some((r) => typeof r == "object" && r.nodeType ===
|
|
1104
|
+
return t && t.some((r) => typeof r == "object" && r.nodeType === Wt.FUNCTION && pa.indexOf(r.token.toLowerCase()) > -1);
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function _a(s, a) {
|
|
1107
1107
|
const { formula1: e = "", ranges: t } = s;
|
|
1108
|
-
if (
|
|
1109
|
-
const i =
|
|
1110
|
-
if ((!i.sheetName || i.sheetName === a) && t.some((o) =>
|
|
1108
|
+
if (dt(e.slice(1))) {
|
|
1109
|
+
const i = $t(e.slice(1));
|
|
1110
|
+
if ((!i.sheetName || i.sheetName === a) && t.some((o) => w.intersects(o, i.range)))
|
|
1111
1111
|
return !0;
|
|
1112
1112
|
}
|
|
1113
1113
|
return !1;
|
|
1114
1114
|
}
|
|
1115
|
-
class
|
|
1115
|
+
class vt extends Y {
|
|
1116
1116
|
constructor() {
|
|
1117
1117
|
super(...arguments);
|
|
1118
1118
|
m(this, "formulaService", this.injector.get(G));
|
|
@@ -1121,7 +1121,7 @@ class _t extends Y {
|
|
|
1121
1121
|
m(this, "_listCacheService", this.injector.get(le));
|
|
1122
1122
|
m(this, "order", 50);
|
|
1123
1123
|
m(this, "offsetFormulaByRange", !1);
|
|
1124
|
-
m(this, "id",
|
|
1124
|
+
m(this, "id", T.LIST);
|
|
1125
1125
|
m(this, "title", "dataValidation.list.title");
|
|
1126
1126
|
m(this, "operators", []);
|
|
1127
1127
|
m(this, "scopes", ["sheet"]);
|
|
@@ -1129,7 +1129,7 @@ class _t extends Y {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
validatorFormula(e, t, r) {
|
|
1131
1131
|
var u, c, d;
|
|
1132
|
-
const i = !M.isBlank(e.formula1), o =
|
|
1132
|
+
const i = !M.isBlank(e.formula1), o = fa((u = e.formula1) != null ? u : "", this._lexer), n = (d = (c = this._univerInstanceService.getUnit(t, N.UNIVER_SHEET)) == null ? void 0 : c.getSheetBySheetId(r)) == null ? void 0 : d.getName(), l = _a(e, n != null ? n : "");
|
|
1133
1133
|
return {
|
|
1134
1134
|
success: !!(i && o && !l),
|
|
1135
1135
|
formula1: i ? o ? l ? this.localeService.t("dataValidation.validFail.listIntersects") : void 0 : this.localeService.t("dataValidation.validFail.listInvalid") : this.localeService.t("dataValidation.validFail.list")
|
|
@@ -1138,7 +1138,7 @@ class _t extends Y {
|
|
|
1138
1138
|
getExtraStyle(e, t, { style: r }) {
|
|
1139
1139
|
var o;
|
|
1140
1140
|
const i = (o = r.tb !== Se.OVERFLOW ? r.tb : Se.CLIP) != null ? o : Se.WRAP;
|
|
1141
|
-
if (e.type ===
|
|
1141
|
+
if (e.type === T.LIST && (e.renderMode === We.ARROW || e.renderMode === We.TEXT)) {
|
|
1142
1142
|
const n = this.getListWithColorMap(e), l = `${t != null ? t : ""}`, u = n[l];
|
|
1143
1143
|
if (u)
|
|
1144
1144
|
return {
|
|
@@ -1162,7 +1162,7 @@ class _t extends Y {
|
|
|
1162
1162
|
return {
|
|
1163
1163
|
formula1: void 0,
|
|
1164
1164
|
formula2: void 0,
|
|
1165
|
-
isFormulaValid:
|
|
1165
|
+
isFormulaValid: C(String(o))
|
|
1166
1166
|
};
|
|
1167
1167
|
}
|
|
1168
1168
|
async isValidType(e, t, r) {
|
|
@@ -1204,7 +1204,7 @@ class _t extends Y {
|
|
|
1204
1204
|
const { formula1: i = "" } = e, o = this._getUnitAndSubUnit(t, r);
|
|
1205
1205
|
if (!o) return [];
|
|
1206
1206
|
const { unitId: n, subUnitId: l } = o, u = await this.formulaService.getRuleFormulaResult(n, l, e.uid);
|
|
1207
|
-
return S(i) ?
|
|
1207
|
+
return S(i) ? ga((d = (c = u == null ? void 0 : u[0]) == null ? void 0 : c.result) == null ? void 0 : d[0][0]) : Ee(i);
|
|
1208
1208
|
}
|
|
1209
1209
|
getListWithColor(e, t, r) {
|
|
1210
1210
|
const i = this._getUnitAndSubUnit(t, r);
|
|
@@ -1227,10 +1227,10 @@ class _t extends Y {
|
|
|
1227
1227
|
).colorMap;
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
|
-
class
|
|
1230
|
+
class va extends Y {
|
|
1231
1231
|
constructor() {
|
|
1232
1232
|
super(...arguments);
|
|
1233
|
-
m(this, "id",
|
|
1233
|
+
m(this, "id", T.TEXT_LENGTH);
|
|
1234
1234
|
m(this, "title", "dataValidation.textLength.title");
|
|
1235
1235
|
m(this, "_lexerTreeBuilder", this.injector.get(X));
|
|
1236
1236
|
m(this, "order", 30);
|
|
@@ -1270,7 +1270,7 @@ class fa extends Y {
|
|
|
1270
1270
|
return e == null ? Number.NaN : +e;
|
|
1271
1271
|
}
|
|
1272
1272
|
async parseFormula(e, t, r, i, o) {
|
|
1273
|
-
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d =
|
|
1273
|
+
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d = C(String(n == null ? void 0 : n.v)) && C(String(l == null ? void 0 : l.v));
|
|
1274
1274
|
return {
|
|
1275
1275
|
formula1: this._parseNumber(S(u) ? n == null ? void 0 : n.v : u),
|
|
1276
1276
|
formula2: this._parseNumber(S(c) ? l == null ? void 0 : l.v : c),
|
|
@@ -1291,10 +1291,10 @@ class fa extends Y {
|
|
|
1291
1291
|
if (!e.operator)
|
|
1292
1292
|
return this.titleStr;
|
|
1293
1293
|
const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
|
|
1294
|
-
return `${this.localeService.t(
|
|
1294
|
+
return `${this.localeService.t(Ut[e.operator]).replace(ue, r != null ? r : "").replace(ce, i != null ? i : "")}`;
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Rt(s) {
|
|
1298
1298
|
var e, t;
|
|
1299
1299
|
return s ? s.p ? !((t = (e = s.p.body) == null ? void 0 : e.dataStream) != null ? t : "").slice(0, -2).trim() : M.isBlank(s.v) : !0;
|
|
1300
1300
|
}
|
|
@@ -1307,12 +1307,12 @@ function xe(s, a, e, t, r = "command", i = !0) {
|
|
|
1307
1307
|
};
|
|
1308
1308
|
const { worksheet: f } = g, p = new Me();
|
|
1309
1309
|
let R = !1;
|
|
1310
|
-
function E(_,
|
|
1310
|
+
function E(_, O) {
|
|
1311
1311
|
i && _.forEach(($) => {
|
|
1312
1312
|
H.foreach($, (x, k) => {
|
|
1313
|
-
const P = f.getCellRaw(x, k), J =
|
|
1314
|
-
(
|
|
1315
|
-
v:
|
|
1313
|
+
const P = f.getCellRaw(x, k), J = _t(P);
|
|
1314
|
+
(Rt(P) || J === O) && !(P != null && P.p) && (R = !0, p.setValue(x, k, {
|
|
1315
|
+
v: O,
|
|
1316
1316
|
p: null
|
|
1317
1317
|
}));
|
|
1318
1318
|
});
|
|
@@ -1424,9 +1424,9 @@ function xe(s, a, e, t, r = "command", i = !0) {
|
|
|
1424
1424
|
source: r
|
|
1425
1425
|
}
|
|
1426
1426
|
});
|
|
1427
|
-
const
|
|
1428
|
-
if (
|
|
1429
|
-
const x = c.getValidator(
|
|
1427
|
+
const O = c.getRuleById(s, a, _.ruleId);
|
|
1428
|
+
if (O && O.type === T.CHECKBOX) {
|
|
1429
|
+
const x = c.getValidator(T.CHECKBOX).parseFormulaSync(O, s, a);
|
|
1430
1430
|
E(_.newRanges, x.formula2);
|
|
1431
1431
|
}
|
|
1432
1432
|
break;
|
|
@@ -1448,8 +1448,8 @@ function xe(s, a, e, t, r = "command", i = !0) {
|
|
|
1448
1448
|
ruleId: _.rule.uid,
|
|
1449
1449
|
source: r
|
|
1450
1450
|
}
|
|
1451
|
-
}), _.rule.type ===
|
|
1452
|
-
const $ = c.getValidator(
|
|
1451
|
+
}), _.rule.type === T.CHECKBOX) {
|
|
1452
|
+
const $ = c.getValidator(T.CHECKBOX).parseFormulaSync(_.rule, s, a);
|
|
1453
1453
|
E(_.rule.ranges, $.originFormula2);
|
|
1454
1454
|
}
|
|
1455
1455
|
break;
|
|
@@ -1463,18 +1463,18 @@ function xe(s, a, e, t, r = "command", i = !0) {
|
|
|
1463
1463
|
subUnitId: a,
|
|
1464
1464
|
cellValue: p.getData()
|
|
1465
1465
|
}
|
|
1466
|
-
},
|
|
1466
|
+
}, O = {
|
|
1467
1467
|
id: ne.id,
|
|
1468
|
-
params:
|
|
1468
|
+
params: mt(t, _.params)
|
|
1469
1469
|
};
|
|
1470
|
-
l.push(_), u.push(
|
|
1470
|
+
l.push(_), u.push(O);
|
|
1471
1471
|
}
|
|
1472
1472
|
return {
|
|
1473
1473
|
redoMutations: l,
|
|
1474
1474
|
undoMutations: u
|
|
1475
1475
|
};
|
|
1476
1476
|
}
|
|
1477
|
-
const
|
|
1477
|
+
const Ra = {
|
|
1478
1478
|
type: z.COMMAND,
|
|
1479
1479
|
id: "sheet.command.updateDataValidationRuleRange",
|
|
1480
1480
|
handler(s, a) {
|
|
@@ -1492,7 +1492,7 @@ const _a = {
|
|
|
1492
1492
|
unitID: e
|
|
1493
1493
|
}), Le(g, n), !0;
|
|
1494
1494
|
}
|
|
1495
|
-
},
|
|
1495
|
+
}, Sa = {
|
|
1496
1496
|
type: z.COMMAND,
|
|
1497
1497
|
id: "sheet.command.addDataValidation",
|
|
1498
1498
|
handler(s, a) {
|
|
@@ -1524,7 +1524,7 @@ const _a = {
|
|
|
1524
1524
|
undoMutations: f
|
|
1525
1525
|
}), Le(g, o), !0;
|
|
1526
1526
|
}
|
|
1527
|
-
},
|
|
1527
|
+
}, Ea = {
|
|
1528
1528
|
type: z.COMMAND,
|
|
1529
1529
|
id: "sheets.command.update-data-validation-setting",
|
|
1530
1530
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1560,21 +1560,21 @@ const _a = {
|
|
|
1560
1560
|
ruleId: l,
|
|
1561
1561
|
payload: {
|
|
1562
1562
|
type: V.SETTING,
|
|
1563
|
-
payload:
|
|
1563
|
+
payload: Bt(d)
|
|
1564
1564
|
}
|
|
1565
1565
|
}, E = [{
|
|
1566
1566
|
id: y.id,
|
|
1567
1567
|
params: R
|
|
1568
1568
|
}];
|
|
1569
|
-
if (u.type ===
|
|
1570
|
-
const
|
|
1569
|
+
if (u.type === T.CHECKBOX) {
|
|
1570
|
+
const O = d.ranges, $ = s.get(D), x = ze($, { unitId: o, subUnitId: n });
|
|
1571
1571
|
if (x) {
|
|
1572
1572
|
const k = new Me(), { worksheet: P } = x, { formula2: J = ye, formula1: me = Ve } = d, { formula2: ge = ye, formula1: pe = Ve } = u;
|
|
1573
1573
|
let Pe = !1;
|
|
1574
|
-
if (
|
|
1574
|
+
if (O.forEach((fe) => {
|
|
1575
1575
|
H.foreach(fe, (ie, He) => {
|
|
1576
|
-
const j = P.getCellRaw(ie, He), Je =
|
|
1577
|
-
(
|
|
1576
|
+
const j = P.getCellRaw(ie, He), Je = _t(j);
|
|
1577
|
+
(Rt(j) || Je === String(J)) && !(j != null && j.p) ? (k.setValue(ie, He, {
|
|
1578
1578
|
v: ge,
|
|
1579
1579
|
p: null
|
|
1580
1580
|
}), Pe = !0) : Je === String(me) && !(j != null && j.p) && (k.setValue(ie, He, {
|
|
@@ -1592,7 +1592,7 @@ const _a = {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
}, ie = {
|
|
1594
1594
|
id: ne.id,
|
|
1595
|
-
params:
|
|
1595
|
+
params: mt(s, fe.params)
|
|
1596
1596
|
};
|
|
1597
1597
|
p.push(fe), E.push(ie);
|
|
1598
1598
|
}
|
|
@@ -1604,7 +1604,7 @@ const _a = {
|
|
|
1604
1604
|
undoMutations: E
|
|
1605
1605
|
}), !0) : !1;
|
|
1606
1606
|
}
|
|
1607
|
-
},
|
|
1607
|
+
}, Ma = {
|
|
1608
1608
|
type: z.COMMAND,
|
|
1609
1609
|
id: "sheets.command.update-data-validation-options",
|
|
1610
1610
|
handler(s, a) {
|
|
@@ -1630,7 +1630,7 @@ const _a = {
|
|
|
1630
1630
|
ruleId: n,
|
|
1631
1631
|
payload: {
|
|
1632
1632
|
type: V.OPTIONS,
|
|
1633
|
-
payload:
|
|
1633
|
+
payload: xt(u)
|
|
1634
1634
|
}
|
|
1635
1635
|
}, f = [{
|
|
1636
1636
|
id: y.id,
|
|
@@ -1642,7 +1642,7 @@ const _a = {
|
|
|
1642
1642
|
undoMutations: f
|
|
1643
1643
|
}), e.executeCommand(y.id, c), !0;
|
|
1644
1644
|
}
|
|
1645
|
-
},
|
|
1645
|
+
}, Va = {
|
|
1646
1646
|
type: z.COMMAND,
|
|
1647
1647
|
id: "sheets.command.clear-range-data-validation",
|
|
1648
1648
|
handler(s, a) {
|
|
@@ -1659,7 +1659,7 @@ const _a = {
|
|
|
1659
1659
|
undoMutations: f
|
|
1660
1660
|
}), Le(g, i).result;
|
|
1661
1661
|
}
|
|
1662
|
-
},
|
|
1662
|
+
}, ya = {
|
|
1663
1663
|
type: z.COMMAND,
|
|
1664
1664
|
id: "sheet.command.remove-all-data-validation",
|
|
1665
1665
|
handler(s, a) {
|
|
@@ -1686,7 +1686,7 @@ const _a = {
|
|
|
1686
1686
|
unitID: e
|
|
1687
1687
|
}), r.executeCommand(I.id, l), !0;
|
|
1688
1688
|
}
|
|
1689
|
-
},
|
|
1689
|
+
}, Ta = (s, a) => {
|
|
1690
1690
|
const e = s.get(F), { unitId: t, subUnitId: r, ruleId: i, source: o } = a;
|
|
1691
1691
|
if (Array.isArray(i)) {
|
|
1692
1692
|
const l = i.map((u) => e.getRuleById(t, r, u)).filter(Boolean);
|
|
@@ -1711,7 +1711,7 @@ const _a = {
|
|
|
1711
1711
|
index: e.getRuleIndex(t, r, i)
|
|
1712
1712
|
}
|
|
1713
1713
|
}];
|
|
1714
|
-
},
|
|
1714
|
+
}, Ca = {
|
|
1715
1715
|
type: z.COMMAND,
|
|
1716
1716
|
id: "sheet.command.remove-data-validation-rule",
|
|
1717
1717
|
handler(s, a) {
|
|
@@ -1737,9 +1737,9 @@ const _a = {
|
|
|
1737
1737
|
unitID: a.unitId
|
|
1738
1738
|
}), i.executeCommand(I.id, a), !0;
|
|
1739
1739
|
}
|
|
1740
|
-
},
|
|
1741
|
-
var
|
|
1742
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1740
|
+
}, Fa = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
1741
|
+
var St = /* @__PURE__ */ ((s) => (s[s.View = 0] = "View", s[s.Edit = 1] = "Edit", s[s.ManageCollaborator = 2] = "ManageCollaborator", s[s.Print = 3] = "Print", s[s.Duplicate = 4] = "Duplicate", s[s.Comment = 5] = "Comment", s[s.Copy = 6] = "Copy", s[s.Share = 7] = "Share", s[s.Export = 8] = "Export", s[s.MoveWorksheet = 9] = "MoveWorksheet", s[s.DeleteWorksheet = 10] = "DeleteWorksheet", s[s.HideWorksheet = 11] = "HideWorksheet", s[s.RenameWorksheet = 12] = "RenameWorksheet", s[s.CreateWorksheet = 13] = "CreateWorksheet", s[s.SetWorksheetStyle = 14] = "SetWorksheetStyle", s[s.EditWorksheetCell = 15] = "EditWorksheetCell", s[s.InsertHyperlink = 16] = "InsertHyperlink", s[s.Sort = 17] = "Sort", s[s.Filter = 18] = "Filter", s[s.PivotTable = 19] = "PivotTable", s[s.FloatImg = 20] = "FloatImg", s[s.History = 21] = "History", s[s.RwHgtClWdt = 22] = "RwHgtClWdt", s[s.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", s[s.ViewFilter = 24] = "ViewFilter", s[s.MoveSheet = 25] = "MoveSheet", s[s.DeleteSheet = 26] = "DeleteSheet", s[s.HideSheet = 27] = "HideSheet", s[s.CopySheet = 28] = "CopySheet", s[s.RenameSheet = 29] = "RenameSheet", s[s.CreateSheet = 30] = "CreateSheet", s[s.SelectProtectedCells = 31] = "SelectProtectedCells", s[s.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", s[s.SetCellStyle = 33] = "SetCellStyle", s[s.SetCellValue = 34] = "SetCellValue", s[s.SetRowStyle = 35] = "SetRowStyle", s[s.SetColumnStyle = 36] = "SetColumnStyle", s[s.InsertRow = 37] = "InsertRow", s[s.InsertColumn = 38] = "InsertColumn", s[s.DeleteRow = 39] = "DeleteRow", s[s.DeleteColumn = 40] = "DeleteColumn", s[s.EditExtraObject = 41] = "EditExtraObject", s[s.Delete = 42] = "Delete", s[s.RecoverHistory = 43] = "RecoverHistory", s[s.ViewHistory = 44] = "ViewHistory", s[s.CreatePermissionObject = 45] = "CreatePermissionObject", s[s.UNRECOGNIZED = -1] = "UNRECOGNIZED", s))(St || {}), Na = Object.getOwnPropertyDescriptor, Oa = (s, a, e, t) => {
|
|
1742
|
+
for (var r = t > 1 ? void 0 : t ? Na(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
1743
1743
|
(o = s[i]) && (r = o(r) || r);
|
|
1744
1744
|
return r;
|
|
1745
1745
|
}, je = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -1756,14 +1756,14 @@ let Fe = class extends B {
|
|
|
1756
1756
|
const i = a[r];
|
|
1757
1757
|
if (typeof i == "string")
|
|
1758
1758
|
continue;
|
|
1759
|
-
const { token: o } = i, n =
|
|
1759
|
+
const { token: o } = i, n = kt(o), l = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET);
|
|
1760
1760
|
let u = l.getActiveSheet();
|
|
1761
1761
|
const c = l.getUnitId();
|
|
1762
1762
|
if (n.sheetName) {
|
|
1763
1763
|
if (u = l.getSheetBySheetName(n.sheetName), !u)
|
|
1764
1764
|
return !1;
|
|
1765
1765
|
const R = u == null ? void 0 : u.getSheetId();
|
|
1766
|
-
if (!this._permissionService.getPermissionPoint(new
|
|
1766
|
+
if (!this._permissionService.getPermissionPoint(new Qt(c, R).id)) return !1;
|
|
1767
1767
|
}
|
|
1768
1768
|
if (!u)
|
|
1769
1769
|
return !1;
|
|
@@ -1771,21 +1771,21 @@ let Fe = class extends B {
|
|
|
1771
1771
|
for (let R = d; R <= g; R++)
|
|
1772
1772
|
for (let E = f; E <= p; E++) {
|
|
1773
1773
|
const _ = (t = (e = u.getCell(R, E)) == null ? void 0 : e.selectionProtection) == null ? void 0 : t[0];
|
|
1774
|
-
if ((_ == null ? void 0 : _[
|
|
1774
|
+
if ((_ == null ? void 0 : _[St.View]) === !1)
|
|
1775
1775
|
return !1;
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
return !0;
|
|
1779
1779
|
}
|
|
1780
1780
|
};
|
|
1781
|
-
Fe =
|
|
1781
|
+
Fe = Oa([
|
|
1782
1782
|
je(0, D),
|
|
1783
|
-
je(1,
|
|
1783
|
+
je(1, Ft),
|
|
1784
1784
|
je(2, v(X))
|
|
1785
1785
|
], Fe);
|
|
1786
|
-
const
|
|
1787
|
-
var
|
|
1788
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1786
|
+
const wa = "sheets-data-validation.config", st = {};
|
|
1787
|
+
var Aa = Object.getOwnPropertyDescriptor, Ia = (s, a, e, t) => {
|
|
1788
|
+
for (var r = t > 1 ? void 0 : t ? Aa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
1789
1789
|
(o = s[i]) && (r = o(r) || r);
|
|
1790
1790
|
return r;
|
|
1791
1791
|
}, Qe = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -1926,17 +1926,17 @@ let Ne = class extends B {
|
|
|
1926
1926
|
}));
|
|
1927
1927
|
}
|
|
1928
1928
|
};
|
|
1929
|
-
Ne =
|
|
1929
|
+
Ne = Ia([
|
|
1930
1930
|
Qe(0, v(F)),
|
|
1931
|
-
Qe(1, v(
|
|
1931
|
+
Qe(1, v(ft)),
|
|
1932
1932
|
Qe(2, v(q))
|
|
1933
1933
|
], Ne);
|
|
1934
|
-
var
|
|
1935
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1934
|
+
var Da = Object.getOwnPropertyDescriptor, ba = (s, a, e, t) => {
|
|
1935
|
+
for (var r = t > 1 ? void 0 : t ? Da(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
1936
1936
|
(o = s[i]) && (r = o(r) || r);
|
|
1937
1937
|
return r;
|
|
1938
1938
|
}, te = (s, a) => (e, t) => a(e, t, s);
|
|
1939
|
-
let
|
|
1939
|
+
let Oe = class extends B {
|
|
1940
1940
|
constructor(a, e, t, r, i, o) {
|
|
1941
1941
|
super();
|
|
1942
1942
|
m(this, "_disposableMap", /* @__PURE__ */ new Map());
|
|
@@ -2023,7 +2023,7 @@ let we = class extends B {
|
|
|
2023
2023
|
register(a, e, t) {
|
|
2024
2024
|
var l;
|
|
2025
2025
|
const r = (u) => {
|
|
2026
|
-
const c = [...t.ranges], g = c.map((p) =>
|
|
2026
|
+
const c = [...t.ranges], g = c.map((p) => qt(p, u)).filter((p) => !!p).flat();
|
|
2027
2027
|
if (lt(g, c))
|
|
2028
2028
|
return { redos: [], undos: [] };
|
|
2029
2029
|
if (g.length) {
|
|
@@ -2051,7 +2051,7 @@ let we = class extends B {
|
|
|
2051
2051
|
}];
|
|
2052
2052
|
return { redos: R, undos: E };
|
|
2053
2053
|
} else {
|
|
2054
|
-
const p = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: I.id, params: p }], E =
|
|
2054
|
+
const p = { unitId: a, subUnitId: e, ruleId: t.uid }, R = [{ id: I.id, params: p }], E = Ta(this._injector, p);
|
|
2055
2055
|
return { redos: R, undos: E };
|
|
2056
2056
|
}
|
|
2057
2057
|
}, i = [];
|
|
@@ -2096,20 +2096,20 @@ let we = class extends B {
|
|
|
2096
2096
|
}));
|
|
2097
2097
|
}
|
|
2098
2098
|
};
|
|
2099
|
-
|
|
2099
|
+
Oe = ba([
|
|
2100
2100
|
te(0, v(F)),
|
|
2101
2101
|
te(1, v(be)),
|
|
2102
|
-
te(2, v(
|
|
2102
|
+
te(2, v(Gt)),
|
|
2103
2103
|
te(3, v(G)),
|
|
2104
|
-
te(4, v(
|
|
2104
|
+
te(4, v(ft)),
|
|
2105
2105
|
te(5, v(q))
|
|
2106
|
-
],
|
|
2107
|
-
var
|
|
2108
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2106
|
+
], Oe);
|
|
2107
|
+
var La = Object.getOwnPropertyDescriptor, Ua = (s, a, e, t) => {
|
|
2108
|
+
for (var r = t > 1 ? void 0 : t ? La(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
2109
2109
|
(o = s[i]) && (r = o(r) || r);
|
|
2110
2110
|
return r;
|
|
2111
2111
|
}, Ge = (s, a) => (e, t) => a(e, t, s);
|
|
2112
|
-
let
|
|
2112
|
+
let we = class extends B {
|
|
2113
2113
|
constructor(s, a, e) {
|
|
2114
2114
|
super(), this._sheetInterceptorService = s, this._univerInstanceService = a, this._sheetDataValidationModel = e, this._initSheetChange();
|
|
2115
2115
|
}
|
|
@@ -2120,7 +2120,7 @@ let Oe = class extends B {
|
|
|
2120
2120
|
// eslint-disable-next-line max-lines-per-function
|
|
2121
2121
|
getMutations: (s) => {
|
|
2122
2122
|
var a;
|
|
2123
|
-
if (s.id ===
|
|
2123
|
+
if (s.id === Yt.id) {
|
|
2124
2124
|
const e = s.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
|
|
2125
2125
|
if (!r)
|
|
2126
2126
|
return { redos: [], undos: [] };
|
|
@@ -2151,7 +2151,7 @@ let Oe = class extends B {
|
|
|
2151
2151
|
params: u
|
|
2152
2152
|
}]
|
|
2153
2153
|
};
|
|
2154
|
-
} else if (s.id ===
|
|
2154
|
+
} else if (s.id === Xt.id) {
|
|
2155
2155
|
const e = s.params, { unitId: t, subUnitId: r, targetSubUnitId: i } = e;
|
|
2156
2156
|
if (!t || !r || !i)
|
|
2157
2157
|
return { redos: [], undos: [] };
|
|
@@ -2190,15 +2190,15 @@ let Oe = class extends B {
|
|
|
2190
2190
|
);
|
|
2191
2191
|
}
|
|
2192
2192
|
};
|
|
2193
|
-
|
|
2194
|
-
Ge(0, v(
|
|
2193
|
+
we = Ua([
|
|
2194
|
+
Ge(0, v(gt)),
|
|
2195
2195
|
Ge(1, v(D)),
|
|
2196
2196
|
Ge(2, v(F))
|
|
2197
|
-
],
|
|
2198
|
-
class
|
|
2197
|
+
], we);
|
|
2198
|
+
class Ba extends Y {
|
|
2199
2199
|
constructor() {
|
|
2200
2200
|
super(...arguments);
|
|
2201
|
-
m(this, "id",
|
|
2201
|
+
m(this, "id", T.ANY);
|
|
2202
2202
|
m(this, "title", "dataValidation.any.title");
|
|
2203
2203
|
m(this, "operators", []);
|
|
2204
2204
|
m(this, "scopes", ["sheet"]);
|
|
@@ -2224,10 +2224,10 @@ class La extends Y {
|
|
|
2224
2224
|
return this.localeService.t("dataValidation.any.error");
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
|
-
class
|
|
2227
|
+
class xa extends Y {
|
|
2228
2228
|
constructor() {
|
|
2229
2229
|
super(...arguments);
|
|
2230
|
-
m(this, "id",
|
|
2230
|
+
m(this, "id", T.CUSTOM);
|
|
2231
2231
|
m(this, "title", "dataValidation.custom.title");
|
|
2232
2232
|
m(this, "operators", []);
|
|
2233
2233
|
m(this, "scopes", ["sheet"]);
|
|
@@ -2237,7 +2237,7 @@ class Ua extends Y {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
validatorFormula(e, t, r) {
|
|
2239
2239
|
var u;
|
|
2240
|
-
const i = S(e.formula1), o = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(o) === 0 && o.startsWith(
|
|
2240
|
+
const i = S(e.formula1), o = (u = e.formula1) != null ? u : "", l = this._lexerTreeBuilder.checkIfAddBracket(o) === 0 && o.startsWith(jt.EQUALS);
|
|
2241
2241
|
return {
|
|
2242
2242
|
success: i && l,
|
|
2243
2243
|
formula1: i && l ? "" : this.localeService.t("dataValidation.validFail.formula")
|
|
@@ -2252,7 +2252,7 @@ class Ua extends Y {
|
|
|
2252
2252
|
}
|
|
2253
2253
|
async isValidType(e, t, r) {
|
|
2254
2254
|
const { column: i, row: o, unitId: n, subUnitId: l } = e, u = await this._customFormulaService.getCellFormulaValue(n, l, r.uid, o, i), c = u == null ? void 0 : u.v;
|
|
2255
|
-
return
|
|
2255
|
+
return C(String(c)) && M.isDefine(c) && c !== "" ? u.t === Nt.BOOLEAN ? !!c : typeof c == "boolean" ? c : typeof c == "number" ? !!c : typeof c == "string" ? C(c) : !!c : !1;
|
|
2256
2256
|
}
|
|
2257
2257
|
generateRuleErrorMessage(e) {
|
|
2258
2258
|
return this.localeService.t("dataValidation.custom.error");
|
|
@@ -2262,21 +2262,21 @@ class Ua extends Y {
|
|
|
2262
2262
|
return this.localeService.t("dataValidation.custom.ruleName").replace("{FORMULA1}", (t = e.formula1) != null ? t : "");
|
|
2263
2263
|
}
|
|
2264
2264
|
}
|
|
2265
|
-
class
|
|
2265
|
+
class Pa extends vt {
|
|
2266
2266
|
constructor() {
|
|
2267
2267
|
super(...arguments);
|
|
2268
|
-
m(this, "id",
|
|
2268
|
+
m(this, "id", T.LIST_MULTIPLE);
|
|
2269
2269
|
m(this, "title", "dataValidation.listMultiple.title");
|
|
2270
2270
|
m(this, "offsetFormulaByRange", !1);
|
|
2271
2271
|
m(this, "skipDefaultFontRender", () => !0);
|
|
2272
2272
|
}
|
|
2273
2273
|
}
|
|
2274
|
-
class
|
|
2274
|
+
class Ha extends Y {
|
|
2275
2275
|
constructor() {
|
|
2276
2276
|
super(...arguments);
|
|
2277
2277
|
m(this, "_customFormulaService", this.injector.get(W));
|
|
2278
2278
|
m(this, "_lexerTreeBuilder", this.injector.get(X));
|
|
2279
|
-
m(this, "id",
|
|
2279
|
+
m(this, "id", T.WHOLE);
|
|
2280
2280
|
m(this, "title", "dataValidation.whole.title");
|
|
2281
2281
|
m(this, "order", 10);
|
|
2282
2282
|
m(this, "operators", [
|
|
@@ -2295,21 +2295,21 @@ class xa extends Y {
|
|
|
2295
2295
|
return !M.isBlank(e) && (S(e) || !Number.isNaN(+e) && Number.isInteger(+e));
|
|
2296
2296
|
}
|
|
2297
2297
|
async isValidType(e, t, r) {
|
|
2298
|
-
const { value: i } = e, o =
|
|
2298
|
+
const { value: i } = e, o = Ce(i);
|
|
2299
2299
|
return !Number.isNaN(o) && Number.isInteger(o);
|
|
2300
2300
|
}
|
|
2301
2301
|
transform(e, t, r) {
|
|
2302
2302
|
const { value: i } = e;
|
|
2303
2303
|
return {
|
|
2304
2304
|
...e,
|
|
2305
|
-
value:
|
|
2305
|
+
value: Ce(i)
|
|
2306
2306
|
};
|
|
2307
2307
|
}
|
|
2308
2308
|
_parseNumber(e) {
|
|
2309
2309
|
return e == null ? Number.NaN : +e;
|
|
2310
2310
|
}
|
|
2311
2311
|
async parseFormula(e, t, r, i, o) {
|
|
2312
|
-
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d = S(u) ? n == null ? void 0 : n.v : u, g = S(c) ? l == null ? void 0 : l.v : c, f =
|
|
2312
|
+
const n = await this._customFormulaService.getCellFormulaValue(t, r, e.uid, i, o), l = await this._customFormulaService.getCellFormula2Value(t, r, e.uid, i, o), { formula1: u, formula2: c } = e, d = S(u) ? n == null ? void 0 : n.v : u, g = S(c) ? l == null ? void 0 : l.v : c, f = C(`${d}`) && C(`${g}`);
|
|
2313
2313
|
return {
|
|
2314
2314
|
formula1: this._parseNumber(d),
|
|
2315
2315
|
formula2: this._parseNumber(g),
|
|
@@ -2334,17 +2334,17 @@ class xa extends Y {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
generateRuleErrorMessage(e, t) {
|
|
2336
2336
|
if (!e.operator)
|
|
2337
|
-
return this.localeService.t(
|
|
2337
|
+
return this.localeService.t(Te.NONE).replace("{TYPE}", this.titleStr);
|
|
2338
2338
|
const { transformedFormula1: r, transformedFormula2: i } = Ue(this._lexerTreeBuilder, e, t);
|
|
2339
|
-
return `${this.localeService.t(
|
|
2339
|
+
return `${this.localeService.t(Te[e.operator]).replace(ue, r != null ? r : "").replace(ce, i != null ? i : "")}`;
|
|
2340
2340
|
}
|
|
2341
2341
|
}
|
|
2342
|
-
var
|
|
2343
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2342
|
+
var Wa = Object.getOwnPropertyDescriptor, $a = (s, a, e, t) => {
|
|
2343
|
+
for (var r = t > 1 ? void 0 : t ? Wa(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
2344
2344
|
(o = s[i]) && (r = o(r) || r);
|
|
2345
2345
|
return r;
|
|
2346
2346
|
}, ae = (s, a) => (e, t) => a(e, t, s);
|
|
2347
|
-
let Ae = class extends
|
|
2347
|
+
let Ae = class extends Ot {
|
|
2348
2348
|
constructor(s, a, e, t, r, i) {
|
|
2349
2349
|
super(), this._univerInstanceService = s, this._dataValidatorRegistryService = a, this._injector = e, this._selectionManagerService = t, this._sheetInterceptorService = r, this._sheetDataValidationModel = i, this._init();
|
|
2350
2350
|
}
|
|
@@ -2353,15 +2353,15 @@ let Ae = class extends Nt {
|
|
|
2353
2353
|
}
|
|
2354
2354
|
_registerValidators() {
|
|
2355
2355
|
[
|
|
2356
|
-
La,
|
|
2357
|
-
da,
|
|
2358
|
-
xa,
|
|
2359
|
-
fa,
|
|
2360
|
-
ca,
|
|
2361
|
-
na,
|
|
2362
|
-
_t,
|
|
2363
2356
|
Ba,
|
|
2364
|
-
|
|
2357
|
+
ma,
|
|
2358
|
+
Ha,
|
|
2359
|
+
va,
|
|
2360
|
+
ha,
|
|
2361
|
+
ua,
|
|
2362
|
+
vt,
|
|
2363
|
+
Pa,
|
|
2364
|
+
xa
|
|
2365
2365
|
].forEach((s) => {
|
|
2366
2366
|
const a = this._injector.createInstance(s);
|
|
2367
2367
|
this.disposeWithMe(this._dataValidatorRegistryService.register(a)), this.disposeWithMe(Ke(() => this._injector.delete(s)));
|
|
@@ -2371,7 +2371,7 @@ let Ae = class extends Nt {
|
|
|
2371
2371
|
this._sheetInterceptorService.interceptCommand({
|
|
2372
2372
|
getMutations: (s) => {
|
|
2373
2373
|
var a;
|
|
2374
|
-
if (s.id ===
|
|
2374
|
+
if (s.id === Kt.id) {
|
|
2375
2375
|
const e = this._univerInstanceService.getCurrentUnitForType(N.UNIVER_SHEET), t = e.getUnitId(), r = e.getActiveSheet();
|
|
2376
2376
|
if (!r)
|
|
2377
2377
|
throw new Error("No active sheet found");
|
|
@@ -2391,16 +2391,16 @@ let Ae = class extends Nt {
|
|
|
2391
2391
|
});
|
|
2392
2392
|
}
|
|
2393
2393
|
};
|
|
2394
|
-
Ae =
|
|
2394
|
+
Ae = $a([
|
|
2395
2395
|
ae(0, D),
|
|
2396
2396
|
ae(1, v(q)),
|
|
2397
2397
|
ae(2, v(be)),
|
|
2398
|
-
ae(3, v(
|
|
2399
|
-
ae(4, v(
|
|
2398
|
+
ae(3, v(pt)),
|
|
2399
|
+
ae(4, v(gt)),
|
|
2400
2400
|
ae(5, v(F))
|
|
2401
2401
|
], Ae);
|
|
2402
|
-
var
|
|
2403
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2402
|
+
var ka = Object.getOwnPropertyDescriptor, ja = (s, a, e, t) => {
|
|
2403
|
+
for (var r = t > 1 ? void 0 : t ? ka(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
2404
2404
|
(o = s[i]) && (r = o(r) || r);
|
|
2405
2405
|
return r;
|
|
2406
2406
|
}, Re = (s, a) => (e, t) => a(e, t, s);
|
|
@@ -2425,7 +2425,7 @@ let Ie = class extends B {
|
|
|
2425
2425
|
});
|
|
2426
2426
|
});
|
|
2427
2427
|
};
|
|
2428
|
-
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(
|
|
2428
|
+
this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(zt(() => this._lifecycleService.lifecycle$.pipe(tt((a) => a === et.Rendered)))).subscribe(s)), this.disposeWithMe(this._dataValidationCacheService.dirtyRanges$.pipe(tt(() => this._lifecycleService.stage >= et.Rendered), At(20)).subscribe(s));
|
|
2429
2429
|
}
|
|
2430
2430
|
async _validatorByCell(s, a, e, t) {
|
|
2431
2431
|
const r = s.getUnitId(), i = a.getSheetId();
|
|
@@ -2519,26 +2519,26 @@ let Ie = class extends B {
|
|
|
2519
2519
|
return this.getDataValidations(s, a, e)[0];
|
|
2520
2520
|
}
|
|
2521
2521
|
};
|
|
2522
|
-
Ie =
|
|
2522
|
+
Ie = ja([
|
|
2523
2523
|
Re(0, D),
|
|
2524
2524
|
Re(1, v(F)),
|
|
2525
2525
|
Re(2, v(Q)),
|
|
2526
2526
|
Re(3, v(wt))
|
|
2527
2527
|
], Ie);
|
|
2528
|
-
var
|
|
2529
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2528
|
+
var Qa = Object.defineProperty, Ga = Object.getOwnPropertyDescriptor, qa = (s, a, e) => a in s ? Qa(s, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[a] = e, Ya = (s, a, e, t) => {
|
|
2529
|
+
for (var r = t > 1 ? void 0 : t ? Ga(a, e) : a, i = s.length - 1, o; i >= 0; i--)
|
|
2530
2530
|
(o = s[i]) && (r = o(r) || r);
|
|
2531
2531
|
return r;
|
|
2532
|
-
}, qe = (s, a) => (e, t) => a(e, t, s),
|
|
2533
|
-
let De = class extends
|
|
2532
|
+
}, qe = (s, a) => (e, t) => a(e, t, s), Et = (s, a, e) => qa(s, typeof a != "symbol" ? a + "" : a, e);
|
|
2533
|
+
let De = class extends bt {
|
|
2534
2534
|
constructor(s = st, a, e, t) {
|
|
2535
2535
|
super(), this._config = s, this._injector = a, this._commandService = e, this._configService = t;
|
|
2536
|
-
const { ...r } =
|
|
2536
|
+
const { ...r } = Lt(
|
|
2537
2537
|
{},
|
|
2538
2538
|
st,
|
|
2539
2539
|
this._config
|
|
2540
2540
|
);
|
|
2541
|
-
this._configService.setConfig(
|
|
2541
|
+
this._configService.setConfig(wa, r);
|
|
2542
2542
|
}
|
|
2543
2543
|
onStarting() {
|
|
2544
2544
|
[
|
|
@@ -2550,86 +2550,86 @@ let De = class extends Dt {
|
|
|
2550
2550
|
[F],
|
|
2551
2551
|
[Ae],
|
|
2552
2552
|
[Fe],
|
|
2553
|
-
[Oe],
|
|
2554
2553
|
[we],
|
|
2554
|
+
[Oe],
|
|
2555
2555
|
[Ne]
|
|
2556
2556
|
].forEach((s) => {
|
|
2557
2557
|
this._injector.add(s);
|
|
2558
2558
|
}), [
|
|
2559
|
-
va,
|
|
2560
|
-
_a,
|
|
2561
|
-
Ra,
|
|
2562
2559
|
Sa,
|
|
2563
|
-
|
|
2560
|
+
Ra,
|
|
2561
|
+
Ea,
|
|
2564
2562
|
Ma,
|
|
2565
|
-
|
|
2563
|
+
Ca,
|
|
2564
|
+
ya,
|
|
2565
|
+
Va
|
|
2566
2566
|
].forEach((s) => {
|
|
2567
2567
|
this._commandService.registerCommand(s);
|
|
2568
|
-
}), this._injector.get(Q), this._injector.get(Ie), this._injector.get(Ae), this._injector.get(Ne), this._injector.get(
|
|
2568
|
+
}), this._injector.get(Q), this._injector.get(Ie), this._injector.get(Ae), this._injector.get(Ne), this._injector.get(Oe);
|
|
2569
2569
|
}
|
|
2570
2570
|
onReady() {
|
|
2571
|
-
this._injector.get(
|
|
2571
|
+
this._injector.get(we);
|
|
2572
2572
|
}
|
|
2573
2573
|
onRendered() {
|
|
2574
2574
|
this._injector.get(Fe);
|
|
2575
2575
|
}
|
|
2576
2576
|
};
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
De =
|
|
2580
|
-
|
|
2577
|
+
Et(De, "pluginName", Fa);
|
|
2578
|
+
Et(De, "type", N.UNIVER_SHEET);
|
|
2579
|
+
De = Ya([
|
|
2580
|
+
It(Zt, Pt),
|
|
2581
2581
|
qe(1, v(be)),
|
|
2582
2582
|
qe(2, U),
|
|
2583
|
-
qe(3,
|
|
2583
|
+
qe(3, Dt)
|
|
2584
2584
|
], De);
|
|
2585
|
-
function
|
|
2586
|
-
const e = s.get(
|
|
2585
|
+
function ir(s) {
|
|
2586
|
+
const e = s.get(pt).getCurrentSelections().map((i) => i.range);
|
|
2587
2587
|
return {
|
|
2588
2588
|
uid: Xe(6),
|
|
2589
|
-
type:
|
|
2589
|
+
type: T.DECIMAL,
|
|
2590
2590
|
operator: h.EQUAL,
|
|
2591
2591
|
formula1: "100",
|
|
2592
2592
|
ranges: e != null ? e : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
|
|
2593
2593
|
};
|
|
2594
2594
|
}
|
|
2595
|
-
const
|
|
2595
|
+
const sr = "data-validation.custom-formula-input", or = "data-validation.formula-input", nr = "data-validation.list-formula-input", lr = "data-validation.checkbox-formula-input";
|
|
2596
2596
|
export {
|
|
2597
|
-
|
|
2598
|
-
|
|
2597
|
+
Sa as AddSheetDataValidationCommand,
|
|
2598
|
+
or as BASE_FORMULA_INPUT_NAME,
|
|
2599
2599
|
Ve as CHECKBOX_FORMULA_1,
|
|
2600
2600
|
ye as CHECKBOX_FORMULA_2,
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2601
|
+
lr as CHECKBOX_FORMULA_INPUT_NAME,
|
|
2602
|
+
sr as CUSTOM_FORMULA_INPUT_NAME,
|
|
2603
|
+
ua as CheckboxValidator,
|
|
2604
|
+
Va as ClearRangeDataValidationCommand,
|
|
2605
|
+
Fa as DATA_VALIDATION_PLUGIN_NAME,
|
|
2606
2606
|
Q as DataValidationCacheService,
|
|
2607
2607
|
W as DataValidationCustomFormulaService,
|
|
2608
2608
|
Fe as DataValidationFormulaController,
|
|
2609
2609
|
G as DataValidationFormulaService,
|
|
2610
2610
|
le as DataValidationListCacheService,
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2611
|
+
ha as DateValidator,
|
|
2612
|
+
nr as LIST_FORMULA_INPUT_NAME,
|
|
2613
|
+
Pa as ListMultipleValidator,
|
|
2614
|
+
vt as ListValidator,
|
|
2615
|
+
ya as RemoveSheetAllDataValidationCommand,
|
|
2616
|
+
Ca as RemoveSheetDataValidationCommand,
|
|
2617
2617
|
F as SheetDataValidationModel,
|
|
2618
2618
|
Ie as SheetsDataValidationValidatorService,
|
|
2619
2619
|
De as UniverSheetsDataValidationPlugin,
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2620
|
+
Ma as UpdateSheetDataValidationOptionsCommand,
|
|
2621
|
+
Ra as UpdateSheetDataValidationRangeCommand,
|
|
2622
|
+
Ea as UpdateSheetDataValidationSettingCommand,
|
|
2623
|
+
ir as createDefaultNewRule,
|
|
2624
2624
|
Ee as deserializeListOptions,
|
|
2625
|
-
|
|
2625
|
+
Ce as getCellValueNumber,
|
|
2626
2626
|
re as getCellValueOrigin,
|
|
2627
|
-
|
|
2627
|
+
rr as getDataValidationCellValue,
|
|
2628
2628
|
xe as getDataValidationDiffMutations,
|
|
2629
2629
|
_e as getFormulaCellData,
|
|
2630
2630
|
oe as getFormulaResult,
|
|
2631
2631
|
Ue as getTransformedFormula,
|
|
2632
|
-
|
|
2633
|
-
|
|
2632
|
+
C as isLegalFormulaResult,
|
|
2633
|
+
ar as serializeListOptions,
|
|
2634
2634
|
ve as transformCheckboxValue
|
|
2635
2635
|
};
|