@univerjs/sheets-conditional-formatting 0.15.2 → 0.15.3-insiders.20260131-cbd5fac
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 +147 -144
- package/lib/index.js +147 -144
- package/lib/types/models/calculate-unit-v2/utils.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var H2 = Object.defineProperty;
|
|
2
2
|
var j2 = (s, r, t) => r in s ? H2(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t;
|
|
3
3
|
var m = (s, r, t) => j2(s, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
-
import { generateRandomId as X2, Tools as J, CommandType as O, IUndoRedoService as e2, ICommandService as W, IUniverInstanceService as q, ObjectMatrix as V, Range as T, sequenceExecute as
|
|
4
|
+
import { generateRandomId as X2, Tools as J, CommandType as O, IUndoRedoService as e2, ICommandService as W, IUniverInstanceService as q, ObjectMatrix as V, Range as T, sequenceExecute as B2, Inject as b, Disposable as x2, RefAlias as K2, CellValueType as M, BooleanNumber as N2, LRUMap as T2, ColorKit as U2, dayjs as v, Injector as M2, RTree as Y2, IResourceManagerService as J2, merge as V2, UniverInstanceType as D2, isInternalEditorID as z2, Rectangle as n2, DependentOn as Q2, Plugin as e0, touchDependencies as t0, IConfigService as n0 } from "@univerjs/core";
|
|
5
5
|
import { isRangesEqual as X1 } from "@univerjs/core";
|
|
6
6
|
import { getSheetCommandTarget as t2, SheetsSelectionsService as r0, findAllRectangle as s0, createTopMatrixFromMatrix as i0, SheetInterceptorService as a0, RemoveSheetCommand as l0, CopySheetCommand as o0, ReorderRangeMutation as u0, MoveRangeMutation as c0, MoveColsMutation as d0, MoveRowsMutation as h0, InsertRowMutation as g0, RemoveRowMutation as C0, RemoveColMutation as f0, InsertColMutation as D0, SetRangeValuesMutation as m0 } from "@univerjs/sheets";
|
|
7
7
|
import { Subject as d2, BehaviorSubject as F0 } from "rxjs";
|
|
@@ -9,7 +9,7 @@ import { RegisterOtherFormulaService as w0, FormulaResultStatus as p, OtherFormu
|
|
|
9
9
|
import { distinctUntilChanged as E0, bufferTime as A0, filter as _0, map as x0 } from "rxjs/operators";
|
|
10
10
|
import { isObject as M0, SpreadsheetExtensionRegistry as O2, SheetExtension as $2, FIX_ONE_PIXEL_BLUR_OFFSET as y0 } from "@univerjs/engine-render";
|
|
11
11
|
const P2 = "SHEET_CONDITIONAL_FORMATTING_PLUGIN";
|
|
12
|
-
var B = /* @__PURE__ */ ((s) => (s.beginsWith = "beginsWith", s.endsWith = "endsWith", s.containsText = "containsText", s.notContainsText = "notContainsText", s.equal = "equal", s.notEqual = "notEqual", s.containsBlanks = "containsBlanks", s.notContainsBlanks = "notContainsBlanks", s.containsErrors = "containsErrors", s.notContainsErrors = "notContainsErrors", s))(B || {}),
|
|
12
|
+
var B = /* @__PURE__ */ ((s) => (s.beginsWith = "beginsWith", s.endsWith = "endsWith", s.containsText = "containsText", s.notContainsText = "notContainsText", s.equal = "equal", s.notEqual = "notEqual", s.containsBlanks = "containsBlanks", s.notContainsBlanks = "notContainsBlanks", s.containsErrors = "containsErrors", s.notContainsErrors = "notContainsErrors", s))(B || {}), N = /* @__PURE__ */ ((s) => (s.today = "today", s.yesterday = "yesterday", s.tomorrow = "tomorrow", s.last7Days = "last7Days", s.thisMonth = "thisMonth", s.lastMonth = "lastMonth", s.nextMonth = "nextMonth", s.thisWeek = "thisWeek", s.lastWeek = "lastWeek", s.nextWeek = "nextWeek", s))(N || {}), w = /* @__PURE__ */ ((s) => (s.greaterThan = "greaterThan", s.greaterThanOrEqual = "greaterThanOrEqual", s.lessThan = "lessThan", s.lessThanOrEqual = "lessThanOrEqual", s.notBetween = "notBetween", s.between = "between", s.equal = "equal", s.notEqual = "notEqual", s))(w || {}), y = /* @__PURE__ */ ((s) => (s.highlightCell = "highlightCell", s.dataBar = "dataBar", s.colorScale = "colorScale", s.iconSet = "iconSet", s))(y || {}), _ = /* @__PURE__ */ ((s) => (s.uniqueValues = "uniqueValues", s.duplicateValues = "duplicateValues", s.rank = "rank", s.text = "text", s.timePeriod = "timePeriod", s.number = "number", s.average = "average", s.formula = "formula", s))(_ || {}), L = /* @__PURE__ */ ((s) => (s.num = "num", s.min = "min", s.max = "max", s.percent = "percent", s.percentile = "percentile", s.formula = "formula", s))(L || {});
|
|
13
13
|
const V1 = "#fff", O1 = "#000000", $1 = () => ({
|
|
14
14
|
cfId: void 0,
|
|
15
15
|
ranges: [],
|
|
@@ -133,7 +133,7 @@ const V1 = "#fff", O1 = "#000000", $1 = () => ({
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}, q1 = (s, r) => s.id === r.id && s.type === r.type, S0 = () => `${X2(8)}`;
|
|
136
|
-
class
|
|
136
|
+
class R {
|
|
137
137
|
constructor() {
|
|
138
138
|
// Map<unitID ,<sheetId ,IConditionFormattingRule[]>>
|
|
139
139
|
m(this, "_model", /* @__PURE__ */ new Map());
|
|
@@ -206,7 +206,7 @@ const i2 = {
|
|
|
206
206
|
if (!r)
|
|
207
207
|
return !1;
|
|
208
208
|
const { unitId: t, subUnitId: e, start: n, end: i } = r;
|
|
209
|
-
return s.get(
|
|
209
|
+
return s.get(R).moveRulePriority(t, e, n, i), !0;
|
|
210
210
|
}
|
|
211
211
|
}, b0 = (s) => {
|
|
212
212
|
const { unitId: r, subUnitId: t } = s, e = I0(s.start, s.end);
|
|
@@ -217,7 +217,7 @@ const i2 = {
|
|
|
217
217
|
{ id: i2.id, params: { unitId: r, subUnitId: t, start: n, end: i } }
|
|
218
218
|
];
|
|
219
219
|
}, m2 = (s, r) => {
|
|
220
|
-
const t = s.get(
|
|
220
|
+
const t = s.get(R), { unitId: e, subUnitId: n, cfId: i } = r, a = [...t.getSubunitRules(e, n) || []], c = a.findIndex((o) => o.cfId === i), l = a[c - 1];
|
|
221
221
|
if (c > -1) {
|
|
222
222
|
const o = a[c], d = [{
|
|
223
223
|
id: a2.id,
|
|
@@ -248,7 +248,7 @@ const i2 = {
|
|
|
248
248
|
if (!r)
|
|
249
249
|
return !1;
|
|
250
250
|
const { unitId: t, subUnitId: e, cfId: n } = r;
|
|
251
|
-
return s.get(
|
|
251
|
+
return s.get(R).deleteRule(t, e, n), !0;
|
|
252
252
|
}
|
|
253
253
|
}, q2 = (s, r) => ({ id: K.id, params: { unitId: r.unitId, subUnitId: r.subUnitId, cfId: r.rule.cfId } }), a2 = {
|
|
254
254
|
type: O.MUTATION,
|
|
@@ -257,7 +257,7 @@ const i2 = {
|
|
|
257
257
|
if (!r)
|
|
258
258
|
return !1;
|
|
259
259
|
const { unitId: t, subUnitId: e, rule: n } = r;
|
|
260
|
-
return s.get(
|
|
260
|
+
return s.get(R).addRule(t, e, n), !0;
|
|
261
261
|
}
|
|
262
262
|
}, L0 = {
|
|
263
263
|
type: O.COMMAND,
|
|
@@ -265,7 +265,7 @@ const i2 = {
|
|
|
265
265
|
handler(s, r) {
|
|
266
266
|
if (!r)
|
|
267
267
|
return !1;
|
|
268
|
-
const { rule: t } = r, e = s.get(e2), n = s.get(W), i = s.get(
|
|
268
|
+
const { rule: t } = r, e = s.get(e2), n = s.get(W), i = s.get(R), a = s.get(q), c = t2(a, r);
|
|
269
269
|
if (!c) return !1;
|
|
270
270
|
const { unitId: l, subUnitId: o } = c, d = i.createCfId(l, o), u = { unitId: l, subUnitId: o, rule: { ...t, cfId: t.cfId || d } }, h = q2(s, u), g = n.syncExecuteCommand(a2.id, u);
|
|
271
271
|
return g && e.pushUndoRedo({
|
|
@@ -281,10 +281,10 @@ const i2 = {
|
|
|
281
281
|
if (!r)
|
|
282
282
|
return !1;
|
|
283
283
|
const { unitId: t, subUnitId: e, rule: n } = r, i = r.cfId || r.rule.cfId;
|
|
284
|
-
return s.get(
|
|
284
|
+
return s.get(R).setRule(t, e, n, i), !0;
|
|
285
285
|
}
|
|
286
286
|
}, Z2 = (s, r) => {
|
|
287
|
-
const t = s.get(
|
|
287
|
+
const t = s.get(R), { unitId: e, subUnitId: n } = r, i = r.cfId || r.rule.cfId, a = t.getRule(e, n, i);
|
|
288
288
|
return a ? [{
|
|
289
289
|
id: l2.id,
|
|
290
290
|
params: {
|
|
@@ -294,14 +294,14 @@ const i2 = {
|
|
|
294
294
|
rule: J.deepClone(a)
|
|
295
295
|
}
|
|
296
296
|
}] : [];
|
|
297
|
-
},
|
|
297
|
+
}, k0 = {
|
|
298
298
|
type: O.COMMAND,
|
|
299
299
|
id: "sheet.command.clear-range-conditional-rule",
|
|
300
300
|
handler(s, r) {
|
|
301
301
|
var D;
|
|
302
302
|
if (!r)
|
|
303
303
|
return !1;
|
|
304
|
-
const t = s.get(
|
|
304
|
+
const t = s.get(R), e = s.get(q), n = s.get(W), i = s.get(e2), a = s.get(r0), c = t2(e, r);
|
|
305
305
|
if (!c) return !1;
|
|
306
306
|
const { unitId: l, subUnitId: o } = c, d = ((D = a.getCurrentSelections()) == null ? void 0 : D.map((F) => F.range)) || [], u = t.getSubunitRules(l, o);
|
|
307
307
|
if (!(u != null && u.length) || !d.length)
|
|
@@ -310,40 +310,40 @@ const i2 = {
|
|
|
310
310
|
u.forEach((F) => {
|
|
311
311
|
const E = new V();
|
|
312
312
|
F.ranges.forEach((A) => {
|
|
313
|
-
T.foreach(A, (
|
|
314
|
-
E.setValue(
|
|
313
|
+
T.foreach(A, (S, k) => {
|
|
314
|
+
E.setValue(S, k, 1);
|
|
315
315
|
});
|
|
316
316
|
}), d.forEach((A) => {
|
|
317
|
-
T.foreach(A, (
|
|
318
|
-
E.realDeleteValue(
|
|
317
|
+
T.foreach(A, (S, k) => {
|
|
318
|
+
E.realDeleteValue(S, k);
|
|
319
319
|
});
|
|
320
320
|
});
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const A = { ...F, ranges:
|
|
324
|
-
h.push({ id: l2.id, params:
|
|
321
|
+
const I = s0(i0(E));
|
|
322
|
+
if (I.length) {
|
|
323
|
+
const A = { ...F, ranges: I }, S = { unitId: l, subUnitId: o, rule: A }, k = Z2(s, S);
|
|
324
|
+
h.push({ id: l2.id, params: S }), g.push(...k);
|
|
325
325
|
} else {
|
|
326
|
-
const A = { unitId: l, subUnitId: o, cfId: F.cfId },
|
|
327
|
-
h.push({ id: K.id, params: A }), g.push(...
|
|
326
|
+
const A = { unitId: l, subUnitId: o, cfId: F.cfId }, S = m2(s, A);
|
|
327
|
+
h.push({ id: K.id, params: A }), g.push(...S);
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
|
-
const f =
|
|
330
|
+
const f = B2(h, n).result;
|
|
331
331
|
return f && i.pushUndoRedo({
|
|
332
332
|
unitID: l,
|
|
333
333
|
redoMutations: h,
|
|
334
334
|
undoMutations: g
|
|
335
335
|
}), f;
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, B0 = {
|
|
338
338
|
type: O.COMMAND,
|
|
339
339
|
id: "sheet.command.clear-worksheet-conditional-rule",
|
|
340
340
|
handler(s, r) {
|
|
341
|
-
const t = s.get(
|
|
341
|
+
const t = s.get(R), e = s.get(q), n = s.get(W), i = s.get(e2), a = t2(e, r);
|
|
342
342
|
if (!a) return !1;
|
|
343
343
|
const { unitId: c, subUnitId: l } = a, o = t.getSubunitRules(c, l);
|
|
344
344
|
if (!(o != null && o.length))
|
|
345
345
|
return !1;
|
|
346
|
-
const d = o.map((f) => ({ cfId: f.cfId, unitId: c, subUnitId: l })), u = d.map((f) => ({ id: K.id, params: f })), h = d.map((f) => m2(s, f)[0]), g =
|
|
346
|
+
const d = o.map((f) => ({ cfId: f.cfId, unitId: c, subUnitId: l })), u = d.map((f) => ({ id: K.id, params: f })), h = d.map((f) => m2(s, f)[0]), g = B2(u, n).result;
|
|
347
347
|
return g && i.pushUndoRedo({
|
|
348
348
|
unitID: c,
|
|
349
349
|
redoMutations: u,
|
|
@@ -367,7 +367,7 @@ const i2 = {
|
|
|
367
367
|
handler(s, r) {
|
|
368
368
|
if (!r)
|
|
369
369
|
return !1;
|
|
370
|
-
const t = s.get(e2), e = s.get(W), n = s.get(q), i = s.get(
|
|
370
|
+
const t = s.get(e2), e = s.get(W), n = s.get(q), i = s.get(R), a = t2(n, r);
|
|
371
371
|
if (!a) return !1;
|
|
372
372
|
const { unitId: c, subUnitId: l } = a, o = W2(r.start, r.end, i.getSubunitRules(c, l) || [], (D) => D.cfId);
|
|
373
373
|
if (!o)
|
|
@@ -396,7 +396,7 @@ var V0 = Object.getOwnPropertyDescriptor, O0 = (s, r, t, e) => {
|
|
|
396
396
|
(a = s[i]) && (n = a(n) || n);
|
|
397
397
|
return n;
|
|
398
398
|
}, S2 = (s, r) => (t, e) => r(t, e, s);
|
|
399
|
-
let z = class extends
|
|
399
|
+
let z = class extends x2 {
|
|
400
400
|
constructor(r, t) {
|
|
401
401
|
super();
|
|
402
402
|
// Cache Formula ID and formula mapping.
|
|
@@ -408,12 +408,12 @@ let z = class extends _2 {
|
|
|
408
408
|
_initRuleChange() {
|
|
409
409
|
const r = (t) => {
|
|
410
410
|
switch (t.type) {
|
|
411
|
-
case
|
|
412
|
-
return t.config.some((e) => e.value.type ===
|
|
413
|
-
case
|
|
414
|
-
return [t.config.max, t.config.min].some((e) => e.type ===
|
|
415
|
-
case
|
|
416
|
-
return t.config.some((e) => e.value.type ===
|
|
411
|
+
case y.colorScale:
|
|
412
|
+
return t.config.some((e) => e.value.type === L.formula);
|
|
413
|
+
case y.dataBar:
|
|
414
|
+
return [t.config.max, t.config.min].some((e) => e.type === L.formula);
|
|
415
|
+
case y.iconSet:
|
|
416
|
+
return t.config.some((e) => e.value.type === L.formula);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((t) => {
|
|
@@ -426,7 +426,7 @@ let z = class extends _2 {
|
|
|
426
426
|
*/
|
|
427
427
|
_registerRuleFormulas(r, t, e) {
|
|
428
428
|
switch (e.rule.type) {
|
|
429
|
-
case
|
|
429
|
+
case y.highlightCell: {
|
|
430
430
|
if (e.rule.subType === _.formula) {
|
|
431
431
|
const n = e.rule.value;
|
|
432
432
|
n && this.registerFormulaWithRange(
|
|
@@ -526,7 +526,7 @@ let z = class extends _2 {
|
|
|
526
526
|
if (!r || !r[0] || !r[0][0])
|
|
527
527
|
return !1;
|
|
528
528
|
const t = r[0][0];
|
|
529
|
-
return (t == null ? void 0 : t.t) ===
|
|
529
|
+
return (t == null ? void 0 : t.t) === M.BOOLEAN ? t.v === N2.TRUE || t.v === !0 : t == null ? void 0 : t.v;
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* If `formulaText` is not provided, then all caches related to `cfId` will be deleted.
|
|
@@ -557,8 +557,8 @@ let z = class extends _2 {
|
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
559
|
z = O0([
|
|
560
|
-
S2(0,
|
|
561
|
-
S2(1,
|
|
560
|
+
S2(0, b(w0)),
|
|
561
|
+
S2(1, b(R))
|
|
562
562
|
], z);
|
|
563
563
|
var U = /* @__PURE__ */ ((s) => (s.preComputingStart = "preComputingStart", s.preComputing = "preComputing", s.preComputingEnd = "preComputingEnd", s.preComputingError = "preComputingError", s))(U || {});
|
|
564
564
|
class F2 {
|
|
@@ -637,10 +637,10 @@ class F2 {
|
|
|
637
637
|
class $0 extends F2 {
|
|
638
638
|
preComputing(r, t, e) {
|
|
639
639
|
const n = e.rule, i = e.worksheet, a = new V();
|
|
640
|
-
!n.rule.config.every((d) => d.value.type ===
|
|
640
|
+
!n.rule.config.every((d) => d.value.type === L.num) && w2(n.ranges, i.getMaxRows() - 1, i.getMaxColumns() - 1).forEach((u) => {
|
|
641
641
|
T.foreach(u, (h, g) => {
|
|
642
642
|
const f = e.getCellValue(h, g), D = f && f.v;
|
|
643
|
-
if (!
|
|
643
|
+
if (!x(D) && (f == null ? void 0 : f.t) === M.NUMBER) {
|
|
644
644
|
const F = Number(D);
|
|
645
645
|
!Number.isNaN(F) && a.setValue(h, g, F);
|
|
646
646
|
}
|
|
@@ -667,7 +667,7 @@ class $0 extends F2 {
|
|
|
667
667
|
if (!e)
|
|
668
668
|
return null;
|
|
669
669
|
const i = n.getCellValue(r, t);
|
|
670
|
-
if (i.t ===
|
|
670
|
+
if (i.t === M.NUMBER) {
|
|
671
671
|
const a = Number(i.v);
|
|
672
672
|
if (!Number.isNaN(a))
|
|
673
673
|
return n1(e, a);
|
|
@@ -706,23 +706,23 @@ class G0 extends $2 {
|
|
|
706
706
|
return;
|
|
707
707
|
c.add($);
|
|
708
708
|
}
|
|
709
|
-
const { color: D, value: F, startPoint: E, isGradient:
|
|
709
|
+
const { color: D, value: F, startPoint: E, isGradient: I } = f.dataBar, { startX: A, endX: S, startY: k, endY: v2 } = u || h ? g : d, o2 = S - A, p2 = v2 + y0 - k, Z = o2 - this._paddingRightAndLeft * 2, y2 = p2 - this._paddingTopAndBottom * 2;
|
|
710
710
|
if (F > 0) {
|
|
711
|
-
const $ = Math.max(Z * (1 - E / 100) * F / 100, 1), G = A + this._paddingRightAndLeft + E / 100 * Z, H =
|
|
712
|
-
if (
|
|
711
|
+
const $ = Math.max(Z * (1 - E / 100) * F / 100, 1), G = A + this._paddingRightAndLeft + E / 100 * Z, H = k + this._paddingTopAndBottom;
|
|
712
|
+
if (I) {
|
|
713
713
|
const j = t.createLinearGradient(G, H, G + $, H);
|
|
714
714
|
j.addColorStop(0, D), j.addColorStop(1, "rgb(255 255 255)"), t.fillStyle = j, t.strokeStyle = D, t.lineWidth = 1;
|
|
715
715
|
} else
|
|
716
716
|
t.fillStyle = D;
|
|
717
|
-
this._drawRectWithRoundedCorner(t, G, H, $, y2, !1, !0, !0, !1),
|
|
717
|
+
this._drawRectWithRoundedCorner(t, G, H, $, y2, !1, !0, !0, !1), I && t.stroke();
|
|
718
718
|
} else {
|
|
719
|
-
const $ = Math.max(Z * E / 100 * Math.abs(F) / 100, 1), G = A + this._paddingRightAndLeft + E / 100 * Z - $, H =
|
|
720
|
-
if (
|
|
719
|
+
const $ = Math.max(Z * E / 100 * Math.abs(F) / 100, 1), G = A + this._paddingRightAndLeft + E / 100 * Z - $, H = k + this._paddingTopAndBottom;
|
|
720
|
+
if (I) {
|
|
721
721
|
const j = t.createLinearGradient(G, H, G + $, H);
|
|
722
722
|
j.addColorStop(0, "rgb(255 255 255)"), j.addColorStop(1, D), t.fillStyle = j, t.strokeStyle = D, t.lineWidth = 1;
|
|
723
723
|
} else
|
|
724
724
|
t.fillStyle = D;
|
|
725
|
-
this._drawRectWithRoundedCorner(t, G, H, $, y2, !0, !1, !1, !0),
|
|
725
|
+
this._drawRectWithRoundedCorner(t, G, H, $, y2, !0, !1, !1, !0), I && t.stroke();
|
|
726
726
|
}
|
|
727
727
|
}), t.restore();
|
|
728
728
|
}
|
|
@@ -734,7 +734,7 @@ class G0 extends $2 {
|
|
|
734
734
|
O2.add(G0);
|
|
735
735
|
const u2 = (s) => Math.max(Math.min(100, s), 0), H0 = (s, r, t) => {
|
|
736
736
|
const e = t(s, r);
|
|
737
|
-
if (e && e.t ===
|
|
737
|
+
if (e && e.t === M.NUMBER) {
|
|
738
738
|
const n = Number(e.v);
|
|
739
739
|
return Number.isNaN(n) ? null : n;
|
|
740
740
|
}
|
|
@@ -743,11 +743,11 @@ const u2 = (s) => Math.max(Math.min(100, s), 0), H0 = (s, r, t) => {
|
|
|
743
743
|
class j0 extends F2 {
|
|
744
744
|
preComputing(r, t, e) {
|
|
745
745
|
const n = e.rule, i = n.rule, a = e.worksheet, c = new V();
|
|
746
|
-
![n.rule.config.max, n.rule.config.min].every((g) => g.type ===
|
|
746
|
+
![n.rule.config.max, n.rule.config.min].every((g) => g.type === L.num) && w2(n.ranges, a.getMaxRows() - 1, a.getMaxColumns() - 1).forEach((f) => {
|
|
747
747
|
T.foreach(f, (D, F) => {
|
|
748
|
-
const E = e.getCellValue(D, F),
|
|
749
|
-
if (!
|
|
750
|
-
const A = Number(
|
|
748
|
+
const E = e.getCellValue(D, F), I = E && E.v;
|
|
749
|
+
if (!x(I) && (E == null ? void 0 : E.t) === M.NUMBER) {
|
|
750
|
+
const A = Number(I);
|
|
751
751
|
!Number.isNaN(A) && c.setValue(D, F, A);
|
|
752
752
|
}
|
|
753
753
|
});
|
|
@@ -803,14 +803,14 @@ class j0 extends F2 {
|
|
|
803
803
|
class X0 extends F2 {
|
|
804
804
|
// eslint-disable-next-line max-lines-per-function
|
|
805
805
|
preComputing(r, t, e) {
|
|
806
|
-
const n = e.rule.rule, i = e.rule.ranges, c = (() => {
|
|
806
|
+
const n = e.rule.rule, i = w2(e.rule.ranges, e.worksheet.getMaxRows() - 1, e.worksheet.getMaxColumns() - 1), c = (() => {
|
|
807
807
|
switch (n.subType) {
|
|
808
808
|
case _.average: {
|
|
809
809
|
let l = 0, o = 0;
|
|
810
810
|
return i.forEach((d) => {
|
|
811
811
|
T.foreach(d, (u, h) => {
|
|
812
|
-
const g = e.getCellValue(u, h), f = P(g
|
|
813
|
-
g && g.t ===
|
|
812
|
+
const g = e.getCellValue(u, h), f = P(g);
|
|
813
|
+
g && g.t === M.NUMBER && !x(f) && (l += Number(f) || 0, o++);
|
|
814
814
|
});
|
|
815
815
|
}), { value: l / o, type: n.subType };
|
|
816
816
|
}
|
|
@@ -819,8 +819,8 @@ class X0 extends F2 {
|
|
|
819
819
|
const l = /* @__PURE__ */ new Map();
|
|
820
820
|
return i.forEach((o) => {
|
|
821
821
|
T.foreach(o, (d, u) => {
|
|
822
|
-
const h = e.getCellValue(d, u), g = P(h
|
|
823
|
-
if (g
|
|
822
|
+
const h = e.getCellValue(d, u), g = P(h);
|
|
823
|
+
if (!x(g)) {
|
|
824
824
|
const f = l.get(g);
|
|
825
825
|
f ? l.set(g, f + 1) : l.set(g, 1);
|
|
826
826
|
}
|
|
@@ -831,8 +831,8 @@ class X0 extends F2 {
|
|
|
831
831
|
let l = [];
|
|
832
832
|
i.forEach((u) => {
|
|
833
833
|
T.foreach(u, (h, g) => {
|
|
834
|
-
const f = e.getCellValue(h, g), D = P(f
|
|
835
|
-
f && f.t ===
|
|
834
|
+
const f = e.getCellValue(h, g), D = P(f);
|
|
835
|
+
f && f.t === M.NUMBER && !x(D) && l.push(Number(D) || 0);
|
|
836
836
|
});
|
|
837
837
|
}), l.sort((u, h) => h - u);
|
|
838
838
|
const o = e.rule.rule;
|
|
@@ -855,7 +855,7 @@ class X0 extends F2 {
|
|
|
855
855
|
}
|
|
856
856
|
case _.timePeriod:
|
|
857
857
|
switch (n.operator) {
|
|
858
|
-
case
|
|
858
|
+
case N.last7Days:
|
|
859
859
|
return {
|
|
860
860
|
value: {
|
|
861
861
|
start: v().subtract(7, "day").valueOf(),
|
|
@@ -863,7 +863,7 @@ class X0 extends F2 {
|
|
|
863
863
|
},
|
|
864
864
|
type: n.subType
|
|
865
865
|
};
|
|
866
|
-
case
|
|
866
|
+
case N.lastMonth:
|
|
867
867
|
return {
|
|
868
868
|
value: {
|
|
869
869
|
start: v().startOf("month").subtract(1, "month").valueOf(),
|
|
@@ -871,7 +871,7 @@ class X0 extends F2 {
|
|
|
871
871
|
},
|
|
872
872
|
type: n.subType
|
|
873
873
|
};
|
|
874
|
-
case
|
|
874
|
+
case N.lastWeek:
|
|
875
875
|
return {
|
|
876
876
|
value: {
|
|
877
877
|
start: v().startOf("week").subtract(1, "week").valueOf(),
|
|
@@ -879,7 +879,7 @@ class X0 extends F2 {
|
|
|
879
879
|
},
|
|
880
880
|
type: n.subType
|
|
881
881
|
};
|
|
882
|
-
case
|
|
882
|
+
case N.nextMonth:
|
|
883
883
|
return {
|
|
884
884
|
value: {
|
|
885
885
|
start: v().startOf("month").add(1, "month").valueOf(),
|
|
@@ -887,7 +887,7 @@ class X0 extends F2 {
|
|
|
887
887
|
},
|
|
888
888
|
type: n.subType
|
|
889
889
|
};
|
|
890
|
-
case
|
|
890
|
+
case N.nextWeek:
|
|
891
891
|
return {
|
|
892
892
|
value: {
|
|
893
893
|
start: v().startOf("week").add(1, "week").valueOf(),
|
|
@@ -895,7 +895,7 @@ class X0 extends F2 {
|
|
|
895
895
|
},
|
|
896
896
|
type: n.subType
|
|
897
897
|
};
|
|
898
|
-
case
|
|
898
|
+
case N.thisMonth:
|
|
899
899
|
return {
|
|
900
900
|
value: {
|
|
901
901
|
start: v().startOf("month").valueOf(),
|
|
@@ -903,7 +903,7 @@ class X0 extends F2 {
|
|
|
903
903
|
},
|
|
904
904
|
type: n.subType
|
|
905
905
|
};
|
|
906
|
-
case
|
|
906
|
+
case N.thisWeek:
|
|
907
907
|
return {
|
|
908
908
|
value: {
|
|
909
909
|
start: v().startOf("week").valueOf(),
|
|
@@ -911,7 +911,7 @@ class X0 extends F2 {
|
|
|
911
911
|
},
|
|
912
912
|
type: n.subType
|
|
913
913
|
};
|
|
914
|
-
case
|
|
914
|
+
case N.today:
|
|
915
915
|
return {
|
|
916
916
|
value: {
|
|
917
917
|
start: v().startOf("day").valueOf(),
|
|
@@ -919,7 +919,7 @@ class X0 extends F2 {
|
|
|
919
919
|
},
|
|
920
920
|
type: n.subType
|
|
921
921
|
};
|
|
922
|
-
case
|
|
922
|
+
case N.tomorrow:
|
|
923
923
|
return {
|
|
924
924
|
value: {
|
|
925
925
|
start: v().startOf("day").add(1, "day").valueOf(),
|
|
@@ -927,7 +927,7 @@ class X0 extends F2 {
|
|
|
927
927
|
},
|
|
928
928
|
type: n.subType
|
|
929
929
|
};
|
|
930
|
-
case
|
|
930
|
+
case N.yesterday:
|
|
931
931
|
return {
|
|
932
932
|
value: {
|
|
933
933
|
start: v().startOf("day").subtract(1, "day").valueOf(),
|
|
@@ -946,11 +946,11 @@ class X0 extends F2 {
|
|
|
946
946
|
return (() => {
|
|
947
947
|
switch (a.subType) {
|
|
948
948
|
case _.number: {
|
|
949
|
-
const o = i && Number(i.v), d = (i == null ? void 0 : i.t) ===
|
|
950
|
-
return d ?
|
|
949
|
+
const o = i && Number(i.v), d = (i == null ? void 0 : i.t) === M.NUMBER, u = a;
|
|
950
|
+
return d ? x(o) || Number.isNaN(o) ? void 0 : r2({ operator: u.operator, value: u.value || 0 }, o || 0) : !![w.notEqual, w.notBetween].includes(u.operator);
|
|
951
951
|
}
|
|
952
952
|
case _.text: {
|
|
953
|
-
const o = a, d = P(i), u = d
|
|
953
|
+
const o = a, d = P(i), u = x(d) ? "" : String(d), h = o.value || "";
|
|
954
954
|
switch (o.operator) {
|
|
955
955
|
case B.beginsWith:
|
|
956
956
|
return u.startsWith(h);
|
|
@@ -978,16 +978,16 @@ class X0 extends F2 {
|
|
|
978
978
|
}
|
|
979
979
|
case _.timePeriod: {
|
|
980
980
|
const o = P(i);
|
|
981
|
-
if (
|
|
981
|
+
if (x(o) || Number.isNaN(Number(o)) || (i == null ? void 0 : i.t) !== M.NUMBER || !e)
|
|
982
982
|
return;
|
|
983
983
|
const d = e1(Number(o)), { start: u, end: h } = e.value;
|
|
984
984
|
return d >= u && d <= h;
|
|
985
985
|
}
|
|
986
986
|
case _.average: {
|
|
987
|
-
const o = i && i.v, d = Number(o), u = (i == null ? void 0 : i.t) ===
|
|
987
|
+
const o = i && i.v, d = Number(o), u = (i == null ? void 0 : i.t) === M.NUMBER, h = a;
|
|
988
988
|
if (!u)
|
|
989
989
|
return w.notEqual === h.operator;
|
|
990
|
-
if (
|
|
990
|
+
if (x(o) || Number.isNaN(d) || !e)
|
|
991
991
|
return !1;
|
|
992
992
|
const g = e.value;
|
|
993
993
|
switch (h.operator) {
|
|
@@ -1009,18 +1009,21 @@ class X0 extends F2 {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
case _.rank: {
|
|
1011
1011
|
const o = P(i), d = Number(o);
|
|
1012
|
-
if (
|
|
1012
|
+
if (x(o) || Number.isNaN(d) || (i == null ? void 0 : i.t) !== M.NUMBER || !e)
|
|
1013
1013
|
return !1;
|
|
1014
1014
|
const u = e.value;
|
|
1015
1015
|
return a.isBottom ? d <= u : d >= u;
|
|
1016
1016
|
}
|
|
1017
1017
|
case _.uniqueValues: {
|
|
1018
1018
|
const o = P(i);
|
|
1019
|
-
return
|
|
1019
|
+
return x(o) || !e ? !1 : e.value.get(o) === 1;
|
|
1020
1020
|
}
|
|
1021
1021
|
case _.duplicateValues: {
|
|
1022
1022
|
const o = P(i);
|
|
1023
|
-
|
|
1023
|
+
if (x(o) || !e)
|
|
1024
|
+
return !1;
|
|
1025
|
+
const d = e.value.get(o);
|
|
1026
|
+
return d && d !== 1;
|
|
1024
1027
|
}
|
|
1025
1028
|
case _.formula: {
|
|
1026
1029
|
const o = e == null ? void 0 : e.value;
|
|
@@ -1036,7 +1039,7 @@ class X0 extends F2 {
|
|
|
1036
1039
|
}
|
|
1037
1040
|
const K0 = (s, r, t) => {
|
|
1038
1041
|
const e = t(s, r);
|
|
1039
|
-
if (e && e.t ===
|
|
1042
|
+
if (e && e.t === M.NUMBER) {
|
|
1040
1043
|
const n = Number(e.v);
|
|
1041
1044
|
return Number.isNaN(n) ? null : n;
|
|
1042
1045
|
}
|
|
@@ -1045,10 +1048,10 @@ const K0 = (s, r, t) => {
|
|
|
1045
1048
|
class Y0 extends F2 {
|
|
1046
1049
|
preComputing(r, t, e) {
|
|
1047
1050
|
const n = e.rule.rule, i = e.worksheet, a = new V();
|
|
1048
|
-
!n.config.every((d) => d.value.type ===
|
|
1051
|
+
!n.config.every((d) => d.value.type === L.num) && w2(e.rule.ranges, i.getMaxRows() - 1, i.getMaxColumns() - 1).forEach((u) => {
|
|
1049
1052
|
T.foreach(u, (h, g) => {
|
|
1050
1053
|
const f = e.getCellValue(h, g), D = f && f.v;
|
|
1051
|
-
if (!
|
|
1054
|
+
if (!x(D) && (f == null ? void 0 : f.t) === M.NUMBER) {
|
|
1052
1055
|
const F = Number(D);
|
|
1053
1056
|
!Number.isNaN(F) && a.setValue(h, g, F);
|
|
1054
1057
|
}
|
|
@@ -1103,8 +1106,8 @@ var J0 = Object.getOwnPropertyDescriptor, z0 = (s, r, t, e) => {
|
|
|
1103
1106
|
(a = s[i]) && (n = a(n) || n);
|
|
1104
1107
|
return n;
|
|
1105
1108
|
}, c2 = (s, r) => (t, e) => r(t, e, s);
|
|
1106
|
-
const
|
|
1107
|
-
let Q = class extends
|
|
1109
|
+
const E2 = 1e3 * 3 * 3;
|
|
1110
|
+
let Q = class extends x2 {
|
|
1108
1111
|
constructor(r, t, e, n) {
|
|
1109
1112
|
super();
|
|
1110
1113
|
// Map<unitID ,<sheetId ,ObjectMatrix>>
|
|
@@ -1113,7 +1116,7 @@ let Q = class extends _2 {
|
|
|
1113
1116
|
/**
|
|
1114
1117
|
* 1nd-level cache
|
|
1115
1118
|
*/
|
|
1116
|
-
m(this, "_cellCache", new T2(
|
|
1119
|
+
m(this, "_cellCache", new T2(E2));
|
|
1117
1120
|
m(this, "_markDirty$", new d2());
|
|
1118
1121
|
/**
|
|
1119
1122
|
* The rendering layer listens to this variable to determine whether a reRender is necessary.
|
|
@@ -1203,7 +1206,7 @@ let Q = class extends _2 {
|
|
|
1203
1206
|
this._conditionalFormattingRuleModel.$ruleChange.subscribe((r) => {
|
|
1204
1207
|
if (r.type === "set") {
|
|
1205
1208
|
const { unitId: t, subUnitId: e } = r, n = r.oldRule;
|
|
1206
|
-
n.rule.type ===
|
|
1209
|
+
n.rule.type === y.highlightCell && n.rule.subType === _.formula && this._conditionalFormattingFormulaService.deleteCache(t, e, n.cfId);
|
|
1207
1210
|
}
|
|
1208
1211
|
})
|
|
1209
1212
|
);
|
|
@@ -1260,24 +1263,24 @@ let Q = class extends _2 {
|
|
|
1260
1263
|
subUnitId: t,
|
|
1261
1264
|
accessor: this._injector,
|
|
1262
1265
|
rule: e,
|
|
1263
|
-
limit:
|
|
1266
|
+
limit: E2,
|
|
1264
1267
|
getCellValue: (c, l) => i.getCellRaw(c, l) || {}
|
|
1265
1268
|
};
|
|
1266
1269
|
switch (e.rule.type) {
|
|
1267
|
-
case
|
|
1270
|
+
case y.colorScale:
|
|
1268
1271
|
return new $0(a);
|
|
1269
|
-
case
|
|
1272
|
+
case y.dataBar:
|
|
1270
1273
|
return new j0(a);
|
|
1271
|
-
case
|
|
1274
|
+
case y.highlightCell:
|
|
1272
1275
|
return new X0(a);
|
|
1273
|
-
case
|
|
1276
|
+
case y.iconSet:
|
|
1274
1277
|
return new Y0(a);
|
|
1275
1278
|
}
|
|
1276
1279
|
}
|
|
1277
1280
|
_createCacheKey(r, t, e, n) {
|
|
1278
1281
|
return `${r}_${t}_${e}_${n}`;
|
|
1279
1282
|
}
|
|
1280
|
-
setCacheLength(r =
|
|
1283
|
+
setCacheLength(r = E2) {
|
|
1281
1284
|
this._cellCache.limit !== r && (this._cellCache.limit = r, this._calculateUnitManagers.forEach((t) => {
|
|
1282
1285
|
t.forEach((e) => {
|
|
1283
1286
|
e.forEach((n) => {
|
|
@@ -1288,23 +1291,23 @@ let Q = class extends _2 {
|
|
|
1288
1291
|
}
|
|
1289
1292
|
};
|
|
1290
1293
|
Q = z0([
|
|
1291
|
-
c2(0,
|
|
1292
|
-
c2(1,
|
|
1293
|
-
c2(2,
|
|
1294
|
+
c2(0, b(M2)),
|
|
1295
|
+
c2(1, b(R)),
|
|
1296
|
+
c2(2, b(z)),
|
|
1294
1297
|
c2(3, q)
|
|
1295
1298
|
], Q);
|
|
1296
1299
|
function h2(s, r) {
|
|
1297
1300
|
return Math.abs(s - r) < Number.EPSILON;
|
|
1298
1301
|
}
|
|
1299
|
-
const
|
|
1302
|
+
const x = (s) => s == null || typeof s == "string" && s.trim() === "", P = (s) => {
|
|
1300
1303
|
var e, n;
|
|
1301
1304
|
if (!s)
|
|
1302
1305
|
return null;
|
|
1303
|
-
if (s.t ===
|
|
1306
|
+
if (s.t === M.BOOLEAN)
|
|
1304
1307
|
return s.v === N2.TRUE ? I2.TRUE : I2.FALSE;
|
|
1305
1308
|
const r = s.v, t = (n = (e = s.p) == null ? void 0 : e.body) == null ? void 0 : n.dataStream.replace(/\r\n$/, "");
|
|
1306
|
-
return
|
|
1307
|
-
},
|
|
1309
|
+
return x(r) ? x(t) ? null : t : r;
|
|
1310
|
+
}, A2 = 86400;
|
|
1308
1311
|
function Q0(s, r = !0) {
|
|
1309
1312
|
if (r && s >= 0) {
|
|
1310
1313
|
if (s === 0)
|
|
@@ -1326,14 +1329,14 @@ function Q0(s, r = !0) {
|
|
|
1326
1329
|
}
|
|
1327
1330
|
const e1 = (s) => {
|
|
1328
1331
|
let r = s | 0;
|
|
1329
|
-
const t =
|
|
1332
|
+
const t = A2 * (s - r);
|
|
1330
1333
|
let e = Math.floor(t);
|
|
1331
|
-
t - e > 0.9999 && (e += 1, e ===
|
|
1332
|
-
const n = e < 0 ?
|
|
1334
|
+
t - e > 0.9999 && (e += 1, e === A2 && (e = 0, r += 1));
|
|
1335
|
+
const n = e < 0 ? A2 + e : e, [i, a, c] = Q0(s, !0), l = Math.floor(n / 60 / 60) % 60, o = Math.floor(n / 60) % 60, d = Math.floor(n) % 60;
|
|
1333
1336
|
return v(`${i}/${a}/${c} ${l}:${o}:${d}`).valueOf();
|
|
1334
1337
|
}, g2 = (s, r, t) => {
|
|
1335
1338
|
switch (s.type) {
|
|
1336
|
-
case
|
|
1339
|
+
case L.max: {
|
|
1337
1340
|
let e = 0;
|
|
1338
1341
|
return r.forValue((n, i, a) => {
|
|
1339
1342
|
a > e && (e = a);
|
|
@@ -1342,7 +1345,7 @@ const e1 = (s) => {
|
|
|
1342
1345
|
result: e
|
|
1343
1346
|
};
|
|
1344
1347
|
}
|
|
1345
|
-
case
|
|
1348
|
+
case L.min: {
|
|
1346
1349
|
let e;
|
|
1347
1350
|
return r.forValue((n, i, a) => {
|
|
1348
1351
|
e === void 0 && (e = a), a < e && (e = a);
|
|
@@ -1351,7 +1354,7 @@ const e1 = (s) => {
|
|
|
1351
1354
|
result: e
|
|
1352
1355
|
};
|
|
1353
1356
|
}
|
|
1354
|
-
case
|
|
1357
|
+
case L.percent: {
|
|
1355
1358
|
let e, n;
|
|
1356
1359
|
r.forValue((c, l, o) => {
|
|
1357
1360
|
(e === void 0 || n === void 0) && (e = o, n = o), o > e && (e = o), o < n && (n = o);
|
|
@@ -1362,18 +1365,18 @@ const e1 = (s) => {
|
|
|
1362
1365
|
result: i * (a / 100) + (n || 0)
|
|
1363
1366
|
};
|
|
1364
1367
|
}
|
|
1365
|
-
case
|
|
1368
|
+
case L.percentile: {
|
|
1366
1369
|
const e = r.toNativeArray().sort((o, d) => o - d), n = Math.max(Math.min(Number(s.value) || 0, 100), 0), i = (e.length - 1) * n / 100, a = Math.floor(i), c = i - a, l = e[a] + (e[Math.min(a + 1, e.length - 1)] - e[a]) * c;
|
|
1367
1370
|
return {
|
|
1368
1371
|
status: p.SUCCESS,
|
|
1369
1372
|
result: l
|
|
1370
1373
|
};
|
|
1371
1374
|
}
|
|
1372
|
-
case
|
|
1375
|
+
case L.formula: {
|
|
1373
1376
|
const { accessor: e, unitId: n, subUnitId: i, cfId: a } = t, c = String(s.value), l = e.get(z);
|
|
1374
1377
|
return l.registerFormulaWithRange(n, i, a, c), l.getFormulaResultWithCoords(n, i, a, c);
|
|
1375
1378
|
}
|
|
1376
|
-
case
|
|
1379
|
+
case L.num:
|
|
1377
1380
|
default: {
|
|
1378
1381
|
const e = Number(s.value);
|
|
1379
1382
|
return {
|
|
@@ -1461,7 +1464,7 @@ const e1 = (s) => {
|
|
|
1461
1464
|
}
|
|
1462
1465
|
} else
|
|
1463
1466
|
return s[s.length - 1].color.toRgbString();
|
|
1464
|
-
},
|
|
1467
|
+
}, w2 = (s, r, t) => s.map((e) => {
|
|
1465
1468
|
if (e.startColumn > t || e.startRow > r)
|
|
1466
1469
|
return null;
|
|
1467
1470
|
const n = { ...e };
|
|
@@ -1575,13 +1578,13 @@ for (const s in C2) {
|
|
|
1575
1578
|
const r = C2[s];
|
|
1576
1579
|
Object.freeze(r);
|
|
1577
1580
|
}
|
|
1578
|
-
const C1 = "EMPTY_ICON_TYPE", f1 = "ssheets-conditional-formatting.config",
|
|
1581
|
+
const C1 = "EMPTY_ICON_TYPE", f1 = "ssheets-conditional-formatting.config", k2 = {};
|
|
1579
1582
|
var D1 = Object.getOwnPropertyDescriptor, m1 = (s, r, t, e) => {
|
|
1580
1583
|
for (var n = e > 1 ? void 0 : e ? D1(r, t) : r, i = s.length - 1, a; i >= 0; i--)
|
|
1581
1584
|
(a = s[i]) && (n = a(n) || n);
|
|
1582
1585
|
return n;
|
|
1583
1586
|
}, Y = (s, r) => (t, e) => r(t, e, s);
|
|
1584
|
-
let s2 = class extends
|
|
1587
|
+
let s2 = class extends x2 {
|
|
1585
1588
|
constructor(s, r, t, e, n, i) {
|
|
1586
1589
|
super(), this._conditionalFormattingRuleModel = s, this._injector = r, this._univerInstanceService = t, this._resourceManagerService = e, this._sheetInterceptorService = n, this._commandService = i, this._initCellChange(), this._initSnapshot(), this._initSheetChange();
|
|
1587
1590
|
}
|
|
@@ -1595,15 +1598,15 @@ let s2 = class extends _2 {
|
|
|
1595
1598
|
return a > -1 && i.splice(a + 1), i.reduce((l, o) => {
|
|
1596
1599
|
var h;
|
|
1597
1600
|
const d = o.rule.type, u = n.find((g) => g.cfId === o.cfId);
|
|
1598
|
-
if (d ===
|
|
1601
|
+
if (d === y.highlightCell)
|
|
1599
1602
|
u.result && V2(l, { style: u.result });
|
|
1600
|
-
else if (d ===
|
|
1603
|
+
else if (d === y.colorScale) {
|
|
1601
1604
|
const g = u == null ? void 0 : u.result;
|
|
1602
1605
|
g && typeof g == "string" && (l.style = { ...(h = l.style) != null ? h : {}, bg: { rgb: g } });
|
|
1603
|
-
} else if (d ===
|
|
1606
|
+
} else if (d === y.dataBar) {
|
|
1604
1607
|
const g = u == null ? void 0 : u.result;
|
|
1605
1608
|
g && (l.dataBar = g, l.isShowValue = g.isShowValue);
|
|
1606
|
-
} else if (d ===
|
|
1609
|
+
} else if (d === y.iconSet) {
|
|
1607
1610
|
const g = u == null ? void 0 : u.result;
|
|
1608
1611
|
g && (l.iconSet = g, l.isShowValue = g.isShowValue);
|
|
1609
1612
|
}
|
|
@@ -1784,12 +1787,12 @@ let s2 = class extends _2 {
|
|
|
1784
1787
|
}
|
|
1785
1788
|
};
|
|
1786
1789
|
s2 = m1([
|
|
1787
|
-
Y(0,
|
|
1788
|
-
Y(1,
|
|
1789
|
-
Y(2,
|
|
1790
|
-
Y(3,
|
|
1791
|
-
Y(4,
|
|
1792
|
-
Y(5,
|
|
1790
|
+
Y(0, b(R)),
|
|
1791
|
+
Y(1, b(M2)),
|
|
1792
|
+
Y(2, b(q)),
|
|
1793
|
+
Y(3, b(J2)),
|
|
1794
|
+
Y(4, b(a0)),
|
|
1795
|
+
Y(5, b(W))
|
|
1793
1796
|
], s2);
|
|
1794
1797
|
const F1 = (s) => s.getCurrentUnitForType(D2.UNIVER_SHEET).getUnitId(), w1 = (s) => {
|
|
1795
1798
|
var r;
|
|
@@ -1799,26 +1802,26 @@ var v1 = Object.defineProperty, p1 = Object.getOwnPropertyDescriptor, E1 = (s, r
|
|
|
1799
1802
|
for (var n = e > 1 ? void 0 : e ? p1(r, t) : r, i = s.length - 1, a; i >= 0; i--)
|
|
1800
1803
|
(a = s[i]) && (n = a(n) || n);
|
|
1801
1804
|
return n;
|
|
1802
|
-
},
|
|
1803
|
-
let f2 = class extends
|
|
1804
|
-
constructor(s =
|
|
1805
|
+
}, _2 = (s, r) => (t, e) => r(t, e, s), G2 = (s, r, t) => E1(s, typeof r != "symbol" ? r + "" : r, t);
|
|
1806
|
+
let f2 = class extends e0 {
|
|
1807
|
+
constructor(s = k2, r, t, e) {
|
|
1805
1808
|
super(), this._config = s, this._injector = r, this._commandService = t, this._configService = e;
|
|
1806
1809
|
const { ...n } = V2(
|
|
1807
1810
|
{},
|
|
1808
|
-
|
|
1811
|
+
k2,
|
|
1809
1812
|
this._config
|
|
1810
1813
|
);
|
|
1811
1814
|
this._configService.setConfig(f1, n), [
|
|
1812
1815
|
[s2],
|
|
1813
1816
|
[z],
|
|
1814
|
-
[
|
|
1817
|
+
[R],
|
|
1815
1818
|
[Q]
|
|
1816
1819
|
].forEach((i) => {
|
|
1817
1820
|
this._injector.add(i);
|
|
1818
1821
|
}), [
|
|
1819
1822
|
L0,
|
|
1820
|
-
B0,
|
|
1821
1823
|
k0,
|
|
1824
|
+
B0,
|
|
1822
1825
|
N0,
|
|
1823
1826
|
T0,
|
|
1824
1827
|
U0,
|
|
@@ -1831,7 +1834,7 @@ let f2 = class extends t0 {
|
|
|
1831
1834
|
});
|
|
1832
1835
|
}
|
|
1833
1836
|
onStarting() {
|
|
1834
|
-
this._injector.get(s2),
|
|
1837
|
+
this._injector.get(s2), t0(this._injector, [
|
|
1835
1838
|
[s2],
|
|
1836
1839
|
[Q]
|
|
1837
1840
|
]);
|
|
@@ -1841,9 +1844,9 @@ G2(f2, "pluginName", P2);
|
|
|
1841
1844
|
G2(f2, "type", D2.UNIVER_SHEET);
|
|
1842
1845
|
f2 = A1([
|
|
1843
1846
|
Q2(p0),
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
+
_2(1, b(M2)),
|
|
1848
|
+
_2(2, b(W)),
|
|
1849
|
+
_2(3, n0)
|
|
1847
1850
|
], f2);
|
|
1848
1851
|
const _1 = "sheet-conditional-rule-icon", x1 = 35, M1 = 15, y1 = 2, R1 = (s) => {
|
|
1849
1852
|
const { startRow: r, endRow: t, startColumn: e, endColumn: n } = s;
|
|
@@ -1884,11 +1887,11 @@ class I1 extends $2 {
|
|
|
1884
1887
|
return;
|
|
1885
1888
|
c.add(Z);
|
|
1886
1889
|
}
|
|
1887
|
-
const { startX:
|
|
1888
|
-
if (this._width > o2 || this._width >
|
|
1890
|
+
const { startX: I, endX: A, startY: S, endY: k } = u || h ? g : d, v2 = A - I, o2 = k - S;
|
|
1891
|
+
if (this._width > o2 || this._width > v2 + this._paddingRightAndLeft * 2)
|
|
1889
1892
|
return;
|
|
1890
|
-
const
|
|
1891
|
-
t.drawImage(E,
|
|
1893
|
+
const p2 = (o2 - this._width) / 2 + S;
|
|
1894
|
+
t.drawImage(E, I + this._paddingRightAndLeft, p2, this._width, this._width);
|
|
1892
1895
|
}), t.restore();
|
|
1893
1896
|
}
|
|
1894
1897
|
_init() {
|
|
@@ -1921,17 +1924,17 @@ export {
|
|
|
1921
1924
|
a2 as AddConditionalRuleMutation,
|
|
1922
1925
|
q2 as AddConditionalRuleMutationUndoFactory,
|
|
1923
1926
|
w as CFNumberOperator,
|
|
1924
|
-
|
|
1927
|
+
y as CFRuleType,
|
|
1925
1928
|
_ as CFSubRuleType,
|
|
1926
1929
|
B as CFTextOperator,
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1930
|
+
N as CFTimePeriodOperator,
|
|
1931
|
+
L as CFValueType,
|
|
1932
|
+
E2 as CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,
|
|
1933
|
+
k0 as ClearRangeCfCommand,
|
|
1934
|
+
B0 as ClearWorksheetCfCommand,
|
|
1932
1935
|
z as ConditionalFormattingFormulaService,
|
|
1933
1936
|
I1 as ConditionalFormattingIcon,
|
|
1934
|
-
|
|
1937
|
+
R as ConditionalFormattingRuleModel,
|
|
1935
1938
|
s2 as ConditionalFormattingService,
|
|
1936
1939
|
Q as ConditionalFormattingViewModel,
|
|
1937
1940
|
V1 as DEFAULT_BG_COLOR,
|
|
@@ -1961,7 +1964,7 @@ export {
|
|
|
1961
1964
|
L2 as defaultDataBarNativeColor,
|
|
1962
1965
|
b2 as defaultDataBarPositiveColor,
|
|
1963
1966
|
W0 as defaultPlaceholderColor,
|
|
1964
|
-
|
|
1967
|
+
w2 as filterRange,
|
|
1965
1968
|
X as findIndexByAnchor,
|
|
1966
1969
|
Z1 as getCacheStyleMatrix,
|
|
1967
1970
|
P as getCellValue,
|
|
@@ -1973,7 +1976,7 @@ export {
|
|
|
1973
1976
|
C2 as iconMap,
|
|
1974
1977
|
q1 as isAnchorEqual,
|
|
1975
1978
|
h2 as isFloatsEqual,
|
|
1976
|
-
|
|
1979
|
+
x as isNullable,
|
|
1977
1980
|
X1 as isRangesEqual,
|
|
1978
1981
|
R0 as moveByAnchor,
|
|
1979
1982
|
S1 as removeUndefinedAttr,
|