@univerjs/sheets-conditional-formatting-ui 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +694 -699
- package/lib/types/controllers/cf.auto-fill.controller.d.ts +1 -2
- package/lib/types/controllers/cf.clear.controller.d.ts +1 -2
- package/lib/types/controllers/cf.copy-paste.controller.d.ts +1 -2
- package/lib/types/controllers/cf.menu.controller.d.ts +1 -2
- package/lib/types/controllers/cf.ref-range.controller.d.ts +1 -2
- package/lib/types/menu/manage-rule.d.ts +1 -1
- package/lib/types/mobile-plugin.d.ts +1 -2
- package/lib/types/plugin.d.ts +1 -2
- package/lib/umd/index.js +3 -3
- package/package.json +18 -20
package/lib/es/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var ra = Object.defineProperty;
|
|
2
2
|
var oa = (e, t, n) => t in e ? ra(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Qt = (e, t, n) => oa(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { CommandType as Re, ICommandService as ue, IUniverInstanceService as re, IUndoRedoService as qt, ObjectMatrix as Vt, Range as ut, sequenceExecute as yi, UniverInstanceType as G, Rectangle as At, ColorKit as bi, BooleanNumber as He, Disposable as rt, OnLifecycle as ot, LifecycleStages as it, LocaleService as $e, createInterceptorKey as Si, createInternalEditorID as yn, Tools as bn, InterceptorManager as ia, toDisposable as Ci, Plugin as _i, DependentOn as wi } from "@univerjs/core";
|
|
5
|
-
import {
|
|
6
|
-
import { ConditionalFormattingRuleModel as he, CFRuleType as L, CFSubRuleType as j, AddConditionalRuleMutation as De, CFNumberOperator as F, setConditionalRuleMutationUndoFactory as Bt, SetConditionalRuleMutation as nt, DeleteConditionalRuleMutationUndoFactory as It, DeleteConditionalRuleMutation as Ye, MoveConditionalRuleMutation as Ln, transformSupportSymmetryAnchor as sa, MoveConditionalRuleMutationUndoFactory as aa, getColorScaleFromValue as la, iconMap as bt, DEFAULT_BG_COLOR as ca, DEFAULT_FONT_COLOR as ua, AddConditionalRuleMutationUndoFactory as xi, CFValueType as A, createDefaultValueByValueType as cn, SHEET_CONDITIONAL_FORMATTING_PLUGIN as st, removeUndefinedAttr as da, createDefaultValue as Pr, CFTextOperator as X, CFTimePeriodOperator as Ge, iconGroup as fa, getOppositeOperator as Dr, compareWithNumber as ha, EMPTY_ICON_TYPE as pa, createDefaultRule as ft, DEFAULT_PADDING as ga, DEFAULT_WIDTH as ma, ConditionalFormattingService as Ri, ConditionalFormattingViewModel as Ar, isRangesEqual as va, UniverSheetsConditionalFormattingPlugin as Ii, getStringFromDataStream as ya } from "@univerjs/sheets-conditional-formatting";
|
|
4
|
+
import { CommandType as Re, ICommandService as ue, IUniverInstanceService as re, IUndoRedoService as qt, ObjectMatrix as Vt, Range as ut, sequenceExecute as yi, UniverInstanceType as G, Rectangle as At, ColorKit as bi, BooleanNumber as He, Disposable as rt, OnLifecycle as ot, LifecycleStages as it, Inject as q, LocaleService as $e, useDependency as oe, createInterceptorKey as Si, createInternalEditorID as yn, Tools as bn, InterceptorManager as ia, Injector as Rt, toDisposable as Ci, Plugin as _i, DependentOn as wi } from "@univerjs/core";
|
|
5
|
+
import { ConditionalFormattingRuleModel as he, CFRuleType as j, CFSubRuleType as N, AddConditionalRuleMutation as De, CFNumberOperator as F, setConditionalRuleMutationUndoFactory as Bt, SetConditionalRuleMutation as nt, DeleteConditionalRuleMutationUndoFactory as It, DeleteConditionalRuleMutation as Ye, MoveConditionalRuleMutation as Ln, transformSupportSymmetryAnchor as sa, MoveConditionalRuleMutationUndoFactory as aa, getColorScaleFromValue as la, iconMap as bt, DEFAULT_BG_COLOR as ca, DEFAULT_FONT_COLOR as ua, AddConditionalRuleMutationUndoFactory as xi, CFValueType as A, createDefaultValueByValueType as cn, SHEET_CONDITIONAL_FORMATTING_PLUGIN as st, removeUndefinedAttr as da, createDefaultValue as Pr, CFTextOperator as X, CFTimePeriodOperator as Ge, iconGroup as fa, getOppositeOperator as Dr, compareWithNumber as ha, EMPTY_ICON_TYPE as pa, createDefaultRule as ft, DEFAULT_PADDING as ga, DEFAULT_WIDTH as ma, ConditionalFormattingService as Ri, ConditionalFormattingViewModel as Ar, isRangesEqual as va, UniverSheetsConditionalFormattingPlugin as Ii, getStringFromDataStream as ya } from "@univerjs/sheets-conditional-formatting";
|
|
7
6
|
import { getSheetCommandTarget as Te, SheetsSelectionsService as Gt, findAllRectangle as kr, createTopMatrixFromMatrix as qr, SetWorksheetActiveOperation as Br, WorkbookEditablePermission as Ti, WorksheetSetCellStylePermission as Oi, WorksheetEditPermission as Ei, RangeProtectionPermissionEditPoint as Pi, SetSelectionsOperation as ba, RemoveSheetMutation as Sa, setEndForRange as Ca, INTERCEPTOR_POINT as _a, SheetInterceptorService as Di, RefRangeService as wa, handleDefaultRangeChangeWithEffectRefCommands as xa, ClearSelectionFormatCommand as Ra, ClearSelectionAllCommand as Ia, RangeMergeUtil as Ta } from "@univerjs/sheets";
|
|
8
7
|
import { MenuItemType as Oa, MenuGroup as Ea, MenuPosition as Pa, getMenuHiddenObservable as Da, useObservable as $a, ComponentManager as Gr, TextEditor as Bn, ILayoutService as Ma, useScrollYOverContainer as Na, RangeSelector as ja, IMenuService as La, ISidebarService as za } from "@univerjs/ui";
|
|
9
8
|
import { Observable as mt, merge as Mo, debounceTime as No } from "rxjs";
|
|
@@ -11,7 +10,6 @@ import { debounceTime as jo, bufferTime as pr, filter as gr } from "rxjs/operato
|
|
|
11
10
|
import { getCurrentRangeDisable$ as Ha, useHighlightRange as Va, SheetSkeletonManagerService as Fa, COPY_TYPE as Lo, rangeToDiscreteRange as Wa, PREDEFINED_HOOK_NAME as mr, virtualizeDiscreteRanges as $i, getRepeatRange as Ua, ISheetClipboardService as Aa, SheetPermissionInterceptorBaseController as ka, IAutoFillService as qa, APPLY_TYPE as vr, getAutoFillRepeatRange as Ba, IEditorBridgeService as Ga } from "@univerjs/sheets-ui";
|
|
12
11
|
import Fe, { forwardRef as Tt, useRef as pn, createElement as Xt, useMemo as be, useState as M, useEffect as ve } from "react";
|
|
13
12
|
import { Select as Ve, Tooltip as zo, Dropdown as Xr, ColorPicker as Xa, InputNumber as St, RadioGroup as Ya, Radio as Ho, Checkbox as zn, Input as Ka, Button as Vo } from "@univerjs/design";
|
|
14
|
-
import { useDependency as oe } from "@wendellhu/redi/react-bindings";
|
|
15
13
|
import { serializeRange as Mi } from "@univerjs/engine-formula";
|
|
16
14
|
import ct from "clsx";
|
|
17
15
|
import Ni from "react-dom";
|
|
@@ -29,8 +27,8 @@ const ji = {
|
|
|
29
27
|
cfId: f,
|
|
30
28
|
stopIfTrue: !!o,
|
|
31
29
|
rule: {
|
|
32
|
-
type:
|
|
33
|
-
subType:
|
|
30
|
+
type: j.highlightCell,
|
|
31
|
+
subType: N.average,
|
|
34
32
|
operator: i,
|
|
35
33
|
style: r
|
|
36
34
|
}
|
|
@@ -50,7 +48,7 @@ const ji = {
|
|
|
50
48
|
cfId: h,
|
|
51
49
|
stopIfTrue: !!o,
|
|
52
50
|
rule: {
|
|
53
|
-
type:
|
|
51
|
+
type: j.colorScale,
|
|
54
52
|
config: r
|
|
55
53
|
}
|
|
56
54
|
};
|
|
@@ -64,12 +62,12 @@ const ji = {
|
|
|
64
62
|
return !1;
|
|
65
63
|
const { ranges: n, min: r, max: o, nativeColor: i, positiveColor: s, isGradient: l, stopIfTrue: a, isShowValue: c } = t, u = e.get(he), h = e.get(re), f = Te(h);
|
|
66
64
|
if (!f) return !1;
|
|
67
|
-
const { unitId: g, subUnitId: m } = f, S = e.get(ue), I = u.createCfId(g, m),
|
|
65
|
+
const { unitId: g, subUnitId: m } = f, S = e.get(ue), I = u.createCfId(g, m), y = {
|
|
68
66
|
ranges: n,
|
|
69
67
|
cfId: I,
|
|
70
68
|
stopIfTrue: !!a,
|
|
71
69
|
rule: {
|
|
72
|
-
type:
|
|
70
|
+
type: j.dataBar,
|
|
73
71
|
isShowValue: c,
|
|
74
72
|
config: {
|
|
75
73
|
min: r,
|
|
@@ -80,7 +78,7 @@ const ji = {
|
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
};
|
|
83
|
-
return S.executeCommand(De.id, { unitId: g, subUnitId: m, rule:
|
|
81
|
+
return S.executeCommand(De.id, { unitId: g, subUnitId: m, rule: y });
|
|
84
82
|
}
|
|
85
83
|
}, Hi = {
|
|
86
84
|
type: Re.COMMAND,
|
|
@@ -95,8 +93,8 @@ const ji = {
|
|
|
95
93
|
cfId: h,
|
|
96
94
|
stopIfTrue: !!o,
|
|
97
95
|
rule: {
|
|
98
|
-
type:
|
|
99
|
-
subType:
|
|
96
|
+
type: j.highlightCell,
|
|
97
|
+
subType: N.duplicateValues,
|
|
100
98
|
style: r
|
|
101
99
|
}
|
|
102
100
|
};
|
|
@@ -121,8 +119,8 @@ const ji = {
|
|
|
121
119
|
cfId: g,
|
|
122
120
|
stopIfTrue: !!o,
|
|
123
121
|
rule: {
|
|
124
|
-
type:
|
|
125
|
-
subType:
|
|
122
|
+
type: j.highlightCell,
|
|
123
|
+
subType: N.number,
|
|
126
124
|
operator: i,
|
|
127
125
|
style: r,
|
|
128
126
|
value: S
|
|
@@ -137,8 +135,8 @@ const ji = {
|
|
|
137
135
|
cfId: g,
|
|
138
136
|
stopIfTrue: !!o,
|
|
139
137
|
rule: {
|
|
140
|
-
type:
|
|
141
|
-
subType:
|
|
138
|
+
type: j.highlightCell,
|
|
139
|
+
subType: N.number,
|
|
142
140
|
operator: i,
|
|
143
141
|
style: r,
|
|
144
142
|
value: S
|
|
@@ -160,8 +158,8 @@ const ji = {
|
|
|
160
158
|
cfId: m,
|
|
161
159
|
stopIfTrue: !!o,
|
|
162
160
|
rule: {
|
|
163
|
-
type:
|
|
164
|
-
subType:
|
|
161
|
+
type: j.highlightCell,
|
|
162
|
+
subType: N.rank,
|
|
165
163
|
isPercent: i,
|
|
166
164
|
isBottom: s,
|
|
167
165
|
style: r,
|
|
@@ -183,8 +181,8 @@ const ji = {
|
|
|
183
181
|
cfId: g,
|
|
184
182
|
stopIfTrue: !!o,
|
|
185
183
|
rule: {
|
|
186
|
-
type:
|
|
187
|
-
subType:
|
|
184
|
+
type: j.highlightCell,
|
|
185
|
+
subType: N.text,
|
|
188
186
|
operator: i,
|
|
189
187
|
style: r,
|
|
190
188
|
value: s
|
|
@@ -205,8 +203,8 @@ const ji = {
|
|
|
205
203
|
cfId: f,
|
|
206
204
|
stopIfTrue: !!o,
|
|
207
205
|
rule: {
|
|
208
|
-
type:
|
|
209
|
-
subType:
|
|
206
|
+
type: j.highlightCell,
|
|
207
|
+
subType: N.timePeriod,
|
|
210
208
|
operator: i,
|
|
211
209
|
style: r
|
|
212
210
|
}
|
|
@@ -226,8 +224,8 @@ const ji = {
|
|
|
226
224
|
cfId: h,
|
|
227
225
|
stopIfTrue: !!o,
|
|
228
226
|
rule: {
|
|
229
|
-
type:
|
|
230
|
-
subType:
|
|
227
|
+
type: j.highlightCell,
|
|
228
|
+
subType: N.uniqueValues,
|
|
231
229
|
style: r
|
|
232
230
|
}
|
|
233
231
|
};
|
|
@@ -247,23 +245,23 @@ const ji = {
|
|
|
247
245
|
return !1;
|
|
248
246
|
const f = [], g = [];
|
|
249
247
|
h.forEach((I) => {
|
|
250
|
-
const
|
|
248
|
+
const y = new Vt();
|
|
251
249
|
I.ranges.forEach((C) => {
|
|
252
|
-
ut.foreach(C, (
|
|
253
|
-
|
|
250
|
+
ut.foreach(C, (x, p) => {
|
|
251
|
+
y.setValue(x, p, 1);
|
|
254
252
|
});
|
|
255
253
|
}), u.forEach((C) => {
|
|
256
|
-
ut.foreach(C, (
|
|
257
|
-
|
|
254
|
+
ut.foreach(C, (x, p) => {
|
|
255
|
+
y.realDeleteValue(x, p);
|
|
258
256
|
});
|
|
259
257
|
});
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
const C = { ...I, ranges:
|
|
263
|
-
f.push({ id: nt.id, params:
|
|
258
|
+
const w = kr(qr(y));
|
|
259
|
+
if (w.length) {
|
|
260
|
+
const C = { ...I, ranges: w }, x = { unitId: a, subUnitId: c, rule: C }, p = Bt(e, x);
|
|
261
|
+
f.push({ id: nt.id, params: x }), g.push(...p);
|
|
264
262
|
} else {
|
|
265
|
-
const C = { unitId: a, subUnitId: c, cfId: I.cfId },
|
|
266
|
-
f.push({ id: Ye.id, params: C }), g.push(...
|
|
263
|
+
const C = { unitId: a, subUnitId: c, cfId: I.cfId }, x = It(e, C);
|
|
264
|
+
f.push({ id: Ye.id, params: C }), g.push(...x);
|
|
267
265
|
}
|
|
268
266
|
});
|
|
269
267
|
const m = yi(f, o).result;
|
|
@@ -350,7 +348,7 @@ const Fo = [Br.id, De.id, nt.id, Ye.id, Ln.id], Ja = (e) => {
|
|
|
350
348
|
if (!h) return;
|
|
351
349
|
const f = h.getActiveSheet();
|
|
352
350
|
if (!f) return;
|
|
353
|
-
const m = (i.getSubunitRules(h.getUnitId(), f.getSheetId()) || []).filter((I) => I.ranges.some((
|
|
351
|
+
const m = (i.getSubunitRules(h.getUnitId(), f.getSheetId()) || []).filter((I) => I.ranges.some((y) => u.some((w) => At.intersects(w, y))));
|
|
354
352
|
c.next(!!m.length);
|
|
355
353
|
})), l = new mt(
|
|
356
354
|
(c) => Mo(
|
|
@@ -372,11 +370,11 @@ const Fo = [Br.id, De.id, nt.id, Ye.id, Ln.id], Ja = (e) => {
|
|
|
372
370
|
if (!f.length)
|
|
373
371
|
return c.next(!1), !1;
|
|
374
372
|
const g = f.some((m) => m.ranges.some((I) => {
|
|
375
|
-
var p,
|
|
376
|
-
const { startRow:
|
|
377
|
-
for (let
|
|
378
|
-
for (let
|
|
379
|
-
const E = (
|
|
373
|
+
var p, R;
|
|
374
|
+
const { startRow: y, startColumn: w, endRow: C, endColumn: x } = I;
|
|
375
|
+
for (let _ = y; _ <= C; _++)
|
|
376
|
+
for (let b = w; b <= x; b++) {
|
|
377
|
+
const E = (R = (p = h.getCell(_, b)) == null ? void 0 : p.selectionProtection) == null ? void 0 : R[0];
|
|
380
378
|
if ((E == null ? void 0 : E[gn.Edit]) === !1 || (E == null ? void 0 : E[gn.View]) === !1)
|
|
381
379
|
return !0;
|
|
382
380
|
}
|
|
@@ -592,7 +590,7 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
592
590
|
function a(P, z) {
|
|
593
591
|
return P === z || P !== P && z !== z;
|
|
594
592
|
}
|
|
595
|
-
var c = "[object Arguments]", u = "[object Boolean]", h = "[object Date]", f = "[object RegExp]", g = "[object Map]", m = "[object Number]", S = "[object Object]", I = "[object Set]",
|
|
593
|
+
var c = "[object Arguments]", u = "[object Boolean]", h = "[object Date]", f = "[object RegExp]", g = "[object Map]", m = "[object Number]", S = "[object Object]", I = "[object Set]", y = "[object String]", w = Object.prototype.toString;
|
|
596
594
|
function C(P) {
|
|
597
595
|
var z = P.areArraysEqual, K = P.areDatesEqual, Z = P.areMapsEqual, Y = P.areObjectsEqual, se = P.areRegExpsEqual, ce = P.areSetsEqual, _e = P.createIsNestedEqual, te = _e(ke);
|
|
598
596
|
function ke(ae, fe, qe) {
|
|
@@ -605,12 +603,12 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
605
603
|
var Do = Array.isArray(ae), $o = Array.isArray(fe);
|
|
606
604
|
if (Do || $o)
|
|
607
605
|
return Do === $o && z(ae, fe, te, qe);
|
|
608
|
-
var Be =
|
|
609
|
-
return Be !==
|
|
606
|
+
var Be = w.call(ae);
|
|
607
|
+
return Be !== w.call(fe) ? !1 : Be === h ? K(ae, fe, te, qe) : Be === f ? se(ae, fe, te, qe) : Be === g ? Z(ae, fe, te, qe) : Be === I ? ce(ae, fe, te, qe) : Be === S || Be === c ? l(ae) || l(fe) ? !1 : Y(ae, fe, te, qe) : Be === u || Be === m || Be === y ? a(ae.valueOf(), fe.valueOf()) : !1;
|
|
610
608
|
}
|
|
611
609
|
return ke;
|
|
612
610
|
}
|
|
613
|
-
function
|
|
611
|
+
function x(P, z, K, Z) {
|
|
614
612
|
var Y = P.length;
|
|
615
613
|
if (z.length !== Y)
|
|
616
614
|
return !1;
|
|
@@ -619,11 +617,11 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
619
617
|
return !1;
|
|
620
618
|
return !0;
|
|
621
619
|
}
|
|
622
|
-
var p = o(
|
|
623
|
-
function
|
|
620
|
+
var p = o(x);
|
|
621
|
+
function R(P, z) {
|
|
624
622
|
return a(P.valueOf(), z.valueOf());
|
|
625
623
|
}
|
|
626
|
-
function
|
|
624
|
+
function _(P, z, K, Z) {
|
|
627
625
|
var Y = P.size === z.size;
|
|
628
626
|
if (!Y)
|
|
629
627
|
return !1;
|
|
@@ -639,8 +637,8 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
639
637
|
}
|
|
640
638
|
}), Y;
|
|
641
639
|
}
|
|
642
|
-
var
|
|
643
|
-
function
|
|
640
|
+
var b = o(_), E = "_owner", D = Object.prototype.hasOwnProperty;
|
|
641
|
+
function L(P, z, K, Z) {
|
|
644
642
|
var Y = Object.keys(P), se = Y.length;
|
|
645
643
|
if (Object.keys(z).length !== se)
|
|
646
644
|
return !1;
|
|
@@ -650,13 +648,13 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
650
648
|
if ((_e || te) && _e !== te)
|
|
651
649
|
return !1;
|
|
652
650
|
}
|
|
653
|
-
if (
|
|
651
|
+
if (!D.call(z, ce) || !K(P[ce], z[ce], ce, ce, P, z, Z))
|
|
654
652
|
return !1;
|
|
655
653
|
}
|
|
656
654
|
return !0;
|
|
657
655
|
}
|
|
658
|
-
var W = o(
|
|
659
|
-
function
|
|
656
|
+
var W = o(L);
|
|
657
|
+
function v(P, z) {
|
|
660
658
|
return P.source === z.source && P.flags === z.flags;
|
|
661
659
|
}
|
|
662
660
|
function T(P, z, K, Z) {
|
|
@@ -676,19 +674,19 @@ var Yi = { exports: {} }, Cn = {}, $r = { exports: {} };
|
|
|
676
674
|
}), Y;
|
|
677
675
|
}
|
|
678
676
|
var ee = o(T), Oe = Object.freeze({
|
|
679
|
-
areArraysEqual:
|
|
680
|
-
areDatesEqual:
|
|
681
|
-
areMapsEqual:
|
|
682
|
-
areObjectsEqual:
|
|
683
|
-
areRegExpsEqual:
|
|
677
|
+
areArraysEqual: x,
|
|
678
|
+
areDatesEqual: R,
|
|
679
|
+
areMapsEqual: _,
|
|
680
|
+
areObjectsEqual: L,
|
|
681
|
+
areRegExpsEqual: v,
|
|
684
682
|
areSetsEqual: T,
|
|
685
683
|
createIsNestedEqual: r
|
|
686
684
|
}), Se = Object.freeze({
|
|
687
685
|
areArraysEqual: p,
|
|
688
|
-
areDatesEqual:
|
|
689
|
-
areMapsEqual:
|
|
686
|
+
areDatesEqual: R,
|
|
687
|
+
areMapsEqual: b,
|
|
690
688
|
areObjectsEqual: W,
|
|
691
|
-
areRegExpsEqual:
|
|
689
|
+
areRegExpsEqual: v,
|
|
692
690
|
areSetsEqual: ee,
|
|
693
691
|
createIsNestedEqual: r
|
|
694
692
|
}), Ce = C(Oe);
|
|
@@ -894,8 +892,8 @@ function an(e, t, n, r, o, i, s, l, a) {
|
|
|
894
892
|
if (m && i)
|
|
895
893
|
return `${t.i}`, t.x = c, t.y = u, t.moved = !1, e;
|
|
896
894
|
for (let S = 0, I = g.length; S < I; S++) {
|
|
897
|
-
const
|
|
898
|
-
`${t.i}${t.x}${t.y}${
|
|
895
|
+
const y = g[S];
|
|
896
|
+
`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`, !y.moved && (y.static ? e = Nr(e, y, t, o, s) : e = Nr(e, t, y, o, s));
|
|
899
897
|
}
|
|
900
898
|
return e;
|
|
901
899
|
}
|
|
@@ -1828,71 +1826,71 @@ Ie(nr, "defaultProps", {
|
|
|
1828
1826
|
}
|
|
1829
1827
|
}), e.default = void 0;
|
|
1830
1828
|
var t = f(Fe), n = u(dt), r = u(Ni), o = u(ct), i = de, s = Je, l = Ze, a = u(er), c = u(tr);
|
|
1831
|
-
function u(
|
|
1832
|
-
return
|
|
1829
|
+
function u(w) {
|
|
1830
|
+
return w && w.__esModule ? w : { default: w };
|
|
1833
1831
|
}
|
|
1834
|
-
function h(
|
|
1832
|
+
function h(w) {
|
|
1835
1833
|
if (typeof WeakMap != "function") return null;
|
|
1836
|
-
var C = /* @__PURE__ */ new WeakMap(),
|
|
1834
|
+
var C = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
|
|
1837
1835
|
return (h = function(p) {
|
|
1838
|
-
return p ?
|
|
1839
|
-
})(
|
|
1840
|
-
}
|
|
1841
|
-
function f(
|
|
1842
|
-
if (
|
|
1843
|
-
return
|
|
1844
|
-
if (
|
|
1845
|
-
return { default:
|
|
1846
|
-
var
|
|
1847
|
-
if (
|
|
1848
|
-
return
|
|
1849
|
-
var p = {},
|
|
1850
|
-
for (var
|
|
1851
|
-
if (
|
|
1852
|
-
var
|
|
1853
|
-
|
|
1836
|
+
return p ? x : C;
|
|
1837
|
+
})(w);
|
|
1838
|
+
}
|
|
1839
|
+
function f(w, C) {
|
|
1840
|
+
if (w && w.__esModule)
|
|
1841
|
+
return w;
|
|
1842
|
+
if (w === null || typeof w != "object" && typeof w != "function")
|
|
1843
|
+
return { default: w };
|
|
1844
|
+
var x = h(C);
|
|
1845
|
+
if (x && x.has(w))
|
|
1846
|
+
return x.get(w);
|
|
1847
|
+
var p = {}, R = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1848
|
+
for (var _ in w)
|
|
1849
|
+
if (_ !== "default" && Object.prototype.hasOwnProperty.call(w, _)) {
|
|
1850
|
+
var b = R ? Object.getOwnPropertyDescriptor(w, _) : null;
|
|
1851
|
+
b && (b.get || b.set) ? Object.defineProperty(p, _, b) : p[_] = w[_];
|
|
1854
1852
|
}
|
|
1855
|
-
return p.default =
|
|
1853
|
+
return p.default = w, x && x.set(w, p), p;
|
|
1856
1854
|
}
|
|
1857
1855
|
function g() {
|
|
1858
|
-
return g = Object.assign ? Object.assign.bind() : function(
|
|
1856
|
+
return g = Object.assign ? Object.assign.bind() : function(w) {
|
|
1859
1857
|
for (var C = 1; C < arguments.length; C++) {
|
|
1860
|
-
var
|
|
1861
|
-
for (var p in
|
|
1862
|
-
Object.prototype.hasOwnProperty.call(
|
|
1858
|
+
var x = arguments[C];
|
|
1859
|
+
for (var p in x)
|
|
1860
|
+
Object.prototype.hasOwnProperty.call(x, p) && (w[p] = x[p]);
|
|
1863
1861
|
}
|
|
1864
|
-
return
|
|
1862
|
+
return w;
|
|
1865
1863
|
}, g.apply(this, arguments);
|
|
1866
1864
|
}
|
|
1867
|
-
function m(
|
|
1868
|
-
return C = S(C), C in
|
|
1865
|
+
function m(w, C, x) {
|
|
1866
|
+
return C = S(C), C in w ? Object.defineProperty(w, C, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : w[C] = x, w;
|
|
1869
1867
|
}
|
|
1870
|
-
function S(
|
|
1871
|
-
var C = I(
|
|
1868
|
+
function S(w) {
|
|
1869
|
+
var C = I(w, "string");
|
|
1872
1870
|
return typeof C == "symbol" ? C : String(C);
|
|
1873
1871
|
}
|
|
1874
|
-
function I(
|
|
1875
|
-
if (typeof
|
|
1876
|
-
var
|
|
1877
|
-
if (
|
|
1878
|
-
var p =
|
|
1872
|
+
function I(w, C) {
|
|
1873
|
+
if (typeof w != "object" || w === null) return w;
|
|
1874
|
+
var x = w[Symbol.toPrimitive];
|
|
1875
|
+
if (x !== void 0) {
|
|
1876
|
+
var p = x.call(w, C || "default");
|
|
1879
1877
|
if (typeof p != "object") return p;
|
|
1880
1878
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1881
1879
|
}
|
|
1882
|
-
return (C === "string" ? String : Number)(
|
|
1880
|
+
return (C === "string" ? String : Number)(w);
|
|
1883
1881
|
}
|
|
1884
|
-
class
|
|
1882
|
+
class y extends t.Component {
|
|
1885
1883
|
// React 16.3+
|
|
1886
1884
|
// Arity (props, state)
|
|
1887
|
-
static getDerivedStateFromProps(C,
|
|
1885
|
+
static getDerivedStateFromProps(C, x) {
|
|
1888
1886
|
let {
|
|
1889
1887
|
position: p
|
|
1890
1888
|
} = C, {
|
|
1891
|
-
prevPropsPosition:
|
|
1892
|
-
} =
|
|
1893
|
-
return p && (!
|
|
1889
|
+
prevPropsPosition: R
|
|
1890
|
+
} = x;
|
|
1891
|
+
return p && (!R || p.x !== R.x || p.y !== R.y) ? ((0, c.default)("Draggable: getDerivedStateFromProps %j", {
|
|
1894
1892
|
position: p,
|
|
1895
|
-
prevPropsPosition:
|
|
1893
|
+
prevPropsPosition: R
|
|
1896
1894
|
}), {
|
|
1897
1895
|
x: p.x,
|
|
1898
1896
|
y: p.y,
|
|
@@ -1902,36 +1900,36 @@ Ie(nr, "defaultProps", {
|
|
|
1902
1900
|
}) : null;
|
|
1903
1901
|
}
|
|
1904
1902
|
constructor(C) {
|
|
1905
|
-
super(C), m(this, "onDragStart", (
|
|
1906
|
-
if ((0, c.default)("Draggable: onDragStart: %j", p), this.props.onStart(
|
|
1903
|
+
super(C), m(this, "onDragStart", (x, p) => {
|
|
1904
|
+
if ((0, c.default)("Draggable: onDragStart: %j", p), this.props.onStart(x, (0, s.createDraggableData)(this, p)) === !1) return !1;
|
|
1907
1905
|
this.setState({
|
|
1908
1906
|
dragging: !0,
|
|
1909
1907
|
dragged: !0
|
|
1910
1908
|
});
|
|
1911
|
-
}), m(this, "onDrag", (
|
|
1909
|
+
}), m(this, "onDrag", (x, p) => {
|
|
1912
1910
|
if (!this.state.dragging) return !1;
|
|
1913
1911
|
(0, c.default)("Draggable: onDrag: %j", p);
|
|
1914
|
-
const
|
|
1915
|
-
x:
|
|
1916
|
-
y:
|
|
1912
|
+
const R = (0, s.createDraggableData)(this, p), _ = {
|
|
1913
|
+
x: R.x,
|
|
1914
|
+
y: R.y,
|
|
1917
1915
|
slackX: 0,
|
|
1918
1916
|
slackY: 0
|
|
1919
1917
|
};
|
|
1920
1918
|
if (this.props.bounds) {
|
|
1921
1919
|
const {
|
|
1922
1920
|
x: E,
|
|
1923
|
-
y:
|
|
1924
|
-
} =
|
|
1925
|
-
|
|
1926
|
-
const [
|
|
1927
|
-
|
|
1921
|
+
y: D
|
|
1922
|
+
} = _;
|
|
1923
|
+
_.x += this.state.slackX, _.y += this.state.slackY;
|
|
1924
|
+
const [L, W] = (0, s.getBoundPosition)(this, _.x, _.y);
|
|
1925
|
+
_.x = L, _.y = W, _.slackX = this.state.slackX + (E - _.x), _.slackY = this.state.slackY + (D - _.y), R.x = _.x, R.y = _.y, R.deltaX = _.x - this.state.x, R.deltaY = _.y - this.state.y;
|
|
1928
1926
|
}
|
|
1929
|
-
if (this.props.onDrag(
|
|
1930
|
-
this.setState(
|
|
1931
|
-
}), m(this, "onDragStop", (
|
|
1932
|
-
if (!this.state.dragging || this.props.onStop(
|
|
1927
|
+
if (this.props.onDrag(x, R) === !1) return !1;
|
|
1928
|
+
this.setState(_);
|
|
1929
|
+
}), m(this, "onDragStop", (x, p) => {
|
|
1930
|
+
if (!this.state.dragging || this.props.onStop(x, (0, s.createDraggableData)(this, p)) === !1) return !1;
|
|
1933
1931
|
(0, c.default)("Draggable: onDragStop: %j", p);
|
|
1934
|
-
const
|
|
1932
|
+
const _ = {
|
|
1935
1933
|
dragging: !1,
|
|
1936
1934
|
slackX: 0,
|
|
1937
1935
|
slackY: 0
|
|
@@ -1939,11 +1937,11 @@ Ie(nr, "defaultProps", {
|
|
|
1939
1937
|
if (!!this.props.position) {
|
|
1940
1938
|
const {
|
|
1941
1939
|
x: E,
|
|
1942
|
-
y:
|
|
1940
|
+
y: D
|
|
1943
1941
|
} = this.props.position;
|
|
1944
|
-
|
|
1942
|
+
_.x = E, _.y = D;
|
|
1945
1943
|
}
|
|
1946
|
-
this.setState(
|
|
1944
|
+
this.setState(_);
|
|
1947
1945
|
}), this.state = {
|
|
1948
1946
|
// Whether or not we are currently dragging.
|
|
1949
1947
|
dragging: !1,
|
|
@@ -1975,36 +1973,36 @@ Ie(nr, "defaultProps", {
|
|
|
1975
1973
|
// React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
1976
1974
|
// the underlying DOM node ourselves. See the README for more information.
|
|
1977
1975
|
findDOMNode() {
|
|
1978
|
-
var C,
|
|
1979
|
-
return (C = (
|
|
1976
|
+
var C, x;
|
|
1977
|
+
return (C = (x = this.props) === null || x === void 0 || (x = x.nodeRef) === null || x === void 0 ? void 0 : x.current) !== null && C !== void 0 ? C : r.default.findDOMNode(this);
|
|
1980
1978
|
}
|
|
1981
1979
|
render() {
|
|
1982
1980
|
const {
|
|
1983
1981
|
axis: C,
|
|
1984
|
-
bounds:
|
|
1982
|
+
bounds: x,
|
|
1985
1983
|
children: p,
|
|
1986
|
-
defaultPosition:
|
|
1987
|
-
defaultClassName:
|
|
1988
|
-
defaultClassNameDragging:
|
|
1984
|
+
defaultPosition: R,
|
|
1985
|
+
defaultClassName: _,
|
|
1986
|
+
defaultClassNameDragging: b,
|
|
1989
1987
|
defaultClassNameDragged: E,
|
|
1990
|
-
position:
|
|
1991
|
-
positionOffset:
|
|
1988
|
+
position: D,
|
|
1989
|
+
positionOffset: L,
|
|
1992
1990
|
scale: W,
|
|
1993
|
-
...
|
|
1991
|
+
...v
|
|
1994
1992
|
} = this.props;
|
|
1995
1993
|
let T = {}, ee = null;
|
|
1996
|
-
const Se =
|
|
1994
|
+
const Se = !!!D || this.state.dragging, Ce = D || R, We = {
|
|
1997
1995
|
// Set left if horizontal drag is enabled
|
|
1998
1996
|
x: (0, s.canDragX)(this) && Se ? this.state.x : Ce.x,
|
|
1999
1997
|
// Set top if vertical drag is enabled
|
|
2000
1998
|
y: (0, s.canDragY)(this) && Se ? this.state.y : Ce.y
|
|
2001
1999
|
};
|
|
2002
|
-
this.state.isElementSVG ? ee = (0, i.createSVGTransform)(We,
|
|
2003
|
-
const H = (0, o.default)(p.props.className || "",
|
|
2004
|
-
[
|
|
2000
|
+
this.state.isElementSVG ? ee = (0, i.createSVGTransform)(We, L) : T = (0, i.createCSSTransform)(We, L);
|
|
2001
|
+
const H = (0, o.default)(p.props.className || "", _, {
|
|
2002
|
+
[b]: this.state.dragging,
|
|
2005
2003
|
[E]: this.state.dragged
|
|
2006
2004
|
});
|
|
2007
|
-
return /* @__PURE__ */ t.createElement(a.default, g({},
|
|
2005
|
+
return /* @__PURE__ */ t.createElement(a.default, g({}, v, {
|
|
2008
2006
|
onStart: this.onDragStart,
|
|
2009
2007
|
onDrag: this.onDrag,
|
|
2010
2008
|
onStop: this.onDragStop
|
|
@@ -2018,7 +2016,7 @@ Ie(nr, "defaultProps", {
|
|
|
2018
2016
|
}));
|
|
2019
2017
|
}
|
|
2020
2018
|
}
|
|
2021
|
-
e.default =
|
|
2019
|
+
e.default = y, m(y, "displayName", "Draggable"), m(y, "propTypes", {
|
|
2022
2020
|
// Accepts all props <DraggableCore> accepts.
|
|
2023
2021
|
...a.default.propTypes,
|
|
2024
2022
|
/**
|
|
@@ -2125,7 +2123,7 @@ Ie(nr, "defaultProps", {
|
|
|
2125
2123
|
className: l.dontSetMe,
|
|
2126
2124
|
style: l.dontSetMe,
|
|
2127
2125
|
transform: l.dontSetMe
|
|
2128
|
-
}), m(
|
|
2126
|
+
}), m(y, "defaultProps", {
|
|
2129
2127
|
...a.default.defaultProps,
|
|
2130
2128
|
axis: "both",
|
|
2131
2129
|
bounds: !1,
|
|
@@ -2415,8 +2413,8 @@ var fo = /* @__PURE__ */ function(e) {
|
|
|
2415
2413
|
var u = this.props.width / this.props.height, h = o - this.props.width, f = i - this.props.height;
|
|
2416
2414
|
Math.abs(h) > Math.abs(f * u) ? i = o / u : o = i * u;
|
|
2417
2415
|
}
|
|
2418
|
-
var g = o, m = i, S = this.slack || [0, 0], I = S[0],
|
|
2419
|
-
return o += I, i +=
|
|
2416
|
+
var g = o, m = i, S = this.slack || [0, 0], I = S[0], y = S[1];
|
|
2417
|
+
return o += I, i += y, l && (o = Math.max(l[0], o), i = Math.max(l[1], i)), a && (o = Math.min(a[0], o), i = Math.min(a[1], i)), this.slack = [I + (g - o), y + (m - i)], [o, i];
|
|
2420
2418
|
}, n.resizeHandler = function(o, i) {
|
|
2421
2419
|
var s = this;
|
|
2422
2420
|
return function(l, a) {
|
|
@@ -2427,23 +2425,23 @@ var fo = /* @__PURE__ */ function(e) {
|
|
|
2427
2425
|
var m = i[0], S = i[i.length - 1], I = c.getBoundingClientRect();
|
|
2428
2426
|
if (s.lastHandleRect != null) {
|
|
2429
2427
|
if (S === "w") {
|
|
2430
|
-
var
|
|
2431
|
-
u +=
|
|
2428
|
+
var y = I.left - s.lastHandleRect.left;
|
|
2429
|
+
u += y;
|
|
2432
2430
|
}
|
|
2433
2431
|
if (m === "n") {
|
|
2434
|
-
var
|
|
2435
|
-
h +=
|
|
2432
|
+
var w = I.top - s.lastHandleRect.top;
|
|
2433
|
+
h += w;
|
|
2436
2434
|
}
|
|
2437
2435
|
}
|
|
2438
2436
|
s.lastHandleRect = I, S === "w" && (u = -u), m === "n" && (h = -h);
|
|
2439
|
-
var C = s.props.width + (f ? u / s.props.transformScale : 0),
|
|
2440
|
-
C = p[0],
|
|
2441
|
-
var
|
|
2442
|
-
|
|
2437
|
+
var C = s.props.width + (f ? u / s.props.transformScale : 0), x = s.props.height + (g ? h / s.props.transformScale : 0), p = s.runConstraints(C, x);
|
|
2438
|
+
C = p[0], x = p[1];
|
|
2439
|
+
var R = C !== s.props.width || x !== s.props.height, _ = typeof s.props[o] == "function" ? s.props[o] : null, b = o === "onResize" && !R;
|
|
2440
|
+
_ && !b && (l.persist == null || l.persist(), _(l, {
|
|
2443
2441
|
node: c,
|
|
2444
2442
|
size: {
|
|
2445
2443
|
width: C,
|
|
2446
|
-
height:
|
|
2444
|
+
height: x
|
|
2447
2445
|
},
|
|
2448
2446
|
handle: i
|
|
2449
2447
|
})), o === "onResizeStop" && s.resetData();
|
|
@@ -2620,7 +2618,7 @@ var ws = /* @__PURE__ */ function(e) {
|
|
|
2620
2618
|
o.onResize;
|
|
2621
2619
|
var l = o.onResizeStart, a = o.onResizeStop, c = o.draggableOpts, u = o.minConstraints, h = o.maxConstraints, f = o.lockAspectRatio, g = o.axis;
|
|
2622
2620
|
o.width, o.height;
|
|
2623
|
-
var m = o.resizeHandles, S = o.style, I = o.transformScale,
|
|
2621
|
+
var m = o.resizeHandles, S = o.style, I = o.transformScale, y = fu(o, au);
|
|
2624
2622
|
return /* @__PURE__ */ _r.createElement(iu.default, {
|
|
2625
2623
|
axis: g,
|
|
2626
2624
|
draggableOpts: c,
|
|
@@ -2636,7 +2634,7 @@ var ws = /* @__PURE__ */ function(e) {
|
|
|
2636
2634
|
resizeHandles: m,
|
|
2637
2635
|
transformScale: I,
|
|
2638
2636
|
width: this.state.width
|
|
2639
|
-
}, /* @__PURE__ */ _r.createElement("div", Hr({},
|
|
2637
|
+
}, /* @__PURE__ */ _r.createElement("div", Hr({}, y, {
|
|
2640
2638
|
style: Hn(Hn({}, S), {}, {
|
|
2641
2639
|
width: this.state.width + "px",
|
|
2642
2640
|
height: this.state.height + "px"
|
|
@@ -2855,13 +2853,13 @@ class po extends $t.default.Component {
|
|
|
2855
2853
|
} = r;
|
|
2856
2854
|
if (C) {
|
|
2857
2855
|
const {
|
|
2858
|
-
margin:
|
|
2856
|
+
margin: x,
|
|
2859
2857
|
rowHeight: p,
|
|
2860
|
-
containerPadding:
|
|
2861
|
-
} = this.props,
|
|
2862
|
-
l = (0, ye.clamp)(l -
|
|
2863
|
-
const
|
|
2864
|
-
a = (0, ye.clamp)(a -
|
|
2858
|
+
containerPadding: R
|
|
2859
|
+
} = this.props, _ = C.clientHeight - (0, ye.calcGridItemWHPx)(f, p, x[1]);
|
|
2860
|
+
l = (0, ye.clamp)(l - R[1], 0, _);
|
|
2861
|
+
const b = (0, ye.calcGridColWidth)(m), E = g - (0, ye.calcGridItemWHPx)(h, b, x[0]);
|
|
2862
|
+
a = (0, ye.clamp)(a - R[0], 0, E);
|
|
2865
2863
|
}
|
|
2866
2864
|
}
|
|
2867
2865
|
const S = {
|
|
@@ -2874,10 +2872,10 @@ class po extends $t.default.Component {
|
|
|
2874
2872
|
const {
|
|
2875
2873
|
containerPadding: I
|
|
2876
2874
|
} = this.props, {
|
|
2877
|
-
x:
|
|
2878
|
-
y:
|
|
2875
|
+
x: y,
|
|
2876
|
+
y: w
|
|
2879
2877
|
} = (0, ye.calcXY)(m, l - I[1], a - I[0], h, f);
|
|
2880
|
-
return s.call(this, u,
|
|
2878
|
+
return s.call(this, u, y, w, {
|
|
2881
2879
|
e: t,
|
|
2882
2880
|
node: r,
|
|
2883
2881
|
newPosition: S
|
|
@@ -3032,7 +3030,7 @@ class po extends $t.default.Component {
|
|
|
3032
3030
|
transformScale: c,
|
|
3033
3031
|
resizeHandles: u,
|
|
3034
3032
|
resizeHandle: h
|
|
3035
|
-
} = this.props, f = this.getPositionParams(), g = (0, ye.calcGridItemPosition)(f, 0, 0, o, 0).width, m = (0, ye.calcGridItemPosition)(f, 0, 0, i, s), S = (0, ye.calcGridItemPosition)(f, 0, 0, l, a), I = [m.width, m.height],
|
|
3033
|
+
} = this.props, f = this.getPositionParams(), g = (0, ye.calcGridItemPosition)(f, 0, 0, o, 0).width, m = (0, ye.calcGridItemPosition)(f, 0, 0, i, s), S = (0, ye.calcGridItemPosition)(f, 0, 0, l, a), I = [m.width, m.height], y = [Math.min(S.width, g), Math.min(S.height, 1 / 0)];
|
|
3036
3034
|
return /* @__PURE__ */ $t.default.createElement(
|
|
3037
3035
|
bu.Resizable,
|
|
3038
3036
|
{
|
|
@@ -3043,7 +3041,7 @@ class po extends $t.default.Component {
|
|
|
3043
3041
|
width: n.width,
|
|
3044
3042
|
height: n.height,
|
|
3045
3043
|
minConstraints: I,
|
|
3046
|
-
maxConstraints:
|
|
3044
|
+
maxConstraints: y,
|
|
3047
3045
|
onResizeStop: this.curryResizeHandler(n, this.onResizeStop),
|
|
3048
3046
|
onResizeStart: this.curryResizeHandler(n, this.onResizeStart),
|
|
3049
3047
|
onResize: this.curryResizeHandler(n, this.onResize),
|
|
@@ -3076,18 +3074,18 @@ class po extends $t.default.Component {
|
|
|
3076
3074
|
minW: S,
|
|
3077
3075
|
maxW: I
|
|
3078
3076
|
} = this.props;
|
|
3079
|
-
let
|
|
3080
|
-
i && (
|
|
3081
|
-
resizing: o === "onResizeStop" ? null :
|
|
3077
|
+
let y = s;
|
|
3078
|
+
i && (y = (0, Mt.resizeItemInDirection)(l, r, s, m), this.setState({
|
|
3079
|
+
resizing: o === "onResizeStop" ? null : y
|
|
3082
3080
|
}));
|
|
3083
3081
|
let {
|
|
3084
|
-
w
|
|
3082
|
+
w,
|
|
3085
3083
|
h: C
|
|
3086
|
-
} = (0, ye.calcWH)(this.getPositionParams(),
|
|
3087
|
-
|
|
3084
|
+
} = (0, ye.calcWH)(this.getPositionParams(), y.width, y.height, c, u, l);
|
|
3085
|
+
w = (0, ye.clamp)(w, Math.max(S, 1), I), C = (0, ye.clamp)(C, g, f), a.call(this, h, w, C, {
|
|
3088
3086
|
e: t,
|
|
3089
3087
|
node: i,
|
|
3090
|
-
size:
|
|
3088
|
+
size: y,
|
|
3091
3089
|
handle: l
|
|
3092
3090
|
});
|
|
3093
3091
|
}
|
|
@@ -3381,20 +3379,20 @@ class ir extends ht.Component {
|
|
|
3381
3379
|
preventCollision: f,
|
|
3382
3380
|
allowOverlap: g
|
|
3383
3381
|
} = this.props;
|
|
3384
|
-
let m = !1, S, I,
|
|
3385
|
-
const [
|
|
3386
|
-
let
|
|
3387
|
-
return I = p.x,
|
|
3382
|
+
let m = !1, S, I, y;
|
|
3383
|
+
const [w, C] = (0, V.withLayoutItem)(u, t, (p) => {
|
|
3384
|
+
let R;
|
|
3385
|
+
return I = p.x, y = p.y, ["sw", "w", "nw", "n", "ne"].indexOf(a) !== -1 && (["sw", "nw", "w"].indexOf(a) !== -1 && (I = p.x + (p.w - n), n = p.x !== I && I < 0 ? p.w : n, I = I < 0 ? 0 : I), ["ne", "n", "nw"].indexOf(a) !== -1 && (y = p.y + (p.h - r), r = p.y !== y && y < 0 ? p.h : r, y = y < 0 ? 0 : y), m = !0), f && !g && (R = (0, V.getAllCollisions)(u, {
|
|
3388
3386
|
...p,
|
|
3389
3387
|
w: n,
|
|
3390
3388
|
h: r,
|
|
3391
3389
|
x: I,
|
|
3392
|
-
y
|
|
3393
|
-
}).filter((
|
|
3390
|
+
y
|
|
3391
|
+
}).filter((b) => b.i !== p.i).length > 0, R && (y = p.y, r = p.h, I = p.x, n = p.w, m = !1)), p.w = n, p.h = r, p;
|
|
3394
3392
|
});
|
|
3395
3393
|
if (!C) return;
|
|
3396
|
-
S =
|
|
3397
|
-
const
|
|
3394
|
+
S = w, m && (S = (0, V.moveElement)(w, C, I, y, !0, this.props.preventCollision, (0, V.compactType)(this.props), h, g));
|
|
3395
|
+
const x = {
|
|
3398
3396
|
w: C.w,
|
|
3399
3397
|
h: C.h,
|
|
3400
3398
|
x: C.x,
|
|
@@ -3402,9 +3400,9 @@ class ir extends ht.Component {
|
|
|
3402
3400
|
static: !0,
|
|
3403
3401
|
i: t
|
|
3404
3402
|
};
|
|
3405
|
-
this.props.onResize(S, c, C,
|
|
3403
|
+
this.props.onResize(S, c, C, x, i, s), this.setState({
|
|
3406
3404
|
layout: g ? S : (0, V.compact)(S, (0, V.compactType)(this.props), h),
|
|
3407
|
-
activeDrag:
|
|
3405
|
+
activeDrag: x
|
|
3408
3406
|
});
|
|
3409
3407
|
}), xe(this, "onResizeStop", (t, n, r, o) => {
|
|
3410
3408
|
let {
|
|
@@ -3430,9 +3428,9 @@ class ir extends ht.Component {
|
|
|
3430
3428
|
resizing: !1
|
|
3431
3429
|
}), this.onLayoutMaybeChanged(f, g);
|
|
3432
3430
|
}), xe(this, "onDragOver", (t) => {
|
|
3433
|
-
var
|
|
3431
|
+
var w;
|
|
3434
3432
|
if (t.preventDefault(), t.stopPropagation(), Is && // $FlowIgnore can't figure this out
|
|
3435
|
-
!((
|
|
3433
|
+
!((w = t.nativeEvent.target) != null && w.classList.contains(Yo)))
|
|
3436
3434
|
return !1;
|
|
3437
3435
|
const {
|
|
3438
3436
|
droppingItem: n,
|
|
@@ -3452,7 +3450,7 @@ class ir extends ht.Component {
|
|
|
3452
3450
|
...h
|
|
3453
3451
|
}, {
|
|
3454
3452
|
layout: g
|
|
3455
|
-
} = this.state, m = t.currentTarget.getBoundingClientRect(), S = t.clientX - m.left, I = t.clientY - m.top,
|
|
3453
|
+
} = this.state, m = t.currentTarget.getBoundingClientRect(), S = t.clientX - m.left, I = t.clientY - m.top, y = {
|
|
3456
3454
|
left: S / u,
|
|
3457
3455
|
top: I / u,
|
|
3458
3456
|
e: t
|
|
@@ -3461,10 +3459,10 @@ class ir extends ht.Component {
|
|
|
3461
3459
|
if (this.state.droppingPosition) {
|
|
3462
3460
|
const {
|
|
3463
3461
|
left: C,
|
|
3464
|
-
top:
|
|
3462
|
+
top: x
|
|
3465
3463
|
} = this.state.droppingPosition;
|
|
3466
|
-
(C != S ||
|
|
3467
|
-
droppingPosition:
|
|
3464
|
+
(C != S || x != I) && this.setState({
|
|
3465
|
+
droppingPosition: y
|
|
3468
3466
|
});
|
|
3469
3467
|
}
|
|
3470
3468
|
} else {
|
|
@@ -3475,16 +3473,16 @@ class ir extends ht.Component {
|
|
|
3475
3473
|
rowHeight: s,
|
|
3476
3474
|
containerWidth: a,
|
|
3477
3475
|
containerPadding: c || o
|
|
3478
|
-
},
|
|
3476
|
+
}, x = (0, xu.calcXY)(C, I, S, f.w, f.h);
|
|
3479
3477
|
this.setState({
|
|
3480
3478
|
droppingDOMNode: /* @__PURE__ */ ht.createElement("div", {
|
|
3481
3479
|
key: f.i
|
|
3482
3480
|
}),
|
|
3483
|
-
droppingPosition:
|
|
3481
|
+
droppingPosition: y,
|
|
3484
3482
|
layout: [...g, {
|
|
3485
3483
|
...f,
|
|
3486
|
-
x:
|
|
3487
|
-
y:
|
|
3484
|
+
x: x.x,
|
|
3485
|
+
y: x.y,
|
|
3488
3486
|
static: !1,
|
|
3489
3487
|
isDraggable: !0
|
|
3490
3488
|
}]
|
|
@@ -3621,12 +3619,12 @@ class ir extends ht.Component {
|
|
|
3621
3619
|
transformScale: m,
|
|
3622
3620
|
draggableCancel: S,
|
|
3623
3621
|
draggableHandle: I,
|
|
3624
|
-
resizeHandles:
|
|
3625
|
-
resizeHandle:
|
|
3622
|
+
resizeHandles: y,
|
|
3623
|
+
resizeHandle: w
|
|
3626
3624
|
} = this.props, {
|
|
3627
3625
|
mounted: C,
|
|
3628
|
-
droppingPosition:
|
|
3629
|
-
} = this.state, p = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && u,
|
|
3626
|
+
droppingPosition: x
|
|
3627
|
+
} = this.state, p = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && u, R = typeof r.isResizable == "boolean" ? r.isResizable : !r.static && h, _ = r.resizeHandles || y, b = p && f && r.isBounded !== !1;
|
|
3630
3628
|
return /* @__PURE__ */ ht.createElement(Xo.default, {
|
|
3631
3629
|
containerWidth: o,
|
|
3632
3630
|
cols: i,
|
|
@@ -3643,8 +3641,8 @@ class ir extends ht.Component {
|
|
|
3643
3641
|
onResize: this.onResize,
|
|
3644
3642
|
onResizeStop: this.onResizeStop,
|
|
3645
3643
|
isDraggable: p,
|
|
3646
|
-
isResizable:
|
|
3647
|
-
isBounded:
|
|
3644
|
+
isResizable: R,
|
|
3645
|
+
isBounded: b,
|
|
3648
3646
|
useCSSTransforms: g && C,
|
|
3649
3647
|
usePercentages: !C,
|
|
3650
3648
|
transformScale: m,
|
|
@@ -3658,9 +3656,9 @@ class ir extends ht.Component {
|
|
|
3658
3656
|
maxH: r.maxH,
|
|
3659
3657
|
maxW: r.maxW,
|
|
3660
3658
|
static: r.static,
|
|
3661
|
-
droppingPosition: n ?
|
|
3662
|
-
resizeHandles:
|
|
3663
|
-
resizeHandle:
|
|
3659
|
+
droppingPosition: n ? x : void 0,
|
|
3660
|
+
resizeHandles: _,
|
|
3661
|
+
resizeHandle: w
|
|
3664
3662
|
}, t);
|
|
3665
3663
|
}
|
|
3666
3664
|
render() {
|
|
@@ -4423,39 +4421,39 @@ const dd = /* @__PURE__ */ Kr(ud), Un = {
|
|
|
4423
4421
|
if (!t)
|
|
4424
4422
|
return null;
|
|
4425
4423
|
const n = be(() => {
|
|
4426
|
-
if (t.type ===
|
|
4424
|
+
if (t.type === j.colorScale) {
|
|
4427
4425
|
const s = t.config.map((c, u) => ({ color: new bi(c.color), value: u })), l = s.length - 1;
|
|
4428
4426
|
return new Array(5).fill("").map((c, u, h) => u * l / (h.length - 1)).map((c) => la(s, c));
|
|
4429
4427
|
}
|
|
4430
4428
|
return null;
|
|
4431
4429
|
}, [t]), r = be(() => {
|
|
4432
|
-
if (t.type ===
|
|
4430
|
+
if (t.type === j.iconSet)
|
|
4433
4431
|
return t.config.map((s) => {
|
|
4434
4432
|
const l = bt[s.iconType];
|
|
4435
4433
|
return l && l[Number(s.iconId)];
|
|
4436
4434
|
});
|
|
4437
4435
|
}, [t]);
|
|
4438
4436
|
switch (t.type) {
|
|
4439
|
-
case
|
|
4437
|
+
case j.dataBar: {
|
|
4440
4438
|
const { isGradient: s } = t.config, l = { width: "50%", height: "100%" }, a = s ? `linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))` : t.config.positiveColor, c = s ? `linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})` : t.config.nativeColor;
|
|
4441
4439
|
return /* @__PURE__ */ d.jsxs("div", { className: On.cfPreview, children: [
|
|
4442
4440
|
/* @__PURE__ */ d.jsx("div", { style: { ...l, background: c, border: `1px solid ${t.config.nativeColor}` } }),
|
|
4443
4441
|
/* @__PURE__ */ d.jsx("div", { style: { ...l, background: a, border: `1px solid ${t.config.positiveColor}` } })
|
|
4444
4442
|
] });
|
|
4445
4443
|
}
|
|
4446
|
-
case
|
|
4444
|
+
case j.colorScale:
|
|
4447
4445
|
return n && /* @__PURE__ */ d.jsx("div", { className: On.cfPreview, children: n.map((s, l) => /* @__PURE__ */ d.jsx("div", { style: { width: `${100 / n.length}%`, height: "100%", background: s } }, l)) });
|
|
4448
|
-
case
|
|
4446
|
+
case j.iconSet:
|
|
4449
4447
|
return r && /* @__PURE__ */ d.jsx("div", { className: On.cfPreview, children: r.map((s, l) => s ? /* @__PURE__ */ d.jsx("img", { style: { height: "100%" }, src: s }, l) : /* @__PURE__ */ d.jsx(Sn, {}, l)) });
|
|
4450
|
-
case
|
|
4451
|
-
const { ul: s, st: l, it: a, bl: c, bg: u, cl: h } = t.style, f = (s == null ? void 0 : s.s) === He.TRUE, g = (l == null ? void 0 : l.s) === He.TRUE, m = a === He.TRUE, S = c === He.TRUE, I = (o = u == null ? void 0 : u.rgb) != null ? o : ca,
|
|
4448
|
+
case j.highlightCell: {
|
|
4449
|
+
const { ul: s, st: l, it: a, bl: c, bg: u, cl: h } = t.style, f = (s == null ? void 0 : s.s) === He.TRUE, g = (l == null ? void 0 : l.s) === He.TRUE, m = a === He.TRUE, S = c === He.TRUE, I = (o = u == null ? void 0 : u.rgb) != null ? o : ca, y = (i = h == null ? void 0 : h.rgb) != null ? i : ua, w = {
|
|
4452
4450
|
fontWeight: S ? "bold" : void 0,
|
|
4453
4451
|
fontStyle: m ? "italic" : void 0,
|
|
4454
4452
|
textDecoration: `${f ? "underline" : ""} ${g ? "line-through" : ""}`.replace(/^ /, "") || void 0,
|
|
4455
4453
|
backgroundColor: I,
|
|
4456
|
-
color:
|
|
4454
|
+
color: y
|
|
4457
4455
|
};
|
|
4458
|
-
return /* @__PURE__ */ d.jsx("div", { style:
|
|
4456
|
+
return /* @__PURE__ */ d.jsx("div", { style: w, className: On.cfPreview, children: "123" });
|
|
4459
4457
|
}
|
|
4460
4458
|
}
|
|
4461
4459
|
return null;
|
|
@@ -4529,50 +4527,50 @@ const vd = "univer-cf-rule-list", yd = "univer-rule-selector", bd = "univer-sele
|
|
|
4529
4527
|
}, Ld = (e, t) => {
|
|
4530
4528
|
const n = e.rule;
|
|
4531
4529
|
switch (n.type) {
|
|
4532
|
-
case
|
|
4530
|
+
case j.colorScale:
|
|
4533
4531
|
return t.t("sheet.cf.ruleType.colorScale");
|
|
4534
|
-
case
|
|
4532
|
+
case j.dataBar:
|
|
4535
4533
|
return t.t("sheet.cf.ruleType.dataBar");
|
|
4536
|
-
case
|
|
4534
|
+
case j.iconSet:
|
|
4537
4535
|
return t.t("sheet.cf.ruleType.iconSet");
|
|
4538
|
-
case
|
|
4536
|
+
case j.highlightCell:
|
|
4539
4537
|
switch (n.subType) {
|
|
4540
|
-
case
|
|
4538
|
+
case N.average: {
|
|
4541
4539
|
const r = n.operator;
|
|
4542
4540
|
return t.t(`sheet.cf.preview.describe.${r}`, t.t("sheet.cf.subRuleType.average"));
|
|
4543
4541
|
}
|
|
4544
|
-
case
|
|
4542
|
+
case N.duplicateValues:
|
|
4545
4543
|
return t.t("sheet.cf.subRuleType.duplicateValues");
|
|
4546
|
-
case
|
|
4544
|
+
case N.uniqueValues:
|
|
4547
4545
|
return t.t("sheet.cf.subRuleType.uniqueValues");
|
|
4548
|
-
case
|
|
4546
|
+
case N.number: {
|
|
4549
4547
|
const r = n.operator;
|
|
4550
4548
|
return t.t(`sheet.cf.preview.describe.${r}`, ...Array.isArray(n.value) ? n.value.map((o) => String(o)) : [String(n.value || "")]);
|
|
4551
4549
|
}
|
|
4552
|
-
case
|
|
4550
|
+
case N.text: {
|
|
4553
4551
|
const r = n.operator;
|
|
4554
4552
|
return t.t(`sheet.cf.preview.describe.${r}`, n.value || "");
|
|
4555
4553
|
}
|
|
4556
|
-
case
|
|
4554
|
+
case N.timePeriod: {
|
|
4557
4555
|
const r = n.operator;
|
|
4558
4556
|
return t.t(`sheet.cf.preview.describe.${r}`);
|
|
4559
4557
|
}
|
|
4560
|
-
case
|
|
4558
|
+
case N.rank:
|
|
4561
4559
|
return n.isPercent ? n.isBottom ? t.t("sheet.cf.preview.describe.bottomNPercent", String(n.value)) : t.t("sheet.cf.preview.describe.topNPercent", String(n.value)) : n.isBottom ? t.t("sheet.cf.preview.describe.bottomN", String(n.value)) : t.t("sheet.cf.preview.describe.topN", String(n.value));
|
|
4562
|
-
case
|
|
4560
|
+
case N.formula:
|
|
4563
4561
|
return t.t("sheet.cf.ruleType.formula");
|
|
4564
4562
|
}
|
|
4565
4563
|
}
|
|
4566
4564
|
};
|
|
4567
4565
|
let Qo = 0;
|
|
4568
4566
|
const zd = (e) => {
|
|
4569
|
-
const { onClick: t } = e, n = oe(he), r = oe(re), o = oe(Gt), i = oe(ue), s = oe($e), l = oe(Wt), a = $a(r.getCurrentTypeOfUnit$(G.UNIVER_SHEET)), c = a.getUnitId(), u = a.getActiveSheet();
|
|
4567
|
+
const { onClick: t } = e, n = oe(he), r = oe(re), o = oe(Gt), i = oe(ue), s = oe($e), l = oe(Wt), a = $a(() => r.getCurrentTypeOfUnit$(G.UNIVER_SHEET), void 0, void 0, []), c = a.getUnitId(), u = a.getActiveSheet();
|
|
4570
4568
|
if (!u)
|
|
4571
4569
|
throw new Error("No active sheet found");
|
|
4572
|
-
const h = u.getSheetId(), [f, g] = M([]), [m, S] = M("2"), [I,
|
|
4570
|
+
const h = u.getSheetId(), [f, g] = M([]), [m, S] = M("2"), [I, y] = M(0), [w, C] = M(-1), [x, p] = M(Qo), R = pn(null), _ = [
|
|
4573
4571
|
{ label: s.t("sheet.cf.panel.workSheet"), value: "2" },
|
|
4574
4572
|
{ label: s.t("sheet.cf.panel.selectedRange"), value: "1" }
|
|
4575
|
-
],
|
|
4573
|
+
], b = () => {
|
|
4576
4574
|
const H = n.getSubunitRules(c, h);
|
|
4577
4575
|
if (!H || !H.length)
|
|
4578
4576
|
return [];
|
|
@@ -4601,14 +4599,14 @@ const zd = (e) => {
|
|
|
4601
4599
|
return !1;
|
|
4602
4600
|
})) ? { ...pe, disable: !0 } : { ...pe };
|
|
4603
4601
|
});
|
|
4604
|
-
}, [
|
|
4602
|
+
}, [D, L] = M(b);
|
|
4605
4603
|
Va(f), ve(() => {
|
|
4606
4604
|
const H = i.onCommandExecuted((J) => {
|
|
4607
|
-
J.id === Br.id &&
|
|
4605
|
+
J.id === Br.id && y(Math.random());
|
|
4608
4606
|
});
|
|
4609
4607
|
return () => H.dispose();
|
|
4610
4608
|
}), ve(() => {
|
|
4611
|
-
|
|
4609
|
+
L(b);
|
|
4612
4610
|
}, [m, I, c, h]), ve(() => {
|
|
4613
4611
|
if (m === "2")
|
|
4614
4612
|
return;
|
|
@@ -4619,20 +4617,20 @@ const zd = (e) => {
|
|
|
4619
4617
|
});
|
|
4620
4618
|
return () => le.dispose();
|
|
4621
4619
|
}).pipe(No(16)).subscribe(() => {
|
|
4622
|
-
|
|
4620
|
+
L(b);
|
|
4623
4621
|
});
|
|
4624
4622
|
return () => {
|
|
4625
4623
|
H.unsubscribe();
|
|
4626
4624
|
};
|
|
4627
4625
|
}, [r, m, c, h]), ve(() => {
|
|
4628
4626
|
const H = n.$ruleChange.subscribe(() => {
|
|
4629
|
-
|
|
4627
|
+
y(Math.random());
|
|
4630
4628
|
});
|
|
4631
4629
|
return () => H.unsubscribe();
|
|
4632
4630
|
}, [n]), ve(() => {
|
|
4633
4631
|
const H = () => {
|
|
4634
4632
|
var pe;
|
|
4635
|
-
const le = Math.max(0, (((pe =
|
|
4633
|
+
const le = Math.max(0, (((pe = R.current) == null ? void 0 : pe.getBoundingClientRect().width) || 0) - 8);
|
|
4636
4634
|
return Qo = le, le;
|
|
4637
4635
|
}, ie = new mt((le) => {
|
|
4638
4636
|
const pe = document.querySelector(".univer-sidebar");
|
|
@@ -4662,7 +4660,7 @@ const zd = (e) => {
|
|
|
4662
4660
|
if (!J || !ie)
|
|
4663
4661
|
throw new Error("No active sheet found");
|
|
4664
4662
|
i.executeCommand(Un.id, { unitId: J, subUnitId: ie, cfId: H.cfId });
|
|
4665
|
-
},
|
|
4663
|
+
}, v = (H, J) => {
|
|
4666
4664
|
C(J.y);
|
|
4667
4665
|
}, T = (H, J, ie) => {
|
|
4668
4666
|
var P;
|
|
@@ -4671,39 +4669,39 @@ const zd = (e) => {
|
|
|
4671
4669
|
if (!le || !pe)
|
|
4672
4670
|
throw new Error("No active sheet found");
|
|
4673
4671
|
const me = (z) => {
|
|
4674
|
-
const K =
|
|
4672
|
+
const K = D.length;
|
|
4675
4673
|
return Math.min(K - 1, Math.max(0, z));
|
|
4676
|
-
}, Le =
|
|
4674
|
+
}, Le = D[me(J.y)].cfId, Ue = D[me(ie.y)].cfId;
|
|
4677
4675
|
Le !== Ue && i.executeCommand(So.id, { unitId: le, subUnitId: pe, start: { id: Le, type: "self" }, end: { id: Ue, type: ie.y > J.y ? "after" : "before" } });
|
|
4678
4676
|
}, ee = () => {
|
|
4679
4677
|
e.onCreate();
|
|
4680
4678
|
}, Oe = () => {
|
|
4681
|
-
m === "2" ? i.executeCommand(Gn.id) : m === "1" &&
|
|
4679
|
+
m === "2" ? i.executeCommand(Gn.id) : m === "1" && D.map((J) => ({ unitId: c, subUnitId: h, cfId: J.cfId })).forEach((J) => {
|
|
4682
4680
|
i.executeCommand(Un.id, J);
|
|
4683
4681
|
});
|
|
4684
|
-
}, Se =
|
|
4682
|
+
}, Se = D.map((H, J) => ({ i: H.cfId, x: 0, w: 12, y: J, h: 1, isResizable: !1 })), Ce = E(D), We = Ce == null ? void 0 : Ce.some((H) => H.disable);
|
|
4685
4683
|
return /* @__PURE__ */ d.jsxs("div", { className: ge.cfRuleList, children: [
|
|
4686
4684
|
/* @__PURE__ */ d.jsxs("div", { className: ge.ruleSelector, children: [
|
|
4687
4685
|
/* @__PURE__ */ d.jsx("div", { children: l.tWithReactNode(
|
|
4688
4686
|
"sheet.cf.panel.managerRuleSelect",
|
|
4689
|
-
/* @__PURE__ */ d.jsx(Ve, { className: ge.select, options:
|
|
4687
|
+
/* @__PURE__ */ d.jsx(Ve, { className: ge.select, options: _, value: m, onChange: (H) => {
|
|
4690
4688
|
S(H);
|
|
4691
4689
|
} })
|
|
4692
4690
|
).map((H, J) => /* @__PURE__ */ d.jsx("span", { children: H }, J)) }),
|
|
4693
4691
|
/* @__PURE__ */ d.jsxs("div", { className: ge.btnList, children: [
|
|
4694
4692
|
/* @__PURE__ */ d.jsx(zo, { title: s.t("sheet.cf.panel.createRule"), placement: "bottom", children: /* @__PURE__ */ d.jsx("div", { className: `${ge.icon}`, onClick: ee, children: /* @__PURE__ */ d.jsx(Gi, {}) }) }),
|
|
4695
|
-
|
|
4693
|
+
D.length && !We ? /* @__PURE__ */ d.jsx(zo, { title: s.t("sheet.cf.panel.clear"), placement: "bottom", children: /* @__PURE__ */ d.jsx("div", { className: `${ge.gap} ${ge.icon}`, onClick: Oe, children: /* @__PURE__ */ d.jsx($n, {}) }) }) : /* @__PURE__ */ d.jsx("div", { className: `${ge.gap} ${ge.disabled}`, children: /* @__PURE__ */ d.jsx($n, {}) })
|
|
4696
4694
|
] })
|
|
4697
4695
|
] }),
|
|
4698
|
-
/* @__PURE__ */ d.jsx("div", { ref:
|
|
4696
|
+
/* @__PURE__ */ d.jsx("div", { ref: R, className: ge.gridLayoutWrap, children: x ? /* @__PURE__ */ d.jsx(
|
|
4699
4697
|
dd,
|
|
4700
4698
|
{
|
|
4701
4699
|
onDragStop: T,
|
|
4702
|
-
onDragStart:
|
|
4700
|
+
onDragStart: v,
|
|
4703
4701
|
layout: Se,
|
|
4704
4702
|
cols: 12,
|
|
4705
4703
|
rowHeight: 60,
|
|
4706
|
-
width:
|
|
4704
|
+
width: x,
|
|
4707
4705
|
margin: [0, 10],
|
|
4708
4706
|
draggableHandle: ".draggableHandle",
|
|
4709
4707
|
children: Ce == null ? void 0 : Ce.map((H, J) => /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsxs(
|
|
@@ -4716,7 +4714,7 @@ const zd = (e) => {
|
|
|
4716
4714
|
onClick: () => {
|
|
4717
4715
|
H.disable || t(H);
|
|
4718
4716
|
},
|
|
4719
|
-
className: `${ge.ruleItem} ${
|
|
4717
|
+
className: `${ge.ruleItem} ${w === J ? ge.active : ""}`,
|
|
4720
4718
|
children: [
|
|
4721
4719
|
/* @__PURE__ */ d.jsx(
|
|
4722
4720
|
"div",
|
|
@@ -4734,7 +4732,7 @@ const zd = (e) => {
|
|
|
4734
4732
|
!H.disable && /* @__PURE__ */ d.jsx(
|
|
4735
4733
|
"div",
|
|
4736
4734
|
{
|
|
4737
|
-
className: `${ge.deleteItem} ${
|
|
4735
|
+
className: `${ge.deleteItem} ${w === J ? ge.active : ""}`,
|
|
4738
4736
|
onClick: (ie) => {
|
|
4739
4737
|
ie.stopPropagation(), W(H);
|
|
4740
4738
|
},
|
|
@@ -4789,7 +4787,7 @@ const zd = (e) => {
|
|
|
4789
4787
|
] })
|
|
4790
4788
|
}
|
|
4791
4789
|
));
|
|
4792
|
-
}, Ad = "univer-cf-rule-style-editor", kd = "univer-cf-preview-wrap", qd = "univer-text", Bd = "univer-position-relative", Gd = "univer-btn-list", Xd = "univer-util-item", Yd = "univer-icon-set", Kd = "univer-render-config", Zd = "univer-flex", Jd = "univer-width45", Qd = "univer-icon-wrap", ef = "univer-icon", tf = "univer-dropdown-icon", nf = "univer-error-input", rf = "univer-error-text", of = "univer-icon-group-list", sf = "univer-title", af = "univer-group", lf = "univer-item-content", cf = "univer-item-wrap", uf = "univer-item", df = "univer-icon-item-list-wrap", ff = "univer-none", hf = "univer-icon-item-list", pf = "univer-width100", gf = "univer-stress",
|
|
4790
|
+
}, Ad = "univer-cf-rule-style-editor", kd = "univer-cf-preview-wrap", qd = "univer-text", Bd = "univer-position-relative", Gd = "univer-btn-list", Xd = "univer-util-item", Yd = "univer-icon-set", Kd = "univer-render-config", Zd = "univer-flex", Jd = "univer-width45", Qd = "univer-icon-wrap", ef = "univer-icon", tf = "univer-dropdown-icon", nf = "univer-error-input", rf = "univer-error-text", of = "univer-icon-group-list", sf = "univer-title", af = "univer-group", lf = "univer-item-content", cf = "univer-item-wrap", uf = "univer-item", df = "univer-icon-item-list-wrap", ff = "univer-none", hf = "univer-icon-item-list", pf = "univer-width100", gf = "univer-stress", $ = {
|
|
4793
4791
|
cfRuleStyleEditor: Ad,
|
|
4794
4792
|
cfPreviewWrap: kd,
|
|
4795
4793
|
text: qd,
|
|
@@ -4842,48 +4840,48 @@ const zd = (e) => {
|
|
|
4842
4840
|
) : /* @__PURE__ */ d.jsx(St, { className: n, value: Number(e.value) || 0, onChange: (f) => e.onChange(f || 0), ...u });
|
|
4843
4841
|
}, mf = (e) => {
|
|
4844
4842
|
var W;
|
|
4845
|
-
const { interceptorManager: t } = e, n = oe($e), r = ((W = e.rule) == null ? void 0 : W.type) ===
|
|
4843
|
+
const { interceptorManager: t } = e, n = oe($e), r = ((W = e.rule) == null ? void 0 : W.type) === j.colorScale ? e.rule : void 0, o = [gt(A.num, n), gt(A.percent, n), gt(A.percentile, n), gt(A.formula, n)], i = [gt(A.min, n), ...o], s = [gt("none", n), ...o], l = [gt(A.max, n), ...o], [a, c] = M(() => {
|
|
4846
4844
|
var T;
|
|
4847
|
-
const
|
|
4848
|
-
return r && ((T = r.config[0]) == null ? void 0 : T.value.type) ||
|
|
4845
|
+
const v = A.min;
|
|
4846
|
+
return r && ((T = r.config[0]) == null ? void 0 : T.value.type) || v;
|
|
4849
4847
|
}), [u, h] = M(() => {
|
|
4850
4848
|
var T;
|
|
4851
|
-
const
|
|
4852
|
-
return !r || r.config.length !== 3 ?
|
|
4849
|
+
const v = "none";
|
|
4850
|
+
return !r || r.config.length !== 3 ? v : ((T = r.config[1]) == null ? void 0 : T.value.type) || v;
|
|
4853
4851
|
}), [f, g] = M(() => {
|
|
4854
4852
|
var T;
|
|
4855
|
-
const
|
|
4856
|
-
return r && ((T = r.config[r.config.length - 1]) == null ? void 0 : T.value.type) ||
|
|
4853
|
+
const v = A.max;
|
|
4854
|
+
return r && ((T = r.config[r.config.length - 1]) == null ? void 0 : T.value.type) || v;
|
|
4857
4855
|
}), [m, S] = M(() => {
|
|
4858
4856
|
if (!r)
|
|
4859
4857
|
return 10;
|
|
4860
4858
|
const T = r.config[0];
|
|
4861
4859
|
return (T == null ? void 0 : T.value.value) === void 0 ? 10 : T == null ? void 0 : T.value.value;
|
|
4862
|
-
}), [I,
|
|
4860
|
+
}), [I, y] = M(() => {
|
|
4863
4861
|
var ee;
|
|
4864
4862
|
if (!r || r.config.length !== 3)
|
|
4865
4863
|
return 50;
|
|
4866
4864
|
const T = (ee = r.config[1]) == null ? void 0 : ee.value.value;
|
|
4867
4865
|
return T === void 0 ? 50 : T;
|
|
4868
|
-
}), [
|
|
4866
|
+
}), [w, C] = M(() => {
|
|
4869
4867
|
var ee;
|
|
4870
4868
|
if (!r)
|
|
4871
4869
|
return 90;
|
|
4872
4870
|
const T = (ee = r.config[r.config.length - 1]) == null ? void 0 : ee.value.value;
|
|
4873
4871
|
return T === void 0 ? 90 : T;
|
|
4874
|
-
}), [
|
|
4872
|
+
}), [x, p] = M(() => {
|
|
4875
4873
|
var T;
|
|
4876
|
-
const
|
|
4877
|
-
return r && ((T = r.config[0]) == null ? void 0 : T.color) ||
|
|
4878
|
-
}), [
|
|
4874
|
+
const v = "#d0d9fb";
|
|
4875
|
+
return r && ((T = r.config[0]) == null ? void 0 : T.color) || v;
|
|
4876
|
+
}), [R, _] = M(() => {
|
|
4879
4877
|
var T;
|
|
4880
|
-
const
|
|
4881
|
-
return !r || r.config.length !== 3 ?
|
|
4882
|
-
}), [
|
|
4878
|
+
const v = "#7790f3";
|
|
4879
|
+
return !r || r.config.length !== 3 ? v : ((T = r.config[1]) == null ? void 0 : T.color) || v;
|
|
4880
|
+
}), [b, E] = M(() => {
|
|
4883
4881
|
var T;
|
|
4884
|
-
const
|
|
4885
|
-
return r && ((T = r.config[r.config.length - 1]) == null ? void 0 : T.color) ||
|
|
4886
|
-
}),
|
|
4882
|
+
const v = "#2e55ef";
|
|
4883
|
+
return r && ((T = r.config[r.config.length - 1]) == null ? void 0 : T.color) || v;
|
|
4884
|
+
}), D = be(() => (v) => {
|
|
4887
4885
|
const {
|
|
4888
4886
|
minType: T,
|
|
4889
4887
|
medianType: ee,
|
|
@@ -4894,20 +4892,20 @@ const zd = (e) => {
|
|
|
4894
4892
|
minColor: H,
|
|
4895
4893
|
medianColor: J,
|
|
4896
4894
|
maxColor: ie
|
|
4897
|
-
} =
|
|
4898
|
-
return le.push({ color: H, value: { type: T, value: Se } }), ee !== "none" && le.push({ color: J, value: { type: ee, value: Ce } }), le.push({ color: ie, value: { type: Oe, value: We } }), { config: le.map((me, Le) => ({ ...me, index: Le })), type:
|
|
4895
|
+
} = v, le = [];
|
|
4896
|
+
return le.push({ color: H, value: { type: T, value: Se } }), ee !== "none" && le.push({ color: J, value: { type: ee, value: Ce } }), le.push({ color: ie, value: { type: Oe, value: We } }), { config: le.map((me, Le) => ({ ...me, index: Le })), type: j.colorScale };
|
|
4899
4897
|
}, []);
|
|
4900
4898
|
ve(() => t.intercept(t.getInterceptPoints().submit, {
|
|
4901
4899
|
handler() {
|
|
4902
|
-
return
|
|
4900
|
+
return D({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: w, minColor: x, medianColor: R, maxColor: b });
|
|
4903
4901
|
}
|
|
4904
|
-
}), [
|
|
4905
|
-
const
|
|
4906
|
-
e.onChange(
|
|
4902
|
+
}), [D, a, u, f, m, I, w, x, R, b, t]);
|
|
4903
|
+
const L = (v) => {
|
|
4904
|
+
e.onChange(D(v));
|
|
4907
4905
|
};
|
|
4908
4906
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
4909
4907
|
/* @__PURE__ */ d.jsx("div", { className: O.title, children: n.t("sheet.cf.panel.styleRule") }),
|
|
4910
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
4908
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.cfPreviewWrap}`, children: /* @__PURE__ */ d.jsx(Kt, { rule: D({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: w, minColor: x, medianColor: R, maxColor: b }) }) }),
|
|
4911
4909
|
/* @__PURE__ */ d.jsx("div", { className: O.label, children: n.t("sheet.cf.valueType.min") }),
|
|
4912
4910
|
/* @__PURE__ */ d.jsxs("div", { className: `${O.labelContainer} ${O.mTSm}`, children: [
|
|
4913
4911
|
/* @__PURE__ */ d.jsx(
|
|
@@ -4915,10 +4913,10 @@ const zd = (e) => {
|
|
|
4915
4913
|
{
|
|
4916
4914
|
options: i,
|
|
4917
4915
|
value: a,
|
|
4918
|
-
onChange: (
|
|
4919
|
-
c(
|
|
4920
|
-
const T = cn(
|
|
4921
|
-
S(T),
|
|
4916
|
+
onChange: (v) => {
|
|
4917
|
+
c(v);
|
|
4918
|
+
const T = cn(v, 10);
|
|
4919
|
+
S(T), L({ minType: v, medianType: u, maxType: f, minValue: T, medianValue: I, maxValue: w, minColor: x, medianColor: R, maxColor: b });
|
|
4922
4920
|
}
|
|
4923
4921
|
}
|
|
4924
4922
|
),
|
|
@@ -4929,8 +4927,8 @@ const zd = (e) => {
|
|
|
4929
4927
|
className: `${O.mLXxs}`,
|
|
4930
4928
|
value: m,
|
|
4931
4929
|
type: a,
|
|
4932
|
-
onChange: (
|
|
4933
|
-
S(
|
|
4930
|
+
onChange: (v) => {
|
|
4931
|
+
S(v), L({ minType: a, medianType: u, maxType: f, minValue: v, medianValue: I, maxValue: w, minColor: x, medianColor: R, maxColor: b });
|
|
4934
4932
|
}
|
|
4935
4933
|
}
|
|
4936
4934
|
),
|
|
@@ -4938,9 +4936,9 @@ const zd = (e) => {
|
|
|
4938
4936
|
_t,
|
|
4939
4937
|
{
|
|
4940
4938
|
className: O.mLXxs,
|
|
4941
|
-
color:
|
|
4942
|
-
onChange: (
|
|
4943
|
-
p(
|
|
4939
|
+
color: x,
|
|
4940
|
+
onChange: (v) => {
|
|
4941
|
+
p(v), L({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: w, minColor: v, medianColor: R, maxColor: b });
|
|
4944
4942
|
}
|
|
4945
4943
|
}
|
|
4946
4944
|
)
|
|
@@ -4952,10 +4950,10 @@ const zd = (e) => {
|
|
|
4952
4950
|
{
|
|
4953
4951
|
options: s,
|
|
4954
4952
|
value: u,
|
|
4955
|
-
onChange: (
|
|
4956
|
-
h(
|
|
4957
|
-
const T = cn(
|
|
4958
|
-
|
|
4953
|
+
onChange: (v) => {
|
|
4954
|
+
h(v);
|
|
4955
|
+
const T = cn(v, 50);
|
|
4956
|
+
y(T), L({ minType: a, medianType: v, maxType: f, minValue: m, medianValue: T, maxValue: w, minColor: x, medianColor: R, maxColor: b });
|
|
4959
4957
|
}
|
|
4960
4958
|
}
|
|
4961
4959
|
),
|
|
@@ -4966,8 +4964,8 @@ const zd = (e) => {
|
|
|
4966
4964
|
className: ` ${O.mLXxs}`,
|
|
4967
4965
|
value: I,
|
|
4968
4966
|
type: u,
|
|
4969
|
-
onChange: (
|
|
4970
|
-
v
|
|
4967
|
+
onChange: (v) => {
|
|
4968
|
+
y(v), L({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: v, maxValue: w, minColor: x, medianColor: R, maxColor: b });
|
|
4971
4969
|
}
|
|
4972
4970
|
}
|
|
4973
4971
|
),
|
|
@@ -4975,9 +4973,9 @@ const zd = (e) => {
|
|
|
4975
4973
|
_t,
|
|
4976
4974
|
{
|
|
4977
4975
|
className: O.mLXxs,
|
|
4978
|
-
color:
|
|
4979
|
-
onChange: (
|
|
4980
|
-
|
|
4976
|
+
color: R,
|
|
4977
|
+
onChange: (v) => {
|
|
4978
|
+
_(v), L({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: w, minColor: x, medianColor: v, maxColor: b });
|
|
4981
4979
|
}
|
|
4982
4980
|
}
|
|
4983
4981
|
)
|
|
@@ -4989,10 +4987,10 @@ const zd = (e) => {
|
|
|
4989
4987
|
{
|
|
4990
4988
|
options: l,
|
|
4991
4989
|
value: f,
|
|
4992
|
-
onChange: (
|
|
4993
|
-
g(
|
|
4994
|
-
const T = cn(
|
|
4995
|
-
C(T),
|
|
4990
|
+
onChange: (v) => {
|
|
4991
|
+
g(v);
|
|
4992
|
+
const T = cn(v, 90);
|
|
4993
|
+
C(T), L({ minType: a, medianType: u, maxType: v, minValue: m, medianValue: I, maxValue: T, minColor: x, medianColor: R, maxColor: b });
|
|
4996
4994
|
}
|
|
4997
4995
|
}
|
|
4998
4996
|
),
|
|
@@ -5001,10 +4999,10 @@ const zd = (e) => {
|
|
|
5001
4999
|
{
|
|
5002
5000
|
id: "max",
|
|
5003
5001
|
className: `${O.mLXxs}`,
|
|
5004
|
-
value:
|
|
5002
|
+
value: w,
|
|
5005
5003
|
type: f,
|
|
5006
|
-
onChange: (
|
|
5007
|
-
C(
|
|
5004
|
+
onChange: (v) => {
|
|
5005
|
+
C(v), L({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: v, minColor: x, medianColor: R, maxColor: b });
|
|
5008
5006
|
}
|
|
5009
5007
|
}
|
|
5010
5008
|
),
|
|
@@ -5012,9 +5010,9 @@ const zd = (e) => {
|
|
|
5012
5010
|
_t,
|
|
5013
5011
|
{
|
|
5014
5012
|
className: O.mLXxs,
|
|
5015
|
-
color:
|
|
5016
|
-
onChange: (
|
|
5017
|
-
E(
|
|
5013
|
+
color: b,
|
|
5014
|
+
onChange: (v) => {
|
|
5015
|
+
E(v), L({ minType: a, medianType: u, maxType: f, minValue: m, medianValue: I, maxValue: w, minColor: x, medianColor: R, maxColor: v });
|
|
5018
5016
|
}
|
|
5019
5017
|
}
|
|
5020
5018
|
)
|
|
@@ -5061,60 +5059,60 @@ const zd = (e) => {
|
|
|
5061
5059
|
);
|
|
5062
5060
|
}, vf = (e) => {
|
|
5063
5061
|
var W;
|
|
5064
|
-
const { interceptorManager: t } = e, n = oe($e), r = ((W = e.rule) == null ? void 0 : W.type) ===
|
|
5062
|
+
const { interceptorManager: t } = e, n = oe($e), r = ((W = e.rule) == null ? void 0 : W.type) === j.dataBar ? e.rule : void 0, [o, i] = M(() => {
|
|
5065
5063
|
var T;
|
|
5066
|
-
const
|
|
5067
|
-
return r ? (T = r.config) != null && T.isGradient ? "1" : "0" :
|
|
5064
|
+
const v = "0";
|
|
5065
|
+
return r ? (T = r.config) != null && T.isGradient ? "1" : "0" : v;
|
|
5068
5066
|
}), [s, l] = M(() => {
|
|
5069
5067
|
var T;
|
|
5070
|
-
const
|
|
5071
|
-
return r && ((T = r.config) == null ? void 0 : T.positiveColor) ||
|
|
5068
|
+
const v = "#abd91a";
|
|
5069
|
+
return r && ((T = r.config) == null ? void 0 : T.positiveColor) || v;
|
|
5072
5070
|
}), [a, c] = M(() => {
|
|
5073
5071
|
var T;
|
|
5074
|
-
const
|
|
5075
|
-
return r && ((T = r.config) == null ? void 0 : T.nativeColor) ||
|
|
5072
|
+
const v = "#ffbe38";
|
|
5073
|
+
return r && ((T = r.config) == null ? void 0 : T.nativeColor) || v;
|
|
5076
5074
|
}), u = [jt(A.num, n), jt(A.percent, n), jt(A.percentile, n), jt(A.formula, n)], h = [jt(A.min, n), ...u], f = [jt(A.max, n), ...u], [g, m] = M(() => {
|
|
5077
5075
|
var T;
|
|
5078
|
-
const
|
|
5079
|
-
return r && ((T = r.config) == null ? void 0 : T.min.type) ||
|
|
5076
|
+
const v = h[0].value;
|
|
5077
|
+
return r && ((T = r.config) == null ? void 0 : T.min.type) || v;
|
|
5080
5078
|
}), [S, I] = M(() => {
|
|
5081
5079
|
var T;
|
|
5082
|
-
const
|
|
5083
|
-
return r && ((T = r.config) == null ? void 0 : T.max.type) ||
|
|
5084
|
-
}), [
|
|
5080
|
+
const v = f[0].value;
|
|
5081
|
+
return r && ((T = r.config) == null ? void 0 : T.max.type) || v;
|
|
5082
|
+
}), [y, w] = M(() => {
|
|
5085
5083
|
var ee;
|
|
5086
5084
|
if (!r)
|
|
5087
5085
|
return 0;
|
|
5088
5086
|
const T = ((ee = r.config) == null ? void 0 : ee.min) || {};
|
|
5089
5087
|
return T.type === A.formula ? T.value || "=" : T.value || 0;
|
|
5090
|
-
}), [C,
|
|
5088
|
+
}), [C, x] = M(() => {
|
|
5091
5089
|
var ee;
|
|
5092
5090
|
if (!r)
|
|
5093
5091
|
return 100;
|
|
5094
5092
|
const T = ((ee = r.config) == null ? void 0 : ee.max) || {};
|
|
5095
5093
|
return T.type === A.formula ? T.value || "=" : T.value === void 0 ? 100 : T.value;
|
|
5096
|
-
}), [p,
|
|
5097
|
-
min: { type:
|
|
5098
|
-
max: { type:
|
|
5099
|
-
isGradient:
|
|
5100
|
-
positiveColor:
|
|
5101
|
-
nativeColor:
|
|
5102
|
-
}, type:
|
|
5094
|
+
}), [p, R] = M(() => r ? r.isShowValue === void 0 ? !0 : !!r.isShowValue : !0), _ = (v) => ({ config: {
|
|
5095
|
+
min: { type: v.minValueType, value: v.minValue },
|
|
5096
|
+
max: { type: v.maxValueType, value: v.maxValue },
|
|
5097
|
+
isGradient: v.isGradient === "1",
|
|
5098
|
+
positiveColor: v.positiveColor,
|
|
5099
|
+
nativeColor: v.nativeColor
|
|
5100
|
+
}, type: j.dataBar, isShowValue: v.isShowValue });
|
|
5103
5101
|
ve(() => t.intercept(t.getInterceptPoints().submit, {
|
|
5104
5102
|
handler() {
|
|
5105
|
-
return
|
|
5103
|
+
return _({ isGradient: o, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5106
5104
|
}
|
|
5107
|
-
}), [o,
|
|
5108
|
-
const
|
|
5109
|
-
e.onChange(
|
|
5110
|
-
}, E = (
|
|
5111
|
-
l(
|
|
5112
|
-
},
|
|
5113
|
-
c(
|
|
5114
|
-
},
|
|
5105
|
+
}), [o, y, g, C, S, s, a, t, p]);
|
|
5106
|
+
const b = (v) => {
|
|
5107
|
+
e.onChange(_(v));
|
|
5108
|
+
}, E = (v) => {
|
|
5109
|
+
l(v), b({ isGradient: o, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: v, nativeColor: a, isShowValue: p });
|
|
5110
|
+
}, D = (v) => {
|
|
5111
|
+
c(v), b({ isGradient: o, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: v, isShowValue: p });
|
|
5112
|
+
}, L = (v) => u.map((T) => T.value).includes(v);
|
|
5115
5113
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
5116
5114
|
/* @__PURE__ */ d.jsx("div", { className: O.title, children: n.t("sheet.cf.panel.styleRule") }),
|
|
5117
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5115
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.cfPreviewWrap}`, children: /* @__PURE__ */ d.jsx(Kt, { rule: _({ isGradient: o, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p }) }) }),
|
|
5118
5116
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
|
5119
5117
|
/* @__PURE__ */ d.jsx("div", { className: O.label, children: n.t("sheet.cf.panel.fillType") }),
|
|
5120
5118
|
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${O.mLXxs} ${O.labelContainer} `, children: [
|
|
@@ -5122,22 +5120,22 @@ const zd = (e) => {
|
|
|
5122
5120
|
Ya,
|
|
5123
5121
|
{
|
|
5124
5122
|
value: o,
|
|
5125
|
-
onChange: (
|
|
5126
|
-
i(
|
|
5123
|
+
onChange: (v) => {
|
|
5124
|
+
i(v), b({ isGradient: v, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5127
5125
|
},
|
|
5128
5126
|
children: [
|
|
5129
|
-
/* @__PURE__ */ d.jsx(Ho, { value: "0", children: /* @__PURE__ */ d.jsx("span", { className:
|
|
5130
|
-
/* @__PURE__ */ d.jsx(Ho, { value: "1", children: /* @__PURE__ */ d.jsx("span", { className:
|
|
5127
|
+
/* @__PURE__ */ d.jsx(Ho, { value: "0", children: /* @__PURE__ */ d.jsx("span", { className: $.text, children: n.t("sheet.cf.panel.pureColor") }) }),
|
|
5128
|
+
/* @__PURE__ */ d.jsx(Ho, { value: "1", children: /* @__PURE__ */ d.jsx("span", { className: $.text, children: n.t("sheet.cf.panel.gradient") }) })
|
|
5131
5129
|
]
|
|
5132
5130
|
}
|
|
5133
5131
|
),
|
|
5134
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${
|
|
5132
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${$.utilItem} ${O.mLXl}`, children: [
|
|
5135
5133
|
/* @__PURE__ */ d.jsx(
|
|
5136
5134
|
zn,
|
|
5137
5135
|
{
|
|
5138
5136
|
checked: !p,
|
|
5139
|
-
onChange: (
|
|
5140
|
-
|
|
5137
|
+
onChange: (v) => {
|
|
5138
|
+
R(!v), b({ isGradient: v, minValue: y, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: !v });
|
|
5141
5139
|
}
|
|
5142
5140
|
}
|
|
5143
5141
|
),
|
|
@@ -5149,17 +5147,17 @@ const zd = (e) => {
|
|
|
5149
5147
|
/* @__PURE__ */ d.jsx("div", { className: O.label, children: n.t("sheet.cf.panel.colorSet") }),
|
|
5150
5148
|
/* @__PURE__ */ d.jsxs("div", { className: `${O.labelContainer} ${O.mTSm} ${O.mLXxs}`, children: [
|
|
5151
5149
|
/* @__PURE__ */ d.jsxs("div", { className: `${O.labelContainer}`, children: [
|
|
5152
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5150
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.text}`, children: n.t("sheet.cf.panel.native") }),
|
|
5153
5151
|
/* @__PURE__ */ d.jsx(
|
|
5154
5152
|
_t,
|
|
5155
5153
|
{
|
|
5156
5154
|
color: a,
|
|
5157
|
-
onChange:
|
|
5155
|
+
onChange: D
|
|
5158
5156
|
}
|
|
5159
5157
|
)
|
|
5160
5158
|
] }),
|
|
5161
5159
|
/* @__PURE__ */ d.jsxs("div", { className: `${O.labelContainer} ${O.mLSm} `, children: [
|
|
5162
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5160
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.text} `, children: n.t("sheet.cf.panel.positive") }),
|
|
5163
5161
|
/* @__PURE__ */ d.jsx(
|
|
5164
5162
|
_t,
|
|
5165
5163
|
{
|
|
@@ -5178,23 +5176,23 @@ const zd = (e) => {
|
|
|
5178
5176
|
{
|
|
5179
5177
|
options: h,
|
|
5180
5178
|
value: g,
|
|
5181
|
-
onChange: (
|
|
5182
|
-
m(
|
|
5183
|
-
const T = cn(
|
|
5184
|
-
|
|
5179
|
+
onChange: (v) => {
|
|
5180
|
+
m(v);
|
|
5181
|
+
const T = cn(v, 10);
|
|
5182
|
+
w(T), b({ isGradient: o, minValue: T, minValueType: v, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5185
5183
|
}
|
|
5186
5184
|
}
|
|
5187
5185
|
),
|
|
5188
5186
|
/* @__PURE__ */ d.jsx(
|
|
5189
5187
|
ei,
|
|
5190
5188
|
{
|
|
5191
|
-
disabled: !
|
|
5189
|
+
disabled: !L(g),
|
|
5192
5190
|
id: "min",
|
|
5193
5191
|
type: g,
|
|
5194
5192
|
className: O.mLSm,
|
|
5195
|
-
value:
|
|
5196
|
-
onChange: (
|
|
5197
|
-
|
|
5193
|
+
value: y,
|
|
5194
|
+
onChange: (v) => {
|
|
5195
|
+
w(v || 0), b({ isGradient: o, minValue: v || 0, minValueType: g, maxValue: C, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5198
5196
|
}
|
|
5199
5197
|
}
|
|
5200
5198
|
)
|
|
@@ -5206,23 +5204,23 @@ const zd = (e) => {
|
|
|
5206
5204
|
{
|
|
5207
5205
|
options: f,
|
|
5208
5206
|
value: S,
|
|
5209
|
-
onChange: (
|
|
5210
|
-
I(
|
|
5211
|
-
const T = cn(
|
|
5212
|
-
|
|
5207
|
+
onChange: (v) => {
|
|
5208
|
+
I(v);
|
|
5209
|
+
const T = cn(v, 90);
|
|
5210
|
+
x(T), b({ isGradient: o, minValue: y, minValueType: g, maxValue: T, maxValueType: v, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5213
5211
|
}
|
|
5214
5212
|
}
|
|
5215
5213
|
),
|
|
5216
5214
|
/* @__PURE__ */ d.jsx(
|
|
5217
5215
|
ei,
|
|
5218
5216
|
{
|
|
5219
|
-
disabled: !
|
|
5217
|
+
disabled: !L(S),
|
|
5220
5218
|
id: "max",
|
|
5221
5219
|
type: S,
|
|
5222
5220
|
className: O.mLSm,
|
|
5223
5221
|
value: C,
|
|
5224
|
-
onChange: (
|
|
5225
|
-
|
|
5222
|
+
onChange: (v) => {
|
|
5223
|
+
x(v || 0), b({ isGradient: o, minValue: y, minValueType: g, maxValue: v || 0, maxValueType: S, positiveColor: s, nativeColor: a, isShowValue: p });
|
|
5226
5224
|
}
|
|
5227
5225
|
}
|
|
5228
5226
|
)
|
|
@@ -5247,14 +5245,14 @@ const zd = (e) => {
|
|
|
5247
5245
|
if (t != null && t.st)
|
|
5248
5246
|
return t.st.s;
|
|
5249
5247
|
}), [g, m] = M(() => {
|
|
5250
|
-
var
|
|
5248
|
+
var R;
|
|
5251
5249
|
const p = "#2f56ef";
|
|
5252
|
-
return (
|
|
5250
|
+
return (R = t == null ? void 0 : t.cl) != null && R.rgb ? t.cl.rgb : p;
|
|
5253
5251
|
}), [S, I] = M(() => {
|
|
5254
|
-
var
|
|
5252
|
+
var R;
|
|
5255
5253
|
const p = "#e8ecfc";
|
|
5256
|
-
return (
|
|
5257
|
-
}),
|
|
5254
|
+
return (R = t == null ? void 0 : t.bg) != null && R.rgb ? t.bg.rgb : p;
|
|
5255
|
+
}), y = o.get("BoldSingle"), w = o.get("ItalicSingle"), C = o.get("UnderlineSingle"), x = o.get("StrikethroughSingle");
|
|
5258
5256
|
return ve(() => {
|
|
5259
5257
|
const p = {
|
|
5260
5258
|
bl: i,
|
|
@@ -5262,87 +5260,87 @@ const zd = (e) => {
|
|
|
5262
5260
|
};
|
|
5263
5261
|
g !== void 0 && (p.cl = { rgb: g }), S !== void 0 && (p.bg = { rgb: S }), h !== void 0 && (p.st = { s: h }), c !== void 0 && (p.ul = { s: c }), n(da(p));
|
|
5264
5262
|
}, [i, l, c, h, g, S]), /* @__PURE__ */ d.jsxs("div", { className: `${Qe.cfStyleEdit} ${r}`, children: [
|
|
5265
|
-
|
|
5266
|
-
|
|
5263
|
+
y && /* @__PURE__ */ d.jsx("div", { className: ct({ [Qe.isActive]: Pn(i || He.FALSE) }, Qe.buttonItem), onClick: () => s(En(i)), children: /* @__PURE__ */ d.jsx(y, {}) }),
|
|
5264
|
+
w && /* @__PURE__ */ d.jsx("div", { className: ct({ [Qe.isActive]: Pn(l || He.FALSE) }, Qe.buttonItem), onClick: () => a(En(l)), children: /* @__PURE__ */ d.jsx(w, {}) }),
|
|
5267
5265
|
C && /* @__PURE__ */ d.jsx("div", { className: ct({ [Qe.isActive]: Pn(c || He.FALSE) }, Qe.buttonItem), onClick: () => u(En(c)), children: /* @__PURE__ */ d.jsx(C, {}) }),
|
|
5268
|
-
|
|
5266
|
+
x && /* @__PURE__ */ d.jsx("div", { className: ct({ [Qe.isActive]: Pn(h || He.FALSE) }, Qe.buttonItem), onClick: () => f(En(h)), children: /* @__PURE__ */ d.jsx(x, {}) }),
|
|
5269
5267
|
/* @__PURE__ */ d.jsx(_t, { color: g, onChange: m, iconId: "FontColor" }),
|
|
5270
5268
|
/* @__PURE__ */ d.jsx(_t, { color: S, onChange: I, iconId: "PaintBucket" })
|
|
5271
5269
|
] });
|
|
5272
5270
|
}, Cf = (e) => {
|
|
5273
5271
|
var I;
|
|
5274
|
-
const { onChange: t, interceptorManager: n } = e, r = oe($e), o = ((I = e.rule) == null ? void 0 : I.type) ===
|
|
5272
|
+
const { onChange: t, interceptorManager: n } = e, r = oe($e), o = ((I = e.rule) == null ? void 0 : I.type) === j.highlightCell ? e.rule : void 0, i = [
|
|
5275
5273
|
{ label: r.t("sheet.cf.panel.isNotBottom"), value: "isNotBottom" },
|
|
5276
5274
|
{ label: r.t("sheet.cf.panel.isBottom"), value: "isBottom" },
|
|
5277
5275
|
{ label: r.t("sheet.cf.panel.greaterThanAverage"), value: "greaterThanAverage" },
|
|
5278
5276
|
{ label: r.t("sheet.cf.panel.lessThanAverage"), value: "lessThanAverage" }
|
|
5279
5277
|
], [s, l] = M(() => {
|
|
5280
|
-
const
|
|
5278
|
+
const y = i[0].value, w = o == null ? void 0 : o.type;
|
|
5281
5279
|
if (!o)
|
|
5282
|
-
return
|
|
5283
|
-
switch (
|
|
5284
|
-
case
|
|
5280
|
+
return y;
|
|
5281
|
+
switch (w) {
|
|
5282
|
+
case j.highlightCell:
|
|
5285
5283
|
switch (o.subType) {
|
|
5286
|
-
case
|
|
5287
|
-
return [F.greaterThan, F.greaterThanOrEqual].includes(o.operator) ? "greaterThanAverage" : [F.lessThan, F.lessThanOrEqual].includes(o.operator) ? "lessThanAverage" :
|
|
5288
|
-
case
|
|
5284
|
+
case N.average:
|
|
5285
|
+
return [F.greaterThan, F.greaterThanOrEqual].includes(o.operator) ? "greaterThanAverage" : [F.lessThan, F.lessThanOrEqual].includes(o.operator) ? "lessThanAverage" : y;
|
|
5286
|
+
case N.rank:
|
|
5289
5287
|
return o.isBottom ? "isBottom" : "isNotBottom";
|
|
5290
5288
|
}
|
|
5291
5289
|
}
|
|
5292
|
-
return
|
|
5290
|
+
return y;
|
|
5293
5291
|
}), [a, c] = M(() => {
|
|
5294
|
-
const
|
|
5292
|
+
const w = o == null ? void 0 : o.type;
|
|
5295
5293
|
if (!o)
|
|
5296
5294
|
return 10;
|
|
5297
|
-
switch (
|
|
5298
|
-
case
|
|
5295
|
+
switch (w) {
|
|
5296
|
+
case j.highlightCell:
|
|
5299
5297
|
switch (o.subType) {
|
|
5300
|
-
case
|
|
5298
|
+
case N.rank:
|
|
5301
5299
|
return o.value || 10;
|
|
5302
5300
|
}
|
|
5303
5301
|
}
|
|
5304
5302
|
return 10;
|
|
5305
5303
|
}), [u, h] = M(() => {
|
|
5306
|
-
const
|
|
5304
|
+
const w = o == null ? void 0 : o.type;
|
|
5307
5305
|
if (!o)
|
|
5308
5306
|
return !1;
|
|
5309
|
-
switch (
|
|
5310
|
-
case
|
|
5307
|
+
switch (w) {
|
|
5308
|
+
case j.highlightCell:
|
|
5311
5309
|
switch (o.subType) {
|
|
5312
|
-
case
|
|
5310
|
+
case N.rank:
|
|
5313
5311
|
return o.isPercent || !1;
|
|
5314
5312
|
}
|
|
5315
5313
|
}
|
|
5316
5314
|
return !1;
|
|
5317
|
-
}), [f, g] = M({}), m = (
|
|
5318
|
-
const { type:
|
|
5319
|
-
if (
|
|
5320
|
-
return { type:
|
|
5321
|
-
if (
|
|
5322
|
-
return { type:
|
|
5323
|
-
if (
|
|
5324
|
-
return { type:
|
|
5325
|
-
if (
|
|
5326
|
-
return { type:
|
|
5315
|
+
}), [f, g] = M({}), m = (y) => {
|
|
5316
|
+
const { type: w, isPercent: C, value: x, style: p } = y;
|
|
5317
|
+
if (w === "isNotBottom")
|
|
5318
|
+
return { type: j.highlightCell, subType: N.rank, isPercent: C, isBottom: !1, value: x, style: p };
|
|
5319
|
+
if (w === "isBottom")
|
|
5320
|
+
return { type: j.highlightCell, subType: N.rank, isPercent: C, isBottom: !0, value: x, style: p };
|
|
5321
|
+
if (w === "greaterThanAverage")
|
|
5322
|
+
return { type: j.highlightCell, subType: N.average, operator: F.greaterThan, style: p };
|
|
5323
|
+
if (w === "lessThanAverage")
|
|
5324
|
+
return { type: j.highlightCell, subType: N.average, operator: F.lessThan, style: p };
|
|
5327
5325
|
};
|
|
5328
5326
|
ve(() => n.intercept(n.getInterceptPoints().submit, {
|
|
5329
5327
|
handler() {
|
|
5330
5328
|
return m({ type: s, isPercent: u, value: a, style: f });
|
|
5331
5329
|
}
|
|
5332
5330
|
}), [s, u, a, f, n]);
|
|
5333
|
-
const S = (
|
|
5334
|
-
t(m(
|
|
5331
|
+
const S = (y) => {
|
|
5332
|
+
t(m(y));
|
|
5335
5333
|
};
|
|
5336
5334
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
5337
5335
|
/* @__PURE__ */ d.jsx("div", { className: `${O.title} ${O.mTBase}`, children: r.t("sheet.cf.panel.styleRule") }),
|
|
5338
5336
|
/* @__PURE__ */ d.jsx(
|
|
5339
5337
|
Ve,
|
|
5340
5338
|
{
|
|
5341
|
-
className: `${
|
|
5339
|
+
className: `${$.width100} ${O.mTSm}`,
|
|
5342
5340
|
value: s,
|
|
5343
5341
|
options: i,
|
|
5344
|
-
onChange: (
|
|
5345
|
-
l(
|
|
5342
|
+
onChange: (y) => {
|
|
5343
|
+
l(y), S({ type: y, isPercent: u, value: a, style: f });
|
|
5346
5344
|
}
|
|
5347
5345
|
}
|
|
5348
5346
|
),
|
|
@@ -5353,33 +5351,33 @@ const zd = (e) => {
|
|
|
5353
5351
|
min: 1,
|
|
5354
5352
|
max: 1e3,
|
|
5355
5353
|
value: a,
|
|
5356
|
-
onChange: (
|
|
5357
|
-
const
|
|
5358
|
-
c(
|
|
5354
|
+
onChange: (y) => {
|
|
5355
|
+
const w = y || 0;
|
|
5356
|
+
c(w), S({ type: s, isPercent: u, value: w, style: f });
|
|
5359
5357
|
}
|
|
5360
5358
|
}
|
|
5361
5359
|
),
|
|
5362
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.mLSm} ${O.labelContainer} ${
|
|
5360
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.mLSm} ${O.labelContainer} ${$.text}`, children: [
|
|
5363
5361
|
/* @__PURE__ */ d.jsx(
|
|
5364
5362
|
zn,
|
|
5365
5363
|
{
|
|
5366
5364
|
checked: u,
|
|
5367
|
-
onChange: (
|
|
5368
|
-
h(!!
|
|
5365
|
+
onChange: (y) => {
|
|
5366
|
+
h(!!y), S({ type: s, isPercent: !!y, value: a, style: f });
|
|
5369
5367
|
}
|
|
5370
5368
|
}
|
|
5371
5369
|
),
|
|
5372
5370
|
r.t("sheet.cf.valueType.percent")
|
|
5373
5371
|
] })
|
|
5374
5372
|
] }),
|
|
5375
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5373
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.cfPreviewWrap} `, children: /* @__PURE__ */ d.jsx(Kt, { rule: m({ type: s, isPercent: u, value: a, style: f }) }) }),
|
|
5376
5374
|
/* @__PURE__ */ d.jsx(
|
|
5377
5375
|
_o,
|
|
5378
5376
|
{
|
|
5379
5377
|
style: o == null ? void 0 : o.style,
|
|
5380
5378
|
className: `${O.mTSm} `,
|
|
5381
|
-
onChange: (
|
|
5382
|
-
g(
|
|
5379
|
+
onChange: (y) => {
|
|
5380
|
+
g(y), S({ type: s, isPercent: u, value: a, style: y });
|
|
5383
5381
|
}
|
|
5384
5382
|
}
|
|
5385
5383
|
)
|
|
@@ -5400,10 +5398,10 @@ const zd = (e) => {
|
|
|
5400
5398
|
),
|
|
5401
5399
|
e.children
|
|
5402
5400
|
] }), ne = (e, t) => ({ label: t.t(`sheet.cf.operator.${e}`), value: e }), _f = (e) => {
|
|
5403
|
-
const { type: t, operator: n, onChange: r, value: o, interceptorManager: i } = e, s = oe($e), [l, a] = M(() => typeof o == "number" ? o : 0), [c, u] = M(""), [h, f] = M(() => typeof o == "string" ? o : ""), [g, m] = M(""), [S, I] = M(() => Array.isArray(o) ? o[0] === void 0 ? 0 : o[0] : 0), [
|
|
5401
|
+
const { type: t, operator: n, onChange: r, value: o, interceptorManager: i } = e, s = oe($e), [l, a] = M(() => typeof o == "number" ? o : 0), [c, u] = M(""), [h, f] = M(() => typeof o == "string" ? o : ""), [g, m] = M(""), [S, I] = M(() => Array.isArray(o) ? o[0] === void 0 ? 0 : o[0] : 0), [y, w] = M(""), [C, x] = M(() => Array.isArray(o) ? o[1] === void 0 ? 100 : o[1] : 100), [p, R] = M("");
|
|
5404
5402
|
switch (ve(() => {
|
|
5405
5403
|
switch (t) {
|
|
5406
|
-
case
|
|
5404
|
+
case N.text: {
|
|
5407
5405
|
[
|
|
5408
5406
|
X.beginsWith,
|
|
5409
5407
|
X.endsWith,
|
|
@@ -5414,7 +5412,7 @@ const zd = (e) => {
|
|
|
5414
5412
|
].includes(n) && r(h);
|
|
5415
5413
|
break;
|
|
5416
5414
|
}
|
|
5417
|
-
case
|
|
5415
|
+
case N.number: {
|
|
5418
5416
|
[
|
|
5419
5417
|
F.equal,
|
|
5420
5418
|
F.notEqual,
|
|
@@ -5427,20 +5425,20 @@ const zd = (e) => {
|
|
|
5427
5425
|
}
|
|
5428
5426
|
}
|
|
5429
5427
|
}, [t]), ve(() => {
|
|
5430
|
-
const
|
|
5431
|
-
handler: (
|
|
5428
|
+
const _ = i.intercept(i.getInterceptPoints().beforeSubmit, {
|
|
5429
|
+
handler: (b, E, D) => {
|
|
5432
5430
|
switch (t) {
|
|
5433
|
-
case
|
|
5434
|
-
return X.beginsWith, X.containsText, X.endsWith, X.notEqual, X.notContainsText, X.equal, h ?
|
|
5431
|
+
case N.text:
|
|
5432
|
+
return X.beginsWith, X.containsText, X.endsWith, X.notEqual, X.notContainsText, X.equal, h ? D(b) : (m(s.t("sheet.cf.errorMessage.notBlank")), !1);
|
|
5435
5433
|
}
|
|
5436
|
-
return
|
|
5434
|
+
return D(b);
|
|
5437
5435
|
}
|
|
5438
5436
|
});
|
|
5439
5437
|
return () => {
|
|
5440
|
-
|
|
5438
|
+
_();
|
|
5441
5439
|
};
|
|
5442
5440
|
}, [t, l, h, S, C]), t) {
|
|
5443
|
-
case
|
|
5441
|
+
case N.text: {
|
|
5444
5442
|
if ([
|
|
5445
5443
|
X.beginsWith,
|
|
5446
5444
|
X.endsWith,
|
|
@@ -5449,23 +5447,23 @@ const zd = (e) => {
|
|
|
5449
5447
|
X.equal,
|
|
5450
5448
|
X.notEqual
|
|
5451
5449
|
].includes(n)) {
|
|
5452
|
-
const
|
|
5453
|
-
f(
|
|
5450
|
+
const _ = (b) => {
|
|
5451
|
+
f(b), r(b);
|
|
5454
5452
|
};
|
|
5455
5453
|
return /* @__PURE__ */ d.jsx("div", { className: `${O.mTSm}`, children: /* @__PURE__ */ d.jsx(ln, { errorText: g, children: /* @__PURE__ */ d.jsx(
|
|
5456
5454
|
Ka,
|
|
5457
5455
|
{
|
|
5458
|
-
className:
|
|
5456
|
+
className: $.width100,
|
|
5459
5457
|
value: h,
|
|
5460
|
-
onChange: (
|
|
5461
|
-
m(""),
|
|
5458
|
+
onChange: (b) => {
|
|
5459
|
+
m(""), _(b);
|
|
5462
5460
|
}
|
|
5463
5461
|
}
|
|
5464
5462
|
) }) });
|
|
5465
5463
|
}
|
|
5466
5464
|
break;
|
|
5467
5465
|
}
|
|
5468
|
-
case
|
|
5466
|
+
case N.number: {
|
|
5469
5467
|
if ([
|
|
5470
5468
|
F.equal,
|
|
5471
5469
|
F.notEqual,
|
|
@@ -5474,20 +5472,20 @@ const zd = (e) => {
|
|
|
5474
5472
|
F.lessThan,
|
|
5475
5473
|
F.lessThanOrEqual
|
|
5476
5474
|
].includes(n)) {
|
|
5477
|
-
const
|
|
5478
|
-
a(
|
|
5475
|
+
const _ = (b) => {
|
|
5476
|
+
a(b || 0), r(b || 0), u("");
|
|
5479
5477
|
};
|
|
5480
|
-
return /* @__PURE__ */ d.jsx("div", { className: `${O.mTSm}`, children: /* @__PURE__ */ d.jsx(ln, { errorText: c, children: /* @__PURE__ */ d.jsx(St, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, className:
|
|
5478
|
+
return /* @__PURE__ */ d.jsx("div", { className: `${O.mTSm}`, children: /* @__PURE__ */ d.jsx(ln, { errorText: c, children: /* @__PURE__ */ d.jsx(St, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, className: $.width100, value: l, onChange: _ }) }) });
|
|
5481
5479
|
}
|
|
5482
5480
|
if ([F.between, F.notBetween].includes(n)) {
|
|
5483
|
-
const
|
|
5484
|
-
I(E || 0), r([E || 0, C]),
|
|
5485
|
-
},
|
|
5486
|
-
|
|
5481
|
+
const _ = (E) => {
|
|
5482
|
+
I(E || 0), r([E || 0, C]), w("");
|
|
5483
|
+
}, b = (E) => {
|
|
5484
|
+
x(E || 0), r([S, E || 0]), R("");
|
|
5487
5485
|
};
|
|
5488
5486
|
return /* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${O.labelContainer} `, children: [
|
|
5489
|
-
/* @__PURE__ */ d.jsx(ln, { errorText:
|
|
5490
|
-
/* @__PURE__ */ d.jsx(ln, { errorText: p, children: /* @__PURE__ */ d.jsx(St, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, className: `${O.mLSm}`, value: C, onChange:
|
|
5487
|
+
/* @__PURE__ */ d.jsx(ln, { errorText: y, children: /* @__PURE__ */ d.jsx(St, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, value: S, onChange: _ }) }),
|
|
5488
|
+
/* @__PURE__ */ d.jsx(ln, { errorText: p, children: /* @__PURE__ */ d.jsx(St, { min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER, className: `${O.mLSm}`, value: C, onChange: b }) })
|
|
5491
5489
|
] });
|
|
5492
5490
|
}
|
|
5493
5491
|
}
|
|
@@ -5495,7 +5493,7 @@ const zd = (e) => {
|
|
|
5495
5493
|
return null;
|
|
5496
5494
|
}, ti = (e, t) => {
|
|
5497
5495
|
switch (e) {
|
|
5498
|
-
case
|
|
5496
|
+
case N.text:
|
|
5499
5497
|
return [
|
|
5500
5498
|
ne(X.containsText, t),
|
|
5501
5499
|
ne(X.notContainsText, t),
|
|
@@ -5508,7 +5506,7 @@ const zd = (e) => {
|
|
|
5508
5506
|
ne(X.containsErrors, t),
|
|
5509
5507
|
ne(X.notContainsErrors, t)
|
|
5510
5508
|
];
|
|
5511
|
-
case
|
|
5509
|
+
case N.number:
|
|
5512
5510
|
return [
|
|
5513
5511
|
ne(F.between, t),
|
|
5514
5512
|
ne(F.notBetween, t),
|
|
@@ -5519,7 +5517,7 @@ const zd = (e) => {
|
|
|
5519
5517
|
ne(F.lessThan, t),
|
|
5520
5518
|
ne(F.lessThanOrEqual, t)
|
|
5521
5519
|
];
|
|
5522
|
-
case
|
|
5520
|
+
case N.timePeriod:
|
|
5523
5521
|
return [
|
|
5524
5522
|
ne(Ge.yesterday, t),
|
|
5525
5523
|
ne(Ge.today, t),
|
|
@@ -5534,42 +5532,42 @@ const zd = (e) => {
|
|
|
5534
5532
|
];
|
|
5535
5533
|
}
|
|
5536
5534
|
}, ni = (e) => {
|
|
5537
|
-
var
|
|
5538
|
-
const { interceptorManager: t, onChange: n } = e, r = oe($e), o = ((
|
|
5539
|
-
const p =
|
|
5535
|
+
var x;
|
|
5536
|
+
const { interceptorManager: t, onChange: n } = e, r = oe($e), o = ((x = e.rule) == null ? void 0 : x.type) === j.highlightCell ? e.rule : void 0, [i, s] = M(() => {
|
|
5537
|
+
const p = N.text;
|
|
5540
5538
|
return o && o.subType || p;
|
|
5541
5539
|
}), l = [
|
|
5542
5540
|
{
|
|
5543
|
-
value:
|
|
5541
|
+
value: N.text,
|
|
5544
5542
|
label: r.t("sheet.cf.subRuleType.text")
|
|
5545
5543
|
},
|
|
5546
5544
|
{
|
|
5547
|
-
value:
|
|
5545
|
+
value: N.number,
|
|
5548
5546
|
label: r.t("sheet.cf.subRuleType.number")
|
|
5549
5547
|
},
|
|
5550
5548
|
{
|
|
5551
|
-
value:
|
|
5549
|
+
value: N.timePeriod,
|
|
5552
5550
|
label: r.t("sheet.cf.subRuleType.timePeriod")
|
|
5553
5551
|
},
|
|
5554
5552
|
{
|
|
5555
|
-
value:
|
|
5553
|
+
value: N.duplicateValues,
|
|
5556
5554
|
label: r.t("sheet.cf.subRuleType.duplicateValues")
|
|
5557
5555
|
},
|
|
5558
5556
|
{
|
|
5559
|
-
value:
|
|
5557
|
+
value: N.uniqueValues,
|
|
5560
5558
|
label: r.t("sheet.cf.subRuleType.uniqueValues")
|
|
5561
5559
|
}
|
|
5562
5560
|
], a = be(() => ti(i, r), [i]), [c, u] = M(() => {
|
|
5563
5561
|
const p = a ? a[0].value : void 0;
|
|
5564
5562
|
return o && o.operator || p;
|
|
5565
5563
|
}), [h, f] = M(() => {
|
|
5566
|
-
var
|
|
5564
|
+
var _;
|
|
5567
5565
|
const p = "";
|
|
5568
|
-
return o ? (
|
|
5566
|
+
return o ? (_ = o.value) != null ? _ : Pr(o.subType, o.operator) : p;
|
|
5569
5567
|
}), [g, m] = M({}), S = be(() => (p) => {
|
|
5570
|
-
var
|
|
5568
|
+
var R, _, b, E, D, L, W, v, T, ee, Oe, Se, Ce, We, H;
|
|
5571
5569
|
switch (p.subType || i) {
|
|
5572
|
-
case
|
|
5570
|
+
case N.text: {
|
|
5573
5571
|
if ([
|
|
5574
5572
|
X.beginsWith,
|
|
5575
5573
|
X.endsWith,
|
|
@@ -5579,15 +5577,15 @@ const zd = (e) => {
|
|
|
5579
5577
|
X.notEqual
|
|
5580
5578
|
].includes(c))
|
|
5581
5579
|
return {
|
|
5582
|
-
type:
|
|
5583
|
-
subType: (
|
|
5584
|
-
operator: (
|
|
5585
|
-
style: (
|
|
5580
|
+
type: j.highlightCell,
|
|
5581
|
+
subType: (R = p.subType) != null ? R : i,
|
|
5582
|
+
operator: (_ = p.operator) != null ? _ : c,
|
|
5583
|
+
style: (b = p.style) != null ? b : g,
|
|
5586
5584
|
value: (E = p.value) != null ? E : h
|
|
5587
5585
|
};
|
|
5588
5586
|
break;
|
|
5589
5587
|
}
|
|
5590
|
-
case
|
|
5588
|
+
case N.number: {
|
|
5591
5589
|
if ([
|
|
5592
5590
|
F.equal,
|
|
5593
5591
|
F.notEqual,
|
|
@@ -5597,15 +5595,15 @@ const zd = (e) => {
|
|
|
5597
5595
|
F.lessThanOrEqual
|
|
5598
5596
|
].includes(c))
|
|
5599
5597
|
return {
|
|
5600
|
-
type:
|
|
5601
|
-
subType: (
|
|
5602
|
-
operator: (
|
|
5598
|
+
type: j.highlightCell,
|
|
5599
|
+
subType: (D = p.subType) != null ? D : i,
|
|
5600
|
+
operator: (L = p.operator) != null ? L : c,
|
|
5603
5601
|
style: (W = p.style) != null ? W : g,
|
|
5604
|
-
value: (
|
|
5602
|
+
value: (v = p.value) != null ? v : h
|
|
5605
5603
|
};
|
|
5606
5604
|
if ([F.between, F.notBetween].includes(c))
|
|
5607
5605
|
return {
|
|
5608
|
-
type:
|
|
5606
|
+
type: j.highlightCell,
|
|
5609
5607
|
subType: (T = p.subType) != null ? T : i,
|
|
5610
5608
|
operator: (ee = p.operator) != null ? ee : c,
|
|
5611
5609
|
style: (Oe = p.style) != null ? Oe : g,
|
|
@@ -5615,7 +5613,7 @@ const zd = (e) => {
|
|
|
5615
5613
|
}
|
|
5616
5614
|
}
|
|
5617
5615
|
return {
|
|
5618
|
-
type:
|
|
5616
|
+
type: j.highlightCell,
|
|
5619
5617
|
subType: (Ce = p.subType) != null ? Ce : i,
|
|
5620
5618
|
operator: (We = p.operator) != null ? We : c,
|
|
5621
5619
|
style: (H = p.style) != null ? H : g
|
|
@@ -5629,20 +5627,20 @@ const zd = (e) => {
|
|
|
5629
5627
|
l.some((p) => p.value === i) || s(l[0].value);
|
|
5630
5628
|
}, [l]);
|
|
5631
5629
|
const I = (p) => {
|
|
5632
|
-
const
|
|
5633
|
-
s(
|
|
5634
|
-
},
|
|
5635
|
-
const
|
|
5636
|
-
u(
|
|
5637
|
-
},
|
|
5630
|
+
const R = p, _ = ti(R, r), b = _ && _[0].value;
|
|
5631
|
+
s(R), u(b), b && f(Pr(R, b)), n(S({ subType: R, operator: b }));
|
|
5632
|
+
}, y = (p) => {
|
|
5633
|
+
const R = p;
|
|
5634
|
+
u(R), n(S({ operator: R }));
|
|
5635
|
+
}, w = (p) => {
|
|
5638
5636
|
f(p), n(S({ value: p }));
|
|
5639
5637
|
}, C = be(() => `${i}_${c}_${Math.random()}`, [i, c]);
|
|
5640
5638
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
5641
5639
|
/* @__PURE__ */ d.jsx("div", { className: `${O.title} ${O.mTBase}`, children: r.t("sheet.cf.panel.styleRule") }),
|
|
5642
|
-
/* @__PURE__ */ d.jsx(Ve, { className: `${O.mTSm} ${
|
|
5643
|
-
(a == null ? void 0 : a.length) && /* @__PURE__ */ d.jsx(Ve, { className: `${O.mTSm} ${
|
|
5644
|
-
/* @__PURE__ */ d.jsx(_f, { value: h, interceptorManager: t, type: i, operator: c, rule: o, onChange:
|
|
5645
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5640
|
+
/* @__PURE__ */ d.jsx(Ve, { className: `${O.mTSm} ${$.width100}`, onChange: I, value: i, options: l }),
|
|
5641
|
+
(a == null ? void 0 : a.length) && /* @__PURE__ */ d.jsx(Ve, { className: `${O.mTSm} ${$.width100}`, onChange: y, value: c || "", options: a }),
|
|
5642
|
+
/* @__PURE__ */ d.jsx(_f, { value: h, interceptorManager: t, type: i, operator: c, rule: o, onChange: w }, C),
|
|
5643
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.cfPreviewWrap}`, children: /* @__PURE__ */ d.jsx(Kt, { rule: S({}) }) }),
|
|
5646
5644
|
/* @__PURE__ */ d.jsx(
|
|
5647
5645
|
_o,
|
|
5648
5646
|
{
|
|
@@ -5656,11 +5654,11 @@ const zd = (e) => {
|
|
|
5656
5654
|
] });
|
|
5657
5655
|
}, wf = (e) => {
|
|
5658
5656
|
var I;
|
|
5659
|
-
const { onChange: t, interceptorManager: n } = e, r = oe($e), i = oe(re).getCurrentUnitForType(G.UNIVER_SHEET), s = i.getActiveSheet(), l = ((I = e.rule) == null ? void 0 : I.type) ===
|
|
5660
|
-
style:
|
|
5657
|
+
const { onChange: t, interceptorManager: n } = e, r = oe($e), i = oe(re).getCurrentUnitForType(G.UNIVER_SHEET), s = i.getActiveSheet(), l = ((I = e.rule) == null ? void 0 : I.type) === j.highlightCell ? e.rule : void 0, [a, c] = M({}), [u, h] = M(() => (l == null ? void 0 : l.subType) === N.formula ? l.value : "="), [f, g] = M(""), m = (y) => ({
|
|
5658
|
+
style: y.style,
|
|
5661
5659
|
value: u,
|
|
5662
|
-
type:
|
|
5663
|
-
subType:
|
|
5660
|
+
type: j.highlightCell,
|
|
5661
|
+
subType: N.formula
|
|
5664
5662
|
});
|
|
5665
5663
|
ve(() => n.intercept(n.getInterceptPoints().submit, {
|
|
5666
5664
|
handler() {
|
|
@@ -5668,11 +5666,11 @@ const zd = (e) => {
|
|
|
5668
5666
|
}
|
|
5669
5667
|
}), [a, u, n]), ve(() => {
|
|
5670
5668
|
n.intercept(n.getInterceptPoints().beforeSubmit, {
|
|
5671
|
-
handler: (
|
|
5669
|
+
handler: (y, w, C) => !u || u.length === 1 || !f.startsWith("=") ? (g(r.t("sheet.cf.errorMessage.formulaError")), !1) : C(y)
|
|
5672
5670
|
});
|
|
5673
5671
|
}, [u]);
|
|
5674
|
-
const S = (
|
|
5675
|
-
t(m(
|
|
5672
|
+
const S = (y) => {
|
|
5673
|
+
t(m(y));
|
|
5676
5674
|
};
|
|
5677
5675
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
5678
5676
|
/* @__PURE__ */ d.jsx("div", { className: `${O.title} ${O.mTBase}`, children: r.t("sheet.cf.panel.styleRule") }),
|
|
@@ -5685,20 +5683,20 @@ const zd = (e) => {
|
|
|
5685
5683
|
value: u,
|
|
5686
5684
|
canvasStyle: { fontSize: 10 },
|
|
5687
5685
|
onlyInputFormula: !0,
|
|
5688
|
-
onChange: (
|
|
5689
|
-
const
|
|
5690
|
-
h(
|
|
5686
|
+
onChange: (y = "") => {
|
|
5687
|
+
const w = y || "";
|
|
5688
|
+
h(w), S({ style: a, formula: w }), g("");
|
|
5691
5689
|
}
|
|
5692
5690
|
}
|
|
5693
5691
|
) }) }),
|
|
5694
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
5692
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.cfPreviewWrap} `, children: /* @__PURE__ */ d.jsx(Kt, { rule: m({ style: a, formula: u }) }) }),
|
|
5695
5693
|
/* @__PURE__ */ d.jsx(
|
|
5696
5694
|
_o,
|
|
5697
5695
|
{
|
|
5698
5696
|
style: l == null ? void 0 : l.style,
|
|
5699
5697
|
className: `${O.mTSm} `,
|
|
5700
|
-
onChange: (
|
|
5701
|
-
c(
|
|
5698
|
+
onChange: (y) => {
|
|
5699
|
+
c(y), S({ style: y, formula: u });
|
|
5702
5700
|
}
|
|
5703
5701
|
}
|
|
5704
5702
|
)
|
|
@@ -6185,10 +6183,10 @@ function Sp(e, t, n) {
|
|
|
6185
6183
|
var Cp = Sp;
|
|
6186
6184
|
const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || "", wp = (e) => {
|
|
6187
6185
|
var i;
|
|
6188
|
-
const t = oe(re), n = t.getCurrentUnitForType(G.UNIVER_SHEET).getUnitId(), r = (i = t.getCurrentUnitForType(G.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : i.getSheetId(), o = be(() => e.error ?
|
|
6189
|
-
return /* @__PURE__ */ d.jsx("div", { className:
|
|
6186
|
+
const t = oe(re), n = t.getCurrentUnitForType(G.UNIVER_SHEET).getUnitId(), r = (i = t.getCurrentUnitForType(G.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : i.getSheetId(), o = be(() => e.error ? $.errorInput : "", [e.error]);
|
|
6187
|
+
return /* @__PURE__ */ d.jsx("div", { className: $.positionRelative, children: e.type !== A.formula ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
6190
6188
|
/* @__PURE__ */ d.jsx(St, { className: o, value: Number(e.value) || 0, onChange: (s) => e.onChange(s != null ? s : 0) }),
|
|
6191
|
-
e.error && /* @__PURE__ */ d.jsx("div", { className:
|
|
6189
|
+
e.error && /* @__PURE__ */ d.jsx("div", { className: $.errorText, children: e.error })
|
|
6192
6190
|
] }) : /* @__PURE__ */ d.jsx(
|
|
6193
6191
|
Bn,
|
|
6194
6192
|
{
|
|
@@ -6213,11 +6211,11 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6213
6211
|
const n = oe($e), r = (o) => {
|
|
6214
6212
|
e.onClick(o);
|
|
6215
6213
|
};
|
|
6216
|
-
return /* @__PURE__ */ d.jsx("div", { ref: t, className:
|
|
6217
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
6218
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
6214
|
+
return /* @__PURE__ */ d.jsx("div", { ref: t, className: $.iconGroupList, children: fa.map((o, i) => /* @__PURE__ */ d.jsxs("div", { className: $.group, children: [
|
|
6215
|
+
/* @__PURE__ */ d.jsx("div", { className: $.title, children: n.t(o.title) }),
|
|
6216
|
+
/* @__PURE__ */ d.jsx("div", { className: $.itemContent, children: o.group.map((s) => /* @__PURE__ */ d.jsx("div", { className: $.itemWrap, onClick: () => {
|
|
6219
6217
|
r(s.name);
|
|
6220
|
-
}, children: /* @__PURE__ */ d.jsx("div", { className:
|
|
6218
|
+
}, children: /* @__PURE__ */ d.jsx("div", { className: $.item, children: s.list.map((l, a) => /* @__PURE__ */ d.jsx("img", { className: $.icon, src: l }, a)) }) }, s.name)) })
|
|
6221
6219
|
] }, i)) });
|
|
6222
6220
|
}), Rp = (e) => {
|
|
6223
6221
|
const t = be(() => {
|
|
@@ -6236,12 +6234,12 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6236
6234
|
}, []), n = (r) => {
|
|
6237
6235
|
e.onClick(r.iconType, r.iconId);
|
|
6238
6236
|
};
|
|
6239
|
-
return /* @__PURE__ */ d.jsxs("div", { className:
|
|
6240
|
-
/* @__PURE__ */ d.jsxs("div", { className:
|
|
6241
|
-
/* @__PURE__ */ d.jsx(Sn, { className:
|
|
6237
|
+
return /* @__PURE__ */ d.jsxs("div", { className: $.iconItemListWrap, children: [
|
|
6238
|
+
/* @__PURE__ */ d.jsxs("div", { className: $.none, onClick: () => n({ iconType: pa, iconId: "", base64: "" }), children: [
|
|
6239
|
+
/* @__PURE__ */ d.jsx(Sn, { className: $.icon }),
|
|
6242
6240
|
/* @__PURE__ */ d.jsx("span", { children: "无单元格图标" })
|
|
6243
6241
|
] }),
|
|
6244
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
6242
|
+
/* @__PURE__ */ d.jsx("div", { className: $.iconItemList, children: t.map((r) => /* @__PURE__ */ d.jsx("div", { className: $.item, children: /* @__PURE__ */ d.jsx("img", { onClick: () => n(r), className: `${$.icon}`, src: r.base64 }) }, `${r.iconType}_${r.iconId}`)) })
|
|
6245
6243
|
] });
|
|
6246
6244
|
}, Ip = (e) => {
|
|
6247
6245
|
const { onChange: t, configList: n, errorMap: r = {} } = e, o = oe($e), i = [
|
|
@@ -6256,120 +6254,120 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6256
6254
|
t([String(f), "value", "value"], h);
|
|
6257
6255
|
}, a = (h, f) => {
|
|
6258
6256
|
t([String(f), "operator"], h);
|
|
6259
|
-
const g = Pr(
|
|
6257
|
+
const g = Pr(N.number, h);
|
|
6260
6258
|
l(g, f);
|
|
6261
6259
|
}, c = (h, f) => {
|
|
6262
6260
|
t([String(f), "value", "type"], h);
|
|
6263
6261
|
};
|
|
6264
6262
|
return be(() => n.map((h, f) => {
|
|
6265
|
-
const g = r[f], m = Zs(h.iconType, h.iconId), S = f === n.length - 1, I = f === 0,
|
|
6266
|
-
const
|
|
6267
|
-
t([String(f)],
|
|
6263
|
+
const g = r[f], m = Zs(h.iconType, h.iconId), S = f === n.length - 1, I = f === 0, y = n[f - 1], w = (y == null ? void 0 : y.value.type) === A.formula ? o.t("sheet.cf.valueType.formula") : y == null ? void 0 : y.value.value, C = (x, p) => {
|
|
6264
|
+
const R = { ...h, iconId: p, iconType: x };
|
|
6265
|
+
t([String(f)], R);
|
|
6268
6266
|
};
|
|
6269
6267
|
return /* @__PURE__ */ d.jsxs("div", { className: `${f ? O.mTXl : O.mTSm}`, children: [
|
|
6270
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.label} ${
|
|
6271
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${
|
|
6268
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.label} ${$.flex}`, children: [
|
|
6269
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${$.width45}`, children: [
|
|
6272
6270
|
o.t("sheet.cf.iconSet.icon"),
|
|
6273
6271
|
f + 1
|
|
6274
6272
|
] }),
|
|
6275
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
6273
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.width45}`, children: /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
6276
6274
|
!I && !S && o.t("sheet.cf.iconSet.rule"),
|
|
6277
|
-
!I && !S && /* @__PURE__ */ d.jsxs("span", { className:
|
|
6275
|
+
!I && !S && /* @__PURE__ */ d.jsxs("span", { className: $.stress, children: [
|
|
6278
6276
|
"(",
|
|
6279
6277
|
o.t("sheet.cf.iconSet.when"),
|
|
6280
|
-
o.t(`sheet.cf.symbol.${Dr(
|
|
6281
|
-
|
|
6278
|
+
o.t(`sheet.cf.symbol.${Dr(y.operator)}`),
|
|
6279
|
+
w,
|
|
6282
6280
|
S ? "" : ` ${o.t("sheet.cf.iconSet.and")} `,
|
|
6283
6281
|
")"
|
|
6284
6282
|
] })
|
|
6285
6283
|
] }) })
|
|
6286
6284
|
] }),
|
|
6287
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${
|
|
6288
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
6289
|
-
m ? /* @__PURE__ */ d.jsx("img", { src: m, className:
|
|
6285
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${$.flex} ${O.mTSm}`, children: [
|
|
6286
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.iconWrap} ${$.width45}`, children: /* @__PURE__ */ d.jsx(Xr, { overlay: /* @__PURE__ */ d.jsx(Rp, { onClick: C, iconId: h.iconId, iconType: h.iconType }), children: /* @__PURE__ */ d.jsxs("div", { className: $.dropdownIcon, children: [
|
|
6287
|
+
m ? /* @__PURE__ */ d.jsx("img", { src: m, className: $.icon }) : /* @__PURE__ */ d.jsx(Sn, { className: $.icon }),
|
|
6290
6288
|
/* @__PURE__ */ d.jsx(Yn, {})
|
|
6291
6289
|
] }) }) }),
|
|
6292
|
-
S ? /* @__PURE__ */ d.jsxs("div", { className: `${
|
|
6290
|
+
S ? /* @__PURE__ */ d.jsxs("div", { className: `${$.width45} ${O.label}`, style: { marginTop: 0 }, children: [
|
|
6293
6291
|
o.t("sheet.cf.iconSet.rule"),
|
|
6294
|
-
/* @__PURE__ */ d.jsxs("span", { className:
|
|
6292
|
+
/* @__PURE__ */ d.jsxs("span", { className: $.stress, children: [
|
|
6295
6293
|
"(",
|
|
6296
6294
|
o.t("sheet.cf.iconSet.when"),
|
|
6297
|
-
o.t(`sheet.cf.symbol.${Dr(
|
|
6298
|
-
|
|
6295
|
+
o.t(`sheet.cf.symbol.${Dr(y.operator)}`),
|
|
6296
|
+
w,
|
|
6299
6297
|
S ? "" : ` ${o.t("sheet.cf.iconSet.and")} `,
|
|
6300
6298
|
")"
|
|
6301
6299
|
] })
|
|
6302
|
-
] }) : /* @__PURE__ */ d.jsx(Ve, { className: `${O.mL0} ${
|
|
6303
|
-
a(
|
|
6300
|
+
] }) : /* @__PURE__ */ d.jsx(Ve, { className: `${O.mL0} ${$.width45} ${O.mR0}`, options: i, value: h.operator, onChange: (x) => {
|
|
6301
|
+
a(x, f);
|
|
6304
6302
|
} })
|
|
6305
6303
|
] }),
|
|
6306
6304
|
S ? /* @__PURE__ */ d.jsx("div", {}) : /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
6307
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${O.label} ${
|
|
6308
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
6309
|
-
/* @__PURE__ */ d.jsx("div", { className: `${
|
|
6305
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${O.label} ${$.flex}`, children: [
|
|
6306
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.width45}`, children: o.t("sheet.cf.iconSet.type") }),
|
|
6307
|
+
/* @__PURE__ */ d.jsx("div", { className: `${$.width45}`, children: o.t("sheet.cf.iconSet.value") })
|
|
6310
6308
|
] }),
|
|
6311
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${
|
|
6312
|
-
/* @__PURE__ */ d.jsx(Ve, { className: `${
|
|
6313
|
-
c(
|
|
6309
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${$.flex}`, children: [
|
|
6310
|
+
/* @__PURE__ */ d.jsx(Ve, { className: `${$.width45} ${O.mL0}`, options: s, value: h.value.type, onChange: (x) => {
|
|
6311
|
+
c(x, f);
|
|
6314
6312
|
} }),
|
|
6315
|
-
/* @__PURE__ */ d.jsx("div", { className: `${O.mL0} ${
|
|
6313
|
+
/* @__PURE__ */ d.jsx("div", { className: `${O.mL0} ${$.width45}`, children: /* @__PURE__ */ d.jsx(wp, { id: f, type: h.value.type, error: g, value: h.value.value || "", onChange: (x) => l(x, f) }) })
|
|
6316
6314
|
] })
|
|
6317
6315
|
] })
|
|
6318
6316
|
] }, f);
|
|
6319
6317
|
}), [n, r]);
|
|
6320
6318
|
}, Tp = (e) => {
|
|
6321
|
-
var
|
|
6322
|
-
const { interceptorManager: t } = e, n = ((
|
|
6319
|
+
var x;
|
|
6320
|
+
const { interceptorManager: t } = e, n = ((x = e.rule) == null ? void 0 : x.type) === j.iconSet ? e.rule : void 0, r = oe($e), [o, i] = M({}), [s, l] = M(() => {
|
|
6323
6321
|
const p = Object.keys(bt)[0];
|
|
6324
6322
|
if (n && n.config.length) {
|
|
6325
|
-
const
|
|
6326
|
-
if (!n.config.some((
|
|
6327
|
-
return
|
|
6323
|
+
const R = n.config[0].iconType;
|
|
6324
|
+
if (!n.config.some((b) => b.iconType !== R))
|
|
6325
|
+
return R;
|
|
6328
6326
|
}
|
|
6329
6327
|
return p;
|
|
6330
6328
|
}), [a, c] = M(() => {
|
|
6331
6329
|
if (n && n.config.length)
|
|
6332
6330
|
return bn.deepClone(n == null ? void 0 : n.config);
|
|
6333
6331
|
const p = bt[s] || [];
|
|
6334
|
-
return new Array(p.length).fill("").map((
|
|
6332
|
+
return new Array(p.length).fill("").map((R, _, b) => _ === b.length - 1 ? {
|
|
6335
6333
|
operator: F.lessThanOrEqual,
|
|
6336
6334
|
value: { type: A.num, value: Number.MAX_SAFE_INTEGER },
|
|
6337
6335
|
iconType: s,
|
|
6338
|
-
iconId: String(
|
|
6339
|
-
} : di(s,
|
|
6336
|
+
iconId: String(_)
|
|
6337
|
+
} : di(s, _, b));
|
|
6340
6338
|
}), [u, h] = M(() => n ? !!n.isShowValue : !0), f = be(() => {
|
|
6341
|
-
const p = a.map((
|
|
6342
|
-
return /* @__PURE__ */ d.jsx("div", { className:
|
|
6339
|
+
const p = a.map((R) => Zs(R.iconType, R.iconId));
|
|
6340
|
+
return /* @__PURE__ */ d.jsx("div", { className: $.iconWrap, children: p.map((R, _) => R ? /* @__PURE__ */ d.jsx("img", { className: $.icon, src: R }, _) : /* @__PURE__ */ d.jsx(Sn, { className: $.icon }, _)) });
|
|
6343
6341
|
}, [a]), g = (p) => {
|
|
6344
|
-
if (p.reduce((
|
|
6342
|
+
if (p.reduce((_, b, E) => _.preType && !_.result || p.length - 1 === E ? _ : b.value.type === A.formula ? {
|
|
6345
6343
|
preType: A.formula,
|
|
6346
6344
|
result: !1
|
|
6347
|
-
} :
|
|
6348
|
-
result:
|
|
6349
|
-
preType:
|
|
6345
|
+
} : _.preType ? {
|
|
6346
|
+
result: _.preType === b.value.type,
|
|
6347
|
+
preType: b.value.type
|
|
6350
6348
|
} : {
|
|
6351
6349
|
result: !0,
|
|
6352
|
-
preType:
|
|
6350
|
+
preType: b.value.type
|
|
6353
6351
|
}, { result: !0, preType: "" }).result && [A.num, A.percent, A.percentile].includes(p[0].value.type)) {
|
|
6354
|
-
const
|
|
6355
|
-
return p.forEach((
|
|
6356
|
-
if (E - 1 < 0 || E ===
|
|
6352
|
+
const _ = {};
|
|
6353
|
+
return p.forEach((b, E, D) => {
|
|
6354
|
+
if (E - 1 < 0 || E === D.length - 1)
|
|
6357
6355
|
return;
|
|
6358
|
-
const W = p[E - 1],
|
|
6359
|
-
ha({ operator:
|
|
6360
|
-
}),
|
|
6356
|
+
const W = p[E - 1], v = Dr(W.operator);
|
|
6357
|
+
ha({ operator: v, value: W.value.value }, b.value.value) || (_[E] = `${r.t(`sheet.cf.form.${v}`, String(W.value.value))} `);
|
|
6358
|
+
}), _;
|
|
6361
6359
|
}
|
|
6362
6360
|
return {};
|
|
6363
|
-
}, m = (p,
|
|
6364
|
-
_p(a, p) !==
|
|
6361
|
+
}, m = (p, R) => {
|
|
6362
|
+
_p(a, p) !== R && (xh(a, p, R), c([...a]), i(g(a)));
|
|
6365
6363
|
}, S = (p) => {
|
|
6366
6364
|
l(p);
|
|
6367
|
-
const
|
|
6368
|
-
c(
|
|
6365
|
+
const R = bt[p] || [], _ = new Array(R.length).fill("").map((b, E, D) => di(p, E, D));
|
|
6366
|
+
c(_), i(g(_));
|
|
6369
6367
|
};
|
|
6370
6368
|
ve(() => {
|
|
6371
6369
|
const p = t.intercept(t.getInterceptPoints().submit, { handler() {
|
|
6372
|
-
return { type:
|
|
6370
|
+
return { type: j.iconSet, isShowValue: u, config: a };
|
|
6373
6371
|
} });
|
|
6374
6372
|
return () => {
|
|
6375
6373
|
p();
|
|
@@ -6383,24 +6381,24 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6383
6381
|
};
|
|
6384
6382
|
}, [u, a, t, o]);
|
|
6385
6383
|
const I = () => {
|
|
6386
|
-
const p = a.map((
|
|
6387
|
-
a.forEach((
|
|
6388
|
-
const
|
|
6389
|
-
|
|
6384
|
+
const p = a.map((R) => ({ ...R }));
|
|
6385
|
+
a.forEach((R, _) => {
|
|
6386
|
+
const b = a.length - 1 - _, E = p[b];
|
|
6387
|
+
R.iconId = E.iconId, R.iconType = E.iconType;
|
|
6390
6388
|
}), c([...a]);
|
|
6391
|
-
},
|
|
6392
|
-
return Na(
|
|
6389
|
+
}, y = oe(Ma), [w, C] = M();
|
|
6390
|
+
return Na(w, y.rootContainerElement), /* @__PURE__ */ d.jsxs("div", { className: $.iconSet, children: [
|
|
6393
6391
|
/* @__PURE__ */ d.jsx("div", { className: O.title, children: r.t("sheet.cf.panel.styleRule") }),
|
|
6394
|
-
/* @__PURE__ */ d.jsx("div", { className: `${O.mTSm}`, children: /* @__PURE__ */ d.jsx(Xr, { placement: "bottomLeft", overlay: /* @__PURE__ */ d.jsx(xp, { ref: (p) => !
|
|
6392
|
+
/* @__PURE__ */ d.jsx("div", { className: `${O.mTSm}`, children: /* @__PURE__ */ d.jsx(Xr, { placement: "bottomLeft", overlay: /* @__PURE__ */ d.jsx(xp, { ref: (p) => !w && p && C(p), iconType: s, onClick: S }), children: /* @__PURE__ */ d.jsxs("div", { className: $.dropdownIcon, style: { width: "unset" }, children: [
|
|
6395
6393
|
f,
|
|
6396
6394
|
/* @__PURE__ */ d.jsx(Yn, {})
|
|
6397
6395
|
] }) }) }),
|
|
6398
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${
|
|
6399
|
-
/* @__PURE__ */ d.jsxs("div", { className:
|
|
6396
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTSm} ${$.renderConfig}`, children: [
|
|
6397
|
+
/* @__PURE__ */ d.jsxs("div", { className: $.utilItem, children: [
|
|
6400
6398
|
/* @__PURE__ */ d.jsx(zn, { onChange: I }),
|
|
6401
6399
|
r.t("sheet.cf.iconSet.reverseIconOrder")
|
|
6402
6400
|
] }),
|
|
6403
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${
|
|
6401
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${$.utilItem} ${O.mLXl}`, children: [
|
|
6404
6402
|
/* @__PURE__ */ d.jsx(zn, { checked: !u, onChange: (p) => {
|
|
6405
6403
|
h(!p);
|
|
6406
6404
|
} }),
|
|
@@ -6413,14 +6411,14 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6413
6411
|
var t;
|
|
6414
6412
|
return (t = e.getCurrentUnitForType(G.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : t.getSheetId();
|
|
6415
6413
|
}, Op = (e) => {
|
|
6416
|
-
var
|
|
6417
|
-
const t = oe($e), n = oe(ue), r = oe(re), o = oe(he), i = oe(Gt), s = fi(r), l = hi(r), a = pn((p = (
|
|
6418
|
-
var E,
|
|
6419
|
-
let
|
|
6420
|
-
return
|
|
6421
|
-
const
|
|
6422
|
-
return
|
|
6423
|
-
}).filter((
|
|
6414
|
+
var x, p, R;
|
|
6415
|
+
const t = oe($e), n = oe(ue), r = oe(re), o = oe(he), i = oe(Gt), s = fi(r), l = hi(r), a = pn((p = (x = e.rule) == null ? void 0 : x.ranges) != null ? p : []), c = be(() => {
|
|
6416
|
+
var b, E, D;
|
|
6417
|
+
let _ = (b = e.rule) == null ? void 0 : b.ranges;
|
|
6418
|
+
return _ != null && _.length || (_ = (D = (E = i.getCurrentSelections()) == null ? void 0 : E.map((L) => L.range)) != null ? D : []), a.current = _, _ != null && _.length ? _.map((L) => {
|
|
6419
|
+
const W = Mi(L);
|
|
6420
|
+
return W === "NaN" ? "" : W;
|
|
6421
|
+
}).filter((L) => !!L).join(",") : "";
|
|
6424
6422
|
}, [e.rule]), u = [
|
|
6425
6423
|
{ label: t.t("sheet.cf.ruleType.highlightCell"), value: "1" },
|
|
6426
6424
|
{ label: t.t("sheet.cf.panel.rankAndAverage"), value: "2" },
|
|
@@ -6429,35 +6427,35 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6429
6427
|
{ label: t.t("sheet.cf.ruleType.formula"), value: "5" },
|
|
6430
6428
|
{ label: t.t("sheet.cf.ruleType.iconSet"), value: "6" }
|
|
6431
6429
|
], [h, f] = M(() => {
|
|
6432
|
-
var
|
|
6433
|
-
const
|
|
6434
|
-
if (!
|
|
6435
|
-
return
|
|
6436
|
-
switch (
|
|
6437
|
-
case
|
|
6438
|
-
switch ((
|
|
6439
|
-
case
|
|
6440
|
-
case
|
|
6441
|
-
case
|
|
6442
|
-
case
|
|
6443
|
-
case
|
|
6430
|
+
var E, D;
|
|
6431
|
+
const _ = (E = e.rule) == null ? void 0 : E.rule.type, b = u[0].value;
|
|
6432
|
+
if (!_)
|
|
6433
|
+
return b;
|
|
6434
|
+
switch (_) {
|
|
6435
|
+
case j.highlightCell: {
|
|
6436
|
+
switch ((D = e.rule) == null ? void 0 : D.rule.subType) {
|
|
6437
|
+
case N.number:
|
|
6438
|
+
case N.text:
|
|
6439
|
+
case N.duplicateValues:
|
|
6440
|
+
case N.uniqueValues:
|
|
6441
|
+
case N.timePeriod:
|
|
6444
6442
|
return "1";
|
|
6445
|
-
case
|
|
6446
|
-
case
|
|
6443
|
+
case N.average:
|
|
6444
|
+
case N.rank:
|
|
6447
6445
|
return "2";
|
|
6448
|
-
case
|
|
6446
|
+
case N.formula:
|
|
6449
6447
|
return "5";
|
|
6450
6448
|
}
|
|
6451
6449
|
break;
|
|
6452
6450
|
}
|
|
6453
|
-
case
|
|
6451
|
+
case j.dataBar:
|
|
6454
6452
|
return "3";
|
|
6455
|
-
case
|
|
6453
|
+
case j.colorScale:
|
|
6456
6454
|
return "4";
|
|
6457
|
-
case
|
|
6455
|
+
case j.iconSet:
|
|
6458
6456
|
return "6";
|
|
6459
6457
|
}
|
|
6460
|
-
return
|
|
6458
|
+
return b;
|
|
6461
6459
|
}), g = pn(), m = be(() => new ia({ beforeSubmit: Hd, submit: Vd }), []), S = be(() => {
|
|
6462
6460
|
switch (h) {
|
|
6463
6461
|
case "1":
|
|
@@ -6477,43 +6475,40 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6477
6475
|
}
|
|
6478
6476
|
}, [h]);
|
|
6479
6477
|
ve(() => {
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
},
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
const E = (() => {
|
|
6498
|
-
const N = r.getCurrentUnitForType(G.UNIVER_SHEET).getActiveSheet();
|
|
6499
|
-
if (!N)
|
|
6478
|
+
const _ = n.onCommandExecuted((b) => {
|
|
6479
|
+
if (b.id === Sa.id) {
|
|
6480
|
+
const E = b.params;
|
|
6481
|
+
E.subUnitId === l && E.unitId === s && e.onCancel();
|
|
6482
|
+
}
|
|
6483
|
+
b.id === Br.id && e.onCancel();
|
|
6484
|
+
});
|
|
6485
|
+
return () => _.dispose();
|
|
6486
|
+
}, []);
|
|
6487
|
+
const I = (_) => {
|
|
6488
|
+
g.current = _;
|
|
6489
|
+
}, y = (_) => {
|
|
6490
|
+
a.current = _.map((b) => b.range);
|
|
6491
|
+
}, w = () => {
|
|
6492
|
+
const b = (() => {
|
|
6493
|
+
const D = r.getCurrentUnitForType(G.UNIVER_SHEET).getActiveSheet();
|
|
6494
|
+
if (!D)
|
|
6500
6495
|
throw new Error("No active sheet found");
|
|
6501
|
-
return a.current.map((
|
|
6496
|
+
return a.current.map((v) => Ca(v, D.getRowCount(), D.getColumnCount())).filter((v) => !(Number.isNaN(v.startRow) || Number.isNaN(v.startColumn)));
|
|
6502
6497
|
})();
|
|
6503
6498
|
if (m.fetchThroughInterceptors(m.getInterceptPoints().beforeSubmit)(!0, null)) {
|
|
6504
|
-
const
|
|
6505
|
-
if (
|
|
6506
|
-
const
|
|
6507
|
-
if (!
|
|
6499
|
+
const D = m.fetchThroughInterceptors(m.getInterceptPoints().submit)(null, null);
|
|
6500
|
+
if (D) {
|
|
6501
|
+
const L = fi(r), W = hi(r);
|
|
6502
|
+
if (!L || !W)
|
|
6508
6503
|
throw new Error("No active sheet found");
|
|
6509
|
-
let
|
|
6510
|
-
e.rule && e.rule.cfId ? (
|
|
6504
|
+
let v = {};
|
|
6505
|
+
e.rule && e.rule.cfId ? (v = { ...e.rule, ranges: b, rule: D }, n.executeCommand(Co.id, { unitId: L, subUnitId: W, rule: v }), e.onCancel()) : (v = { cfId: o.createCfId(L, W), ranges: b, rule: D, stopIfTrue: !1 }, n.executeCommand(lr.id, { unitId: L, subUnitId: W, rule: v }), e.onCancel());
|
|
6511
6506
|
}
|
|
6512
6507
|
}
|
|
6513
6508
|
}, C = () => {
|
|
6514
6509
|
e.onCancel();
|
|
6515
6510
|
};
|
|
6516
|
-
return /* @__PURE__ */ d.jsxs("div", { className:
|
|
6511
|
+
return /* @__PURE__ */ d.jsxs("div", { className: $.cfRuleStyleEditor, children: [
|
|
6517
6512
|
/* @__PURE__ */ d.jsx("div", { className: O.title, children: t.t("sheet.cf.panel.range") }),
|
|
6518
6513
|
/* @__PURE__ */ d.jsx("div", { className: `${O.mTBase}`, children: /* @__PURE__ */ d.jsx(
|
|
6519
6514
|
ja,
|
|
@@ -6524,15 +6519,15 @@ const _p = /* @__PURE__ */ Kr(Cp), Zs = (e, t) => (bt[e] || [])[Number(t)] || ""
|
|
|
6524
6519
|
openForSheetUnitId: s,
|
|
6525
6520
|
value: c,
|
|
6526
6521
|
id: yn(`${st}_rangeSelector`),
|
|
6527
|
-
onChange:
|
|
6522
|
+
onChange: y
|
|
6528
6523
|
}
|
|
6529
6524
|
) }),
|
|
6530
6525
|
/* @__PURE__ */ d.jsx("div", { className: O.title, children: t.t("sheet.cf.panel.styleType") }),
|
|
6531
|
-
/* @__PURE__ */ d.jsx("div", { className: O.mTBase, children: /* @__PURE__ */ d.jsx(Ve, { className:
|
|
6526
|
+
/* @__PURE__ */ d.jsx("div", { className: O.mTBase, children: /* @__PURE__ */ d.jsx(Ve, { className: $.width100, value: h, options: u, onChange: (_) => f(_) }) }),
|
|
6532
6527
|
/* @__PURE__ */ d.jsx(S, { interceptorManager: m, rule: (R = e.rule) == null ? void 0 : R.rule, onChange: I }),
|
|
6533
|
-
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTBase} ${
|
|
6528
|
+
/* @__PURE__ */ d.jsxs("div", { className: `${O.mTBase} ${$.btnList}`, children: [
|
|
6534
6529
|
/* @__PURE__ */ d.jsx(Vo, { size: "small", onClick: C, children: t.t("sheet.cf.panel.cancel") }),
|
|
6535
|
-
/* @__PURE__ */ d.jsx(Vo, { className: O.mLSm, size: "small", type: "primary", onClick:
|
|
6530
|
+
/* @__PURE__ */ d.jsx(Vo, { className: O.mLSm, size: "small", type: "primary", onClick: w, children: t.t("sheet.cf.panel.submit") })
|
|
6536
6531
|
] })
|
|
6537
6532
|
] });
|
|
6538
6533
|
}, Ep = (e) => {
|
|
@@ -6608,8 +6603,8 @@ const Po = {
|
|
|
6608
6603
|
...ft,
|
|
6609
6604
|
ranges: i,
|
|
6610
6605
|
rule: {
|
|
6611
|
-
type:
|
|
6612
|
-
subType:
|
|
6606
|
+
type: j.highlightCell,
|
|
6607
|
+
subType: N.rank
|
|
6613
6608
|
}
|
|
6614
6609
|
};
|
|
6615
6610
|
n.openPanel(a);
|
|
@@ -6620,8 +6615,8 @@ const Po = {
|
|
|
6620
6615
|
...ft,
|
|
6621
6616
|
ranges: i,
|
|
6622
6617
|
rule: {
|
|
6623
|
-
type:
|
|
6624
|
-
subType:
|
|
6618
|
+
type: j.highlightCell,
|
|
6619
|
+
subType: N.formula,
|
|
6625
6620
|
value: "="
|
|
6626
6621
|
}
|
|
6627
6622
|
};
|
|
@@ -6633,7 +6628,7 @@ const Po = {
|
|
|
6633
6628
|
...ft,
|
|
6634
6629
|
ranges: i,
|
|
6635
6630
|
rule: {
|
|
6636
|
-
type:
|
|
6631
|
+
type: j.colorScale,
|
|
6637
6632
|
config: []
|
|
6638
6633
|
}
|
|
6639
6634
|
};
|
|
@@ -6645,7 +6640,7 @@ const Po = {
|
|
|
6645
6640
|
...ft,
|
|
6646
6641
|
ranges: i,
|
|
6647
6642
|
rule: {
|
|
6648
|
-
type:
|
|
6643
|
+
type: j.dataBar,
|
|
6649
6644
|
isShowValue: !0
|
|
6650
6645
|
}
|
|
6651
6646
|
};
|
|
@@ -6657,7 +6652,7 @@ const Po = {
|
|
|
6657
6652
|
...ft,
|
|
6658
6653
|
ranges: i,
|
|
6659
6654
|
rule: {
|
|
6660
|
-
type:
|
|
6655
|
+
type: j.iconSet,
|
|
6661
6656
|
config: [],
|
|
6662
6657
|
isShowValue: !0
|
|
6663
6658
|
}
|
|
@@ -6784,7 +6779,7 @@ let dn = class extends rt {
|
|
|
6784
6779
|
c.forEach((f, g) => {
|
|
6785
6780
|
u.forEach((m, S) => {
|
|
6786
6781
|
const I = this._conditionalFormattingViewModel.getCellCf(t, n, f, m, s);
|
|
6787
|
-
I && (I.cfList.forEach((
|
|
6782
|
+
I && (I.cfList.forEach((y) => h.add(y.cfId)), o.setValue(g, S, I.cfList.map((y) => y.cfId)));
|
|
6788
6783
|
});
|
|
6789
6784
|
}), h.forEach((f) => {
|
|
6790
6785
|
const g = this._conditionalFormattingRuleModel.getRule(t, n, f);
|
|
@@ -6805,97 +6800,97 @@ let dn = class extends rt {
|
|
|
6805
6800
|
))
|
|
6806
6801
|
return { redos: [], undos: [] };
|
|
6807
6802
|
const { ranges: [l, a], mapFunc: c } = $i([n.copyRange, t]), u = Ua(l, a, !0), h = this._conditionalFormattingViewModel.getMatrix(i, s), f = {};
|
|
6808
|
-
ut.foreach(a, (p,
|
|
6809
|
-
const { row:
|
|
6810
|
-
E && E.cfList.forEach((
|
|
6811
|
-
if (!f[
|
|
6812
|
-
const
|
|
6813
|
-
f[
|
|
6814
|
-
const W = this._conditionalFormattingRuleModel.getRule(i, s,
|
|
6815
|
-
W == null || W.ranges.forEach((
|
|
6816
|
-
ut.foreach(
|
|
6817
|
-
|
|
6803
|
+
ut.foreach(a, (p, R) => {
|
|
6804
|
+
const { row: _, col: b } = c(p, R), E = this._conditionalFormattingViewModel.getCellCf(i, s, _, b, h);
|
|
6805
|
+
E && E.cfList.forEach((D) => {
|
|
6806
|
+
if (!f[D.cfId]) {
|
|
6807
|
+
const L = new Vt();
|
|
6808
|
+
f[D.cfId] = L;
|
|
6809
|
+
const W = this._conditionalFormattingRuleModel.getRule(i, s, D.cfId);
|
|
6810
|
+
W == null || W.ranges.forEach((v) => {
|
|
6811
|
+
ut.foreach(v, (T, ee) => {
|
|
6812
|
+
L.setValue(T, ee, 1);
|
|
6818
6813
|
});
|
|
6819
6814
|
});
|
|
6820
6815
|
}
|
|
6821
|
-
f[
|
|
6816
|
+
f[D.cfId].realDeleteValue(_, b);
|
|
6822
6817
|
});
|
|
6823
6818
|
});
|
|
6824
6819
|
const { matrix: g, info: m } = this._copyInfo, S = [];
|
|
6825
6820
|
let I = this._conditionalFormattingRuleModel.createCfId(i, s);
|
|
6826
|
-
const
|
|
6827
|
-
if (
|
|
6828
|
-
return
|
|
6829
|
-
const
|
|
6830
|
-
if (
|
|
6831
|
-
return
|
|
6821
|
+
const y = {}, w = (p) => {
|
|
6822
|
+
if (y[p])
|
|
6823
|
+
return y[p];
|
|
6824
|
+
const R = m == null ? void 0 : m.cfMap[p], _ = [...this._conditionalFormattingRuleModel.getSubunitRules(i, s) || [], ...S].find((b) => bn.diffValue(b.rule, R));
|
|
6825
|
+
if (_)
|
|
6826
|
+
return y[p] = _, _;
|
|
6832
6827
|
{
|
|
6833
|
-
const
|
|
6834
|
-
rule:
|
|
6828
|
+
const b = {
|
|
6829
|
+
rule: R,
|
|
6835
6830
|
cfId: I,
|
|
6836
6831
|
ranges: [],
|
|
6837
6832
|
stopIfTrue: !1
|
|
6838
6833
|
};
|
|
6839
|
-
return
|
|
6834
|
+
return y[p] = b, S.push(b), I = `${Number(I) + 1}`, b;
|
|
6840
6835
|
}
|
|
6841
6836
|
};
|
|
6842
6837
|
u.forEach((p) => {
|
|
6843
|
-
g && g.forValue((
|
|
6838
|
+
g && g.forValue((R, _, b) => {
|
|
6844
6839
|
const E = At.getPositionRange(
|
|
6845
6840
|
{
|
|
6846
|
-
startRow:
|
|
6847
|
-
endRow:
|
|
6848
|
-
startColumn:
|
|
6849
|
-
endColumn:
|
|
6841
|
+
startRow: R,
|
|
6842
|
+
endRow: R,
|
|
6843
|
+
startColumn: _,
|
|
6844
|
+
endColumn: _
|
|
6850
6845
|
},
|
|
6851
6846
|
p.startRange
|
|
6852
|
-
), { row:
|
|
6853
|
-
|
|
6847
|
+
), { row: D, col: L } = c(E.startRow, E.startColumn);
|
|
6848
|
+
b.forEach((W) => {
|
|
6854
6849
|
if (!f[W]) {
|
|
6855
|
-
const
|
|
6856
|
-
f[W] = T,
|
|
6850
|
+
const v = w(W), T = new Vt();
|
|
6851
|
+
f[W] = T, v.ranges.forEach((ee) => {
|
|
6857
6852
|
ut.foreach(ee, (Oe, Se) => {
|
|
6858
6853
|
T.setValue(Oe, Se, 1);
|
|
6859
6854
|
});
|
|
6860
6855
|
});
|
|
6861
6856
|
}
|
|
6862
|
-
f[W].setValue(
|
|
6857
|
+
f[W].setValue(D, L, 1);
|
|
6863
6858
|
});
|
|
6864
6859
|
});
|
|
6865
6860
|
});
|
|
6866
|
-
const C = [],
|
|
6861
|
+
const C = [], x = [];
|
|
6867
6862
|
for (const p in f) {
|
|
6868
|
-
const
|
|
6869
|
-
if (!
|
|
6870
|
-
const
|
|
6863
|
+
const R = f[p], _ = kr(qr(R));
|
|
6864
|
+
if (!_.length) {
|
|
6865
|
+
const b = {
|
|
6871
6866
|
unitId: i,
|
|
6872
6867
|
subUnitId: s,
|
|
6873
6868
|
cfId: p
|
|
6874
6869
|
};
|
|
6875
|
-
C.push({ id: Ye.id, params:
|
|
6870
|
+
C.push({ id: Ye.id, params: b }), x.push(...It(this._injector, b));
|
|
6876
6871
|
}
|
|
6877
|
-
if (S.some((
|
|
6878
|
-
const
|
|
6872
|
+
if (S.some((b) => b.cfId === p)) {
|
|
6873
|
+
const b = w(p), E = {
|
|
6879
6874
|
unitId: i,
|
|
6880
6875
|
subUnitId: s,
|
|
6881
|
-
rule: { ...
|
|
6876
|
+
rule: { ...b, ranges: _ }
|
|
6882
6877
|
};
|
|
6883
|
-
C.push({ id: De.id, params: E }),
|
|
6878
|
+
C.push({ id: De.id, params: E }), x.push(xi(this._injector, E));
|
|
6884
6879
|
} else {
|
|
6885
|
-
const
|
|
6886
|
-
if (!
|
|
6880
|
+
const b = this._conditionalFormattingRuleModel.getRule(i, s, p);
|
|
6881
|
+
if (!b)
|
|
6887
6882
|
continue;
|
|
6888
6883
|
const E = {
|
|
6889
6884
|
unitId: i,
|
|
6890
6885
|
subUnitId: s,
|
|
6891
|
-
rule: { ...
|
|
6886
|
+
rule: { ...b, ranges: _ }
|
|
6892
6887
|
};
|
|
6893
|
-
C.push({ id: nt.id, params: E }),
|
|
6888
|
+
C.push({ id: nt.id, params: E }), x.push(...Bt(this._injector, E));
|
|
6894
6889
|
}
|
|
6895
6890
|
}
|
|
6896
6891
|
return {
|
|
6897
6892
|
redos: C,
|
|
6898
|
-
undos:
|
|
6893
|
+
undos: x
|
|
6899
6894
|
};
|
|
6900
6895
|
}
|
|
6901
6896
|
};
|
|
@@ -7069,7 +7064,7 @@ let Mn = class extends rt {
|
|
|
7069
7064
|
endRow: m
|
|
7070
7065
|
},
|
|
7071
7066
|
h
|
|
7072
|
-
),
|
|
7067
|
+
), y = At.getPositionRange(
|
|
7073
7068
|
{
|
|
7074
7069
|
startRow: m,
|
|
7075
7070
|
startColumn: S,
|
|
@@ -7077,75 +7072,75 @@ let Mn = class extends rt {
|
|
|
7077
7072
|
endRow: m
|
|
7078
7073
|
},
|
|
7079
7074
|
f
|
|
7080
|
-
), { row:
|
|
7075
|
+
), { row: w, col: C } = a(I.startRow, I.startColumn), x = this._conditionalFormattingViewModel.getCellCf(
|
|
7081
7076
|
c,
|
|
7082
7077
|
u,
|
|
7083
|
-
|
|
7078
|
+
w,
|
|
7084
7079
|
C
|
|
7085
|
-
), { row: p, col:
|
|
7080
|
+
), { row: p, col: R } = a(y.startRow, y.startColumn), _ = this._conditionalFormattingViewModel.getCellCf(
|
|
7086
7081
|
c,
|
|
7087
7082
|
u,
|
|
7088
7083
|
p,
|
|
7089
|
-
|
|
7084
|
+
R
|
|
7090
7085
|
);
|
|
7091
|
-
|
|
7092
|
-
let E = l.get(
|
|
7093
|
-
if (!l.get(
|
|
7094
|
-
const
|
|
7095
|
-
if (
|
|
7086
|
+
_ && _.cfList.forEach((b) => {
|
|
7087
|
+
let E = l.get(b.cfId);
|
|
7088
|
+
if (!l.get(b.cfId)) {
|
|
7089
|
+
const D = this._conditionalFormattingRuleModel.getRule(c, u, b.cfId);
|
|
7090
|
+
if (!D)
|
|
7096
7091
|
return;
|
|
7097
|
-
E = new Vt(),
|
|
7098
|
-
ut.foreach(
|
|
7099
|
-
E.setValue(W,
|
|
7092
|
+
E = new Vt(), D.ranges.forEach((L) => {
|
|
7093
|
+
ut.foreach(L, (W, v) => {
|
|
7094
|
+
E.setValue(W, v, 1);
|
|
7100
7095
|
});
|
|
7101
|
-
}), l.set(
|
|
7096
|
+
}), l.set(b.cfId, E);
|
|
7102
7097
|
}
|
|
7103
|
-
E.realDeleteValue(p,
|
|
7104
|
-
}),
|
|
7105
|
-
let E = l.get(
|
|
7106
|
-
if (!l.get(
|
|
7107
|
-
const
|
|
7108
|
-
if (
|
|
7098
|
+
E.realDeleteValue(p, R);
|
|
7099
|
+
}), x && x.cfList.forEach((b) => {
|
|
7100
|
+
let E = l.get(b.cfId);
|
|
7101
|
+
if (!l.get(b.cfId)) {
|
|
7102
|
+
const D = this._conditionalFormattingRuleModel.getRule(c, u, b.cfId);
|
|
7103
|
+
if (!D)
|
|
7109
7104
|
return;
|
|
7110
|
-
E = new Vt(),
|
|
7111
|
-
ut.foreach(
|
|
7112
|
-
E.setValue(W,
|
|
7105
|
+
E = new Vt(), D.ranges.forEach((L) => {
|
|
7106
|
+
ut.foreach(L, (W, v) => {
|
|
7107
|
+
E.setValue(W, v, 1);
|
|
7113
7108
|
});
|
|
7114
|
-
}), l.set(
|
|
7109
|
+
}), l.set(b.cfId, E);
|
|
7115
7110
|
}
|
|
7116
|
-
E.setValue(p,
|
|
7111
|
+
E.setValue(p, R, 1);
|
|
7117
7112
|
});
|
|
7118
7113
|
});
|
|
7119
7114
|
}, n = (o, i) => {
|
|
7120
|
-
var
|
|
7121
|
-
const s = (
|
|
7115
|
+
var y, w, C;
|
|
7116
|
+
const s = (y = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET)) == null ? void 0 : y.getUnitId(), l = (C = (w = this._univerInstanceService.getCurrentUnitForType(G.UNIVER_SHEET)) == null ? void 0 : w.getActiveSheet()) == null ? void 0 : C.getSheetId(), a = /* @__PURE__ */ new Map(), c = [], u = [];
|
|
7122
7117
|
if (!s || !l)
|
|
7123
7118
|
return e();
|
|
7124
7119
|
const h = $i([o, i]), [f, g] = h.ranges, { mapFunc: m } = h, S = {
|
|
7125
7120
|
row: f.startRow,
|
|
7126
7121
|
col: f.startColumn
|
|
7127
7122
|
};
|
|
7128
|
-
return Ba(f, g).forEach((
|
|
7129
|
-
t(S,
|
|
7130
|
-
}), a.forEach((
|
|
7131
|
-
const
|
|
7132
|
-
if (!
|
|
7123
|
+
return Ba(f, g).forEach((x) => {
|
|
7124
|
+
t(S, x.repeatStartCell, x.relativeRange, a, m);
|
|
7125
|
+
}), a.forEach((x, p) => {
|
|
7126
|
+
const R = this._conditionalFormattingRuleModel.getRule(s, l, p);
|
|
7127
|
+
if (!R)
|
|
7133
7128
|
return;
|
|
7134
|
-
const
|
|
7135
|
-
if (
|
|
7136
|
-
const
|
|
7129
|
+
const _ = kr(qr(x));
|
|
7130
|
+
if (_.length) {
|
|
7131
|
+
const b = {
|
|
7137
7132
|
unitId: s,
|
|
7138
7133
|
subUnitId: l,
|
|
7139
|
-
rule: { ...
|
|
7134
|
+
rule: { ...R, ranges: _ }
|
|
7140
7135
|
};
|
|
7141
|
-
c.push({ id: nt.id, params:
|
|
7136
|
+
c.push({ id: nt.id, params: b }), u.push(...Bt(this._injector, b));
|
|
7142
7137
|
} else {
|
|
7143
|
-
const
|
|
7138
|
+
const b = {
|
|
7144
7139
|
unitId: s,
|
|
7145
7140
|
subUnitId: l,
|
|
7146
|
-
cfId:
|
|
7141
|
+
cfId: R.cfId
|
|
7147
7142
|
};
|
|
7148
|
-
c.push({ id: Ye.id, params:
|
|
7143
|
+
c.push({ id: Ye.id, params: b }), u.push(...It(this._injector, b));
|
|
7149
7144
|
}
|
|
7150
7145
|
}), {
|
|
7151
7146
|
undos: u,
|