@univerjs/sheets-conditional-formatting-ui 0.7.0-nightly.202505091607 → 0.7.0-nightly.202505111606
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 +68 -14
- package/lib/es/index.js +750 -537
- package/lib/index.css +1 -1
- package/lib/index.js +750 -537
- package/lib/umd/index.js +72 -18
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var rr = Object.defineProperty;
|
|
2
2
|
var ir = (t, e, r) => e in t ? rr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var ye = (t, e, r) => ir(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { CommandType as he, ICommandService as te, IUniverInstanceService as z, ColorKit as fn, BooleanNumber as ae, LocaleService as re, UniverInstanceType as $, Tools as Wt, get as sr, set as or, createInterceptorKey as pn, InterceptorManager as ar, Inject as O, Disposable as ce, Injector as ve, Rectangle as fe, generateRandomId as lr, ObjectMatrix as
|
|
5
|
-
import { ConditionalFormattingRuleModel as Q, CFSubRuleType as
|
|
6
|
-
import { getSheetCommandTarget as Ce, SheetsSelectionsService as $e, RemoveSheetMutation as Rr, SetWorksheetActiveOperation as qt, setEndForRange as xr, SetSelectionsOperation as
|
|
7
|
-
import { useDependency as W, ComponentManager as zt, useSidebarClick as Nt, ILayoutService as Lr, useScrollYOverContainer as Ar, ISidebarService as
|
|
8
|
-
import { jsx as c, jsxs as
|
|
4
|
+
import { CommandType as he, ICommandService as te, IUniverInstanceService as z, ColorKit as fn, BooleanNumber as ae, LocaleService as re, UniverInstanceType as $, Tools as Wt, get as sr, set as or, createInterceptorKey as pn, InterceptorManager as ar, Inject as O, Disposable as ce, Injector as ve, Rectangle as fe, generateRandomId as lr, ObjectMatrix as we, Range as pe, toDisposable as Cn, InterceptorEffectEnum as cr, DependentOn as yn, IConfigService as bn, Plugin as Sn, merge as In, registerDependencies as ur, touchDependencies as Ft } from "@univerjs/core";
|
|
5
|
+
import { ConditionalFormattingRuleModel as Q, CFSubRuleType as F, CFRuleType as U, AddConditionalRuleMutation as se, CFNumberOperator as P, getColorScaleFromValue as dr, iconMap as Ee, DEFAULT_BG_COLOR as hr, DEFAULT_FONT_COLOR as vr, defaultDataBarPositiveColor as Ke, defaultDataBarNativeColor as Xe, CFValueType as A, createDefaultValueByValueType as Je, removeUndefinedAttr as gr, createDefaultValue as mt, CFTextOperator as j, CFTimePeriodOperator as ue, iconGroup as mr, getOppositeOperator as Ht, compareWithNumber as fr, EMPTY_ICON_TYPE as pr, SetCfCommand as Cr, AddCfCommand as _n, SetConditionalRuleMutation as be, DeleteConditionalRuleMutation as Se, MoveConditionalRuleMutation as Tn, ClearWorksheetCfCommand as Rn, DeleteCfCommand as Kt, MoveCfCommand as yr, ClearRangeCfCommand as br, createDefaultRule as Te, ConditionalFormattingViewModel as it, SHEET_CONDITIONAL_FORMATTING_PLUGIN as st, DeleteConditionalRuleMutationUndoFactory as Le, AddConditionalRuleMutationUndoFactory as xn, setConditionalRuleMutationUndoFactory as Ae, isRangesEqual as Sr, ConditionalFormattingService as wn, DEFAULT_PADDING as Ir, DEFAULT_WIDTH as _r, UniverSheetsConditionalFormattingPlugin as En, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH as Tr } from "@univerjs/sheets-conditional-formatting";
|
|
6
|
+
import { getSheetCommandTarget as Ce, SheetsSelectionsService as $e, RemoveSheetMutation as Rr, SetWorksheetActiveOperation as qt, setEndForRange as xr, SetSelectionsOperation as wr, checkRangesEditablePermission as ft, rangeToDiscreteRange as Er, findAllRectangle as pt, createTopMatrixFromMatrix as Ct, SheetPermissionCheckController as Nr, WorksheetEditPermission as Nn, WorksheetSetCellStylePermission as Mn, RangeProtectionPermissionEditPoint as Vn, WorkbookEditablePermission as kn, RefRangeService as Mr, handleDefaultRangeChangeWithEffectRefCommands as Vr, SheetInterceptorService as Gt, INTERCEPTOR_POINT as kr, ClearSelectionFormatCommand as Fr, ClearSelectionAllCommand as Ur, RangeMergeUtil as Pr, AFTER_CELL_EDIT as Or } from "@univerjs/sheets";
|
|
7
|
+
import { useDependency as W, ComponentManager as zt, useSidebarClick as Nt, ILayoutService as Lr, useScrollYOverContainer as Ar, ISidebarService as Fn, useObservable as Dr, getMenuHiddenObservable as $r, MenuItemType as jr, RibbonStartGroup as Hr, IMenuManagerService as Br } from "@univerjs/ui";
|
|
8
|
+
import { jsx as c, jsxs as k, Fragment as Bt } from "react/jsx-runtime";
|
|
9
9
|
import { forwardRef as Ve, useRef as de, createElement as je, useMemo as J, useState as N, useEffect as K } from "react";
|
|
10
10
|
import { Dropdown as Zt, clsx as X, ColorPicker as Wr, borderClassName as He, Select as le, InputNumber as Ne, RadioGroup as qr, Radio as Xt, Checkbox as yt, Input as Gr, Button as Jt, Tooltip as Qt, ReactGridLayout as zr } from "@univerjs/design";
|
|
11
11
|
import { serializeRange as Un, deserializeRangeWithSheet as Zr } from "@univerjs/engine-formula";
|
|
@@ -28,7 +28,7 @@ const Dn = {
|
|
|
28
28
|
stopIfTrue: !!i,
|
|
29
29
|
rule: {
|
|
30
30
|
type: U.highlightCell,
|
|
31
|
-
subType:
|
|
31
|
+
subType: F.average,
|
|
32
32
|
operator: s,
|
|
33
33
|
style: n
|
|
34
34
|
}
|
|
@@ -94,7 +94,7 @@ const Dn = {
|
|
|
94
94
|
stopIfTrue: !!i,
|
|
95
95
|
rule: {
|
|
96
96
|
type: U.highlightCell,
|
|
97
|
-
subType:
|
|
97
|
+
subType: F.duplicateValues,
|
|
98
98
|
style: n
|
|
99
99
|
}
|
|
100
100
|
};
|
|
@@ -120,7 +120,7 @@ const Dn = {
|
|
|
120
120
|
stopIfTrue: !!i,
|
|
121
121
|
rule: {
|
|
122
122
|
type: U.highlightCell,
|
|
123
|
-
subType:
|
|
123
|
+
subType: F.number,
|
|
124
124
|
operator: s,
|
|
125
125
|
style: n,
|
|
126
126
|
value: p
|
|
@@ -136,7 +136,7 @@ const Dn = {
|
|
|
136
136
|
stopIfTrue: !!i,
|
|
137
137
|
rule: {
|
|
138
138
|
type: U.highlightCell,
|
|
139
|
-
subType:
|
|
139
|
+
subType: F.number,
|
|
140
140
|
operator: s,
|
|
141
141
|
style: n,
|
|
142
142
|
value: p
|
|
@@ -159,7 +159,7 @@ const Dn = {
|
|
|
159
159
|
stopIfTrue: !!i,
|
|
160
160
|
rule: {
|
|
161
161
|
type: U.highlightCell,
|
|
162
|
-
subType:
|
|
162
|
+
subType: F.rank,
|
|
163
163
|
isPercent: s,
|
|
164
164
|
isBottom: o,
|
|
165
165
|
style: n,
|
|
@@ -182,7 +182,7 @@ const Dn = {
|
|
|
182
182
|
stopIfTrue: !!i,
|
|
183
183
|
rule: {
|
|
184
184
|
type: U.highlightCell,
|
|
185
|
-
subType:
|
|
185
|
+
subType: F.text,
|
|
186
186
|
operator: s,
|
|
187
187
|
style: n,
|
|
188
188
|
value: o
|
|
@@ -204,7 +204,7 @@ const Dn = {
|
|
|
204
204
|
stopIfTrue: !!i,
|
|
205
205
|
rule: {
|
|
206
206
|
type: U.highlightCell,
|
|
207
|
-
subType:
|
|
207
|
+
subType: F.timePeriod,
|
|
208
208
|
operator: s,
|
|
209
209
|
style: n
|
|
210
210
|
}
|
|
@@ -225,7 +225,7 @@ const Dn = {
|
|
|
225
225
|
stopIfTrue: !!i,
|
|
226
226
|
rule: {
|
|
227
227
|
type: U.highlightCell,
|
|
228
|
-
subType:
|
|
228
|
+
subType: F.uniqueValues,
|
|
229
229
|
style: n
|
|
230
230
|
}
|
|
231
231
|
};
|
|
@@ -278,14 +278,14 @@ function ai() {
|
|
|
278
278
|
return Math.random().toString(36).substring(2, 8);
|
|
279
279
|
}
|
|
280
280
|
Be.displayName = "UniverIcon";
|
|
281
|
-
var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] },
|
|
281
|
+
var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, gt = Ve(function(t, e) {
|
|
282
282
|
return je(Be, Object.assign({}, t, {
|
|
283
283
|
id: "delete-single",
|
|
284
284
|
ref: e,
|
|
285
285
|
icon: li
|
|
286
286
|
}));
|
|
287
287
|
});
|
|
288
|
-
|
|
288
|
+
gt.displayName = "DeleteSingle";
|
|
289
289
|
var ci = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Yn = Ve(function(t, e) {
|
|
290
290
|
return je(Be, Object.assign({}, t, {
|
|
291
291
|
id: "increase-single",
|
|
@@ -324,7 +324,7 @@ const Me = (t) => {
|
|
|
324
324
|
Zt,
|
|
325
325
|
{
|
|
326
326
|
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(Wr, { value: e, onChange: r }) }),
|
|
327
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ k(
|
|
328
328
|
"span",
|
|
329
329
|
{
|
|
330
330
|
className: X(`
|
|
@@ -357,7 +357,7 @@ const Me = (t) => {
|
|
|
357
357
|
}, [e]), n = J(() => {
|
|
358
358
|
if (e.type === U.iconSet)
|
|
359
359
|
return e.config.map((a) => {
|
|
360
|
-
const u =
|
|
360
|
+
const u = Ee[a.iconType];
|
|
361
361
|
return u && u[Number(a.iconId)];
|
|
362
362
|
});
|
|
363
363
|
}, [e]), i = `univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center
|
|
@@ -365,7 +365,7 @@ const Me = (t) => {
|
|
|
365
365
|
switch (e.type) {
|
|
366
366
|
case U.dataBar: {
|
|
367
367
|
const { isGradient: a } = e.config, u = a ? `linear-gradient(to right, ${e.config.positiveColor || Ke}, rgb(255 255 255))` : e.config.positiveColor, l = a ? `linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor || Xe})` : e.config.nativeColor;
|
|
368
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ k("div", { className: i, children: [
|
|
369
369
|
/* @__PURE__ */ c(
|
|
370
370
|
"div",
|
|
371
371
|
{
|
|
@@ -393,10 +393,10 @@ const Me = (t) => {
|
|
|
393
393
|
case U.iconSet:
|
|
394
394
|
return n && /* @__PURE__ */ c("div", { className: i, children: n.map((a, u) => a ? /* @__PURE__ */ c("img", { className: "univer-h-full", src: a, draggable: !1 }, u) : /* @__PURE__ */ c(ot, {}, u)) });
|
|
395
395
|
case U.highlightCell: {
|
|
396
|
-
const { ul: a, st: u, it: l, bl: h, bg: v, cl: f } = e.style, S = (a == null ? void 0 : a.s) === ae.TRUE, p = (u == null ? void 0 : u.s) === ae.TRUE, T = l === ae.TRUE, _ = h === ae.TRUE, R = (s = v == null ? void 0 : v.rgb) != null ? s : hr,
|
|
396
|
+
const { ul: a, st: u, it: l, bl: h, bg: v, cl: f } = e.style, S = (a == null ? void 0 : a.s) === ae.TRUE, p = (u == null ? void 0 : u.s) === ae.TRUE, T = l === ae.TRUE, _ = h === ae.TRUE, R = (s = v == null ? void 0 : v.rgb) != null ? s : hr, w = (o = f == null ? void 0 : f.rgb) != null ? o : vr, x = {
|
|
397
397
|
textDecoration: (d = `${S ? "underline" : ""} ${p ? "line-through" : ""}`.replace(/^ /, "")) != null ? d : void 0,
|
|
398
398
|
backgroundColor: R,
|
|
399
|
-
color:
|
|
399
|
+
color: w
|
|
400
400
|
};
|
|
401
401
|
return /* @__PURE__ */ c(
|
|
402
402
|
"div",
|
|
@@ -449,16 +449,16 @@ const Me = (t) => {
|
|
|
449
449
|
var L;
|
|
450
450
|
const { interceptorManager: e } = t, r = W(re), n = ((L = t.rule) == null ? void 0 : L.type) === U.colorScale ? t.rule : void 0, i = [Re(A.num, r), Re(A.percent, r), Re(A.percentile, r), Re(A.formula, r)], s = [Re(A.min, r), ...i], o = [Re("none", r), ...i], d = [Re(A.max, r), ...i], [a, u] = N(() => {
|
|
451
451
|
var I;
|
|
452
|
-
const
|
|
453
|
-
return n && ((I = n.config[0]) == null ? void 0 : I.value.type) ||
|
|
452
|
+
const m = A.min;
|
|
453
|
+
return n && ((I = n.config[0]) == null ? void 0 : I.value.type) || m;
|
|
454
454
|
}), [l, h] = N(() => {
|
|
455
455
|
var I;
|
|
456
|
-
const
|
|
457
|
-
return !n || n.config.length !== 3 ?
|
|
456
|
+
const m = "none";
|
|
457
|
+
return !n || n.config.length !== 3 ? m : ((I = n.config[1]) == null ? void 0 : I.value.type) || m;
|
|
458
458
|
}), [v, f] = N(() => {
|
|
459
459
|
var I;
|
|
460
|
-
const
|
|
461
|
-
return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.value.type) ||
|
|
460
|
+
const m = A.max;
|
|
461
|
+
return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.value.type) || m;
|
|
462
462
|
}), [S, p] = N(() => {
|
|
463
463
|
if (!n)
|
|
464
464
|
return 10;
|
|
@@ -470,51 +470,79 @@ const Me = (t) => {
|
|
|
470
470
|
return 50;
|
|
471
471
|
const I = (H = n.config[1]) == null ? void 0 : H.value.value;
|
|
472
472
|
return I === void 0 ? 50 : I;
|
|
473
|
-
}), [R,
|
|
473
|
+
}), [R, w] = N(() => {
|
|
474
474
|
var H;
|
|
475
475
|
if (!n)
|
|
476
476
|
return 90;
|
|
477
477
|
const I = (H = n.config[n.config.length - 1]) == null ? void 0 : H.value.value;
|
|
478
478
|
return I === void 0 ? 90 : I;
|
|
479
|
-
}), [x,
|
|
479
|
+
}), [x, g] = N(() => {
|
|
480
480
|
var I;
|
|
481
|
-
const
|
|
482
|
-
return n && ((I = n.config[0]) == null ? void 0 : I.color) ||
|
|
481
|
+
const m = "#d0d9fb";
|
|
482
|
+
return n && ((I = n.config[0]) == null ? void 0 : I.color) || m;
|
|
483
483
|
}), [C, b] = N(() => {
|
|
484
484
|
var I;
|
|
485
|
-
const
|
|
486
|
-
return !n || n.config.length !== 3 ?
|
|
485
|
+
const m = "#7790f3";
|
|
486
|
+
return !n || n.config.length !== 3 ? m : ((I = n.config[1]) == null ? void 0 : I.color) || m;
|
|
487
487
|
}), [y, M] = N(() => {
|
|
488
488
|
var I;
|
|
489
|
-
const
|
|
490
|
-
return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.color) ||
|
|
491
|
-
}),
|
|
492
|
-
const { minType: I, medianType: H, maxType: Y, minValue:
|
|
493
|
-
return G.push({ color:
|
|
489
|
+
const m = "#2e55ef";
|
|
490
|
+
return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.color) || m;
|
|
491
|
+
}), E = J(() => (m) => {
|
|
492
|
+
const { minType: I, medianType: H, maxType: Y, minValue: ge, medianValue: me, maxValue: ke, minColor: Fe, medianColor: D, maxColor: B } = m, G = [];
|
|
493
|
+
return G.push({ color: Fe, value: { type: I, value: ge } }), H !== "none" && G.push({ color: D, value: { type: H, value: me } }), G.push({ color: B, value: { type: Y, value: ke } }), { config: G.map((ee, ne) => ({ ...ee, index: ne })), type: U.colorScale };
|
|
494
494
|
}, []);
|
|
495
495
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
496
496
|
handler() {
|
|
497
|
-
return
|
|
497
|
+
return E({ minType: a, medianType: l, maxType: v, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y });
|
|
498
498
|
}
|
|
499
|
-
}), [
|
|
500
|
-
const V = (
|
|
501
|
-
t.onChange(
|
|
499
|
+
}), [E, a, l, v, S, T, R, x, C, y, e]);
|
|
500
|
+
const V = (m) => {
|
|
501
|
+
t.onChange(E(m));
|
|
502
502
|
};
|
|
503
|
-
return /* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */ c(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
503
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
504
|
+
/* @__PURE__ */ c(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: `
|
|
508
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
509
|
+
dark:univer-text-gray-200
|
|
510
|
+
`,
|
|
511
|
+
children: r.t("sheet.cf.panel.styleRule")
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: E({ minType: a, medianType: l, maxType: v, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y }) }) }),
|
|
515
|
+
/* @__PURE__ */ c(
|
|
516
|
+
"div",
|
|
517
|
+
{
|
|
518
|
+
className: `
|
|
519
|
+
univer-mt-3 univer-text-xs univer-text-gray-600
|
|
520
|
+
dark:univer-text-gray-200
|
|
521
|
+
`,
|
|
522
|
+
children: r.t("sheet.cf.valueType.min")
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-h-8 univer-items-center", children: [
|
|
508
526
|
/* @__PURE__ */ c(
|
|
509
527
|
le,
|
|
510
528
|
{
|
|
511
529
|
className: "univer-flex-shrink-0",
|
|
512
530
|
options: s,
|
|
513
531
|
value: a,
|
|
514
|
-
onChange: (
|
|
515
|
-
u(
|
|
516
|
-
const I = Je(
|
|
517
|
-
p(I), V({
|
|
532
|
+
onChange: (m) => {
|
|
533
|
+
u(m);
|
|
534
|
+
const I = Je(m, 10);
|
|
535
|
+
p(I), V({
|
|
536
|
+
minType: m,
|
|
537
|
+
medianType: l,
|
|
538
|
+
maxType: v,
|
|
539
|
+
minValue: I,
|
|
540
|
+
medianValue: T,
|
|
541
|
+
maxValue: R,
|
|
542
|
+
minColor: x,
|
|
543
|
+
medianColor: C,
|
|
544
|
+
maxColor: y
|
|
545
|
+
});
|
|
518
546
|
}
|
|
519
547
|
}
|
|
520
548
|
),
|
|
@@ -525,8 +553,18 @@ const Me = (t) => {
|
|
|
525
553
|
className: "univer-ml-1",
|
|
526
554
|
value: S,
|
|
527
555
|
type: a,
|
|
528
|
-
onChange: (
|
|
529
|
-
p(
|
|
556
|
+
onChange: (m) => {
|
|
557
|
+
p(m), V({
|
|
558
|
+
minType: a,
|
|
559
|
+
medianType: l,
|
|
560
|
+
maxType: v,
|
|
561
|
+
minValue: m,
|
|
562
|
+
medianValue: T,
|
|
563
|
+
maxValue: R,
|
|
564
|
+
minColor: x,
|
|
565
|
+
medianColor: C,
|
|
566
|
+
maxColor: y
|
|
567
|
+
});
|
|
530
568
|
}
|
|
531
569
|
}
|
|
532
570
|
),
|
|
@@ -535,26 +573,45 @@ const Me = (t) => {
|
|
|
535
573
|
{
|
|
536
574
|
className: "univer-ml-1",
|
|
537
575
|
color: x,
|
|
538
|
-
onChange: (
|
|
539
|
-
m
|
|
576
|
+
onChange: (m) => {
|
|
577
|
+
g(m), V({
|
|
578
|
+
minType: a,
|
|
579
|
+
medianType: l,
|
|
580
|
+
maxType: v,
|
|
581
|
+
minValue: S,
|
|
582
|
+
medianValue: T,
|
|
583
|
+
maxValue: R,
|
|
584
|
+
minColor: m,
|
|
585
|
+
medianColor: C,
|
|
586
|
+
maxColor: y
|
|
587
|
+
});
|
|
540
588
|
}
|
|
541
589
|
}
|
|
542
590
|
)
|
|
543
591
|
] }),
|
|
544
|
-
/* @__PURE__ */ c(
|
|
545
|
-
|
|
592
|
+
/* @__PURE__ */ c(
|
|
593
|
+
"div",
|
|
594
|
+
{
|
|
595
|
+
className: `
|
|
596
|
+
univer-mt-3 univer-text-xs
|
|
597
|
+
univer-text-gray-600dark:univer-text-gray-200
|
|
598
|
+
`,
|
|
599
|
+
children: r.t("sheet.cf.panel.medianValue")
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-h-8 univer-items-center", children: [
|
|
546
603
|
/* @__PURE__ */ c(
|
|
547
604
|
le,
|
|
548
605
|
{
|
|
549
606
|
className: "univer-flex-shrink-0",
|
|
550
607
|
options: o,
|
|
551
608
|
value: l,
|
|
552
|
-
onChange: (
|
|
553
|
-
h(
|
|
554
|
-
const I = Je(
|
|
609
|
+
onChange: (m) => {
|
|
610
|
+
h(m);
|
|
611
|
+
const I = Je(m, 50);
|
|
555
612
|
_(I), V({
|
|
556
613
|
minType: a,
|
|
557
|
-
medianType:
|
|
614
|
+
medianType: m,
|
|
558
615
|
maxType: v,
|
|
559
616
|
minValue: S,
|
|
560
617
|
medianValue: I,
|
|
@@ -573,13 +630,13 @@ const Me = (t) => {
|
|
|
573
630
|
className: "univer-ml-1",
|
|
574
631
|
value: T,
|
|
575
632
|
type: l,
|
|
576
|
-
onChange: (
|
|
577
|
-
_(
|
|
633
|
+
onChange: (m) => {
|
|
634
|
+
_(m), V({
|
|
578
635
|
minType: a,
|
|
579
636
|
medianType: l,
|
|
580
637
|
maxType: v,
|
|
581
638
|
minValue: S,
|
|
582
|
-
medianValue:
|
|
639
|
+
medianValue: m,
|
|
583
640
|
maxValue: R,
|
|
584
641
|
minColor: x,
|
|
585
642
|
medianColor: C,
|
|
@@ -593,8 +650,8 @@ const Me = (t) => {
|
|
|
593
650
|
{
|
|
594
651
|
className: "univer-ml-1",
|
|
595
652
|
color: C,
|
|
596
|
-
onChange: (
|
|
597
|
-
b(
|
|
653
|
+
onChange: (m) => {
|
|
654
|
+
b(m), V({
|
|
598
655
|
minType: a,
|
|
599
656
|
medianType: l,
|
|
600
657
|
maxType: v,
|
|
@@ -602,28 +659,37 @@ const Me = (t) => {
|
|
|
602
659
|
medianValue: T,
|
|
603
660
|
maxValue: R,
|
|
604
661
|
minColor: x,
|
|
605
|
-
medianColor:
|
|
662
|
+
medianColor: m,
|
|
606
663
|
maxColor: y
|
|
607
664
|
});
|
|
608
665
|
}
|
|
609
666
|
}
|
|
610
667
|
)
|
|
611
668
|
] }),
|
|
612
|
-
/* @__PURE__ */ c(
|
|
613
|
-
|
|
669
|
+
/* @__PURE__ */ c(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
className: `
|
|
673
|
+
univer-mt-3 univer-text-xs univer-text-gray-600
|
|
674
|
+
dark:univer-text-gray-200
|
|
675
|
+
`,
|
|
676
|
+
children: r.t("sheet.cf.valueType.max")
|
|
677
|
+
}
|
|
678
|
+
),
|
|
679
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-h-8 univer-items-center", children: [
|
|
614
680
|
/* @__PURE__ */ c(
|
|
615
681
|
le,
|
|
616
682
|
{
|
|
617
683
|
className: "univer-flex-shrink-0",
|
|
618
684
|
options: d,
|
|
619
685
|
value: v,
|
|
620
|
-
onChange: (
|
|
621
|
-
f(
|
|
622
|
-
const I = Je(
|
|
623
|
-
|
|
686
|
+
onChange: (m) => {
|
|
687
|
+
f(m);
|
|
688
|
+
const I = Je(m, 90);
|
|
689
|
+
w(I), V({
|
|
624
690
|
minType: a,
|
|
625
691
|
medianType: l,
|
|
626
|
-
maxType:
|
|
692
|
+
maxType: m,
|
|
627
693
|
minValue: S,
|
|
628
694
|
medianValue: T,
|
|
629
695
|
maxValue: I,
|
|
@@ -641,14 +707,14 @@ const Me = (t) => {
|
|
|
641
707
|
className: "univer-ml-1",
|
|
642
708
|
value: R,
|
|
643
709
|
type: v,
|
|
644
|
-
onChange: (
|
|
645
|
-
|
|
710
|
+
onChange: (m) => {
|
|
711
|
+
w(m), V({
|
|
646
712
|
minType: a,
|
|
647
713
|
medianType: l,
|
|
648
714
|
maxType: v,
|
|
649
715
|
minValue: S,
|
|
650
716
|
medianValue: T,
|
|
651
|
-
maxValue:
|
|
717
|
+
maxValue: m,
|
|
652
718
|
minColor: x,
|
|
653
719
|
medianColor: C,
|
|
654
720
|
maxColor: y
|
|
@@ -661,8 +727,8 @@ const Me = (t) => {
|
|
|
661
727
|
{
|
|
662
728
|
className: "univer-ml-1",
|
|
663
729
|
color: y,
|
|
664
|
-
onChange: (
|
|
665
|
-
M(
|
|
730
|
+
onChange: (m) => {
|
|
731
|
+
M(m), V({
|
|
666
732
|
minType: a,
|
|
667
733
|
medianType: l,
|
|
668
734
|
maxType: v,
|
|
@@ -671,7 +737,7 @@ const Me = (t) => {
|
|
|
671
737
|
maxValue: R,
|
|
672
738
|
minColor: x,
|
|
673
739
|
medianColor: C,
|
|
674
|
-
maxColor:
|
|
740
|
+
maxColor: m
|
|
675
741
|
});
|
|
676
742
|
}
|
|
677
743
|
}
|
|
@@ -729,59 +795,86 @@ const Me = (t) => {
|
|
|
729
795
|
...S
|
|
730
796
|
}
|
|
731
797
|
);
|
|
732
|
-
},
|
|
798
|
+
}, gi = (t) => {
|
|
733
799
|
var L;
|
|
734
800
|
const { interceptorManager: e } = t, r = W(re), n = ((L = t.rule) == null ? void 0 : L.type) === U.dataBar ? t.rule : void 0, [i, s] = N(() => {
|
|
735
801
|
var I;
|
|
736
|
-
const
|
|
737
|
-
return n ? (I = n.config) != null && I.isGradient ? "1" : "0" :
|
|
802
|
+
const m = "0";
|
|
803
|
+
return n ? (I = n.config) != null && I.isGradient ? "1" : "0" : m;
|
|
738
804
|
}), [o, d] = N(() => {
|
|
739
|
-
var
|
|
740
|
-
return n ? ((
|
|
805
|
+
var m;
|
|
806
|
+
return n ? ((m = n.config) == null ? void 0 : m.positiveColor) || Ke : Ke;
|
|
741
807
|
}), [a, u] = N(() => {
|
|
742
|
-
var
|
|
743
|
-
return n ? ((
|
|
808
|
+
var m;
|
|
809
|
+
return n ? ((m = n.config) == null ? void 0 : m.nativeColor) || Xe : Xe;
|
|
744
810
|
}), l = [Ue(A.num, r), Ue(A.percent, r), Ue(A.percentile, r), Ue(A.formula, r)], h = [Ue(A.min, r), ...l], v = [Ue(A.max, r), ...l], [f, S] = N(() => {
|
|
745
811
|
var I;
|
|
746
|
-
const
|
|
747
|
-
return n && ((I = n.config) == null ? void 0 : I.min.type) ||
|
|
812
|
+
const m = h[0].value;
|
|
813
|
+
return n && ((I = n.config) == null ? void 0 : I.min.type) || m;
|
|
748
814
|
}), [p, T] = N(() => {
|
|
749
815
|
var I;
|
|
750
|
-
const
|
|
751
|
-
return n && ((I = n.config) == null ? void 0 : I.max.type) ||
|
|
816
|
+
const m = v[0].value;
|
|
817
|
+
return n && ((I = n.config) == null ? void 0 : I.max.type) || m;
|
|
752
818
|
}), [_, R] = N(() => {
|
|
753
819
|
var H;
|
|
754
820
|
if (!n)
|
|
755
821
|
return 0;
|
|
756
822
|
const I = ((H = n.config) == null ? void 0 : H.min) || {};
|
|
757
823
|
return I.type === A.formula ? I.value || "=" : I.value || 0;
|
|
758
|
-
}), [
|
|
824
|
+
}), [w, x] = N(() => {
|
|
759
825
|
var H;
|
|
760
826
|
if (!n)
|
|
761
827
|
return 100;
|
|
762
828
|
const I = ((H = n.config) == null ? void 0 : H.max) || {};
|
|
763
829
|
return I.type === A.formula ? I.value || "=" : I.value === void 0 ? 100 : I.value;
|
|
764
|
-
}), [
|
|
765
|
-
min: { type:
|
|
766
|
-
max: { type:
|
|
767
|
-
isGradient:
|
|
768
|
-
positiveColor:
|
|
769
|
-
nativeColor:
|
|
770
|
-
}, type: U.dataBar, isShowValue:
|
|
830
|
+
}), [g, C] = N(() => n ? n.isShowValue === void 0 ? !0 : !!n.isShowValue : !0), b = (m) => ({ config: {
|
|
831
|
+
min: { type: m.minValueType, value: m.minValue },
|
|
832
|
+
max: { type: m.maxValueType, value: m.maxValue },
|
|
833
|
+
isGradient: m.isGradient === "1",
|
|
834
|
+
positiveColor: m.positiveColor || Ke,
|
|
835
|
+
nativeColor: m.nativeColor || Xe
|
|
836
|
+
}, type: U.dataBar, isShowValue: m.isShowValue });
|
|
771
837
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
772
838
|
handler() {
|
|
773
|
-
return b({ isGradient: i, minValue: _, minValueType: f, maxValue:
|
|
839
|
+
return b({ isGradient: i, minValue: _, minValueType: f, maxValue: w, maxValueType: p, positiveColor: o, nativeColor: a, isShowValue: g });
|
|
774
840
|
}
|
|
775
|
-
}), [i, _, f,
|
|
776
|
-
const y = (
|
|
777
|
-
t.onChange(b(
|
|
778
|
-
}, M = (
|
|
779
|
-
d(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
841
|
+
}), [i, _, f, w, p, o, a, e, g]);
|
|
842
|
+
const y = (m) => {
|
|
843
|
+
t.onChange(b(m));
|
|
844
|
+
}, M = (m) => {
|
|
845
|
+
d(m), y({
|
|
846
|
+
isGradient: i,
|
|
847
|
+
minValue: _,
|
|
848
|
+
minValueType: f,
|
|
849
|
+
maxValue: w,
|
|
850
|
+
maxValueType: p,
|
|
851
|
+
positiveColor: m,
|
|
852
|
+
nativeColor: a,
|
|
853
|
+
isShowValue: g
|
|
854
|
+
});
|
|
855
|
+
}, E = (m) => {
|
|
856
|
+
u(m), y({
|
|
857
|
+
isGradient: i,
|
|
858
|
+
minValue: _,
|
|
859
|
+
minValueType: f,
|
|
860
|
+
maxValue: w,
|
|
861
|
+
maxValueType: p,
|
|
862
|
+
positiveColor: o,
|
|
863
|
+
nativeColor: m,
|
|
864
|
+
isShowValue: g
|
|
865
|
+
});
|
|
866
|
+
}, V = (m) => l.map((I) => I.value).includes(m);
|
|
867
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
868
|
+
/* @__PURE__ */ c(
|
|
869
|
+
"div",
|
|
870
|
+
{
|
|
871
|
+
className: `
|
|
872
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
873
|
+
dark:univer-text-gray-200
|
|
874
|
+
`,
|
|
875
|
+
children: r.t("sheet.cf.panel.styleRule")
|
|
876
|
+
}
|
|
877
|
+
),
|
|
785
878
|
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(
|
|
786
879
|
We,
|
|
787
880
|
{
|
|
@@ -789,23 +882,41 @@ const Me = (t) => {
|
|
|
789
882
|
isGradient: i,
|
|
790
883
|
minValue: _,
|
|
791
884
|
minValueType: f,
|
|
792
|
-
maxValue:
|
|
885
|
+
maxValue: w,
|
|
793
886
|
maxValueType: p,
|
|
794
887
|
positiveColor: o,
|
|
795
888
|
nativeColor: a,
|
|
796
|
-
isShowValue:
|
|
889
|
+
isShowValue: g
|
|
797
890
|
})
|
|
798
891
|
}
|
|
799
892
|
) }),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */ c(
|
|
802
|
-
|
|
803
|
-
|
|
893
|
+
/* @__PURE__ */ k("div", { children: [
|
|
894
|
+
/* @__PURE__ */ c(
|
|
895
|
+
"div",
|
|
896
|
+
{
|
|
897
|
+
className: `
|
|
898
|
+
univer-mt-3 univer-text-sm univer-text-gray-600
|
|
899
|
+
dark:univer-text-gray-200
|
|
900
|
+
`,
|
|
901
|
+
children: r.t("sheet.cf.panel.fillType")
|
|
902
|
+
}
|
|
903
|
+
),
|
|
904
|
+
/* @__PURE__ */ k("div", { className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center", children: [
|
|
905
|
+
/* @__PURE__ */ k(
|
|
804
906
|
qr,
|
|
805
907
|
{
|
|
806
908
|
value: i,
|
|
807
|
-
onChange: (
|
|
808
|
-
s(
|
|
909
|
+
onChange: (m) => {
|
|
910
|
+
s(m), y({
|
|
911
|
+
isGradient: m,
|
|
912
|
+
minValue: _,
|
|
913
|
+
minValueType: f,
|
|
914
|
+
maxValue: w,
|
|
915
|
+
maxValueType: p,
|
|
916
|
+
positiveColor: o,
|
|
917
|
+
nativeColor: a,
|
|
918
|
+
isShowValue: g
|
|
919
|
+
});
|
|
809
920
|
},
|
|
810
921
|
children: [
|
|
811
922
|
/* @__PURE__ */ c(Xt, { value: "0", children: /* @__PURE__ */ c("span", { className: "univer-text-xs", children: r.t("sheet.cf.panel.pureColor") }) }),
|
|
@@ -813,21 +924,21 @@ const Me = (t) => {
|
|
|
813
924
|
]
|
|
814
925
|
}
|
|
815
926
|
),
|
|
816
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ k("div", { className: "univer-ml-6 univer-flex univer-items-center univer-text-xs", children: [
|
|
817
928
|
/* @__PURE__ */ c(
|
|
818
929
|
yt,
|
|
819
930
|
{
|
|
820
|
-
checked: !
|
|
821
|
-
onChange: (
|
|
822
|
-
C(!
|
|
823
|
-
isGradient:
|
|
931
|
+
checked: !g,
|
|
932
|
+
onChange: (m) => {
|
|
933
|
+
C(!m), y({
|
|
934
|
+
isGradient: m,
|
|
824
935
|
minValue: _,
|
|
825
936
|
minValueType: f,
|
|
826
|
-
maxValue:
|
|
937
|
+
maxValue: w,
|
|
827
938
|
maxValueType: p,
|
|
828
939
|
positiveColor: o,
|
|
829
940
|
nativeColor: a,
|
|
830
|
-
isShowValue: !
|
|
941
|
+
isShowValue: !m
|
|
831
942
|
});
|
|
832
943
|
}
|
|
833
944
|
}
|
|
@@ -836,20 +947,29 @@ const Me = (t) => {
|
|
|
836
947
|
] })
|
|
837
948
|
] })
|
|
838
949
|
] }),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */ c(
|
|
841
|
-
|
|
842
|
-
|
|
950
|
+
/* @__PURE__ */ k("div", { children: [
|
|
951
|
+
/* @__PURE__ */ c(
|
|
952
|
+
"div",
|
|
953
|
+
{
|
|
954
|
+
className: `
|
|
955
|
+
univer-mt-3 univer-text-sm univer-text-gray-600
|
|
956
|
+
dark:univer-text-gray-200
|
|
957
|
+
`,
|
|
958
|
+
children: r.t("sheet.cf.panel.colorSet")
|
|
959
|
+
}
|
|
960
|
+
),
|
|
961
|
+
/* @__PURE__ */ k("div", { className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center", children: [
|
|
962
|
+
/* @__PURE__ */ k("div", { className: "univer-flex univer-items-center", children: [
|
|
843
963
|
/* @__PURE__ */ c("div", { className: "univer-text-xs", children: r.t("sheet.cf.panel.native") }),
|
|
844
964
|
/* @__PURE__ */ c(
|
|
845
965
|
Me,
|
|
846
966
|
{
|
|
847
967
|
color: a,
|
|
848
|
-
onChange:
|
|
968
|
+
onChange: E
|
|
849
969
|
}
|
|
850
970
|
)
|
|
851
971
|
] }),
|
|
852
|
-
/* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ k("div", { className: "univer-ml-3 univer-flex univer-items-center", children: [
|
|
853
973
|
/* @__PURE__ */ c("div", { className: "univer-text-xs", children: r.t("sheet.cf.panel.positive") }),
|
|
854
974
|
/* @__PURE__ */ c(
|
|
855
975
|
Me,
|
|
@@ -861,27 +981,36 @@ const Me = (t) => {
|
|
|
861
981
|
] })
|
|
862
982
|
] })
|
|
863
983
|
] }),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */ c(
|
|
866
|
-
|
|
984
|
+
/* @__PURE__ */ k("div", { children: [
|
|
985
|
+
/* @__PURE__ */ c(
|
|
986
|
+
"div",
|
|
987
|
+
{
|
|
988
|
+
className: `
|
|
989
|
+
univer-mt-3 univer-text-sm univer-text-gray-600
|
|
990
|
+
dark:univer-text-gray-200
|
|
991
|
+
`,
|
|
992
|
+
children: r.t("sheet.cf.valueType.min")
|
|
993
|
+
}
|
|
994
|
+
),
|
|
995
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
|
|
867
996
|
/* @__PURE__ */ c(
|
|
868
997
|
le,
|
|
869
998
|
{
|
|
870
999
|
className: "univer-w-1/2 univer-flex-shrink-0",
|
|
871
1000
|
options: h,
|
|
872
1001
|
value: f,
|
|
873
|
-
onChange: (
|
|
874
|
-
S(
|
|
875
|
-
const I = Je(
|
|
1002
|
+
onChange: (m) => {
|
|
1003
|
+
S(m);
|
|
1004
|
+
const I = Je(m, 10);
|
|
876
1005
|
R(I), y({
|
|
877
1006
|
isGradient: i,
|
|
878
1007
|
minValue: I,
|
|
879
|
-
minValueType:
|
|
880
|
-
maxValue:
|
|
1008
|
+
minValueType: m,
|
|
1009
|
+
maxValue: w,
|
|
881
1010
|
maxValueType: p,
|
|
882
1011
|
positiveColor: o,
|
|
883
1012
|
nativeColor: a,
|
|
884
|
-
isShowValue:
|
|
1013
|
+
isShowValue: g
|
|
885
1014
|
});
|
|
886
1015
|
}
|
|
887
1016
|
}
|
|
@@ -894,41 +1023,50 @@ const Me = (t) => {
|
|
|
894
1023
|
disabled: !V(f),
|
|
895
1024
|
type: f,
|
|
896
1025
|
value: _,
|
|
897
|
-
onChange: (
|
|
898
|
-
R(
|
|
1026
|
+
onChange: (m) => {
|
|
1027
|
+
R(m || 0), y({
|
|
899
1028
|
isGradient: i,
|
|
900
|
-
minValue:
|
|
1029
|
+
minValue: m || 0,
|
|
901
1030
|
minValueType: f,
|
|
902
|
-
maxValue:
|
|
1031
|
+
maxValue: w,
|
|
903
1032
|
maxValueType: p,
|
|
904
1033
|
positiveColor: o,
|
|
905
1034
|
nativeColor: a,
|
|
906
|
-
isShowValue:
|
|
1035
|
+
isShowValue: g
|
|
907
1036
|
});
|
|
908
1037
|
}
|
|
909
1038
|
}
|
|
910
1039
|
)
|
|
911
1040
|
] }),
|
|
912
|
-
/* @__PURE__ */ c(
|
|
913
|
-
|
|
1041
|
+
/* @__PURE__ */ c(
|
|
1042
|
+
"div",
|
|
1043
|
+
{
|
|
1044
|
+
className: `
|
|
1045
|
+
univer-mt-3 univer-text-sm univer-text-gray-600
|
|
1046
|
+
dark:univer-text-gray-200
|
|
1047
|
+
`,
|
|
1048
|
+
children: r.t("sheet.cf.valueType.max")
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
|
|
914
1052
|
/* @__PURE__ */ c(
|
|
915
1053
|
le,
|
|
916
1054
|
{
|
|
917
1055
|
className: "univer-w-1/2 univer-flex-shrink-0",
|
|
918
1056
|
options: v,
|
|
919
1057
|
value: p,
|
|
920
|
-
onChange: (
|
|
921
|
-
T(
|
|
922
|
-
const I = Je(
|
|
1058
|
+
onChange: (m) => {
|
|
1059
|
+
T(m);
|
|
1060
|
+
const I = Je(m, 90);
|
|
923
1061
|
x(I), y({
|
|
924
1062
|
isGradient: i,
|
|
925
1063
|
minValue: _,
|
|
926
1064
|
minValueType: f,
|
|
927
1065
|
maxValue: I,
|
|
928
|
-
maxValueType:
|
|
1066
|
+
maxValueType: m,
|
|
929
1067
|
positiveColor: o,
|
|
930
1068
|
nativeColor: a,
|
|
931
|
-
isShowValue:
|
|
1069
|
+
isShowValue: g
|
|
932
1070
|
});
|
|
933
1071
|
}
|
|
934
1072
|
}
|
|
@@ -940,17 +1078,17 @@ const Me = (t) => {
|
|
|
940
1078
|
disabled: !V(p),
|
|
941
1079
|
id: "max",
|
|
942
1080
|
type: p,
|
|
943
|
-
value:
|
|
944
|
-
onChange: (
|
|
945
|
-
x(
|
|
1081
|
+
value: w,
|
|
1082
|
+
onChange: (m) => {
|
|
1083
|
+
x(m || 0), y({
|
|
946
1084
|
isGradient: i,
|
|
947
1085
|
minValue: _,
|
|
948
1086
|
minValueType: f,
|
|
949
|
-
maxValue:
|
|
1087
|
+
maxValue: m || 0,
|
|
950
1088
|
maxValueType: p,
|
|
951
1089
|
positiveColor: o,
|
|
952
1090
|
nativeColor: a,
|
|
953
|
-
isShowValue:
|
|
1091
|
+
isShowValue: g
|
|
954
1092
|
});
|
|
955
1093
|
}
|
|
956
1094
|
}
|
|
@@ -979,20 +1117,20 @@ const Me = (t) => {
|
|
|
979
1117
|
var b;
|
|
980
1118
|
const C = "#e8ecfc";
|
|
981
1119
|
return (b = e == null ? void 0 : e.bg) != null && b.rgb ? e.bg.rgb : C;
|
|
982
|
-
}), _ = i.get("BoldSingle"), R = i.get("ItalicSingle"),
|
|
1120
|
+
}), _ = i.get("BoldSingle"), R = i.get("ItalicSingle"), w = i.get("UnderlineSingle"), x = i.get("StrikethroughSingle");
|
|
983
1121
|
K(() => {
|
|
984
1122
|
const C = {
|
|
985
1123
|
bl: s,
|
|
986
1124
|
it: d
|
|
987
1125
|
};
|
|
988
|
-
f !== void 0 && (C.cl = { rgb: f }), p !== void 0 && (C.bg = { rgb: p }), h !== void 0 && (C.st = { s: h }), u !== void 0 && (C.ul = { s: u }), r(
|
|
1126
|
+
f !== void 0 && (C.cl = { rgb: f }), p !== void 0 && (C.bg = { rgb: p }), h !== void 0 && (C.st = { s: h }), u !== void 0 && (C.ul = { s: u }), r(gr(C));
|
|
989
1127
|
}, [s, d, u, h, f, p]);
|
|
990
|
-
const
|
|
991
|
-
return /* @__PURE__ */
|
|
1128
|
+
const g = "univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";
|
|
1129
|
+
return /* @__PURE__ */ k("div", { className: X("univer-my-2.5 univer-flex univer-justify-between", n), children: [
|
|
992
1130
|
_ && /* @__PURE__ */ c(
|
|
993
1131
|
"div",
|
|
994
1132
|
{
|
|
995
|
-
className: X(
|
|
1133
|
+
className: X(g, {
|
|
996
1134
|
"univer-bg-gray-100": ut(s || ae.FALSE)
|
|
997
1135
|
}),
|
|
998
1136
|
onClick: () => o(ct(s)),
|
|
@@ -1002,27 +1140,27 @@ const Me = (t) => {
|
|
|
1002
1140
|
R && /* @__PURE__ */ c(
|
|
1003
1141
|
"div",
|
|
1004
1142
|
{
|
|
1005
|
-
className: X(
|
|
1143
|
+
className: X(g, {
|
|
1006
1144
|
"univer-bg-gray-100": ut(d || ae.FALSE)
|
|
1007
1145
|
}),
|
|
1008
1146
|
onClick: () => a(ct(d)),
|
|
1009
1147
|
children: /* @__PURE__ */ c(R, {})
|
|
1010
1148
|
}
|
|
1011
1149
|
),
|
|
1012
|
-
|
|
1150
|
+
w && /* @__PURE__ */ c(
|
|
1013
1151
|
"div",
|
|
1014
1152
|
{
|
|
1015
|
-
className: X(
|
|
1153
|
+
className: X(g, {
|
|
1016
1154
|
"univer-bg-gray-100": ut(u || ae.FALSE)
|
|
1017
1155
|
}),
|
|
1018
1156
|
onClick: () => l(ct(u)),
|
|
1019
|
-
children: /* @__PURE__ */ c(
|
|
1157
|
+
children: /* @__PURE__ */ c(w, {})
|
|
1020
1158
|
}
|
|
1021
1159
|
),
|
|
1022
1160
|
x && /* @__PURE__ */ c(
|
|
1023
1161
|
"div",
|
|
1024
1162
|
{
|
|
1025
|
-
className: X(
|
|
1163
|
+
className: X(g, {
|
|
1026
1164
|
"univer-bg-gray-100": ut(h || ae.FALSE)
|
|
1027
1165
|
}),
|
|
1028
1166
|
onClick: () => v(ct(h)),
|
|
@@ -1032,13 +1170,13 @@ const Me = (t) => {
|
|
|
1032
1170
|
/* @__PURE__ */ c(Me, { color: f, onChange: S, iconId: "FontColor" }),
|
|
1033
1171
|
/* @__PURE__ */ c(Me, { color: p, onChange: T, iconId: "PaintBucket" })
|
|
1034
1172
|
] });
|
|
1035
|
-
},
|
|
1173
|
+
}, mi = (t) => {
|
|
1036
1174
|
var x;
|
|
1037
|
-
const { onChange: e, interceptorManager: r } = t, n = W(re), s = W(z).getCurrentUnitForType($.UNIVER_SHEET), o = s.getActiveSheet(), d = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, a = de(null), [u, l] = N(!1), h = de(null), [v, f] = N({}), [S, p] = N(() => (d == null ? void 0 : d.subType) ===
|
|
1038
|
-
style:
|
|
1175
|
+
const { onChange: e, interceptorManager: r } = t, n = W(re), s = W(z).getCurrentUnitForType($.UNIVER_SHEET), o = s.getActiveSheet(), d = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, a = de(null), [u, l] = N(!1), h = de(null), [v, f] = N({}), [S, p] = N(() => (d == null ? void 0 : d.subType) === F.formula ? d.value : "="), [T, _] = N(void 0), R = (g) => ({
|
|
1176
|
+
style: g.style,
|
|
1039
1177
|
value: S,
|
|
1040
1178
|
type: U.highlightCell,
|
|
1041
|
-
subType:
|
|
1179
|
+
subType: F.formula
|
|
1042
1180
|
});
|
|
1043
1181
|
K(() => r.intercept(r.getInterceptPoints().submit, {
|
|
1044
1182
|
handler() {
|
|
@@ -1047,14 +1185,23 @@ const Me = (t) => {
|
|
|
1047
1185
|
}), [v, S, r]), K(() => r.intercept(r.getInterceptPoints().beforeSubmit, {
|
|
1048
1186
|
handler: (C, b, y) => T || S.length === 1 || !S.startsWith("=") ? (_(n.t("sheet.cf.errorMessage.formulaError")), !1) : y(C)
|
|
1049
1187
|
}), [T, S]);
|
|
1050
|
-
const
|
|
1051
|
-
e(R(
|
|
1188
|
+
const w = (g) => {
|
|
1189
|
+
e(R(g));
|
|
1052
1190
|
};
|
|
1053
|
-
return Nt((
|
|
1191
|
+
return Nt((g) => {
|
|
1054
1192
|
var b;
|
|
1055
|
-
((b = h.current) == null ? void 0 : b.isClickOutSide(
|
|
1056
|
-
}), /* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */ c(
|
|
1193
|
+
((b = h.current) == null ? void 0 : b.isClickOutSide(g)) && l(!1);
|
|
1194
|
+
}), /* @__PURE__ */ k("div", { ref: a, children: [
|
|
1195
|
+
/* @__PURE__ */ c(
|
|
1196
|
+
"div",
|
|
1197
|
+
{
|
|
1198
|
+
className: `
|
|
1199
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
1200
|
+
dark:univer-text-gray-200
|
|
1201
|
+
`,
|
|
1202
|
+
children: n.t("sheet.cf.panel.styleRule")
|
|
1203
|
+
}
|
|
1204
|
+
),
|
|
1058
1205
|
/* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(
|
|
1059
1206
|
Mt,
|
|
1060
1207
|
{
|
|
@@ -1075,11 +1222,11 @@ const Me = (t) => {
|
|
|
1075
1222
|
onFocus: () => {
|
|
1076
1223
|
l(!0);
|
|
1077
1224
|
},
|
|
1078
|
-
onChange: (
|
|
1079
|
-
p(
|
|
1225
|
+
onChange: (g) => {
|
|
1226
|
+
p(g), w({ style: v });
|
|
1080
1227
|
},
|
|
1081
|
-
onVerify: (
|
|
1082
|
-
!
|
|
1228
|
+
onVerify: (g, C) => {
|
|
1229
|
+
!g || C.length === 1 ? _(n.t("sheet.cf.errorMessage.formulaError")) : _(void 0);
|
|
1083
1230
|
}
|
|
1084
1231
|
}
|
|
1085
1232
|
) }),
|
|
@@ -1089,13 +1236,13 @@ const Me = (t) => {
|
|
|
1089
1236
|
{
|
|
1090
1237
|
style: d == null ? void 0 : d.style,
|
|
1091
1238
|
className: "univer-mt-3",
|
|
1092
|
-
onChange: (
|
|
1093
|
-
f(
|
|
1239
|
+
onChange: (g) => {
|
|
1240
|
+
f(g), w({ style: g });
|
|
1094
1241
|
}
|
|
1095
1242
|
}
|
|
1096
1243
|
)
|
|
1097
1244
|
] });
|
|
1098
|
-
}, dt = (t) => /* @__PURE__ */
|
|
1245
|
+
}, dt = (t) => /* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
|
|
1099
1246
|
/* @__PURE__ */ c(
|
|
1100
1247
|
"div",
|
|
1101
1248
|
{
|
|
@@ -1111,34 +1258,34 @@ const Me = (t) => {
|
|
|
1111
1258
|
),
|
|
1112
1259
|
t.children
|
|
1113
1260
|
] }), q = (t, e) => ({ label: e.t(`sheet.cf.operator.${t}`), value: t }), fi = (t) => {
|
|
1114
|
-
const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [u, l] = N(""), [h, v] = N(() => typeof i == "string" ? i : ""), [f, S] = N(""), [p, T] = N(() => Array.isArray(i) ? i[0] === void 0 ? 0 : i[0] : 0), [_, R] = N(""), [
|
|
1261
|
+
const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [u, l] = N(""), [h, v] = N(() => typeof i == "string" ? i : ""), [f, S] = N(""), [p, T] = N(() => Array.isArray(i) ? i[0] === void 0 ? 0 : i[0] : 0), [_, R] = N(""), [w, x] = N(() => Array.isArray(i) ? i[1] === void 0 ? 100 : i[1] : 100), [g, C] = N("");
|
|
1115
1262
|
switch (K(() => {
|
|
1116
1263
|
switch (e) {
|
|
1117
|
-
case
|
|
1264
|
+
case F.text: {
|
|
1118
1265
|
[j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r) && n(h);
|
|
1119
1266
|
break;
|
|
1120
1267
|
}
|
|
1121
|
-
case
|
|
1122
|
-
[P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([p,
|
|
1268
|
+
case F.number: {
|
|
1269
|
+
[P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([p, w]);
|
|
1123
1270
|
break;
|
|
1124
1271
|
}
|
|
1125
1272
|
}
|
|
1126
1273
|
}, [e]), K(() => {
|
|
1127
1274
|
const b = s.intercept(s.getInterceptPoints().beforeSubmit, {
|
|
1128
|
-
handler: (y, M,
|
|
1275
|
+
handler: (y, M, E) => {
|
|
1129
1276
|
switch (e) {
|
|
1130
|
-
case
|
|
1277
|
+
case F.text:
|
|
1131
1278
|
if ([j.beginsWith, j.containsText, j.endsWith, j.notEqual, j.notContainsText, j.equal].includes(r))
|
|
1132
|
-
return h ?
|
|
1279
|
+
return h ? E(y) : (S(o.t("sheet.cf.errorMessage.notBlank")), !1);
|
|
1133
1280
|
}
|
|
1134
|
-
return
|
|
1281
|
+
return E(y);
|
|
1135
1282
|
}
|
|
1136
1283
|
});
|
|
1137
1284
|
return () => {
|
|
1138
1285
|
b();
|
|
1139
1286
|
};
|
|
1140
1287
|
}, [e, d, h, r]), e) {
|
|
1141
|
-
case
|
|
1288
|
+
case F.text: {
|
|
1142
1289
|
if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r)) {
|
|
1143
1290
|
const b = (y) => {
|
|
1144
1291
|
v(y), n(y);
|
|
@@ -1155,7 +1302,7 @@ const Me = (t) => {
|
|
|
1155
1302
|
}
|
|
1156
1303
|
break;
|
|
1157
1304
|
}
|
|
1158
|
-
case
|
|
1305
|
+
case F.number: {
|
|
1159
1306
|
if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r)) {
|
|
1160
1307
|
const b = (y) => {
|
|
1161
1308
|
a(y || 0), n(y || 0), l("");
|
|
@@ -1173,19 +1320,19 @@ const Me = (t) => {
|
|
|
1173
1320
|
}
|
|
1174
1321
|
if ([P.between, P.notBetween].includes(r)) {
|
|
1175
1322
|
const b = (M) => {
|
|
1176
|
-
T(M || 0), n([M || 0,
|
|
1323
|
+
T(M || 0), n([M || 0, w]), R("");
|
|
1177
1324
|
}, y = (M) => {
|
|
1178
1325
|
x(M || 0), n([p, M || 0]), C("");
|
|
1179
1326
|
};
|
|
1180
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
|
|
1181
1328
|
/* @__PURE__ */ c(dt, { errorText: _, children: /* @__PURE__ */ c(Ne, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value: p, onChange: b }) }),
|
|
1182
|
-
/* @__PURE__ */ c(dt, { errorText:
|
|
1329
|
+
/* @__PURE__ */ c(dt, { errorText: g, children: /* @__PURE__ */ c(
|
|
1183
1330
|
Ne,
|
|
1184
1331
|
{
|
|
1185
1332
|
className: "univer-ml-3",
|
|
1186
1333
|
min: Number.MIN_SAFE_INTEGER,
|
|
1187
1334
|
max: Number.MAX_SAFE_INTEGER,
|
|
1188
|
-
value:
|
|
1335
|
+
value: w,
|
|
1189
1336
|
onChange: y
|
|
1190
1337
|
}
|
|
1191
1338
|
) })
|
|
@@ -1196,7 +1343,7 @@ const Me = (t) => {
|
|
|
1196
1343
|
return null;
|
|
1197
1344
|
}, on = (t, e) => {
|
|
1198
1345
|
switch (t) {
|
|
1199
|
-
case
|
|
1346
|
+
case F.text:
|
|
1200
1347
|
return [
|
|
1201
1348
|
q(j.containsText, e),
|
|
1202
1349
|
q(j.notContainsText, e),
|
|
@@ -1209,7 +1356,7 @@ const Me = (t) => {
|
|
|
1209
1356
|
q(j.containsErrors, e),
|
|
1210
1357
|
q(j.notContainsErrors, e)
|
|
1211
1358
|
];
|
|
1212
|
-
case
|
|
1359
|
+
case F.number:
|
|
1213
1360
|
return [
|
|
1214
1361
|
q(P.between, e),
|
|
1215
1362
|
q(P.notBetween, e),
|
|
@@ -1220,7 +1367,7 @@ const Me = (t) => {
|
|
|
1220
1367
|
q(P.lessThan, e),
|
|
1221
1368
|
q(P.lessThanOrEqual, e)
|
|
1222
1369
|
];
|
|
1223
|
-
case
|
|
1370
|
+
case F.timePeriod:
|
|
1224
1371
|
return [
|
|
1225
1372
|
q(ue.yesterday, e),
|
|
1226
1373
|
q(ue.today, e),
|
|
@@ -1237,69 +1384,69 @@ const Me = (t) => {
|
|
|
1237
1384
|
}, an = (t) => {
|
|
1238
1385
|
var x;
|
|
1239
1386
|
const { interceptorManager: e, onChange: r } = t, n = W(re), i = ((x = t.rule) == null ? void 0 : x.type) === U.highlightCell ? t.rule : void 0, [s, o] = N(() => {
|
|
1240
|
-
const
|
|
1241
|
-
return i && i.subType ||
|
|
1387
|
+
const g = F.text;
|
|
1388
|
+
return i && i.subType || g;
|
|
1242
1389
|
}), d = [{
|
|
1243
|
-
value:
|
|
1390
|
+
value: F.text,
|
|
1244
1391
|
label: n.t("sheet.cf.subRuleType.text")
|
|
1245
1392
|
}, {
|
|
1246
|
-
value:
|
|
1393
|
+
value: F.number,
|
|
1247
1394
|
label: n.t("sheet.cf.subRuleType.number")
|
|
1248
1395
|
}, {
|
|
1249
|
-
value:
|
|
1396
|
+
value: F.timePeriod,
|
|
1250
1397
|
label: n.t("sheet.cf.subRuleType.timePeriod")
|
|
1251
1398
|
}, {
|
|
1252
|
-
value:
|
|
1399
|
+
value: F.duplicateValues,
|
|
1253
1400
|
label: n.t("sheet.cf.subRuleType.duplicateValues")
|
|
1254
1401
|
}, {
|
|
1255
|
-
value:
|
|
1402
|
+
value: F.uniqueValues,
|
|
1256
1403
|
label: n.t("sheet.cf.subRuleType.uniqueValues")
|
|
1257
1404
|
}], a = J(() => on(s, n), [s]), [u, l] = N(() => {
|
|
1258
|
-
const
|
|
1259
|
-
return i && i.operator ||
|
|
1405
|
+
const g = a ? a[0].value : void 0;
|
|
1406
|
+
return i && i.operator || g;
|
|
1260
1407
|
}), [h, v] = N(() => {
|
|
1261
1408
|
var b;
|
|
1262
|
-
const
|
|
1263
|
-
return i ? (b = i.value) != null ? b :
|
|
1264
|
-
}), [f, S] = N({}), p = J(() => (
|
|
1265
|
-
var C, b, y, M,
|
|
1266
|
-
switch (
|
|
1267
|
-
case
|
|
1409
|
+
const g = "";
|
|
1410
|
+
return i ? (b = i.value) != null ? b : mt(i.subType, i.operator) : g;
|
|
1411
|
+
}), [f, S] = N({}), p = J(() => (g) => {
|
|
1412
|
+
var C, b, y, M, E, V, L, m, I, H, Y, ge, me, ke, Fe;
|
|
1413
|
+
switch (g.subType || s) {
|
|
1414
|
+
case F.text: {
|
|
1268
1415
|
if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(u))
|
|
1269
1416
|
return {
|
|
1270
1417
|
type: U.highlightCell,
|
|
1271
|
-
subType: (C =
|
|
1272
|
-
operator: (b =
|
|
1273
|
-
style: (y =
|
|
1274
|
-
value: (M =
|
|
1418
|
+
subType: (C = g.subType) != null ? C : s,
|
|
1419
|
+
operator: (b = g.operator) != null ? b : u,
|
|
1420
|
+
style: (y = g.style) != null ? y : f,
|
|
1421
|
+
value: (M = g.value) != null ? M : h
|
|
1275
1422
|
};
|
|
1276
1423
|
break;
|
|
1277
1424
|
}
|
|
1278
|
-
case
|
|
1425
|
+
case F.number: {
|
|
1279
1426
|
if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(u))
|
|
1280
1427
|
return {
|
|
1281
1428
|
type: U.highlightCell,
|
|
1282
|
-
subType: (
|
|
1283
|
-
operator: (V =
|
|
1284
|
-
style: (L =
|
|
1285
|
-
value: (
|
|
1429
|
+
subType: (E = g.subType) != null ? E : s,
|
|
1430
|
+
operator: (V = g.operator) != null ? V : u,
|
|
1431
|
+
style: (L = g.style) != null ? L : f,
|
|
1432
|
+
value: (m = g.value) != null ? m : h
|
|
1286
1433
|
};
|
|
1287
1434
|
if ([P.between, P.notBetween].includes(u))
|
|
1288
1435
|
return {
|
|
1289
1436
|
type: U.highlightCell,
|
|
1290
|
-
subType: (I =
|
|
1291
|
-
operator: (H =
|
|
1292
|
-
style: (Y =
|
|
1293
|
-
value: (
|
|
1437
|
+
subType: (I = g.subType) != null ? I : s,
|
|
1438
|
+
operator: (H = g.operator) != null ? H : u,
|
|
1439
|
+
style: (Y = g.style) != null ? Y : f,
|
|
1440
|
+
value: (ge = g.value) != null ? ge : h
|
|
1294
1441
|
};
|
|
1295
1442
|
break;
|
|
1296
1443
|
}
|
|
1297
1444
|
}
|
|
1298
1445
|
return {
|
|
1299
1446
|
type: U.highlightCell,
|
|
1300
|
-
subType: (
|
|
1301
|
-
operator: (
|
|
1302
|
-
style: (
|
|
1447
|
+
subType: (me = g.subType) != null ? me : s,
|
|
1448
|
+
operator: (ke = g.operator) != null ? ke : u,
|
|
1449
|
+
style: (Fe = g.style) != null ? Fe : f
|
|
1303
1450
|
};
|
|
1304
1451
|
}, [s, u, h, f]);
|
|
1305
1452
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
@@ -1307,20 +1454,29 @@ const Me = (t) => {
|
|
|
1307
1454
|
return p({});
|
|
1308
1455
|
}
|
|
1309
1456
|
}), [p, e]), K(() => {
|
|
1310
|
-
d.some((
|
|
1457
|
+
d.some((g) => g.value === s) || o(d[0].value);
|
|
1311
1458
|
}, [d]);
|
|
1312
|
-
const T = (
|
|
1313
|
-
const C =
|
|
1314
|
-
o(C), l(y), y && v(
|
|
1315
|
-
}, _ = (
|
|
1316
|
-
const C =
|
|
1459
|
+
const T = (g) => {
|
|
1460
|
+
const C = g, b = on(C, n), y = b && b[0].value;
|
|
1461
|
+
o(C), l(y), y && v(mt(C, y)), r(p({ subType: C, operator: y }));
|
|
1462
|
+
}, _ = (g) => {
|
|
1463
|
+
const C = g;
|
|
1317
1464
|
l(C), r(p({ operator: C }));
|
|
1318
|
-
}, R = (
|
|
1319
|
-
v(
|
|
1320
|
-
},
|
|
1321
|
-
return /* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */ c(
|
|
1323
|
-
|
|
1465
|
+
}, R = (g) => {
|
|
1466
|
+
v(g), r(p({ value: g }));
|
|
1467
|
+
}, w = J(() => `${s}_${u}_${Math.random()}`, [s, u]);
|
|
1468
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
1469
|
+
/* @__PURE__ */ c(
|
|
1470
|
+
"div",
|
|
1471
|
+
{
|
|
1472
|
+
className: `
|
|
1473
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
1474
|
+
dark:univer-text-gray-200
|
|
1475
|
+
`,
|
|
1476
|
+
children: n.t("sheet.cf.panel.styleRule")
|
|
1477
|
+
}
|
|
1478
|
+
),
|
|
1479
|
+
/* @__PURE__ */ k("div", { className: "univer-flex univer-justify-between univer-gap-4", children: [
|
|
1324
1480
|
/* @__PURE__ */ c(
|
|
1325
1481
|
le,
|
|
1326
1482
|
{
|
|
@@ -1350,7 +1506,7 @@ const Me = (t) => {
|
|
|
1350
1506
|
rule: i,
|
|
1351
1507
|
onChange: R
|
|
1352
1508
|
},
|
|
1353
|
-
|
|
1509
|
+
w
|
|
1354
1510
|
),
|
|
1355
1511
|
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: p({}) }) }),
|
|
1356
1512
|
/* @__PURE__ */ c(
|
|
@@ -1358,19 +1514,19 @@ const Me = (t) => {
|
|
|
1358
1514
|
{
|
|
1359
1515
|
style: i == null ? void 0 : i.style,
|
|
1360
1516
|
className: "univer-ml-1",
|
|
1361
|
-
onChange: (
|
|
1362
|
-
S(
|
|
1517
|
+
onChange: (g) => {
|
|
1518
|
+
S(g), r(p({ style: g }));
|
|
1363
1519
|
}
|
|
1364
1520
|
}
|
|
1365
1521
|
)
|
|
1366
1522
|
] });
|
|
1367
|
-
}, Xn = (t, e) => (
|
|
1523
|
+
}, Xn = (t, e) => (Ee[t] || [])[Number(e)] || "", pi = (t) => {
|
|
1368
1524
|
var l;
|
|
1369
1525
|
const { error: e, type: r, onChange: n } = t, i = W(z), s = i.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), o = (l = i.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : l.getSheetId(), d = de(null), [a, u] = N(!1);
|
|
1370
1526
|
return Nt((h) => {
|
|
1371
1527
|
var f;
|
|
1372
1528
|
((f = d.current) == null ? void 0 : f.isClickOutSide(h)) && u(!1);
|
|
1373
|
-
}), /* @__PURE__ */ c("div", { className: "univer-relative", children: r !== A.formula ? /* @__PURE__ */
|
|
1529
|
+
}), /* @__PURE__ */ c("div", { className: "univer-relative", children: r !== A.formula ? /* @__PURE__ */ k(Bt, { children: [
|
|
1374
1530
|
/* @__PURE__ */ c(
|
|
1375
1531
|
Ne,
|
|
1376
1532
|
{
|
|
@@ -1405,7 +1561,7 @@ const Me = (t) => {
|
|
|
1405
1561
|
const { onClick: r } = t, n = W(re), i = (s) => {
|
|
1406
1562
|
r(s);
|
|
1407
1563
|
};
|
|
1408
|
-
return /* @__PURE__ */ c("div", { ref: e, className: "univer-w-80", children:
|
|
1564
|
+
return /* @__PURE__ */ c("div", { ref: e, className: "univer-w-80", children: mr.map((s, o) => /* @__PURE__ */ k("div", { className: "univer-mb-3", children: [
|
|
1409
1565
|
/* @__PURE__ */ c("div", { className: "univer-mb-1 univer-text-sm", children: n.t(s.title) }),
|
|
1410
1566
|
/* @__PURE__ */ c("div", { className: "univer-flex univer-flex-wrap", children: s.group.map((d) => /* @__PURE__ */ c(
|
|
1411
1567
|
"div",
|
|
@@ -1439,8 +1595,8 @@ const Me = (t) => {
|
|
|
1439
1595
|
}), yi = (t) => {
|
|
1440
1596
|
const { onClick: e } = t, r = J(() => {
|
|
1441
1597
|
const i = [];
|
|
1442
|
-
for (const s in
|
|
1443
|
-
const o =
|
|
1598
|
+
for (const s in Ee) {
|
|
1599
|
+
const o = Ee[s], d = s;
|
|
1444
1600
|
o.forEach((a, u) => {
|
|
1445
1601
|
i.push({
|
|
1446
1602
|
iconType: d,
|
|
@@ -1453,8 +1609,8 @@ const Me = (t) => {
|
|
|
1453
1609
|
}, []), n = (i) => {
|
|
1454
1610
|
e(i.iconType, i.iconId);
|
|
1455
1611
|
};
|
|
1456
|
-
return /* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
1613
|
+
/* @__PURE__ */ k(
|
|
1458
1614
|
"div",
|
|
1459
1615
|
{
|
|
1460
1616
|
className: "univer-mb-2.5 univer-flex univer-cursor-pointer univer-items-center univer-pl-1",
|
|
@@ -1496,32 +1652,33 @@ const Me = (t) => {
|
|
|
1496
1652
|
e([String(v), "value", "value"], h);
|
|
1497
1653
|
}, a = (h, v) => {
|
|
1498
1654
|
e([String(v), "operator"], h);
|
|
1499
|
-
const f =
|
|
1655
|
+
const f = mt(F.number, h);
|
|
1500
1656
|
d(f, v);
|
|
1501
1657
|
}, u = (h, v) => {
|
|
1502
1658
|
e([String(v), "value", "type"], h);
|
|
1503
|
-
const f = r[v], S =
|
|
1659
|
+
const f = r[v], S = mt(F.number, f.operator);
|
|
1504
1660
|
d(S, v);
|
|
1505
1661
|
};
|
|
1506
1662
|
return J(() => r.map((h, v) => {
|
|
1507
|
-
const f = n[v], S = Xn(h.iconType, h.iconId), p = v === r.length - 1, T = v === 0, _ = r[v - 1], R = (_ == null ? void 0 : _.value.type) === A.formula ? i.t("sheet.cf.valueType.formula") : _ == null ? void 0 : _.value.value,
|
|
1508
|
-
const C = { ...h, iconId:
|
|
1663
|
+
const f = n[v], S = Xn(h.iconType, h.iconId), p = v === r.length - 1, T = v === 0, _ = r[v - 1], R = (_ == null ? void 0 : _.value.type) === A.formula ? i.t("sheet.cf.valueType.formula") : _ == null ? void 0 : _.value.value, w = (x, g) => {
|
|
1664
|
+
const C = { ...h, iconId: g, iconType: x };
|
|
1509
1665
|
e([String(v)], C);
|
|
1510
1666
|
};
|
|
1511
|
-
return /* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ k(
|
|
1512
1668
|
"div",
|
|
1513
1669
|
{
|
|
1514
1670
|
className: v ? "univer-mt-6" : "univer-mt-3",
|
|
1515
1671
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ k(
|
|
1517
1673
|
"div",
|
|
1518
1674
|
{
|
|
1519
1675
|
className: `
|
|
1520
1676
|
univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm
|
|
1521
1677
|
univer-text-gray-600
|
|
1678
|
+
dark:univer-text-gray-200
|
|
1522
1679
|
`,
|
|
1523
1680
|
children: [
|
|
1524
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ k(
|
|
1525
1682
|
"div",
|
|
1526
1683
|
{
|
|
1527
1684
|
className: "univer-w-[45%]",
|
|
@@ -1531,32 +1688,42 @@ const Me = (t) => {
|
|
|
1531
1688
|
]
|
|
1532
1689
|
}
|
|
1533
1690
|
),
|
|
1534
|
-
/* @__PURE__ */ c("div", { className: "univer-w-[45%]", children: /* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ c("div", { className: "univer-w-[45%]", children: /* @__PURE__ */ k(Bt, { children: [
|
|
1535
1692
|
!T && !p && i.t("sheet.cf.iconSet.rule"),
|
|
1536
|
-
!T && !p && /* @__PURE__ */
|
|
1537
|
-
"
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1693
|
+
!T && !p && /* @__PURE__ */ k(
|
|
1694
|
+
"span",
|
|
1695
|
+
{
|
|
1696
|
+
className: `
|
|
1697
|
+
univer-font-medium univer-text-gray-600
|
|
1698
|
+
dark:univer-text-gray-200
|
|
1699
|
+
`,
|
|
1700
|
+
children: [
|
|
1701
|
+
"(",
|
|
1702
|
+
i.t("sheet.cf.iconSet.when"),
|
|
1703
|
+
i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
|
|
1704
|
+
R,
|
|
1705
|
+
p ? "" : ` ${i.t("sheet.cf.iconSet.and")} `,
|
|
1706
|
+
")"
|
|
1707
|
+
]
|
|
1708
|
+
}
|
|
1709
|
+
)
|
|
1544
1710
|
] }) })
|
|
1545
1711
|
]
|
|
1546
1712
|
}
|
|
1547
1713
|
),
|
|
1548
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-gap-4", children: [
|
|
1549
1715
|
/* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: /* @__PURE__ */ c(
|
|
1550
1716
|
Zt,
|
|
1551
1717
|
{
|
|
1552
|
-
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick:
|
|
1553
|
-
children: /* @__PURE__ */
|
|
1718
|
+
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick: w, iconId: h.iconId, iconType: h.iconType }) }),
|
|
1719
|
+
children: /* @__PURE__ */ k(
|
|
1554
1720
|
"div",
|
|
1555
1721
|
{
|
|
1556
1722
|
className: X(`
|
|
1557
1723
|
univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center
|
|
1558
1724
|
univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2
|
|
1559
1725
|
univer-text-xs univer-text-gray-600 univer-transition-all
|
|
1726
|
+
dark:univer-text-gray-200
|
|
1560
1727
|
hover:univer-border-primary-600
|
|
1561
1728
|
`, He),
|
|
1562
1729
|
children: [
|
|
@@ -1572,15 +1739,24 @@ const Me = (t) => {
|
|
|
1572
1739
|
)
|
|
1573
1740
|
}
|
|
1574
1741
|
) }),
|
|
1575
|
-
p ? /* @__PURE__ */
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1742
|
+
p ? /* @__PURE__ */ k(
|
|
1743
|
+
"div",
|
|
1744
|
+
{
|
|
1745
|
+
className: `
|
|
1746
|
+
univer-mt-0 univer-w-[45%] univer-text-sm univer-text-gray-600
|
|
1747
|
+
dark:univer-text-gray-200
|
|
1748
|
+
`,
|
|
1749
|
+
children: [
|
|
1750
|
+
i.t("sheet.cf.iconSet.rule"),
|
|
1751
|
+
/* @__PURE__ */ k("span", { className: "univer-font-medium", children: [
|
|
1752
|
+
i.t("sheet.cf.iconSet.when"),
|
|
1753
|
+
i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
|
|
1754
|
+
R,
|
|
1755
|
+
p ? "" : ` ${i.t("sheet.cf.iconSet.and")} `
|
|
1756
|
+
] })
|
|
1757
|
+
]
|
|
1758
|
+
}
|
|
1759
|
+
) : /* @__PURE__ */ c(
|
|
1584
1760
|
le,
|
|
1585
1761
|
{
|
|
1586
1762
|
options: s,
|
|
@@ -1591,13 +1767,14 @@ const Me = (t) => {
|
|
|
1591
1767
|
}
|
|
1592
1768
|
)
|
|
1593
1769
|
] }),
|
|
1594
|
-
p ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1770
|
+
p ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */ k(Bt, { children: [
|
|
1771
|
+
/* @__PURE__ */ k(
|
|
1596
1772
|
"div",
|
|
1597
1773
|
{
|
|
1598
1774
|
className: `
|
|
1599
1775
|
univer-mt-3 univer-flex univer-items-center univer-justify-between univer-gap-4
|
|
1600
1776
|
univer-text-sm univer-text-gray-600
|
|
1777
|
+
dark:univer-text-gray-200
|
|
1601
1778
|
`,
|
|
1602
1779
|
children: [
|
|
1603
1780
|
/* @__PURE__ */ c("div", { children: i.t("sheet.cf.iconSet.type") }),
|
|
@@ -1605,7 +1782,7 @@ const Me = (t) => {
|
|
|
1605
1782
|
]
|
|
1606
1783
|
}
|
|
1607
1784
|
),
|
|
1608
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ k(
|
|
1609
1786
|
"div",
|
|
1610
1787
|
{
|
|
1611
1788
|
className: `
|
|
@@ -1647,26 +1824,26 @@ const Me = (t) => {
|
|
|
1647
1824
|
}, Si = (t) => {
|
|
1648
1825
|
var x;
|
|
1649
1826
|
const { interceptorManager: e } = t, r = ((x = t.rule) == null ? void 0 : x.type) === U.iconSet ? t.rule : void 0, n = W(re), [i, s] = N({}), [o, d] = N(() => {
|
|
1650
|
-
const
|
|
1827
|
+
const g = Object.keys(Ee)[0];
|
|
1651
1828
|
if (r && r.config.length) {
|
|
1652
1829
|
const C = r.config[0].iconType;
|
|
1653
1830
|
if (!r.config.some((y) => y.iconType !== C))
|
|
1654
1831
|
return C;
|
|
1655
1832
|
}
|
|
1656
|
-
return
|
|
1833
|
+
return g;
|
|
1657
1834
|
}), [a, u] = N(() => {
|
|
1658
1835
|
if (r && r.config.length)
|
|
1659
1836
|
return Wt.deepClone(r == null ? void 0 : r.config);
|
|
1660
|
-
const
|
|
1661
|
-
return new Array(
|
|
1837
|
+
const g = Ee[o] || [];
|
|
1838
|
+
return new Array(g.length).fill("").map((C, b, y) => b === y.length - 1 ? {
|
|
1662
1839
|
operator: P.lessThanOrEqual,
|
|
1663
1840
|
value: { type: A.num, value: Number.MAX_SAFE_INTEGER },
|
|
1664
1841
|
iconType: o,
|
|
1665
1842
|
iconId: String(b)
|
|
1666
1843
|
} : ln(o, b, y));
|
|
1667
1844
|
}), [l, h] = N(() => r ? !!r.isShowValue : !0), v = J(() => {
|
|
1668
|
-
const
|
|
1669
|
-
return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children:
|
|
1845
|
+
const g = a.map((C) => Xn(C.iconType, C.iconId));
|
|
1846
|
+
return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: g.map((C, b) => C ? /* @__PURE__ */ c(
|
|
1670
1847
|
"img",
|
|
1671
1848
|
{
|
|
1672
1849
|
className: "univer-size-5",
|
|
@@ -1674,8 +1851,8 @@ const Me = (t) => {
|
|
|
1674
1851
|
},
|
|
1675
1852
|
b
|
|
1676
1853
|
) : /* @__PURE__ */ c(ot, { className: "univer-size-5" }, b)) });
|
|
1677
|
-
}, [a]), f = (
|
|
1678
|
-
if (
|
|
1854
|
+
}, [a]), f = (g) => {
|
|
1855
|
+
if (g.reduce((b, y, M) => b.preType && !b.result || g.length - 1 === M ? b : y.value.type === A.formula ? {
|
|
1679
1856
|
preType: A.formula,
|
|
1680
1857
|
result: !1
|
|
1681
1858
|
} : b.preType ? {
|
|
@@ -1684,50 +1861,50 @@ const Me = (t) => {
|
|
|
1684
1861
|
} : {
|
|
1685
1862
|
result: !0,
|
|
1686
1863
|
preType: y.value.type
|
|
1687
|
-
}, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(
|
|
1864
|
+
}, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(g[0].value.type)) {
|
|
1688
1865
|
const b = {};
|
|
1689
|
-
return
|
|
1690
|
-
if (M - 1 < 0 || M ===
|
|
1866
|
+
return g.forEach((y, M, E) => {
|
|
1867
|
+
if (M - 1 < 0 || M === E.length - 1)
|
|
1691
1868
|
return;
|
|
1692
|
-
const L =
|
|
1693
|
-
fr({ operator:
|
|
1869
|
+
const L = g[M - 1], m = Ht(L.operator);
|
|
1870
|
+
fr({ operator: m, value: L.value.value }, y.value.value) || (b[M] = `${n.t(`sheet.cf.form.${m}`, String(L.value.value))} `);
|
|
1694
1871
|
}), b;
|
|
1695
1872
|
}
|
|
1696
1873
|
return {};
|
|
1697
|
-
}, S = (
|
|
1698
|
-
sr(a,
|
|
1699
|
-
}, p = (
|
|
1700
|
-
d(
|
|
1701
|
-
const C =
|
|
1874
|
+
}, S = (g, C) => {
|
|
1875
|
+
sr(a, g) !== C && (or(a, g, C), u([...a]), s(f(a)));
|
|
1876
|
+
}, p = (g) => {
|
|
1877
|
+
d(g);
|
|
1878
|
+
const C = Ee[g] || [], b = new Array(C.length).fill("").map((y, M, E) => ln(g, M, E));
|
|
1702
1879
|
u(b), s(f(b));
|
|
1703
1880
|
};
|
|
1704
1881
|
K(() => {
|
|
1705
|
-
const
|
|
1882
|
+
const g = e.intercept(e.getInterceptPoints().submit, {
|
|
1706
1883
|
handler() {
|
|
1707
1884
|
return { type: U.iconSet, isShowValue: l, config: a };
|
|
1708
1885
|
}
|
|
1709
1886
|
});
|
|
1710
1887
|
return () => {
|
|
1711
|
-
|
|
1888
|
+
g();
|
|
1712
1889
|
};
|
|
1713
1890
|
}, [l, a, e]), K(() => {
|
|
1714
|
-
const
|
|
1891
|
+
const g = e.intercept(e.getInterceptPoints().beforeSubmit, {
|
|
1715
1892
|
handler() {
|
|
1716
1893
|
return Object.keys(i).length === 0;
|
|
1717
1894
|
}
|
|
1718
1895
|
});
|
|
1719
1896
|
return () => {
|
|
1720
|
-
|
|
1897
|
+
g();
|
|
1721
1898
|
};
|
|
1722
1899
|
}, [l, a, e, i]);
|
|
1723
1900
|
const T = () => {
|
|
1724
|
-
const
|
|
1901
|
+
const g = a.map((C) => ({ ...C }));
|
|
1725
1902
|
a.forEach((C, b) => {
|
|
1726
|
-
const y = a.length - 1 - b, M =
|
|
1903
|
+
const y = a.length - 1 - b, M = g[y];
|
|
1727
1904
|
C.iconId = M.iconId, C.iconType = M.iconType;
|
|
1728
1905
|
}), u([...a]);
|
|
1729
|
-
}, _ = W(Lr), [R,
|
|
1730
|
-
return Ar(R, _.rootContainerElement), /* @__PURE__ */
|
|
1906
|
+
}, _ = W(Lr), [R, w] = N();
|
|
1907
|
+
return Ar(R, _.rootContainerElement), /* @__PURE__ */ k("div", { children: [
|
|
1731
1908
|
/* @__PURE__ */ c("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-600", children: n.t("sheet.cf.panel.styleRule") }),
|
|
1732
1909
|
/* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(
|
|
1733
1910
|
Zt,
|
|
@@ -1735,14 +1912,14 @@ const Me = (t) => {
|
|
|
1735
1912
|
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(
|
|
1736
1913
|
Ci,
|
|
1737
1914
|
{
|
|
1738
|
-
ref: (
|
|
1739
|
-
!R &&
|
|
1915
|
+
ref: (g) => {
|
|
1916
|
+
!R && g && w(g);
|
|
1740
1917
|
},
|
|
1741
1918
|
iconType: o,
|
|
1742
1919
|
onClick: p
|
|
1743
1920
|
}
|
|
1744
1921
|
) }),
|
|
1745
|
-
children: /* @__PURE__ */
|
|
1922
|
+
children: /* @__PURE__ */ k(
|
|
1746
1923
|
"div",
|
|
1747
1924
|
{
|
|
1748
1925
|
className: X(`
|
|
@@ -1759,14 +1936,14 @@ const Me = (t) => {
|
|
|
1759
1936
|
)
|
|
1760
1937
|
}
|
|
1761
1938
|
) }),
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center univer-text-xs", children: [
|
|
1940
|
+
/* @__PURE__ */ k("div", { className: "univer-flex univer-items-center univer-text-xs", children: [
|
|
1764
1941
|
/* @__PURE__ */ c(yt, { onChange: T }),
|
|
1765
1942
|
n.t("sheet.cf.iconSet.reverseIconOrder")
|
|
1766
1943
|
] }),
|
|
1767
|
-
/* @__PURE__ */
|
|
1768
|
-
/* @__PURE__ */ c(yt, { checked: !l, onChange: (
|
|
1769
|
-
h(!
|
|
1944
|
+
/* @__PURE__ */ k("div", { className: "univer-ml-6 univer-flex univer-items-center univer-text-xs", children: [
|
|
1945
|
+
/* @__PURE__ */ c(yt, { checked: !l, onChange: (g) => {
|
|
1946
|
+
h(!g);
|
|
1770
1947
|
} }),
|
|
1771
1948
|
n.t("sheet.cf.iconSet.onlyShowIcon")
|
|
1772
1949
|
] })
|
|
@@ -1782,9 +1959,9 @@ const Me = (t) => {
|
|
|
1782
1959
|
switch (R) {
|
|
1783
1960
|
case U.highlightCell:
|
|
1784
1961
|
switch (i.subType) {
|
|
1785
|
-
case
|
|
1962
|
+
case F.average:
|
|
1786
1963
|
return [P.greaterThan, P.greaterThanOrEqual].includes(i.operator) ? "greaterThanAverage" : [P.lessThan, P.lessThanOrEqual].includes(i.operator) ? "lessThanAverage" : _;
|
|
1787
|
-
case
|
|
1964
|
+
case F.rank:
|
|
1788
1965
|
return i.isBottom ? "isBottom" : "isNotBottom";
|
|
1789
1966
|
}
|
|
1790
1967
|
}
|
|
@@ -1796,7 +1973,7 @@ const Me = (t) => {
|
|
|
1796
1973
|
switch (R) {
|
|
1797
1974
|
case U.highlightCell:
|
|
1798
1975
|
switch (i.subType) {
|
|
1799
|
-
case
|
|
1976
|
+
case F.rank:
|
|
1800
1977
|
return i.value || 10;
|
|
1801
1978
|
}
|
|
1802
1979
|
}
|
|
@@ -1808,21 +1985,21 @@ const Me = (t) => {
|
|
|
1808
1985
|
switch (R) {
|
|
1809
1986
|
case U.highlightCell:
|
|
1810
1987
|
switch (i.subType) {
|
|
1811
|
-
case
|
|
1988
|
+
case F.rank:
|
|
1812
1989
|
return i.isPercent || !1;
|
|
1813
1990
|
}
|
|
1814
1991
|
}
|
|
1815
1992
|
return !1;
|
|
1816
1993
|
}), [v, f] = N({}), S = (_) => {
|
|
1817
|
-
const { type: R, isPercent:
|
|
1994
|
+
const { type: R, isPercent: w, value: x, style: g } = _;
|
|
1818
1995
|
if (R === "isNotBottom")
|
|
1819
|
-
return { type: U.highlightCell, subType:
|
|
1996
|
+
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !1, value: x, style: g };
|
|
1820
1997
|
if (R === "isBottom")
|
|
1821
|
-
return { type: U.highlightCell, subType:
|
|
1998
|
+
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !0, value: x, style: g };
|
|
1822
1999
|
if (R === "greaterThanAverage")
|
|
1823
|
-
return { type: U.highlightCell, subType:
|
|
2000
|
+
return { type: U.highlightCell, subType: F.average, operator: P.greaterThan, style: g };
|
|
1824
2001
|
if (R === "lessThanAverage")
|
|
1825
|
-
return { type: U.highlightCell, subType:
|
|
2002
|
+
return { type: U.highlightCell, subType: F.average, operator: P.lessThan, style: g };
|
|
1826
2003
|
};
|
|
1827
2004
|
K(() => r.intercept(r.getInterceptPoints().submit, {
|
|
1828
2005
|
handler() {
|
|
@@ -1832,8 +2009,17 @@ const Me = (t) => {
|
|
|
1832
2009
|
const p = (_) => {
|
|
1833
2010
|
e(S(_));
|
|
1834
2011
|
};
|
|
1835
|
-
return /* @__PURE__ */
|
|
1836
|
-
/* @__PURE__ */ c(
|
|
2012
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
2013
|
+
/* @__PURE__ */ c(
|
|
2014
|
+
"div",
|
|
2015
|
+
{
|
|
2016
|
+
className: `
|
|
2017
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
2018
|
+
dark:univer-text-gray-200
|
|
2019
|
+
`,
|
|
2020
|
+
children: n.t("sheet.cf.panel.styleRule")
|
|
2021
|
+
}
|
|
2022
|
+
),
|
|
1837
2023
|
/* @__PURE__ */ c(
|
|
1838
2024
|
le,
|
|
1839
2025
|
{
|
|
@@ -1845,7 +2031,7 @@ const Me = (t) => {
|
|
|
1845
2031
|
}
|
|
1846
2032
|
}
|
|
1847
2033
|
),
|
|
1848
|
-
["isNotBottom", "isBottom"].includes(o) && /* @__PURE__ */
|
|
2034
|
+
["isNotBottom", "isBottom"].includes(o) && /* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
|
|
1849
2035
|
/* @__PURE__ */ c(
|
|
1850
2036
|
Ne,
|
|
1851
2037
|
{
|
|
@@ -1858,7 +2044,7 @@ const Me = (t) => {
|
|
|
1858
2044
|
}
|
|
1859
2045
|
}
|
|
1860
2046
|
),
|
|
1861
|
-
/* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ k(
|
|
1862
2048
|
"div",
|
|
1863
2049
|
{
|
|
1864
2050
|
className: "univer-ml-3 univer-flex univer-items-center univer-text-xs",
|
|
@@ -1895,9 +2081,9 @@ const Me = (t) => {
|
|
|
1895
2081
|
}, Ri = (t) => {
|
|
1896
2082
|
var b, y, M;
|
|
1897
2083
|
const e = W(re), r = W(te), n = W(z), i = W(Q), s = W($e), o = cn(n), d = un(n), [a, u] = N(void 0), l = de((y = (b = t.rule) == null ? void 0 : b.ranges) != null ? y : []), h = J(() => {
|
|
1898
|
-
var V, L,
|
|
1899
|
-
let
|
|
1900
|
-
return
|
|
2084
|
+
var V, L, m;
|
|
2085
|
+
let E = (V = t.rule) == null ? void 0 : V.ranges;
|
|
2086
|
+
return E != null && E.length || (E = (m = (L = s.getCurrentSelections()) == null ? void 0 : L.map((I) => I.range)) != null ? m : []), l.current = E, E != null && E.length ? E.map((I) => {
|
|
1901
2087
|
const H = Un(I);
|
|
1902
2088
|
return H === "NaN" ? "" : H;
|
|
1903
2089
|
}).filter((I) => !!I).join(",") : "";
|
|
@@ -1909,23 +2095,23 @@ const Me = (t) => {
|
|
|
1909
2095
|
{ label: e.t("sheet.cf.ruleType.formula"), value: "5" },
|
|
1910
2096
|
{ label: e.t("sheet.cf.ruleType.iconSet"), value: "6" }
|
|
1911
2097
|
], [f, S] = N(() => {
|
|
1912
|
-
var L,
|
|
1913
|
-
const
|
|
1914
|
-
if (!
|
|
2098
|
+
var L, m;
|
|
2099
|
+
const E = (L = t.rule) == null ? void 0 : L.rule.type, V = v[0].value;
|
|
2100
|
+
if (!E)
|
|
1915
2101
|
return V;
|
|
1916
|
-
switch (
|
|
2102
|
+
switch (E) {
|
|
1917
2103
|
case U.highlightCell: {
|
|
1918
|
-
switch ((
|
|
1919
|
-
case
|
|
1920
|
-
case
|
|
1921
|
-
case
|
|
1922
|
-
case
|
|
1923
|
-
case
|
|
2104
|
+
switch ((m = t.rule) == null ? void 0 : m.rule.subType) {
|
|
2105
|
+
case F.number:
|
|
2106
|
+
case F.text:
|
|
2107
|
+
case F.duplicateValues:
|
|
2108
|
+
case F.uniqueValues:
|
|
2109
|
+
case F.timePeriod:
|
|
1924
2110
|
return "1";
|
|
1925
|
-
case
|
|
1926
|
-
case
|
|
2111
|
+
case F.average:
|
|
2112
|
+
case F.rank:
|
|
1927
2113
|
return "2";
|
|
1928
|
-
case
|
|
2114
|
+
case F.formula:
|
|
1929
2115
|
return "5";
|
|
1930
2116
|
}
|
|
1931
2117
|
break;
|
|
@@ -1945,11 +2131,11 @@ const Me = (t) => {
|
|
|
1945
2131
|
case "2":
|
|
1946
2132
|
return Ii;
|
|
1947
2133
|
case "3":
|
|
1948
|
-
return
|
|
2134
|
+
return gi;
|
|
1949
2135
|
case "4":
|
|
1950
2136
|
return vi;
|
|
1951
2137
|
case "5":
|
|
1952
|
-
return
|
|
2138
|
+
return mi;
|
|
1953
2139
|
case "6":
|
|
1954
2140
|
return Si;
|
|
1955
2141
|
default:
|
|
@@ -1957,67 +2143,85 @@ const Me = (t) => {
|
|
|
1957
2143
|
}
|
|
1958
2144
|
}, [f]);
|
|
1959
2145
|
K(() => {
|
|
1960
|
-
const
|
|
2146
|
+
const E = r.onCommandExecuted((V) => {
|
|
1961
2147
|
if (V.id === Rr.id) {
|
|
1962
2148
|
const L = V.params;
|
|
1963
2149
|
L.subUnitId === d && L.unitId === o && t.onCancel();
|
|
1964
2150
|
}
|
|
1965
2151
|
V.id === qt.id && t.onCancel();
|
|
1966
2152
|
});
|
|
1967
|
-
return () =>
|
|
2153
|
+
return () => E.dispose();
|
|
1968
2154
|
}, []);
|
|
1969
|
-
const R = (
|
|
1970
|
-
p.current =
|
|
1971
|
-
},
|
|
1972
|
-
const V =
|
|
2155
|
+
const R = (E) => {
|
|
2156
|
+
p.current = E;
|
|
2157
|
+
}, w = (E) => {
|
|
2158
|
+
const V = E.split(",").filter((L) => !!L).map(Zr).map((L) => L.range);
|
|
1973
2159
|
l.current = V;
|
|
1974
2160
|
}, x = () => {
|
|
1975
2161
|
if (a)
|
|
1976
2162
|
return;
|
|
1977
2163
|
const V = (() => {
|
|
1978
|
-
const
|
|
1979
|
-
if (!
|
|
2164
|
+
const m = n.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet();
|
|
2165
|
+
if (!m)
|
|
1980
2166
|
throw new Error("No active sheet found");
|
|
1981
|
-
return l.current.map((Y) => xr(Y,
|
|
2167
|
+
return l.current.map((Y) => xr(Y, m.getRowCount(), m.getColumnCount())).filter((Y) => !(Number.isNaN(Y.startRow) || Number.isNaN(Y.startColumn)));
|
|
1982
2168
|
})();
|
|
1983
2169
|
if (T.fetchThroughInterceptors(T.getInterceptPoints().beforeSubmit)(!0, null)) {
|
|
1984
|
-
const
|
|
1985
|
-
if (
|
|
2170
|
+
const m = T.fetchThroughInterceptors(T.getInterceptPoints().submit)(null, null);
|
|
2171
|
+
if (m) {
|
|
1986
2172
|
const I = cn(n), H = un(n);
|
|
1987
2173
|
if (!I || !H)
|
|
1988
2174
|
throw new Error("No active sheet found");
|
|
1989
2175
|
let Y = {};
|
|
1990
|
-
t.rule && t.rule.cfId ? (Y = { ...t.rule, ranges: V, rule:
|
|
2176
|
+
t.rule && t.rule.cfId ? (Y = { ...t.rule, ranges: V, rule: m }, r.executeCommand(Cr.id, { unitId: I, subUnitId: H, rule: Y }), t.onCancel()) : (Y = { cfId: i.createCfId(I, H), ranges: V, rule: m, stopIfTrue: !1 }, r.executeCommand(_n.id, { unitId: I, subUnitId: H, rule: Y }), t.onCancel());
|
|
1991
2177
|
}
|
|
1992
2178
|
}
|
|
1993
|
-
},
|
|
2179
|
+
}, g = () => {
|
|
1994
2180
|
t.onCancel();
|
|
1995
|
-
}, C = (
|
|
1996
|
-
|
|
2181
|
+
}, C = (E, V) => {
|
|
2182
|
+
E ? V.length < 1 ? u(e.t("sheet.cf.errorMessage.rangeError")) : u(void 0) : u(e.t("sheet.cf.errorMessage.rangeError"));
|
|
1997
2183
|
};
|
|
1998
|
-
return /* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */ c(
|
|
2000
|
-
|
|
2184
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
2185
|
+
/* @__PURE__ */ c(
|
|
2186
|
+
"div",
|
|
2187
|
+
{
|
|
2188
|
+
className: `
|
|
2189
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
2190
|
+
dark:univer-text-gray-200
|
|
2191
|
+
`,
|
|
2192
|
+
children: e.t("sheet.cf.panel.range")
|
|
2193
|
+
}
|
|
2194
|
+
),
|
|
2195
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-4", children: [
|
|
2001
2196
|
/* @__PURE__ */ c(
|
|
2002
2197
|
Yr,
|
|
2003
2198
|
{
|
|
2004
2199
|
unitId: o,
|
|
2005
2200
|
subUnitId: d,
|
|
2006
2201
|
initialValue: h,
|
|
2007
|
-
onChange: (
|
|
2202
|
+
onChange: (E, V) => w(V),
|
|
2008
2203
|
onVerify: C
|
|
2009
2204
|
}
|
|
2010
2205
|
),
|
|
2011
2206
|
a && /* @__PURE__ */ c("div", { className: "univer-mt-1 univer-text-xs univer-text-red-500", children: a })
|
|
2012
2207
|
] }),
|
|
2013
|
-
/* @__PURE__ */ c(
|
|
2208
|
+
/* @__PURE__ */ c(
|
|
2209
|
+
"div",
|
|
2210
|
+
{
|
|
2211
|
+
className: `
|
|
2212
|
+
univer-mt-4 univer-text-sm univer-text-gray-600
|
|
2213
|
+
dark:univer-text-gray-200
|
|
2214
|
+
`,
|
|
2215
|
+
children: e.t("sheet.cf.panel.styleType")
|
|
2216
|
+
}
|
|
2217
|
+
),
|
|
2014
2218
|
/* @__PURE__ */ c(
|
|
2015
2219
|
le,
|
|
2016
2220
|
{
|
|
2017
2221
|
className: "univer-mt-4 univer-w-full",
|
|
2018
2222
|
value: f,
|
|
2019
2223
|
options: v,
|
|
2020
|
-
onChange: (
|
|
2224
|
+
onChange: (E) => S(E)
|
|
2021
2225
|
}
|
|
2022
2226
|
),
|
|
2023
2227
|
/* @__PURE__ */ c(
|
|
@@ -2028,17 +2232,17 @@ const Me = (t) => {
|
|
|
2028
2232
|
onChange: R
|
|
2029
2233
|
}
|
|
2030
2234
|
),
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */ c(Jt, { onClick:
|
|
2235
|
+
/* @__PURE__ */ k("div", { className: "univer-mt-4 univer-flex univer-justify-end", children: [
|
|
2236
|
+
/* @__PURE__ */ c(Jt, { onClick: g, children: e.t("sheet.cf.panel.cancel") }),
|
|
2033
2237
|
/* @__PURE__ */ c(Jt, { className: "univer-ml-3", variant: "primary", onClick: x, children: e.t("sheet.cf.panel.submit") })
|
|
2034
2238
|
] })
|
|
2035
2239
|
] });
|
|
2036
2240
|
};
|
|
2037
|
-
var xi = Object.getOwnPropertyDescriptor,
|
|
2241
|
+
var xi = Object.getOwnPropertyDescriptor, wi = (t, e, r, n) => {
|
|
2038
2242
|
for (var i = n > 1 ? void 0 : n ? xi(e, r) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2039
2243
|
(o = t[s]) && (i = o(i) || i);
|
|
2040
2244
|
return i;
|
|
2041
|
-
},
|
|
2245
|
+
}, Ei = (t, e) => (r, n) => e(r, n, t);
|
|
2042
2246
|
let De = class extends ce {
|
|
2043
2247
|
constructor(e) {
|
|
2044
2248
|
super();
|
|
@@ -2076,8 +2280,8 @@ let De = class extends ce {
|
|
|
2076
2280
|
return [];
|
|
2077
2281
|
}
|
|
2078
2282
|
};
|
|
2079
|
-
De =
|
|
2080
|
-
|
|
2283
|
+
De = wi([
|
|
2284
|
+
Ei(0, O(re))
|
|
2081
2285
|
], De);
|
|
2082
2286
|
const Ni = (t, e) => {
|
|
2083
2287
|
const r = t.rule;
|
|
@@ -2090,42 +2294,42 @@ const Ni = (t, e) => {
|
|
|
2090
2294
|
return e.t("sheet.cf.ruleType.iconSet");
|
|
2091
2295
|
case U.highlightCell:
|
|
2092
2296
|
switch (r.subType) {
|
|
2093
|
-
case
|
|
2297
|
+
case F.average: {
|
|
2094
2298
|
const n = r.operator;
|
|
2095
2299
|
return e.t(`sheet.cf.preview.describe.${n}`, e.t("sheet.cf.subRuleType.average"));
|
|
2096
2300
|
}
|
|
2097
|
-
case
|
|
2301
|
+
case F.duplicateValues:
|
|
2098
2302
|
return e.t("sheet.cf.subRuleType.duplicateValues");
|
|
2099
|
-
case
|
|
2303
|
+
case F.uniqueValues:
|
|
2100
2304
|
return e.t("sheet.cf.subRuleType.uniqueValues");
|
|
2101
|
-
case
|
|
2305
|
+
case F.number: {
|
|
2102
2306
|
const n = r.operator;
|
|
2103
2307
|
return e.t(`sheet.cf.preview.describe.${n}`, ...Array.isArray(r.value) ? r.value.map((i) => String(i)) : [String(r.value || "")]);
|
|
2104
2308
|
}
|
|
2105
|
-
case
|
|
2309
|
+
case F.text: {
|
|
2106
2310
|
const n = r.operator;
|
|
2107
2311
|
return e.t(`sheet.cf.preview.describe.${n}`, r.value || "");
|
|
2108
2312
|
}
|
|
2109
|
-
case
|
|
2313
|
+
case F.timePeriod: {
|
|
2110
2314
|
const n = r.operator;
|
|
2111
2315
|
return e.t(`sheet.cf.preview.describe.${n}`);
|
|
2112
2316
|
}
|
|
2113
|
-
case
|
|
2317
|
+
case F.rank:
|
|
2114
2318
|
return r.isPercent ? r.isBottom ? e.t("sheet.cf.preview.describe.bottomNPercent", String(r.value)) : e.t("sheet.cf.preview.describe.topNPercent", String(r.value)) : r.isBottom ? e.t("sheet.cf.preview.describe.bottomN", String(r.value)) : e.t("sheet.cf.preview.describe.topN", String(r.value));
|
|
2115
|
-
case
|
|
2319
|
+
case F.formula:
|
|
2116
2320
|
return e.t("sheet.cf.ruleType.formula");
|
|
2117
2321
|
}
|
|
2118
2322
|
}
|
|
2119
2323
|
};
|
|
2120
2324
|
let dn = 0;
|
|
2121
2325
|
const Mi = (t) => {
|
|
2122
|
-
const { onClick: e } = t, r = W(Q), n = W(z), i = W($e), s = W(te), o = W(re), d = W(ve), a = W(
|
|
2326
|
+
const { onClick: e } = t, r = W(Q), n = W(z), i = W($e), s = W(te), o = W(re), d = W(ve), a = W(Fn), u = W(De), l = Dr(() => n.getCurrentTypeOfUnit$($.UNIVER_SHEET), void 0, void 0, []), h = l.getUnitId(), v = l.getActiveSheet();
|
|
2123
2327
|
if (!v)
|
|
2124
2328
|
throw new Error("No active sheet found");
|
|
2125
|
-
const f = v.getSheetId(), [S, p] = N([]), [T, _] = N("2"), [R,
|
|
2329
|
+
const f = v.getSheetId(), [S, p] = N([]), [T, _] = N("2"), [R, w] = N(0), [x, g] = N(-1), [C, b] = N(dn), y = de(null), M = [
|
|
2126
2330
|
{ label: o.t("sheet.cf.panel.workSheet"), value: "2" },
|
|
2127
2331
|
{ label: o.t("sheet.cf.panel.selectedRange"), value: "1" }
|
|
2128
|
-
],
|
|
2332
|
+
], E = () => {
|
|
2129
2333
|
const D = r.getSubunitRules(h, f);
|
|
2130
2334
|
if (!D || !D.length)
|
|
2131
2335
|
return [];
|
|
@@ -2138,32 +2342,32 @@ const Mi = (t) => {
|
|
|
2138
2342
|
} else if (T === "2")
|
|
2139
2343
|
return [...D];
|
|
2140
2344
|
return [];
|
|
2141
|
-
}, [V, L] = N(
|
|
2345
|
+
}, [V, L] = N(E);
|
|
2142
2346
|
Kr(S), K(() => {
|
|
2143
2347
|
const D = s.onCommandExecuted((B) => {
|
|
2144
|
-
B.id === qt.id &&
|
|
2348
|
+
B.id === qt.id && w(Math.random());
|
|
2145
2349
|
});
|
|
2146
2350
|
return () => D.dispose();
|
|
2147
2351
|
}), K(() => {
|
|
2148
|
-
L(
|
|
2352
|
+
L(E);
|
|
2149
2353
|
}, [T, R, h, f]), K(() => {
|
|
2150
2354
|
if (T === "2")
|
|
2151
2355
|
return;
|
|
2152
2356
|
const D = new xe((B) => {
|
|
2153
|
-
const G = [
|
|
2357
|
+
const G = [wr.id, se.id, be.id, Se.id, Tn.id], Z = s.onCommandExecuted((ee) => {
|
|
2154
2358
|
const { id: ne, params: Ie } = ee, _e = n.getCurrentUnitOfType($.UNIVER_SHEET).getUnitId();
|
|
2155
2359
|
G.includes(ne) && Ie.unitId === _e && B.next(null);
|
|
2156
2360
|
});
|
|
2157
2361
|
return () => Z.dispose();
|
|
2158
2362
|
}).pipe(tn(16)).subscribe(() => {
|
|
2159
|
-
L(
|
|
2363
|
+
L(E);
|
|
2160
2364
|
});
|
|
2161
2365
|
return () => {
|
|
2162
2366
|
D.unsubscribe();
|
|
2163
2367
|
};
|
|
2164
2368
|
}, [n, T, h, f]), K(() => {
|
|
2165
2369
|
const D = r.$ruleChange.subscribe(() => {
|
|
2166
|
-
|
|
2370
|
+
w(Math.random());
|
|
2167
2371
|
});
|
|
2168
2372
|
return () => D.unsubscribe();
|
|
2169
2373
|
}, [r]), K(() => {
|
|
@@ -2175,12 +2379,12 @@ const Mi = (t) => {
|
|
|
2175
2379
|
const ee = a.getContainer();
|
|
2176
2380
|
if (ee) {
|
|
2177
2381
|
let ne = setTimeout(() => {
|
|
2178
|
-
Z.next();
|
|
2382
|
+
Z.next(void 0);
|
|
2179
2383
|
}, 150);
|
|
2180
2384
|
const Ie = () => {
|
|
2181
2385
|
ne && clearTimeout(ne), ne = null;
|
|
2182
2386
|
}, _e = (lt) => {
|
|
2183
|
-
lt.propertyName === "width" && (Ie(), Z.next());
|
|
2387
|
+
lt.propertyName === "width" && (Ie(), Z.next(void 0));
|
|
2184
2388
|
};
|
|
2185
2389
|
return ee.addEventListener("transitionend", _e), () => {
|
|
2186
2390
|
Ie(), ee.removeEventListener("transitionend", _e);
|
|
@@ -2193,17 +2397,17 @@ const Mi = (t) => {
|
|
|
2193
2397
|
G.unsubscribe();
|
|
2194
2398
|
};
|
|
2195
2399
|
}, []);
|
|
2196
|
-
const
|
|
2400
|
+
const m = (D) => {
|
|
2197
2401
|
var Z;
|
|
2198
2402
|
const B = n.getCurrentUnitOfType($.UNIVER_SHEET).getUnitId(), G = (Z = n.getCurrentUnitOfType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : Z.getSheetId();
|
|
2199
2403
|
if (!B || !G)
|
|
2200
2404
|
throw new Error("No active sheet found");
|
|
2201
2405
|
s.executeCommand(Kt.id, { unitId: B, subUnitId: G, cfId: D.cfId });
|
|
2202
2406
|
}, I = (D, B) => {
|
|
2203
|
-
|
|
2407
|
+
g(B.y);
|
|
2204
2408
|
}, H = (D, B, G) => {
|
|
2205
2409
|
var lt;
|
|
2206
|
-
|
|
2410
|
+
g(-1);
|
|
2207
2411
|
const Z = n.getCurrentUnitOfType($.UNIVER_SHEET).getUnitId(), ee = (lt = n.getCurrentUnitOfType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : lt.getSheetId();
|
|
2208
2412
|
if (!Z || !ee)
|
|
2209
2413
|
throw new Error("No active sheet found");
|
|
@@ -2214,25 +2418,25 @@ const Mi = (t) => {
|
|
|
2214
2418
|
Ie !== _e && s.executeCommand(yr.id, { unitId: Z, subUnitId: ee, start: { id: Ie, type: "self" }, end: { id: _e, type: G.y > B.y ? "after" : "before" } });
|
|
2215
2419
|
}, Y = () => {
|
|
2216
2420
|
t.onCreate();
|
|
2217
|
-
},
|
|
2421
|
+
}, ge = () => {
|
|
2218
2422
|
T === "2" ? s.executeCommand(Rn.id) : T === "1" && V.map((B) => ({ unitId: h, subUnitId: f, cfId: B.cfId })).forEach((B) => {
|
|
2219
2423
|
s.executeCommand(Kt.id, B);
|
|
2220
2424
|
});
|
|
2221
|
-
},
|
|
2425
|
+
}, me = J(() => {
|
|
2222
2426
|
const D = n.getCurrentUnitOfType($.UNIVER_SHEET), B = D.getActiveSheet();
|
|
2223
2427
|
return V.filter((G) => {
|
|
2224
2428
|
const Z = G.ranges;
|
|
2225
2429
|
return ft(d, D.getUnitId(), B.getSheetId(), Z);
|
|
2226
2430
|
});
|
|
2227
|
-
}, [V]),
|
|
2431
|
+
}, [V]), ke = me.map((D, B) => ({ i: D.cfId, x: 0, w: 12, y: B, h: 1, isResizable: !1 })), Fe = J(() => {
|
|
2228
2432
|
const D = n.getCurrentUnitOfType($.UNIVER_SHEET), B = D.getActiveSheet();
|
|
2229
2433
|
return V.every((G) => {
|
|
2230
2434
|
const Z = G.ranges;
|
|
2231
2435
|
return ft(d, D.getUnitId(), B.getSheetId(), Z);
|
|
2232
2436
|
});
|
|
2233
2437
|
}, [V]);
|
|
2234
|
-
return /* @__PURE__ */
|
|
2235
|
-
/* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ k("div", { children: [
|
|
2439
|
+
/* @__PURE__ */ k("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm", children: [
|
|
2236
2440
|
/* @__PURE__ */ c("div", { className: "univer-flex univer-items-center univer-gap-2", children: u.tWithReactNode(
|
|
2237
2441
|
"sheet.cf.panel.managerRuleSelect",
|
|
2238
2442
|
/* @__PURE__ */ c(
|
|
@@ -2247,7 +2451,7 @@ const Mi = (t) => {
|
|
|
2247
2451
|
}
|
|
2248
2452
|
)
|
|
2249
2453
|
).map((D, B) => /* @__PURE__ */ c("span", { children: D }, B)) }),
|
|
2250
|
-
/* @__PURE__ */
|
|
2454
|
+
/* @__PURE__ */ k("div", { className: "univer-flex univer-justify-end", children: [
|
|
2251
2455
|
/* @__PURE__ */ c(Qt, { title: o.t("sheet.cf.panel.createRule"), placement: "bottom", children: /* @__PURE__ */ c(
|
|
2252
2456
|
"a",
|
|
2253
2457
|
{
|
|
@@ -2256,14 +2460,14 @@ const Mi = (t) => {
|
|
|
2256
2460
|
children: /* @__PURE__ */ c(Yn, {})
|
|
2257
2461
|
}
|
|
2258
2462
|
) }),
|
|
2259
|
-
V.length &&
|
|
2463
|
+
V.length && Fe ? /* @__PURE__ */ c(Qt, { title: o.t("sheet.cf.panel.clear"), placement: "bottom", children: /* @__PURE__ */ c(
|
|
2260
2464
|
"a",
|
|
2261
2465
|
{
|
|
2262
2466
|
className: "univer-size-5 univer-cursor-pointer",
|
|
2263
|
-
onClick:
|
|
2264
|
-
children: /* @__PURE__ */ c(
|
|
2467
|
+
onClick: ge,
|
|
2468
|
+
children: /* @__PURE__ */ c(gt, { className: "univer-text-red-500" })
|
|
2265
2469
|
}
|
|
2266
|
-
) }) : /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
2470
|
+
) }) : /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(gt, { className: "univer-text-gray-300" }) })
|
|
2267
2471
|
] })
|
|
2268
2472
|
] }),
|
|
2269
2473
|
/* @__PURE__ */ c("div", { ref: y, children: C > 0 && /* @__PURE__ */ c(
|
|
@@ -2274,14 +2478,14 @@ const Mi = (t) => {
|
|
|
2274
2478
|
[&_.react-grid-placeholder]:univer-rounded [&_.react-grid-placeholder]:!univer-bg-gray-200
|
|
2275
2479
|
`,
|
|
2276
2480
|
draggableHandle: ".draggableHandle",
|
|
2277
|
-
layout:
|
|
2481
|
+
layout: ke,
|
|
2278
2482
|
cols: 12,
|
|
2279
2483
|
rowHeight: 60,
|
|
2280
2484
|
width: C,
|
|
2281
2485
|
margin: [0, 10],
|
|
2282
2486
|
onDragStop: H,
|
|
2283
2487
|
onDragStart: I,
|
|
2284
|
-
children:
|
|
2488
|
+
children: me == null ? void 0 : me.map((D, B) => /* @__PURE__ */ c("div", { children: /* @__PURE__ */ k(
|
|
2285
2489
|
"div",
|
|
2286
2490
|
{
|
|
2287
2491
|
className: X(`
|
|
@@ -2312,14 +2516,23 @@ const Mi = (t) => {
|
|
|
2312
2516
|
children: /* @__PURE__ */ c(Kn, {})
|
|
2313
2517
|
}
|
|
2314
2518
|
),
|
|
2315
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ k(
|
|
2316
2520
|
"div",
|
|
2317
2521
|
{
|
|
2318
2522
|
className: `
|
|
2319
2523
|
univer-min-w-0 univer-max-w-full univer-flex-shrink univer-overflow-hidden
|
|
2320
2524
|
`,
|
|
2321
2525
|
children: [
|
|
2322
|
-
/* @__PURE__ */ c(
|
|
2526
|
+
/* @__PURE__ */ c(
|
|
2527
|
+
"div",
|
|
2528
|
+
{
|
|
2529
|
+
className: `
|
|
2530
|
+
univer-text-sm univer-text-gray-900
|
|
2531
|
+
dark:univer-text-white
|
|
2532
|
+
`,
|
|
2533
|
+
children: Ni(D, o)
|
|
2534
|
+
}
|
|
2535
|
+
),
|
|
2323
2536
|
/* @__PURE__ */ c("div", { className: "univer-text-xs univer-text-gray-400", children: D.ranges.map((G) => Un(G)).join(",") })
|
|
2324
2537
|
]
|
|
2325
2538
|
}
|
|
@@ -2338,9 +2551,9 @@ const Mi = (t) => {
|
|
|
2338
2551
|
"univer-flex univer-items-center univer-justify-center": x === B
|
|
2339
2552
|
}),
|
|
2340
2553
|
onClick: (G) => {
|
|
2341
|
-
G.stopPropagation(),
|
|
2554
|
+
G.stopPropagation(), m(D), p([]);
|
|
2342
2555
|
},
|
|
2343
|
-
children: /* @__PURE__ */ c(
|
|
2556
|
+
children: /* @__PURE__ */ c(gt, {})
|
|
2344
2557
|
}
|
|
2345
2558
|
)
|
|
2346
2559
|
]
|
|
@@ -2359,8 +2572,8 @@ const Mi = (t) => {
|
|
|
2359
2572
|
i(!0);
|
|
2360
2573
|
} }) });
|
|
2361
2574
|
};
|
|
2362
|
-
var
|
|
2363
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
2575
|
+
var ki = Object.getOwnPropertyDescriptor, Fi = (t, e, r, n) => {
|
|
2576
|
+
for (var i = n > 1 ? void 0 : n ? ki(e, r) : e, s = t.length - 1, o; s >= 0; s--)
|
|
2364
2577
|
(o = t[s]) && (i = o(i) || i);
|
|
2365
2578
|
return i;
|
|
2366
2579
|
}, qe = (t, e) => (r, n) => e(r, n, t);
|
|
@@ -2397,15 +2610,15 @@ let Qe = class extends ce {
|
|
|
2397
2610
|
this._componentManager.register(ht, Vi);
|
|
2398
2611
|
}
|
|
2399
2612
|
};
|
|
2400
|
-
Qe =
|
|
2613
|
+
Qe = Fi([
|
|
2401
2614
|
qe(0, z),
|
|
2402
2615
|
qe(1, O(ve)),
|
|
2403
2616
|
qe(2, O(zt)),
|
|
2404
|
-
qe(3, O(
|
|
2617
|
+
qe(3, O(Fn)),
|
|
2405
2618
|
qe(4, O(re))
|
|
2406
2619
|
], Qe);
|
|
2407
2620
|
var ie = /* @__PURE__ */ ((t) => (t[t.createRule = 1] = "createRule", t[t.viewRule = 2] = "viewRule", t[t.highlightCell = 3] = "highlightCell", t[t.rank = 4] = "rank", t[t.formula = 5] = "formula", t[t.colorScale = 6] = "colorScale", t[t.dataBar = 7] = "dataBar", t[t.icon = 8] = "icon", t[t.clearRangeRules = 9] = "clearRangeRules", t[t.clearWorkSheetRules = 10] = "clearWorkSheetRules", t))(ie || {});
|
|
2408
|
-
const
|
|
2621
|
+
const kt = {
|
|
2409
2622
|
id: "sheet.operation.open.conditional.formatting.panel",
|
|
2410
2623
|
type: he.OPERATION,
|
|
2411
2624
|
handler: (t, e) => {
|
|
@@ -2422,7 +2635,7 @@ const Ft = {
|
|
|
2422
2635
|
ranges: s,
|
|
2423
2636
|
rule: {
|
|
2424
2637
|
type: U.highlightCell,
|
|
2425
|
-
subType:
|
|
2638
|
+
subType: F.rank
|
|
2426
2639
|
}
|
|
2427
2640
|
};
|
|
2428
2641
|
r.openPanel(a);
|
|
@@ -2434,7 +2647,7 @@ const Ft = {
|
|
|
2434
2647
|
ranges: s,
|
|
2435
2648
|
rule: {
|
|
2436
2649
|
type: U.highlightCell,
|
|
2437
|
-
subType:
|
|
2650
|
+
subType: F.formula,
|
|
2438
2651
|
value: "="
|
|
2439
2652
|
}
|
|
2440
2653
|
};
|
|
@@ -2522,7 +2735,7 @@ let et = class extends ce {
|
|
|
2522
2735
|
);
|
|
2523
2736
|
}
|
|
2524
2737
|
_collectConditionalRule(e, r, n) {
|
|
2525
|
-
const i = new
|
|
2738
|
+
const i = new we(), s = {};
|
|
2526
2739
|
this._copyInfo = {
|
|
2527
2740
|
matrix: i,
|
|
2528
2741
|
info: {
|
|
@@ -2531,7 +2744,7 @@ let et = class extends ce {
|
|
|
2531
2744
|
cfMap: s
|
|
2532
2745
|
}
|
|
2533
2746
|
};
|
|
2534
|
-
const o = this._injector.invoke((l) =>
|
|
2747
|
+
const o = this._injector.invoke((l) => Er(n, l, e, r));
|
|
2535
2748
|
if (!o)
|
|
2536
2749
|
return;
|
|
2537
2750
|
const { rows: d, cols: a } = o, u = /* @__PURE__ */ new Set();
|
|
@@ -2563,30 +2776,30 @@ let et = class extends ce {
|
|
|
2563
2776
|
))
|
|
2564
2777
|
return { redos: [], undos: [] };
|
|
2565
2778
|
const { ranges: [a, u], mapFunc: l } = Pn([r.copyRange, e]), h = Jr(a, u, !0), v = {};
|
|
2566
|
-
pe.foreach(u, (
|
|
2567
|
-
const { row: b, col: y } = l(
|
|
2568
|
-
M && M.forEach((
|
|
2569
|
-
if (!v[
|
|
2570
|
-
const V = new
|
|
2571
|
-
v[
|
|
2572
|
-
const L = this._conditionalFormattingRuleModel.getRule(s, o,
|
|
2573
|
-
L == null || L.ranges.forEach((
|
|
2574
|
-
pe.foreach(
|
|
2779
|
+
pe.foreach(u, (g, C) => {
|
|
2780
|
+
const { row: b, col: y } = l(g, C), M = this._conditionalFormattingViewModel.getCellCfs(s, o, b, y);
|
|
2781
|
+
M && M.forEach((E) => {
|
|
2782
|
+
if (!v[E.cfId]) {
|
|
2783
|
+
const V = new we();
|
|
2784
|
+
v[E.cfId] = V;
|
|
2785
|
+
const L = this._conditionalFormattingRuleModel.getRule(s, o, E.cfId);
|
|
2786
|
+
L == null || L.ranges.forEach((m) => {
|
|
2787
|
+
pe.foreach(m, (I, H) => {
|
|
2575
2788
|
V.setValue(I, H, 1);
|
|
2576
2789
|
});
|
|
2577
2790
|
});
|
|
2578
2791
|
}
|
|
2579
|
-
v[
|
|
2792
|
+
v[E.cfId].realDeleteValue(b, y);
|
|
2580
2793
|
});
|
|
2581
2794
|
});
|
|
2582
2795
|
const { matrix: f, info: S } = this._copyInfo, p = [];
|
|
2583
2796
|
let T = this._conditionalFormattingRuleModel.createCfId(s, o);
|
|
2584
|
-
const _ = {}, R = (
|
|
2585
|
-
if (_[
|
|
2586
|
-
return _[
|
|
2587
|
-
const C = S == null ? void 0 : S.cfMap[
|
|
2797
|
+
const _ = {}, R = (g) => {
|
|
2798
|
+
if (_[g])
|
|
2799
|
+
return _[g];
|
|
2800
|
+
const C = S == null ? void 0 : S.cfMap[g], b = [...this._conditionalFormattingRuleModel.getSubunitRules(s, o) || [], ...p].find((y) => Wt.diffValue(y.rule, C));
|
|
2588
2801
|
if (b)
|
|
2589
|
-
return _[
|
|
2802
|
+
return _[g] = b, b;
|
|
2590
2803
|
{
|
|
2591
2804
|
const y = {
|
|
2592
2805
|
rule: C,
|
|
@@ -2594,10 +2807,10 @@ let et = class extends ce {
|
|
|
2594
2807
|
ranges: [],
|
|
2595
2808
|
stopIfTrue: !1
|
|
2596
2809
|
};
|
|
2597
|
-
return _[
|
|
2810
|
+
return _[g] = y, p.push(y), T = `${Number(T) + 1}`, y;
|
|
2598
2811
|
}
|
|
2599
2812
|
};
|
|
2600
|
-
h.forEach((
|
|
2813
|
+
h.forEach((g) => {
|
|
2601
2814
|
f && f.forValue((C, b, y) => {
|
|
2602
2815
|
const M = fe.getPositionRange(
|
|
2603
2816
|
{
|
|
@@ -2606,41 +2819,41 @@ let et = class extends ce {
|
|
|
2606
2819
|
startColumn: b,
|
|
2607
2820
|
endColumn: b
|
|
2608
2821
|
},
|
|
2609
|
-
|
|
2610
|
-
), { row:
|
|
2822
|
+
g.startRange
|
|
2823
|
+
), { row: E, col: V } = l(M.startRow, M.startColumn);
|
|
2611
2824
|
y.forEach((L) => {
|
|
2612
2825
|
if (!v[L]) {
|
|
2613
|
-
const
|
|
2614
|
-
v[L] = I,
|
|
2615
|
-
pe.foreach(H, (Y,
|
|
2616
|
-
I.setValue(Y,
|
|
2826
|
+
const m = R(L), I = new we();
|
|
2827
|
+
v[L] = I, m.ranges.forEach((H) => {
|
|
2828
|
+
pe.foreach(H, (Y, ge) => {
|
|
2829
|
+
I.setValue(Y, ge, 1);
|
|
2617
2830
|
});
|
|
2618
2831
|
});
|
|
2619
2832
|
}
|
|
2620
|
-
v[L].setValue(
|
|
2833
|
+
v[L].setValue(E, V, 1);
|
|
2621
2834
|
});
|
|
2622
2835
|
});
|
|
2623
2836
|
});
|
|
2624
|
-
const
|
|
2625
|
-
for (const
|
|
2626
|
-
const C = v[
|
|
2837
|
+
const w = [], x = [];
|
|
2838
|
+
for (const g in v) {
|
|
2839
|
+
const C = v[g], b = pt(Ct(C));
|
|
2627
2840
|
if (!b.length) {
|
|
2628
2841
|
const y = {
|
|
2629
2842
|
unitId: s,
|
|
2630
2843
|
subUnitId: o,
|
|
2631
|
-
cfId:
|
|
2844
|
+
cfId: g
|
|
2632
2845
|
};
|
|
2633
|
-
|
|
2846
|
+
w.push({ id: Se.id, params: y }), x.push(...Le(this._injector, y));
|
|
2634
2847
|
}
|
|
2635
|
-
if (p.some((y) => y.cfId ===
|
|
2636
|
-
const y = R(
|
|
2848
|
+
if (p.some((y) => y.cfId === g)) {
|
|
2849
|
+
const y = R(g), M = {
|
|
2637
2850
|
unitId: s,
|
|
2638
2851
|
subUnitId: o,
|
|
2639
2852
|
rule: { ...y, ranges: b }
|
|
2640
2853
|
};
|
|
2641
|
-
|
|
2854
|
+
w.push({ id: se.id, params: M }), x.push(xn(this._injector, M));
|
|
2642
2855
|
} else {
|
|
2643
|
-
const y = this._conditionalFormattingRuleModel.getRule(s, o,
|
|
2856
|
+
const y = this._conditionalFormattingRuleModel.getRule(s, o, g);
|
|
2644
2857
|
if (!y)
|
|
2645
2858
|
continue;
|
|
2646
2859
|
const M = {
|
|
@@ -2648,11 +2861,11 @@ let et = class extends ce {
|
|
|
2648
2861
|
subUnitId: o,
|
|
2649
2862
|
rule: { ...y, ranges: b }
|
|
2650
2863
|
};
|
|
2651
|
-
|
|
2864
|
+
w.push({ id: be.id, params: M }), x.push(...Ae(this._injector, M));
|
|
2652
2865
|
}
|
|
2653
2866
|
}
|
|
2654
2867
|
return {
|
|
2655
|
-
redos:
|
|
2868
|
+
redos: w,
|
|
2656
2869
|
undos: x
|
|
2657
2870
|
};
|
|
2658
2871
|
}
|
|
@@ -2677,7 +2890,7 @@ let tt = class extends ce {
|
|
|
2677
2890
|
this.disposeWithMe(
|
|
2678
2891
|
this._commandService.beforeCommandExecuted((t) => {
|
|
2679
2892
|
t.id === _n.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
2680
|
-
workbookTypes: [
|
|
2893
|
+
workbookTypes: [kn],
|
|
2681
2894
|
rangeTypes: [Vn],
|
|
2682
2895
|
worksheetTypes: [Nn, Mn]
|
|
2683
2896
|
}, t.params.rule.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
|
@@ -2784,7 +2997,7 @@ let rt = class extends ce {
|
|
|
2784
2997
|
).subscribe(() => this._markDirtySkeleton()));
|
|
2785
2998
|
}
|
|
2786
2999
|
_initViewModelInterceptor() {
|
|
2787
|
-
this.disposeWithMe(this._sheetInterceptorService.intercept(
|
|
3000
|
+
this.disposeWithMe(this._sheetInterceptorService.intercept(kr.CELL_CONTENT, {
|
|
2788
3001
|
effect: cr.Style,
|
|
2789
3002
|
handler: (e, r, n) => {
|
|
2790
3003
|
const i = this._conditionalFormattingService.composeStyle(r.unitId, r.subUnitId, r.row, r.col);
|
|
@@ -2799,7 +3012,7 @@ let rt = class extends ce {
|
|
|
2799
3012
|
};
|
|
2800
3013
|
rt = ji([
|
|
2801
3014
|
Pe(0, O(Gt)),
|
|
2802
|
-
Pe(1, O(
|
|
3015
|
+
Pe(1, O(wn)),
|
|
2803
3016
|
Pe(2, O(z)),
|
|
2804
3017
|
Pe(3, O(An)),
|
|
2805
3018
|
Pe(4, O(it)),
|
|
@@ -2832,7 +3045,7 @@ let St = class extends Sn {
|
|
|
2832
3045
|
qn,
|
|
2833
3046
|
Gn,
|
|
2834
3047
|
zn,
|
|
2835
|
-
|
|
3048
|
+
kt
|
|
2836
3049
|
].forEach((t) => {
|
|
2837
3050
|
this._commandService.registerCommand(t);
|
|
2838
3051
|
});
|
|
@@ -2841,7 +3054,7 @@ let St = class extends Sn {
|
|
|
2841
3054
|
Qn(St, "pluginName", `${st}_MOBILE_UI_PLUGIN`);
|
|
2842
3055
|
Qn(St, "type", $.UNIVER_SHEET);
|
|
2843
3056
|
St = qi([
|
|
2844
|
-
yn(
|
|
3057
|
+
yn(En),
|
|
2845
3058
|
Dt(1, O(ve)),
|
|
2846
3059
|
Dt(2, O(te)),
|
|
2847
3060
|
Dt(3, bn)
|
|
@@ -2890,48 +3103,48 @@ let It = class extends ce {
|
|
|
2890
3103
|
endRow: S
|
|
2891
3104
|
},
|
|
2892
3105
|
v
|
|
2893
|
-
), { row: R, col:
|
|
3106
|
+
), { row: R, col: w } = a(T.startRow, T.startColumn), x = this._conditionalFormattingViewModel.getCellCfs(
|
|
2894
3107
|
u,
|
|
2895
3108
|
l,
|
|
2896
3109
|
R,
|
|
2897
|
-
|
|
2898
|
-
), { row:
|
|
3110
|
+
w
|
|
3111
|
+
), { row: g, col: C } = a(_.startRow, _.startColumn), b = this._conditionalFormattingViewModel.getCellCfs(
|
|
2899
3112
|
u,
|
|
2900
3113
|
l,
|
|
2901
|
-
|
|
3114
|
+
g,
|
|
2902
3115
|
C
|
|
2903
3116
|
);
|
|
2904
3117
|
b && b.forEach((y) => {
|
|
2905
3118
|
let M = d.get(y.cfId);
|
|
2906
3119
|
if (!d.get(y.cfId)) {
|
|
2907
|
-
const
|
|
2908
|
-
if (!
|
|
3120
|
+
const E = this._conditionalFormattingRuleModel.getRule(u, l, y.cfId);
|
|
3121
|
+
if (!E)
|
|
2909
3122
|
return;
|
|
2910
|
-
M = new
|
|
2911
|
-
pe.foreach(V, (L,
|
|
2912
|
-
M.setValue(L,
|
|
3123
|
+
M = new we(), E.ranges.forEach((V) => {
|
|
3124
|
+
pe.foreach(V, (L, m) => {
|
|
3125
|
+
M.setValue(L, m, 1);
|
|
2913
3126
|
});
|
|
2914
3127
|
}), d.set(y.cfId, M);
|
|
2915
3128
|
}
|
|
2916
|
-
M.realDeleteValue(
|
|
3129
|
+
M.realDeleteValue(g, C);
|
|
2917
3130
|
}), x && x.forEach((y) => {
|
|
2918
3131
|
let M = d.get(y.cfId);
|
|
2919
3132
|
if (!d.get(y.cfId)) {
|
|
2920
|
-
const
|
|
2921
|
-
if (!
|
|
3133
|
+
const E = this._conditionalFormattingRuleModel.getRule(u, l, y.cfId);
|
|
3134
|
+
if (!E)
|
|
2922
3135
|
return;
|
|
2923
|
-
M = new
|
|
2924
|
-
pe.foreach(V, (L,
|
|
2925
|
-
M.setValue(L,
|
|
3136
|
+
M = new we(), E.ranges.forEach((V) => {
|
|
3137
|
+
pe.foreach(V, (L, m) => {
|
|
3138
|
+
M.setValue(L, m, 1);
|
|
2926
3139
|
});
|
|
2927
3140
|
}), d.set(y.cfId, M);
|
|
2928
3141
|
}
|
|
2929
|
-
M.setValue(
|
|
3142
|
+
M.setValue(g, C, 1);
|
|
2930
3143
|
});
|
|
2931
3144
|
});
|
|
2932
3145
|
}, r = (i, s) => {
|
|
2933
|
-
var _, R,
|
|
2934
|
-
const o = (_ = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : _.getUnitId(), d = (
|
|
3146
|
+
var _, R, w;
|
|
3147
|
+
const o = (_ = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : _.getUnitId(), d = (w = (R = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : R.getActiveSheet()) == null ? void 0 : w.getSheetId(), a = /* @__PURE__ */ new Map(), u = [], l = [];
|
|
2935
3148
|
if (!o || !d)
|
|
2936
3149
|
return t();
|
|
2937
3150
|
const h = Pn([i, s]), [v, f] = h.ranges, { mapFunc: S } = h, p = {
|
|
@@ -2940,8 +3153,8 @@ let It = class extends ce {
|
|
|
2940
3153
|
};
|
|
2941
3154
|
return ei(v, f).forEach((x) => {
|
|
2942
3155
|
e(p, x.repeatStartCell, x.relativeRange, a, S);
|
|
2943
|
-
}), a.forEach((x,
|
|
2944
|
-
const C = this._conditionalFormattingRuleModel.getRule(o, d,
|
|
3156
|
+
}), a.forEach((x, g) => {
|
|
3157
|
+
const C = this._conditionalFormattingRuleModel.getRule(o, d, g);
|
|
2945
3158
|
if (!C)
|
|
2946
3159
|
return;
|
|
2947
3160
|
const b = pt(Ct(x));
|
|
@@ -2998,7 +3211,7 @@ let _t = class extends ce {
|
|
|
2998
3211
|
getMutations: (t) => {
|
|
2999
3212
|
var i;
|
|
3000
3213
|
const e = [], r = [], n = { redos: e, undos: r };
|
|
3001
|
-
if ([
|
|
3214
|
+
if ([Fr.id, Ur.id].includes(t.id)) {
|
|
3002
3215
|
const s = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((f) => f.range);
|
|
3003
3216
|
if (!s)
|
|
3004
3217
|
return n;
|
|
@@ -3109,9 +3322,9 @@ let Tt = class extends ce {
|
|
|
3109
3322
|
};
|
|
3110
3323
|
Tt = Xi([
|
|
3111
3324
|
vn(0, O(Gt)),
|
|
3112
|
-
vn(1, O(
|
|
3325
|
+
vn(1, O(wn))
|
|
3113
3326
|
], Tt);
|
|
3114
|
-
const
|
|
3327
|
+
const gn = [
|
|
3115
3328
|
qt.id,
|
|
3116
3329
|
se.id,
|
|
3117
3330
|
be.id,
|
|
@@ -3197,7 +3410,7 @@ const mn = [
|
|
|
3197
3410
|
const l = r.onCommandExecuted((h) => {
|
|
3198
3411
|
var p;
|
|
3199
3412
|
const { id: v, params: f } = h, S = (p = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : p.getUnitId();
|
|
3200
|
-
|
|
3413
|
+
gn.includes(v) && f.unitId === S && u.next(null);
|
|
3201
3414
|
});
|
|
3202
3415
|
return () => l.dispose();
|
|
3203
3416
|
})
|
|
@@ -3214,7 +3427,7 @@ const mn = [
|
|
|
3214
3427
|
const l = r.onCommandExecuted((h) => {
|
|
3215
3428
|
var p;
|
|
3216
3429
|
const { id: v, params: f } = h, S = (p = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : p.getUnitId();
|
|
3217
|
-
|
|
3430
|
+
gn.includes(v) && f.unitId === S && u.next(null);
|
|
3218
3431
|
});
|
|
3219
3432
|
return () => l.dispose();
|
|
3220
3433
|
}).pipe(rn(16)).subscribe(() => {
|
|
@@ -3238,17 +3451,17 @@ const mn = [
|
|
|
3238
3451
|
}), a.next(Ye);
|
|
3239
3452
|
});
|
|
3240
3453
|
return {
|
|
3241
|
-
id:
|
|
3454
|
+
id: kt.id,
|
|
3242
3455
|
type: jr.SELECTOR,
|
|
3243
3456
|
icon: "Conditions",
|
|
3244
3457
|
tooltip: "sheet.cf.title",
|
|
3245
3458
|
selections: d,
|
|
3246
3459
|
hidden$: $r(t, $.UNIVER_SHEET),
|
|
3247
|
-
disabled$: ti(t, { workbookTypes: [
|
|
3460
|
+
disabled$: ti(t, { workbookTypes: [kn], worksheetTypes: [Mn, Nn], rangeTypes: [Vn] })
|
|
3248
3461
|
};
|
|
3249
3462
|
}, Qi = {
|
|
3250
3463
|
[Hr.FORMULAS_INSERT]: {
|
|
3251
|
-
[
|
|
3464
|
+
[kt.id]: {
|
|
3252
3465
|
order: 0,
|
|
3253
3466
|
menuItemFactory: Ji
|
|
3254
3467
|
}
|
|
@@ -3258,7 +3471,7 @@ var es = Object.getOwnPropertyDescriptor, ts = (t, e, r, n) => {
|
|
|
3258
3471
|
for (var i = n > 1 ? void 0 : n ? es(e, r) : e, s = t.length - 1, o; s >= 0; s--)
|
|
3259
3472
|
(o = t[s]) && (i = o(i) || i);
|
|
3260
3473
|
return i;
|
|
3261
|
-
},
|
|
3474
|
+
}, mn = (t, e) => (r, n) => e(r, n, t);
|
|
3262
3475
|
let Rt = class extends ce {
|
|
3263
3476
|
constructor(e, r) {
|
|
3264
3477
|
super();
|
|
@@ -3267,8 +3480,8 @@ let Rt = class extends ce {
|
|
|
3267
3480
|
}
|
|
3268
3481
|
};
|
|
3269
3482
|
Rt = ts([
|
|
3270
|
-
|
|
3271
|
-
|
|
3483
|
+
mn(0, O(ve)),
|
|
3484
|
+
mn(1, Br)
|
|
3272
3485
|
], Rt);
|
|
3273
3486
|
var ns = Object.getOwnPropertyDescriptor, rs = (t, e, r, n) => {
|
|
3274
3487
|
for (var i = n > 1 ? void 0 : n ? ns(e, r) : e, s = t.length - 1, o; s >= 0; s--)
|
|
@@ -3333,7 +3546,7 @@ let xt = class extends ce {
|
|
|
3333
3546
|
endRow: T
|
|
3334
3547
|
},
|
|
3335
3548
|
S
|
|
3336
|
-
),
|
|
3549
|
+
), w = fe.getPositionRange(
|
|
3337
3550
|
{
|
|
3338
3551
|
startRow: T,
|
|
3339
3552
|
startColumn: _,
|
|
@@ -3346,28 +3559,28 @@ let xt = class extends ce {
|
|
|
3346
3559
|
h,
|
|
3347
3560
|
R.startRow,
|
|
3348
3561
|
R.startColumn
|
|
3349
|
-
),
|
|
3562
|
+
), g = this._conditionalFormattingViewModel.getCellCfs(
|
|
3350
3563
|
v,
|
|
3351
3564
|
f,
|
|
3352
|
-
|
|
3353
|
-
|
|
3565
|
+
w.startRow,
|
|
3566
|
+
w.startColumn
|
|
3354
3567
|
);
|
|
3355
|
-
|
|
3568
|
+
g && g.forEach((C) => {
|
|
3356
3569
|
let b = a.get(C.cfId);
|
|
3357
3570
|
if (!a.get(C.cfId)) {
|
|
3358
3571
|
const y = this._conditionalFormattingRuleModel.getRule(v, f, C.cfId);
|
|
3359
3572
|
if (!y)
|
|
3360
3573
|
return;
|
|
3361
|
-
b = new
|
|
3362
|
-
pe.foreach(M, (
|
|
3363
|
-
b.setValue(
|
|
3574
|
+
b = new we(), y.ranges.forEach((M) => {
|
|
3575
|
+
pe.foreach(M, (E, V) => {
|
|
3576
|
+
b.setValue(E, V, 1);
|
|
3364
3577
|
});
|
|
3365
3578
|
}), a.set(C.cfId, b);
|
|
3366
3579
|
}
|
|
3367
|
-
b.realDeleteValue(
|
|
3580
|
+
b.realDeleteValue(w.startRow, w.startColumn);
|
|
3368
3581
|
}), x && x.forEach((C) => {
|
|
3369
3582
|
const b = a.get(C.cfId);
|
|
3370
|
-
b && b.setValue(
|
|
3583
|
+
b && b.setValue(w.startRow, w.startColumn, 1);
|
|
3371
3584
|
});
|
|
3372
3585
|
});
|
|
3373
3586
|
}, n = (s, o, d) => {
|
|
@@ -3376,39 +3589,39 @@ let xt = class extends ce {
|
|
|
3376
3589
|
if (!s || !o || !u || !l)
|
|
3377
3590
|
return e();
|
|
3378
3591
|
const p = (R = this._conditionalFormattingRuleModel.getSubunitRules(u, l)) != null ? R : [];
|
|
3379
|
-
p == null || p.forEach((
|
|
3380
|
-
const { ranges: x, cfId:
|
|
3592
|
+
p == null || p.forEach((w) => {
|
|
3593
|
+
const { ranges: x, cfId: g } = w;
|
|
3381
3594
|
if (x.some((C) => fe.intersects(a, C))) {
|
|
3382
|
-
const C = new
|
|
3595
|
+
const C = new we();
|
|
3383
3596
|
h || x.forEach((b) => {
|
|
3384
3597
|
pe.foreach(b, (y, M) => {
|
|
3385
3598
|
C.setValue(y, M, 1);
|
|
3386
3599
|
});
|
|
3387
|
-
}), v.set(
|
|
3600
|
+
}), v.set(g, C);
|
|
3388
3601
|
}
|
|
3389
3602
|
});
|
|
3390
3603
|
const T = {
|
|
3391
3604
|
row: a.startRow,
|
|
3392
3605
|
col: a.startColumn
|
|
3393
3606
|
};
|
|
3394
|
-
return is(a, d).forEach((
|
|
3395
|
-
r(T, { row:
|
|
3396
|
-
}), v.forEach((
|
|
3607
|
+
return is(a, d).forEach((w) => {
|
|
3608
|
+
r(T, { row: w.startRange.startRow, col: w.startRange.startColumn }, w.repeatRelativeRange, v, { targetUnitId: s, targetSubUnitId: o });
|
|
3609
|
+
}), v.forEach((w, x) => {
|
|
3397
3610
|
if (h) {
|
|
3398
|
-
const
|
|
3399
|
-
if (
|
|
3611
|
+
const g = this._conditionalFormattingRuleModel.getRule(s, o, x), C = pt(Ct(w));
|
|
3612
|
+
if (g)
|
|
3400
3613
|
if (C.length) {
|
|
3401
3614
|
const b = {
|
|
3402
3615
|
unitId: s,
|
|
3403
3616
|
subUnitId: o,
|
|
3404
|
-
rule: { ...
|
|
3617
|
+
rule: { ...g, ranges: C }
|
|
3405
3618
|
};
|
|
3406
3619
|
f.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
|
|
3407
3620
|
} else {
|
|
3408
3621
|
const b = {
|
|
3409
3622
|
unitId: s,
|
|
3410
3623
|
subUnitId: o,
|
|
3411
|
-
cfId:
|
|
3624
|
+
cfId: g.cfId
|
|
3412
3625
|
};
|
|
3413
3626
|
f.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
|
|
3414
3627
|
}
|
|
@@ -3428,22 +3641,22 @@ let xt = class extends ce {
|
|
|
3428
3641
|
}
|
|
3429
3642
|
}
|
|
3430
3643
|
} else {
|
|
3431
|
-
const
|
|
3432
|
-
if (!
|
|
3644
|
+
const g = this._conditionalFormattingRuleModel.getRule(u, l, x);
|
|
3645
|
+
if (!g)
|
|
3433
3646
|
return;
|
|
3434
|
-
const C = pt(Ct(
|
|
3647
|
+
const C = pt(Ct(w));
|
|
3435
3648
|
if (C.length) {
|
|
3436
3649
|
const b = {
|
|
3437
3650
|
unitId: u,
|
|
3438
3651
|
subUnitId: l,
|
|
3439
|
-
rule: { ...
|
|
3652
|
+
rule: { ...g, ranges: C }
|
|
3440
3653
|
};
|
|
3441
3654
|
f.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
|
|
3442
3655
|
} else {
|
|
3443
3656
|
const b = {
|
|
3444
3657
|
unitId: u,
|
|
3445
3658
|
subUnitId: l,
|
|
3446
|
-
cfId:
|
|
3659
|
+
cfId: g.cfId
|
|
3447
3660
|
};
|
|
3448
3661
|
f.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
|
|
3449
3662
|
}
|
|
@@ -3490,7 +3703,7 @@ var ss = Object.getOwnPropertyDescriptor, os = (t, e, r, n) => {
|
|
|
3490
3703
|
(o = t[s]) && (i = o(i) || i);
|
|
3491
3704
|
return i;
|
|
3492
3705
|
}, $t = (t, e) => (r, n) => e(r, n, t);
|
|
3493
|
-
let
|
|
3706
|
+
let wt = class extends ce {
|
|
3494
3707
|
constructor(t, e, r) {
|
|
3495
3708
|
super(), this._conditionalFormattingViewModel = t, this._univerInstanceService = e, this._renderManagerService = r, this._init();
|
|
3496
3709
|
}
|
|
@@ -3512,17 +3725,17 @@ let Et = class extends ce {
|
|
|
3512
3725
|
});
|
|
3513
3726
|
}
|
|
3514
3727
|
};
|
|
3515
|
-
|
|
3728
|
+
wt = os([
|
|
3516
3729
|
$t(0, O(it)),
|
|
3517
3730
|
$t(1, z),
|
|
3518
3731
|
$t(2, An)
|
|
3519
|
-
],
|
|
3732
|
+
], wt);
|
|
3520
3733
|
var as = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, cs = (t, e, r) => e in t ? as(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, us = (t, e, r, n) => {
|
|
3521
3734
|
for (var i = n > 1 ? void 0 : n ? ls(e, r) : e, s = t.length - 1, o; s >= 0; s--)
|
|
3522
3735
|
(o = t[s]) && (i = o(i) || i);
|
|
3523
3736
|
return i;
|
|
3524
3737
|
}, jt = (t, e) => (r, n) => e(r, n, t), er = (t, e, r) => cs(t, typeof e != "symbol" ? e + "" : e, r);
|
|
3525
|
-
let
|
|
3738
|
+
let Et = class extends Sn {
|
|
3526
3739
|
constructor(t = bt, e, r, n) {
|
|
3527
3740
|
super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
|
|
3528
3741
|
const { menu: i, ...s } = In(
|
|
@@ -3545,19 +3758,19 @@ let wt = class extends Sn {
|
|
|
3545
3758
|
[Tt],
|
|
3546
3759
|
[_t],
|
|
3547
3760
|
[xt],
|
|
3548
|
-
[
|
|
3549
|
-
]),
|
|
3761
|
+
[wt]
|
|
3762
|
+
]), Ft(this._injector, [
|
|
3550
3763
|
[rt]
|
|
3551
3764
|
]);
|
|
3552
3765
|
}
|
|
3553
3766
|
onReady() {
|
|
3554
|
-
|
|
3767
|
+
Ft(this._injector, [
|
|
3555
3768
|
[Rt],
|
|
3556
3769
|
[Qe]
|
|
3557
3770
|
]);
|
|
3558
3771
|
}
|
|
3559
3772
|
onRendered() {
|
|
3560
|
-
|
|
3773
|
+
Ft(this._injector, [
|
|
3561
3774
|
[It],
|
|
3562
3775
|
[_t],
|
|
3563
3776
|
[et],
|
|
@@ -3566,7 +3779,7 @@ let wt = class extends Sn {
|
|
|
3566
3779
|
[xt],
|
|
3567
3780
|
[tt],
|
|
3568
3781
|
[nt],
|
|
3569
|
-
[
|
|
3782
|
+
[wt]
|
|
3570
3783
|
]);
|
|
3571
3784
|
}
|
|
3572
3785
|
_initCommand() {
|
|
@@ -3580,20 +3793,20 @@ let wt = class extends Sn {
|
|
|
3580
3793
|
qn,
|
|
3581
3794
|
Gn,
|
|
3582
3795
|
zn,
|
|
3583
|
-
|
|
3796
|
+
kt
|
|
3584
3797
|
].forEach((t) => {
|
|
3585
3798
|
this._commandService.registerCommand(t);
|
|
3586
3799
|
});
|
|
3587
3800
|
}
|
|
3588
3801
|
};
|
|
3589
|
-
er(
|
|
3590
|
-
er(
|
|
3591
|
-
|
|
3592
|
-
yn(
|
|
3802
|
+
er(Et, "pluginName", `${st}_UI_PLUGIN`);
|
|
3803
|
+
er(Et, "type", $.UNIVER_SHEET);
|
|
3804
|
+
Et = us([
|
|
3805
|
+
yn(En),
|
|
3593
3806
|
jt(1, O(ve)),
|
|
3594
3807
|
jt(2, O(te)),
|
|
3595
3808
|
jt(3, bn)
|
|
3596
|
-
],
|
|
3809
|
+
], Et);
|
|
3597
3810
|
export {
|
|
3598
3811
|
Dn as AddAverageCfCommand,
|
|
3599
3812
|
$n as AddColorScaleConditionalRuleCommand,
|
|
@@ -3605,7 +3818,7 @@ export {
|
|
|
3605
3818
|
Gn as AddTimePeriodCfCommand,
|
|
3606
3819
|
zn as AddUniqueValuesCfCommand,
|
|
3607
3820
|
_t as ConditionalFormattingClearController,
|
|
3608
|
-
|
|
3821
|
+
kt as OpenConditionalFormattingOperator,
|
|
3609
3822
|
St as UniverSheetsConditionalFormattingMobileUIPlugin,
|
|
3610
|
-
|
|
3823
|
+
Et as UniverSheetsConditionalFormattingUIPlugin
|
|
3611
3824
|
};
|