@univerjs/sheets-data-validation-ui 0.10.8 → 0.10.9
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 +2 -2
- package/lib/es/index.js +627 -627
- package/lib/index.js +627 -627
- package/lib/types/views/widgets/dropdown-widget.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +14 -14
package/lib/index.js
CHANGED
@@ -1,36 +1,36 @@
|
|
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
|
5
|
-
import { DeviceInputEventType as gt, IRenderManagerService as
|
6
|
-
import { SheetInterceptorService as
|
7
|
-
import { SheetDataValidationModel 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
|
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 ne, Injector as be, IConfigService as dn, 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 Gt, Optional as Ur, RxDisposable as cn, InterceptorEffectEnum as jn, sequenceExecute as Yn, bufferDebounceTime as Fr, debounce as xr, UndoCommand as Br, RedoCommand as Wr, isUnitRangesEqual as Hr, shallowEqual as yn, ThemeService as Xn, ColorKit as $r, isFormulaString as Ve, generateRandomId as bn, VerticalAlign as de, HorizontalAlign as Re, DEFAULT_STYLES as te, WrapStrategy as me, Plugin as Zn, merge as Kn, DependentOn as jr } from "@univerjs/core";
|
5
|
+
import { DeviceInputEventType as gt, IRenderManagerService as Fe, fixLineWidthByScale as Mn, Transform as Yr, CheckboxShape as Xr, getCurrentTypeOfRenderer as Ke, CURSOR_TYPE as ze, FontCache as Zr, Shape as Kr, Rect as zn, getFontStyleString as Oe, DocSimpleSkeleton as it, Text as En } from "@univerjs/engine-render";
|
6
|
+
import { SheetInterceptorService as un, VALIDATE_CELL as zr, SheetsSelectionsService as Gn, SetRangeValuesCommand as st, getSheetCommandTarget as qn, rangeToDiscreteRange as Gr, SheetPermissionCheckController as qr, WorksheetEditPermission as qt, WorksheetSetCellStylePermission as Jt, RangeProtectionPermissionEditPoint as Qt, WorkbookEditablePermission as en, INTERCEPTOR_POINT as Jn, InterceptCellContentPriority as Qn, checkRangesEditablePermission as Jr } from "@univerjs/sheets";
|
7
|
+
import { SheetDataValidationModel as oe, SheetsDataValidationValidatorService as Qr, getDataValidationCellValue as Ut, getCellValueOrigin as ie, serializeListOptions as er, createDefaultNewRule as tr, AddSheetDataValidationCommand as hn, DATA_VALIDATION_PLUGIN_NAME as nr, getDataValidationDiffMutations as tn, UpdateSheetDataValidationRangeCommand as rr, DataValidationCacheService as ir, UpdateSheetDataValidationSettingCommand as Dn, 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 pn, CHECKBOX_FORMULA_INPUT_NAME as sr, DataValidationFormulaService as ii, CHECKBOX_FORMULA_2 as oi, CHECKBOX_FORMULA_1 as ai, getFormulaResult as Ft, isLegalFormulaResult as Vn, transformCheckboxValue as si, UniverSheetsDataValidationPlugin as li } from "@univerjs/sheets-data-validation";
|
8
|
+
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as ve, DataValidationModel as gn, DataValidatorRegistryScope as di, TWO_FORMULA_OPERATOR_COUNT as ci, getRuleOptions as On, getRuleSetting as Tn } from "@univerjs/data-validation";
|
9
|
+
import { ISidebarService as lr, IDialogService as ui, IZenZoneService as dr, KeyCode as vt, MenuItemType as vn, getMenuHiddenObservable as hi, RibbonDataGroup as pi, IMenuManagerService as gi, useDependency as U, ComponentManager as fn, useObservable as Pe, useEvent as nn, useSidebarClick as cr } from "@univerjs/ui";
|
10
|
+
import { filter as mn, BehaviorSubject as Pn, 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
|
14
|
-
import { createElement as Ie, forwardRef as
|
15
|
-
import { jsxs as $, Fragment as ut, jsx 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 rn, getAutoFillRepeatRange as yi, ISheetClipboardService as bi, COPY_TYPE as An, PREDEFINED_HOOK_NAME as mt, getRepeatRange as Ln, 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 _n, Radio as Ae, Checkbox as At, Input as Le, Select as kn, clsx as Ne, borderClassName as yt, DraggableList as Di, Dropdown as Vi } from "@univerjs/design";
|
14
|
+
import { createElement as Ie, forwardRef as xe, useRef as pt, useState as W, useMemo as ct, useEffect as ke } from "react";
|
15
|
+
import { jsxs as $, Fragment as ut, jsx as C } from "react/jsx-runtime";
|
16
16
|
import { deserializeRangeWithSheet as Oi, serializeRange as vr } from "@univerjs/engine-formula";
|
17
17
|
import { RangeSelector as Ti, FormulaEditor as fr } from "@univerjs/sheets-formula-ui";
|
18
18
|
var Pi = Object.getOwnPropertyDescriptor, Ai = (e, t, r, n) => {
|
19
19
|
for (var i = n > 1 ? void 0 : n ? Pi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
20
20
|
(a = e[o]) && (i = a(i) || i);
|
21
21
|
return i;
|
22
|
-
},
|
23
|
-
let
|
22
|
+
}, Nn = (e, t) => (r, n) => t(r, n, e);
|
23
|
+
let _e = class extends ye {
|
24
24
|
constructor(t, r) {
|
25
25
|
super();
|
26
|
-
V(this, "_open$", new
|
26
|
+
V(this, "_open$", new Pn(!1));
|
27
27
|
V(this, "open$", this._open$.pipe(vi()));
|
28
28
|
V(this, "_activeRule");
|
29
|
-
V(this, "_activeRule$", new
|
29
|
+
V(this, "_activeRule$", new Pn(void 0));
|
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(mn((n) => !n)).subscribe(() => {
|
34
34
|
this.close();
|
35
35
|
})
|
36
36
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
@@ -65,16 +65,16 @@ let Se = class extends ye {
|
|
65
65
|
this._activeRule = t, this._activeRule$.next(t);
|
66
66
|
}
|
67
67
|
};
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
],
|
72
|
-
const
|
68
|
+
_e = Ai([
|
69
|
+
Nn(0, ce),
|
70
|
+
Nn(1, lr)
|
71
|
+
], _e);
|
72
|
+
const Te = "#ECECEC", Sn = "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);
|
76
76
|
return i;
|
77
|
-
},
|
77
|
+
}, He = (e, t) => (r, n) => t(r, n, e);
|
78
78
|
let qe = class extends ye {
|
79
79
|
constructor(e, t, r, n, i, o) {
|
80
80
|
super(), this._sheetInterceptorService = e, this._dataValidationModel = t, this._dataValidatorRegistryService = r, this._dialogService = n, this._localeService = i, this._sheetsDataValidationValidatorService = o, this._initEditorBridgeInterceptor();
|
@@ -144,12 +144,12 @@ let qe = class extends ye {
|
|
144
144
|
}
|
145
145
|
};
|
146
146
|
qe = ki([
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
147
|
+
He(0, M(un)),
|
148
|
+
He(1, M(oe)),
|
149
|
+
He(2, M(Me)),
|
150
|
+
He(3, ui),
|
151
|
+
He(4, M(ue)),
|
152
|
+
He(5, M(Qr))
|
153
153
|
], qe);
|
154
154
|
var Ni = Object.getOwnPropertyDescriptor, Ui = (e, t, r, n) => {
|
155
155
|
for (var i = n > 1 ? void 0 : n ? Ni(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
@@ -179,7 +179,7 @@ function Fi(e, t) {
|
|
179
179
|
return "HH:mm:ss";
|
180
180
|
}
|
181
181
|
}
|
182
|
-
let
|
182
|
+
let Ue = class extends ye {
|
183
183
|
constructor(t, r, n, i, o, a, l, s, d, u, h) {
|
184
184
|
super();
|
185
185
|
V(this, "_activeDropdown");
|
@@ -219,7 +219,7 @@ let Fe = class extends ye {
|
|
219
219
|
}
|
220
220
|
// eslint-disable-next-line max-lines-per-function, complexity
|
221
221
|
showDropdown(t) {
|
222
|
-
var b, y, g,
|
222
|
+
var b, y, g, v;
|
223
223
|
const { location: r } = t, { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = r;
|
224
224
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
225
225
|
return;
|
@@ -231,11 +231,11 @@ let Fe = class extends ye {
|
|
231
231
|
if (!(u != null && u.dropdownType))
|
232
232
|
return;
|
233
233
|
let h;
|
234
|
-
const c = async (
|
235
|
-
var O,
|
236
|
-
if (!
|
234
|
+
const c = async (f, I) => {
|
235
|
+
var O, A, k;
|
236
|
+
if (!f)
|
237
237
|
return !0;
|
238
|
-
const w =
|
238
|
+
const w = f, S = s.getCell(n, i), R = w.format(I === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), P = (O = $n.parseDate(R)) == null ? void 0 : O.v, N = I === "time" ? P % 1 : P, E = l.getStyles().getStyleByCell(S), T = (k = (A = E == null ? void 0 : E.n) == null ? void 0 : A.pattern) != null ? k : "";
|
239
239
|
return d.errorStyle !== lt.STOP || await u.validator({
|
240
240
|
value: N,
|
241
241
|
unitId: o,
|
@@ -274,16 +274,16 @@ let Fe = class extends ye {
|
|
274
274
|
keycode: vt.ESC
|
275
275
|
}), !0) : (this._injector.has(qe) && this._injector.get(qe).showReject(u.getRuleFinalError(d, { row: n, col: i, unitId: o, subUnitId: a })), !1);
|
276
276
|
};
|
277
|
-
let
|
277
|
+
let _;
|
278
278
|
switch (u.dropdownType) {
|
279
279
|
case ve.DATE: {
|
280
|
-
const
|
281
|
-
|
280
|
+
const f = ie(s.getCellRaw(n, i)), I = xt(f), w = !!((b = d.bizInfo) != null && b.showTime);
|
281
|
+
_ = {
|
282
282
|
location: r,
|
283
283
|
type: "datepicker",
|
284
284
|
props: {
|
285
285
|
showTime: w,
|
286
|
-
onChange: (
|
286
|
+
onChange: (S) => c(S, w ? "datetime" : "date"),
|
287
287
|
defaultValue: I,
|
288
288
|
patternType: "date"
|
289
289
|
}
|
@@ -291,8 +291,8 @@ let Fe = class extends ye {
|
|
291
291
|
break;
|
292
292
|
}
|
293
293
|
case ve.TIME: {
|
294
|
-
const
|
295
|
-
|
294
|
+
const f = ie(s.getCellRaw(n, i)), I = xt(f);
|
295
|
+
_ = {
|
296
296
|
location: r,
|
297
297
|
type: "datepicker",
|
298
298
|
props: {
|
@@ -304,8 +304,8 @@ let Fe = class extends ye {
|
|
304
304
|
break;
|
305
305
|
}
|
306
306
|
case ve.DATETIME: {
|
307
|
-
const
|
308
|
-
|
307
|
+
const f = ie(s.getCellRaw(n, i)), I = xt(f);
|
308
|
+
_ = {
|
309
309
|
location: r,
|
310
310
|
type: "datepicker",
|
311
311
|
props: {
|
@@ -318,7 +318,7 @@ let Fe = class extends ye {
|
|
318
318
|
}
|
319
319
|
case ve.LIST:
|
320
320
|
case ve.MULTIPLE_LIST: {
|
321
|
-
const
|
321
|
+
const f = u.dropdownType === ve.MULTIPLE_LIST, I = async (E) => {
|
322
322
|
const T = er(E), O = {
|
323
323
|
unitId: o,
|
324
324
|
subUnitId: a,
|
@@ -340,32 +340,32 @@ let Fe = class extends ye {
|
|
340
340
|
eventType: gt.Keyboard,
|
341
341
|
unitId: o,
|
342
342
|
keycode: vt.ESC
|
343
|
-
}), !
|
344
|
-
}, w = (d == null ? void 0 : d.renderMode) === se.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0,
|
345
|
-
this._commandService.executeCommand(
|
343
|
+
}), !f;
|
344
|
+
}, w = (d == null ? void 0 : d.renderMode) === se.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, S = u.getListWithColor(d, o, a), R = Ut(s.getCellRaw(n, i)), P = () => {
|
345
|
+
this._commandService.executeCommand(Be.id, {
|
346
346
|
ruleId: d.uid
|
347
347
|
}), h == null || h.dispose();
|
348
|
-
}, N =
|
348
|
+
}, N = S.map((E) => ({
|
349
349
|
label: E.label,
|
350
350
|
value: E.label,
|
351
|
-
color: w || E.color ? E.color ||
|
351
|
+
color: w || E.color ? E.color || Te : "transparent"
|
352
352
|
}));
|
353
|
-
|
353
|
+
_ = {
|
354
354
|
location: r,
|
355
355
|
type: "list",
|
356
356
|
props: {
|
357
357
|
onChange: (E) => I(E),
|
358
358
|
options: N,
|
359
|
-
onEdit:
|
359
|
+
onEdit: P,
|
360
360
|
defaultValue: R,
|
361
|
-
multiple:
|
362
|
-
showEdit: (g = (y = this._configService.getConfig(
|
361
|
+
multiple: f,
|
362
|
+
showEdit: (g = (y = this._configService.getConfig(Sn)) == null ? void 0 : y.showEditOnDropdown) != null ? g : !0
|
363
363
|
}
|
364
364
|
};
|
365
365
|
break;
|
366
366
|
}
|
367
367
|
case ve.CASCADE: {
|
368
|
-
|
368
|
+
_ = {
|
369
369
|
type: "cascader",
|
370
370
|
props: {
|
371
371
|
onChange: (I) => {
|
@@ -393,14 +393,14 @@ let Fe = class extends ye {
|
|
393
393
|
}), !0;
|
394
394
|
},
|
395
395
|
defaultValue: Ut(s.getCellRaw(n, i)).split("/"),
|
396
|
-
options: JSON.parse((
|
396
|
+
options: JSON.parse((v = d.formula1) != null ? v : "[]")
|
397
397
|
},
|
398
398
|
location: r
|
399
399
|
};
|
400
400
|
break;
|
401
401
|
}
|
402
402
|
case ve.COLOR: {
|
403
|
-
|
403
|
+
_ = {
|
404
404
|
type: "color",
|
405
405
|
props: {
|
406
406
|
onChange: (I) => {
|
@@ -437,7 +437,7 @@ let Fe = class extends ye {
|
|
437
437
|
throw new Error("[DataValidationDropdownManagerService]: unknown type!");
|
438
438
|
}
|
439
439
|
if (h = this._cellDropdownManagerService.showDropdown({
|
440
|
-
...
|
440
|
+
..._,
|
441
441
|
onHide: () => {
|
442
442
|
this._activeDropdown = null, this._activeDropdown$.next(null);
|
443
443
|
}
|
@@ -446,8 +446,8 @@ let Fe = class extends ye {
|
|
446
446
|
const p = new Lr();
|
447
447
|
p.add(h), p.add({
|
448
448
|
dispose: () => {
|
449
|
-
var
|
450
|
-
(I = (
|
449
|
+
var f, I;
|
450
|
+
(I = (f = this._activeDropdown) == null ? void 0 : f.onHide) == null || I.call(f);
|
451
451
|
}
|
452
452
|
}), this._currentPopup = p;
|
453
453
|
}
|
@@ -482,26 +482,26 @@ let Fe = class extends ye {
|
|
482
482
|
});
|
483
483
|
}
|
484
484
|
};
|
485
|
-
|
485
|
+
Ue = Ui([
|
486
486
|
pe(0, ce),
|
487
487
|
pe(1, M(Me)),
|
488
488
|
pe(2, dr),
|
489
|
-
pe(3, M(
|
489
|
+
pe(3, M(oe)),
|
490
490
|
pe(4, M(Gn)),
|
491
491
|
pe(5, M(Si)),
|
492
|
-
pe(6, M(
|
493
|
-
pe(7,
|
492
|
+
pe(6, M(oe)),
|
493
|
+
pe(7, ne),
|
494
494
|
pe(8, pr),
|
495
495
|
pe(9, M(be)),
|
496
|
-
pe(10,
|
497
|
-
],
|
498
|
-
const Mt = "DataValidationPanel",
|
496
|
+
pe(10, dn)
|
497
|
+
], Ue);
|
498
|
+
const Mt = "DataValidationPanel", Be = {
|
499
499
|
id: "data-validation.operation.open-validation-panel",
|
500
500
|
type: rt.OPERATION,
|
501
501
|
handler(e, t) {
|
502
502
|
if (!t)
|
503
503
|
return !1;
|
504
|
-
const { ruleId: r, isAdd: n } = t, i = e.get(
|
504
|
+
const { ruleId: r, isAdd: n } = t, i = e.get(_e), o = e.get(gn), a = e.get(ce), l = e.get(lr), s = qn(a);
|
505
505
|
if (!s) return !1;
|
506
506
|
const { unitId: d, subUnitId: u } = s, h = r ? o.getRuleById(d, u, r) : void 0;
|
507
507
|
i.open(), i.setActiveRule(h && {
|
@@ -518,18 +518,18 @@ const Mt = "DataValidationPanel", We = {
|
|
518
518
|
});
|
519
519
|
return i.setCloseDisposable(c), !0;
|
520
520
|
}
|
521
|
-
},
|
521
|
+
}, Cn = {
|
522
522
|
id: "data-validation.operation.close-validation-panel",
|
523
523
|
type: rt.OPERATION,
|
524
524
|
handler(e) {
|
525
|
-
return e.get(
|
525
|
+
return e.get(_e).close(), !0;
|
526
526
|
}
|
527
527
|
}, mr = {
|
528
528
|
id: "data-validation.operation.toggle-validation-panel",
|
529
529
|
type: rt.OPERATION,
|
530
530
|
handler(e) {
|
531
|
-
const t = e.get(
|
532
|
-
return r.open(), r.isOpen ? t.executeCommand(
|
531
|
+
const t = e.get(ne), r = e.get(_e);
|
532
|
+
return r.open(), r.isOpen ? t.executeCommand(Cn.id) : t.executeCommand(Be.id), !0;
|
533
533
|
}
|
534
534
|
}, Lt = {
|
535
535
|
type: rt.OPERATION,
|
@@ -537,7 +537,7 @@ const Mt = "DataValidationPanel", We = {
|
|
537
537
|
handler(e, t) {
|
538
538
|
if (!t)
|
539
539
|
return !1;
|
540
|
-
const r = e.get(
|
540
|
+
const r = e.get(Ue), { unitId: n, subUnitId: i, row: o, column: a } = t, l = r.activeDropdown, s = l == null ? void 0 : l.location;
|
541
541
|
return s && s.unitId === n && s.subUnitId === i && s.row === o && s.col === a || r.showDataValidationDropdown(
|
542
542
|
n,
|
543
543
|
i,
|
@@ -549,7 +549,7 @@ const Mt = "DataValidationPanel", We = {
|
|
549
549
|
type: rt.OPERATION,
|
550
550
|
id: "sheet.operation.hide-data-validation-dropdown",
|
551
551
|
handler(e, t) {
|
552
|
-
return t ? (e.get(
|
552
|
+
return t ? (e.get(Ue).hideDropdown(), !0) : !1;
|
553
553
|
}
|
554
554
|
}, kt = {
|
555
555
|
type: rt.COMMAND,
|
@@ -557,12 +557,12 @@ const Mt = "DataValidationPanel", We = {
|
|
557
557
|
handler(e) {
|
558
558
|
const t = e.get(ce), r = qn(t);
|
559
559
|
if (!r) return !1;
|
560
|
-
const { workbook: n, worksheet: i } = r, o = tr(e), a = e.get(
|
560
|
+
const { workbook: n, worksheet: i } = r, o = tr(e), a = e.get(ne), l = n.getUnitId(), s = i.getSheetId(), d = {
|
561
561
|
rule: o,
|
562
562
|
unitId: l,
|
563
563
|
subUnitId: s
|
564
564
|
};
|
565
|
-
return a.syncExecuteCommand(
|
565
|
+
return a.syncExecuteCommand(hn.id, d) ? (a.syncExecuteCommand(Be.id, {
|
566
566
|
ruleId: o.uid,
|
567
567
|
isAdd: !0
|
568
568
|
}), !0) : !1;
|
@@ -572,7 +572,7 @@ var xi = Object.getOwnPropertyDescriptor, Bi = (e, t, r, n) => {
|
|
572
572
|
for (var i = n > 1 ? void 0 : n ? xi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
573
573
|
(a = e[o]) && (i = a(i) || i);
|
574
574
|
return i;
|
575
|
-
},
|
575
|
+
}, $e = (e, t) => (r, n) => t(r, n, e);
|
576
576
|
const Ee = "SHEET_DATA_VALIDATION_ALERT";
|
577
577
|
let ht = class extends ye {
|
578
578
|
constructor(e, t, r, n, i, o) {
|
@@ -625,12 +625,12 @@ let ht = class extends ye {
|
|
625
625
|
}
|
626
626
|
};
|
627
627
|
ht = Bi([
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
628
|
+
$e(0, M(Ci)),
|
629
|
+
$e(1, M(wi)),
|
630
|
+
$e(2, ce),
|
631
|
+
$e(3, M(ue)),
|
632
|
+
$e(4, dr),
|
633
|
+
$e(5, M(oe))
|
634
634
|
], ht);
|
635
635
|
var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, r, n) => {
|
636
636
|
for (var i = n > 1 ? void 0 : n ? Wi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
@@ -644,12 +644,12 @@ let Je = class extends ye {
|
|
644
644
|
// eslint-disable-next-line max-lines-per-function
|
645
645
|
_initAutoFill() {
|
646
646
|
const e = () => ({ redos: [], undos: [] }), t = (n, i) => {
|
647
|
-
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 = rn([o, a]), [h, c] = u.ranges, { mapFunc: _ } = u, p = {
|
648
648
|
row: h.startRow,
|
649
649
|
col: h.startColumn
|
650
650
|
}, b = yi(h, c), y = new It(), g = /* @__PURE__ */ new Set();
|
651
|
-
b.forEach((
|
652
|
-
const R =
|
651
|
+
b.forEach((S) => {
|
652
|
+
const R = S.repeatStartCell, P = S.relativeRange, N = {
|
653
653
|
startRow: p.row,
|
654
654
|
startColumn: p.col,
|
655
655
|
endColumn: p.col,
|
@@ -660,8 +660,8 @@ let Je = class extends ye {
|
|
660
660
|
endColumn: R.col,
|
661
661
|
endRow: R.row
|
662
662
|
};
|
663
|
-
Nr.foreach(
|
664
|
-
const
|
663
|
+
Nr.foreach(P, (T, O) => {
|
664
|
+
const A = Rt.getPositionRange(
|
665
665
|
{
|
666
666
|
startRow: T,
|
667
667
|
startColumn: O,
|
@@ -669,7 +669,7 @@ let Je = class extends ye {
|
|
669
669
|
endRow: T
|
670
670
|
},
|
671
671
|
N
|
672
|
-
), { row: k, col: H } =
|
672
|
+
), { row: k, col: H } = _(A.startRow, A.startColumn), B = this._sheetDataValidationModel.getRuleIdByLocation(l, s, k, H) || "", J = Rt.getPositionRange(
|
673
673
|
{
|
674
674
|
startRow: T,
|
675
675
|
startColumn: O,
|
@@ -677,13 +677,13 @@ let Je = class extends ye {
|
|
677
677
|
endRow: T
|
678
678
|
},
|
679
679
|
E
|
680
|
-
), { row:
|
681
|
-
y.setValue(
|
680
|
+
), { row: re, col: ae } = _(J.startRow, J.startColumn);
|
681
|
+
y.setValue(re, ae, B), g.add(B);
|
682
682
|
});
|
683
683
|
});
|
684
|
-
const
|
685
|
-
d.addRangeRules(
|
686
|
-
const
|
684
|
+
const v = Array.from(g).map((S) => ({ id: S, ranges: Gt(y, (R) => R === S) }));
|
685
|
+
d.addRangeRules(v);
|
686
|
+
const f = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: I, undoMutations: w } = tn(l, s, f, this._injector, "patched", i === ot.ONLY_FORMAT);
|
687
687
|
return {
|
688
688
|
undos: w,
|
689
689
|
redos: I
|
@@ -710,7 +710,7 @@ let Je = class extends ye {
|
|
710
710
|
};
|
711
711
|
Je = Hi([
|
712
712
|
Bt(0, Ri),
|
713
|
-
Bt(1, M(
|
713
|
+
Bt(1, M(oe)),
|
714
714
|
Bt(2, M(be))
|
715
715
|
], Je);
|
716
716
|
var $i = Object.getOwnPropertyDescriptor, ji = (e, t, r, n) => {
|
@@ -729,7 +729,7 @@ let Qe = class extends ye {
|
|
729
729
|
id: nr,
|
730
730
|
onBeforeCopy: (t, r, n) => this._collect(t, r, n),
|
731
731
|
onPasteCells: (t, r, n, i) => {
|
732
|
-
const { copyType: o =
|
732
|
+
const { copyType: o = An.COPY, pasteType: a } = i, { range: l } = t || {}, { range: s, unitId: d, subUnitId: u } = r;
|
733
733
|
return this._generateMutations(s, { copyType: o, pasteType: a, copyRange: l, unitId: d, subUnitId: u });
|
734
734
|
}
|
735
735
|
});
|
@@ -756,7 +756,7 @@ let Qe = class extends ye {
|
|
756
756
|
_generateMutations(t, r) {
|
757
757
|
if (!this._copyInfo)
|
758
758
|
return { redos: [], undos: [] };
|
759
|
-
if (r.copyType ===
|
759
|
+
if (r.copyType === An.CUT)
|
760
760
|
return this._copyInfo = null, { redos: [], undos: [] };
|
761
761
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
|
762
762
|
return { redos: [], undos: [] };
|
@@ -769,30 +769,30 @@ let Qe = class extends ye {
|
|
769
769
|
return { redos: [], undos: [] };
|
770
770
|
const { unitId: i, subUnitId: o } = this._copyInfo;
|
771
771
|
if (r.unitId !== i || o !== r.subUnitId) {
|
772
|
-
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 } = rn([r.copyRange, t]), c = Ln(d, u, !0), _ = /* @__PURE__ */ new Map();
|
773
773
|
c.forEach(({ startRange: g }) => {
|
774
|
-
var
|
775
|
-
(
|
776
|
-
const
|
774
|
+
var v;
|
775
|
+
(v = this._copyInfo) == null || v.matrix.forValue((f, I, w) => {
|
776
|
+
const S = Rt.getPositionRange(
|
777
777
|
{
|
778
|
-
startRow:
|
779
|
-
endRow:
|
778
|
+
startRow: f,
|
779
|
+
endRow: f,
|
780
780
|
startColumn: I,
|
781
781
|
endColumn: I
|
782
782
|
},
|
783
783
|
g
|
784
|
-
), R = `${o}-${w}`,
|
785
|
-
!this._sheetDataValidationModel.getRuleById(r.unitId, r.subUnitId, R) &&
|
786
|
-
const { row: N, col: E } = h(
|
784
|
+
), R = `${o}-${w}`, P = this._sheetDataValidationModel.getRuleById(i, o, w);
|
785
|
+
!this._sheetDataValidationModel.getRuleById(r.unitId, r.subUnitId, R) && P && _.set(R, { ...P, uid: R });
|
786
|
+
const { row: N, col: E } = h(S.startRow, S.startColumn);
|
787
787
|
s.add(R), l.setValue(N, E, R);
|
788
788
|
});
|
789
789
|
});
|
790
|
-
const p = Array.from(s).map((g) => ({ id: g, ranges:
|
790
|
+
const p = Array.from(s).map((g) => ({ id: g, ranges: Gt(l, (v) => v === g) }));
|
791
791
|
a.addRangeRules(p);
|
792
|
-
const { redoMutations: b, undoMutations: y } =
|
792
|
+
const { redoMutations: b, undoMutations: y } = tn(
|
793
793
|
r.unitId,
|
794
794
|
r.subUnitId,
|
795
|
-
a.diffWithAddition(this._sheetDataValidationModel.getRules(r.unitId, r.subUnitId),
|
795
|
+
a.diffWithAddition(this._sheetDataValidationModel.getRules(r.unitId, r.subUnitId), _.values()),
|
796
796
|
this._injector,
|
797
797
|
"patched",
|
798
798
|
!1
|
@@ -802,25 +802,25 @@ let Qe = class extends ye {
|
|
802
802
|
undos: y
|
803
803
|
};
|
804
804
|
} else {
|
805
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } =
|
806
|
-
|
805
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } = rn([r.copyRange, t]);
|
806
|
+
Ln(d, u, !0).forEach(({ startRange: y }) => {
|
807
807
|
var g;
|
808
|
-
(g = this._copyInfo) == null || g.matrix.forValue((
|
808
|
+
(g = this._copyInfo) == null || g.matrix.forValue((v, f, I) => {
|
809
809
|
const w = Rt.getPositionRange(
|
810
810
|
{
|
811
|
-
startRow:
|
812
|
-
endRow:
|
813
|
-
startColumn:
|
814
|
-
endColumn:
|
811
|
+
startRow: v,
|
812
|
+
endRow: v,
|
813
|
+
startColumn: f,
|
814
|
+
endColumn: f
|
815
815
|
},
|
816
816
|
y
|
817
|
-
), { row:
|
818
|
-
l.setValue(
|
817
|
+
), { row: S, col: R } = h(w.startRow, w.startColumn);
|
818
|
+
l.setValue(S, R, I), s.add(I);
|
819
819
|
});
|
820
820
|
});
|
821
|
-
const
|
822
|
-
a.addRangeRules(
|
823
|
-
const { redoMutations: p, undoMutations: b } =
|
821
|
+
const _ = Array.from(s).map((y) => ({ id: y, ranges: Gt(l, (g) => g === y) }));
|
822
|
+
a.addRangeRules(_);
|
823
|
+
const { redoMutations: p, undoMutations: b } = tn(
|
824
824
|
i,
|
825
825
|
o,
|
826
826
|
a.diff(this._sheetDataValidationModel.getRules(i, o)),
|
@@ -837,7 +837,7 @@ let Qe = class extends ye {
|
|
837
837
|
};
|
838
838
|
Qe = ji([
|
839
839
|
Wt(0, bi),
|
840
|
-
Wt(1, M(
|
840
|
+
Wt(1, M(oe)),
|
841
841
|
Wt(2, M(be))
|
842
842
|
], Qe);
|
843
843
|
var Yi = Object.getOwnPropertyDescriptor, Xi = (e, t, r, n) => {
|
@@ -852,14 +852,14 @@ let et = class extends ye {
|
|
852
852
|
_commandExecutedListener() {
|
853
853
|
this.disposeWithMe(
|
854
854
|
this._commandService.beforeCommandExecuted((e) => {
|
855
|
-
e.id ===
|
856
|
-
workbookTypes: [
|
857
|
-
rangeTypes: [
|
858
|
-
worksheetTypes: [
|
855
|
+
e.id === hn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
856
|
+
workbookTypes: [en],
|
857
|
+
rangeTypes: [Qt],
|
858
|
+
worksheetTypes: [qt, Jt]
|
859
859
|
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === rr.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
860
|
-
workbookTypes: [
|
861
|
-
rangeTypes: [
|
862
|
-
worksheetTypes: [
|
860
|
+
workbookTypes: [en],
|
861
|
+
rangeTypes: [Qt],
|
862
|
+
worksheetTypes: [qt, Jt]
|
863
863
|
}, e.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
864
864
|
})
|
865
865
|
);
|
@@ -867,32 +867,32 @@ let et = class extends ye {
|
|
867
867
|
};
|
868
868
|
et = Xi([
|
869
869
|
Ht(0, M(ue)),
|
870
|
-
Ht(1,
|
870
|
+
Ht(1, ne),
|
871
871
|
Ht(2, M(qr))
|
872
872
|
], et);
|
873
873
|
const Sr = "sheet.menu.data-validation";
|
874
874
|
function Zi(e) {
|
875
875
|
return {
|
876
876
|
id: Sr,
|
877
|
-
type:
|
877
|
+
type: vn.SUBITEMS,
|
878
878
|
icon: "DataValidationIcon",
|
879
879
|
tooltip: "dataValidation.title",
|
880
880
|
hidden$: hi(e, X.UNIVER_SHEET),
|
881
|
-
disabled$: Mi(e, { workbookTypes: [
|
881
|
+
disabled$: Mi(e, { workbookTypes: [en], worksheetTypes: [Jt, qt], rangeTypes: [Qt] })
|
882
882
|
};
|
883
883
|
}
|
884
884
|
function Ki(e) {
|
885
885
|
return {
|
886
|
-
id:
|
886
|
+
id: Be.id,
|
887
887
|
title: "dataValidation.panel.title",
|
888
|
-
type:
|
888
|
+
type: vn.BUTTON
|
889
889
|
};
|
890
890
|
}
|
891
891
|
function zi(e) {
|
892
892
|
return {
|
893
893
|
id: kt.id,
|
894
894
|
title: "dataValidation.panel.add",
|
895
|
-
type:
|
895
|
+
type: vn.BUTTON
|
896
896
|
};
|
897
897
|
}
|
898
898
|
const Gi = {
|
@@ -900,7 +900,7 @@ const Gi = {
|
|
900
900
|
[Sr]: {
|
901
901
|
order: 0,
|
902
902
|
menuItemFactory: Zi,
|
903
|
-
[
|
903
|
+
[Be.id]: {
|
904
904
|
order: 0,
|
905
905
|
menuItemFactory: Ki
|
906
906
|
},
|
@@ -922,7 +922,7 @@ const wr = {
|
|
922
922
|
color: "#fe4b4b"
|
923
923
|
}
|
924
924
|
};
|
925
|
-
let tt = class extends
|
925
|
+
let tt = class extends cn {
|
926
926
|
constructor(e, t, r, n, i, o, a, l, s, d, u) {
|
927
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();
|
928
928
|
}
|
@@ -980,52 +980,52 @@ let tt = class extends dn {
|
|
980
980
|
priority: Qn.DATA_VALIDATION,
|
981
981
|
// eslint-disable-next-line max-lines-per-function, complexity
|
982
982
|
handler: (e, t, r) => {
|
983
|
-
var g,
|
983
|
+
var g, v, f, I, w;
|
984
984
|
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(o, a, n, i);
|
985
985
|
if (!d)
|
986
986
|
return r(e);
|
987
987
|
const u = this._sheetDataValidationModel.getRuleById(o, a, d);
|
988
988
|
if (!u)
|
989
989
|
return r(e);
|
990
|
-
const h = (g = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? g : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type),
|
990
|
+
const h = (g = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? g : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), _ = t.rawData;
|
991
991
|
let p;
|
992
992
|
const b = {
|
993
993
|
get value() {
|
994
|
-
var
|
995
|
-
return p !== void 0 || (p = (
|
994
|
+
var S;
|
995
|
+
return p !== void 0 || (p = (S = ie(_)) != null ? S : null), p;
|
996
996
|
}
|
997
997
|
}, y = {
|
998
998
|
get value() {
|
999
|
-
var
|
1000
|
-
return `${(
|
999
|
+
var S;
|
1000
|
+
return `${(S = b.value) != null ? S : ""}`;
|
1001
1001
|
}
|
1002
1002
|
};
|
1003
1003
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
1004
1004
|
...e == null ? void 0 : e.markers,
|
1005
1005
|
...h === Ze.INVALID ? wr : null
|
1006
1006
|
}, e.customRender = [
|
1007
|
-
...(
|
1007
|
+
...(v = e == null ? void 0 : e.customRender) != null ? v : [],
|
1008
1008
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
1009
1009
|
], e.fontRenderExtension = {
|
1010
1010
|
...e == null ? void 0 : e.fontRenderExtension,
|
1011
|
-
isSkip: ((
|
1011
|
+
isSkip: ((f = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : f.isSkip) || ((I = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : I.call(c, u, b.value, t))
|
1012
1012
|
}, e.interceptorStyle = {
|
1013
1013
|
...e == null ? void 0 : e.interceptorStyle,
|
1014
1014
|
...c == null ? void 0 : c.getExtraStyle(u, y.value, {
|
1015
1015
|
get style() {
|
1016
|
-
const
|
1017
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
1016
|
+
const S = l.getStyles();
|
1017
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? S.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
1018
1018
|
}
|
1019
1019
|
}, n, i)
|
1020
1020
|
}, e.interceptorAutoHeight = () => {
|
1021
|
-
var N, E, T, O,
|
1022
|
-
const
|
1023
|
-
if (!
|
1021
|
+
var N, E, T, O, A, k;
|
1022
|
+
const S = (E = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(dt).getSkeletonParam(a)) == null ? void 0 : E.skeleton;
|
1023
|
+
if (!S)
|
1024
1024
|
return;
|
1025
|
-
const R =
|
1025
|
+
const R = S.worksheet.getMergedCell(n, i), P = {
|
1026
1026
|
data: e,
|
1027
|
-
style:
|
1028
|
-
primaryWithCoord:
|
1027
|
+
style: S.getStyles().getStyleByCell(e),
|
1028
|
+
primaryWithCoord: S.getCellWithCoordByIndex((T = R == null ? void 0 : R.startRow) != null ? T : n, (O = R == null ? void 0 : R.startColumn) != null ? O : i),
|
1029
1029
|
unitId: o,
|
1030
1030
|
subUnitId: a,
|
1031
1031
|
row: n,
|
@@ -1033,16 +1033,16 @@ let tt = class extends dn {
|
|
1033
1033
|
workbook: l,
|
1034
1034
|
worksheet: s
|
1035
1035
|
};
|
1036
|
-
return (k = (
|
1036
|
+
return (k = (A = c == null ? void 0 : c.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : k.call(A, P);
|
1037
1037
|
}, e.interceptorAutoWidth = () => {
|
1038
|
-
var N, E, T, O,
|
1039
|
-
const
|
1040
|
-
if (!
|
1038
|
+
var N, E, T, O, A, k;
|
1039
|
+
const S = (E = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(dt).getSkeletonParam(a)) == null ? void 0 : E.skeleton;
|
1040
|
+
if (!S)
|
1041
1041
|
return;
|
1042
|
-
const R =
|
1042
|
+
const R = S.worksheet.getMergedCell(n, i), P = {
|
1043
1043
|
data: e,
|
1044
|
-
style:
|
1045
|
-
primaryWithCoord:
|
1044
|
+
style: S.getStyles().getStyleByCell(e),
|
1045
|
+
primaryWithCoord: S.getCellWithCoordByIndex((T = R == null ? void 0 : R.startRow) != null ? T : n, (O = R == null ? void 0 : R.startColumn) != null ? O : i),
|
1046
1046
|
unitId: o,
|
1047
1047
|
subUnitId: a,
|
1048
1048
|
row: n,
|
@@ -1050,7 +1050,7 @@ let tt = class extends dn {
|
|
1050
1050
|
workbook: l,
|
1051
1051
|
worksheet: s
|
1052
1052
|
};
|
1053
|
-
return (k = (
|
1053
|
+
return (k = (A = c == null ? void 0 : c.canvasRender) == null ? void 0 : A.calcCellAutoWidth) == null ? void 0 : k.call(A, P);
|
1054
1054
|
}, e.coverable = ((w = e == null ? void 0 : e.coverable) != null ? w : !0) && !(u.type === j.LIST || u.type === j.LIST_MULTIPLE), r(e);
|
1055
1055
|
}
|
1056
1056
|
}
|
@@ -1061,7 +1061,7 @@ let tt = class extends dn {
|
|
1061
1061
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1062
1062
|
// patched data-validation change don't need to re-calc row height
|
1063
1063
|
// re-calc of row height will be triggered precisely by the origin command
|
1064
|
-
|
1064
|
+
mn((e) => e.source === "command"),
|
1065
1065
|
hr(100)
|
1066
1066
|
).subscribe((e) => {
|
1067
1067
|
if (e.length === 0)
|
@@ -1078,19 +1078,19 @@ let tt = class extends dn {
|
|
1078
1078
|
}
|
1079
1079
|
};
|
1080
1080
|
tt = Cr([
|
1081
|
-
K(0,
|
1081
|
+
K(0, ne),
|
1082
1082
|
K(1, gi),
|
1083
|
-
K(2,
|
1083
|
+
K(2, Fe),
|
1084
1084
|
K(3, ce),
|
1085
1085
|
K(4, M(gr)),
|
1086
|
-
K(5, M(
|
1087
|
-
K(6, M(
|
1086
|
+
K(5, M(Ue)),
|
1087
|
+
K(6, M(oe)),
|
1088
1088
|
K(7, M(Me)),
|
1089
|
-
K(8, M(
|
1089
|
+
K(8, M(un)),
|
1090
1090
|
K(9, M(ir)),
|
1091
1091
|
K(10, Ur(pr))
|
1092
1092
|
], tt);
|
1093
|
-
let
|
1093
|
+
let Un = class extends cn {
|
1094
1094
|
constructor(e, t, r, n, i, o, a) {
|
1095
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();
|
1096
1096
|
}
|
@@ -1105,14 +1105,14 @@ let Nn = class extends dn {
|
|
1105
1105
|
priority: Qn.DATA_VALIDATION,
|
1106
1106
|
// eslint-disable-next-line complexity, max-lines-per-function
|
1107
1107
|
handler: (e, t, r) => {
|
1108
|
-
var y, g,
|
1108
|
+
var y, g, v, f, I;
|
1109
1109
|
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(o, a, n, i);
|
1110
1110
|
if (!d)
|
1111
1111
|
return r(e);
|
1112
1112
|
const u = this._sheetDataValidationModel.getRuleById(o, a, d);
|
1113
1113
|
if (!u)
|
1114
1114
|
return r(e);
|
1115
|
-
const h = (y = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? y : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type),
|
1115
|
+
const h = (y = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? y : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), _ = s.getCellRaw(n, i), p = ie(_), b = `${p != null ? p : ""}`;
|
1116
1116
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
1117
1117
|
...e == null ? void 0 : e.markers,
|
1118
1118
|
...h === Ze.INVALID ? wr : null
|
@@ -1121,7 +1121,7 @@ let Nn = class extends dn {
|
|
1121
1121
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
1122
1122
|
], e.fontRenderExtension = {
|
1123
1123
|
...e == null ? void 0 : e.fontRenderExtension,
|
1124
|
-
isSkip: ((
|
1124
|
+
isSkip: ((v = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : v.isSkip) || ((f = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : f.call(c, u, p, t))
|
1125
1125
|
}, e.interceptorStyle = {
|
1126
1126
|
...e == null ? void 0 : e.interceptorStyle,
|
1127
1127
|
...c == null ? void 0 : c.getExtraStyle(u, b, {
|
@@ -1131,14 +1131,14 @@ let Nn = class extends dn {
|
|
1131
1131
|
}
|
1132
1132
|
}, n, i)
|
1133
1133
|
}, e.interceptorAutoHeight = () => {
|
1134
|
-
var
|
1135
|
-
const w = (N = (
|
1134
|
+
var P, N, E, T, O, A;
|
1135
|
+
const w = (N = (P = this._renderManagerService.getRenderById(o)) == null ? void 0 : P.with(dt).getSkeletonParam(a)) == null ? void 0 : N.skeleton;
|
1136
1136
|
if (!w)
|
1137
1137
|
return;
|
1138
|
-
const
|
1138
|
+
const S = w.worksheet.getMergedCell(n, i), R = {
|
1139
1139
|
data: e,
|
1140
1140
|
style: w.getStyles().getStyleByCell(e),
|
1141
|
-
primaryWithCoord: w.getCellWithCoordByIndex((E =
|
1141
|
+
primaryWithCoord: w.getCellWithCoordByIndex((E = S == null ? void 0 : S.startRow) != null ? E : n, (T = S == null ? void 0 : S.startColumn) != null ? T : i),
|
1142
1142
|
unitId: o,
|
1143
1143
|
subUnitId: a,
|
1144
1144
|
row: n,
|
@@ -1146,16 +1146,16 @@ let Nn = class extends dn {
|
|
1146
1146
|
workbook: l,
|
1147
1147
|
worksheet: s
|
1148
1148
|
};
|
1149
|
-
return (
|
1149
|
+
return (A = (O = c == null ? void 0 : c.canvasRender) == null ? void 0 : O.calcCellAutoHeight) == null ? void 0 : A.call(O, R);
|
1150
1150
|
}, e.interceptorAutoWidth = () => {
|
1151
|
-
var
|
1152
|
-
const w = (N = (
|
1151
|
+
var P, N, E, T, O, A;
|
1152
|
+
const w = (N = (P = this._renderManagerService.getRenderById(o)) == null ? void 0 : P.with(dt).getSkeletonParam(a)) == null ? void 0 : N.skeleton;
|
1153
1153
|
if (!w)
|
1154
1154
|
return;
|
1155
|
-
const
|
1155
|
+
const S = w.worksheet.getMergedCell(n, i), R = {
|
1156
1156
|
data: e,
|
1157
1157
|
style: w.getStyles().getStyleByCell(e),
|
1158
|
-
primaryWithCoord: w.getCellWithCoordByIndex((E =
|
1158
|
+
primaryWithCoord: w.getCellWithCoordByIndex((E = S == null ? void 0 : S.startRow) != null ? E : n, (T = S == null ? void 0 : S.startColumn) != null ? T : i),
|
1159
1159
|
unitId: o,
|
1160
1160
|
subUnitId: a,
|
1161
1161
|
row: n,
|
@@ -1163,7 +1163,7 @@ let Nn = class extends dn {
|
|
1163
1163
|
workbook: l,
|
1164
1164
|
worksheet: s
|
1165
1165
|
};
|
1166
|
-
return (
|
1166
|
+
return (A = (O = c == null ? void 0 : c.canvasRender) == null ? void 0 : O.calcCellAutoWidth) == null ? void 0 : A.call(O, R);
|
1167
1167
|
}, e.coverable = ((I = e == null ? void 0 : e.coverable) != null ? I : !0) && !(u.type === j.LIST || u.type === j.LIST_MULTIPLE), r(e);
|
1168
1168
|
}
|
1169
1169
|
}
|
@@ -1172,7 +1172,7 @@ let Nn = class extends dn {
|
|
1172
1172
|
}
|
1173
1173
|
_initAutoHeight() {
|
1174
1174
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1175
|
-
|
1175
|
+
mn((e) => e.source === "command"),
|
1176
1176
|
hr(16)
|
1177
1177
|
).subscribe((e) => {
|
1178
1178
|
const t = [];
|
@@ -1186,20 +1186,20 @@ let Nn = class extends dn {
|
|
1186
1186
|
});
|
1187
1187
|
}
|
1188
1188
|
};
|
1189
|
-
|
1190
|
-
K(0,
|
1191
|
-
K(1,
|
1189
|
+
Un = Cr([
|
1190
|
+
K(0, ne),
|
1191
|
+
K(1, Fe),
|
1192
1192
|
K(2, M(gr)),
|
1193
1193
|
K(3, M(Me)),
|
1194
|
-
K(4, M(
|
1195
|
-
K(5, M(
|
1194
|
+
K(4, M(un)),
|
1195
|
+
K(5, M(oe)),
|
1196
1196
|
K(6, M(ir))
|
1197
|
-
],
|
1197
|
+
], Un);
|
1198
1198
|
var Ji = Object.getOwnPropertyDescriptor, Qi = (e, t, r, n) => {
|
1199
1199
|
for (var i = n > 1 ? void 0 : n ? Ji(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1200
1200
|
(a = e[o]) && (i = a(i) || i);
|
1201
1201
|
return i;
|
1202
|
-
},
|
1202
|
+
}, Fn = (e, t) => (r, n) => t(r, n, e);
|
1203
1203
|
let Et = class extends ye {
|
1204
1204
|
constructor(e, t, r) {
|
1205
1205
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = r, this._initSkeletonChange();
|
@@ -1221,8 +1221,8 @@ let Et = class extends ye {
|
|
1221
1221
|
}
|
1222
1222
|
};
|
1223
1223
|
Et = Qi([
|
1224
|
-
|
1225
|
-
|
1224
|
+
Fn(1, M(oe)),
|
1225
|
+
Fn(2, M(dt))
|
1226
1226
|
], Et);
|
1227
1227
|
var le = function() {
|
1228
1228
|
return le = Object.assign || function(e) {
|
@@ -1239,7 +1239,7 @@ var le = function() {
|
|
1239
1239
|
for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
|
1240
1240
|
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
|
1241
1241
|
return r;
|
1242
|
-
},
|
1242
|
+
}, We = xe(function(e, t) {
|
1243
1243
|
var r = e.icon, n = e.id, i = e.className, o = e.extend, a = eo(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), s = pt("_".concat(ro()));
|
1244
1244
|
return Ir(r, "".concat(n), { defIds: r.defIds, idSuffix: s.current }, le({ ref: t, className: l }, a), o);
|
1245
1245
|
});
|
@@ -1269,49 +1269,49 @@ function no(e, t) {
|
|
1269
1269
|
function ro() {
|
1270
1270
|
return Math.random().toString(36).substring(2, 8);
|
1271
1271
|
}
|
1272
|
-
|
1273
|
-
var io = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.4917 3.07803C1.4917 2.19437 2.20804 1.47803 3.0917 1.47803H5.6917C6.57536 1.47803 7.2917 2.19437 7.2917 3.07803V5.67803C7.2917 6.56168 6.57535 7.27803 5.6917 7.27803H3.0917C2.20804 7.27803 1.4917 6.56168 1.4917 5.67803V3.07803ZM3.0917 2.67803C2.87078 2.67803 2.6917 2.85711 2.6917 3.07803V5.67803C2.6917 5.89894 2.87079 6.07803 3.0917 6.07803H5.6917C5.91261 6.07803 6.0917 5.89894 6.0917 5.67803V3.07803C6.0917 2.85711 5.91261 2.67803 5.6917 2.67803H3.0917Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.6175 2.45279C14.8518 2.68711 14.8518 3.06701 14.6175 3.30132L11.6151 6.30365C11.3957 6.52307 11.0451 6.53897 10.8067 6.34031L8.80915 4.67566C8.55458 4.46352 8.52019 4.08518 8.73233 3.83062C8.94447 3.57605 9.32281 3.54166 9.57737 3.7538L11.154 5.06767L13.769 2.45278C14.0033 2.21847 14.3832 2.21848 14.6175 2.45279Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.1175 9.19746C14.3518 9.43178 14.3518 9.81168 14.1175 10.046L12.5418 11.6217L14.1175 13.1975C14.3518 13.4318 14.3518 13.8117 14.1175 14.046C13.8832 14.2803 13.5033 14.2803 13.269 14.046L11.6933 12.4703L10.1175 14.046C9.88321 14.2803 9.50331 14.2803 9.269 14.046C9.03468 13.8117 9.03468 13.4318 9.269 13.1975L10.8447 11.6217L9.269 10.046C9.03468 9.81168 9.03468 9.43178 9.269 9.19746C9.50331 8.96315 9.88321 8.96315 10.1175 9.19746L11.6933 10.7732L13.269 9.19746C13.5033 8.96315 13.8832 8.96315 14.1175 9.19746Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.0917 8.72168C2.20804 8.72168 1.4917 9.43802 1.4917 10.3217V12.9217C1.4917 13.8053 2.20804 14.5217 3.0917 14.5217H5.6917C6.57535 14.5217 7.2917 13.8053 7.2917 12.9217V10.3217C7.2917 9.43802 6.57536 8.72168 5.6917 8.72168H3.0917ZM2.6917 10.3217C2.6917 10.1008 2.87078 9.92168 3.0917 9.92168H5.6917C5.91261 9.92168 6.0917 10.1008 6.0917 10.3217V12.9217C6.0917 13.1426 5.91261 13.3217 5.6917 13.3217H3.0917C2.87079 13.3217 2.6917 13.1426 2.6917 12.9217V10.3217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr =
|
1274
|
-
return Ie(
|
1272
|
+
We.displayName = "UniverIcon";
|
1273
|
+
var io = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.4917 3.07803C1.4917 2.19437 2.20804 1.47803 3.0917 1.47803H5.6917C6.57536 1.47803 7.2917 2.19437 7.2917 3.07803V5.67803C7.2917 6.56168 6.57535 7.27803 5.6917 7.27803H3.0917C2.20804 7.27803 1.4917 6.56168 1.4917 5.67803V3.07803ZM3.0917 2.67803C2.87078 2.67803 2.6917 2.85711 2.6917 3.07803V5.67803C2.6917 5.89894 2.87079 6.07803 3.0917 6.07803H5.6917C5.91261 6.07803 6.0917 5.89894 6.0917 5.67803V3.07803C6.0917 2.85711 5.91261 2.67803 5.6917 2.67803H3.0917Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.6175 2.45279C14.8518 2.68711 14.8518 3.06701 14.6175 3.30132L11.6151 6.30365C11.3957 6.52307 11.0451 6.53897 10.8067 6.34031L8.80915 4.67566C8.55458 4.46352 8.52019 4.08518 8.73233 3.83062C8.94447 3.57605 9.32281 3.54166 9.57737 3.7538L11.154 5.06767L13.769 2.45278C14.0033 2.21847 14.3832 2.21848 14.6175 2.45279Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.1175 9.19746C14.3518 9.43178 14.3518 9.81168 14.1175 10.046L12.5418 11.6217L14.1175 13.1975C14.3518 13.4318 14.3518 13.8117 14.1175 14.046C13.8832 14.2803 13.5033 14.2803 13.269 14.046L11.6933 12.4703L10.1175 14.046C9.88321 14.2803 9.50331 14.2803 9.269 14.046C9.03468 13.8117 9.03468 13.4318 9.269 13.1975L10.8447 11.6217L9.269 10.046C9.03468 9.81168 9.03468 9.43178 9.269 9.19746C9.50331 8.96315 9.88321 8.96315 10.1175 9.19746L11.6933 10.7732L13.269 9.19746C13.5033 8.96315 13.8832 8.96315 14.1175 9.19746Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.0917 8.72168C2.20804 8.72168 1.4917 9.43802 1.4917 10.3217V12.9217C1.4917 13.8053 2.20804 14.5217 3.0917 14.5217H5.6917C6.57535 14.5217 7.2917 13.8053 7.2917 12.9217V10.3217C7.2917 9.43802 6.57536 8.72168 5.6917 8.72168H3.0917ZM2.6917 10.3217C2.6917 10.1008 2.87078 9.92168 3.0917 9.92168H5.6917C5.91261 9.92168 6.0917 10.1008 6.0917 10.3217V12.9217C6.0917 13.1426 5.91261 13.3217 5.6917 13.3217H3.0917C2.87079 13.3217 2.6917 13.1426 2.6917 12.9217V10.3217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr = xe(function(e, t) {
|
1274
|
+
return Ie(We, Object.assign({}, e, {
|
1275
1275
|
id: "data-validation-icon",
|
1276
1276
|
ref: t,
|
1277
1277
|
icon: io
|
1278
1278
|
}));
|
1279
1279
|
});
|
1280
1280
|
Rr.displayName = "DataValidationIcon";
|
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" } }] },
|
1282
|
-
return Ie(
|
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" } }] }, wn = xe(function(e, t) {
|
1282
|
+
return Ie(We, Object.assign({}, e, {
|
1283
1283
|
id: "delete-icon",
|
1284
1284
|
ref: t,
|
1285
1285
|
icon: oo
|
1286
1286
|
}));
|
1287
1287
|
});
|
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 =
|
1290
|
-
return Ie(
|
1288
|
+
wn.displayName = "DeleteIcon";
|
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 = xe(function(e, t) {
|
1290
|
+
return Ie(We, Object.assign({}, e, {
|
1291
1291
|
id: "increase-icon",
|
1292
1292
|
ref: t,
|
1293
1293
|
icon: ao
|
1294
1294
|
}));
|
1295
1295
|
});
|
1296
1296
|
yr.displayName = "IncreaseIcon";
|
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" } }] },
|
1298
|
-
return Ie(
|
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" } }] }, In = xe(function(e, t) {
|
1298
|
+
return Ie(We, Object.assign({}, e, {
|
1299
1299
|
id: "more-down-icon",
|
1300
1300
|
ref: t,
|
1301
1301
|
icon: so
|
1302
1302
|
}));
|
1303
1303
|
});
|
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 =
|
1306
|
-
return Ie(
|
1304
|
+
In.displayName = "MoreDownIcon";
|
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 = xe(function(e, t) {
|
1306
|
+
return Ie(We, Object.assign({}, e, {
|
1307
1307
|
id: "more-up-icon",
|
1308
1308
|
ref: t,
|
1309
1309
|
icon: lo
|
1310
1310
|
}));
|
1311
1311
|
});
|
1312
1312
|
br.displayName = "MoreUpIcon";
|
1313
|
-
var co = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z" } }, { tag: "path", attrs: { d: "M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z" } }, { tag: "path", attrs: { d: "M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z" } }, { tag: "path", attrs: { d: "M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z" } }, { tag: "path", attrs: { d: "M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z" } }, { tag: "path", attrs: { d: "M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z" } }] }] }, Mr =
|
1314
|
-
return Ie(
|
1313
|
+
var co = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z" } }, { tag: "path", attrs: { d: "M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z" } }, { tag: "path", attrs: { d: "M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z" } }, { tag: "path", attrs: { d: "M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z" } }, { tag: "path", attrs: { d: "M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z" } }, { tag: "path", attrs: { d: "M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z" } }] }] }, Mr = xe(function(e, t) {
|
1314
|
+
return Ie(We, Object.assign({}, e, {
|
1315
1315
|
id: "sequence-icon",
|
1316
1316
|
ref: t,
|
1317
1317
|
icon: co
|
@@ -1320,7 +1320,7 @@ var co = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
1320
1320
|
Mr.displayName = "SequenceIcon";
|
1321
1321
|
function uo(e) {
|
1322
1322
|
var d;
|
1323
|
-
const t =
|
1323
|
+
const t = U(ue), r = U(fn), { value: n, onChange: i, extraComponent: o } = e, [a, l] = W(!1), s = o ? r.get(o) : null;
|
1324
1324
|
return /* @__PURE__ */ $(ut, { children: [
|
1325
1325
|
/* @__PURE__ */ $(
|
1326
1326
|
"div",
|
@@ -1329,34 +1329,34 @@ function uo(e) {
|
|
1329
1329
|
onClick: () => l(!a),
|
1330
1330
|
children: [
|
1331
1331
|
t.t("dataValidation.panel.options"),
|
1332
|
-
a ? /* @__PURE__ */
|
1332
|
+
a ? /* @__PURE__ */ C(br, { className: "univer-ml-1" }) : /* @__PURE__ */ C(In, { className: "univer-ml-1" })
|
1333
1333
|
]
|
1334
1334
|
}
|
1335
1335
|
),
|
1336
1336
|
a && /* @__PURE__ */ $(ut, { children: [
|
1337
|
-
s ? /* @__PURE__ */
|
1338
|
-
/* @__PURE__ */
|
1337
|
+
s ? /* @__PURE__ */ C(s, { value: n, onChange: i }) : null,
|
1338
|
+
/* @__PURE__ */ C(
|
1339
1339
|
Y,
|
1340
1340
|
{
|
1341
1341
|
label: t.t("dataValidation.panel.invalid"),
|
1342
1342
|
children: /* @__PURE__ */ $(
|
1343
|
-
|
1343
|
+
_n,
|
1344
1344
|
{
|
1345
1345
|
value: `${(d = n.errorStyle) != null ? d : lt.WARNING}`,
|
1346
1346
|
onChange: (u) => i({ ...n, errorStyle: +u }),
|
1347
1347
|
children: [
|
1348
|
-
/* @__PURE__ */
|
1349
|
-
/* @__PURE__ */
|
1348
|
+
/* @__PURE__ */ C(Ae, { value: `${lt.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
1349
|
+
/* @__PURE__ */ C(Ae, { value: `${lt.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
|
1350
1350
|
]
|
1351
1351
|
}
|
1352
1352
|
)
|
1353
1353
|
}
|
1354
1354
|
),
|
1355
|
-
/* @__PURE__ */
|
1355
|
+
/* @__PURE__ */ C(
|
1356
1356
|
Y,
|
1357
1357
|
{
|
1358
1358
|
label: t.t("dataValidation.panel.messageInfo"),
|
1359
|
-
children: /* @__PURE__ */
|
1359
|
+
children: /* @__PURE__ */ C(
|
1360
1360
|
At,
|
1361
1361
|
{
|
1362
1362
|
checked: n.showErrorMessage,
|
@@ -1369,7 +1369,7 @@ function uo(e) {
|
|
1369
1369
|
)
|
1370
1370
|
}
|
1371
1371
|
),
|
1372
|
-
n.showErrorMessage ? /* @__PURE__ */
|
1372
|
+
n.showErrorMessage ? /* @__PURE__ */ C(Y, { children: /* @__PURE__ */ C(Le, { value: n.error, onChange: (u) => i({ ...n, error: u }) }) }) : null
|
1373
1373
|
] })
|
1374
1374
|
] });
|
1375
1375
|
}
|
@@ -1385,28 +1385,28 @@ function po(e, t, r) {
|
|
1385
1385
|
return t ? ((i = (n = e.getUnit(t)) == null ? void 0 : n.getSheetBySheetName(r)) == null ? void 0 : i.getSheetId()) || "" : ((a = (o = e.getCurrentUnitForType(X.UNIVER_SHEET)) == null ? void 0 : o.getSheetBySheetName(r)) == null ? void 0 : a.getSheetId()) || "";
|
1386
1386
|
}
|
1387
1387
|
function go() {
|
1388
|
-
var D,
|
1389
|
-
const [e, t] = W(0), r =
|
1390
|
-
if (
|
1391
|
-
const
|
1392
|
-
|
1393
|
-
}, [O]),
|
1394
|
-
h.onCommandExecuted((
|
1395
|
-
(
|
1396
|
-
const
|
1397
|
-
t((x) => x + 1),
|
1388
|
+
var D, F;
|
1389
|
+
const [e, t] = W(0), r = U(_e), n = Pe(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = U(Me), d = U(ce), u = U(fn), h = U(ne), c = U(gn), _ = U(ue), [p, b] = W(a), y = s.getValidatorItem(p.type), [g, v] = W(!1), f = s.getValidatorsByScope(di.SHEET), [I, w] = W(() => p.ranges.map((m) => ({ unitId: "", sheetId: "", range: m }))), S = ct(() => ho(h), [h]), [R, P] = W(!1), [N, E] = W(!1), T = pt(null), O = U(Gn);
|
1390
|
+
if (ke(() => () => {
|
1391
|
+
const m = O.getCurrentLastSelection();
|
1392
|
+
m && O.setSelections([m]);
|
1393
|
+
}, [O]), ke(() => {
|
1394
|
+
h.onCommandExecuted((m) => {
|
1395
|
+
(m.id === Br.id || m.id === Wr.id) && setTimeout(() => {
|
1396
|
+
const L = c.getRuleById(i, o, l);
|
1397
|
+
t((x) => x + 1), L && (b(L), w(L.ranges.map((x) => ({ unitId: "", sheetId: "", range: x }))));
|
1398
1398
|
}, 20);
|
1399
1399
|
});
|
1400
1400
|
}, [h, c, l, o, i]), !y)
|
1401
1401
|
return null;
|
1402
|
-
const
|
1403
|
-
var
|
1404
|
-
(
|
1405
|
-
}, J =
|
1406
|
-
const
|
1407
|
-
const
|
1408
|
-
if (
|
1409
|
-
const Or = po(d, ee.unitId,
|
1402
|
+
const A = y.operators, k = y.operatorNames, H = p.operator ? ci.includes(p.operator) : !1, B = () => {
|
1403
|
+
var m, L, x;
|
1404
|
+
(L = (m = T.current) == null ? void 0 : m.editor) != null && L.isFocus() && J((x = T.current) == null ? void 0 : x.getValue()), !(!p.ranges.length || R) && (y.validatorFormula(p, i, o).success ? r.setActiveRule(null) : v(!0));
|
1405
|
+
}, J = nn((m) => {
|
1406
|
+
const L = m.split(",").filter(Boolean).map(Oi).map((ee) => {
|
1407
|
+
const Rn = ee.sheetName;
|
1408
|
+
if (Rn) {
|
1409
|
+
const Or = po(d, ee.unitId, Rn);
|
1410
1410
|
return { ...ee, sheetId: Or };
|
1411
1411
|
}
|
1412
1412
|
return {
|
@@ -1414,41 +1414,41 @@ function go() {
|
|
1414
1414
|
sheetId: ""
|
1415
1415
|
};
|
1416
1416
|
});
|
1417
|
-
if (Hr(
|
1417
|
+
if (Hr(L, I))
|
1418
1418
|
return;
|
1419
|
-
w(
|
1420
|
-
const x =
|
1419
|
+
w(L);
|
1420
|
+
const x = L.filter((ee) => (!ee.unitId || ee.unitId === i) && (!ee.sheetId || ee.sheetId === o)).map((ee) => ee.range);
|
1421
1421
|
if (b({
|
1422
1422
|
...p,
|
1423
1423
|
ranges: x
|
1424
1424
|
}), x.length === 0)
|
1425
1425
|
return;
|
1426
|
-
const
|
1426
|
+
const Ce = {
|
1427
1427
|
unitId: i,
|
1428
1428
|
subUnitId: o,
|
1429
1429
|
ruleId: l,
|
1430
1430
|
ranges: x
|
1431
1431
|
};
|
1432
|
-
|
1433
|
-
}),
|
1434
|
-
if (
|
1432
|
+
S(rr.id, Ce);
|
1433
|
+
}), re = (m) => {
|
1434
|
+
if (yn(m, Tn(p)))
|
1435
1435
|
return;
|
1436
1436
|
b({
|
1437
1437
|
...p,
|
1438
|
-
...
|
1438
|
+
...m
|
1439
1439
|
});
|
1440
|
-
const
|
1440
|
+
const L = {
|
1441
1441
|
unitId: i,
|
1442
1442
|
subUnitId: o,
|
1443
1443
|
ruleId: l,
|
1444
|
-
setting:
|
1444
|
+
setting: m
|
1445
1445
|
};
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1446
|
+
S(
|
1447
|
+
Dn.id,
|
1448
|
+
L,
|
1449
1449
|
void 0
|
1450
1450
|
);
|
1451
|
-
},
|
1451
|
+
}, ae = async () => {
|
1452
1452
|
await h.executeCommand(or.id, {
|
1453
1453
|
ruleId: l,
|
1454
1454
|
unitId: i,
|
@@ -1460,102 +1460,102 @@ function go() {
|
|
1460
1460
|
formula1: p.formula1,
|
1461
1461
|
formula2: p.formula2,
|
1462
1462
|
allowBlank: p.allowBlank
|
1463
|
-
},
|
1464
|
-
const
|
1465
|
-
if (!
|
1463
|
+
}, G = (m) => {
|
1464
|
+
const L = s.getValidatorItem(m);
|
1465
|
+
if (!L)
|
1466
1466
|
return;
|
1467
|
-
const x =
|
1468
|
-
...
|
1469
|
-
type:
|
1467
|
+
const x = L.operators, Ce = c.getRuleById(i, o, l), ee = m === (Ce == null ? void 0 : Ce.type) || m.includes("list") && (Ce != null && Ce.type.includes("list")) ? {
|
1468
|
+
...Ce,
|
1469
|
+
type: m
|
1470
1470
|
} : {
|
1471
1471
|
...p,
|
1472
|
-
type:
|
1472
|
+
type: m,
|
1473
1473
|
operator: x[0],
|
1474
1474
|
formula1: void 0,
|
1475
1475
|
formula2: void 0
|
1476
1476
|
};
|
1477
|
-
b(ee), h.executeCommand(
|
1477
|
+
b(ee), h.executeCommand(Dn.id, {
|
1478
1478
|
unitId: i,
|
1479
1479
|
subUnitId: o,
|
1480
1480
|
ruleId: p.uid,
|
1481
|
-
setting:
|
1481
|
+
setting: Tn(ee)
|
1482
1482
|
});
|
1483
|
-
}, Z = u.get(y.formulaInput), fe = ct(() => I.map((
|
1484
|
-
|
1483
|
+
}, Z = u.get(y.formulaInput), fe = ct(() => I.map((m) => vr(m.range)).join(","), []), Q = On(p), q = (m) => {
|
1484
|
+
yn(m, On(p)) || (b({
|
1485
1485
|
...p,
|
1486
|
-
...
|
1487
|
-
}),
|
1486
|
+
...m
|
1487
|
+
}), S(
|
1488
1488
|
ei.id,
|
1489
1489
|
{
|
1490
1490
|
unitId: i,
|
1491
1491
|
subUnitId: o,
|
1492
1492
|
ruleId: l,
|
1493
|
-
options:
|
1493
|
+
options: m
|
1494
1494
|
}
|
1495
1495
|
));
|
1496
|
-
},
|
1496
|
+
}, z = A.length && !p.operator;
|
1497
1497
|
return /* @__PURE__ */ $("div", { "data-u-comp": "data-validation-detail", className: "univer-py-2", children: [
|
1498
|
-
/* @__PURE__ */
|
1498
|
+
/* @__PURE__ */ C(
|
1499
1499
|
Y,
|
1500
1500
|
{
|
1501
|
-
label:
|
1502
|
-
error: !p.ranges.length || R ?
|
1503
|
-
children: /* @__PURE__ */
|
1501
|
+
label: _.t("dataValidation.panel.range"),
|
1502
|
+
error: !p.ranges.length || R ? _.t("dataValidation.panel.rangeError") : "",
|
1503
|
+
children: /* @__PURE__ */ C(
|
1504
1504
|
Ti,
|
1505
1505
|
{
|
1506
1506
|
selectorRef: T,
|
1507
1507
|
unitId: i,
|
1508
1508
|
subUnitId: o,
|
1509
1509
|
initialValue: fe,
|
1510
|
-
onChange: (
|
1510
|
+
onChange: (m, L) => {
|
1511
1511
|
var x;
|
1512
|
-
!N && ((x = T.current) != null && x.verify()) && J(
|
1512
|
+
!N && ((x = T.current) != null && x.verify()) && J(L);
|
1513
1513
|
},
|
1514
|
-
onFocusChange: (
|
1514
|
+
onFocusChange: (m, L) => {
|
1515
1515
|
var x;
|
1516
|
-
E(
|
1516
|
+
E(m), !m && L && ((x = T.current) != null && x.verify()) && J(L);
|
1517
1517
|
},
|
1518
|
-
onVerify: (
|
1518
|
+
onVerify: (m) => P(!m)
|
1519
1519
|
}
|
1520
1520
|
)
|
1521
1521
|
}
|
1522
1522
|
),
|
1523
|
-
/* @__PURE__ */
|
1524
|
-
|
1523
|
+
/* @__PURE__ */ C(Y, { label: _.t("dataValidation.panel.type"), children: /* @__PURE__ */ C(
|
1524
|
+
kn,
|
1525
1525
|
{
|
1526
1526
|
className: "univer-w-full",
|
1527
1527
|
value: p.type,
|
1528
|
-
options: (D =
|
1529
|
-
label:
|
1530
|
-
value:
|
1528
|
+
options: (D = f == null ? void 0 : f.sort((m, L) => m.order - L.order)) == null ? void 0 : D.map((m) => ({
|
1529
|
+
label: _.t(m.title),
|
1530
|
+
value: m.id
|
1531
1531
|
})),
|
1532
|
-
onChange:
|
1532
|
+
onChange: G
|
1533
1533
|
}
|
1534
1534
|
) }),
|
1535
|
-
|
1536
|
-
|
1535
|
+
A != null && A.length ? /* @__PURE__ */ C(Y, { label: _.t("dataValidation.panel.operator"), children: /* @__PURE__ */ C(
|
1536
|
+
kn,
|
1537
1537
|
{
|
1538
1538
|
className: "univer-w-full",
|
1539
1539
|
value: `${p.operator}`,
|
1540
1540
|
options: [
|
1541
1541
|
{
|
1542
1542
|
value: "",
|
1543
|
-
label:
|
1543
|
+
label: _.t("dataValidation.operators.legal")
|
1544
1544
|
},
|
1545
|
-
...
|
1546
|
-
value: `${
|
1547
|
-
label: k[
|
1545
|
+
...A.map((m, L) => ({
|
1546
|
+
value: `${m}`,
|
1547
|
+
label: k[L]
|
1548
1548
|
}))
|
1549
1549
|
],
|
1550
|
-
onChange: (
|
1551
|
-
|
1550
|
+
onChange: (m) => {
|
1551
|
+
re({
|
1552
1552
|
...he,
|
1553
|
-
operator:
|
1553
|
+
operator: m
|
1554
1554
|
});
|
1555
1555
|
}
|
1556
1556
|
}
|
1557
1557
|
) }) : null,
|
1558
|
-
Z && !
|
1558
|
+
Z && !z ? /* @__PURE__ */ C(
|
1559
1559
|
Z,
|
1560
1560
|
{
|
1561
1561
|
isTwoFormula: H,
|
@@ -1563,10 +1563,10 @@ function go() {
|
|
1563
1563
|
formula1: p.formula1,
|
1564
1564
|
formula2: p.formula2
|
1565
1565
|
},
|
1566
|
-
onChange: (
|
1567
|
-
|
1566
|
+
onChange: (m) => {
|
1567
|
+
re({
|
1568
1568
|
...he,
|
1569
|
-
...
|
1569
|
+
...m
|
1570
1570
|
});
|
1571
1571
|
},
|
1572
1572
|
showError: g,
|
@@ -1577,34 +1577,34 @@ function go() {
|
|
1577
1577
|
},
|
1578
1578
|
e + p.type
|
1579
1579
|
) : null,
|
1580
|
-
/* @__PURE__ */
|
1580
|
+
/* @__PURE__ */ C(Y, { children: /* @__PURE__ */ C(
|
1581
1581
|
At,
|
1582
1582
|
{
|
1583
|
-
checked: (
|
1583
|
+
checked: (F = p.allowBlank) != null ? F : !0,
|
1584
1584
|
onChange: () => {
|
1585
|
-
var
|
1586
|
-
return
|
1585
|
+
var m;
|
1586
|
+
return re({
|
1587
1587
|
...he,
|
1588
|
-
allowBlank: !((
|
1588
|
+
allowBlank: !((m = p.allowBlank) == null || m)
|
1589
1589
|
});
|
1590
1590
|
},
|
1591
|
-
children:
|
1591
|
+
children: _.t("dataValidation.panel.allowBlank")
|
1592
1592
|
}
|
1593
1593
|
) }),
|
1594
|
-
/* @__PURE__ */
|
1594
|
+
/* @__PURE__ */ C(uo, { value: Q, onChange: q, extraComponent: y.optionsInput }),
|
1595
1595
|
/* @__PURE__ */ $("div", { className: "univer-mt-5 univer-flex univer-flex-row univer-justify-end", children: [
|
1596
|
-
/* @__PURE__ */
|
1597
|
-
/* @__PURE__ */
|
1596
|
+
/* @__PURE__ */ C(Ge, { className: "univer-ml-3", onClick: ae, children: _.t("dataValidation.panel.removeRule") }),
|
1597
|
+
/* @__PURE__ */ C(Ge, { className: "univer-ml-3", variant: "primary", onClick: B, children: _.t("dataValidation.panel.done") })
|
1598
1598
|
] })
|
1599
1599
|
] });
|
1600
1600
|
}
|
1601
1601
|
const vo = (e) => {
|
1602
|
-
const { rule: t, onClick: r, unitId: n, subUnitId: i, disable: o } = e, a =
|
1602
|
+
const { rule: t, onClick: r, unitId: n, subUnitId: i, disable: o } = e, a = U(Me), l = U(ne), s = U(Ei), d = a.getValidatorItem(t.type), u = pt(void 0), [h, c] = W(!1), _ = U(Xn), p = Pe(_.currentTheme$), b = ct(() => {
|
1603
1603
|
var w;
|
1604
|
-
const g =
|
1604
|
+
const g = _.getColorFromTheme("primary.600"), v = _.getColorFromTheme("loop-color.2"), f = (w = _.getColorFromTheme(v)) != null ? w : g, I = new $r(f).toRgb();
|
1605
1605
|
return {
|
1606
1606
|
fill: `rgba(${I.r}, ${I.g}, ${I.b}, 0.1)`,
|
1607
|
-
stroke:
|
1607
|
+
stroke: f
|
1608
1608
|
};
|
1609
1609
|
}, [p]), y = (g) => {
|
1610
1610
|
l.executeCommand(or.id, {
|
@@ -1613,15 +1613,15 @@ const vo = (e) => {
|
|
1613
1613
|
subUnitId: i
|
1614
1614
|
}), g.stopPropagation();
|
1615
1615
|
};
|
1616
|
-
return
|
1616
|
+
return ke(() => () => {
|
1617
1617
|
var g;
|
1618
|
-
u.current && ((g = u.current) == null || g.forEach((
|
1619
|
-
|
1618
|
+
u.current && ((g = u.current) == null || g.forEach((v) => {
|
1619
|
+
v && s.removeShape(v);
|
1620
1620
|
}));
|
1621
1621
|
}, [s]), /* @__PURE__ */ $(
|
1622
1622
|
"div",
|
1623
1623
|
{
|
1624
|
-
className:
|
1624
|
+
className: Ne(
|
1625
1625
|
`
|
1626
1626
|
univer-bg-secondary univer-relative univer--ml-2 univer--mr-2 univer-box-border univer-flex
|
1627
1627
|
univer-w-[287px] univer-cursor-pointer univer-flex-col univer-justify-between univer-overflow-hidden
|
@@ -1642,31 +1642,31 @@ const vo = (e) => {
|
|
1642
1642
|
},
|
1643
1643
|
onMouseLeave: () => {
|
1644
1644
|
var g;
|
1645
|
-
c(!1), (g = u.current) == null || g.forEach((
|
1646
|
-
|
1645
|
+
c(!1), (g = u.current) == null || g.forEach((v) => {
|
1646
|
+
v && s.removeShape(v);
|
1647
1647
|
}), u.current = void 0;
|
1648
1648
|
},
|
1649
1649
|
children: [
|
1650
|
-
/* @__PURE__ */
|
1650
|
+
/* @__PURE__ */ C(
|
1651
1651
|
"div",
|
1652
1652
|
{
|
1653
1653
|
className: "univer-truncate univer-text-sm univer-font-medium univer-leading-[22px] univer-text-gray-900 dark:!univer-text-white",
|
1654
1654
|
children: d == null ? void 0 : d.generateRuleName(t)
|
1655
1655
|
}
|
1656
1656
|
),
|
1657
|
-
/* @__PURE__ */
|
1657
|
+
/* @__PURE__ */ C(
|
1658
1658
|
"div",
|
1659
1659
|
{
|
1660
1660
|
className: "univer-text-secondary univer-truncate univer-text-xs univer-leading-[18px] dark:!univer-text-gray-300",
|
1661
1661
|
children: t.ranges.map((g) => vr(g)).join(",")
|
1662
1662
|
}
|
1663
1663
|
),
|
1664
|
-
h ? /* @__PURE__ */
|
1664
|
+
h ? /* @__PURE__ */ C(
|
1665
1665
|
"div",
|
1666
1666
|
{
|
1667
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",
|
1668
1668
|
onClick: y,
|
1669
|
-
children: /* @__PURE__ */
|
1669
|
+
children: /* @__PURE__ */ C(wn, {})
|
1670
1670
|
}
|
1671
1671
|
) : null
|
1672
1672
|
]
|
@@ -1674,79 +1674,79 @@ const vo = (e) => {
|
|
1674
1674
|
);
|
1675
1675
|
};
|
1676
1676
|
function fo(e) {
|
1677
|
-
const t =
|
1678
|
-
|
1677
|
+
const t = U(oe), r = U(ce), n = U(ne), i = U(be), o = U(_e), a = U(ue), [l, s] = W([]), { workbook: d } = e, u = Pe(d.activeSheet$, void 0, !0), h = d.getUnitId(), c = u == null ? void 0 : u.getSheetId();
|
1678
|
+
ke(() => {
|
1679
1679
|
s(t.getRules(h, c));
|
1680
|
-
const
|
1681
|
-
|
1680
|
+
const v = t.ruleChange$.subscribe((f) => {
|
1681
|
+
f.unitId === h && f.subUnitId === c && s(t.getRules(h, c));
|
1682
1682
|
});
|
1683
1683
|
return () => {
|
1684
|
-
|
1684
|
+
v.unsubscribe();
|
1685
1685
|
};
|
1686
1686
|
}, [h, c, t]);
|
1687
|
-
const
|
1688
|
-
const
|
1687
|
+
const _ = async () => {
|
1688
|
+
const v = tr(i), f = {
|
1689
1689
|
unitId: h,
|
1690
1690
|
subUnitId: c,
|
1691
|
-
rule:
|
1691
|
+
rule: v
|
1692
1692
|
};
|
1693
|
-
await n.executeCommand(
|
1693
|
+
await n.executeCommand(hn.id, f), o.setActiveRule({
|
1694
1694
|
unitId: h,
|
1695
1695
|
subUnitId: c,
|
1696
|
-
rule:
|
1696
|
+
rule: v
|
1697
1697
|
});
|
1698
1698
|
}, p = () => {
|
1699
1699
|
n.executeCommand(ti.id, {
|
1700
1700
|
unitId: h,
|
1701
1701
|
subUnitId: c
|
1702
1702
|
});
|
1703
|
-
}, y = ((
|
1704
|
-
const
|
1705
|
-
return
|
1706
|
-
})(l), g = y == null ? void 0 : y.some((
|
1703
|
+
}, y = ((v) => {
|
1704
|
+
const f = r.getCurrentUnitForType(X.UNIVER_SHEET), I = f.getActiveSheet(), w = f.getUnitId(), S = I.getSheetId();
|
1705
|
+
return v.map((P) => Jr(i, w, S, P.ranges) ? { ...P } : { ...P, disable: !0 });
|
1706
|
+
})(l), g = y == null ? void 0 : y.some((v) => v.disable);
|
1707
1707
|
return /* @__PURE__ */ $("div", { className: "univer-pb-4", children: [
|
1708
|
-
y == null ? void 0 : y.map((
|
1709
|
-
var
|
1710
|
-
return /* @__PURE__ */
|
1708
|
+
y == null ? void 0 : y.map((v) => {
|
1709
|
+
var f;
|
1710
|
+
return /* @__PURE__ */ C(
|
1711
1711
|
vo,
|
1712
1712
|
{
|
1713
1713
|
unitId: h,
|
1714
1714
|
subUnitId: c,
|
1715
1715
|
onClick: () => {
|
1716
|
-
|
1716
|
+
v.disable || o.setActiveRule({
|
1717
1717
|
unitId: h,
|
1718
1718
|
subUnitId: c,
|
1719
|
-
rule:
|
1719
|
+
rule: v
|
1720
1720
|
});
|
1721
1721
|
},
|
1722
|
-
rule:
|
1723
|
-
disable: (
|
1722
|
+
rule: v,
|
1723
|
+
disable: (f = v.disable) != null ? f : !1
|
1724
1724
|
},
|
1725
|
-
|
1725
|
+
v.uid
|
1726
1726
|
);
|
1727
1727
|
}),
|
1728
1728
|
/* @__PURE__ */ $("div", { className: "univer-mt-4 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
|
1729
|
-
l.length && !g ? /* @__PURE__ */
|
1730
|
-
/* @__PURE__ */
|
1729
|
+
l.length && !g ? /* @__PURE__ */ C(Ge, { onClick: p, children: a.t("dataValidation.panel.removeAll") }) : null,
|
1730
|
+
/* @__PURE__ */ C(Ge, { variant: "primary", onClick: _, children: a.t("dataValidation.panel.add") })
|
1731
1731
|
] })
|
1732
1732
|
] });
|
1733
1733
|
}
|
1734
1734
|
const mo = () => {
|
1735
|
-
const e =
|
1735
|
+
const e = U(_e), t = Pe(e.activeRule$, e.activeRule), r = U(ce), n = Pe(
|
1736
1736
|
() => r.getCurrentTypeOfUnit$(X.UNIVER_SHEET),
|
1737
1737
|
void 0,
|
1738
1738
|
void 0,
|
1739
1739
|
[]
|
1740
|
-
), i =
|
1740
|
+
), i = Pe(() => {
|
1741
1741
|
var o;
|
1742
1742
|
return (o = n == null ? void 0 : n.activeSheet$) != null ? o : mi(null);
|
1743
1743
|
}, void 0, void 0, []);
|
1744
|
-
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */
|
1744
|
+
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */ C(go, {}, t.rule.uid) : /* @__PURE__ */ C(fo, { workbook: n });
|
1745
1745
|
}, _o = (e) => {
|
1746
|
-
const { isTwoFormula: t = !1, value: r, onChange: n, showError: i, validResult: o } = e, a =
|
1746
|
+
const { isTwoFormula: t = !1, value: r, onChange: n, showError: i, validResult: o } = e, a = U(ue), l = i ? o == null ? void 0 : o.formula1 : "", s = i ? o == null ? void 0 : o.formula2 : "";
|
1747
1747
|
return t ? /* @__PURE__ */ $(ut, { children: [
|
1748
|
-
/* @__PURE__ */
|
1749
|
-
|
1748
|
+
/* @__PURE__ */ C(Y, { error: l, children: /* @__PURE__ */ C(
|
1749
|
+
Le,
|
1750
1750
|
{
|
1751
1751
|
className: "univer-w-full",
|
1752
1752
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1759,9 +1759,9 @@ const mo = () => {
|
|
1759
1759
|
}
|
1760
1760
|
}
|
1761
1761
|
) }),
|
1762
|
-
/* @__PURE__ */
|
1763
|
-
/* @__PURE__ */
|
1764
|
-
|
1762
|
+
/* @__PURE__ */ C("div", { className: "-univer-mt-2 univer-mb-1 univer-text-sm univer-text-gray-400", children: a.t("dataValidation.panel.formulaAnd") }),
|
1763
|
+
/* @__PURE__ */ C(Y, { error: s, children: /* @__PURE__ */ C(
|
1764
|
+
Le,
|
1765
1765
|
{
|
1766
1766
|
className: "univer-w-full",
|
1767
1767
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1774,8 +1774,8 @@ const mo = () => {
|
|
1774
1774
|
}
|
1775
1775
|
}
|
1776
1776
|
) })
|
1777
|
-
] }) : /* @__PURE__ */
|
1778
|
-
|
1777
|
+
] }) : /* @__PURE__ */ C(Y, { error: l, children: /* @__PURE__ */ C(
|
1778
|
+
Le,
|
1779
1779
|
{
|
1780
1780
|
className: "univer-w-full",
|
1781
1781
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1787,9 +1787,9 @@ const mo = () => {
|
|
1787
1787
|
) });
|
1788
1788
|
};
|
1789
1789
|
function So(e) {
|
1790
|
-
const { value: t, onChange: r, showError: n, validResult: i } = e, o =
|
1790
|
+
const { value: t, onChange: r, showError: n, validResult: i } = e, o = U(ue), a = n ? i == null ? void 0 : i.formula1 : "", l = n ? i == null ? void 0 : i.formula2 : "", [s, d] = W(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
1791
1791
|
return /* @__PURE__ */ $(ut, { children: [
|
1792
|
-
/* @__PURE__ */
|
1792
|
+
/* @__PURE__ */ C(Y, { children: /* @__PURE__ */ C(
|
1793
1793
|
At,
|
1794
1794
|
{
|
1795
1795
|
checked: s,
|
@@ -1803,8 +1803,8 @@ function So(e) {
|
|
1803
1803
|
children: o.t("dataValidation.checkbox.tips")
|
1804
1804
|
}
|
1805
1805
|
) }),
|
1806
|
-
s ? /* @__PURE__ */
|
1807
|
-
|
1806
|
+
s ? /* @__PURE__ */ C(Y, { label: o.t("dataValidation.checkbox.checked"), error: a, children: /* @__PURE__ */ C(
|
1807
|
+
Le,
|
1808
1808
|
{
|
1809
1809
|
className: "univer-w-full",
|
1810
1810
|
placeholder: o.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1817,8 +1817,8 @@ function So(e) {
|
|
1817
1817
|
}
|
1818
1818
|
}
|
1819
1819
|
) }) : null,
|
1820
|
-
s ? /* @__PURE__ */
|
1821
|
-
|
1820
|
+
s ? /* @__PURE__ */ C(Y, { label: o.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ C(
|
1821
|
+
Le,
|
1822
1822
|
{
|
1823
1823
|
className: "univer-w-full",
|
1824
1824
|
placeholder: o.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1839,21 +1839,21 @@ function Co(e) {
|
|
1839
1839
|
return cr((c) => {
|
1840
1840
|
var p;
|
1841
1841
|
((p = s.current) == null ? void 0 : p.isClickOutSide(c)) && u(!1);
|
1842
|
-
}), /* @__PURE__ */
|
1842
|
+
}), /* @__PURE__ */ C(Y, { error: l, children: /* @__PURE__ */ C(
|
1843
1843
|
fr,
|
1844
1844
|
{
|
1845
1845
|
ref: s,
|
1846
|
-
className:
|
1846
|
+
className: Ne("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent", yt),
|
1847
1847
|
initValue: (h = n == null ? void 0 : n.formula1) != null ? h : "=",
|
1848
1848
|
unitId: t,
|
1849
1849
|
subUnitId: r,
|
1850
1850
|
isFocus: d,
|
1851
1851
|
isSupportAcrossSheet: !0,
|
1852
1852
|
onChange: (c) => {
|
1853
|
-
const
|
1854
|
-
|
1853
|
+
const _ = (c != null ? c : "").trim();
|
1854
|
+
_ !== (n == null ? void 0 : n.formula1) && (i == null || i({
|
1855
1855
|
...n,
|
1856
|
-
formula1:
|
1856
|
+
formula1: _
|
1857
1857
|
}));
|
1858
1858
|
},
|
1859
1859
|
onFocus: () => u(!0)
|
@@ -1887,22 +1887,22 @@ const wo = [
|
|
1887
1887
|
"#F248A6"
|
1888
1888
|
], Io = (e) => {
|
1889
1889
|
const { value: t, onChange: r, disabled: n } = e, [i, o] = W(!1);
|
1890
|
-
return /* @__PURE__ */
|
1890
|
+
return /* @__PURE__ */ C(
|
1891
1891
|
Vi,
|
1892
1892
|
{
|
1893
1893
|
align: "start",
|
1894
1894
|
disabled: n,
|
1895
1895
|
open: i,
|
1896
1896
|
onOpenChange: o,
|
1897
|
-
overlay: /* @__PURE__ */
|
1897
|
+
overlay: /* @__PURE__ */ C(
|
1898
1898
|
"div",
|
1899
1899
|
{
|
1900
1900
|
className: "univer-box-border univer-grid univer-w-fit univer-grid-cols-6 univer-flex-wrap univer-gap-2 univer-p-1.5",
|
1901
1901
|
children: wo.map(
|
1902
|
-
(a) => /* @__PURE__ */
|
1902
|
+
(a) => /* @__PURE__ */ C(
|
1903
1903
|
"div",
|
1904
1904
|
{
|
1905
|
-
className:
|
1905
|
+
className: Ne("univer-box-border univer-size-4 univer-cursor-pointer univer-rounded", yt),
|
1906
1906
|
style: { background: a },
|
1907
1907
|
onClick: () => {
|
1908
1908
|
r(a), o(!1);
|
@@ -1916,26 +1916,26 @@ const wo = [
|
|
1916
1916
|
children: /* @__PURE__ */ $(
|
1917
1917
|
"div",
|
1918
1918
|
{
|
1919
|
-
className:
|
1919
|
+
className: Ne("univer-box-border univer-inline-flex univer-h-8 univer-w-16 univer-cursor-pointer univer-items-center univer-justify-between univer-gap-2 univer-rounded-lg univer-bg-white univer-px-2.5 univer-transition-colors univer-duration-200 hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white", yt),
|
1920
1920
|
children: [
|
1921
|
-
/* @__PURE__ */
|
1921
|
+
/* @__PURE__ */ C(
|
1922
1922
|
"div",
|
1923
1923
|
{
|
1924
1924
|
className: "univer-box-border univer-h-4 univer-w-4 univer-rounded univer-text-base",
|
1925
1925
|
style: { background: t }
|
1926
1926
|
}
|
1927
1927
|
),
|
1928
|
-
/* @__PURE__ */
|
1928
|
+
/* @__PURE__ */ C(In, {})
|
1929
1929
|
]
|
1930
1930
|
}
|
1931
1931
|
)
|
1932
1932
|
}
|
1933
1933
|
);
|
1934
|
-
},
|
1934
|
+
}, xn = (e) => {
|
1935
1935
|
const { item: t, commonProps: r, className: n } = e, { onItemChange: i, onItemDelete: o } = r;
|
1936
|
-
return /* @__PURE__ */ $("div", { className:
|
1937
|
-
!t.isRef && /* @__PURE__ */
|
1938
|
-
/* @__PURE__ */
|
1936
|
+
return /* @__PURE__ */ $("div", { className: Ne("univer-flex univer-items-center univer-gap-2", n), children: [
|
1937
|
+
!t.isRef && /* @__PURE__ */ C("div", { className: Ne("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ C(Mr, {}) }),
|
1938
|
+
/* @__PURE__ */ C(
|
1939
1939
|
Io,
|
1940
1940
|
{
|
1941
1941
|
value: t.color,
|
@@ -1944,8 +1944,8 @@ const wo = [
|
|
1944
1944
|
}
|
1945
1945
|
}
|
1946
1946
|
),
|
1947
|
-
/* @__PURE__ */
|
1948
|
-
|
1947
|
+
/* @__PURE__ */ C(
|
1948
|
+
Le,
|
1949
1949
|
{
|
1950
1950
|
disabled: t.isRef,
|
1951
1951
|
value: t.label,
|
@@ -1954,152 +1954,152 @@ const wo = [
|
|
1954
1954
|
}
|
1955
1955
|
}
|
1956
1956
|
),
|
1957
|
-
t.isRef ? null : /* @__PURE__ */
|
1957
|
+
t.isRef ? null : /* @__PURE__ */ C(
|
1958
1958
|
"div",
|
1959
1959
|
{
|
1960
1960
|
className: "univer-ml-1 univer-cursor-pointer univer-rounded univer-text-base hover:univer-bg-gray-200",
|
1961
|
-
children: /* @__PURE__ */
|
1961
|
+
children: /* @__PURE__ */ C(wn, { onClick: () => o(t.id) })
|
1962
1962
|
}
|
1963
1963
|
)
|
1964
1964
|
] });
|
1965
1965
|
};
|
1966
1966
|
function Ro(e) {
|
1967
1967
|
const { value: t, onChange: r = () => {
|
1968
|
-
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, h] = W(() =>
|
1969
|
-
|
1968
|
+
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, h] = W(() => Ve(s) ? "1" : "0"), [c, _] = W(u === "1" ? s : "="), [p, b] = W(u === "1" ? s : "="), y = U(ue), g = U(Me), v = U(gn), f = U(ni), [I, w] = W(() => d.split(",")), S = g.getValidatorItem(j.LIST), [R, P] = W([]), [N, E] = W(""), T = a ? o == null ? void 0 : o.formula1 : "", O = ct(() => v.ruleChange$.pipe(ur(16)), []), A = Pe(O), k = nn(r);
|
1969
|
+
ke(() => {
|
1970
1970
|
(async () => {
|
1971
|
-
await new Promise((
|
1972
|
-
setTimeout(() =>
|
1971
|
+
await new Promise((m) => {
|
1972
|
+
setTimeout(() => m(!0), 100);
|
1973
1973
|
});
|
1974
|
-
const D =
|
1975
|
-
if (
|
1976
|
-
const
|
1977
|
-
|
1974
|
+
const D = v.getRuleById(n, i, l), F = D == null ? void 0 : D.formula1;
|
1975
|
+
if (Ve(F) && S && D) {
|
1976
|
+
const m = await S.getListAsync(D, n, i);
|
1977
|
+
P(m);
|
1978
1978
|
}
|
1979
1979
|
})();
|
1980
|
-
}, [
|
1981
|
-
|
1980
|
+
}, [v, A, S, l, i, n]), ke(() => {
|
1981
|
+
Ve(s) && s !== p && (_(s), b(p));
|
1982
1982
|
}, [p, s]);
|
1983
1983
|
const [H, B] = W(() => {
|
1984
|
-
const D = u !== "1" ? ri(s) : [],
|
1985
|
-
return D.map((
|
1986
|
-
label:
|
1987
|
-
color:
|
1984
|
+
const D = u !== "1" ? ri(s) : [], F = d.split(",");
|
1985
|
+
return D.map((m, L) => ({
|
1986
|
+
label: m,
|
1987
|
+
color: F[L] || Te,
|
1988
1988
|
isRef: !1,
|
1989
|
-
id:
|
1989
|
+
id: bn(4)
|
1990
1990
|
}));
|
1991
|
-
}), J = (D,
|
1992
|
-
const
|
1993
|
-
|
1994
|
-
},
|
1995
|
-
const
|
1996
|
-
|
1997
|
-
},
|
1991
|
+
}), J = (D, F, m) => {
|
1992
|
+
const L = H.find((x) => x.id === D);
|
1993
|
+
L && (L.label = F, L.color = m, B([...H]));
|
1994
|
+
}, re = (D) => {
|
1995
|
+
const F = H.findIndex((m) => m.id === D);
|
1996
|
+
F !== -1 && (H.splice(F, 1), B([...H]));
|
1997
|
+
}, ae = d.split(","), he = ct(() => R.map((D, F) => ({
|
1998
1998
|
label: D,
|
1999
|
-
color:
|
2000
|
-
id: `${
|
1999
|
+
color: ae[F] || Te,
|
2000
|
+
id: `${F}`,
|
2001
2001
|
isRef: !0
|
2002
|
-
})), [
|
2003
|
-
const
|
2004
|
-
|
2002
|
+
})), [ae, R]), G = (D, F, m) => {
|
2003
|
+
const L = [...I];
|
2004
|
+
L[+D] = m, w(L), k({
|
2005
2005
|
formula1: s,
|
2006
|
-
formula2:
|
2006
|
+
formula2: L.join(",")
|
2007
2007
|
});
|
2008
2008
|
}, Z = () => {
|
2009
2009
|
B([
|
2010
2010
|
...H,
|
2011
2011
|
{
|
2012
2012
|
label: "",
|
2013
|
-
color:
|
2013
|
+
color: Te,
|
2014
2014
|
isRef: !1,
|
2015
|
-
id:
|
2015
|
+
id: bn(4)
|
2016
2016
|
}
|
2017
2017
|
]);
|
2018
2018
|
};
|
2019
|
-
|
2019
|
+
ke(() => {
|
2020
2020
|
if (u === "1")
|
2021
2021
|
return;
|
2022
|
-
const D = /* @__PURE__ */ new Set(),
|
2023
|
-
H.map((
|
2024
|
-
labelList:
|
2025
|
-
item:
|
2026
|
-
})).forEach(({ item:
|
2027
|
-
|
2028
|
-
D.has(x) || (D.add(x),
|
2022
|
+
const D = /* @__PURE__ */ new Set(), F = [];
|
2023
|
+
H.map((m) => ({
|
2024
|
+
labelList: m.label.split(","),
|
2025
|
+
item: m
|
2026
|
+
})).forEach(({ item: m, labelList: L }) => {
|
2027
|
+
L.forEach((x) => {
|
2028
|
+
D.has(x) || (D.add(x), F.push({
|
2029
2029
|
label: x,
|
2030
|
-
color:
|
2030
|
+
color: m.color
|
2031
2031
|
}));
|
2032
2032
|
});
|
2033
2033
|
}), k({
|
2034
|
-
formula1: er(
|
2035
|
-
formula2:
|
2034
|
+
formula1: er(F.map((m) => m.label)),
|
2035
|
+
formula2: F.map((m) => m.color === Te ? "" : m.color).join(",")
|
2036
2036
|
});
|
2037
2037
|
}, [H, k, u, p, I]);
|
2038
|
-
const fe =
|
2039
|
-
if (!
|
2038
|
+
const fe = nn(async (D) => {
|
2039
|
+
if (!Ve(D)) {
|
2040
2040
|
k == null || k({
|
2041
2041
|
formula1: "",
|
2042
2042
|
formula2: d
|
2043
2043
|
});
|
2044
2044
|
return;
|
2045
2045
|
}
|
2046
|
-
|
2047
|
-
formula1:
|
2046
|
+
f.getFormulaRefCheck(D) ? (k == null || k({
|
2047
|
+
formula1: Ve(D) ? D : "",
|
2048
2048
|
formula2: d
|
2049
2049
|
}), E("")) : (k == null || k({
|
2050
2050
|
formula1: "",
|
2051
2051
|
formula2: d
|
2052
|
-
}),
|
2053
|
-
}), Q = pt(null), [q,
|
2052
|
+
}), _("="), E(y.t("dataValidation.validFail.formulaError")));
|
2053
|
+
}), Q = pt(null), [q, z] = W(!1);
|
2054
2054
|
return cr((D) => {
|
2055
|
-
var
|
2056
|
-
((
|
2055
|
+
var m;
|
2056
|
+
((m = Q.current) == null ? void 0 : m.isClickOutSide(D)) && z(!1);
|
2057
2057
|
}), /* @__PURE__ */ $(ut, { children: [
|
2058
|
-
/* @__PURE__ */
|
2059
|
-
|
2058
|
+
/* @__PURE__ */ C(Y, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ $(
|
2059
|
+
_n,
|
2060
2060
|
{
|
2061
2061
|
value: u,
|
2062
2062
|
onChange: (D) => {
|
2063
|
-
h(D),
|
2063
|
+
h(D), _(p), D === "1" && k({
|
2064
2064
|
formula1: p === "=" ? "" : p,
|
2065
2065
|
formula2: I.join(",")
|
2066
2066
|
});
|
2067
2067
|
},
|
2068
2068
|
children: [
|
2069
|
-
/* @__PURE__ */
|
2070
|
-
/* @__PURE__ */
|
2069
|
+
/* @__PURE__ */ C(Ae, { value: "0", children: y.t("dataValidation.list.customOptions") }),
|
2070
|
+
/* @__PURE__ */ C(Ae, { value: "1", children: y.t("dataValidation.list.refOptions") })
|
2071
2071
|
]
|
2072
2072
|
}
|
2073
2073
|
) }),
|
2074
2074
|
u === "1" ? /* @__PURE__ */ $(Y, { error: T || N || void 0, children: [
|
2075
|
-
/* @__PURE__ */
|
2075
|
+
/* @__PURE__ */ C(
|
2076
2076
|
fr,
|
2077
2077
|
{
|
2078
2078
|
ref: Q,
|
2079
|
-
className:
|
2079
|
+
className: Ne("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent", yt),
|
2080
2080
|
initValue: c,
|
2081
2081
|
unitId: n,
|
2082
2082
|
subUnitId: i,
|
2083
2083
|
isFocus: q,
|
2084
2084
|
isSupportAcrossSheet: !0,
|
2085
|
-
onFocus: () =>
|
2085
|
+
onFocus: () => z(!0),
|
2086
2086
|
onChange: (D = "") => {
|
2087
|
-
const
|
2088
|
-
b(
|
2087
|
+
const F = (D != null ? D : "").trim();
|
2088
|
+
b(F), fe(F);
|
2089
2089
|
}
|
2090
2090
|
}
|
2091
2091
|
),
|
2092
|
-
he.length > 0 && /* @__PURE__ */
|
2093
|
-
|
2092
|
+
he.length > 0 && /* @__PURE__ */ C("div", { className: "univer-mt-3", children: he.map((D) => /* @__PURE__ */ C(
|
2093
|
+
xn,
|
2094
2094
|
{
|
2095
2095
|
className: "univer-mb-3",
|
2096
2096
|
item: D,
|
2097
|
-
commonProps: { onItemChange:
|
2097
|
+
commonProps: { onItemChange: G }
|
2098
2098
|
},
|
2099
2099
|
D.id
|
2100
2100
|
)) })
|
2101
|
-
] }) : /* @__PURE__ */
|
2102
|
-
/* @__PURE__ */
|
2101
|
+
] }) : /* @__PURE__ */ C(Y, { error: T, children: /* @__PURE__ */ $("div", { className: "-univer-mt-3", children: [
|
2102
|
+
/* @__PURE__ */ C(
|
2103
2103
|
Di,
|
2104
2104
|
{
|
2105
2105
|
list: H,
|
@@ -2107,13 +2107,13 @@ function Ro(e) {
|
|
2107
2107
|
rowHeight: 28,
|
2108
2108
|
margin: [0, 12],
|
2109
2109
|
draggableHandle: ".draggableHandle",
|
2110
|
-
itemRender: (D) => /* @__PURE__ */
|
2111
|
-
|
2110
|
+
itemRender: (D) => /* @__PURE__ */ C(
|
2111
|
+
xn,
|
2112
2112
|
{
|
2113
2113
|
item: D,
|
2114
2114
|
commonProps: {
|
2115
2115
|
onItemChange: J,
|
2116
|
-
onItemDelete:
|
2116
|
+
onItemDelete: re
|
2117
2117
|
}
|
2118
2118
|
},
|
2119
2119
|
D.id
|
@@ -2127,7 +2127,7 @@ function Ro(e) {
|
|
2127
2127
|
className: "univer-text-primary univer-flex univer-w-fit univer-cursor-pointer univer-flex-row univer-items-center univer-rounded univer-p-1 univer-px-2 univer-text-sm hover:univer-bg-primary-50 dark:hover:!univer-bg-gray-800",
|
2128
2128
|
onClick: Z,
|
2129
2129
|
children: [
|
2130
|
-
/* @__PURE__ */
|
2130
|
+
/* @__PURE__ */ C(yr, { className: "univer-mr-1" }),
|
2131
2131
|
y.t("dataValidation.list.add")
|
2132
2132
|
]
|
2133
2133
|
}
|
@@ -2145,7 +2145,7 @@ const yo = [
|
|
2145
2145
|
_o
|
2146
2146
|
],
|
2147
2147
|
[
|
2148
|
-
|
2148
|
+
pn,
|
2149
2149
|
Ro
|
2150
2150
|
],
|
2151
2151
|
[
|
@@ -2155,19 +2155,19 @@ const yo = [
|
|
2155
2155
|
], bo = "LIST_RENDER_MODE_OPTION_INPUT";
|
2156
2156
|
function Dt(e) {
|
2157
2157
|
var i;
|
2158
|
-
const { value: t, onChange: r } = e, n =
|
2159
|
-
return /* @__PURE__ */
|
2160
|
-
/* @__PURE__ */
|
2161
|
-
/* @__PURE__ */
|
2162
|
-
/* @__PURE__ */
|
2158
|
+
const { value: t, onChange: r } = e, n = U(ue);
|
2159
|
+
return /* @__PURE__ */ C(Y, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ $(_n, { value: `${(i = t.renderMode) != null ? i : se.CUSTOM}`, onChange: (o) => r({ ...t, renderMode: +o }), children: [
|
2160
|
+
/* @__PURE__ */ C(Ae, { value: `${se.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2161
|
+
/* @__PURE__ */ C(Ae, { value: `${se.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2162
|
+
/* @__PURE__ */ C(Ae, { value: `${se.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2163
2163
|
] }) });
|
2164
2164
|
}
|
2165
2165
|
Dt.componentKey = bo;
|
2166
2166
|
const Mo = "DATE_SHOW_TIME_OPTION";
|
2167
2167
|
function Vt(e) {
|
2168
2168
|
var i;
|
2169
|
-
const { value: t, onChange: r } = e, n =
|
2170
|
-
return /* @__PURE__ */
|
2169
|
+
const { value: t, onChange: r } = e, n = U(ue);
|
2170
|
+
return /* @__PURE__ */ C(Y, { children: /* @__PURE__ */ C(
|
2171
2171
|
At,
|
2172
2172
|
{
|
2173
2173
|
checked: (i = t.bizInfo) == null ? void 0 : i.showTime,
|
@@ -2189,9 +2189,9 @@ var Eo = Object.getOwnPropertyDescriptor, Do = (e, t, r, n) => {
|
|
2189
2189
|
for (var i = n > 1 ? void 0 : n ? Eo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2190
2190
|
(a = e[o]) && (i = a(i) || i);
|
2191
2191
|
return i;
|
2192
|
-
},
|
2192
|
+
}, je = (e, t) => (r, n) => t(r, n, e);
|
2193
2193
|
const _t = 6;
|
2194
|
-
let
|
2194
|
+
let on = class {
|
2195
2195
|
constructor(e, t, r, n, i, o) {
|
2196
2196
|
this._commandService = e, this._univerInstanceService = t, this._formulaService = r, this._themeService = n, this._renderManagerService = i, this._dataValidationModel = o;
|
2197
2197
|
}
|
@@ -2239,25 +2239,25 @@ let rn = class {
|
|
2239
2239
|
return ((r = t == null ? void 0 : t.fs) != null ? r : 10) * 1.6;
|
2240
2240
|
}
|
2241
2241
|
async _parseFormula(e, t, r) {
|
2242
|
-
var d, u, h, c,
|
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 = (
|
2242
|
+
var d, u, h, c, _, p, b, y, g;
|
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 = (_ = (c = o == null ? void 0 : o[1]) == null ? void 0 : c.result) == null ? void 0 : _[0]) == null ? void 0 : p[0]), s = Vn(String(a)) && Vn(String(l));
|
2244
2244
|
return {
|
2245
|
-
formula1:
|
2246
|
-
formula2:
|
2245
|
+
formula1: Ve(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,
|
2246
|
+
formula2: Ve(i) ? l : i,
|
2247
2247
|
isFormulaValid: s
|
2248
2248
|
};
|
2249
2249
|
}
|
2250
2250
|
drawWith(e, t) {
|
2251
|
-
var T, O,
|
2252
|
-
const { style: r, primaryWithCoord: n, unitId: i, subUnitId: o, worksheet: a, row: l, col: s } = t, d = n.isMergedMainCell ? n.mergeInfo : n, u =
|
2251
|
+
var T, O, A, k;
|
2252
|
+
const { style: r, primaryWithCoord: n, unitId: i, subUnitId: o, worksheet: a, row: l, col: s } = t, d = n.isMergedMainCell ? n.mergeInfo : n, u = ie(a.getCellRaw(l, s)), h = this._dataValidationModel.getRuleByLocation(i, o, l, s);
|
2253
2253
|
if (!h)
|
2254
2254
|
return;
|
2255
2255
|
const c = this._dataValidationModel.getValidator(h.type);
|
2256
2256
|
if (!c || !((T = c.skipDefaultFontRender) != null && T.call(c, h, u, { unitId: i, subUnitId: o, row: l, column: s })))
|
2257
2257
|
return;
|
2258
|
-
const
|
2259
|
-
left:
|
2260
|
-
top:
|
2258
|
+
const _ = c.parseFormulaSync(h, i, o), { formula1: p } = _, b = this._calc(d, r), { a: y, d: g } = e.getTransform(), v = Mn(b.left, y), f = Mn(b.top, g), I = Yr.create().composeMatrix({
|
2259
|
+
left: v,
|
2260
|
+
top: f,
|
2261
2261
|
scaleX: 1,
|
2262
2262
|
scaleY: 1,
|
2263
2263
|
angle: 0,
|
@@ -2265,16 +2265,16 @@ let rn = class {
|
|
2265
2265
|
skewY: 0,
|
2266
2266
|
flipX: !1,
|
2267
2267
|
flipY: !1
|
2268
|
-
}), w = d.endX - d.startX,
|
2269
|
-
e.save(), e.beginPath(), e.rect(d.startX, d.startY, w,
|
2268
|
+
}), w = d.endX - d.startX, S = d.endY - d.startY;
|
2269
|
+
e.save(), e.beginPath(), e.rect(d.startX, d.startY, w, S), e.clip();
|
2270
2270
|
const R = I.getMatrix();
|
2271
2271
|
e.transform(R[0], R[1], R[2], R[3], R[4], R[5]);
|
2272
|
-
const
|
2272
|
+
const P = ((O = r == null ? void 0 : r.fs) != null ? O : 10) * 1.6, N = String(u) === String(p), E = this._themeService.getColorFromTheme("primary.600");
|
2273
2273
|
Xr.drawWith(e, {
|
2274
2274
|
checked: N,
|
2275
|
-
width:
|
2276
|
-
height:
|
2277
|
-
fill: (k = (
|
2275
|
+
width: P,
|
2276
|
+
height: P,
|
2277
|
+
fill: (k = (A = r == null ? void 0 : r.cl) == null ? void 0 : A.rgb) != null ? k : E
|
2278
2278
|
}), e.restore();
|
2279
2279
|
}
|
2280
2280
|
isHit(e, t) {
|
@@ -2285,13 +2285,13 @@ let rn = class {
|
|
2285
2285
|
var p;
|
2286
2286
|
if (t.button === 2)
|
2287
2287
|
return;
|
2288
|
-
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s =
|
2288
|
+
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s = ie(o.getCellRaw(a, l)), d = this._dataValidationModel.getRuleByLocation(n, i, a, l);
|
2289
2289
|
if (!d)
|
2290
2290
|
return;
|
2291
2291
|
const u = this._dataValidationModel.getValidator(d.type);
|
2292
2292
|
if (!u || !((p = u.skipDefaultFontRender) != null && p.call(u, d, s, { unitId: n, subUnitId: i, row: a, column: l })))
|
2293
2293
|
return;
|
2294
|
-
const { formula1: h, formula2: c } = await this._parseFormula(d, n, i),
|
2294
|
+
const { formula1: h, formula2: c } = await this._parseFormula(d, n, i), _ = {
|
2295
2295
|
range: {
|
2296
2296
|
startColumn: r.actualColumn,
|
2297
2297
|
endColumn: r.actualColumn,
|
@@ -2305,7 +2305,7 @@ let rn = class {
|
|
2305
2305
|
};
|
2306
2306
|
this._commandService.executeCommand(
|
2307
2307
|
st.id,
|
2308
|
-
|
2308
|
+
_
|
2309
2309
|
);
|
2310
2310
|
}
|
2311
2311
|
onPointerEnter(e, t) {
|
@@ -2317,40 +2317,40 @@ let rn = class {
|
|
2317
2317
|
(n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(ze.DEFAULT);
|
2318
2318
|
}
|
2319
2319
|
};
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
],
|
2320
|
+
on = Do([
|
2321
|
+
je(0, ne),
|
2322
|
+
je(1, ce),
|
2323
|
+
je(2, M(ii)),
|
2324
|
+
je(3, M(Xn)),
|
2325
|
+
je(4, M(Fe)),
|
2326
|
+
je(5, M(oe))
|
2327
|
+
], on);
|
2328
2328
|
var Vo = Object.getOwnPropertyDescriptor, Oo = (e, t, r, n) => {
|
2329
2329
|
for (var i = n > 1 ? void 0 : n ? Vo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2330
2330
|
(a = e[o]) && (i = a(i) || i);
|
2331
2331
|
return i;
|
2332
2332
|
}, To = (e, t) => (r, n) => t(r, n, e);
|
2333
|
-
let
|
2333
|
+
let Se = class {
|
2334
2334
|
constructor(e) {
|
2335
2335
|
V(this, "canvasRender", null);
|
2336
2336
|
V(this, "dropdownType");
|
2337
2337
|
V(this, "optionsInput");
|
2338
|
-
V(this, "formulaInput",
|
2338
|
+
V(this, "formulaInput", pn);
|
2339
2339
|
this.injector = e;
|
2340
2340
|
}
|
2341
2341
|
};
|
2342
|
-
|
2342
|
+
Se = Oo([
|
2343
2343
|
To(0, M(be))
|
2344
|
-
],
|
2345
|
-
class Po extends
|
2344
|
+
], Se);
|
2345
|
+
class Po extends Se {
|
2346
2346
|
constructor() {
|
2347
2347
|
super(...arguments);
|
2348
2348
|
V(this, "id", j.CHECKBOX);
|
2349
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2349
|
+
V(this, "canvasRender", this.injector.createInstance(on));
|
2350
2350
|
V(this, "formulaInput", sr);
|
2351
2351
|
}
|
2352
2352
|
}
|
2353
|
-
class Ao extends
|
2353
|
+
class Ao extends Se {
|
2354
2354
|
constructor() {
|
2355
2355
|
super(...arguments);
|
2356
2356
|
V(this, "id", j.CUSTOM);
|
@@ -2358,7 +2358,7 @@ class Ao extends Ce {
|
|
2358
2358
|
}
|
2359
2359
|
}
|
2360
2360
|
const Lo = "data-validation.formula-input";
|
2361
|
-
class ko extends
|
2361
|
+
class ko extends Se {
|
2362
2362
|
constructor() {
|
2363
2363
|
super(...arguments);
|
2364
2364
|
V(this, "id", j.DATE);
|
@@ -2367,14 +2367,14 @@ class ko extends Ce {
|
|
2367
2367
|
V(this, "dropdownType", ve.DATE);
|
2368
2368
|
}
|
2369
2369
|
}
|
2370
|
-
class No extends
|
2370
|
+
class No extends Se {
|
2371
2371
|
constructor() {
|
2372
2372
|
super(...arguments);
|
2373
2373
|
V(this, "id", j.DECIMAL);
|
2374
2374
|
V(this, "formulaInput", Pt);
|
2375
2375
|
}
|
2376
2376
|
}
|
2377
|
-
const Er = 4, Uo = 0, $t = 4, Dr = 4,
|
2377
|
+
const Er = 4, Uo = 0, $t = 4, Dr = 4, an = 6, Ot = 6, De = 14;
|
2378
2378
|
function Fo(e, t) {
|
2379
2379
|
const r = Zr.getTextSize(e, t), n = r.width + Er * 2, { ba: i, bd: o } = r, a = i + o;
|
2380
2380
|
return {
|
@@ -2384,14 +2384,14 @@ function Fo(e, t) {
|
|
2384
2384
|
};
|
2385
2385
|
}
|
2386
2386
|
function jt(e, t, r, n) {
|
2387
|
-
const i =
|
2387
|
+
const i = De + an * 2, o = r - i, a = n - Ot * 2, l = e.map((c) => ({
|
2388
2388
|
layout: Fo(c, t),
|
2389
2389
|
text: c
|
2390
2390
|
}));
|
2391
2391
|
let s;
|
2392
2392
|
const d = [];
|
2393
2393
|
l.forEach((c) => {
|
2394
|
-
const { layout:
|
2394
|
+
const { layout: _ } = c, { width: p, height: b } = _;
|
2395
2395
|
!s || s.width + p + $t > o ? (s = {
|
2396
2396
|
width: p,
|
2397
2397
|
height: b,
|
@@ -2405,8 +2405,8 @@ function jt(e, t, r, n) {
|
|
2405
2405
|
}), s.width = s.width + p + $t);
|
2406
2406
|
});
|
2407
2407
|
let u = 0, h = 0;
|
2408
|
-
return d.forEach((c,
|
2409
|
-
h = Math.max(h, c.width),
|
2408
|
+
return d.forEach((c, _) => {
|
2409
|
+
h = Math.max(h, c.width), _ === d.length - 1 ? u += c.height : u += c.height + Dr;
|
2410
2410
|
}), {
|
2411
2411
|
lines: d,
|
2412
2412
|
totalHeight: u,
|
@@ -2424,7 +2424,7 @@ class Bo extends Kr {
|
|
2424
2424
|
width: l.width,
|
2425
2425
|
height: l.height,
|
2426
2426
|
radius: xo,
|
2427
|
-
fill: o ||
|
2427
|
+
fill: o || Te
|
2428
2428
|
}), t.translateWithPrecision(Er, l.ba), t.font = n, t.fillStyle = a, t.fillText(s, 0, 0), t.restore();
|
2429
2429
|
}
|
2430
2430
|
}
|
@@ -2434,7 +2434,7 @@ var Wo = Object.getOwnPropertyDescriptor, Ho = (e, t, r, n) => {
|
|
2434
2434
|
return i;
|
2435
2435
|
}, St = (e, t) => (r, n) => t(r, n, e);
|
2436
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");
|
2437
|
-
let
|
2437
|
+
let sn = class {
|
2438
2438
|
constructor(e, t, r, n) {
|
2439
2439
|
V(this, "zIndex");
|
2440
2440
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2448,34 +2448,34 @@ let an = class {
|
|
2448
2448
|
return `${e}.${t}`;
|
2449
2449
|
}
|
2450
2450
|
_drawDownIcon(e, t, r, n, i) {
|
2451
|
-
const o = r -
|
2451
|
+
const o = r - De + 4;
|
2452
2452
|
let a = 4;
|
2453
2453
|
switch (i) {
|
2454
2454
|
case de.MIDDLE:
|
2455
|
-
a = (n -
|
2455
|
+
a = (n - De) / 2 + 4;
|
2456
2456
|
break;
|
2457
2457
|
case de.BOTTOM:
|
2458
|
-
a = n -
|
2458
|
+
a = n - De + 4;
|
2459
2459
|
break;
|
2460
2460
|
}
|
2461
2461
|
e.save(), e.translateWithPrecision(t.startX + o, t.startY + a), e.fillStyle = "#565656", e.fill($o), e.restore();
|
2462
2462
|
}
|
2463
2463
|
// eslint-disable-next-line max-lines-per-function
|
2464
2464
|
drawWith(e, t, r, n) {
|
2465
|
-
var
|
2466
|
-
const { primaryWithCoord: i, row: o, col: a, style: l, data: s, subUnitId: d } = t, u = i.isMergedMainCell ? i.mergeInfo : i, h = s == null ? void 0 : s.fontRenderExtension, { leftOffset: c = 0, rightOffset:
|
2467
|
-
if (!C)
|
2468
|
-
return;
|
2469
|
-
const v = this._dataValidationModel.getValidator(C.type);
|
2465
|
+
var re, ae;
|
2466
|
+
const { primaryWithCoord: i, row: o, col: a, style: l, data: s, subUnitId: d } = t, u = i.isMergedMainCell ? i.mergeInfo : i, h = s == null ? void 0 : s.fontRenderExtension, { leftOffset: c = 0, rightOffset: _ = 0, topOffset: p = 0, downOffset: b = 0 } = h || {}, y = this._ensureMap(d), g = this._generateKey(o, a), v = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, o, a);
|
2470
2467
|
if (!v)
|
2471
2468
|
return;
|
2469
|
+
const f = this._dataValidationModel.getValidator(v.type);
|
2470
|
+
if (!f)
|
2471
|
+
return;
|
2472
2472
|
const I = {
|
2473
2473
|
startX: u.startX + c,
|
2474
|
-
endX: u.endX -
|
2474
|
+
endX: u.endX - _,
|
2475
2475
|
startY: u.startY + p,
|
2476
2476
|
endY: u.endY - b
|
2477
|
-
}, w = I.endX - I.startX,
|
2478
|
-
this._drawDownIcon(e, I, w,
|
2477
|
+
}, w = I.endX - I.startX, S = I.endY - I.startY, { cl: R } = l || {}, P = (re = typeof R == "object" ? R == null ? void 0 : R.rgb : R) != null ? re : "#000", N = Oe(l != null ? l : void 0), { vt: E, ht: T } = l || {}, O = E != null ? E : de.MIDDLE, A = (ae = ie(s)) != null ? ae : "", k = f.parseCellValue(A), H = f.getListWithColorMap(v), B = jt(k, N, w, S);
|
2478
|
+
this._drawDownIcon(e, I, w, S, O), e.save(), e.translateWithPrecision(I.startX, I.startY), e.beginPath(), e.rect(0, 0, w - De, S), e.clip(), e.translateWithPrecision(an, Ot);
|
2479
2479
|
let J = 0;
|
2480
2480
|
switch (O) {
|
2481
2481
|
case de.MIDDLE:
|
@@ -2485,7 +2485,7 @@ let an = class {
|
|
2485
2485
|
J = B.contentHeight - B.totalHeight;
|
2486
2486
|
break;
|
2487
2487
|
}
|
2488
|
-
e.translateWithPrecision(0, J), B.lines.forEach((he,
|
2488
|
+
e.translateWithPrecision(0, J), B.lines.forEach((he, G) => {
|
2489
2489
|
e.save();
|
2490
2490
|
const { width: Z, height: fe, items: Q } = he;
|
2491
2491
|
let q = 0;
|
@@ -2497,18 +2497,18 @@ let an = class {
|
|
2497
2497
|
q = (B.contentWidth - Z) / 2;
|
2498
2498
|
break;
|
2499
2499
|
}
|
2500
|
-
e.translate(q,
|
2501
|
-
e.save(), e.translateWithPrecision(
|
2500
|
+
e.translate(q, G * (fe + Dr)), Q.forEach((z) => {
|
2501
|
+
e.save(), e.translateWithPrecision(z.left, 0), Bo.drawWith(e, {
|
2502
2502
|
...N,
|
2503
|
-
info:
|
2504
|
-
color:
|
2505
|
-
fill: H[
|
2503
|
+
info: z,
|
2504
|
+
color: P,
|
2505
|
+
fill: H[z.text]
|
2506
2506
|
}), e.restore();
|
2507
2507
|
}), e.restore();
|
2508
2508
|
}), e.restore(), y.set(g, {
|
2509
2509
|
left: I.startX,
|
2510
2510
|
top: I.startY,
|
2511
|
-
width: B.contentWidth +
|
2511
|
+
width: B.contentWidth + an + De,
|
2512
2512
|
height: B.contentHeight + Ot * 2
|
2513
2513
|
});
|
2514
2514
|
}
|
@@ -2519,14 +2519,14 @@ let an = class {
|
|
2519
2519
|
endX: h.endX - s,
|
2520
2520
|
startY: h.startY + d,
|
2521
2521
|
endY: h.endY - u
|
2522
|
-
},
|
2523
|
-
if (!
|
2522
|
+
}, _ = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2523
|
+
if (!_)
|
2524
2524
|
return;
|
2525
|
-
const p = this._dataValidationModel.getValidator(
|
2525
|
+
const p = this._dataValidationModel.getValidator(_.type);
|
2526
2526
|
if (!p)
|
2527
2527
|
return;
|
2528
|
-
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w =
|
2529
|
-
return jt(
|
2528
|
+
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w = ie(n)) != null ? w : "", v = p.parseCellValue(g), f = Oe(r != null ? r : void 0);
|
2529
|
+
return jt(v, f, b, y).cellAutoHeight;
|
2530
2530
|
}
|
2531
2531
|
calcCellAutoWidth(e) {
|
2532
2532
|
var w;
|
@@ -2535,18 +2535,18 @@ let an = class {
|
|
2535
2535
|
endX: h.endX - s,
|
2536
2536
|
startY: h.startY + d,
|
2537
2537
|
endY: h.endY - u
|
2538
|
-
},
|
2539
|
-
if (!
|
2538
|
+
}, _ = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2539
|
+
if (!_)
|
2540
2540
|
return;
|
2541
|
-
const p = this._dataValidationModel.getValidator(
|
2541
|
+
const p = this._dataValidationModel.getValidator(_.type);
|
2542
2542
|
if (!p)
|
2543
2543
|
return;
|
2544
|
-
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w =
|
2545
|
-
return jt(
|
2544
|
+
const b = c.endX - c.startX, y = c.endY - c.startY, g = (w = ie(n)) != null ? w : "", v = p.parseCellValue(g), f = Oe(r != null ? r : void 0);
|
2545
|
+
return jt(v, f, b, y).calcAutoWidth;
|
2546
2546
|
}
|
2547
2547
|
isHit(e, t) {
|
2548
2548
|
const { primaryWithCoord: r } = t, n = r.isMergedMainCell ? r.mergeInfo : r, { endX: i } = n, { x: o } = e;
|
2549
|
-
return o >= i -
|
2549
|
+
return o >= i - De && o <= i;
|
2550
2550
|
}
|
2551
2551
|
onPointerDown(e, t) {
|
2552
2552
|
if (t.button === 2)
|
@@ -2568,17 +2568,17 @@ let an = class {
|
|
2568
2568
|
return (n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null ? void 0 : n.setCursor(ze.DEFAULT);
|
2569
2569
|
}
|
2570
2570
|
};
|
2571
|
-
|
2572
|
-
St(0,
|
2571
|
+
sn = Ho([
|
2572
|
+
St(0, ne),
|
2573
2573
|
St(1, ce),
|
2574
|
-
St(2, M(
|
2575
|
-
St(3, M(
|
2576
|
-
],
|
2577
|
-
class jo extends
|
2574
|
+
St(2, M(Fe)),
|
2575
|
+
St(3, M(oe))
|
2576
|
+
], sn);
|
2577
|
+
class jo extends Se {
|
2578
2578
|
constructor() {
|
2579
2579
|
super(...arguments);
|
2580
2580
|
V(this, "id", j.LIST_MULTIPLE);
|
2581
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2581
|
+
V(this, "canvasRender", this.injector.createInstance(sn));
|
2582
2582
|
V(this, "dropdownType", ve.MULTIPLE_LIST);
|
2583
2583
|
}
|
2584
2584
|
}
|
@@ -2587,7 +2587,7 @@ var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, r, n) => {
|
|
2587
2587
|
(a = e[o]) && (i = a(i) || i);
|
2588
2588
|
return i;
|
2589
2589
|
}, at = (e, t) => (r, n) => t(r, n, e);
|
2590
|
-
const
|
2590
|
+
const Ye = 4, Ct = 4, ge = 14, Yt = 1, we = 6, Xe = 3, Xt = 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");
|
2591
2591
|
function Wn(e, t, r, n, i, o, a = !0) {
|
2592
2592
|
let l = 0;
|
2593
2593
|
const s = a ? Xe : 0;
|
@@ -2612,12 +2612,12 @@ function Wn(e, t, r, n, i, o, a = !0) {
|
|
2612
2612
|
d = e - r;
|
2613
2613
|
break;
|
2614
2614
|
}
|
2615
|
-
return d = Math.max(
|
2615
|
+
return d = Math.max(we, d), {
|
2616
2616
|
paddingLeft: d,
|
2617
2617
|
paddingTop: l
|
2618
2618
|
};
|
2619
2619
|
}
|
2620
|
-
let
|
2620
|
+
let ln = class {
|
2621
2621
|
constructor(e, t, r, n, i) {
|
2622
2622
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2623
2623
|
V(this, "zIndex");
|
@@ -2631,7 +2631,7 @@ let sn = class {
|
|
2631
2631
|
return `${e}.${t}`;
|
2632
2632
|
}
|
2633
2633
|
_drawDownIcon(e, t, r, n, i, o, a) {
|
2634
|
-
const { t: l =
|
2634
|
+
const { t: l = te.pd.t, b: s = te.pd.b } = a, d = r - ge;
|
2635
2635
|
let u;
|
2636
2636
|
switch (o) {
|
2637
2637
|
case de.MIDDLE:
|
@@ -2648,81 +2648,81 @@ let sn = class {
|
|
2648
2648
|
}
|
2649
2649
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2650
2650
|
drawWith(e, t, r) {
|
2651
|
-
var H, B, J,
|
2651
|
+
var H, B, J, re, ae, he;
|
2652
2652
|
const { primaryWithCoord: n, row: i, col: o, style: a, data: l, subUnitId: s } = t, d = n.isMergedMainCell ? n.mergeInfo : n, u = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, i, o);
|
2653
2653
|
if (!u)
|
2654
2654
|
return;
|
2655
2655
|
const h = this._dataValidationModel.getValidator(u.type);
|
2656
2656
|
if (!h)
|
2657
2657
|
return;
|
2658
|
-
const c = l == null ? void 0 : l.fontRenderExtension, { leftOffset:
|
2658
|
+
const c = l == null ? void 0 : l.fontRenderExtension, { leftOffset: _ = 0, rightOffset: p = 0, topOffset: b = 0, downOffset: y = 0 } = c || {};
|
2659
2659
|
if (!u || !h || !h || h.id.indexOf(j.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
2660
2660
|
return;
|
2661
2661
|
const g = {
|
2662
|
-
startX: d.startX +
|
2662
|
+
startX: d.startX + _,
|
2663
2663
|
endX: d.endX - p,
|
2664
2664
|
startY: d.startY + b,
|
2665
2665
|
endY: d.endY - y
|
2666
|
-
},
|
2667
|
-
let { tb: E, vt: T, ht: O, pd:
|
2668
|
-
E = E != null ? E : me.WRAP, T = T != null ? T : de.BOTTOM, O = O != null ? O :
|
2669
|
-
const k =
|
2666
|
+
}, v = g.endX - g.startX, f = g.endY - g.startY, I = this._ensureMap(s), w = this._generateKey(i, o), S = h.getListWithColor(u), R = ie(l), P = `${R != null ? R : ""}`, N = S.find((G) => G.label === P);
|
2667
|
+
let { tb: E, vt: T, ht: O, pd: A } = a || {};
|
2668
|
+
E = E != null ? E : me.WRAP, T = T != null ? T : de.BOTTOM, O = O != null ? O : te.ht, A = A != null ? A : te.pd;
|
2669
|
+
const k = Oe(a).fontCache;
|
2670
2670
|
if (u.renderMode === se.ARROW) {
|
2671
|
-
const { l:
|
2672
|
-
|
2671
|
+
const { l: G = te.pd.l, t: Z = te.pd.t, r: fe = te.pd.r, b: Q = te.pd.b } = A, q = v - G - fe - ge - 4, z = new it(
|
2672
|
+
P,
|
2673
2673
|
k,
|
2674
2674
|
E === me.WRAP,
|
2675
2675
|
q,
|
2676
2676
|
1 / 0
|
2677
2677
|
);
|
2678
|
-
|
2679
|
-
const D =
|
2680
|
-
this._drawDownIcon(e, g,
|
2681
|
-
text:
|
2678
|
+
z.calculate();
|
2679
|
+
const D = z.getTotalWidth(), F = z.getTotalHeight(), { paddingTop: m, paddingLeft: L } = Wn(q, f - Z - Q, D, F, T, O, !0);
|
2680
|
+
this._drawDownIcon(e, g, v, f, F, T, A), e.save(), e.translateWithPrecision(g.startX + G, g.startY + Z), e.beginPath(), e.rect(0, 0, v - G - fe, f - Z - Q), e.clip(), e.translateWithPrecision(0, m), e.save(), e.translateWithPrecision(L, 0), e.beginPath(), e.rect(0, 0, q, F), e.clip(), En.drawWith(e, {
|
2681
|
+
text: P,
|
2682
2682
|
fontStyle: k,
|
2683
2683
|
width: q,
|
2684
|
-
height:
|
2684
|
+
height: F,
|
2685
2685
|
color: (H = a == null ? void 0 : a.cl) == null ? void 0 : H.rgb,
|
2686
2686
|
strokeLine: !!((B = a == null ? void 0 : a.st) != null && B.s),
|
2687
2687
|
underline: !!((J = a == null ? void 0 : a.ul) != null && J.s),
|
2688
2688
|
warp: E === me.WRAP,
|
2689
2689
|
hAlign: Re.LEFT
|
2690
|
-
},
|
2691
|
-
left: g.endX
|
2690
|
+
}, z), e.restore(), e.restore(), I.set(w, {
|
2691
|
+
left: g.endX - ge + r.rowHeaderWidth,
|
2692
2692
|
top: g.startY + Z + r.columnHeaderHeight,
|
2693
2693
|
width: ge,
|
2694
|
-
height:
|
2694
|
+
height: f - Z - Q
|
2695
2695
|
});
|
2696
2696
|
} else {
|
2697
|
-
e.save(), e.translateWithPrecision(g.startX, g.startY), e.beginPath(), e.rect(0, 0,
|
2698
|
-
const
|
2699
|
-
|
2697
|
+
e.save(), e.translateWithPrecision(g.startX, g.startY), e.beginPath(), e.rect(0, 0, v, f), e.clip();
|
2698
|
+
const G = v - we * 2 - Ye - ge - 4, Z = new it(
|
2699
|
+
P,
|
2700
2700
|
k,
|
2701
2701
|
E === me.WRAP,
|
2702
|
-
|
2702
|
+
G,
|
2703
2703
|
1 / 0
|
2704
2704
|
);
|
2705
2705
|
Z.calculate();
|
2706
|
-
const fe = Z.getTotalWidth(), Q = Z.getTotalHeight(), q = Q +
|
2707
|
-
e.translateWithPrecision(
|
2708
|
-
width:
|
2706
|
+
const fe = Z.getTotalWidth(), Q = Z.getTotalHeight(), q = Q + Yt * 2, z = Math.max(v - we * 2, 1), { paddingTop: D } = Wn(z, f, fe, q, T, O);
|
2707
|
+
e.translateWithPrecision(we, D), zn.drawWith(e, {
|
2708
|
+
width: z,
|
2709
2709
|
height: q,
|
2710
|
-
fill: (N == null ? void 0 : N.color) ||
|
2711
|
-
radius:
|
2712
|
-
}), e.save(), e.translateWithPrecision(
|
2713
|
-
text:
|
2710
|
+
fill: (N == null ? void 0 : N.color) || Te,
|
2711
|
+
radius: Xt
|
2712
|
+
}), e.save(), e.translateWithPrecision(Ye, Yt), e.beginPath(), e.rect(0, 0, G, Q), e.clip(), En.drawWith(e, {
|
2713
|
+
text: P,
|
2714
2714
|
fontStyle: k,
|
2715
|
-
width:
|
2715
|
+
width: G,
|
2716
2716
|
height: Q,
|
2717
|
-
color: (
|
2718
|
-
strokeLine: !!((
|
2717
|
+
color: (re = a == null ? void 0 : a.cl) == null ? void 0 : re.rgb,
|
2718
|
+
strokeLine: !!((ae = a == null ? void 0 : a.st) != null && ae.s),
|
2719
2719
|
underline: !!((he = a == null ? void 0 : a.ul) != null && he.s),
|
2720
2720
|
warp: E === me.WRAP,
|
2721
2721
|
hAlign: Re.LEFT
|
2722
|
-
}, Z), e.restore(), e.translateWithPrecision(
|
2723
|
-
left: g.startX +
|
2722
|
+
}, Z), e.restore(), e.translateWithPrecision(G + Ye + 4, (Q - Ct) / 2), e.fillStyle = Zo, e.fill(Bn), e.restore(), I.set(w, {
|
2723
|
+
left: g.startX + we + r.rowHeaderWidth,
|
2724
2724
|
top: g.startY + D + r.columnHeaderHeight,
|
2725
|
-
width:
|
2725
|
+
width: z,
|
2726
2726
|
height: q
|
2727
2727
|
});
|
2728
2728
|
}
|
@@ -2731,64 +2731,64 @@ let sn = class {
|
|
2731
2731
|
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2732
2732
|
if (!c || c.renderMode === se.TEXT)
|
2733
2733
|
return;
|
2734
|
-
const
|
2734
|
+
const _ = {
|
2735
2735
|
startX: a.startX + s,
|
2736
2736
|
endX: a.endX - d,
|
2737
2737
|
startY: a.startY + u,
|
2738
2738
|
endY: a.endY - h
|
2739
|
-
}, p =
|
2740
|
-
let { tb: g, pd:
|
2741
|
-
const { t:
|
2739
|
+
}, p = _.endX - _.startX, b = ie(n), y = `${b != null ? b : ""}`;
|
2740
|
+
let { tb: g, pd: v } = r || {};
|
2741
|
+
const { t: f = te.pd.t, b: I = te.pd.b } = v != null ? v : {};
|
2742
2742
|
if (g = g != null ? g : me.WRAP, c.renderMode === se.ARROW) {
|
2743
|
-
const w = p - ge,
|
2743
|
+
const { l: w = te.pd.l, r: S = te.pd.r } = v != null ? v : {}, R = p - w - S - ge - 4, P = new it(
|
2744
2744
|
y,
|
2745
|
-
|
2745
|
+
Oe(r).fontCache,
|
2746
2746
|
g === me.WRAP,
|
2747
|
-
|
2747
|
+
R,
|
2748
2748
|
1 / 0
|
2749
2749
|
);
|
2750
|
-
return
|
2750
|
+
return P.calculate(), P.getTotalHeight() + f + I + Xe * 2;
|
2751
2751
|
} else {
|
2752
|
-
const w = Math.max(p -
|
2752
|
+
const w = Math.max(p - we * 2 - Ye - ge - 4, 10), S = new it(
|
2753
2753
|
y,
|
2754
|
-
|
2754
|
+
Oe(r).fontCache,
|
2755
2755
|
g === me.WRAP,
|
2756
2756
|
w,
|
2757
2757
|
1 / 0
|
2758
2758
|
);
|
2759
|
-
return
|
2759
|
+
return S.calculate(), S.getTotalHeight() + Xe * 2 + Yt * 2;
|
2760
2760
|
}
|
2761
2761
|
}
|
2762
2762
|
calcCellAutoWidth(e) {
|
2763
2763
|
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2764
2764
|
if (!c || c.renderMode === se.TEXT)
|
2765
2765
|
return;
|
2766
|
-
const
|
2766
|
+
const _ = {
|
2767
2767
|
startX: a.startX + s,
|
2768
2768
|
endX: a.endX - d,
|
2769
2769
|
startY: a.startY + u,
|
2770
2770
|
endY: a.endY - h
|
2771
|
-
}, p =
|
2772
|
-
let { tb: g, pd:
|
2773
|
-
const { l:
|
2771
|
+
}, p = _.endX - _.startX, b = ie(n), y = `${b != null ? b : ""}`;
|
2772
|
+
let { tb: g, pd: v } = r || {};
|
2773
|
+
const { l: f = te.pd.l, r: I = te.pd.r } = v != null ? v : {};
|
2774
2774
|
g = g != null ? g : me.WRAP;
|
2775
|
-
let w =
|
2775
|
+
let w = we * 2 + ge;
|
2776
2776
|
switch (c.renderMode) {
|
2777
2777
|
case se.ARROW:
|
2778
|
-
w = ge +
|
2778
|
+
w = ge + 4 + I + f;
|
2779
2779
|
break;
|
2780
2780
|
case se.CUSTOM:
|
2781
|
-
w = ge +
|
2781
|
+
w = ge + we * 2 + Ye * 2 + I + f + Xt / 2 + 1;
|
2782
2782
|
break;
|
2783
2783
|
// default is CUSTOM
|
2784
2784
|
default:
|
2785
|
-
w = ge +
|
2785
|
+
w = ge + we * 2 + Ye * 2 + I + f + Xt / 2 + 1;
|
2786
2786
|
}
|
2787
|
-
const
|
2787
|
+
const S = p - w, R = new it(
|
2788
2788
|
y,
|
2789
|
-
|
2789
|
+
Oe(r).fontCache,
|
2790
2790
|
g === me.WRAP,
|
2791
|
-
|
2791
|
+
S,
|
2792
2792
|
1 / 0
|
2793
2793
|
);
|
2794
2794
|
return R.calculate(), R.getTotalWidth() + w;
|
@@ -2797,8 +2797,8 @@ let sn = class {
|
|
2797
2797
|
const { subUnitId: r, row: n, col: i } = t, a = this._ensureMap(r).get(this._generateKey(n, i)), l = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, n, i);
|
2798
2798
|
if (!l || !a || l.renderMode === se.TEXT)
|
2799
2799
|
return !1;
|
2800
|
-
const { top: s, left: d, width: u, height: h } = a, { x: c, y:
|
2801
|
-
return c >= d && c <= d + u &&
|
2800
|
+
const { top: s, left: d, width: u, height: h } = a, { x: c, y: _ } = e;
|
2801
|
+
return c >= d && c <= d + u && _ >= s && _ <= s + h;
|
2802
2802
|
}
|
2803
2803
|
onPointerDown(e, t) {
|
2804
2804
|
if (t.button === 2)
|
@@ -2820,31 +2820,31 @@ let sn = class {
|
|
2820
2820
|
(n = (r = Ke(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(ze.DEFAULT);
|
2821
2821
|
}
|
2822
2822
|
};
|
2823
|
-
|
2823
|
+
ln = Xo([
|
2824
2824
|
at(0, ce),
|
2825
2825
|
at(1, M(ue)),
|
2826
|
-
at(2,
|
2827
|
-
at(3, M(
|
2828
|
-
at(4, M(
|
2829
|
-
],
|
2830
|
-
class Ko extends
|
2826
|
+
at(2, ne),
|
2827
|
+
at(3, M(Fe)),
|
2828
|
+
at(4, M(oe))
|
2829
|
+
], ln);
|
2830
|
+
class Ko extends Se {
|
2831
2831
|
constructor() {
|
2832
2832
|
super(...arguments);
|
2833
2833
|
V(this, "id", j.LIST);
|
2834
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2834
|
+
V(this, "canvasRender", this.injector.createInstance(ln));
|
2835
2835
|
V(this, "dropdownType", ve.LIST);
|
2836
2836
|
V(this, "optionsInput", Dt.componentKey);
|
2837
|
-
V(this, "formulaInput",
|
2837
|
+
V(this, "formulaInput", pn);
|
2838
2838
|
}
|
2839
2839
|
}
|
2840
|
-
class zo extends
|
2840
|
+
class zo extends Se {
|
2841
2841
|
constructor() {
|
2842
2842
|
super(...arguments);
|
2843
2843
|
V(this, "id", j.TEXT_LENGTH);
|
2844
2844
|
V(this, "formulaInput", Pt);
|
2845
2845
|
}
|
2846
2846
|
}
|
2847
|
-
class Go extends
|
2847
|
+
class Go extends Se {
|
2848
2848
|
constructor() {
|
2849
2849
|
super(...arguments);
|
2850
2850
|
V(this, "id", j.WHOLE);
|
@@ -2855,8 +2855,8 @@ var qo = Object.getOwnPropertyDescriptor, Jo = (e, t, r, n) => {
|
|
2855
2855
|
for (var i = n > 1 ? void 0 : n ? qo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2856
2856
|
(a = e[o]) && (i = a(i) || i);
|
2857
2857
|
return i;
|
2858
|
-
},
|
2859
|
-
let nt = class extends
|
2858
|
+
}, Zt = (e, t) => (r, n) => t(r, n, e);
|
2859
|
+
let nt = class extends cn {
|
2860
2860
|
constructor(e, t, r) {
|
2861
2861
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = r, this._initComponents(), this._registerValidatorViews();
|
2862
2862
|
}
|
@@ -2891,15 +2891,15 @@ let nt = class extends dn {
|
|
2891
2891
|
}
|
2892
2892
|
};
|
2893
2893
|
nt = Jo([
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2894
|
+
Zt(0, M(be)),
|
2895
|
+
Zt(1, M(fn)),
|
2896
|
+
Zt(2, M(Me))
|
2897
2897
|
], nt);
|
2898
2898
|
var Qo = Object.getOwnPropertyDescriptor, ea = (e, t, r, n) => {
|
2899
2899
|
for (var i = n > 1 ? void 0 : n ? Qo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2900
2900
|
(a = e[o]) && (i = a(i) || i);
|
2901
2901
|
return i;
|
2902
|
-
},
|
2902
|
+
}, Kt = (e, t) => (r, n) => t(r, n, e);
|
2903
2903
|
const ta = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2904
2904
|
var wt;
|
2905
2905
|
let Hn = (wt = class extends Zn {
|
@@ -2910,12 +2910,12 @@ let Hn = (wt = class extends Zn {
|
|
2910
2910
|
bt,
|
2911
2911
|
this._config
|
2912
2912
|
);
|
2913
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
2913
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Sn, o);
|
2914
2914
|
}
|
2915
2915
|
onStarting() {
|
2916
2916
|
[
|
2917
|
-
[
|
2918
|
-
[
|
2917
|
+
[_e],
|
2918
|
+
[Ue],
|
2919
2919
|
[ht],
|
2920
2920
|
[Je],
|
2921
2921
|
[tt],
|
@@ -2928,15 +2928,15 @@ let Hn = (wt = class extends Zn {
|
|
2928
2928
|
kt,
|
2929
2929
|
Lt,
|
2930
2930
|
_r,
|
2931
|
-
|
2932
|
-
|
2931
|
+
Cn,
|
2932
|
+
Be,
|
2933
2933
|
mr
|
2934
2934
|
].forEach((e) => {
|
2935
2935
|
this._commandService.registerCommand(e);
|
2936
2936
|
});
|
2937
2937
|
}
|
2938
2938
|
onReady() {
|
2939
|
-
this._injector.get(Qe), this._injector.get(et), this._injector.get(
|
2939
|
+
this._injector.get(Qe), this._injector.get(et), this._injector.get(Fe).registerRenderModule(
|
2940
2940
|
X.UNIVER_SHEET,
|
2941
2941
|
[Et]
|
2942
2942
|
);
|
@@ -2949,15 +2949,15 @@ let Hn = (wt = class extends Zn {
|
|
2949
2949
|
}
|
2950
2950
|
}, V(wt, "pluginName", ta), V(wt, "type", X.UNIVER_SHEET), wt);
|
2951
2951
|
Hn = ea([
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2952
|
+
Kt(1, M(be)),
|
2953
|
+
Kt(2, ne),
|
2954
|
+
Kt(3, dn)
|
2955
2955
|
], Hn);
|
2956
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) => {
|
2957
2957
|
for (var i = n > 1 ? void 0 : n ? ra(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2958
2958
|
(a = e[o]) && (i = a(i) || i);
|
2959
2959
|
return i;
|
2960
|
-
},
|
2960
|
+
}, zt = (e, t) => (r, n) => t(r, n, e), Vr = (e, t, r) => ia(e, typeof t != "symbol" ? t + "" : t, r);
|
2961
2961
|
const aa = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2962
2962
|
let Tt = class extends Zn {
|
2963
2963
|
constructor(e = bt, t, r, n) {
|
@@ -2967,12 +2967,12 @@ let Tt = class extends Zn {
|
|
2967
2967
|
bt,
|
2968
2968
|
this._config
|
2969
2969
|
);
|
2970
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
2970
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Sn, o);
|
2971
2971
|
}
|
2972
2972
|
onStarting() {
|
2973
2973
|
[
|
2974
|
-
[
|
2975
|
-
[
|
2974
|
+
[_e],
|
2975
|
+
[Ue],
|
2976
2976
|
[ht],
|
2977
2977
|
[Je],
|
2978
2978
|
[tt],
|
@@ -2986,15 +2986,15 @@ let Tt = class extends Zn {
|
|
2986
2986
|
kt,
|
2987
2987
|
Lt,
|
2988
2988
|
_r,
|
2989
|
-
|
2990
|
-
|
2989
|
+
Cn,
|
2990
|
+
Be,
|
2991
2991
|
mr
|
2992
2992
|
].forEach((e) => {
|
2993
2993
|
this._commandService.registerCommand(e);
|
2994
2994
|
});
|
2995
2995
|
}
|
2996
2996
|
onReady() {
|
2997
|
-
this._injector.get(Qe), this._injector.get(et), this._injector.get(qe), this._injector.get(ht), this._injector.get(
|
2997
|
+
this._injector.get(Qe), this._injector.get(et), this._injector.get(qe), this._injector.get(ht), this._injector.get(Fe).registerRenderModule(
|
2998
2998
|
X.UNIVER_SHEET,
|
2999
2999
|
[Et]
|
3000
3000
|
);
|
@@ -3010,12 +3010,12 @@ Vr(Tt, "pluginName", aa);
|
|
3010
3010
|
Vr(Tt, "type", X.UNIVER_SHEET);
|
3011
3011
|
Tt = oa([
|
3012
3012
|
jr(li),
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3013
|
+
zt(1, M(be)),
|
3014
|
+
zt(2, ne),
|
3015
|
+
zt(3, dn)
|
3016
3016
|
], Tt);
|
3017
3017
|
export {
|
3018
|
-
|
3018
|
+
Se as BaseSheetDataValidatorView,
|
3019
3019
|
Hn as UniverSheetsDataValidationMobileUIPlugin,
|
3020
3020
|
Tt as UniverSheetsDataValidationUIPlugin
|
3021
3021
|
};
|