@univerjs/sheets-data-validation-ui 0.10.5 → 0.10.6-experimental.20250904-44da50e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +134 -133
- package/lib/index.js +134 -133
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
var Tr = Object.defineProperty;
|
2
2
|
var Pr = (e, t, r) => t in e ? Tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
3
3
|
var V = (e, t, r) => Pr(e, typeof t != "symbol" ? t + "" : t, r);
|
4
|
-
import { Disposable as ye, UniverInstanceType as X, toDisposable as Ar, IUniverInstanceService as ce, Inject as M, LocaleService as ue, DataValidationErrorStyle as lt, DataValidationStatus as Ze, ICommandService as te, Injector as be, IConfigService as
|
4
|
+
import { Disposable as ye, UniverInstanceType as X, toDisposable as Ar, IUniverInstanceService as ce, Inject as M, LocaleService as ue, DataValidationErrorStyle as lt, DataValidationStatus as Ze, ICommandService as te, Injector as be, IConfigService as ln, DataValidationRenderMode as se, DisposableCollection as Lr, dayjs as Nt, numfmt as $n, CellValueType as kr, CommandType as rt, DataValidationType as j, ObjectMatrix as It, Range as Nr, Rectangle as Rt, queryObjectMatrix as zt, Optional as Ur, RxDisposable as dn, InterceptorEffectEnum as jn, sequenceExecute as Yn, bufferDebounceTime as Fr, debounce as xr, UndoCommand as Br, RedoCommand as Wr, isUnitRangesEqual as Hr, shallowEqual as Rn, ThemeService as Xn, ColorKit as $r, isFormulaString as Oe, generateRandomId as yn, VerticalAlign as de, HorizontalAlign as Re, DEFAULT_STYLES as ae, WrapStrategy as me, Plugin as Zn, merge as Kn, DependentOn as jr } from "@univerjs/core";
|
5
5
|
import { DeviceInputEventType as gt, IRenderManagerService as xe, fixLineWidthByScale as bn, Transform as Yr, CheckboxShape as Xr, getCurrentTypeOfRenderer as Ke, CURSOR_TYPE as ze, FontCache as Zr, Shape as Kr, Rect as zn, getFontStyleString as Te, DocSimpleSkeleton as it, Text as Mn } from "@univerjs/engine-render";
|
6
|
-
import { SheetInterceptorService as
|
7
|
-
import { SheetDataValidationModel as ie, SheetsDataValidationValidatorService as Qr, getDataValidationCellValue as
|
8
|
-
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as ve, DataValidationModel as
|
9
|
-
import { ISidebarService as lr, IDialogService as ui, IZenZoneService as dr, KeyCode as vt, MenuItemType as
|
10
|
-
import { filter as
|
6
|
+
import { SheetInterceptorService as cn, VALIDATE_CELL as zr, SheetsSelectionsService as Gn, SetRangeValuesCommand as st, getSheetCommandTarget as qn, rangeToDiscreteRange as Gr, SheetPermissionCheckController as qr, WorksheetEditPermission as Gt, WorksheetSetCellStylePermission as qt, RangeProtectionPermissionEditPoint as Jt, WorkbookEditablePermission as Qt, INTERCEPTOR_POINT as Jn, InterceptCellContentPriority as Qn, checkRangesEditablePermission as Jr } from "@univerjs/sheets";
|
7
|
+
import { SheetDataValidationModel as ie, SheetsDataValidationValidatorService as Qr, getDataValidationCellValue as Ut, getCellValueOrigin as re, serializeListOptions as er, createDefaultNewRule as tr, AddSheetDataValidationCommand as un, DATA_VALIDATION_PLUGIN_NAME as nr, getDataValidationDiffMutations as en, UpdateSheetDataValidationRangeCommand as rr, DataValidationCacheService as ir, UpdateSheetDataValidationSettingCommand as En, UpdateSheetDataValidationOptionsCommand as ei, RemoveSheetDataValidationCommand as or, RemoveSheetAllDataValidationCommand as ti, DataValidationFormulaController as ni, deserializeListOptions as ri, CUSTOM_FORMULA_INPUT_NAME as ar, BASE_FORMULA_INPUT_NAME as Pt, LIST_FORMULA_INPUT_NAME as hn, CHECKBOX_FORMULA_INPUT_NAME as sr, DataValidationFormulaService as ii, CHECKBOX_FORMULA_2 as oi, CHECKBOX_FORMULA_1 as ai, getFormulaResult as Ft, isLegalFormulaResult as Dn, transformCheckboxValue as si, UniverSheetsDataValidationPlugin as li } from "@univerjs/sheets-data-validation";
|
8
|
+
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as ve, DataValidationModel as pn, DataValidatorRegistryScope as di, TWO_FORMULA_OPERATOR_COUNT as ci, getRuleOptions as Vn, getRuleSetting as On } from "@univerjs/data-validation";
|
9
|
+
import { ISidebarService as lr, IDialogService as ui, IZenZoneService as dr, KeyCode as vt, MenuItemType as gn, getMenuHiddenObservable as hi, RibbonDataGroup as pi, IMenuManagerService as gi, useDependency as F, ComponentManager as vn, useObservable as Ae, useEvent as tn, useSidebarClick as cr } from "@univerjs/ui";
|
10
|
+
import { filter as fn, BehaviorSubject as Tn, distinctUntilChanged as vi, Subject as fi, debounceTime as ur, bufferTime as hr, of as mi } from "rxjs";
|
11
11
|
import { getPatternType as _i } from "@univerjs/sheets-numfmt";
|
12
|
-
import { ISheetCellDropdownManagerService as Si, IEditorBridgeService as pr, SetCellEditVisibleOperation as ft, HoverManagerService as Ci, CellAlertManagerService as wi, CellAlertType as Ii, IAutoFillService as Ri, APPLY_TYPE as ot, virtualizeDiscreteRanges as
|
13
|
-
import { Button as Ge, FormLayout as Y, RadioGroup as
|
12
|
+
import { ISheetCellDropdownManagerService as Si, IEditorBridgeService as pr, SetCellEditVisibleOperation as ft, HoverManagerService as Ci, CellAlertManagerService as wi, CellAlertType as Ii, IAutoFillService as Ri, APPLY_TYPE as ot, virtualizeDiscreteRanges as nn, getAutoFillRepeatRange as yi, ISheetClipboardService as bi, COPY_TYPE as Pn, PREDEFINED_HOOK_NAME as mt, getRepeatRange as An, getCurrentRangeDisable$ as Mi, AutoHeightController as gr, SheetSkeletonManagerService as dt, IMarkSelectionService as Ei } from "@univerjs/sheets-ui";
|
13
|
+
import { Button as Ge, FormLayout as Y, RadioGroup as mn, Radio as Le, Checkbox as At, Input as ke, Select as Ln, clsx as Ue, borderClassName as yt, DraggableList as Di, Dropdown as Vi } from "@univerjs/design";
|
14
14
|
import { createElement as Ie, forwardRef as Be, useRef as pt, useState as W, useMemo as ct, useEffect as Ne } from "react";
|
15
15
|
import { jsxs as $, Fragment as ut, jsx as S } from "react/jsx-runtime";
|
16
16
|
import { deserializeRangeWithSheet as Oi, serializeRange as vr } from "@univerjs/engine-formula";
|
@@ -30,7 +30,7 @@ let Se = class extends ye {
|
|
30
30
|
V(this, "activeRule$", this._activeRule$.asObservable());
|
31
31
|
V(this, "_closeDisposable", null);
|
32
32
|
this._univerInstanceService = t, this._sidebarService = r, this.disposeWithMe(
|
33
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
|
33
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(fn((n) => !n)).subscribe(() => {
|
34
34
|
this.close();
|
35
35
|
})
|
36
36
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
@@ -69,7 +69,7 @@ Se = Ai([
|
|
69
69
|
kn(0, ce),
|
70
70
|
kn(1, lr)
|
71
71
|
], Se);
|
72
|
-
const Pe = "#ECECEC",
|
72
|
+
const Pe = "#ECECEC", _n = "sheets-data-validation-ui.config", bt = {};
|
73
73
|
var Li = Object.getOwnPropertyDescriptor, ki = (e, t, r, n) => {
|
74
74
|
for (var i = n > 1 ? void 0 : n ? Li(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
75
75
|
(a = e[o]) && (i = a(i) || i);
|
@@ -144,7 +144,7 @@ let qe = class extends ye {
|
|
144
144
|
}
|
145
145
|
};
|
146
146
|
qe = ki([
|
147
|
-
$e(0, M(
|
147
|
+
$e(0, M(cn)),
|
148
148
|
$e(1, M(ie)),
|
149
149
|
$e(2, M(Me)),
|
150
150
|
$e(3, ui),
|
@@ -156,12 +156,13 @@ var Ni = Object.getOwnPropertyDescriptor, Ui = (e, t, r, n) => {
|
|
156
156
|
(a = e[o]) && (i = a(i) || i);
|
157
157
|
return i;
|
158
158
|
}, pe = (e, t) => (r, n) => t(r, n, e);
|
159
|
-
const
|
159
|
+
const xt = (e) => {
|
160
160
|
if (e == null || typeof e == "boolean")
|
161
161
|
return;
|
162
|
+
if (e === "") return Nt();
|
162
163
|
if (typeof e == "number" || !Number.isNaN(+e))
|
163
|
-
return
|
164
|
-
const t =
|
164
|
+
return Nt($n.format("yyyy-MM-dd HH:mm:ss", Number(e)));
|
165
|
+
const t = Nt(e);
|
165
166
|
if (t.isValid())
|
166
167
|
return t;
|
167
168
|
};
|
@@ -276,7 +277,7 @@ let Fe = class extends ye {
|
|
276
277
|
let m;
|
277
278
|
switch (u.dropdownType) {
|
278
279
|
case ve.DATE: {
|
279
|
-
const v = re(s.getCellRaw(n, i)), I =
|
280
|
+
const v = re(s.getCellRaw(n, i)), I = xt(v), w = !!((b = d.bizInfo) != null && b.showTime);
|
280
281
|
m = {
|
281
282
|
location: r,
|
282
283
|
type: "datepicker",
|
@@ -290,7 +291,7 @@ let Fe = class extends ye {
|
|
290
291
|
break;
|
291
292
|
}
|
292
293
|
case ve.TIME: {
|
293
|
-
const v = re(s.getCellRaw(n, i)), I =
|
294
|
+
const v = re(s.getCellRaw(n, i)), I = xt(v);
|
294
295
|
m = {
|
295
296
|
location: r,
|
296
297
|
type: "datepicker",
|
@@ -303,7 +304,7 @@ let Fe = class extends ye {
|
|
303
304
|
break;
|
304
305
|
}
|
305
306
|
case ve.DATETIME: {
|
306
|
-
const v = re(s.getCellRaw(n, i)), I =
|
307
|
+
const v = re(s.getCellRaw(n, i)), I = xt(v);
|
307
308
|
m = {
|
308
309
|
location: r,
|
309
310
|
type: "datepicker",
|
@@ -340,7 +341,7 @@ let Fe = class extends ye {
|
|
340
341
|
unitId: o,
|
341
342
|
keycode: vt.ESC
|
342
343
|
}), !v;
|
343
|
-
}, w = (d == null ? void 0 : d.renderMode) === se.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, _ = u.getListWithColor(d, o, a), R =
|
344
|
+
}, w = (d == null ? void 0 : d.renderMode) === se.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, _ = u.getListWithColor(d, o, a), R = Ut(s.getCellRaw(n, i)), L = () => {
|
344
345
|
this._commandService.executeCommand(We.id, {
|
345
346
|
ruleId: d.uid
|
346
347
|
}), h == null || h.dispose();
|
@@ -358,7 +359,7 @@ let Fe = class extends ye {
|
|
358
359
|
onEdit: L,
|
359
360
|
defaultValue: R,
|
360
361
|
multiple: v,
|
361
|
-
showEdit: (g = (y = this._configService.getConfig(
|
362
|
+
showEdit: (g = (y = this._configService.getConfig(_n)) == null ? void 0 : y.showEditOnDropdown) != null ? g : !0
|
362
363
|
}
|
363
364
|
};
|
364
365
|
break;
|
@@ -391,7 +392,7 @@ let Fe = class extends ye {
|
|
391
392
|
keycode: vt.ESC
|
392
393
|
}), !0;
|
393
394
|
},
|
394
|
-
defaultValue:
|
395
|
+
defaultValue: Ut(s.getCellRaw(n, i)).split("/"),
|
395
396
|
options: JSON.parse((C = d.formula1) != null ? C : "[]")
|
396
397
|
},
|
397
398
|
location: r
|
@@ -426,7 +427,7 @@ let Fe = class extends ye {
|
|
426
427
|
keycode: vt.ESC
|
427
428
|
}), !0;
|
428
429
|
},
|
429
|
-
defaultValue:
|
430
|
+
defaultValue: Ut(s.getCellRaw(n, i))
|
430
431
|
},
|
431
432
|
location: r
|
432
433
|
};
|
@@ -492,7 +493,7 @@ Fe = Ui([
|
|
492
493
|
pe(7, te),
|
493
494
|
pe(8, pr),
|
494
495
|
pe(9, M(be)),
|
495
|
-
pe(10,
|
496
|
+
pe(10, ln)
|
496
497
|
], Fe);
|
497
498
|
const Mt = "DataValidationPanel", We = {
|
498
499
|
id: "data-validation.operation.open-validation-panel",
|
@@ -500,7 +501,7 @@ const Mt = "DataValidationPanel", We = {
|
|
500
501
|
handler(e, t) {
|
501
502
|
if (!t)
|
502
503
|
return !1;
|
503
|
-
const { ruleId: r, isAdd: n } = t, i = e.get(Se), o = e.get(
|
504
|
+
const { ruleId: r, isAdd: n } = t, i = e.get(Se), o = e.get(pn), a = e.get(ce), l = e.get(lr), s = qn(a);
|
504
505
|
if (!s) return !1;
|
505
506
|
const { unitId: d, subUnitId: u } = s, h = r ? o.getRuleById(d, u, r) : void 0;
|
506
507
|
i.open(), i.setActiveRule(h && {
|
@@ -517,7 +518,7 @@ const Mt = "DataValidationPanel", We = {
|
|
517
518
|
});
|
518
519
|
return i.setCloseDisposable(c), !0;
|
519
520
|
}
|
520
|
-
},
|
521
|
+
}, Sn = {
|
521
522
|
id: "data-validation.operation.close-validation-panel",
|
522
523
|
type: rt.OPERATION,
|
523
524
|
handler(e) {
|
@@ -528,7 +529,7 @@ const Mt = "DataValidationPanel", We = {
|
|
528
529
|
type: rt.OPERATION,
|
529
530
|
handler(e) {
|
530
531
|
const t = e.get(te), r = e.get(Se);
|
531
|
-
return r.open(), r.isOpen ? t.executeCommand(
|
532
|
+
return r.open(), r.isOpen ? t.executeCommand(Sn.id) : t.executeCommand(We.id), !0;
|
532
533
|
}
|
533
534
|
}, Lt = {
|
534
535
|
type: rt.OPERATION,
|
@@ -561,7 +562,7 @@ const Mt = "DataValidationPanel", We = {
|
|
561
562
|
unitId: l,
|
562
563
|
subUnitId: s
|
563
564
|
};
|
564
|
-
return a.syncExecuteCommand(
|
565
|
+
return a.syncExecuteCommand(un.id, d) ? (a.syncExecuteCommand(We.id, {
|
565
566
|
ruleId: o.uid,
|
566
567
|
isAdd: !0
|
567
568
|
}), !0) : !1;
|
@@ -635,7 +636,7 @@ var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, r, n) => {
|
|
635
636
|
for (var i = n > 1 ? void 0 : n ? Wi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
636
637
|
(a = e[o]) && (i = a(i) || i);
|
637
638
|
return i;
|
638
|
-
},
|
639
|
+
}, Bt = (e, t) => (r, n) => t(r, n, e);
|
639
640
|
let Je = class extends ye {
|
640
641
|
constructor(e, t, r) {
|
641
642
|
super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = r, this._initAutoFill();
|
@@ -643,7 +644,7 @@ let Je = class extends ye {
|
|
643
644
|
// eslint-disable-next-line max-lines-per-function
|
644
645
|
_initAutoFill() {
|
645
646
|
const e = () => ({ redos: [], undos: [] }), t = (n, i) => {
|
646
|
-
const { source: o, target: a, unitId: l, subUnitId: s } = n, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u =
|
647
|
+
const { source: o, target: a, unitId: l, subUnitId: s } = n, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = nn([o, a]), [h, c] = u.ranges, { mapFunc: m } = u, p = {
|
647
648
|
row: h.startRow,
|
648
649
|
col: h.startColumn
|
649
650
|
}, b = yi(h, c), y = new It(), g = /* @__PURE__ */ new Set();
|
@@ -680,9 +681,9 @@ let Je = class extends ye {
|
|
680
681
|
y.setValue(ne, oe, B), g.add(B);
|
681
682
|
});
|
682
683
|
});
|
683
|
-
const C = Array.from(g).map((_) => ({ id: _, ranges:
|
684
|
+
const C = Array.from(g).map((_) => ({ id: _, ranges: zt(y, (R) => R === _) }));
|
684
685
|
d.addRangeRules(C);
|
685
|
-
const v = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: I, undoMutations: w } =
|
686
|
+
const v = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: I, undoMutations: w } = en(l, s, v, this._injector, "patched", i === ot.ONLY_FORMAT);
|
686
687
|
return {
|
687
688
|
undos: w,
|
688
689
|
redos: I
|
@@ -708,15 +709,15 @@ let Je = class extends ye {
|
|
708
709
|
}
|
709
710
|
};
|
710
711
|
Je = Hi([
|
711
|
-
|
712
|
-
|
713
|
-
|
712
|
+
Bt(0, Ri),
|
713
|
+
Bt(1, M(ie)),
|
714
|
+
Bt(2, M(be))
|
714
715
|
], Je);
|
715
716
|
var $i = Object.getOwnPropertyDescriptor, ji = (e, t, r, n) => {
|
716
717
|
for (var i = n > 1 ? void 0 : n ? $i(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
717
718
|
(a = e[o]) && (i = a(i) || i);
|
718
719
|
return i;
|
719
|
-
},
|
720
|
+
}, Wt = (e, t) => (r, n) => t(r, n, e);
|
720
721
|
let Qe = class extends ye {
|
721
722
|
constructor(t, r, n) {
|
722
723
|
super();
|
@@ -768,7 +769,7 @@ let Qe = class extends ye {
|
|
768
769
|
return { redos: [], undos: [] };
|
769
770
|
const { unitId: i, subUnitId: o } = this._copyInfo;
|
770
771
|
if (r.unitId !== i || o !== r.subUnitId) {
|
771
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(r.unitId, r.subUnitId).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } =
|
772
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(r.unitId, r.subUnitId).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } = nn([r.copyRange, t]), c = An(d, u, !0), m = /* @__PURE__ */ new Map();
|
772
773
|
c.forEach(({ startRange: g }) => {
|
773
774
|
var C;
|
774
775
|
(C = this._copyInfo) == null || C.matrix.forValue((v, I, w) => {
|
@@ -786,9 +787,9 @@ let Qe = class extends ye {
|
|
786
787
|
s.add(R), l.setValue(N, E, R);
|
787
788
|
});
|
788
789
|
});
|
789
|
-
const p = Array.from(s).map((g) => ({ id: g, ranges:
|
790
|
+
const p = Array.from(s).map((g) => ({ id: g, ranges: zt(l, (C) => C === g) }));
|
790
791
|
a.addRangeRules(p);
|
791
|
-
const { redoMutations: b, undoMutations: y } =
|
792
|
+
const { redoMutations: b, undoMutations: y } = en(
|
792
793
|
r.unitId,
|
793
794
|
r.subUnitId,
|
794
795
|
a.diffWithAddition(this._sheetDataValidationModel.getRules(r.unitId, r.subUnitId), m.values()),
|
@@ -801,7 +802,7 @@ let Qe = class extends ye {
|
|
801
802
|
undos: y
|
802
803
|
};
|
803
804
|
} else {
|
804
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } =
|
805
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } = nn([r.copyRange, t]);
|
805
806
|
An(d, u, !0).forEach(({ startRange: y }) => {
|
806
807
|
var g;
|
807
808
|
(g = this._copyInfo) == null || g.matrix.forValue((C, v, I) => {
|
@@ -817,9 +818,9 @@ let Qe = class extends ye {
|
|
817
818
|
l.setValue(_, R, I), s.add(I);
|
818
819
|
});
|
819
820
|
});
|
820
|
-
const m = Array.from(s).map((y) => ({ id: y, ranges:
|
821
|
+
const m = Array.from(s).map((y) => ({ id: y, ranges: zt(l, (g) => g === y) }));
|
821
822
|
a.addRangeRules(m);
|
822
|
-
const { redoMutations: p, undoMutations: b } =
|
823
|
+
const { redoMutations: p, undoMutations: b } = en(
|
823
824
|
i,
|
824
825
|
o,
|
825
826
|
a.diff(this._sheetDataValidationModel.getRules(i, o)),
|
@@ -835,15 +836,15 @@ let Qe = class extends ye {
|
|
835
836
|
}
|
836
837
|
};
|
837
838
|
Qe = ji([
|
838
|
-
|
839
|
-
|
840
|
-
|
839
|
+
Wt(0, bi),
|
840
|
+
Wt(1, M(ie)),
|
841
|
+
Wt(2, M(be))
|
841
842
|
], Qe);
|
842
843
|
var Yi = Object.getOwnPropertyDescriptor, Xi = (e, t, r, n) => {
|
843
844
|
for (var i = n > 1 ? void 0 : n ? Yi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
844
845
|
(a = e[o]) && (i = a(i) || i);
|
845
846
|
return i;
|
846
|
-
},
|
847
|
+
}, Ht = (e, t) => (r, n) => t(r, n, e);
|
847
848
|
let et = class extends ye {
|
848
849
|
constructor(e, t, r) {
|
849
850
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = r, this._commandExecutedListener();
|
@@ -851,47 +852,47 @@ let et = class extends ye {
|
|
851
852
|
_commandExecutedListener() {
|
852
853
|
this.disposeWithMe(
|
853
854
|
this._commandService.beforeCommandExecuted((e) => {
|
854
|
-
e.id ===
|
855
|
-
workbookTypes: [
|
856
|
-
rangeTypes: [
|
857
|
-
worksheetTypes: [
|
855
|
+
e.id === un.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
856
|
+
workbookTypes: [Qt],
|
857
|
+
rangeTypes: [Jt],
|
858
|
+
worksheetTypes: [Gt, qt]
|
858
859
|
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === rr.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
859
|
-
workbookTypes: [
|
860
|
-
rangeTypes: [
|
861
|
-
worksheetTypes: [
|
860
|
+
workbookTypes: [Qt],
|
861
|
+
rangeTypes: [Jt],
|
862
|
+
worksheetTypes: [Gt, qt]
|
862
863
|
}, e.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
863
864
|
})
|
864
865
|
);
|
865
866
|
}
|
866
867
|
};
|
867
868
|
et = Xi([
|
868
|
-
|
869
|
-
|
870
|
-
|
869
|
+
Ht(0, M(ue)),
|
870
|
+
Ht(1, te),
|
871
|
+
Ht(2, M(qr))
|
871
872
|
], et);
|
872
873
|
const Sr = "sheet.menu.data-validation";
|
873
874
|
function Zi(e) {
|
874
875
|
return {
|
875
876
|
id: Sr,
|
876
|
-
type:
|
877
|
+
type: gn.SUBITEMS,
|
877
878
|
icon: "DataValidationIcon",
|
878
879
|
tooltip: "dataValidation.title",
|
879
880
|
hidden$: hi(e, X.UNIVER_SHEET),
|
880
|
-
disabled$: Mi(e, { workbookTypes: [
|
881
|
+
disabled$: Mi(e, { workbookTypes: [Qt], worksheetTypes: [qt, Gt], rangeTypes: [Jt] })
|
881
882
|
};
|
882
883
|
}
|
883
884
|
function Ki(e) {
|
884
885
|
return {
|
885
886
|
id: We.id,
|
886
887
|
title: "dataValidation.panel.title",
|
887
|
-
type:
|
888
|
+
type: gn.BUTTON
|
888
889
|
};
|
889
890
|
}
|
890
891
|
function zi(e) {
|
891
892
|
return {
|
892
893
|
id: kt.id,
|
893
894
|
title: "dataValidation.panel.add",
|
894
|
-
type:
|
895
|
+
type: gn.BUTTON
|
895
896
|
};
|
896
897
|
}
|
897
898
|
const Gi = {
|
@@ -921,7 +922,7 @@ const wr = {
|
|
921
922
|
color: "#fe4b4b"
|
922
923
|
}
|
923
924
|
};
|
924
|
-
let tt = class extends
|
925
|
+
let tt = class extends dn {
|
925
926
|
constructor(e, t, r, n, i, o, a, l, s, d, u) {
|
926
927
|
super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = r, this._univerInstanceService = n, this._autoHeightController = i, this._dropdownManagerService = o, this._sheetDataValidationModel = a, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = d, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
927
928
|
}
|
@@ -1060,7 +1061,7 @@ let tt = class extends ln {
|
|
1060
1061
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1061
1062
|
// patched data-validation change don't need to re-calc row height
|
1062
1063
|
// re-calc of row height will be triggered precisely by the origin command
|
1063
|
-
|
1064
|
+
fn((e) => e.source === "command"),
|
1064
1065
|
hr(100)
|
1065
1066
|
).subscribe((e) => {
|
1066
1067
|
if (e.length === 0)
|
@@ -1085,11 +1086,11 @@ tt = Cr([
|
|
1085
1086
|
K(5, M(Fe)),
|
1086
1087
|
K(6, M(ie)),
|
1087
1088
|
K(7, M(Me)),
|
1088
|
-
K(8, M(
|
1089
|
+
K(8, M(cn)),
|
1089
1090
|
K(9, M(ir)),
|
1090
1091
|
K(10, Ur(pr))
|
1091
1092
|
], tt);
|
1092
|
-
let Nn = class extends
|
1093
|
+
let Nn = class extends dn {
|
1093
1094
|
constructor(e, t, r, n, i, o, a) {
|
1094
1095
|
super(), this._commandService = e, this._renderManagerService = t, this._autoHeightController = r, this._dataValidatorRegistryService = n, this._sheetInterceptorService = i, this._sheetDataValidationModel = o, this._dataValidationCacheService = a, this._initViewModelIntercept(), this._initAutoHeight();
|
1095
1096
|
}
|
@@ -1171,7 +1172,7 @@ let Nn = class extends ln {
|
|
1171
1172
|
}
|
1172
1173
|
_initAutoHeight() {
|
1173
1174
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1174
|
-
|
1175
|
+
fn((e) => e.source === "command"),
|
1175
1176
|
hr(16)
|
1176
1177
|
).subscribe((e) => {
|
1177
1178
|
const t = [];
|
@@ -1190,7 +1191,7 @@ Nn = Cr([
|
|
1190
1191
|
K(1, xe),
|
1191
1192
|
K(2, M(gr)),
|
1192
1193
|
K(3, M(Me)),
|
1193
|
-
K(4, M(
|
1194
|
+
K(4, M(cn)),
|
1194
1195
|
K(5, M(ie)),
|
1195
1196
|
K(6, M(ir))
|
1196
1197
|
], Nn);
|
@@ -1277,14 +1278,14 @@ var io = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
1277
1278
|
}));
|
1278
1279
|
});
|
1279
1280
|
Rr.displayName = "DataValidationIcon";
|
1280
|
-
var oo = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] },
|
1281
|
+
var oo = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Cn = Be(function(e, t) {
|
1281
1282
|
return Ie(He, Object.assign({}, e, {
|
1282
1283
|
id: "delete-icon",
|
1283
1284
|
ref: t,
|
1284
1285
|
icon: oo
|
1285
1286
|
}));
|
1286
1287
|
});
|
1287
|
-
|
1288
|
+
Cn.displayName = "DeleteIcon";
|
1288
1289
|
var ao = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, yr = Be(function(e, t) {
|
1289
1290
|
return Ie(He, Object.assign({}, e, {
|
1290
1291
|
id: "increase-icon",
|
@@ -1293,14 +1294,14 @@ var ao = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
1293
1294
|
}));
|
1294
1295
|
});
|
1295
1296
|
yr.displayName = "IncreaseIcon";
|
1296
|
-
var so = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] },
|
1297
|
+
var so = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wn = Be(function(e, t) {
|
1297
1298
|
return Ie(He, Object.assign({}, e, {
|
1298
1299
|
id: "more-down-icon",
|
1299
1300
|
ref: t,
|
1300
1301
|
icon: so
|
1301
1302
|
}));
|
1302
1303
|
});
|
1303
|
-
|
1304
|
+
wn.displayName = "MoreDownIcon";
|
1304
1305
|
var lo = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, br = Be(function(e, t) {
|
1305
1306
|
return Ie(He, Object.assign({}, e, {
|
1306
1307
|
id: "more-up-icon",
|
@@ -1319,7 +1320,7 @@ var co = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
1319
1320
|
Mr.displayName = "SequenceIcon";
|
1320
1321
|
function uo(e) {
|
1321
1322
|
var d;
|
1322
|
-
const t = F(ue), r = F(
|
1323
|
+
const t = F(ue), r = F(vn), { value: n, onChange: i, extraComponent: o } = e, [a, l] = W(!1), s = o ? r.get(o) : null;
|
1323
1324
|
return /* @__PURE__ */ $(ut, { children: [
|
1324
1325
|
/* @__PURE__ */ $(
|
1325
1326
|
"div",
|
@@ -1328,7 +1329,7 @@ function uo(e) {
|
|
1328
1329
|
onClick: () => l(!a),
|
1329
1330
|
children: [
|
1330
1331
|
t.t("dataValidation.panel.options"),
|
1331
|
-
a ? /* @__PURE__ */ S(br, { className: "univer-ml-1" }) : /* @__PURE__ */ S(
|
1332
|
+
a ? /* @__PURE__ */ S(br, { className: "univer-ml-1" }) : /* @__PURE__ */ S(wn, { className: "univer-ml-1" })
|
1332
1333
|
]
|
1333
1334
|
}
|
1334
1335
|
),
|
@@ -1339,7 +1340,7 @@ function uo(e) {
|
|
1339
1340
|
{
|
1340
1341
|
label: t.t("dataValidation.panel.invalid"),
|
1341
1342
|
children: /* @__PURE__ */ $(
|
1342
|
-
|
1343
|
+
mn,
|
1343
1344
|
{
|
1344
1345
|
value: `${(d = n.errorStyle) != null ? d : lt.WARNING}`,
|
1345
1346
|
onChange: (u) => i({ ...n, errorStyle: +u }),
|
@@ -1385,7 +1386,7 @@ function po(e, t, r) {
|
|
1385
1386
|
}
|
1386
1387
|
function go() {
|
1387
1388
|
var D, U;
|
1388
|
-
const [e, t] = W(0), r = F(Se), n = Ae(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = F(Me), d = F(ce), u = F(
|
1389
|
+
const [e, t] = W(0), r = F(Se), n = Ae(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = F(Me), d = F(ce), u = F(vn), h = F(te), c = F(pn), m = F(ue), [p, b] = W(a), y = s.getValidatorItem(p.type), [g, C] = W(!1), v = s.getValidatorsByScope(di.SHEET), [I, w] = W(() => p.ranges.map((f) => ({ unitId: "", sheetId: "", range: f }))), _ = ct(() => ho(h), [h]), [R, L] = W(!1), [N, E] = W(!1), T = pt(null), O = F(Gn);
|
1389
1390
|
if (Ne(() => () => {
|
1390
1391
|
const f = O.getCurrentLastSelection();
|
1391
1392
|
f && O.setSelections([f]);
|
@@ -1401,11 +1402,11 @@ function go() {
|
|
1401
1402
|
const P = y.operators, k = y.operatorNames, H = p.operator ? ci.includes(p.operator) : !1, B = () => {
|
1402
1403
|
var f, A, x;
|
1403
1404
|
(A = (f = T.current) == null ? void 0 : f.editor) != null && A.isFocus() && J((x = T.current) == null ? void 0 : x.getValue()), !(!p.ranges.length || R) && (y.validatorFormula(p, i, o).success ? r.setActiveRule(null) : C(!0));
|
1404
|
-
}, J =
|
1405
|
+
}, J = tn((f) => {
|
1405
1406
|
const A = f.split(",").filter(Boolean).map(Oi).map((ee) => {
|
1406
|
-
const
|
1407
|
-
if (
|
1408
|
-
const Or = po(d, ee.unitId,
|
1407
|
+
const In = ee.sheetName;
|
1408
|
+
if (In) {
|
1409
|
+
const Or = po(d, ee.unitId, In);
|
1409
1410
|
return { ...ee, sheetId: Or };
|
1410
1411
|
}
|
1411
1412
|
return {
|
@@ -1665,7 +1666,7 @@ const vo = (e) => {
|
|
1665
1666
|
{
|
1666
1667
|
className: "univer-absolute univer-right-2 univer-top-[19px] univer-flex univer-h-5 univer-w-5 univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-200 dark:!univer-text-gray-300 dark:hover:!univer-bg-gray-700",
|
1667
1668
|
onClick: y,
|
1668
|
-
children: /* @__PURE__ */ S(
|
1669
|
+
children: /* @__PURE__ */ S(Cn, {})
|
1669
1670
|
}
|
1670
1671
|
) : null
|
1671
1672
|
]
|
@@ -1689,7 +1690,7 @@ function fo(e) {
|
|
1689
1690
|
subUnitId: c,
|
1690
1691
|
rule: C
|
1691
1692
|
};
|
1692
|
-
await n.executeCommand(
|
1693
|
+
await n.executeCommand(un.id, v), o.setActiveRule({
|
1693
1694
|
unitId: h,
|
1694
1695
|
subUnitId: c,
|
1695
1696
|
rule: C
|
@@ -1924,7 +1925,7 @@ const wo = [
|
|
1924
1925
|
style: { background: t }
|
1925
1926
|
}
|
1926
1927
|
),
|
1927
|
-
/* @__PURE__ */ S(
|
1928
|
+
/* @__PURE__ */ S(wn, {})
|
1928
1929
|
]
|
1929
1930
|
}
|
1930
1931
|
)
|
@@ -1957,14 +1958,14 @@ const wo = [
|
|
1957
1958
|
"div",
|
1958
1959
|
{
|
1959
1960
|
className: "univer-ml-1 univer-cursor-pointer univer-rounded univer-text-base hover:univer-bg-gray-200",
|
1960
|
-
children: /* @__PURE__ */ S(
|
1961
|
+
children: /* @__PURE__ */ S(Cn, { onClick: () => o(t.id) })
|
1961
1962
|
}
|
1962
1963
|
)
|
1963
1964
|
] });
|
1964
1965
|
};
|
1965
1966
|
function Ro(e) {
|
1966
1967
|
const { value: t, onChange: r = () => {
|
1967
|
-
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, h] = W(() => Oe(s) ? "1" : "0"), [c, m] = W(u === "1" ? s : "="), [p, b] = W(u === "1" ? s : "="), y = F(ue), g = F(Me), C = F(
|
1968
|
+
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, h] = W(() => Oe(s) ? "1" : "0"), [c, m] = W(u === "1" ? s : "="), [p, b] = W(u === "1" ? s : "="), y = F(ue), g = F(Me), C = F(pn), v = F(ni), [I, w] = W(() => d.split(",")), _ = g.getValidatorItem(j.LIST), [R, L] = W([]), [N, E] = W(""), T = a ? o == null ? void 0 : o.formula1 : "", O = ct(() => C.ruleChange$.pipe(ur(16)), []), P = Ae(O), k = tn(r);
|
1968
1969
|
Ne(() => {
|
1969
1970
|
(async () => {
|
1970
1971
|
await new Promise((f) => {
|
@@ -2034,7 +2035,7 @@ function Ro(e) {
|
|
2034
2035
|
formula2: U.map((f) => f.color === Pe ? "" : f.color).join(",")
|
2035
2036
|
});
|
2036
2037
|
}, [H, k, u, p, I]);
|
2037
|
-
const fe =
|
2038
|
+
const fe = tn(async (D) => {
|
2038
2039
|
if (!Oe(D)) {
|
2039
2040
|
k == null || k({
|
2040
2041
|
formula1: "",
|
@@ -2055,7 +2056,7 @@ function Ro(e) {
|
|
2055
2056
|
((f = Q.current) == null ? void 0 : f.isClickOutSide(D)) && G(!1);
|
2056
2057
|
}), /* @__PURE__ */ $(ut, { children: [
|
2057
2058
|
/* @__PURE__ */ S(Y, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ $(
|
2058
|
-
|
2059
|
+
mn,
|
2059
2060
|
{
|
2060
2061
|
value: u,
|
2061
2062
|
onChange: (D) => {
|
@@ -2144,7 +2145,7 @@ const yo = [
|
|
2144
2145
|
_o
|
2145
2146
|
],
|
2146
2147
|
[
|
2147
|
-
|
2148
|
+
hn,
|
2148
2149
|
Ro
|
2149
2150
|
],
|
2150
2151
|
[
|
@@ -2155,7 +2156,7 @@ const yo = [
|
|
2155
2156
|
function Dt(e) {
|
2156
2157
|
var i;
|
2157
2158
|
const { value: t, onChange: r } = e, n = F(ue);
|
2158
|
-
return /* @__PURE__ */ S(Y, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ $(
|
2159
|
+
return /* @__PURE__ */ S(Y, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ $(mn, { value: `${(i = t.renderMode) != null ? i : se.CUSTOM}`, onChange: (o) => r({ ...t, renderMode: +o }), children: [
|
2159
2160
|
/* @__PURE__ */ S(Le, { value: `${se.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2160
2161
|
/* @__PURE__ */ S(Le, { value: `${se.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2161
2162
|
/* @__PURE__ */ S(Le, { value: `${se.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
@@ -2190,7 +2191,7 @@ var Eo = Object.getOwnPropertyDescriptor, Do = (e, t, r, n) => {
|
|
2190
2191
|
return i;
|
2191
2192
|
}, Ye = (e, t) => (r, n) => t(r, n, e);
|
2192
2193
|
const _t = 6;
|
2193
|
-
let
|
2194
|
+
let rn = class {
|
2194
2195
|
constructor(e, t, r, n, i, o) {
|
2195
2196
|
this._commandService = e, this._univerInstanceService = t, this._formulaService = r, this._themeService = n, this._renderManagerService = i, this._dataValidationModel = o;
|
2196
2197
|
}
|
@@ -2239,9 +2240,9 @@ let nn = class {
|
|
2239
2240
|
}
|
2240
2241
|
async _parseFormula(e, t, r) {
|
2241
2242
|
var d, u, h, c, m, p, b, y, g;
|
2242
|
-
const { formula1: n = ai, formula2: i = oi } = e, o = await this._formulaService.getRuleFormulaResult(t, r, e.uid), a =
|
2243
|
+
const { formula1: n = ai, formula2: i = oi } = e, o = await this._formulaService.getRuleFormulaResult(t, r, e.uid), a = Ft((h = (u = (d = o == null ? void 0 : o[0]) == null ? void 0 : d.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Ft((p = (m = (c = o == null ? void 0 : o[1]) == null ? void 0 : c.result) == null ? void 0 : m[0]) == null ? void 0 : p[0]), s = Dn(String(a)) && Dn(String(l));
|
2243
2244
|
return {
|
2244
|
-
formula1: Oe(n) ?
|
2245
|
+
formula1: Oe(n) ? Ft((g = (y = (b = o == null ? void 0 : o[0]) == null ? void 0 : b.result) == null ? void 0 : y[0]) == null ? void 0 : g[0]) : n,
|
2245
2246
|
formula2: Oe(i) ? l : i,
|
2246
2247
|
isFormulaValid: s
|
2247
2248
|
};
|
@@ -2316,14 +2317,14 @@ let nn = class {
|
|
2316
2317
|
(n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(ze.DEFAULT);
|
2317
2318
|
}
|
2318
2319
|
};
|
2319
|
-
|
2320
|
+
rn = Do([
|
2320
2321
|
Ye(0, te),
|
2321
2322
|
Ye(1, ce),
|
2322
2323
|
Ye(2, M(ii)),
|
2323
2324
|
Ye(3, M(Xn)),
|
2324
2325
|
Ye(4, M(xe)),
|
2325
2326
|
Ye(5, M(ie))
|
2326
|
-
],
|
2327
|
+
], rn);
|
2327
2328
|
var Vo = Object.getOwnPropertyDescriptor, Oo = (e, t, r, n) => {
|
2328
2329
|
for (var i = n > 1 ? void 0 : n ? Vo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2329
2330
|
(a = e[o]) && (i = a(i) || i);
|
@@ -2334,7 +2335,7 @@ let Ce = class {
|
|
2334
2335
|
V(this, "canvasRender", null);
|
2335
2336
|
V(this, "dropdownType");
|
2336
2337
|
V(this, "optionsInput");
|
2337
|
-
V(this, "formulaInput",
|
2338
|
+
V(this, "formulaInput", hn);
|
2338
2339
|
this.injector = e;
|
2339
2340
|
}
|
2340
2341
|
};
|
@@ -2345,7 +2346,7 @@ class Po extends Ce {
|
|
2345
2346
|
constructor() {
|
2346
2347
|
super(...arguments);
|
2347
2348
|
V(this, "id", j.CHECKBOX);
|
2348
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2349
|
+
V(this, "canvasRender", this.injector.createInstance(rn));
|
2349
2350
|
V(this, "formulaInput", sr);
|
2350
2351
|
}
|
2351
2352
|
}
|
@@ -2373,7 +2374,7 @@ class No extends Ce {
|
|
2373
2374
|
V(this, "formulaInput", Pt);
|
2374
2375
|
}
|
2375
2376
|
}
|
2376
|
-
const Er = 4, Uo = 0,
|
2377
|
+
const Er = 4, Uo = 0, $t = 4, Dr = 4, on = 6, Ot = 6, Ve = 14;
|
2377
2378
|
function Fo(e, t) {
|
2378
2379
|
const r = Zr.getTextSize(e, t), n = r.width + Er * 2, { ba: i, bd: o } = r, a = i + o;
|
2379
2380
|
return {
|
@@ -2382,8 +2383,8 @@ function Fo(e, t) {
|
|
2382
2383
|
ba: i
|
2383
2384
|
};
|
2384
2385
|
}
|
2385
|
-
function
|
2386
|
-
const i = Ve +
|
2386
|
+
function jt(e, t, r, n) {
|
2387
|
+
const i = Ve + on * 2, o = r - i, a = n - Ot * 2, l = e.map((c) => ({
|
2387
2388
|
layout: Fo(c, t),
|
2388
2389
|
text: c
|
2389
2390
|
}));
|
@@ -2391,7 +2392,7 @@ function $t(e, t, r, n) {
|
|
2391
2392
|
const d = [];
|
2392
2393
|
l.forEach((c) => {
|
2393
2394
|
const { layout: m } = c, { width: p, height: b } = m;
|
2394
|
-
!s || s.width + p +
|
2395
|
+
!s || s.width + p + $t > o ? (s = {
|
2395
2396
|
width: p,
|
2396
2397
|
height: b,
|
2397
2398
|
items: [{
|
@@ -2400,8 +2401,8 @@ function $t(e, t, r, n) {
|
|
2400
2401
|
}]
|
2401
2402
|
}, d.push(s)) : (s.items.push({
|
2402
2403
|
...c,
|
2403
|
-
left: s.width +
|
2404
|
-
}), s.width = s.width + p +
|
2404
|
+
left: s.width + $t
|
2405
|
+
}), s.width = s.width + p + $t);
|
2405
2406
|
});
|
2406
2407
|
let u = 0, h = 0;
|
2407
2408
|
return d.forEach((c, m) => {
|
@@ -2433,7 +2434,7 @@ var Wo = Object.getOwnPropertyDescriptor, Ho = (e, t, r, n) => {
|
|
2433
2434
|
return i;
|
2434
2435
|
}, St = (e, t) => (r, n) => t(r, n, e);
|
2435
2436
|
const $o = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
|
2436
|
-
let
|
2437
|
+
let an = class {
|
2437
2438
|
constructor(e, t, r, n) {
|
2438
2439
|
V(this, "zIndex");
|
2439
2440
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2473,8 +2474,8 @@ let on = class {
|
|
2473
2474
|
endX: u.endX - m,
|
2474
2475
|
startY: u.startY + p,
|
2475
2476
|
endY: u.endY - b
|
2476
|
-
}, w = I.endX - I.startX, _ = I.endY - I.startY, { cl: R } = l || {}, L = (ne = typeof R == "object" ? R == null ? void 0 : R.rgb : R) != null ? ne : "#000", N = Te(l != null ? l : void 0), { vt: E, ht: T } = l || {}, O = E != null ? E : de.MIDDLE, P = (oe = re(s)) != null ? oe : "", k = v.parseCellValue(P), H = v.getListWithColorMap(C), B =
|
2477
|
-
this._drawDownIcon(e, I, w, _, O), e.save(), e.translateWithPrecision(I.startX, I.startY), e.beginPath(), e.rect(0, 0, w - Ve, _), e.clip(), e.translateWithPrecision(
|
2477
|
+
}, w = I.endX - I.startX, _ = I.endY - I.startY, { cl: R } = l || {}, L = (ne = typeof R == "object" ? R == null ? void 0 : R.rgb : R) != null ? ne : "#000", N = Te(l != null ? l : void 0), { vt: E, ht: T } = l || {}, O = E != null ? E : de.MIDDLE, P = (oe = re(s)) != null ? oe : "", k = v.parseCellValue(P), H = v.getListWithColorMap(C), B = jt(k, N, w, _);
|
2478
|
+
this._drawDownIcon(e, I, w, _, O), e.save(), e.translateWithPrecision(I.startX, I.startY), e.beginPath(), e.rect(0, 0, w - Ve, _), e.clip(), e.translateWithPrecision(on, Ot);
|
2478
2479
|
let J = 0;
|
2479
2480
|
switch (O) {
|
2480
2481
|
case de.MIDDLE:
|
@@ -2507,7 +2508,7 @@ let on = class {
|
|
2507
2508
|
}), e.restore(), y.set(g, {
|
2508
2509
|
left: I.startX,
|
2509
2510
|
top: I.startY,
|
2510
|
-
width: B.contentWidth +
|
2511
|
+
width: B.contentWidth + on + Ve,
|
2511
2512
|
height: B.contentHeight + Ot * 2
|
2512
2513
|
});
|
2513
2514
|
}
|
@@ -2525,7 +2526,7 @@ let on = class {
|
|
2525
2526
|
if (!p)
|
2526
2527
|
return;
|
2527
2528
|
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w = re(n)) != null ? w : "", C = p.parseCellValue(g), v = Te(r != null ? r : void 0);
|
2528
|
-
return
|
2529
|
+
return jt(C, v, b, y).cellAutoHeight;
|
2529
2530
|
}
|
2530
2531
|
calcCellAutoWidth(e) {
|
2531
2532
|
var w;
|
@@ -2541,7 +2542,7 @@ let on = class {
|
|
2541
2542
|
if (!p)
|
2542
2543
|
return;
|
2543
2544
|
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w = re(n)) != null ? w : "", C = p.parseCellValue(g), v = Te(r != null ? r : void 0);
|
2544
|
-
return
|
2545
|
+
return jt(C, v, b, y).calcAutoWidth;
|
2545
2546
|
}
|
2546
2547
|
isHit(e, t) {
|
2547
2548
|
const { primaryWithCoord: r } = t, n = r.isMergedMainCell ? r.mergeInfo : r, { endX: i } = n, { x: o } = e;
|
@@ -2567,17 +2568,17 @@ let on = class {
|
|
2567
2568
|
return (n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null ? void 0 : n.setCursor(ze.DEFAULT);
|
2568
2569
|
}
|
2569
2570
|
};
|
2570
|
-
|
2571
|
+
an = Ho([
|
2571
2572
|
St(0, te),
|
2572
2573
|
St(1, ce),
|
2573
2574
|
St(2, M(xe)),
|
2574
2575
|
St(3, M(ie))
|
2575
|
-
],
|
2576
|
+
], an);
|
2576
2577
|
class jo extends Ce {
|
2577
2578
|
constructor() {
|
2578
2579
|
super(...arguments);
|
2579
2580
|
V(this, "id", j.LIST_MULTIPLE);
|
2580
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2581
|
+
V(this, "canvasRender", this.injector.createInstance(an));
|
2581
2582
|
V(this, "dropdownType", ve.MULTIPLE_LIST);
|
2582
2583
|
}
|
2583
2584
|
}
|
@@ -2586,7 +2587,7 @@ var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, r, n) => {
|
|
2586
2587
|
(a = e[o]) && (i = a(i) || i);
|
2587
2588
|
return i;
|
2588
2589
|
}, at = (e, t) => (r, n) => t(r, n, e);
|
2589
|
-
const De = 4, Ct = 4, ge = 14, xn = 1, _e = 6, Xe = 3,
|
2590
|
+
const De = 4, Ct = 4, ge = 14, xn = 1, _e = 6, Xe = 3, Yt = 8, Zo = "#565656", Bn = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
|
2590
2591
|
function Wn(e, t, r, n, i, o, a = !0) {
|
2591
2592
|
let l = 0;
|
2592
2593
|
const s = a ? Xe : 0;
|
@@ -2616,7 +2617,7 @@ function Wn(e, t, r, n, i, o, a = !0) {
|
|
2616
2617
|
paddingTop: l
|
2617
2618
|
};
|
2618
2619
|
}
|
2619
|
-
let
|
2620
|
+
let sn = class {
|
2620
2621
|
constructor(e, t, r, n, i) {
|
2621
2622
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2622
2623
|
V(this, "zIndex");
|
@@ -2707,7 +2708,7 @@ let an = class {
|
|
2707
2708
|
width: G,
|
2708
2709
|
height: q,
|
2709
2710
|
fill: (N == null ? void 0 : N.color) || Pe,
|
2710
|
-
radius:
|
2711
|
+
radius: Yt
|
2711
2712
|
}), e.save(), e.translateWithPrecision(De, xn), e.beginPath(), e.rect(0, 0, z, Q), e.clip(), e.translateWithPrecision(U, 0), Mn.drawWith(e, {
|
2712
2713
|
text: L,
|
2713
2714
|
fontStyle: k,
|
@@ -2777,11 +2778,11 @@ let an = class {
|
|
2777
2778
|
w = ge + _e * 2 + I + v;
|
2778
2779
|
break;
|
2779
2780
|
case se.CUSTOM:
|
2780
|
-
w = ge + _e * 2 + De * 2 + I + v +
|
2781
|
+
w = ge + _e * 2 + De * 2 + I + v + Yt / 2 + 1;
|
2781
2782
|
break;
|
2782
2783
|
// default is CUSTOM
|
2783
2784
|
default:
|
2784
|
-
w = ge + _e * 2 + De * 2 + I + v +
|
2785
|
+
w = ge + _e * 2 + De * 2 + I + v + Yt / 2 + 1;
|
2785
2786
|
}
|
2786
2787
|
const _ = p - w, R = new it(
|
2787
2788
|
y,
|
@@ -2819,21 +2820,21 @@ let an = class {
|
|
2819
2820
|
(n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(ze.DEFAULT);
|
2820
2821
|
}
|
2821
2822
|
};
|
2822
|
-
|
2823
|
+
sn = Xo([
|
2823
2824
|
at(0, ce),
|
2824
2825
|
at(1, M(ue)),
|
2825
2826
|
at(2, te),
|
2826
2827
|
at(3, M(xe)),
|
2827
2828
|
at(4, M(ie))
|
2828
|
-
],
|
2829
|
+
], sn);
|
2829
2830
|
class Ko extends Ce {
|
2830
2831
|
constructor() {
|
2831
2832
|
super(...arguments);
|
2832
2833
|
V(this, "id", j.LIST);
|
2833
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2834
|
+
V(this, "canvasRender", this.injector.createInstance(sn));
|
2834
2835
|
V(this, "dropdownType", ve.LIST);
|
2835
2836
|
V(this, "optionsInput", Dt.componentKey);
|
2836
|
-
V(this, "formulaInput",
|
2837
|
+
V(this, "formulaInput", hn);
|
2837
2838
|
}
|
2838
2839
|
}
|
2839
2840
|
class zo extends Ce {
|
@@ -2854,8 +2855,8 @@ var qo = Object.getOwnPropertyDescriptor, Jo = (e, t, r, n) => {
|
|
2854
2855
|
for (var i = n > 1 ? void 0 : n ? qo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2855
2856
|
(a = e[o]) && (i = a(i) || i);
|
2856
2857
|
return i;
|
2857
|
-
},
|
2858
|
-
let nt = class extends
|
2858
|
+
}, Xt = (e, t) => (r, n) => t(r, n, e);
|
2859
|
+
let nt = class extends dn {
|
2859
2860
|
constructor(e, t, r) {
|
2860
2861
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = r, this._initComponents(), this._registerValidatorViews();
|
2861
2862
|
}
|
@@ -2890,15 +2891,15 @@ let nt = class extends ln {
|
|
2890
2891
|
}
|
2891
2892
|
};
|
2892
2893
|
nt = Jo([
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2894
|
+
Xt(0, M(be)),
|
2895
|
+
Xt(1, M(vn)),
|
2896
|
+
Xt(2, M(Me))
|
2896
2897
|
], nt);
|
2897
2898
|
var Qo = Object.getOwnPropertyDescriptor, ea = (e, t, r, n) => {
|
2898
2899
|
for (var i = n > 1 ? void 0 : n ? Qo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2899
2900
|
(a = e[o]) && (i = a(i) || i);
|
2900
2901
|
return i;
|
2901
|
-
},
|
2902
|
+
}, Zt = (e, t) => (r, n) => t(r, n, e);
|
2902
2903
|
const ta = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2903
2904
|
var wt;
|
2904
2905
|
let Hn = (wt = class extends Zn {
|
@@ -2909,7 +2910,7 @@ let Hn = (wt = class extends Zn {
|
|
2909
2910
|
bt,
|
2910
2911
|
this._config
|
2911
2912
|
);
|
2912
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
2913
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(_n, o);
|
2913
2914
|
}
|
2914
2915
|
onStarting() {
|
2915
2916
|
[
|
@@ -2927,7 +2928,7 @@ let Hn = (wt = class extends Zn {
|
|
2927
2928
|
kt,
|
2928
2929
|
Lt,
|
2929
2930
|
_r,
|
2930
|
-
|
2931
|
+
Sn,
|
2931
2932
|
We,
|
2932
2933
|
mr
|
2933
2934
|
].forEach((e) => {
|
@@ -2948,15 +2949,15 @@ let Hn = (wt = class extends Zn {
|
|
2948
2949
|
}
|
2949
2950
|
}, V(wt, "pluginName", ta), V(wt, "type", X.UNIVER_SHEET), wt);
|
2950
2951
|
Hn = ea([
|
2951
|
-
|
2952
|
-
|
2953
|
-
|
2952
|
+
Zt(1, M(be)),
|
2953
|
+
Zt(2, te),
|
2954
|
+
Zt(3, ln)
|
2954
2955
|
], Hn);
|
2955
2956
|
var na = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, ia = (e, t, r) => t in e ? na(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, oa = (e, t, r, n) => {
|
2956
2957
|
for (var i = n > 1 ? void 0 : n ? ra(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2957
2958
|
(a = e[o]) && (i = a(i) || i);
|
2958
2959
|
return i;
|
2959
|
-
},
|
2960
|
+
}, Kt = (e, t) => (r, n) => t(r, n, e), Vr = (e, t, r) => ia(e, typeof t != "symbol" ? t + "" : t, r);
|
2960
2961
|
const aa = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2961
2962
|
let Tt = class extends Zn {
|
2962
2963
|
constructor(e = bt, t, r, n) {
|
@@ -2966,7 +2967,7 @@ let Tt = class extends Zn {
|
|
2966
2967
|
bt,
|
2967
2968
|
this._config
|
2968
2969
|
);
|
2969
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
2970
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(_n, o);
|
2970
2971
|
}
|
2971
2972
|
onStarting() {
|
2972
2973
|
[
|
@@ -2985,7 +2986,7 @@ let Tt = class extends Zn {
|
|
2985
2986
|
kt,
|
2986
2987
|
Lt,
|
2987
2988
|
_r,
|
2988
|
-
|
2989
|
+
Sn,
|
2989
2990
|
We,
|
2990
2991
|
mr
|
2991
2992
|
].forEach((e) => {
|
@@ -3009,9 +3010,9 @@ Vr(Tt, "pluginName", aa);
|
|
3009
3010
|
Vr(Tt, "type", X.UNIVER_SHEET);
|
3010
3011
|
Tt = oa([
|
3011
3012
|
jr(li),
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3013
|
+
Kt(1, M(be)),
|
3014
|
+
Kt(2, te),
|
3015
|
+
Kt(3, ln)
|
3015
3016
|
], Tt);
|
3016
3017
|
export {
|
3017
3018
|
Ce as BaseSheetDataValidatorView,
|