@univerjs/sheets-conditional-formatting-ui 0.7.0 → 0.8.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -2
- package/lib/es/index.js +592 -590
- package/lib/index.css +1 -1
- package/lib/index.js +592 -590
- package/lib/types/components/wrapper-error/WrapperError.d.ts +2 -2
- package/lib/types/locale/en-US.d.ts +174 -2
- package/lib/types/locale/fa-IR.d.ts +2 -2
- package/lib/types/locale/ru-RU.d.ts +2 -2
- package/lib/types/locale/vi-VN.d.ts +2 -2
- package/lib/types/locale/zh-CN.d.ts +2 -174
- package/lib/types/locale/zh-TW.d.ts +2 -2
- package/lib/umd/index.js +1 -2
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var ye = (t, e, r) => ir(t, typeof e != "symbol" ? e + "" : e, r);
|
|
|
4
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
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
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,
|
|
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, RibbonDataGroup as Hr, IMenuManagerService as Br } from "@univerjs/ui";
|
|
8
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";
|
|
@@ -20,11 +20,11 @@ const Dn = {
|
|
|
20
20
|
handler(t, e) {
|
|
21
21
|
if (!e)
|
|
22
22
|
return !1;
|
|
23
|
-
const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(te), a = t.get(z),
|
|
24
|
-
if (!
|
|
25
|
-
const { unitId: l, subUnitId:
|
|
23
|
+
const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(te), a = t.get(z), h = Ce(a);
|
|
24
|
+
if (!h) return !1;
|
|
25
|
+
const { unitId: l, subUnitId: u } = h, g = o.createCfId(l, u), p = {
|
|
26
26
|
ranges: r,
|
|
27
|
-
cfId:
|
|
27
|
+
cfId: g,
|
|
28
28
|
stopIfTrue: !!i,
|
|
29
29
|
rule: {
|
|
30
30
|
type: U.highlightCell,
|
|
@@ -33,7 +33,7 @@ const Dn = {
|
|
|
33
33
|
style: n
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
return d.executeCommand(se.id, { unitId: l, subUnitId:
|
|
36
|
+
return d.executeCommand(se.id, { unitId: l, subUnitId: u, rule: p });
|
|
37
37
|
}
|
|
38
38
|
}, $n = {
|
|
39
39
|
type: he.COMMAND,
|
|
@@ -43,16 +43,16 @@ const Dn = {
|
|
|
43
43
|
return !1;
|
|
44
44
|
const { ranges: r, config: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(te), d = t.get(z), a = Ce(d);
|
|
45
45
|
if (!a) return !1;
|
|
46
|
-
const { unitId:
|
|
46
|
+
const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
|
|
47
47
|
ranges: r,
|
|
48
|
-
cfId:
|
|
48
|
+
cfId: u,
|
|
49
49
|
stopIfTrue: !!i,
|
|
50
50
|
rule: {
|
|
51
51
|
type: U.colorScale,
|
|
52
52
|
config: n
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
return o.executeCommand(se.id, { unitId:
|
|
55
|
+
return o.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
|
|
56
56
|
}
|
|
57
57
|
}, jn = {
|
|
58
58
|
type: he.COMMAND,
|
|
@@ -60,15 +60,15 @@ const Dn = {
|
|
|
60
60
|
handler(t, e) {
|
|
61
61
|
if (!e)
|
|
62
62
|
return !1;
|
|
63
|
-
const { ranges: r, min: n, max: i, nativeColor: s, positiveColor: o, isGradient: d, stopIfTrue: a, isShowValue:
|
|
64
|
-
if (!
|
|
65
|
-
const { unitId:
|
|
63
|
+
const { ranges: r, min: n, max: i, nativeColor: s, positiveColor: o, isGradient: d, stopIfTrue: a, isShowValue: h } = e, l = t.get(Q), u = t.get(z), g = Ce(u);
|
|
64
|
+
if (!g) return !1;
|
|
65
|
+
const { unitId: p, subUnitId: S } = g, f = t.get(te), T = l.createCfId(p, S), _ = {
|
|
66
66
|
ranges: r,
|
|
67
67
|
cfId: T,
|
|
68
68
|
stopIfTrue: !!a,
|
|
69
69
|
rule: {
|
|
70
70
|
type: U.dataBar,
|
|
71
|
-
isShowValue:
|
|
71
|
+
isShowValue: h,
|
|
72
72
|
config: {
|
|
73
73
|
min: n,
|
|
74
74
|
max: i,
|
|
@@ -78,7 +78,7 @@ const Dn = {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
return
|
|
81
|
+
return f.executeCommand(se.id, { unitId: p, subUnitId: S, rule: _ });
|
|
82
82
|
}
|
|
83
83
|
}, Hn = {
|
|
84
84
|
type: he.COMMAND,
|
|
@@ -88,9 +88,9 @@ const Dn = {
|
|
|
88
88
|
return !1;
|
|
89
89
|
const { ranges: r, style: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(te), d = t.get(z), a = Ce(d);
|
|
90
90
|
if (!a) return !1;
|
|
91
|
-
const { unitId:
|
|
91
|
+
const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
|
|
92
92
|
ranges: r,
|
|
93
|
-
cfId:
|
|
93
|
+
cfId: u,
|
|
94
94
|
stopIfTrue: !!i,
|
|
95
95
|
rule: {
|
|
96
96
|
type: U.highlightCell,
|
|
@@ -98,7 +98,7 @@ const Dn = {
|
|
|
98
98
|
style: n
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
return o.executeCommand(se.id, { unitId:
|
|
101
|
+
return o.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
|
|
102
102
|
}
|
|
103
103
|
}, Bn = {
|
|
104
104
|
type: he.COMMAND,
|
|
@@ -106,44 +106,44 @@ const Dn = {
|
|
|
106
106
|
handler(t, e) {
|
|
107
107
|
if (!e)
|
|
108
108
|
return !1;
|
|
109
|
-
const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(te),
|
|
109
|
+
const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(te), h = t.get(z), l = Ce(h);
|
|
110
110
|
if (!l) return !1;
|
|
111
|
-
const { unitId:
|
|
111
|
+
const { unitId: u, subUnitId: g } = l, p = d.createCfId(u, g);
|
|
112
112
|
let S;
|
|
113
113
|
if ([P.between, P.notBetween].includes(s)) {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
114
|
+
const f = o;
|
|
115
|
+
if (f.length !== 2 || !Array.isArray(f))
|
|
116
116
|
return !1;
|
|
117
117
|
S = {
|
|
118
118
|
ranges: r,
|
|
119
|
-
cfId:
|
|
119
|
+
cfId: p,
|
|
120
120
|
stopIfTrue: !!i,
|
|
121
121
|
rule: {
|
|
122
122
|
type: U.highlightCell,
|
|
123
123
|
subType: F.number,
|
|
124
124
|
operator: s,
|
|
125
125
|
style: n,
|
|
126
|
-
value:
|
|
126
|
+
value: f
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
} else {
|
|
130
|
-
const
|
|
131
|
-
if (typeof
|
|
130
|
+
const f = o;
|
|
131
|
+
if (typeof f != "number")
|
|
132
132
|
return !1;
|
|
133
133
|
S = {
|
|
134
134
|
ranges: r,
|
|
135
|
-
cfId:
|
|
135
|
+
cfId: p,
|
|
136
136
|
stopIfTrue: !!i,
|
|
137
137
|
rule: {
|
|
138
138
|
type: U.highlightCell,
|
|
139
139
|
subType: F.number,
|
|
140
140
|
operator: s,
|
|
141
141
|
style: n,
|
|
142
|
-
value:
|
|
142
|
+
value: f
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
return a.executeCommand(se.id, { unitId:
|
|
146
|
+
return a.executeCommand(se.id, { unitId: u, subUnitId: g, rule: S });
|
|
147
147
|
}
|
|
148
148
|
}, Wn = {
|
|
149
149
|
type: he.COMMAND,
|
|
@@ -151,9 +151,9 @@ const Dn = {
|
|
|
151
151
|
handler(t, e) {
|
|
152
152
|
if (!e)
|
|
153
153
|
return !1;
|
|
154
|
-
const { ranges: r, style: n, stopIfTrue: i, isPercent: s, isBottom: o, value: d } = e, a = t.get(Q),
|
|
155
|
-
if (!
|
|
156
|
-
const { unitId:
|
|
154
|
+
const { ranges: r, style: n, stopIfTrue: i, isPercent: s, isBottom: o, value: d } = e, a = t.get(Q), h = t.get(z), l = t.get(te), u = Ce(h);
|
|
155
|
+
if (!u) return !1;
|
|
156
|
+
const { unitId: g, subUnitId: p } = u, S = a.createCfId(g, p), f = {
|
|
157
157
|
ranges: r,
|
|
158
158
|
cfId: S,
|
|
159
159
|
stopIfTrue: !!i,
|
|
@@ -166,7 +166,7 @@ const Dn = {
|
|
|
166
166
|
value: d
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
|
-
return l.executeCommand(se.id, { unitId:
|
|
169
|
+
return l.executeCommand(se.id, { unitId: g, subUnitId: p, rule: f });
|
|
170
170
|
}
|
|
171
171
|
}, qn = {
|
|
172
172
|
type: he.COMMAND,
|
|
@@ -174,11 +174,11 @@ const Dn = {
|
|
|
174
174
|
handler(t, e) {
|
|
175
175
|
if (!e)
|
|
176
176
|
return !1;
|
|
177
|
-
const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(z),
|
|
178
|
-
if (!
|
|
179
|
-
const { unitId: l, subUnitId:
|
|
177
|
+
const { ranges: r, style: n, stopIfTrue: i, operator: s, value: o } = e, d = t.get(Q), a = t.get(z), h = Ce(a);
|
|
178
|
+
if (!h) return !1;
|
|
179
|
+
const { unitId: l, subUnitId: u } = h, g = t.get(te), p = d.createCfId(l, u), S = {
|
|
180
180
|
ranges: r,
|
|
181
|
-
cfId:
|
|
181
|
+
cfId: p,
|
|
182
182
|
stopIfTrue: !!i,
|
|
183
183
|
rule: {
|
|
184
184
|
type: U.highlightCell,
|
|
@@ -188,7 +188,7 @@ const Dn = {
|
|
|
188
188
|
value: o
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
return
|
|
191
|
+
return g.executeCommand(se.id, { unitId: l, subUnitId: u, rule: S });
|
|
192
192
|
}
|
|
193
193
|
}, Gn = {
|
|
194
194
|
type: he.COMMAND,
|
|
@@ -196,11 +196,11 @@ const Dn = {
|
|
|
196
196
|
handler(t, e) {
|
|
197
197
|
if (!e)
|
|
198
198
|
return !1;
|
|
199
|
-
const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(z), a = t.get(te),
|
|
200
|
-
if (!
|
|
201
|
-
const { unitId: l, subUnitId:
|
|
199
|
+
const { ranges: r, style: n, stopIfTrue: i, operator: s } = e, o = t.get(Q), d = t.get(z), a = t.get(te), h = Ce(d);
|
|
200
|
+
if (!h) return !1;
|
|
201
|
+
const { unitId: l, subUnitId: u } = h, g = o.createCfId(l, u), p = {
|
|
202
202
|
ranges: r,
|
|
203
|
-
cfId:
|
|
203
|
+
cfId: g,
|
|
204
204
|
stopIfTrue: !!i,
|
|
205
205
|
rule: {
|
|
206
206
|
type: U.highlightCell,
|
|
@@ -209,7 +209,7 @@ const Dn = {
|
|
|
209
209
|
style: n
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
|
-
return a.executeCommand(se.id, { unitId: l, subUnitId:
|
|
212
|
+
return a.executeCommand(se.id, { unitId: l, subUnitId: u, rule: p });
|
|
213
213
|
}
|
|
214
214
|
}, zn = {
|
|
215
215
|
type: he.COMMAND,
|
|
@@ -219,9 +219,9 @@ const Dn = {
|
|
|
219
219
|
return !1;
|
|
220
220
|
const { ranges: r, style: n, stopIfTrue: i } = e, s = t.get(Q), o = t.get(z), d = t.get(te), a = Ce(o);
|
|
221
221
|
if (!a) return !1;
|
|
222
|
-
const { unitId:
|
|
222
|
+
const { unitId: h, subUnitId: l } = a, u = s.createCfId(h, l), g = {
|
|
223
223
|
ranges: r,
|
|
224
|
-
cfId:
|
|
224
|
+
cfId: u,
|
|
225
225
|
stopIfTrue: !!i,
|
|
226
226
|
rule: {
|
|
227
227
|
type: U.highlightCell,
|
|
@@ -229,7 +229,7 @@ const Dn = {
|
|
|
229
229
|
style: n
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
return d.executeCommand(se.id, { unitId:
|
|
232
|
+
return d.executeCommand(se.id, { unitId: h, subUnitId: l, rule: g });
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
235
|
var oe = function() {
|
|
@@ -319,17 +319,17 @@ var hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em"
|
|
|
319
319
|
});
|
|
320
320
|
ot.displayName = "SlashSingle";
|
|
321
321
|
const Me = (t) => {
|
|
322
|
-
const { color: e, onChange: r, disable: n = !1, iconId: i = "PaintBucket", className: s, isNeedDropdownIcon: o = !0 } = t, d = W(zt), a = J(() => new fn(e), [e]),
|
|
323
|
-
return
|
|
322
|
+
const { color: e, onChange: r, disable: n = !1, iconId: i = "PaintBucket", className: s, isNeedDropdownIcon: o = !0 } = t, d = W(zt), a = J(() => new fn(e), [e]), h = d.get(i);
|
|
323
|
+
return h ? n ? /* @__PURE__ */ c(h, { className: X("univer-fill-primary-600", s), extend: { colorChannel1: a.isValid ? e : "" } }) : /* @__PURE__ */ c(
|
|
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
327
|
children: /* @__PURE__ */ k(
|
|
328
328
|
"span",
|
|
329
329
|
{
|
|
330
|
-
className: X("univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-p-1 hover:univer-bg-gray-100", s),
|
|
330
|
+
className: X("univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-p-1 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", s),
|
|
331
331
|
children: [
|
|
332
|
-
/* @__PURE__ */ c(
|
|
332
|
+
/* @__PURE__ */ c(h, { className: "univer-fill-primary-600", extend: { colorChannel1: a.isValid ? e : "" } }),
|
|
333
333
|
o && /* @__PURE__ */ c(
|
|
334
334
|
Vt,
|
|
335
335
|
{
|
|
@@ -342,67 +342,73 @@ const Me = (t) => {
|
|
|
342
342
|
}
|
|
343
343
|
) : null;
|
|
344
344
|
}, We = (t) => {
|
|
345
|
-
var s, o, d;
|
|
345
|
+
var s, o, d, a, h;
|
|
346
346
|
const e = t.rule;
|
|
347
347
|
if (!e) return null;
|
|
348
348
|
const r = J(() => {
|
|
349
349
|
if (e.type === U.colorScale) {
|
|
350
|
-
const
|
|
351
|
-
return new Array(5).fill("").map((
|
|
350
|
+
const l = e.config.map((p, S) => ({ color: new fn(p.color), value: S })), u = l.length - 1;
|
|
351
|
+
return new Array(5).fill("").map((p, S, f) => S * u / (f.length - 1)).map((p) => dr(l, p));
|
|
352
352
|
}
|
|
353
353
|
return null;
|
|
354
354
|
}, [e]), n = J(() => {
|
|
355
355
|
if (e.type === U.iconSet)
|
|
356
|
-
return e.config.map((
|
|
357
|
-
const u = Ee[
|
|
358
|
-
return u && u[Number(
|
|
356
|
+
return e.config.map((l) => {
|
|
357
|
+
const u = Ee[l.iconType];
|
|
358
|
+
return u && u[Number(l.iconId)];
|
|
359
359
|
});
|
|
360
|
-
}, [e]), i =
|
|
361
|
-
univer-justify-center univer-text-xs`;
|
|
360
|
+
}, [e]), i = "univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center univer-justify-center univer-text-xs";
|
|
362
361
|
switch (e.type) {
|
|
363
362
|
case U.dataBar: {
|
|
364
|
-
const { isGradient:
|
|
363
|
+
const { isGradient: l } = e.config, u = l ? `linear-gradient(to right, ${e.config.positiveColor || Ke}, rgb(255 255 255))` : e.config.positiveColor, g = l ? `linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor || Xe})` : e.config.nativeColor;
|
|
365
364
|
return /* @__PURE__ */ k("div", { className: i, children: [
|
|
366
365
|
/* @__PURE__ */ c(
|
|
367
366
|
"div",
|
|
368
367
|
{
|
|
369
|
-
className: "univer-h-full univer-w-1/2",
|
|
368
|
+
className: "univer-h-full univer-w-1/2 univer-border univer-border-solid",
|
|
370
369
|
style: {
|
|
371
|
-
background:
|
|
372
|
-
|
|
370
|
+
background: g,
|
|
371
|
+
borderColor: (s = e.config.nativeColor) != null ? s : Xe
|
|
373
372
|
}
|
|
374
373
|
}
|
|
375
374
|
),
|
|
376
375
|
/* @__PURE__ */ c(
|
|
377
376
|
"div",
|
|
378
377
|
{
|
|
379
|
-
className: "univer-h-full univer-w-1/2",
|
|
378
|
+
className: "univer-h-full univer-w-1/2 univer-border univer-border-solid",
|
|
380
379
|
style: {
|
|
381
380
|
background: u,
|
|
382
|
-
|
|
381
|
+
borderColor: (o = e.config.positiveColor) != null ? o : Ke
|
|
383
382
|
}
|
|
384
383
|
}
|
|
385
384
|
)
|
|
386
385
|
] });
|
|
387
386
|
}
|
|
388
387
|
case U.colorScale:
|
|
389
|
-
return r && /* @__PURE__ */ c("div", { className: i, children: r.map((
|
|
388
|
+
return r && /* @__PURE__ */ c("div", { className: i, children: r.map((l, u) => /* @__PURE__ */ c(
|
|
389
|
+
"div",
|
|
390
|
+
{
|
|
391
|
+
className: "univer-h-full",
|
|
392
|
+
style: { width: `${100 / r.length}%`, background: l }
|
|
393
|
+
},
|
|
394
|
+
u
|
|
395
|
+
)) });
|
|
390
396
|
case U.iconSet:
|
|
391
|
-
return n && /* @__PURE__ */ c("div", { className: i, children: n.map((
|
|
397
|
+
return n && /* @__PURE__ */ c("div", { className: i, children: n.map((l, u) => l ? /* @__PURE__ */ c("img", { className: "univer-h-full", src: l, draggable: !1 }, u) : /* @__PURE__ */ c(ot, {}, u)) });
|
|
392
398
|
case U.highlightCell: {
|
|
393
|
-
const { ul:
|
|
394
|
-
textDecoration: (
|
|
395
|
-
backgroundColor:
|
|
396
|
-
color:
|
|
399
|
+
const { ul: l, st: u, it: g, bl: p, bg: S, cl: f } = e.style, T = (l == null ? void 0 : l.s) === ae.TRUE, _ = (u == null ? void 0 : u.s) === ae.TRUE, R = g === ae.TRUE, w = p === ae.TRUE, x = (d = S == null ? void 0 : S.rgb) != null ? d : hr, v = (a = f == null ? void 0 : f.rgb) != null ? a : vr, C = {
|
|
400
|
+
textDecoration: (h = `${T ? "underline" : ""} ${_ ? "line-through" : ""}`.replace(/^ /, "")) != null ? h : void 0,
|
|
401
|
+
backgroundColor: x,
|
|
402
|
+
color: v
|
|
397
403
|
};
|
|
398
404
|
return /* @__PURE__ */ c(
|
|
399
405
|
"div",
|
|
400
406
|
{
|
|
401
407
|
className: X(i, {
|
|
402
|
-
"univer-font-bold":
|
|
403
|
-
"univer-italic":
|
|
408
|
+
"univer-font-bold": w,
|
|
409
|
+
"univer-italic": R
|
|
404
410
|
}),
|
|
405
|
-
style:
|
|
411
|
+
style: C,
|
|
406
412
|
children: "123"
|
|
407
413
|
}
|
|
408
414
|
);
|
|
@@ -410,46 +416,46 @@ const Me = (t) => {
|
|
|
410
416
|
}
|
|
411
417
|
}, at = X("univer-mt-5 univer-px-1 univer-py-2 univer-rounded", He), Re = (t, e) => ({ label: e.t(`sheet.cf.valueType.${t}`), value: t }), Lt = (t) => {
|
|
412
418
|
var S;
|
|
413
|
-
const { type: e, className: r, onChange: n, id: i, value: s } = t, o = W(z), d = o.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), a = (S = o.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : S.getSheetId(),
|
|
419
|
+
const { type: e, className: r, onChange: n, id: i, value: s } = t, o = W(z), d = o.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), a = (S = o.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : S.getSheetId(), h = J(() => String(s).startsWith("=") ? String(s) : "=", [s]), l = J(() => [A.max, A.min, "none"].includes(e) ? { disabled: !0 } : [A.percent, A.percentile].includes(e) ? {
|
|
414
420
|
min: 0,
|
|
415
421
|
max: 100
|
|
416
422
|
} : {
|
|
417
423
|
min: Number.MIN_SAFE_INTEGER,
|
|
418
424
|
max: Number.MAX_SAFE_INTEGER
|
|
419
|
-
}, [e]),
|
|
420
|
-
return Nt((
|
|
425
|
+
}, [e]), u = de(null), [g, p] = N(!1);
|
|
426
|
+
return Nt((f) => {
|
|
421
427
|
var _;
|
|
422
|
-
((_ =
|
|
428
|
+
((_ = u.current) == null ? void 0 : _.isClickOutSide(f)) && p(!1);
|
|
423
429
|
}), e === A.formula ? /* @__PURE__ */ c("div", { className: "univer-ml-1 univer-w-full", children: /* @__PURE__ */ c(
|
|
424
430
|
Mt,
|
|
425
431
|
{
|
|
426
|
-
ref:
|
|
427
|
-
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark
|
|
428
|
-
initValue:
|
|
432
|
+
ref: u,
|
|
433
|
+
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
|
|
434
|
+
initValue: h,
|
|
429
435
|
unitId: d,
|
|
430
436
|
subUnitId: a,
|
|
431
|
-
isFocus:
|
|
432
|
-
onChange: (
|
|
433
|
-
n(
|
|
437
|
+
isFocus: g,
|
|
438
|
+
onChange: (f = "") => {
|
|
439
|
+
n(f || "");
|
|
434
440
|
},
|
|
435
|
-
onFocus: () =>
|
|
441
|
+
onFocus: () => p(!0)
|
|
436
442
|
}
|
|
437
|
-
) }) : /* @__PURE__ */ c(Ne, { className: r, value: Number(t.value) || 0, onChange: (
|
|
443
|
+
) }) : /* @__PURE__ */ c(Ne, { className: r, value: Number(t.value) || 0, onChange: (f) => t.onChange(f || 0), ...l });
|
|
438
444
|
}, vi = (t) => {
|
|
439
445
|
var L;
|
|
440
|
-
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,
|
|
446
|
+
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, h] = N(() => {
|
|
441
447
|
var I;
|
|
442
448
|
const m = A.min;
|
|
443
449
|
return n && ((I = n.config[0]) == null ? void 0 : I.value.type) || m;
|
|
444
|
-
}), [l,
|
|
450
|
+
}), [l, u] = N(() => {
|
|
445
451
|
var I;
|
|
446
452
|
const m = "none";
|
|
447
453
|
return !n || n.config.length !== 3 ? m : ((I = n.config[1]) == null ? void 0 : I.value.type) || m;
|
|
448
|
-
}), [
|
|
454
|
+
}), [g, p] = N(() => {
|
|
449
455
|
var I;
|
|
450
456
|
const m = A.max;
|
|
451
457
|
return n && ((I = n.config[n.config.length - 1]) == null ? void 0 : I.value.type) || m;
|
|
452
|
-
}), [S,
|
|
458
|
+
}), [S, f] = N(() => {
|
|
453
459
|
if (!n)
|
|
454
460
|
return 10;
|
|
455
461
|
const I = n.config[0];
|
|
@@ -466,7 +472,7 @@ const Me = (t) => {
|
|
|
466
472
|
return 90;
|
|
467
473
|
const I = (H = n.config[n.config.length - 1]) == null ? void 0 : H.value.value;
|
|
468
474
|
return I === void 0 ? 90 : I;
|
|
469
|
-
}), [x,
|
|
475
|
+
}), [x, v] = N(() => {
|
|
470
476
|
var I;
|
|
471
477
|
const m = "#d0d9fb";
|
|
472
478
|
return n && ((I = n.config[0]) == null ? void 0 : I.color) || m;
|
|
@@ -484,9 +490,9 @@ const Me = (t) => {
|
|
|
484
490
|
}, []);
|
|
485
491
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
486
492
|
handler() {
|
|
487
|
-
return E({ minType: a, medianType: l, maxType:
|
|
493
|
+
return E({ minType: a, medianType: l, maxType: g, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y });
|
|
488
494
|
}
|
|
489
|
-
}), [E, a, l,
|
|
495
|
+
}), [E, a, l, g, S, T, R, x, C, y, e]);
|
|
490
496
|
const V = (m) => {
|
|
491
497
|
t.onChange(E(m));
|
|
492
498
|
};
|
|
@@ -494,15 +500,15 @@ const Me = (t) => {
|
|
|
494
500
|
/* @__PURE__ */ c(
|
|
495
501
|
"div",
|
|
496
502
|
{
|
|
497
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
503
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
498
504
|
children: r.t("sheet.cf.panel.styleRule")
|
|
499
505
|
}
|
|
500
506
|
),
|
|
501
|
-
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: E({ minType: a, medianType: l, maxType:
|
|
507
|
+
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: E({ minType: a, medianType: l, maxType: g, minValue: S, medianValue: T, maxValue: R, minColor: x, medianColor: C, maxColor: y }) }) }),
|
|
502
508
|
/* @__PURE__ */ c(
|
|
503
509
|
"div",
|
|
504
510
|
{
|
|
505
|
-
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark
|
|
511
|
+
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
|
|
506
512
|
children: r.t("sheet.cf.valueType.min")
|
|
507
513
|
}
|
|
508
514
|
),
|
|
@@ -514,12 +520,12 @@ const Me = (t) => {
|
|
|
514
520
|
options: s,
|
|
515
521
|
value: a,
|
|
516
522
|
onChange: (m) => {
|
|
517
|
-
|
|
523
|
+
h(m);
|
|
518
524
|
const I = Je(m, 10);
|
|
519
|
-
|
|
525
|
+
f(I), V({
|
|
520
526
|
minType: m,
|
|
521
527
|
medianType: l,
|
|
522
|
-
maxType:
|
|
528
|
+
maxType: g,
|
|
523
529
|
minValue: I,
|
|
524
530
|
medianValue: T,
|
|
525
531
|
maxValue: R,
|
|
@@ -538,10 +544,10 @@ const Me = (t) => {
|
|
|
538
544
|
value: S,
|
|
539
545
|
type: a,
|
|
540
546
|
onChange: (m) => {
|
|
541
|
-
|
|
547
|
+
f(m), V({
|
|
542
548
|
minType: a,
|
|
543
549
|
medianType: l,
|
|
544
|
-
maxType:
|
|
550
|
+
maxType: g,
|
|
545
551
|
minValue: m,
|
|
546
552
|
medianValue: T,
|
|
547
553
|
maxValue: R,
|
|
@@ -558,10 +564,10 @@ const Me = (t) => {
|
|
|
558
564
|
className: "univer-ml-1",
|
|
559
565
|
color: x,
|
|
560
566
|
onChange: (m) => {
|
|
561
|
-
|
|
567
|
+
v(m), V({
|
|
562
568
|
minType: a,
|
|
563
569
|
medianType: l,
|
|
564
|
-
maxType:
|
|
570
|
+
maxType: g,
|
|
565
571
|
minValue: S,
|
|
566
572
|
medianValue: T,
|
|
567
573
|
maxValue: R,
|
|
@@ -576,7 +582,7 @@ const Me = (t) => {
|
|
|
576
582
|
/* @__PURE__ */ c(
|
|
577
583
|
"div",
|
|
578
584
|
{
|
|
579
|
-
className: "univer-mt-3 univer-text-xs univer-text-gray-600dark
|
|
585
|
+
className: "univer-mt-3 univer-text-xs univer-text-gray-600dark:!univer-text-gray-200",
|
|
580
586
|
children: r.t("sheet.cf.panel.medianValue")
|
|
581
587
|
}
|
|
582
588
|
),
|
|
@@ -588,12 +594,12 @@ const Me = (t) => {
|
|
|
588
594
|
options: o,
|
|
589
595
|
value: l,
|
|
590
596
|
onChange: (m) => {
|
|
591
|
-
|
|
597
|
+
u(m);
|
|
592
598
|
const I = Je(m, 50);
|
|
593
599
|
_(I), V({
|
|
594
600
|
minType: a,
|
|
595
601
|
medianType: m,
|
|
596
|
-
maxType:
|
|
602
|
+
maxType: g,
|
|
597
603
|
minValue: S,
|
|
598
604
|
medianValue: I,
|
|
599
605
|
maxValue: R,
|
|
@@ -615,7 +621,7 @@ const Me = (t) => {
|
|
|
615
621
|
_(m), V({
|
|
616
622
|
minType: a,
|
|
617
623
|
medianType: l,
|
|
618
|
-
maxType:
|
|
624
|
+
maxType: g,
|
|
619
625
|
minValue: S,
|
|
620
626
|
medianValue: m,
|
|
621
627
|
maxValue: R,
|
|
@@ -635,7 +641,7 @@ const Me = (t) => {
|
|
|
635
641
|
b(m), V({
|
|
636
642
|
minType: a,
|
|
637
643
|
medianType: l,
|
|
638
|
-
maxType:
|
|
644
|
+
maxType: g,
|
|
639
645
|
minValue: S,
|
|
640
646
|
medianValue: T,
|
|
641
647
|
maxValue: R,
|
|
@@ -650,7 +656,7 @@ const Me = (t) => {
|
|
|
650
656
|
/* @__PURE__ */ c(
|
|
651
657
|
"div",
|
|
652
658
|
{
|
|
653
|
-
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark
|
|
659
|
+
className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
|
|
654
660
|
children: r.t("sheet.cf.valueType.max")
|
|
655
661
|
}
|
|
656
662
|
),
|
|
@@ -660,9 +666,9 @@ const Me = (t) => {
|
|
|
660
666
|
{
|
|
661
667
|
className: "univer-flex-shrink-0",
|
|
662
668
|
options: d,
|
|
663
|
-
value:
|
|
669
|
+
value: g,
|
|
664
670
|
onChange: (m) => {
|
|
665
|
-
|
|
671
|
+
p(m);
|
|
666
672
|
const I = Je(m, 90);
|
|
667
673
|
w(I), V({
|
|
668
674
|
minType: a,
|
|
@@ -684,12 +690,12 @@ const Me = (t) => {
|
|
|
684
690
|
id: "max",
|
|
685
691
|
className: "univer-ml-1",
|
|
686
692
|
value: R,
|
|
687
|
-
type:
|
|
693
|
+
type: g,
|
|
688
694
|
onChange: (m) => {
|
|
689
695
|
w(m), V({
|
|
690
696
|
minType: a,
|
|
691
697
|
medianType: l,
|
|
692
|
-
maxType:
|
|
698
|
+
maxType: g,
|
|
693
699
|
minValue: S,
|
|
694
700
|
medianValue: T,
|
|
695
701
|
maxValue: m,
|
|
@@ -709,7 +715,7 @@ const Me = (t) => {
|
|
|
709
715
|
M(m), V({
|
|
710
716
|
minType: a,
|
|
711
717
|
medianType: l,
|
|
712
|
-
maxType:
|
|
718
|
+
maxType: g,
|
|
713
719
|
minValue: S,
|
|
714
720
|
medianValue: T,
|
|
715
721
|
maxValue: R,
|
|
@@ -723,13 +729,13 @@ const Me = (t) => {
|
|
|
723
729
|
] })
|
|
724
730
|
] });
|
|
725
731
|
}, Ue = (t, e) => ({ label: e.t(`sheet.cf.valueType.${t}`), value: t }), sn = (t) => {
|
|
726
|
-
var
|
|
727
|
-
const { onChange: e, className: r, value: n, type: i, id: s, disabled: o = !1 } = t, d = W(z), a = d.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(),
|
|
732
|
+
var f;
|
|
733
|
+
const { onChange: e, className: r, value: n, type: i, id: s, disabled: o = !1 } = t, d = W(z), a = d.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), h = (f = d.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : f.getSheetId(), l = de(null), [u, g] = N(!1);
|
|
728
734
|
Nt((T) => {
|
|
729
735
|
var R;
|
|
730
|
-
((R = l.current) == null ? void 0 : R.isClickOutSide(T)) &&
|
|
736
|
+
((R = l.current) == null ? void 0 : R.isClickOutSide(T)) && g(!1);
|
|
731
737
|
});
|
|
732
|
-
const
|
|
738
|
+
const p = de(n), S = J(() => [A.percentile, A.percent].includes(i) ? {
|
|
733
739
|
max: 100,
|
|
734
740
|
min: 0
|
|
735
741
|
} : {
|
|
@@ -737,20 +743,20 @@ const Me = (t) => {
|
|
|
737
743
|
max: Number.MAX_SAFE_INTEGER
|
|
738
744
|
}, [i]);
|
|
739
745
|
if (i === A.formula) {
|
|
740
|
-
const T = String(
|
|
746
|
+
const T = String(p.current).startsWith("=") ? String(p.current) || "" : "=";
|
|
741
747
|
return /* @__PURE__ */ c("div", { className: "univer-ml-3 univer-w-full", children: /* @__PURE__ */ c(
|
|
742
748
|
Mt,
|
|
743
749
|
{
|
|
744
750
|
ref: l,
|
|
745
|
-
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark
|
|
751
|
+
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
|
|
746
752
|
initValue: T,
|
|
747
753
|
unitId: a,
|
|
748
|
-
subUnitId:
|
|
749
|
-
isFocus:
|
|
754
|
+
subUnitId: h,
|
|
755
|
+
isFocus: u,
|
|
750
756
|
onChange: (_ = "") => {
|
|
751
757
|
e(_ || "");
|
|
752
758
|
},
|
|
753
|
-
onFocus: () =>
|
|
759
|
+
onFocus: () => g(!0)
|
|
754
760
|
}
|
|
755
761
|
) });
|
|
756
762
|
}
|
|
@@ -775,16 +781,16 @@ const Me = (t) => {
|
|
|
775
781
|
}), [o, d] = N(() => {
|
|
776
782
|
var m;
|
|
777
783
|
return n ? ((m = n.config) == null ? void 0 : m.positiveColor) || Ke : Ke;
|
|
778
|
-
}), [a,
|
|
784
|
+
}), [a, h] = N(() => {
|
|
779
785
|
var m;
|
|
780
786
|
return n ? ((m = n.config) == null ? void 0 : m.nativeColor) || Xe : Xe;
|
|
781
|
-
}), l = [Ue(A.num, r), Ue(A.percent, r), Ue(A.percentile, r), Ue(A.formula, r)],
|
|
787
|
+
}), l = [Ue(A.num, r), Ue(A.percent, r), Ue(A.percentile, r), Ue(A.formula, r)], u = [Ue(A.min, r), ...l], g = [Ue(A.max, r), ...l], [p, S] = N(() => {
|
|
782
788
|
var I;
|
|
783
|
-
const m =
|
|
789
|
+
const m = u[0].value;
|
|
784
790
|
return n && ((I = n.config) == null ? void 0 : I.min.type) || m;
|
|
785
|
-
}), [
|
|
791
|
+
}), [f, T] = N(() => {
|
|
786
792
|
var I;
|
|
787
|
-
const m =
|
|
793
|
+
const m = g[0].value;
|
|
788
794
|
return n && ((I = n.config) == null ? void 0 : I.max.type) || m;
|
|
789
795
|
}), [_, R] = N(() => {
|
|
790
796
|
var H;
|
|
@@ -798,7 +804,7 @@ const Me = (t) => {
|
|
|
798
804
|
return 100;
|
|
799
805
|
const I = ((H = n.config) == null ? void 0 : H.max) || {};
|
|
800
806
|
return I.type === A.formula ? I.value || "=" : I.value === void 0 ? 100 : I.value;
|
|
801
|
-
}), [
|
|
807
|
+
}), [v, C] = N(() => n ? n.isShowValue === void 0 ? !0 : !!n.isShowValue : !0), b = (m) => ({ config: {
|
|
802
808
|
min: { type: m.minValueType, value: m.minValue },
|
|
803
809
|
max: { type: m.maxValueType, value: m.maxValue },
|
|
804
810
|
isGradient: m.isGradient === "1",
|
|
@@ -807,39 +813,39 @@ const Me = (t) => {
|
|
|
807
813
|
}, type: U.dataBar, isShowValue: m.isShowValue });
|
|
808
814
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
809
815
|
handler() {
|
|
810
|
-
return b({ isGradient: i, minValue: _, minValueType:
|
|
816
|
+
return b({ isGradient: i, minValue: _, minValueType: p, maxValue: w, maxValueType: f, positiveColor: o, nativeColor: a, isShowValue: v });
|
|
811
817
|
}
|
|
812
|
-
}), [i, _,
|
|
818
|
+
}), [i, _, p, w, f, o, a, e, v]);
|
|
813
819
|
const y = (m) => {
|
|
814
820
|
t.onChange(b(m));
|
|
815
821
|
}, M = (m) => {
|
|
816
822
|
d(m), y({
|
|
817
823
|
isGradient: i,
|
|
818
824
|
minValue: _,
|
|
819
|
-
minValueType:
|
|
825
|
+
minValueType: p,
|
|
820
826
|
maxValue: w,
|
|
821
|
-
maxValueType:
|
|
827
|
+
maxValueType: f,
|
|
822
828
|
positiveColor: m,
|
|
823
829
|
nativeColor: a,
|
|
824
|
-
isShowValue:
|
|
830
|
+
isShowValue: v
|
|
825
831
|
});
|
|
826
832
|
}, E = (m) => {
|
|
827
|
-
|
|
833
|
+
h(m), y({
|
|
828
834
|
isGradient: i,
|
|
829
835
|
minValue: _,
|
|
830
|
-
minValueType:
|
|
836
|
+
minValueType: p,
|
|
831
837
|
maxValue: w,
|
|
832
|
-
maxValueType:
|
|
838
|
+
maxValueType: f,
|
|
833
839
|
positiveColor: o,
|
|
834
840
|
nativeColor: m,
|
|
835
|
-
isShowValue:
|
|
841
|
+
isShowValue: v
|
|
836
842
|
});
|
|
837
843
|
}, V = (m) => l.map((I) => I.value).includes(m);
|
|
838
844
|
return /* @__PURE__ */ k("div", { children: [
|
|
839
845
|
/* @__PURE__ */ c(
|
|
840
846
|
"div",
|
|
841
847
|
{
|
|
842
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
848
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
843
849
|
children: r.t("sheet.cf.panel.styleRule")
|
|
844
850
|
}
|
|
845
851
|
),
|
|
@@ -849,12 +855,12 @@ const Me = (t) => {
|
|
|
849
855
|
rule: b({
|
|
850
856
|
isGradient: i,
|
|
851
857
|
minValue: _,
|
|
852
|
-
minValueType:
|
|
858
|
+
minValueType: p,
|
|
853
859
|
maxValue: w,
|
|
854
|
-
maxValueType:
|
|
860
|
+
maxValueType: f,
|
|
855
861
|
positiveColor: o,
|
|
856
862
|
nativeColor: a,
|
|
857
|
-
isShowValue:
|
|
863
|
+
isShowValue: v
|
|
858
864
|
})
|
|
859
865
|
}
|
|
860
866
|
) }),
|
|
@@ -862,7 +868,7 @@ const Me = (t) => {
|
|
|
862
868
|
/* @__PURE__ */ c(
|
|
863
869
|
"div",
|
|
864
870
|
{
|
|
865
|
-
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark
|
|
871
|
+
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
866
872
|
children: r.t("sheet.cf.panel.fillType")
|
|
867
873
|
}
|
|
868
874
|
),
|
|
@@ -875,12 +881,12 @@ const Me = (t) => {
|
|
|
875
881
|
s(m), y({
|
|
876
882
|
isGradient: m,
|
|
877
883
|
minValue: _,
|
|
878
|
-
minValueType:
|
|
884
|
+
minValueType: p,
|
|
879
885
|
maxValue: w,
|
|
880
|
-
maxValueType:
|
|
886
|
+
maxValueType: f,
|
|
881
887
|
positiveColor: o,
|
|
882
888
|
nativeColor: a,
|
|
883
|
-
isShowValue:
|
|
889
|
+
isShowValue: v
|
|
884
890
|
});
|
|
885
891
|
},
|
|
886
892
|
children: [
|
|
@@ -893,14 +899,14 @@ const Me = (t) => {
|
|
|
893
899
|
/* @__PURE__ */ c(
|
|
894
900
|
yt,
|
|
895
901
|
{
|
|
896
|
-
checked: !
|
|
902
|
+
checked: !v,
|
|
897
903
|
onChange: (m) => {
|
|
898
904
|
C(!m), y({
|
|
899
905
|
isGradient: m,
|
|
900
906
|
minValue: _,
|
|
901
|
-
minValueType:
|
|
907
|
+
minValueType: p,
|
|
902
908
|
maxValue: w,
|
|
903
|
-
maxValueType:
|
|
909
|
+
maxValueType: f,
|
|
904
910
|
positiveColor: o,
|
|
905
911
|
nativeColor: a,
|
|
906
912
|
isShowValue: !m
|
|
@@ -916,7 +922,7 @@ const Me = (t) => {
|
|
|
916
922
|
/* @__PURE__ */ c(
|
|
917
923
|
"div",
|
|
918
924
|
{
|
|
919
|
-
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark
|
|
925
|
+
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
920
926
|
children: r.t("sheet.cf.panel.colorSet")
|
|
921
927
|
}
|
|
922
928
|
),
|
|
@@ -947,7 +953,7 @@ const Me = (t) => {
|
|
|
947
953
|
/* @__PURE__ */ c(
|
|
948
954
|
"div",
|
|
949
955
|
{
|
|
950
|
-
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark
|
|
956
|
+
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
951
957
|
children: r.t("sheet.cf.valueType.min")
|
|
952
958
|
}
|
|
953
959
|
),
|
|
@@ -956,8 +962,8 @@ const Me = (t) => {
|
|
|
956
962
|
le,
|
|
957
963
|
{
|
|
958
964
|
className: "univer-w-1/2 univer-flex-shrink-0",
|
|
959
|
-
options:
|
|
960
|
-
value:
|
|
965
|
+
options: u,
|
|
966
|
+
value: p,
|
|
961
967
|
onChange: (m) => {
|
|
962
968
|
S(m);
|
|
963
969
|
const I = Je(m, 10);
|
|
@@ -966,10 +972,10 @@ const Me = (t) => {
|
|
|
966
972
|
minValue: I,
|
|
967
973
|
minValueType: m,
|
|
968
974
|
maxValue: w,
|
|
969
|
-
maxValueType:
|
|
975
|
+
maxValueType: f,
|
|
970
976
|
positiveColor: o,
|
|
971
977
|
nativeColor: a,
|
|
972
|
-
isShowValue:
|
|
978
|
+
isShowValue: v
|
|
973
979
|
});
|
|
974
980
|
}
|
|
975
981
|
}
|
|
@@ -979,19 +985,19 @@ const Me = (t) => {
|
|
|
979
985
|
{
|
|
980
986
|
id: "min",
|
|
981
987
|
className: "univer-ml-3",
|
|
982
|
-
disabled: !V(
|
|
983
|
-
type:
|
|
988
|
+
disabled: !V(p),
|
|
989
|
+
type: p,
|
|
984
990
|
value: _,
|
|
985
991
|
onChange: (m) => {
|
|
986
992
|
R(m || 0), y({
|
|
987
993
|
isGradient: i,
|
|
988
994
|
minValue: m || 0,
|
|
989
|
-
minValueType:
|
|
995
|
+
minValueType: p,
|
|
990
996
|
maxValue: w,
|
|
991
|
-
maxValueType:
|
|
997
|
+
maxValueType: f,
|
|
992
998
|
positiveColor: o,
|
|
993
999
|
nativeColor: a,
|
|
994
|
-
isShowValue:
|
|
1000
|
+
isShowValue: v
|
|
995
1001
|
});
|
|
996
1002
|
}
|
|
997
1003
|
}
|
|
@@ -1000,7 +1006,7 @@ const Me = (t) => {
|
|
|
1000
1006
|
/* @__PURE__ */ c(
|
|
1001
1007
|
"div",
|
|
1002
1008
|
{
|
|
1003
|
-
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark
|
|
1009
|
+
className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1004
1010
|
children: r.t("sheet.cf.valueType.max")
|
|
1005
1011
|
}
|
|
1006
1012
|
),
|
|
@@ -1009,20 +1015,20 @@ const Me = (t) => {
|
|
|
1009
1015
|
le,
|
|
1010
1016
|
{
|
|
1011
1017
|
className: "univer-w-1/2 univer-flex-shrink-0",
|
|
1012
|
-
options:
|
|
1013
|
-
value:
|
|
1018
|
+
options: g,
|
|
1019
|
+
value: f,
|
|
1014
1020
|
onChange: (m) => {
|
|
1015
1021
|
T(m);
|
|
1016
1022
|
const I = Je(m, 90);
|
|
1017
1023
|
x(I), y({
|
|
1018
1024
|
isGradient: i,
|
|
1019
1025
|
minValue: _,
|
|
1020
|
-
minValueType:
|
|
1026
|
+
minValueType: p,
|
|
1021
1027
|
maxValue: I,
|
|
1022
1028
|
maxValueType: m,
|
|
1023
1029
|
positiveColor: o,
|
|
1024
1030
|
nativeColor: a,
|
|
1025
|
-
isShowValue:
|
|
1031
|
+
isShowValue: v
|
|
1026
1032
|
});
|
|
1027
1033
|
}
|
|
1028
1034
|
}
|
|
@@ -1031,20 +1037,20 @@ const Me = (t) => {
|
|
|
1031
1037
|
sn,
|
|
1032
1038
|
{
|
|
1033
1039
|
className: "univer-ml-3",
|
|
1034
|
-
disabled: !V(
|
|
1040
|
+
disabled: !V(f),
|
|
1035
1041
|
id: "max",
|
|
1036
|
-
type:
|
|
1042
|
+
type: f,
|
|
1037
1043
|
value: w,
|
|
1038
1044
|
onChange: (m) => {
|
|
1039
1045
|
x(m || 0), y({
|
|
1040
1046
|
isGradient: i,
|
|
1041
1047
|
minValue: _,
|
|
1042
|
-
minValueType:
|
|
1048
|
+
minValueType: p,
|
|
1043
1049
|
maxValue: m || 0,
|
|
1044
|
-
maxValueType:
|
|
1050
|
+
maxValueType: f,
|
|
1045
1051
|
positiveColor: o,
|
|
1046
1052
|
nativeColor: a,
|
|
1047
|
-
isShowValue:
|
|
1053
|
+
isShowValue: v
|
|
1048
1054
|
});
|
|
1049
1055
|
}
|
|
1050
1056
|
}
|
|
@@ -1059,17 +1065,17 @@ const Me = (t) => {
|
|
|
1059
1065
|
}), [d, a] = N(() => {
|
|
1060
1066
|
if (e != null && e.it)
|
|
1061
1067
|
return e.it;
|
|
1062
|
-
}), [
|
|
1068
|
+
}), [h, l] = N(() => {
|
|
1063
1069
|
if (e != null && e.ul)
|
|
1064
1070
|
return e.ul.s;
|
|
1065
|
-
}), [
|
|
1071
|
+
}), [u, g] = N(() => {
|
|
1066
1072
|
if (e != null && e.st)
|
|
1067
1073
|
return e.st.s;
|
|
1068
|
-
}), [
|
|
1074
|
+
}), [p, S] = N(() => {
|
|
1069
1075
|
var b;
|
|
1070
1076
|
const C = "#2f56ef";
|
|
1071
1077
|
return (b = e == null ? void 0 : e.cl) != null && b.rgb ? e.cl.rgb : C;
|
|
1072
|
-
}), [
|
|
1078
|
+
}), [f, T] = N(() => {
|
|
1073
1079
|
var b;
|
|
1074
1080
|
const C = "#e8ecfc";
|
|
1075
1081
|
return (b = e == null ? void 0 : e.bg) != null && b.rgb ? e.bg.rgb : C;
|
|
@@ -1079,14 +1085,14 @@ const Me = (t) => {
|
|
|
1079
1085
|
bl: s,
|
|
1080
1086
|
it: d
|
|
1081
1087
|
};
|
|
1082
|
-
|
|
1083
|
-
}, [s, d, u,
|
|
1084
|
-
const
|
|
1088
|
+
p !== void 0 && (C.cl = { rgb: p }), f !== void 0 && (C.bg = { rgb: f }), u !== void 0 && (C.st = { s: u }), h !== void 0 && (C.ul = { s: h }), r(gr(C));
|
|
1089
|
+
}, [s, d, h, u, p, f]);
|
|
1090
|
+
const v = "univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";
|
|
1085
1091
|
return /* @__PURE__ */ k("div", { className: X("univer-my-2.5 univer-flex univer-justify-between", n), children: [
|
|
1086
1092
|
_ && /* @__PURE__ */ c(
|
|
1087
1093
|
"div",
|
|
1088
1094
|
{
|
|
1089
|
-
className: X(
|
|
1095
|
+
className: X(v, {
|
|
1090
1096
|
"univer-bg-gray-100": ut(s || ae.FALSE)
|
|
1091
1097
|
}),
|
|
1092
1098
|
onClick: () => o(ct(s)),
|
|
@@ -1096,7 +1102,7 @@ const Me = (t) => {
|
|
|
1096
1102
|
R && /* @__PURE__ */ c(
|
|
1097
1103
|
"div",
|
|
1098
1104
|
{
|
|
1099
|
-
className: X(
|
|
1105
|
+
className: X(v, {
|
|
1100
1106
|
"univer-bg-gray-100": ut(d || ae.FALSE)
|
|
1101
1107
|
}),
|
|
1102
1108
|
onClick: () => a(ct(d)),
|
|
@@ -1106,113 +1112,107 @@ const Me = (t) => {
|
|
|
1106
1112
|
w && /* @__PURE__ */ c(
|
|
1107
1113
|
"div",
|
|
1108
1114
|
{
|
|
1109
|
-
className: X(
|
|
1110
|
-
"univer-bg-gray-100": ut(
|
|
1115
|
+
className: X(v, {
|
|
1116
|
+
"univer-bg-gray-100": ut(h || ae.FALSE)
|
|
1111
1117
|
}),
|
|
1112
|
-
onClick: () => l(ct(
|
|
1118
|
+
onClick: () => l(ct(h)),
|
|
1113
1119
|
children: /* @__PURE__ */ c(w, {})
|
|
1114
1120
|
}
|
|
1115
1121
|
),
|
|
1116
1122
|
x && /* @__PURE__ */ c(
|
|
1117
1123
|
"div",
|
|
1118
1124
|
{
|
|
1119
|
-
className: X(
|
|
1120
|
-
"univer-bg-gray-100": ut(
|
|
1125
|
+
className: X(v, {
|
|
1126
|
+
"univer-bg-gray-100": ut(u || ae.FALSE)
|
|
1121
1127
|
}),
|
|
1122
|
-
onClick: () =>
|
|
1128
|
+
onClick: () => g(ct(u)),
|
|
1123
1129
|
children: /* @__PURE__ */ c(x, {})
|
|
1124
1130
|
}
|
|
1125
1131
|
),
|
|
1126
|
-
/* @__PURE__ */ c(Me, { color:
|
|
1127
|
-
/* @__PURE__ */ c(Me, { color:
|
|
1132
|
+
/* @__PURE__ */ c(Me, { color: p, onChange: S, iconId: "FontColor" }),
|
|
1133
|
+
/* @__PURE__ */ c(Me, { color: f, onChange: T, iconId: "PaintBucket" })
|
|
1128
1134
|
] });
|
|
1129
1135
|
}, mi = (t) => {
|
|
1130
1136
|
var x;
|
|
1131
|
-
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), [
|
|
1132
|
-
style:
|
|
1137
|
+
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), [h, l] = N(!1), u = de(null), [g, p] = N({}), [S, f] = N(() => (d == null ? void 0 : d.subType) === F.formula ? d.value : "="), [T, _] = N(void 0), R = (v) => ({
|
|
1138
|
+
style: v.style,
|
|
1133
1139
|
value: S,
|
|
1134
1140
|
type: U.highlightCell,
|
|
1135
1141
|
subType: F.formula
|
|
1136
1142
|
});
|
|
1137
1143
|
K(() => r.intercept(r.getInterceptPoints().submit, {
|
|
1138
1144
|
handler() {
|
|
1139
|
-
return R({ style:
|
|
1145
|
+
return R({ style: g });
|
|
1140
1146
|
}
|
|
1141
|
-
}), [
|
|
1147
|
+
}), [g, S, r]), K(() => r.intercept(r.getInterceptPoints().beforeSubmit, {
|
|
1142
1148
|
handler: (C, b, y) => T || S.length === 1 || !S.startsWith("=") ? (_(n.t("sheet.cf.errorMessage.formulaError")), !1) : y(C)
|
|
1143
1149
|
}), [T, S]);
|
|
1144
|
-
const w = (
|
|
1145
|
-
e(R(
|
|
1150
|
+
const w = (v) => {
|
|
1151
|
+
e(R(v));
|
|
1146
1152
|
};
|
|
1147
|
-
return Nt((
|
|
1153
|
+
return Nt((v) => {
|
|
1148
1154
|
var b;
|
|
1149
|
-
((b =
|
|
1155
|
+
((b = u.current) == null ? void 0 : b.isClickOutSide(v)) && l(!1);
|
|
1150
1156
|
}), /* @__PURE__ */ k("div", { ref: a, children: [
|
|
1151
1157
|
/* @__PURE__ */ c(
|
|
1152
1158
|
"div",
|
|
1153
1159
|
{
|
|
1154
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
1160
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1155
1161
|
children: n.t("sheet.cf.panel.styleRule")
|
|
1156
1162
|
}
|
|
1157
1163
|
),
|
|
1158
1164
|
/* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(
|
|
1159
1165
|
Mt,
|
|
1160
1166
|
{
|
|
1161
|
-
ref:
|
|
1162
|
-
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark
|
|
1167
|
+
ref: u,
|
|
1168
|
+
className: X("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent dark:!univer-bg-gray-700 dark:!univer-text-white hover:univer-border-primary-600", He),
|
|
1163
1169
|
errorText: T,
|
|
1164
|
-
isFocus:
|
|
1170
|
+
isFocus: h,
|
|
1165
1171
|
initValue: S,
|
|
1166
1172
|
unitId: s.getUnitId(),
|
|
1167
1173
|
subUnitId: o == null ? void 0 : o.getSheetId(),
|
|
1168
1174
|
onFocus: () => {
|
|
1169
1175
|
l(!0);
|
|
1170
1176
|
},
|
|
1171
|
-
onChange: (
|
|
1172
|
-
|
|
1177
|
+
onChange: (v) => {
|
|
1178
|
+
f(v), w({ style: g });
|
|
1173
1179
|
},
|
|
1174
|
-
onVerify: (
|
|
1175
|
-
!
|
|
1180
|
+
onVerify: (v, C) => {
|
|
1181
|
+
!v || C.length === 1 ? _(n.t("sheet.cf.errorMessage.formulaError")) : _(void 0);
|
|
1176
1182
|
}
|
|
1177
1183
|
}
|
|
1178
1184
|
) }),
|
|
1179
|
-
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: R({ style:
|
|
1185
|
+
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: R({ style: g }) }) }),
|
|
1180
1186
|
/* @__PURE__ */ c(
|
|
1181
1187
|
Yt,
|
|
1182
1188
|
{
|
|
1183
1189
|
style: d == null ? void 0 : d.style,
|
|
1184
1190
|
className: "univer-mt-3",
|
|
1185
|
-
onChange: (
|
|
1186
|
-
|
|
1191
|
+
onChange: (v) => {
|
|
1192
|
+
p(v), w({ style: v });
|
|
1187
1193
|
}
|
|
1188
1194
|
}
|
|
1189
1195
|
)
|
|
1190
1196
|
] });
|
|
1191
|
-
}, dt = (t) => /* @__PURE__ */ k("div", {
|
|
1197
|
+
}, dt = (t) => /* @__PURE__ */ k("div", { className: "univer-relative", children: [
|
|
1192
1198
|
/* @__PURE__ */ c(
|
|
1193
1199
|
"div",
|
|
1194
1200
|
{
|
|
1195
|
-
|
|
1196
|
-
position: "absolute",
|
|
1197
|
-
zIndex: 999,
|
|
1198
|
-
bottom: "-13px",
|
|
1199
|
-
fontSize: "10px",
|
|
1200
|
-
color: "red"
|
|
1201
|
-
},
|
|
1201
|
+
className: "univer-absolute univer-bottom-[-13px] univer-z-[999] univer-text-[10px] univer-text-red-500",
|
|
1202
1202
|
children: t.errorText
|
|
1203
1203
|
}
|
|
1204
1204
|
),
|
|
1205
1205
|
t.children
|
|
1206
1206
|
] }), q = (t, e) => ({ label: e.t(`sheet.cf.operator.${t}`), value: t }), fi = (t) => {
|
|
1207
|
-
const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [
|
|
1207
|
+
const { type: e, operator: r, onChange: n, value: i, interceptorManager: s } = t, o = W(re), [d, a] = N(() => typeof i == "number" ? i : 0), [h, l] = N(""), [u, g] = N(() => typeof i == "string" ? i : ""), [p, S] = N(""), [f, 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), [v, C] = N("");
|
|
1208
1208
|
switch (K(() => {
|
|
1209
1209
|
switch (e) {
|
|
1210
1210
|
case F.text: {
|
|
1211
|
-
[j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r) && n(
|
|
1211
|
+
[j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r) && n(u);
|
|
1212
1212
|
break;
|
|
1213
1213
|
}
|
|
1214
1214
|
case F.number: {
|
|
1215
|
-
[P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([
|
|
1215
|
+
[P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(r) && n(d), [P.between, P.notBetween].includes(r) && n([f, w]);
|
|
1216
1216
|
break;
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
@@ -1222,7 +1222,7 @@ const Me = (t) => {
|
|
|
1222
1222
|
switch (e) {
|
|
1223
1223
|
case F.text:
|
|
1224
1224
|
if ([j.beginsWith, j.containsText, j.endsWith, j.notEqual, j.notContainsText, j.equal].includes(r))
|
|
1225
|
-
return
|
|
1225
|
+
return u ? E(y) : (S(o.t("sheet.cf.errorMessage.notBlank")), !1);
|
|
1226
1226
|
}
|
|
1227
1227
|
return E(y);
|
|
1228
1228
|
}
|
|
@@ -1230,16 +1230,16 @@ const Me = (t) => {
|
|
|
1230
1230
|
return () => {
|
|
1231
1231
|
b();
|
|
1232
1232
|
};
|
|
1233
|
-
}, [e, d,
|
|
1233
|
+
}, [e, d, u, r]), e) {
|
|
1234
1234
|
case F.text: {
|
|
1235
1235
|
if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(r)) {
|
|
1236
1236
|
const b = (y) => {
|
|
1237
|
-
|
|
1237
|
+
g(y), n(y);
|
|
1238
1238
|
};
|
|
1239
|
-
return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText:
|
|
1239
|
+
return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: p, children: /* @__PURE__ */ c(
|
|
1240
1240
|
Gr,
|
|
1241
1241
|
{
|
|
1242
|
-
value:
|
|
1242
|
+
value: u,
|
|
1243
1243
|
onChange: (y) => {
|
|
1244
1244
|
S(""), b(y);
|
|
1245
1245
|
}
|
|
@@ -1253,7 +1253,7 @@ const Me = (t) => {
|
|
|
1253
1253
|
const b = (y) => {
|
|
1254
1254
|
a(y || 0), n(y || 0), l("");
|
|
1255
1255
|
};
|
|
1256
|
-
return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText:
|
|
1256
|
+
return /* @__PURE__ */ c("div", { className: "univer-mt-3", children: /* @__PURE__ */ c(dt, { errorText: h, children: /* @__PURE__ */ c(
|
|
1257
1257
|
Ne,
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "univer-w-full",
|
|
@@ -1268,11 +1268,11 @@ const Me = (t) => {
|
|
|
1268
1268
|
const b = (M) => {
|
|
1269
1269
|
T(M || 0), n([M || 0, w]), R("");
|
|
1270
1270
|
}, y = (M) => {
|
|
1271
|
-
x(M || 0), n([
|
|
1271
|
+
x(M || 0), n([f, M || 0]), C("");
|
|
1272
1272
|
};
|
|
1273
1273
|
return /* @__PURE__ */ k("div", { className: "univer-mt-3 univer-flex univer-items-center", children: [
|
|
1274
|
-
/* @__PURE__ */ c(dt, { errorText: _, children: /* @__PURE__ */ c(Ne, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value:
|
|
1275
|
-
/* @__PURE__ */ c(dt, { errorText:
|
|
1274
|
+
/* @__PURE__ */ c(dt, { errorText: _, children: /* @__PURE__ */ c(Ne, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value: f, onChange: b }) }),
|
|
1275
|
+
/* @__PURE__ */ c(dt, { errorText: v, children: /* @__PURE__ */ c(
|
|
1276
1276
|
Ne,
|
|
1277
1277
|
{
|
|
1278
1278
|
className: "univer-ml-3",
|
|
@@ -1330,8 +1330,8 @@ const Me = (t) => {
|
|
|
1330
1330
|
}, an = (t) => {
|
|
1331
1331
|
var x;
|
|
1332
1332
|
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(() => {
|
|
1333
|
-
const
|
|
1334
|
-
return i && i.subType ||
|
|
1333
|
+
const v = F.text;
|
|
1334
|
+
return i && i.subType || v;
|
|
1335
1335
|
}), d = [{
|
|
1336
1336
|
value: F.text,
|
|
1337
1337
|
label: n.t("sheet.cf.subRuleType.text")
|
|
@@ -1347,75 +1347,75 @@ const Me = (t) => {
|
|
|
1347
1347
|
}, {
|
|
1348
1348
|
value: F.uniqueValues,
|
|
1349
1349
|
label: n.t("sheet.cf.subRuleType.uniqueValues")
|
|
1350
|
-
}], a = J(() => on(s, n), [s]), [
|
|
1351
|
-
const
|
|
1352
|
-
return i && i.operator ||
|
|
1353
|
-
}), [
|
|
1350
|
+
}], a = J(() => on(s, n), [s]), [h, l] = N(() => {
|
|
1351
|
+
const v = a ? a[0].value : void 0;
|
|
1352
|
+
return i && i.operator || v;
|
|
1353
|
+
}), [u, g] = N(() => {
|
|
1354
1354
|
var b;
|
|
1355
|
-
const
|
|
1356
|
-
return i ? (b = i.value) != null ? b : mt(i.subType, i.operator) :
|
|
1357
|
-
}), [
|
|
1355
|
+
const v = "";
|
|
1356
|
+
return i ? (b = i.value) != null ? b : mt(i.subType, i.operator) : v;
|
|
1357
|
+
}), [p, S] = N({}), f = J(() => (v) => {
|
|
1358
1358
|
var C, b, y, M, E, V, L, m, I, H, Y, ge, me, ke, Fe;
|
|
1359
|
-
switch (
|
|
1359
|
+
switch (v.subType || s) {
|
|
1360
1360
|
case F.text: {
|
|
1361
|
-
if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(
|
|
1361
|
+
if ([j.beginsWith, j.endsWith, j.containsText, j.notContainsText, j.equal, j.notEqual].includes(h))
|
|
1362
1362
|
return {
|
|
1363
1363
|
type: U.highlightCell,
|
|
1364
|
-
subType: (C =
|
|
1365
|
-
operator: (b =
|
|
1366
|
-
style: (y =
|
|
1367
|
-
value: (M =
|
|
1364
|
+
subType: (C = v.subType) != null ? C : s,
|
|
1365
|
+
operator: (b = v.operator) != null ? b : h,
|
|
1366
|
+
style: (y = v.style) != null ? y : p,
|
|
1367
|
+
value: (M = v.value) != null ? M : u
|
|
1368
1368
|
};
|
|
1369
1369
|
break;
|
|
1370
1370
|
}
|
|
1371
1371
|
case F.number: {
|
|
1372
|
-
if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(
|
|
1372
|
+
if ([P.equal, P.notEqual, P.greaterThan, P.greaterThanOrEqual, P.lessThan, P.lessThanOrEqual].includes(h))
|
|
1373
1373
|
return {
|
|
1374
1374
|
type: U.highlightCell,
|
|
1375
|
-
subType: (E =
|
|
1376
|
-
operator: (V =
|
|
1377
|
-
style: (L =
|
|
1378
|
-
value: (m =
|
|
1375
|
+
subType: (E = v.subType) != null ? E : s,
|
|
1376
|
+
operator: (V = v.operator) != null ? V : h,
|
|
1377
|
+
style: (L = v.style) != null ? L : p,
|
|
1378
|
+
value: (m = v.value) != null ? m : u
|
|
1379
1379
|
};
|
|
1380
|
-
if ([P.between, P.notBetween].includes(
|
|
1380
|
+
if ([P.between, P.notBetween].includes(h))
|
|
1381
1381
|
return {
|
|
1382
1382
|
type: U.highlightCell,
|
|
1383
|
-
subType: (I =
|
|
1384
|
-
operator: (H =
|
|
1385
|
-
style: (Y =
|
|
1386
|
-
value: (ge =
|
|
1383
|
+
subType: (I = v.subType) != null ? I : s,
|
|
1384
|
+
operator: (H = v.operator) != null ? H : h,
|
|
1385
|
+
style: (Y = v.style) != null ? Y : p,
|
|
1386
|
+
value: (ge = v.value) != null ? ge : u
|
|
1387
1387
|
};
|
|
1388
1388
|
break;
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
1391
|
return {
|
|
1392
1392
|
type: U.highlightCell,
|
|
1393
|
-
subType: (me =
|
|
1394
|
-
operator: (ke =
|
|
1395
|
-
style: (Fe =
|
|
1393
|
+
subType: (me = v.subType) != null ? me : s,
|
|
1394
|
+
operator: (ke = v.operator) != null ? ke : h,
|
|
1395
|
+
style: (Fe = v.style) != null ? Fe : p
|
|
1396
1396
|
};
|
|
1397
|
-
}, [s,
|
|
1397
|
+
}, [s, h, u, p]);
|
|
1398
1398
|
K(() => e.intercept(e.getInterceptPoints().submit, {
|
|
1399
1399
|
handler() {
|
|
1400
|
-
return
|
|
1400
|
+
return f({});
|
|
1401
1401
|
}
|
|
1402
|
-
}), [
|
|
1403
|
-
d.some((
|
|
1402
|
+
}), [f, e]), K(() => {
|
|
1403
|
+
d.some((v) => v.value === s) || o(d[0].value);
|
|
1404
1404
|
}, [d]);
|
|
1405
|
-
const T = (
|
|
1406
|
-
const C =
|
|
1407
|
-
o(C), l(y), y &&
|
|
1408
|
-
}, _ = (
|
|
1409
|
-
const C =
|
|
1410
|
-
l(C), r(
|
|
1411
|
-
}, R = (
|
|
1412
|
-
v
|
|
1413
|
-
}, w = J(() => `${s}_${
|
|
1405
|
+
const T = (v) => {
|
|
1406
|
+
const C = v, b = on(C, n), y = b && b[0].value;
|
|
1407
|
+
o(C), l(y), y && g(mt(C, y)), r(f({ subType: C, operator: y }));
|
|
1408
|
+
}, _ = (v) => {
|
|
1409
|
+
const C = v;
|
|
1410
|
+
l(C), r(f({ operator: C }));
|
|
1411
|
+
}, R = (v) => {
|
|
1412
|
+
g(v), r(f({ value: v }));
|
|
1413
|
+
}, w = J(() => `${s}_${h}_${Math.random()}`, [s, h]);
|
|
1414
1414
|
return /* @__PURE__ */ k("div", { children: [
|
|
1415
1415
|
/* @__PURE__ */ c(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
1418
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
1418
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1419
1419
|
children: n.t("sheet.cf.panel.styleRule")
|
|
1420
1420
|
}
|
|
1421
1421
|
),
|
|
@@ -1434,7 +1434,7 @@ const Me = (t) => {
|
|
|
1434
1434
|
{
|
|
1435
1435
|
className: "univer-mt-3 univer-w-full",
|
|
1436
1436
|
onChange: _,
|
|
1437
|
-
value:
|
|
1437
|
+
value: h || "",
|
|
1438
1438
|
options: a
|
|
1439
1439
|
}
|
|
1440
1440
|
)
|
|
@@ -1442,33 +1442,33 @@ const Me = (t) => {
|
|
|
1442
1442
|
/* @__PURE__ */ c(
|
|
1443
1443
|
fi,
|
|
1444
1444
|
{
|
|
1445
|
-
value:
|
|
1445
|
+
value: u,
|
|
1446
1446
|
interceptorManager: e,
|
|
1447
1447
|
type: s,
|
|
1448
|
-
operator:
|
|
1448
|
+
operator: h,
|
|
1449
1449
|
rule: i,
|
|
1450
1450
|
onChange: R
|
|
1451
1451
|
},
|
|
1452
1452
|
w
|
|
1453
1453
|
),
|
|
1454
|
-
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule:
|
|
1454
|
+
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: f({}) }) }),
|
|
1455
1455
|
/* @__PURE__ */ c(
|
|
1456
1456
|
Yt,
|
|
1457
1457
|
{
|
|
1458
1458
|
style: i == null ? void 0 : i.style,
|
|
1459
1459
|
className: "univer-ml-1",
|
|
1460
|
-
onChange: (
|
|
1461
|
-
S(
|
|
1460
|
+
onChange: (v) => {
|
|
1461
|
+
S(v), r(f({ style: v }));
|
|
1462
1462
|
}
|
|
1463
1463
|
}
|
|
1464
1464
|
)
|
|
1465
1465
|
] });
|
|
1466
1466
|
}, Xn = (t, e) => (Ee[t] || [])[Number(e)] || "", pi = (t) => {
|
|
1467
1467
|
var l;
|
|
1468
|
-
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,
|
|
1469
|
-
return Nt((
|
|
1470
|
-
var
|
|
1471
|
-
((
|
|
1468
|
+
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, h] = N(!1);
|
|
1469
|
+
return Nt((u) => {
|
|
1470
|
+
var p;
|
|
1471
|
+
((p = d.current) == null ? void 0 : p.isClickOutSide(u)) && h(!1);
|
|
1472
1472
|
}), /* @__PURE__ */ c("div", { className: "univer-relative", children: r !== A.formula ? /* @__PURE__ */ k(Bt, { children: [
|
|
1473
1473
|
/* @__PURE__ */ c(
|
|
1474
1474
|
Ne,
|
|
@@ -1477,7 +1477,7 @@ const Me = (t) => {
|
|
|
1477
1477
|
"univer-border-red-500": e
|
|
1478
1478
|
}),
|
|
1479
1479
|
value: Number(t.value) || 0,
|
|
1480
|
-
onChange: (
|
|
1480
|
+
onChange: (u) => n(u != null ? u : 0)
|
|
1481
1481
|
}
|
|
1482
1482
|
),
|
|
1483
1483
|
e && /* @__PURE__ */ c("div", { className: "univer-absolute univer-text-xs univer-text-red-500", children: e })
|
|
@@ -1489,10 +1489,10 @@ const Me = (t) => {
|
|
|
1489
1489
|
unitId: s,
|
|
1490
1490
|
subUnitId: o,
|
|
1491
1491
|
isFocus: a,
|
|
1492
|
-
onChange: (
|
|
1493
|
-
n(
|
|
1492
|
+
onChange: (u = "") => {
|
|
1493
|
+
n(u || "");
|
|
1494
1494
|
},
|
|
1495
|
-
onFocus: () =>
|
|
1495
|
+
onFocus: () => h(!0)
|
|
1496
1496
|
}
|
|
1497
1497
|
) }) });
|
|
1498
1498
|
}, ln = (t, e, r) => ({
|
|
@@ -1516,15 +1516,15 @@ const Me = (t) => {
|
|
|
1516
1516
|
children: /* @__PURE__ */ c(
|
|
1517
1517
|
"a",
|
|
1518
1518
|
{
|
|
1519
|
-
className: "univer-cursor-pointer univer-rounded hover:univer-bg-gray-100",
|
|
1520
|
-
children: d.list.map((a,
|
|
1519
|
+
className: "univer-cursor-pointer univer-rounded dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
|
|
1520
|
+
children: d.list.map((a, h) => /* @__PURE__ */ c(
|
|
1521
1521
|
"img",
|
|
1522
1522
|
{
|
|
1523
1523
|
className: "univer-size-5",
|
|
1524
1524
|
src: a,
|
|
1525
1525
|
draggable: !1
|
|
1526
1526
|
},
|
|
1527
|
-
|
|
1527
|
+
h
|
|
1528
1528
|
))
|
|
1529
1529
|
}
|
|
1530
1530
|
)
|
|
@@ -1537,11 +1537,11 @@ const Me = (t) => {
|
|
|
1537
1537
|
const i = [];
|
|
1538
1538
|
for (const s in Ee) {
|
|
1539
1539
|
const o = Ee[s], d = s;
|
|
1540
|
-
o.forEach((a,
|
|
1540
|
+
o.forEach((a, h) => {
|
|
1541
1541
|
i.push({
|
|
1542
1542
|
iconType: d,
|
|
1543
1543
|
base64: a,
|
|
1544
|
-
iconId: String(
|
|
1544
|
+
iconId: String(h)
|
|
1545
1545
|
});
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
@@ -1564,7 +1564,7 @@ const Me = (t) => {
|
|
|
1564
1564
|
/* @__PURE__ */ c("div", { className: "univer-flex univer-w-64 univer-flex-wrap", children: r.map((i) => /* @__PURE__ */ c(
|
|
1565
1565
|
"div",
|
|
1566
1566
|
{
|
|
1567
|
-
className: "univer-mb-2 univer-mr-2 univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-100",
|
|
1567
|
+
className: "univer-mb-2 univer-mr-2 univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
|
|
1568
1568
|
children: /* @__PURE__ */ c(
|
|
1569
1569
|
"img",
|
|
1570
1570
|
{
|
|
@@ -1584,31 +1584,31 @@ const Me = (t) => {
|
|
|
1584
1584
|
{ label: i.t(`sheet.cf.valueType.${A.percent}`), value: A.percent },
|
|
1585
1585
|
{ label: i.t(`sheet.cf.valueType.${A.percentile}`), value: A.percentile },
|
|
1586
1586
|
{ label: i.t(`sheet.cf.valueType.${A.formula}`), value: A.formula }
|
|
1587
|
-
], d = (
|
|
1588
|
-
e([String(
|
|
1589
|
-
}, a = (
|
|
1590
|
-
e([String(
|
|
1591
|
-
const
|
|
1592
|
-
d(
|
|
1593
|
-
},
|
|
1594
|
-
e([String(
|
|
1595
|
-
const
|
|
1596
|
-
d(S,
|
|
1587
|
+
], d = (u, g) => {
|
|
1588
|
+
e([String(g), "value", "value"], u);
|
|
1589
|
+
}, a = (u, g) => {
|
|
1590
|
+
e([String(g), "operator"], u);
|
|
1591
|
+
const p = mt(F.number, u);
|
|
1592
|
+
d(p, g);
|
|
1593
|
+
}, h = (u, g) => {
|
|
1594
|
+
e([String(g), "value", "type"], u);
|
|
1595
|
+
const p = r[g], S = mt(F.number, p.operator);
|
|
1596
|
+
d(S, g);
|
|
1597
1597
|
};
|
|
1598
|
-
return J(() => r.map((
|
|
1599
|
-
const
|
|
1600
|
-
const C = { ...
|
|
1601
|
-
e([String(
|
|
1598
|
+
return J(() => r.map((u, g) => {
|
|
1599
|
+
const p = n[g], S = Xn(u.iconType, u.iconId), f = g === r.length - 1, T = g === 0, _ = r[g - 1], R = (_ == null ? void 0 : _.value.type) === A.formula ? i.t("sheet.cf.valueType.formula") : _ == null ? void 0 : _.value.value, w = (x, v) => {
|
|
1600
|
+
const C = { ...u, iconId: v, iconType: x };
|
|
1601
|
+
e([String(g)], C);
|
|
1602
1602
|
};
|
|
1603
1603
|
return /* @__PURE__ */ k(
|
|
1604
1604
|
"div",
|
|
1605
1605
|
{
|
|
1606
|
-
className:
|
|
1606
|
+
className: g ? "univer-mt-6" : "univer-mt-3",
|
|
1607
1607
|
children: [
|
|
1608
1608
|
/* @__PURE__ */ k(
|
|
1609
1609
|
"div",
|
|
1610
1610
|
{
|
|
1611
|
-
className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark
|
|
1611
|
+
className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1612
1612
|
children: [
|
|
1613
1613
|
/* @__PURE__ */ k(
|
|
1614
1614
|
"div",
|
|
@@ -1616,22 +1616,22 @@ const Me = (t) => {
|
|
|
1616
1616
|
className: "univer-w-[45%]",
|
|
1617
1617
|
children: [
|
|
1618
1618
|
i.t("sheet.cf.iconSet.icon"),
|
|
1619
|
-
|
|
1619
|
+
g + 1
|
|
1620
1620
|
]
|
|
1621
1621
|
}
|
|
1622
1622
|
),
|
|
1623
1623
|
/* @__PURE__ */ c("div", { className: "univer-w-[45%]", children: /* @__PURE__ */ k(Bt, { children: [
|
|
1624
|
-
!T && !
|
|
1625
|
-
!T && !
|
|
1624
|
+
!T && !f && i.t("sheet.cf.iconSet.rule"),
|
|
1625
|
+
!T && !f && /* @__PURE__ */ k(
|
|
1626
1626
|
"span",
|
|
1627
1627
|
{
|
|
1628
|
-
className: "univer-font-medium univer-text-gray-600 dark
|
|
1628
|
+
className: "univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1629
1629
|
children: [
|
|
1630
1630
|
"(",
|
|
1631
1631
|
i.t("sheet.cf.iconSet.when"),
|
|
1632
1632
|
i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
|
|
1633
1633
|
R,
|
|
1634
|
-
|
|
1634
|
+
f ? "" : ` ${i.t("sheet.cf.iconSet.and")} `,
|
|
1635
1635
|
")"
|
|
1636
1636
|
]
|
|
1637
1637
|
}
|
|
@@ -1644,11 +1644,11 @@ const Me = (t) => {
|
|
|
1644
1644
|
/* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: /* @__PURE__ */ c(
|
|
1645
1645
|
Zt,
|
|
1646
1646
|
{
|
|
1647
|
-
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick: w, iconId:
|
|
1647
|
+
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(yi, { onClick: w, iconId: u.iconId, iconType: u.iconType }) }),
|
|
1648
1648
|
children: /* @__PURE__ */ k(
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
1651
|
-
className: X("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all dark
|
|
1651
|
+
className: X("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all dark:!univer-text-gray-200 hover:univer-border-primary-600", He),
|
|
1652
1652
|
children: [
|
|
1653
1653
|
S ? /* @__PURE__ */ c("img", { src: S, className: "univer-size-4", draggable: !1 }) : /* @__PURE__ */ c(
|
|
1654
1654
|
ot,
|
|
@@ -1662,17 +1662,17 @@ const Me = (t) => {
|
|
|
1662
1662
|
)
|
|
1663
1663
|
}
|
|
1664
1664
|
) }),
|
|
1665
|
-
|
|
1665
|
+
f ? /* @__PURE__ */ k(
|
|
1666
1666
|
"div",
|
|
1667
1667
|
{
|
|
1668
|
-
className: "univer-mt-0 univer-w-[45%] univer-text-sm univer-text-gray-600 dark
|
|
1668
|
+
className: "univer-mt-0 univer-w-[45%] univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1669
1669
|
children: [
|
|
1670
1670
|
i.t("sheet.cf.iconSet.rule"),
|
|
1671
1671
|
/* @__PURE__ */ k("span", { className: "univer-font-medium", children: [
|
|
1672
1672
|
i.t("sheet.cf.iconSet.when"),
|
|
1673
1673
|
i.t(`sheet.cf.symbol.${Ht(_.operator)}`),
|
|
1674
1674
|
R,
|
|
1675
|
-
|
|
1675
|
+
f ? "" : ` ${i.t("sheet.cf.iconSet.and")} `
|
|
1676
1676
|
] })
|
|
1677
1677
|
]
|
|
1678
1678
|
}
|
|
@@ -1680,18 +1680,18 @@ const Me = (t) => {
|
|
|
1680
1680
|
le,
|
|
1681
1681
|
{
|
|
1682
1682
|
options: s,
|
|
1683
|
-
value:
|
|
1683
|
+
value: u.operator,
|
|
1684
1684
|
onChange: (x) => {
|
|
1685
|
-
a(x,
|
|
1685
|
+
a(x, g);
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
1688
|
)
|
|
1689
1689
|
] }),
|
|
1690
|
-
|
|
1690
|
+
f ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */ k(Bt, { children: [
|
|
1691
1691
|
/* @__PURE__ */ k(
|
|
1692
1692
|
"div",
|
|
1693
1693
|
{
|
|
1694
|
-
className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-gap-4 univer-text-sm univer-text-gray-600 dark
|
|
1694
|
+
className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-gap-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1695
1695
|
children: [
|
|
1696
1696
|
/* @__PURE__ */ c("div", { children: i.t("sheet.cf.iconSet.type") }),
|
|
1697
1697
|
/* @__PURE__ */ c("div", { children: i.t("sheet.cf.iconSet.value") })
|
|
@@ -1708,21 +1708,21 @@ const Me = (t) => {
|
|
|
1708
1708
|
{
|
|
1709
1709
|
className: "univer-flex-shrink-0",
|
|
1710
1710
|
options: o,
|
|
1711
|
-
value:
|
|
1711
|
+
value: u.value.type,
|
|
1712
1712
|
onChange: (x) => {
|
|
1713
|
-
|
|
1713
|
+
h(x, g);
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
),
|
|
1717
1717
|
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
1718
1718
|
pi,
|
|
1719
1719
|
{
|
|
1720
|
-
id:
|
|
1721
|
-
type:
|
|
1722
|
-
error:
|
|
1723
|
-
value:
|
|
1720
|
+
id: g,
|
|
1721
|
+
type: u.value.type,
|
|
1722
|
+
error: p,
|
|
1723
|
+
value: u.value.value || "",
|
|
1724
1724
|
onChange: (x) => {
|
|
1725
|
-
d(x,
|
|
1725
|
+
d(x, g);
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
1728
|
) })
|
|
@@ -1732,32 +1732,32 @@ const Me = (t) => {
|
|
|
1732
1732
|
] })
|
|
1733
1733
|
]
|
|
1734
1734
|
},
|
|
1735
|
-
|
|
1735
|
+
g
|
|
1736
1736
|
);
|
|
1737
1737
|
}), [r, n]);
|
|
1738
1738
|
}, Si = (t) => {
|
|
1739
1739
|
var x;
|
|
1740
1740
|
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(() => {
|
|
1741
|
-
const
|
|
1741
|
+
const v = Object.keys(Ee)[0];
|
|
1742
1742
|
if (r && r.config.length) {
|
|
1743
1743
|
const C = r.config[0].iconType;
|
|
1744
1744
|
if (!r.config.some((y) => y.iconType !== C))
|
|
1745
1745
|
return C;
|
|
1746
1746
|
}
|
|
1747
|
-
return
|
|
1748
|
-
}), [a,
|
|
1747
|
+
return v;
|
|
1748
|
+
}), [a, h] = N(() => {
|
|
1749
1749
|
if (r && r.config.length)
|
|
1750
1750
|
return Wt.deepClone(r == null ? void 0 : r.config);
|
|
1751
|
-
const
|
|
1752
|
-
return new Array(
|
|
1751
|
+
const v = Ee[o] || [];
|
|
1752
|
+
return new Array(v.length).fill("").map((C, b, y) => b === y.length - 1 ? {
|
|
1753
1753
|
operator: P.lessThanOrEqual,
|
|
1754
1754
|
value: { type: A.num, value: Number.MAX_SAFE_INTEGER },
|
|
1755
1755
|
iconType: o,
|
|
1756
1756
|
iconId: String(b)
|
|
1757
1757
|
} : ln(o, b, y));
|
|
1758
|
-
}), [l,
|
|
1759
|
-
const
|
|
1760
|
-
return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children:
|
|
1758
|
+
}), [l, u] = N(() => r ? !!r.isShowValue : !0), g = J(() => {
|
|
1759
|
+
const v = a.map((C) => Xn(C.iconType, C.iconId));
|
|
1760
|
+
return /* @__PURE__ */ c("div", { className: "univer-flex univer-items-center", children: v.map((C, b) => C ? /* @__PURE__ */ c(
|
|
1761
1761
|
"img",
|
|
1762
1762
|
{
|
|
1763
1763
|
className: "univer-size-5",
|
|
@@ -1765,8 +1765,8 @@ const Me = (t) => {
|
|
|
1765
1765
|
},
|
|
1766
1766
|
b
|
|
1767
1767
|
) : /* @__PURE__ */ c(ot, { className: "univer-size-5" }, b)) });
|
|
1768
|
-
}, [a]),
|
|
1769
|
-
if (
|
|
1768
|
+
}, [a]), p = (v) => {
|
|
1769
|
+
if (v.reduce((b, y, M) => b.preType && !b.result || v.length - 1 === M ? b : y.value.type === A.formula ? {
|
|
1770
1770
|
preType: A.formula,
|
|
1771
1771
|
result: !1
|
|
1772
1772
|
} : b.preType ? {
|
|
@@ -1775,48 +1775,48 @@ const Me = (t) => {
|
|
|
1775
1775
|
} : {
|
|
1776
1776
|
result: !0,
|
|
1777
1777
|
preType: y.value.type
|
|
1778
|
-
}, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(
|
|
1778
|
+
}, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(v[0].value.type)) {
|
|
1779
1779
|
const b = {};
|
|
1780
|
-
return
|
|
1780
|
+
return v.forEach((y, M, E) => {
|
|
1781
1781
|
if (M - 1 < 0 || M === E.length - 1)
|
|
1782
1782
|
return;
|
|
1783
|
-
const L =
|
|
1783
|
+
const L = v[M - 1], m = Ht(L.operator);
|
|
1784
1784
|
fr({ operator: m, value: L.value.value }, y.value.value) || (b[M] = `${n.t(`sheet.cf.form.${m}`, String(L.value.value))} `);
|
|
1785
1785
|
}), b;
|
|
1786
1786
|
}
|
|
1787
1787
|
return {};
|
|
1788
|
-
}, S = (
|
|
1789
|
-
sr(a,
|
|
1790
|
-
},
|
|
1791
|
-
d(
|
|
1792
|
-
const C = Ee[
|
|
1793
|
-
|
|
1788
|
+
}, S = (v, C) => {
|
|
1789
|
+
sr(a, v) !== C && (or(a, v, C), h([...a]), s(p(a)));
|
|
1790
|
+
}, f = (v) => {
|
|
1791
|
+
d(v);
|
|
1792
|
+
const C = Ee[v] || [], b = new Array(C.length).fill("").map((y, M, E) => ln(v, M, E));
|
|
1793
|
+
h(b), s(p(b));
|
|
1794
1794
|
};
|
|
1795
1795
|
K(() => {
|
|
1796
|
-
const
|
|
1796
|
+
const v = e.intercept(e.getInterceptPoints().submit, {
|
|
1797
1797
|
handler() {
|
|
1798
1798
|
return { type: U.iconSet, isShowValue: l, config: a };
|
|
1799
1799
|
}
|
|
1800
1800
|
});
|
|
1801
1801
|
return () => {
|
|
1802
|
-
|
|
1802
|
+
v();
|
|
1803
1803
|
};
|
|
1804
1804
|
}, [l, a, e]), K(() => {
|
|
1805
|
-
const
|
|
1805
|
+
const v = e.intercept(e.getInterceptPoints().beforeSubmit, {
|
|
1806
1806
|
handler() {
|
|
1807
1807
|
return Object.keys(i).length === 0;
|
|
1808
1808
|
}
|
|
1809
1809
|
});
|
|
1810
1810
|
return () => {
|
|
1811
|
-
|
|
1811
|
+
v();
|
|
1812
1812
|
};
|
|
1813
1813
|
}, [l, a, e, i]);
|
|
1814
1814
|
const T = () => {
|
|
1815
|
-
const
|
|
1815
|
+
const v = a.map((C) => ({ ...C }));
|
|
1816
1816
|
a.forEach((C, b) => {
|
|
1817
|
-
const y = a.length - 1 - b, M =
|
|
1817
|
+
const y = a.length - 1 - b, M = v[y];
|
|
1818
1818
|
C.iconId = M.iconId, C.iconType = M.iconType;
|
|
1819
|
-
}),
|
|
1819
|
+
}), h([...a]);
|
|
1820
1820
|
}, _ = W(Lr), [R, w] = N();
|
|
1821
1821
|
return Ar(R, _.rootContainerElement), /* @__PURE__ */ k("div", { children: [
|
|
1822
1822
|
/* @__PURE__ */ c("div", { className: "univer-mt-4 univer-text-sm univer-text-gray-600", children: n.t("sheet.cf.panel.styleRule") }),
|
|
@@ -1826,11 +1826,11 @@ const Me = (t) => {
|
|
|
1826
1826
|
overlay: /* @__PURE__ */ c("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ c(
|
|
1827
1827
|
Ci,
|
|
1828
1828
|
{
|
|
1829
|
-
ref: (
|
|
1830
|
-
!R &&
|
|
1829
|
+
ref: (v) => {
|
|
1830
|
+
!R && v && w(v);
|
|
1831
1831
|
},
|
|
1832
1832
|
iconType: o,
|
|
1833
|
-
onClick:
|
|
1833
|
+
onClick: f
|
|
1834
1834
|
}
|
|
1835
1835
|
) }),
|
|
1836
1836
|
children: /* @__PURE__ */ k(
|
|
@@ -1838,7 +1838,7 @@ const Me = (t) => {
|
|
|
1838
1838
|
{
|
|
1839
1839
|
className: X("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600", He),
|
|
1840
1840
|
children: [
|
|
1841
|
-
|
|
1841
|
+
g,
|
|
1842
1842
|
/* @__PURE__ */ c(Vt, {})
|
|
1843
1843
|
]
|
|
1844
1844
|
}
|
|
@@ -1851,8 +1851,8 @@ const Me = (t) => {
|
|
|
1851
1851
|
n.t("sheet.cf.iconSet.reverseIconOrder")
|
|
1852
1852
|
] }),
|
|
1853
1853
|
/* @__PURE__ */ k("div", { className: "univer-ml-6 univer-flex univer-items-center univer-text-xs", children: [
|
|
1854
|
-
/* @__PURE__ */ c(yt, { checked: !l, onChange: (
|
|
1855
|
-
|
|
1854
|
+
/* @__PURE__ */ c(yt, { checked: !l, onChange: (v) => {
|
|
1855
|
+
u(!v);
|
|
1856
1856
|
} }),
|
|
1857
1857
|
n.t("sheet.cf.iconSet.onlyShowIcon")
|
|
1858
1858
|
] })
|
|
@@ -1875,7 +1875,7 @@ const Me = (t) => {
|
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
return _;
|
|
1878
|
-
}), [a,
|
|
1878
|
+
}), [a, h] = N(() => {
|
|
1879
1879
|
const R = i == null ? void 0 : i.type;
|
|
1880
1880
|
if (!i)
|
|
1881
1881
|
return 10;
|
|
@@ -1887,7 +1887,7 @@ const Me = (t) => {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
}
|
|
1889
1889
|
return 10;
|
|
1890
|
-
}), [l,
|
|
1890
|
+
}), [l, u] = N(() => {
|
|
1891
1891
|
const R = i == null ? void 0 : i.type;
|
|
1892
1892
|
if (!i)
|
|
1893
1893
|
return !1;
|
|
@@ -1899,30 +1899,30 @@ const Me = (t) => {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
1901
1901
|
return !1;
|
|
1902
|
-
}), [
|
|
1903
|
-
const { type: R, isPercent: w, value: x, style:
|
|
1902
|
+
}), [g, p] = N({}), S = (_) => {
|
|
1903
|
+
const { type: R, isPercent: w, value: x, style: v } = _;
|
|
1904
1904
|
if (R === "isNotBottom")
|
|
1905
|
-
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !1, value: x, style:
|
|
1905
|
+
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !1, value: x, style: v };
|
|
1906
1906
|
if (R === "isBottom")
|
|
1907
|
-
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !0, value: x, style:
|
|
1907
|
+
return { type: U.highlightCell, subType: F.rank, isPercent: w, isBottom: !0, value: x, style: v };
|
|
1908
1908
|
if (R === "greaterThanAverage")
|
|
1909
|
-
return { type: U.highlightCell, subType: F.average, operator: P.greaterThan, style:
|
|
1909
|
+
return { type: U.highlightCell, subType: F.average, operator: P.greaterThan, style: v };
|
|
1910
1910
|
if (R === "lessThanAverage")
|
|
1911
|
-
return { type: U.highlightCell, subType: F.average, operator: P.lessThan, style:
|
|
1911
|
+
return { type: U.highlightCell, subType: F.average, operator: P.lessThan, style: v };
|
|
1912
1912
|
};
|
|
1913
1913
|
K(() => r.intercept(r.getInterceptPoints().submit, {
|
|
1914
1914
|
handler() {
|
|
1915
|
-
return S({ type: o, isPercent: l, value: a, style:
|
|
1915
|
+
return S({ type: o, isPercent: l, value: a, style: g });
|
|
1916
1916
|
}
|
|
1917
|
-
}), [o, l, a,
|
|
1918
|
-
const
|
|
1917
|
+
}), [o, l, a, g, r]);
|
|
1918
|
+
const f = (_) => {
|
|
1919
1919
|
e(S(_));
|
|
1920
1920
|
};
|
|
1921
1921
|
return /* @__PURE__ */ k("div", { children: [
|
|
1922
1922
|
/* @__PURE__ */ c(
|
|
1923
1923
|
"div",
|
|
1924
1924
|
{
|
|
1925
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
1925
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
1926
1926
|
children: n.t("sheet.cf.panel.styleRule")
|
|
1927
1927
|
}
|
|
1928
1928
|
),
|
|
@@ -1933,7 +1933,7 @@ const Me = (t) => {
|
|
|
1933
1933
|
value: o,
|
|
1934
1934
|
options: s,
|
|
1935
1935
|
onChange: (_) => {
|
|
1936
|
-
d(_),
|
|
1936
|
+
d(_), f({ type: _, isPercent: l, value: a, style: g });
|
|
1937
1937
|
}
|
|
1938
1938
|
}
|
|
1939
1939
|
),
|
|
@@ -1946,7 +1946,7 @@ const Me = (t) => {
|
|
|
1946
1946
|
value: a,
|
|
1947
1947
|
onChange: (_) => {
|
|
1948
1948
|
const R = _ || 0;
|
|
1949
|
-
|
|
1949
|
+
h(R), f({ type: o, isPercent: l, value: R, style: g });
|
|
1950
1950
|
}
|
|
1951
1951
|
}
|
|
1952
1952
|
),
|
|
@@ -1960,7 +1960,7 @@ const Me = (t) => {
|
|
|
1960
1960
|
{
|
|
1961
1961
|
checked: l,
|
|
1962
1962
|
onChange: (_) => {
|
|
1963
|
-
|
|
1963
|
+
u(!!_), f({ type: o, isPercent: !!_, value: a, style: g });
|
|
1964
1964
|
}
|
|
1965
1965
|
}
|
|
1966
1966
|
),
|
|
@@ -1969,14 +1969,14 @@ const Me = (t) => {
|
|
|
1969
1969
|
}
|
|
1970
1970
|
)
|
|
1971
1971
|
] }),
|
|
1972
|
-
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: S({ type: o, isPercent: l, value: a, style:
|
|
1972
|
+
/* @__PURE__ */ c("div", { className: at, children: /* @__PURE__ */ c(We, { rule: S({ type: o, isPercent: l, value: a, style: g }) }) }),
|
|
1973
1973
|
/* @__PURE__ */ c(
|
|
1974
1974
|
Yt,
|
|
1975
1975
|
{
|
|
1976
1976
|
style: i == null ? void 0 : i.style,
|
|
1977
1977
|
className: "univer-mt-3",
|
|
1978
1978
|
onChange: (_) => {
|
|
1979
|
-
|
|
1979
|
+
p(_), f({ type: o, isPercent: l, value: a, style: _ });
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
1982
|
)
|
|
@@ -1986,23 +1986,23 @@ const Me = (t) => {
|
|
|
1986
1986
|
return (e = t.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : e.getSheetId();
|
|
1987
1987
|
}, Ri = (t) => {
|
|
1988
1988
|
var b, y, M;
|
|
1989
|
-
const e = W(re), r = W(te), n = W(z), i = W(Q), s = W($e), o = cn(n), d = un(n), [a,
|
|
1989
|
+
const e = W(re), r = W(te), n = W(z), i = W(Q), s = W($e), o = cn(n), d = un(n), [a, h] = N(void 0), l = de((y = (b = t.rule) == null ? void 0 : b.ranges) != null ? y : []), u = J(() => {
|
|
1990
1990
|
var V, L, m;
|
|
1991
1991
|
let E = (V = t.rule) == null ? void 0 : V.ranges;
|
|
1992
1992
|
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) => {
|
|
1993
1993
|
const H = Un(I);
|
|
1994
1994
|
return H === "NaN" ? "" : H;
|
|
1995
1995
|
}).filter((I) => !!I).join(",") : "";
|
|
1996
|
-
}, [t.rule]),
|
|
1996
|
+
}, [t.rule]), g = [
|
|
1997
1997
|
{ label: e.t("sheet.cf.ruleType.highlightCell"), value: "1" },
|
|
1998
1998
|
{ label: e.t("sheet.cf.panel.rankAndAverage"), value: "2" },
|
|
1999
1999
|
{ label: e.t("sheet.cf.ruleType.dataBar"), value: "3" },
|
|
2000
2000
|
{ label: e.t("sheet.cf.ruleType.colorScale"), value: "4" },
|
|
2001
2001
|
{ label: e.t("sheet.cf.ruleType.formula"), value: "5" },
|
|
2002
2002
|
{ label: e.t("sheet.cf.ruleType.iconSet"), value: "6" }
|
|
2003
|
-
], [
|
|
2003
|
+
], [p, S] = N(() => {
|
|
2004
2004
|
var L, m;
|
|
2005
|
-
const E = (L = t.rule) == null ? void 0 : L.rule.type, V =
|
|
2005
|
+
const E = (L = t.rule) == null ? void 0 : L.rule.type, V = g[0].value;
|
|
2006
2006
|
if (!E)
|
|
2007
2007
|
return V;
|
|
2008
2008
|
switch (E) {
|
|
@@ -2030,8 +2030,8 @@ const Me = (t) => {
|
|
|
2030
2030
|
return "6";
|
|
2031
2031
|
}
|
|
2032
2032
|
return V;
|
|
2033
|
-
}),
|
|
2034
|
-
switch (
|
|
2033
|
+
}), f = de(void 0), T = J(() => new ar({ beforeSubmit: _i, submit: Ti }), []), _ = J(() => {
|
|
2034
|
+
switch (p) {
|
|
2035
2035
|
case "1":
|
|
2036
2036
|
return an;
|
|
2037
2037
|
case "2":
|
|
@@ -2047,7 +2047,7 @@ const Me = (t) => {
|
|
|
2047
2047
|
default:
|
|
2048
2048
|
return an;
|
|
2049
2049
|
}
|
|
2050
|
-
}, [
|
|
2050
|
+
}, [p]);
|
|
2051
2051
|
K(() => {
|
|
2052
2052
|
const E = r.onCommandExecuted((V) => {
|
|
2053
2053
|
if (V.id === Rr.id) {
|
|
@@ -2059,7 +2059,7 @@ const Me = (t) => {
|
|
|
2059
2059
|
return () => E.dispose();
|
|
2060
2060
|
}, []);
|
|
2061
2061
|
const R = (E) => {
|
|
2062
|
-
|
|
2062
|
+
f.current = E;
|
|
2063
2063
|
}, w = (E) => {
|
|
2064
2064
|
const V = E.split(",").filter((L) => !!L).map(Zr).map((L) => L.range);
|
|
2065
2065
|
l.current = V;
|
|
@@ -2082,16 +2082,16 @@ const Me = (t) => {
|
|
|
2082
2082
|
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());
|
|
2083
2083
|
}
|
|
2084
2084
|
}
|
|
2085
|
-
},
|
|
2085
|
+
}, v = () => {
|
|
2086
2086
|
t.onCancel();
|
|
2087
2087
|
}, C = (E, V) => {
|
|
2088
|
-
E ? V.length < 1 ?
|
|
2088
|
+
E ? V.length < 1 ? h(e.t("sheet.cf.errorMessage.rangeError")) : h(void 0) : h(e.t("sheet.cf.errorMessage.rangeError"));
|
|
2089
2089
|
};
|
|
2090
2090
|
return /* @__PURE__ */ k("div", { children: [
|
|
2091
2091
|
/* @__PURE__ */ c(
|
|
2092
2092
|
"div",
|
|
2093
2093
|
{
|
|
2094
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
2094
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2095
2095
|
children: e.t("sheet.cf.panel.range")
|
|
2096
2096
|
}
|
|
2097
2097
|
),
|
|
@@ -2101,7 +2101,7 @@ const Me = (t) => {
|
|
|
2101
2101
|
{
|
|
2102
2102
|
unitId: o,
|
|
2103
2103
|
subUnitId: d,
|
|
2104
|
-
initialValue:
|
|
2104
|
+
initialValue: u,
|
|
2105
2105
|
onChange: (E, V) => w(V),
|
|
2106
2106
|
onVerify: C
|
|
2107
2107
|
}
|
|
@@ -2111,7 +2111,7 @@ const Me = (t) => {
|
|
|
2111
2111
|
/* @__PURE__ */ c(
|
|
2112
2112
|
"div",
|
|
2113
2113
|
{
|
|
2114
|
-
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark
|
|
2114
|
+
className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2115
2115
|
children: e.t("sheet.cf.panel.styleType")
|
|
2116
2116
|
}
|
|
2117
2117
|
),
|
|
@@ -2119,8 +2119,8 @@ const Me = (t) => {
|
|
|
2119
2119
|
le,
|
|
2120
2120
|
{
|
|
2121
2121
|
className: "univer-mt-4 univer-w-full",
|
|
2122
|
-
value:
|
|
2123
|
-
options:
|
|
2122
|
+
value: p,
|
|
2123
|
+
options: g,
|
|
2124
2124
|
onChange: (E) => S(E)
|
|
2125
2125
|
}
|
|
2126
2126
|
),
|
|
@@ -2133,7 +2133,7 @@ const Me = (t) => {
|
|
|
2133
2133
|
}
|
|
2134
2134
|
),
|
|
2135
2135
|
/* @__PURE__ */ k("div", { className: "univer-mt-4 univer-flex univer-justify-end", children: [
|
|
2136
|
-
/* @__PURE__ */ c(Jt, { onClick:
|
|
2136
|
+
/* @__PURE__ */ c(Jt, { onClick: v, children: e.t("sheet.cf.panel.cancel") }),
|
|
2137
2137
|
/* @__PURE__ */ c(Jt, { className: "univer-ml-3", variant: "primary", onClick: x, children: e.t("sheet.cf.panel.submit") })
|
|
2138
2138
|
] })
|
|
2139
2139
|
] });
|
|
@@ -2165,15 +2165,15 @@ let De = class extends ce {
|
|
|
2165
2165
|
const n = this._localeService.getLocales(), i = e.split("."), s = n && this._localeService.resolveKeyPath(n, i);
|
|
2166
2166
|
if (typeof s == "string") {
|
|
2167
2167
|
const o = [];
|
|
2168
|
-
return this._findReplaceIndex(s).forEach((d, a,
|
|
2169
|
-
const l =
|
|
2168
|
+
return this._findReplaceIndex(s).forEach((d, a, h) => {
|
|
2169
|
+
const l = h[a - 1] || { endIndex: -1 };
|
|
2170
2170
|
if (l.endIndex + 1 < d.startIndex) {
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2171
|
+
const u = s.slice(l.endIndex + 1, d.startIndex);
|
|
2172
|
+
u && o.push(u);
|
|
2173
2173
|
}
|
|
2174
|
-
if (r[d.key] && o.push(r[d.key]), a ===
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2174
|
+
if (r[d.key] && o.push(r[d.key]), a === h.length - 1) {
|
|
2175
|
+
const u = s.slice(d.endIndex + 1);
|
|
2176
|
+
u && o.push(u);
|
|
2177
2177
|
}
|
|
2178
2178
|
}), o;
|
|
2179
2179
|
}
|
|
@@ -2223,14 +2223,14 @@ const Ni = (t, e) => {
|
|
|
2223
2223
|
};
|
|
2224
2224
|
let dn = 0;
|
|
2225
2225
|
const Mi = (t) => {
|
|
2226
|
-
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),
|
|
2227
|
-
if (!
|
|
2226
|
+
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), h = W(De), l = Dr(() => n.getCurrentTypeOfUnit$($.UNIVER_SHEET), void 0, void 0, []), u = l.getUnitId(), g = l.getActiveSheet();
|
|
2227
|
+
if (!g)
|
|
2228
2228
|
throw new Error("No active sheet found");
|
|
2229
|
-
const
|
|
2229
|
+
const p = g.getSheetId(), [S, f] = N([]), [T, _] = N("2"), [R, w] = N(0), [x, v] = N(-1), [C, b] = N(dn), y = de(null), M = [
|
|
2230
2230
|
{ label: o.t("sheet.cf.panel.workSheet"), value: "2" },
|
|
2231
2231
|
{ label: o.t("sheet.cf.panel.selectedRange"), value: "1" }
|
|
2232
2232
|
], E = () => {
|
|
2233
|
-
const D = r.getSubunitRules(
|
|
2233
|
+
const D = r.getSubunitRules(u, p);
|
|
2234
2234
|
if (!D || !D.length)
|
|
2235
2235
|
return [];
|
|
2236
2236
|
if (T === "1") {
|
|
@@ -2250,7 +2250,7 @@ const Mi = (t) => {
|
|
|
2250
2250
|
return () => D.dispose();
|
|
2251
2251
|
}), K(() => {
|
|
2252
2252
|
L(E);
|
|
2253
|
-
}, [T, R,
|
|
2253
|
+
}, [T, R, u, p]), K(() => {
|
|
2254
2254
|
if (T === "2")
|
|
2255
2255
|
return;
|
|
2256
2256
|
const D = new xe((B) => {
|
|
@@ -2265,7 +2265,7 @@ const Mi = (t) => {
|
|
|
2265
2265
|
return () => {
|
|
2266
2266
|
D.unsubscribe();
|
|
2267
2267
|
};
|
|
2268
|
-
}, [n, T,
|
|
2268
|
+
}, [n, T, u, p]), K(() => {
|
|
2269
2269
|
const D = r.$ruleChange.subscribe(() => {
|
|
2270
2270
|
w(Math.random());
|
|
2271
2271
|
});
|
|
@@ -2304,10 +2304,10 @@ const Mi = (t) => {
|
|
|
2304
2304
|
throw new Error("No active sheet found");
|
|
2305
2305
|
s.executeCommand(Kt.id, { unitId: B, subUnitId: G, cfId: D.cfId });
|
|
2306
2306
|
}, I = (D, B) => {
|
|
2307
|
-
|
|
2307
|
+
v(B.y);
|
|
2308
2308
|
}, H = (D, B, G) => {
|
|
2309
2309
|
var lt;
|
|
2310
|
-
|
|
2310
|
+
v(-1);
|
|
2311
2311
|
const Z = n.getCurrentUnitOfType($.UNIVER_SHEET).getUnitId(), ee = (lt = n.getCurrentUnitOfType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : lt.getSheetId();
|
|
2312
2312
|
if (!Z || !ee)
|
|
2313
2313
|
throw new Error("No active sheet found");
|
|
@@ -2319,7 +2319,7 @@ const Mi = (t) => {
|
|
|
2319
2319
|
}, Y = () => {
|
|
2320
2320
|
t.onCreate();
|
|
2321
2321
|
}, ge = () => {
|
|
2322
|
-
T === "2" ? s.executeCommand(Rn.id) : T === "1" && V.map((B) => ({ unitId:
|
|
2322
|
+
T === "2" ? s.executeCommand(Rn.id) : T === "1" && V.map((B) => ({ unitId: u, subUnitId: p, cfId: B.cfId })).forEach((B) => {
|
|
2323
2323
|
s.executeCommand(Kt.id, B);
|
|
2324
2324
|
});
|
|
2325
2325
|
}, me = J(() => {
|
|
@@ -2337,7 +2337,7 @@ const Mi = (t) => {
|
|
|
2337
2337
|
}, [V]);
|
|
2338
2338
|
return /* @__PURE__ */ k("div", { children: [
|
|
2339
2339
|
/* @__PURE__ */ k("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm", children: [
|
|
2340
|
-
/* @__PURE__ */ c("div", { className: "univer-flex univer-items-center univer-gap-2", children:
|
|
2340
|
+
/* @__PURE__ */ c("div", { className: "univer-flex univer-items-center univer-gap-2", children: h.tWithReactNode(
|
|
2341
2341
|
"sheet.cf.panel.managerRuleSelect",
|
|
2342
2342
|
/* @__PURE__ */ c(
|
|
2343
2343
|
le,
|
|
@@ -2385,13 +2385,13 @@ const Mi = (t) => {
|
|
|
2385
2385
|
children: me == null ? void 0 : me.map((D, B) => /* @__PURE__ */ c("div", { children: /* @__PURE__ */ k(
|
|
2386
2386
|
"div",
|
|
2387
2387
|
{
|
|
2388
|
-
className: X("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100", {
|
|
2389
|
-
"univer-bg-gray-100": x === B
|
|
2388
|
+
className: X("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", {
|
|
2389
|
+
"univer-bg-gray-100 dark:!univer-bg-gray-700": x === B
|
|
2390
2390
|
}),
|
|
2391
2391
|
onMouseMove: () => {
|
|
2392
|
-
D.ranges !== S &&
|
|
2392
|
+
D.ranges !== S && f(D.ranges);
|
|
2393
2393
|
},
|
|
2394
|
-
onMouseLeave: () =>
|
|
2394
|
+
onMouseLeave: () => f([]),
|
|
2395
2395
|
onClick: () => {
|
|
2396
2396
|
e(D);
|
|
2397
2397
|
},
|
|
@@ -2412,7 +2412,7 @@ const Mi = (t) => {
|
|
|
2412
2412
|
/* @__PURE__ */ c(
|
|
2413
2413
|
"div",
|
|
2414
2414
|
{
|
|
2415
|
-
className: "univer-text-sm univer-text-gray-900 dark
|
|
2415
|
+
className: "univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
2416
2416
|
children: Ni(D, o)
|
|
2417
2417
|
}
|
|
2418
2418
|
),
|
|
@@ -2428,7 +2428,7 @@ const Mi = (t) => {
|
|
|
2428
2428
|
"univer-flex univer-items-center univer-justify-center": x === B
|
|
2429
2429
|
}),
|
|
2430
2430
|
onClick: (G) => {
|
|
2431
|
-
G.stopPropagation(), m(D),
|
|
2431
|
+
G.stopPropagation(), m(D), f([]);
|
|
2432
2432
|
},
|
|
2433
2433
|
children: /* @__PURE__ */ c(gt, {})
|
|
2434
2434
|
}
|
|
@@ -2484,7 +2484,9 @@ let Qe = class extends ce {
|
|
|
2484
2484
|
this._sidebarDisposable = this._sidebarService.open(r);
|
|
2485
2485
|
}
|
|
2486
2486
|
_initPanel() {
|
|
2487
|
-
this.
|
|
2487
|
+
this.disposeWithMe(
|
|
2488
|
+
this._componentManager.register(ht, Vi)
|
|
2489
|
+
);
|
|
2488
2490
|
}
|
|
2489
2491
|
};
|
|
2490
2492
|
Qe = Fi([
|
|
@@ -2624,15 +2626,15 @@ let et = class extends ce {
|
|
|
2624
2626
|
const o = this._injector.invoke((l) => Er(n, l, e, r));
|
|
2625
2627
|
if (!o)
|
|
2626
2628
|
return;
|
|
2627
|
-
const { rows: d, cols: a } = o,
|
|
2628
|
-
d.forEach((l,
|
|
2629
|
-
a.forEach((
|
|
2630
|
-
const S = this._conditionalFormattingViewModel.getCellCfs(e, r, l,
|
|
2631
|
-
S && (S.forEach((
|
|
2629
|
+
const { rows: d, cols: a } = o, h = /* @__PURE__ */ new Set();
|
|
2630
|
+
d.forEach((l, u) => {
|
|
2631
|
+
a.forEach((g, p) => {
|
|
2632
|
+
const S = this._conditionalFormattingViewModel.getCellCfs(e, r, l, g);
|
|
2633
|
+
S && (S.forEach((f) => h.add(f.cfId)), i.setValue(u, p, S.map((f) => f.cfId)));
|
|
2632
2634
|
});
|
|
2633
|
-
}),
|
|
2634
|
-
const
|
|
2635
|
-
|
|
2635
|
+
}), h.forEach((l) => {
|
|
2636
|
+
const u = this._conditionalFormattingRuleModel.getRule(e, r, l);
|
|
2637
|
+
u && (s[l] = u.rule);
|
|
2636
2638
|
});
|
|
2637
2639
|
}
|
|
2638
2640
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -2652,13 +2654,13 @@ let et = class extends ce {
|
|
|
2652
2654
|
r.pasteType
|
|
2653
2655
|
))
|
|
2654
2656
|
return { redos: [], undos: [] };
|
|
2655
|
-
const { ranges: [a,
|
|
2656
|
-
pe.foreach(
|
|
2657
|
-
const { row: b, col: y } = l(
|
|
2657
|
+
const { ranges: [a, h], mapFunc: l } = Pn([r.copyRange, e]), u = Jr(a, h, !0), g = {};
|
|
2658
|
+
pe.foreach(h, (v, C) => {
|
|
2659
|
+
const { row: b, col: y } = l(v, C), M = this._conditionalFormattingViewModel.getCellCfs(s, o, b, y);
|
|
2658
2660
|
M && M.forEach((E) => {
|
|
2659
|
-
if (!
|
|
2661
|
+
if (!g[E.cfId]) {
|
|
2660
2662
|
const V = new we();
|
|
2661
|
-
|
|
2663
|
+
g[E.cfId] = V;
|
|
2662
2664
|
const L = this._conditionalFormattingRuleModel.getRule(s, o, E.cfId);
|
|
2663
2665
|
L == null || L.ranges.forEach((m) => {
|
|
2664
2666
|
pe.foreach(m, (I, H) => {
|
|
@@ -2666,17 +2668,17 @@ let et = class extends ce {
|
|
|
2666
2668
|
});
|
|
2667
2669
|
});
|
|
2668
2670
|
}
|
|
2669
|
-
|
|
2671
|
+
g[E.cfId].realDeleteValue(b, y);
|
|
2670
2672
|
});
|
|
2671
2673
|
});
|
|
2672
|
-
const { matrix:
|
|
2674
|
+
const { matrix: p, info: S } = this._copyInfo, f = [];
|
|
2673
2675
|
let T = this._conditionalFormattingRuleModel.createCfId(s, o);
|
|
2674
|
-
const _ = {}, R = (
|
|
2675
|
-
if (_[
|
|
2676
|
-
return _[
|
|
2677
|
-
const C = S == null ? void 0 : S.cfMap[
|
|
2676
|
+
const _ = {}, R = (v) => {
|
|
2677
|
+
if (_[v])
|
|
2678
|
+
return _[v];
|
|
2679
|
+
const C = S == null ? void 0 : S.cfMap[v], b = [...this._conditionalFormattingRuleModel.getSubunitRules(s, o) || [], ...f].find((y) => Wt.diffValue(y.rule, C));
|
|
2678
2680
|
if (b)
|
|
2679
|
-
return _[
|
|
2681
|
+
return _[v] = b, b;
|
|
2680
2682
|
{
|
|
2681
2683
|
const y = {
|
|
2682
2684
|
rule: C,
|
|
@@ -2684,11 +2686,11 @@ let et = class extends ce {
|
|
|
2684
2686
|
ranges: [],
|
|
2685
2687
|
stopIfTrue: !1
|
|
2686
2688
|
};
|
|
2687
|
-
return _[
|
|
2689
|
+
return _[v] = y, f.push(y), T = `${Number(T) + 1}`, y;
|
|
2688
2690
|
}
|
|
2689
2691
|
};
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
+
u.forEach((v) => {
|
|
2693
|
+
p && p.forValue((C, b, y) => {
|
|
2692
2694
|
const M = fe.getPositionRange(
|
|
2693
2695
|
{
|
|
2694
2696
|
startRow: C,
|
|
@@ -2696,41 +2698,41 @@ let et = class extends ce {
|
|
|
2696
2698
|
startColumn: b,
|
|
2697
2699
|
endColumn: b
|
|
2698
2700
|
},
|
|
2699
|
-
|
|
2701
|
+
v.startRange
|
|
2700
2702
|
), { row: E, col: V } = l(M.startRow, M.startColumn);
|
|
2701
2703
|
y.forEach((L) => {
|
|
2702
|
-
if (!
|
|
2704
|
+
if (!g[L]) {
|
|
2703
2705
|
const m = R(L), I = new we();
|
|
2704
|
-
|
|
2706
|
+
g[L] = I, m.ranges.forEach((H) => {
|
|
2705
2707
|
pe.foreach(H, (Y, ge) => {
|
|
2706
2708
|
I.setValue(Y, ge, 1);
|
|
2707
2709
|
});
|
|
2708
2710
|
});
|
|
2709
2711
|
}
|
|
2710
|
-
|
|
2712
|
+
g[L].setValue(E, V, 1);
|
|
2711
2713
|
});
|
|
2712
2714
|
});
|
|
2713
2715
|
});
|
|
2714
2716
|
const w = [], x = [];
|
|
2715
|
-
for (const
|
|
2716
|
-
const C = v
|
|
2717
|
+
for (const v in g) {
|
|
2718
|
+
const C = g[v], b = pt(Ct(C));
|
|
2717
2719
|
if (!b.length) {
|
|
2718
2720
|
const y = {
|
|
2719
2721
|
unitId: s,
|
|
2720
2722
|
subUnitId: o,
|
|
2721
|
-
cfId:
|
|
2723
|
+
cfId: v
|
|
2722
2724
|
};
|
|
2723
2725
|
w.push({ id: Se.id, params: y }), x.push(...Le(this._injector, y));
|
|
2724
2726
|
}
|
|
2725
|
-
if (
|
|
2726
|
-
const y = R(
|
|
2727
|
+
if (f.some((y) => y.cfId === v)) {
|
|
2728
|
+
const y = R(v), M = {
|
|
2727
2729
|
unitId: s,
|
|
2728
2730
|
subUnitId: o,
|
|
2729
2731
|
rule: { ...y, ranges: b }
|
|
2730
2732
|
};
|
|
2731
2733
|
w.push({ id: se.id, params: M }), x.push(xn(this._injector, M));
|
|
2732
2734
|
} else {
|
|
2733
|
-
const y = this._conditionalFormattingRuleModel.getRule(s, o,
|
|
2735
|
+
const y = this._conditionalFormattingRuleModel.getRule(s, o, v);
|
|
2734
2736
|
if (!y)
|
|
2735
2737
|
continue;
|
|
2736
2738
|
const M = {
|
|
@@ -2792,20 +2794,20 @@ let nt = class extends ce {
|
|
|
2792
2794
|
_initRefRange() {
|
|
2793
2795
|
const t = /* @__PURE__ */ new Map(), e = (n, i, s) => `${n}_${i}_${s}`, r = (n, i, s) => {
|
|
2794
2796
|
const o = (a) => {
|
|
2795
|
-
const
|
|
2796
|
-
if (Sr(l,
|
|
2797
|
+
const h = [...s.ranges], l = h.map((g) => Vr(g, a)).filter((g) => !!g);
|
|
2798
|
+
if (Sr(l, h))
|
|
2797
2799
|
return { redos: [], undos: [] };
|
|
2798
2800
|
if (l.length) {
|
|
2799
|
-
const
|
|
2800
|
-
return { redos:
|
|
2801
|
+
const g = { unitId: n, subUnitId: i, rule: { ...s, ranges: l } }, p = [{ id: be.id, params: g }], S = Ae(this._injector, g);
|
|
2802
|
+
return { redos: p, undos: S };
|
|
2801
2803
|
} else {
|
|
2802
|
-
const
|
|
2803
|
-
return { redos:
|
|
2804
|
+
const g = { unitId: n, subUnitId: i, cfId: s.cfId }, p = [{ id: Se.id, params: g }], S = Le(this._injector, g);
|
|
2805
|
+
return { redos: p, undos: S };
|
|
2804
2806
|
}
|
|
2805
2807
|
}, d = [];
|
|
2806
2808
|
s.ranges.forEach((a) => {
|
|
2807
|
-
const
|
|
2808
|
-
d.push(() =>
|
|
2809
|
+
const h = this._refRangeService.registerRefRange(a, o);
|
|
2810
|
+
d.push(() => h.dispose());
|
|
2809
2811
|
}), t.set(e(n, i, s.cfId), () => d.forEach((a) => a()));
|
|
2810
2812
|
};
|
|
2811
2813
|
this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((n) => {
|
|
@@ -2817,13 +2819,13 @@ let nt = class extends ce {
|
|
|
2817
2819
|
break;
|
|
2818
2820
|
}
|
|
2819
2821
|
case "delete": {
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
+
const h = t.get(e(i, s, o.cfId));
|
|
2823
|
+
h && h();
|
|
2822
2824
|
break;
|
|
2823
2825
|
}
|
|
2824
2826
|
case "set": {
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
+
const h = t.get(e(i, s, o.cfId));
|
|
2828
|
+
h && h(), r(n.unitId, n.subUnitId, n.rule);
|
|
2827
2829
|
}
|
|
2828
2830
|
}
|
|
2829
2831
|
})), this.disposeWithMe(Cn(() => {
|
|
@@ -2948,53 +2950,53 @@ let It = class extends ce {
|
|
|
2948
2950
|
// eslint-disable-next-line max-lines-per-function
|
|
2949
2951
|
_initAutoFill() {
|
|
2950
2952
|
const t = () => ({ redos: [], undos: [] }), e = (i, s, o, d, a) => {
|
|
2951
|
-
var
|
|
2952
|
-
const
|
|
2953
|
-
if (!
|
|
2953
|
+
var p;
|
|
2954
|
+
const h = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getUnitId(), l = (p = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : p.getSheetId();
|
|
2955
|
+
if (!h || !l)
|
|
2954
2956
|
return;
|
|
2955
|
-
const
|
|
2957
|
+
const u = {
|
|
2956
2958
|
startRow: i.row,
|
|
2957
2959
|
startColumn: i.col,
|
|
2958
2960
|
endColumn: i.col,
|
|
2959
2961
|
endRow: i.row
|
|
2960
|
-
},
|
|
2962
|
+
}, g = {
|
|
2961
2963
|
startRow: s.row,
|
|
2962
2964
|
startColumn: s.col,
|
|
2963
2965
|
endColumn: s.col,
|
|
2964
2966
|
endRow: s.row
|
|
2965
2967
|
};
|
|
2966
|
-
pe.foreach(o, (S,
|
|
2968
|
+
pe.foreach(o, (S, f) => {
|
|
2967
2969
|
const T = fe.getPositionRange(
|
|
2968
2970
|
{
|
|
2969
2971
|
startRow: S,
|
|
2970
|
-
startColumn:
|
|
2971
|
-
endColumn:
|
|
2972
|
+
startColumn: f,
|
|
2973
|
+
endColumn: f,
|
|
2972
2974
|
endRow: S
|
|
2973
2975
|
},
|
|
2974
|
-
|
|
2976
|
+
u
|
|
2975
2977
|
), _ = fe.getPositionRange(
|
|
2976
2978
|
{
|
|
2977
2979
|
startRow: S,
|
|
2978
|
-
startColumn:
|
|
2979
|
-
endColumn:
|
|
2980
|
+
startColumn: f,
|
|
2981
|
+
endColumn: f,
|
|
2980
2982
|
endRow: S
|
|
2981
2983
|
},
|
|
2982
|
-
|
|
2984
|
+
g
|
|
2983
2985
|
), { row: R, col: w } = a(T.startRow, T.startColumn), x = this._conditionalFormattingViewModel.getCellCfs(
|
|
2984
|
-
|
|
2986
|
+
h,
|
|
2985
2987
|
l,
|
|
2986
2988
|
R,
|
|
2987
2989
|
w
|
|
2988
|
-
), { row:
|
|
2989
|
-
|
|
2990
|
+
), { row: v, col: C } = a(_.startRow, _.startColumn), b = this._conditionalFormattingViewModel.getCellCfs(
|
|
2991
|
+
h,
|
|
2990
2992
|
l,
|
|
2991
|
-
|
|
2993
|
+
v,
|
|
2992
2994
|
C
|
|
2993
2995
|
);
|
|
2994
2996
|
b && b.forEach((y) => {
|
|
2995
2997
|
let M = d.get(y.cfId);
|
|
2996
2998
|
if (!d.get(y.cfId)) {
|
|
2997
|
-
const E = this._conditionalFormattingRuleModel.getRule(
|
|
2999
|
+
const E = this._conditionalFormattingRuleModel.getRule(h, l, y.cfId);
|
|
2998
3000
|
if (!E)
|
|
2999
3001
|
return;
|
|
3000
3002
|
M = new we(), E.ranges.forEach((V) => {
|
|
@@ -3003,11 +3005,11 @@ let It = class extends ce {
|
|
|
3003
3005
|
});
|
|
3004
3006
|
}), d.set(y.cfId, M);
|
|
3005
3007
|
}
|
|
3006
|
-
M.realDeleteValue(
|
|
3008
|
+
M.realDeleteValue(v, C);
|
|
3007
3009
|
}), x && x.forEach((y) => {
|
|
3008
3010
|
let M = d.get(y.cfId);
|
|
3009
3011
|
if (!d.get(y.cfId)) {
|
|
3010
|
-
const E = this._conditionalFormattingRuleModel.getRule(
|
|
3012
|
+
const E = this._conditionalFormattingRuleModel.getRule(h, l, y.cfId);
|
|
3011
3013
|
if (!E)
|
|
3012
3014
|
return;
|
|
3013
3015
|
M = new we(), E.ranges.forEach((V) => {
|
|
@@ -3016,22 +3018,22 @@ let It = class extends ce {
|
|
|
3016
3018
|
});
|
|
3017
3019
|
}), d.set(y.cfId, M);
|
|
3018
3020
|
}
|
|
3019
|
-
M.setValue(
|
|
3021
|
+
M.setValue(v, C, 1);
|
|
3020
3022
|
});
|
|
3021
3023
|
});
|
|
3022
3024
|
}, r = (i, s) => {
|
|
3023
3025
|
var _, R, w;
|
|
3024
|
-
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(),
|
|
3026
|
+
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(), h = [], l = [];
|
|
3025
3027
|
if (!o || !d)
|
|
3026
3028
|
return t();
|
|
3027
|
-
const
|
|
3028
|
-
row:
|
|
3029
|
-
col:
|
|
3029
|
+
const u = Pn([i, s]), [g, p] = u.ranges, { mapFunc: S } = u, f = {
|
|
3030
|
+
row: g.startRow,
|
|
3031
|
+
col: g.startColumn
|
|
3030
3032
|
};
|
|
3031
|
-
return ei(
|
|
3032
|
-
e(
|
|
3033
|
-
}), a.forEach((x,
|
|
3034
|
-
const C = this._conditionalFormattingRuleModel.getRule(o, d,
|
|
3033
|
+
return ei(g, p).forEach((x) => {
|
|
3034
|
+
e(f, x.repeatStartCell, x.relativeRange, a, S);
|
|
3035
|
+
}), a.forEach((x, v) => {
|
|
3036
|
+
const C = this._conditionalFormattingRuleModel.getRule(o, d, v);
|
|
3035
3037
|
if (!C)
|
|
3036
3038
|
return;
|
|
3037
3039
|
const b = pt(Ct(x));
|
|
@@ -3041,18 +3043,18 @@ let It = class extends ce {
|
|
|
3041
3043
|
subUnitId: d,
|
|
3042
3044
|
rule: { ...C, ranges: b }
|
|
3043
3045
|
};
|
|
3044
|
-
|
|
3046
|
+
h.push({ id: be.id, params: y }), l.push(...Ae(this._injector, y));
|
|
3045
3047
|
} else {
|
|
3046
3048
|
const y = {
|
|
3047
3049
|
unitId: o,
|
|
3048
3050
|
subUnitId: d,
|
|
3049
3051
|
cfId: C.cfId
|
|
3050
3052
|
};
|
|
3051
|
-
|
|
3053
|
+
h.push({ id: Se.id, params: y }), l.push(...Le(this._injector, y));
|
|
3052
3054
|
}
|
|
3053
3055
|
}), {
|
|
3054
3056
|
undos: l,
|
|
3055
|
-
redos:
|
|
3057
|
+
redos: h
|
|
3056
3058
|
};
|
|
3057
3059
|
}, n = {
|
|
3058
3060
|
id: st,
|
|
@@ -3089,17 +3091,17 @@ let _t = class extends ce {
|
|
|
3089
3091
|
var i;
|
|
3090
3092
|
const e = [], r = [], n = { redos: e, undos: r };
|
|
3091
3093
|
if ([Fr.id, Ur.id].includes(t.id)) {
|
|
3092
|
-
const s = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((
|
|
3094
|
+
const s = (i = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : i.map((p) => p.range);
|
|
3093
3095
|
if (!s)
|
|
3094
3096
|
return n;
|
|
3095
3097
|
const o = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET), d = o.getActiveSheet();
|
|
3096
3098
|
if (!d)
|
|
3097
3099
|
return n;
|
|
3098
|
-
const a = o.getUnitId(),
|
|
3100
|
+
const a = o.getUnitId(), h = d.getSheetId(), l = this._conditionalFormattingRuleModel.getSubunitRules(a, h);
|
|
3099
3101
|
if (!l || !l.length)
|
|
3100
3102
|
return n;
|
|
3101
|
-
const { redos:
|
|
3102
|
-
e.push(...
|
|
3103
|
+
const { redos: u, undos: g } = hn(this._injector, l, s, a, h);
|
|
3104
|
+
e.push(...u), r.push(...g);
|
|
3103
3105
|
}
|
|
3104
3106
|
return n;
|
|
3105
3107
|
}
|
|
@@ -3126,18 +3128,18 @@ _t = Yi([
|
|
|
3126
3128
|
], _t);
|
|
3127
3129
|
function hn(t, e, r, n, i) {
|
|
3128
3130
|
const s = [], o = [];
|
|
3129
|
-
return e.filter((d) => r.some((a) => d.ranges.some((
|
|
3130
|
-
const
|
|
3131
|
-
if (
|
|
3131
|
+
return e.filter((d) => r.some((a) => d.ranges.some((h) => fe.getIntersects(h, a)))).forEach((d) => {
|
|
3132
|
+
const h = new Pr().add(...d.ranges).subtract(...r).merge();
|
|
3133
|
+
if (h.length) {
|
|
3132
3134
|
const l = {
|
|
3133
3135
|
id: be.id,
|
|
3134
3136
|
params: {
|
|
3135
3137
|
unitId: n,
|
|
3136
3138
|
subUnitId: i,
|
|
3137
|
-
rule: { ...d, ranges:
|
|
3139
|
+
rule: { ...d, ranges: h }
|
|
3138
3140
|
}
|
|
3139
|
-
},
|
|
3140
|
-
s.push(l), o.push(...
|
|
3141
|
+
}, u = Ae(t, l.params);
|
|
3142
|
+
s.push(l), o.push(...u);
|
|
3141
3143
|
} else {
|
|
3142
3144
|
const l = {
|
|
3143
3145
|
id: Se.id,
|
|
@@ -3146,8 +3148,8 @@ function hn(t, e, r, n, i) {
|
|
|
3146
3148
|
subUnitId: i,
|
|
3147
3149
|
cfId: d.cfId
|
|
3148
3150
|
}
|
|
3149
|
-
},
|
|
3150
|
-
s.push(l), o.push(...
|
|
3151
|
+
}, u = Le(t, l.params);
|
|
3152
|
+
s.push(l), o.push(...u);
|
|
3151
3153
|
}
|
|
3152
3154
|
}), { redos: s, undos: o };
|
|
3153
3155
|
}
|
|
@@ -3176,18 +3178,18 @@ let Tt = class extends ce {
|
|
|
3176
3178
|
t || r(t);
|
|
3177
3179
|
const n = this._conditionalFormattingService.composeStyle(e.unitId, e.subUnitId, e.row, e.col), i = (o = n == null ? void 0 : n.style) != null ? o : {}, s = Object.keys(i);
|
|
3178
3180
|
if (t != null && t.p)
|
|
3179
|
-
return (a = (d = t.p.body) == null ? void 0 : d.textRuns) == null || a.forEach((
|
|
3180
|
-
|
|
3181
|
-
var
|
|
3182
|
-
(
|
|
3181
|
+
return (a = (d = t.p.body) == null ? void 0 : d.textRuns) == null || a.forEach((h) => {
|
|
3182
|
+
h.ts && s.forEach((l) => {
|
|
3183
|
+
var u;
|
|
3184
|
+
(u = h.ts) == null || delete u[l];
|
|
3183
3185
|
});
|
|
3184
3186
|
}), r(t);
|
|
3185
3187
|
{
|
|
3186
|
-
const
|
|
3187
|
-
s.forEach((
|
|
3188
|
-
delete u
|
|
3188
|
+
const h = { ...(typeof (t == null ? void 0 : t.s) == "string" ? e.workbook.getStyles().get(t.s) : t == null ? void 0 : t.s) || {} };
|
|
3189
|
+
s.forEach((u) => {
|
|
3190
|
+
delete h[u];
|
|
3189
3191
|
});
|
|
3190
|
-
const l = { ...t, s: { ...
|
|
3192
|
+
const l = { ...t, s: { ...h } };
|
|
3191
3193
|
return r(l);
|
|
3192
3194
|
}
|
|
3193
3195
|
}
|
|
@@ -3283,48 +3285,48 @@ const gn = [
|
|
|
3283
3285
|
const e = t.get($e), r = t.get(te), n = t.get(z), i = t.get(Q), s = new xe((a) => Ln(
|
|
3284
3286
|
e.selectionMoveEnd$,
|
|
3285
3287
|
e.selectionSet$,
|
|
3286
|
-
new xe((
|
|
3287
|
-
const l = r.onCommandExecuted((
|
|
3288
|
-
var
|
|
3289
|
-
const { id:
|
|
3290
|
-
gn.includes(
|
|
3288
|
+
new xe((h) => {
|
|
3289
|
+
const l = r.onCommandExecuted((u) => {
|
|
3290
|
+
var f;
|
|
3291
|
+
const { id: g, params: p } = u, S = (f = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : f.getUnitId();
|
|
3292
|
+
gn.includes(g) && p.unitId === S && h.next(null);
|
|
3291
3293
|
});
|
|
3292
3294
|
return () => l.dispose();
|
|
3293
3295
|
})
|
|
3294
3296
|
).pipe(rn(16)).subscribe(() => {
|
|
3295
|
-
var
|
|
3296
|
-
const
|
|
3297
|
+
var f;
|
|
3298
|
+
const h = ((f = e.getCurrentSelections()) == null ? void 0 : f.map((T) => T.range)) || [], l = n.getCurrentUnitForType($.UNIVER_SHEET);
|
|
3297
3299
|
if (!l) return;
|
|
3298
|
-
const
|
|
3299
|
-
if (!
|
|
3300
|
-
const S = (i.getSubunitRules(l.getUnitId(),
|
|
3300
|
+
const u = l.getActiveSheet();
|
|
3301
|
+
if (!u) return;
|
|
3302
|
+
const S = (i.getSubunitRules(l.getUnitId(), u.getSheetId()) || []).filter((T) => T.ranges.some((_) => h.some((R) => fe.intersects(R, _)))).map((T) => T.ranges).every((T) => ft(t, l.getUnitId(), u.getSheetId(), T));
|
|
3301
3303
|
a.next(S);
|
|
3302
3304
|
})), o = new xe(
|
|
3303
|
-
(a) => new xe((
|
|
3304
|
-
const l = r.onCommandExecuted((
|
|
3305
|
-
var
|
|
3306
|
-
const { id:
|
|
3307
|
-
gn.includes(
|
|
3305
|
+
(a) => new xe((h) => {
|
|
3306
|
+
const l = r.onCommandExecuted((u) => {
|
|
3307
|
+
var f;
|
|
3308
|
+
const { id: g, params: p } = u, S = (f = n.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : f.getUnitId();
|
|
3309
|
+
gn.includes(g) && p.unitId === S && h.next(null);
|
|
3308
3310
|
});
|
|
3309
3311
|
return () => l.dispose();
|
|
3310
3312
|
}).pipe(rn(16)).subscribe(() => {
|
|
3311
|
-
const
|
|
3312
|
-
if (!
|
|
3313
|
-
const l =
|
|
3313
|
+
const h = n.getCurrentUnitForType($.UNIVER_SHEET);
|
|
3314
|
+
if (!h) return;
|
|
3315
|
+
const l = h.getActiveSheet();
|
|
3314
3316
|
if (!l) return;
|
|
3315
|
-
const
|
|
3316
|
-
if (!
|
|
3317
|
+
const u = i.getSubunitRules(h.getUnitId(), l.getSheetId()) || [];
|
|
3318
|
+
if (!u.length)
|
|
3317
3319
|
return a.next(!1), !1;
|
|
3318
|
-
const
|
|
3319
|
-
a.next(
|
|
3320
|
+
const g = u.map((p) => p.ranges).every((p) => ft(t, h.getUnitId(), l.getSheetId(), p));
|
|
3321
|
+
a.next(g);
|
|
3320
3322
|
})
|
|
3321
3323
|
), d = new xe((a) => {
|
|
3322
|
-
s.subscribe((
|
|
3323
|
-
const l = Ye.find((
|
|
3324
|
-
l && (l.disabled = !
|
|
3325
|
-
}), o.subscribe((
|
|
3326
|
-
const l = Ye.find((
|
|
3327
|
-
l && (l.disabled = !
|
|
3324
|
+
s.subscribe((h) => {
|
|
3325
|
+
const l = Ye.find((u) => u.value === ie.clearRangeRules);
|
|
3326
|
+
l && (l.disabled = !h, a.next(Ye));
|
|
3327
|
+
}), o.subscribe((h) => {
|
|
3328
|
+
const l = Ye.find((u) => u.value === ie.clearWorkSheetRules);
|
|
3329
|
+
l && (l.disabled = !h, a.next(Ye));
|
|
3328
3330
|
}), a.next(Ye);
|
|
3329
3331
|
});
|
|
3330
3332
|
return {
|
|
@@ -3337,9 +3339,9 @@ const gn = [
|
|
|
3337
3339
|
disabled$: ti(t, { workbookTypes: [kn], worksheetTypes: [Mn, Nn], rangeTypes: [Vn] })
|
|
3338
3340
|
};
|
|
3339
3341
|
}, Qi = {
|
|
3340
|
-
[Hr.
|
|
3342
|
+
[Hr.RULES]: {
|
|
3341
3343
|
[kt.id]: {
|
|
3342
|
-
order:
|
|
3344
|
+
order: 1,
|
|
3343
3345
|
menuItemFactory: Ji
|
|
3344
3346
|
}
|
|
3345
3347
|
}
|
|
@@ -3366,7 +3368,7 @@ var ns = Object.getOwnPropertyDescriptor, rs = (t, e, r, n) => {
|
|
|
3366
3368
|
return i;
|
|
3367
3369
|
}, Oe = (t, e) => (r, n) => e(r, n, t);
|
|
3368
3370
|
const is = (t, e) => {
|
|
3369
|
-
const r = (l) => l.endRow - l.startRow + 1, n = (l) => l.endColumn - l.startColumn + 1, i = r(e) % r(t), s = n(e) % n(t), o = Math.floor(r(e) / r(t)), d = Math.floor(n(e) / n(t)), a = [],
|
|
3371
|
+
const r = (l) => l.endRow - l.startRow + 1, n = (l) => l.endColumn - l.startColumn + 1, i = r(e) % r(t), s = n(e) % n(t), o = Math.floor(r(e) / r(t)), d = Math.floor(n(e) / n(t)), a = [], h = {
|
|
3370
3372
|
startRow: 0,
|
|
3371
3373
|
endRow: r(t) - 1,
|
|
3372
3374
|
startColumn: 0,
|
|
@@ -3379,18 +3381,18 @@ const is = (t, e) => {
|
|
|
3379
3381
|
startColumn: e.startColumn,
|
|
3380
3382
|
endColumn: e.startColumn
|
|
3381
3383
|
};
|
|
3382
|
-
return a.push({ repeatRelativeRange:
|
|
3384
|
+
return a.push({ repeatRelativeRange: h, startRange: l }), a;
|
|
3383
3385
|
}
|
|
3384
3386
|
for (let l = 0; l < o + (i ? 0.1 : 0); l++)
|
|
3385
|
-
for (let
|
|
3386
|
-
const
|
|
3387
|
-
startRow:
|
|
3388
|
-
endRow:
|
|
3389
|
-
startColumn:
|
|
3390
|
-
endColumn:
|
|
3387
|
+
for (let u = 0; u < d + (s ? 0.1 : 0); u++) {
|
|
3388
|
+
const g = r(t) * l, p = n(t) * u, S = {
|
|
3389
|
+
startRow: g + e.startRow,
|
|
3390
|
+
endRow: g + e.startRow,
|
|
3391
|
+
startColumn: p + e.startColumn,
|
|
3392
|
+
endColumn: p + e.startColumn
|
|
3391
3393
|
};
|
|
3392
|
-
let
|
|
3393
|
-
l === o && i && (
|
|
3394
|
+
let f = h;
|
|
3395
|
+
l === o && i && (f = { ...f }, f.endRow = f.endRow - (r(t) - i)), u === d && s && (f = { ...f }, f.endColumn = f.endColumn - (n(t) - s)), a.push({ repeatRelativeRange: f, startRange: S });
|
|
3394
3396
|
}
|
|
3395
3397
|
return a;
|
|
3396
3398
|
};
|
|
@@ -3402,13 +3404,13 @@ let xt = class extends ce {
|
|
|
3402
3404
|
}
|
|
3403
3405
|
// eslint-disable-next-line max-lines-per-function
|
|
3404
3406
|
_initFormattingPainter() {
|
|
3405
|
-
const e = () => ({ redos: [], undos: [] }), r = (s, o, d, a,
|
|
3406
|
-
const { unitId: l, subUnitId:
|
|
3407
|
+
const e = () => ({ redos: [], undos: [] }), r = (s, o, d, a, h) => {
|
|
3408
|
+
const { unitId: l, subUnitId: u } = this._painterConfig, { targetUnitId: g, targetSubUnitId: p } = h, S = {
|
|
3407
3409
|
startRow: s.row,
|
|
3408
3410
|
startColumn: s.col,
|
|
3409
3411
|
endColumn: s.col,
|
|
3410
3412
|
endRow: s.row
|
|
3411
|
-
},
|
|
3413
|
+
}, f = {
|
|
3412
3414
|
startRow: o.row,
|
|
3413
3415
|
startColumn: o.col,
|
|
3414
3416
|
endColumn: o.col,
|
|
@@ -3430,22 +3432,22 @@ let xt = class extends ce {
|
|
|
3430
3432
|
endColumn: _,
|
|
3431
3433
|
endRow: T
|
|
3432
3434
|
},
|
|
3433
|
-
|
|
3435
|
+
f
|
|
3434
3436
|
), x = this._conditionalFormattingViewModel.getCellCfs(
|
|
3435
3437
|
l,
|
|
3436
|
-
|
|
3438
|
+
u,
|
|
3437
3439
|
R.startRow,
|
|
3438
3440
|
R.startColumn
|
|
3439
|
-
),
|
|
3440
|
-
|
|
3441
|
-
|
|
3441
|
+
), v = this._conditionalFormattingViewModel.getCellCfs(
|
|
3442
|
+
g,
|
|
3443
|
+
p,
|
|
3442
3444
|
w.startRow,
|
|
3443
3445
|
w.startColumn
|
|
3444
3446
|
);
|
|
3445
|
-
|
|
3447
|
+
v && v.forEach((C) => {
|
|
3446
3448
|
let b = a.get(C.cfId);
|
|
3447
3449
|
if (!a.get(C.cfId)) {
|
|
3448
|
-
const y = this._conditionalFormattingRuleModel.getRule(
|
|
3450
|
+
const y = this._conditionalFormattingRuleModel.getRule(g, p, C.cfId);
|
|
3449
3451
|
if (!y)
|
|
3450
3452
|
return;
|
|
3451
3453
|
b = new we(), y.ranges.forEach((M) => {
|
|
@@ -3462,19 +3464,19 @@ let xt = class extends ce {
|
|
|
3462
3464
|
});
|
|
3463
3465
|
}, n = (s, o, d) => {
|
|
3464
3466
|
var R;
|
|
3465
|
-
const { range: a, unitId:
|
|
3466
|
-
if (!s || !o || !
|
|
3467
|
+
const { range: a, unitId: h, subUnitId: l } = this._painterConfig, u = s !== h || l !== o, g = /* @__PURE__ */ new Map(), p = [], S = [];
|
|
3468
|
+
if (!s || !o || !h || !l)
|
|
3467
3469
|
return e();
|
|
3468
|
-
const
|
|
3469
|
-
|
|
3470
|
-
const { ranges: x, cfId:
|
|
3470
|
+
const f = (R = this._conditionalFormattingRuleModel.getSubunitRules(h, l)) != null ? R : [];
|
|
3471
|
+
f == null || f.forEach((w) => {
|
|
3472
|
+
const { ranges: x, cfId: v } = w;
|
|
3471
3473
|
if (x.some((C) => fe.intersects(a, C))) {
|
|
3472
3474
|
const C = new we();
|
|
3473
|
-
|
|
3475
|
+
u || x.forEach((b) => {
|
|
3474
3476
|
pe.foreach(b, (y, M) => {
|
|
3475
3477
|
C.setValue(y, M, 1);
|
|
3476
3478
|
});
|
|
3477
|
-
}),
|
|
3479
|
+
}), g.set(v, C);
|
|
3478
3480
|
}
|
|
3479
3481
|
});
|
|
3480
3482
|
const T = {
|
|
@@ -3482,28 +3484,28 @@ let xt = class extends ce {
|
|
|
3482
3484
|
col: a.startColumn
|
|
3483
3485
|
};
|
|
3484
3486
|
return is(a, d).forEach((w) => {
|
|
3485
|
-
r(T, { row: w.startRange.startRow, col: w.startRange.startColumn }, w.repeatRelativeRange,
|
|
3486
|
-
}),
|
|
3487
|
-
if (
|
|
3488
|
-
const
|
|
3489
|
-
if (
|
|
3487
|
+
r(T, { row: w.startRange.startRow, col: w.startRange.startColumn }, w.repeatRelativeRange, g, { targetUnitId: s, targetSubUnitId: o });
|
|
3488
|
+
}), g.forEach((w, x) => {
|
|
3489
|
+
if (u) {
|
|
3490
|
+
const v = this._conditionalFormattingRuleModel.getRule(s, o, x), C = pt(Ct(w));
|
|
3491
|
+
if (v)
|
|
3490
3492
|
if (C.length) {
|
|
3491
3493
|
const b = {
|
|
3492
3494
|
unitId: s,
|
|
3493
3495
|
subUnitId: o,
|
|
3494
|
-
rule: { ...
|
|
3496
|
+
rule: { ...v, ranges: C }
|
|
3495
3497
|
};
|
|
3496
|
-
|
|
3498
|
+
p.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
|
|
3497
3499
|
} else {
|
|
3498
3500
|
const b = {
|
|
3499
3501
|
unitId: s,
|
|
3500
3502
|
subUnitId: o,
|
|
3501
|
-
cfId:
|
|
3503
|
+
cfId: v.cfId
|
|
3502
3504
|
};
|
|
3503
|
-
|
|
3505
|
+
p.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
|
|
3504
3506
|
}
|
|
3505
3507
|
else if (C.length) {
|
|
3506
|
-
const b = this._conditionalFormattingRuleModel.getRule(
|
|
3508
|
+
const b = this._conditionalFormattingRuleModel.getRule(h, l, x);
|
|
3507
3509
|
if (b) {
|
|
3508
3510
|
const y = {
|
|
3509
3511
|
unitId: s,
|
|
@@ -3514,33 +3516,33 @@ let xt = class extends ce {
|
|
|
3514
3516
|
ranges: C
|
|
3515
3517
|
}
|
|
3516
3518
|
};
|
|
3517
|
-
|
|
3519
|
+
p.push({ id: se.id, params: y }), S.push(xn(this._injector, y));
|
|
3518
3520
|
}
|
|
3519
3521
|
}
|
|
3520
3522
|
} else {
|
|
3521
|
-
const
|
|
3522
|
-
if (!
|
|
3523
|
+
const v = this._conditionalFormattingRuleModel.getRule(h, l, x);
|
|
3524
|
+
if (!v)
|
|
3523
3525
|
return;
|
|
3524
3526
|
const C = pt(Ct(w));
|
|
3525
3527
|
if (C.length) {
|
|
3526
3528
|
const b = {
|
|
3527
|
-
unitId:
|
|
3529
|
+
unitId: h,
|
|
3528
3530
|
subUnitId: l,
|
|
3529
|
-
rule: { ...
|
|
3531
|
+
rule: { ...v, ranges: C }
|
|
3530
3532
|
};
|
|
3531
|
-
|
|
3533
|
+
p.push({ id: be.id, params: b }), S.push(...Ae(this._injector, b));
|
|
3532
3534
|
} else {
|
|
3533
3535
|
const b = {
|
|
3534
|
-
unitId:
|
|
3536
|
+
unitId: h,
|
|
3535
3537
|
subUnitId: l,
|
|
3536
|
-
cfId:
|
|
3538
|
+
cfId: v.cfId
|
|
3537
3539
|
};
|
|
3538
|
-
|
|
3540
|
+
p.push({ id: Se.id, params: b }), S.push(...Le(this._injector, b));
|
|
3539
3541
|
}
|
|
3540
3542
|
}
|
|
3541
3543
|
}), {
|
|
3542
3544
|
undos: S,
|
|
3543
|
-
redos:
|
|
3545
|
+
redos: p
|
|
3544
3546
|
};
|
|
3545
3547
|
}, i = {
|
|
3546
3548
|
id: st,
|
|
@@ -3549,8 +3551,8 @@ let xt = class extends ce {
|
|
|
3549
3551
|
switch (s) {
|
|
3550
3552
|
case Ot.INFINITE:
|
|
3551
3553
|
case Ot.ONCE: {
|
|
3552
|
-
const
|
|
3553
|
-
|
|
3554
|
+
const h = (o = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : o.getUnitId(), l = (a = (d = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET)) == null ? void 0 : d.getActiveSheet()) == null ? void 0 : a.getSheetId(), u = this._sheetsSelectionsService.getCurrentLastSelection(), g = u == null ? void 0 : u.range;
|
|
3555
|
+
h && l && g && (this._painterConfig = { unitId: h, subUnitId: l, range: g });
|
|
3554
3556
|
break;
|
|
3555
3557
|
}
|
|
3556
3558
|
case Ot.OFF: {
|
|
@@ -3592,8 +3594,8 @@ let wt = class extends ce {
|
|
|
3592
3594
|
const s = i.with(On);
|
|
3593
3595
|
this.disposeWithMe(s.currentSkeleton$.subscribe((o) => {
|
|
3594
3596
|
if (o) {
|
|
3595
|
-
const d = o.skeleton.rowColumnSegment, a = d.endColumn - d.startColumn + 1, l = (d.endRow - d.startRow + 1) * a * 9,
|
|
3596
|
-
this._conditionalFormattingViewModel.setCacheLength(
|
|
3597
|
+
const d = o.skeleton.rowColumnSegment, a = d.endColumn - d.startColumn + 1, l = (d.endRow - d.startRow + 1) * a * 9, u = Math.max(Tr, l);
|
|
3598
|
+
this._conditionalFormattingViewModel.setCacheLength(u);
|
|
3597
3599
|
}
|
|
3598
3600
|
}));
|
|
3599
3601
|
};
|