@univerjs/sheets-data-validation-ui 0.10.8 → 0.10.9-nightly.202509260614
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 +870 -870
- package/lib/index.js +870 -870
- package/lib/types/views/widgets/dropdown-widget.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
@@ -1,17 +1,17 @@
|
|
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
|
5
|
-
import { DeviceInputEventType as
|
6
|
-
import { SheetInterceptorService as
|
7
|
-
import { SheetDataValidationModel as ie, SheetsDataValidationValidatorService as Qr, getDataValidationCellValue as Ut, getCellValueOrigin as re, serializeListOptions as er, createDefaultNewRule as tr, AddSheetDataValidationCommand as
|
8
|
-
import { DataValidatorRegistryService as Me, DataValidatorDropdownType 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 de, Inject as E, LocaleService as ce, DataValidationErrorStyle as lt, DataValidationStatus as Ze, ICommandService as ee, Injector as be, IConfigService as dn, DataValidationRenderMode as ae, 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 le, HorizontalAlign as Re, DEFAULT_STYLES as Q, WrapStrategy as fe, Plugin as Zn, merge as Kn, DependentOn as jr } from "@univerjs/core";
|
5
|
+
import { DeviceInputEventType as pt, 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 ie, SheetsDataValidationValidatorService as Qr, getDataValidationCellValue as Ut, getCellValueOrigin as re, 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 gn, 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 pe, DataValidationModel as pn, 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 gi, IMenuManagerService as pi, useDependency as F, 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
|
13
|
-
import { Button as Ge, FormLayout as Y, RadioGroup as
|
14
|
-
import { createElement as Ie, forwardRef as
|
12
|
+
import { ISheetCellDropdownManagerService as Si, IEditorBridgeService as gr, 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 pr, 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 gt, useState as H, useMemo as ct, useEffect as ke } from "react";
|
15
15
|
import { jsxs as $, Fragment as ut, jsx as S } from "react/jsx-runtime";
|
16
16
|
import { deserializeRangeWithSheet as Oi, serializeRange as vr } from "@univerjs/engine-formula";
|
17
17
|
import { RangeSelector as Ti, FormulaEditor as fr } from "@univerjs/sheets-formula-ui";
|
@@ -19,18 +19,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 me = 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
|
+
me = Ai([
|
69
|
+
Nn(0, de),
|
70
|
+
Nn(1, lr)
|
71
|
+
], me);
|
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,18 +144,18 @@ let qe = class extends ye {
|
|
144
144
|
}
|
145
145
|
};
|
146
146
|
qe = ki([
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
147
|
+
He(0, E(un)),
|
148
|
+
He(1, E(ie)),
|
149
|
+
He(2, E(Me)),
|
150
|
+
He(3, ui),
|
151
|
+
He(4, E(ce)),
|
152
|
+
He(5, E(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--)
|
156
156
|
(a = e[o]) && (i = a(i) || i);
|
157
157
|
return i;
|
158
|
-
},
|
158
|
+
}, he = (e, t) => (r, n) => t(r, n, e);
|
159
159
|
const xt = (e) => {
|
160
160
|
if (e == null || typeof e == "boolean")
|
161
161
|
return;
|
@@ -179,15 +179,15 @@ function Fi(e, t) {
|
|
179
179
|
return "HH:mm:ss";
|
180
180
|
}
|
181
181
|
}
|
182
|
-
let
|
183
|
-
constructor(t, r, n, i, o, a, l, s, d, u,
|
182
|
+
let Ue = class extends ye {
|
183
|
+
constructor(t, r, n, i, o, a, l, s, d, u, g) {
|
184
184
|
super();
|
185
185
|
V(this, "_activeDropdown");
|
186
186
|
V(this, "_activeDropdown$", new fi());
|
187
187
|
V(this, "_currentPopup", null);
|
188
188
|
V(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
189
189
|
V(this, "_zenVisible", !1);
|
190
|
-
this._univerInstanceService = t, this._dataValidatorRegistryService = r, this._zenZoneService = n, this._dataValidationModel = i, this._sheetsSelectionsService = o, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService =
|
190
|
+
this._univerInstanceService = t, this._dataValidatorRegistryService = r, this._zenZoneService = n, this._dataValidationModel = i, this._sheetsSelectionsService = o, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService = g, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
|
191
191
|
this._activeDropdown$.complete();
|
192
192
|
});
|
193
193
|
}
|
@@ -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
|
222
|
+
var M, y, w, C;
|
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;
|
@@ -230,12 +230,12 @@ let Fe = class extends ye {
|
|
230
230
|
const u = this._dataValidatorRegistryService.getValidatorItem(d.type);
|
231
231
|
if (!(u != null && u.dropdownType))
|
232
232
|
return;
|
233
|
-
let
|
234
|
-
const c = async (
|
235
|
-
var
|
236
|
-
if (!
|
233
|
+
let g;
|
234
|
+
const c = async (p, I) => {
|
235
|
+
var D, T, k;
|
236
|
+
if (!p)
|
237
237
|
return !0;
|
238
|
-
const
|
238
|
+
const _ = p, v = s.getCell(n, i), R = _.format(I === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), A = (D = $n.parseDate(R)) == null ? void 0 : D.v, N = I === "time" ? A % 1 : A, O = l.getStyles().getStyleByCell(v), L = (k = (T = O == null ? void 0 : O.n) == null ? void 0 : T.pattern) != null ? k : "";
|
239
239
|
return d.errorStyle !== lt.STOP || await u.validator({
|
240
240
|
value: N,
|
241
241
|
unitId: o,
|
@@ -263,63 +263,63 @@ let Fe = class extends ye {
|
|
263
263
|
si: null,
|
264
264
|
s: {
|
265
265
|
n: {
|
266
|
-
pattern: Fi(I,
|
266
|
+
pattern: Fi(I, L)
|
267
267
|
}
|
268
268
|
}
|
269
269
|
}
|
270
270
|
}), await this._commandService.executeCommand(ft.id, {
|
271
271
|
visible: !1,
|
272
|
-
eventType:
|
272
|
+
eventType: pt.Keyboard,
|
273
273
|
unitId: o,
|
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 f;
|
278
278
|
switch (u.dropdownType) {
|
279
|
-
case
|
280
|
-
const
|
281
|
-
|
279
|
+
case pe.DATE: {
|
280
|
+
const p = re(s.getCellRaw(n, i)), I = xt(p), _ = !!((M = d.bizInfo) != null && M.showTime);
|
281
|
+
f = {
|
282
282
|
location: r,
|
283
283
|
type: "datepicker",
|
284
284
|
props: {
|
285
|
-
showTime:
|
286
|
-
onChange: (
|
285
|
+
showTime: _,
|
286
|
+
onChange: (v) => c(v, _ ? "datetime" : "date"),
|
287
287
|
defaultValue: I,
|
288
288
|
patternType: "date"
|
289
289
|
}
|
290
290
|
};
|
291
291
|
break;
|
292
292
|
}
|
293
|
-
case
|
294
|
-
const
|
295
|
-
|
293
|
+
case pe.TIME: {
|
294
|
+
const p = re(s.getCellRaw(n, i)), I = xt(p);
|
295
|
+
f = {
|
296
296
|
location: r,
|
297
297
|
type: "datepicker",
|
298
298
|
props: {
|
299
|
-
onChange: (
|
299
|
+
onChange: (_) => c(_, "time"),
|
300
300
|
defaultValue: I,
|
301
301
|
patternType: "time"
|
302
302
|
}
|
303
303
|
};
|
304
304
|
break;
|
305
305
|
}
|
306
|
-
case
|
307
|
-
const
|
308
|
-
|
306
|
+
case pe.DATETIME: {
|
307
|
+
const p = re(s.getCellRaw(n, i)), I = xt(p);
|
308
|
+
f = {
|
309
309
|
location: r,
|
310
310
|
type: "datepicker",
|
311
311
|
props: {
|
312
|
-
onChange: (
|
312
|
+
onChange: (_) => c(_, "datetime"),
|
313
313
|
defaultValue: I,
|
314
314
|
patternType: "datetime"
|
315
315
|
}
|
316
316
|
};
|
317
317
|
break;
|
318
318
|
}
|
319
|
-
case
|
320
|
-
case
|
321
|
-
const
|
322
|
-
const
|
319
|
+
case pe.LIST:
|
320
|
+
case pe.MULTIPLE_LIST: {
|
321
|
+
const p = u.dropdownType === pe.MULTIPLE_LIST, I = async (O) => {
|
322
|
+
const L = er(O), D = {
|
323
323
|
unitId: o,
|
324
324
|
subUnitId: a,
|
325
325
|
range: {
|
@@ -329,47 +329,47 @@ let Fe = class extends ye {
|
|
329
329
|
endRow: n
|
330
330
|
},
|
331
331
|
value: {
|
332
|
-
v:
|
332
|
+
v: L,
|
333
333
|
p: null,
|
334
334
|
f: null,
|
335
335
|
si: null
|
336
336
|
}
|
337
337
|
};
|
338
|
-
return this._commandService.executeCommand(st.id,
|
338
|
+
return this._commandService.executeCommand(st.id, D), this._editorBridgeService.isVisible().visible && await this._commandService.executeCommand(ft.id, {
|
339
339
|
visible: !1,
|
340
|
-
eventType:
|
340
|
+
eventType: pt.Keyboard,
|
341
341
|
unitId: o,
|
342
342
|
keycode: vt.ESC
|
343
|
-
}), !
|
344
|
-
},
|
345
|
-
this._commandService.executeCommand(
|
343
|
+
}), !p;
|
344
|
+
}, _ = (d == null ? void 0 : d.renderMode) === ae.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, v = u.getListWithColor(d, o, a), R = Ut(s.getCellRaw(n, i)), A = () => {
|
345
|
+
this._commandService.executeCommand(Be.id, {
|
346
346
|
ruleId: d.uid
|
347
|
-
}),
|
348
|
-
}, N =
|
349
|
-
label:
|
350
|
-
value:
|
351
|
-
color:
|
347
|
+
}), g == null || g.dispose();
|
348
|
+
}, N = v.map((O) => ({
|
349
|
+
label: O.label,
|
350
|
+
value: O.label,
|
351
|
+
color: _ || O.color ? O.color || Te : "transparent"
|
352
352
|
}));
|
353
|
-
|
353
|
+
f = {
|
354
354
|
location: r,
|
355
355
|
type: "list",
|
356
356
|
props: {
|
357
|
-
onChange: (
|
357
|
+
onChange: (O) => I(O),
|
358
358
|
options: N,
|
359
|
-
onEdit:
|
359
|
+
onEdit: A,
|
360
360
|
defaultValue: R,
|
361
|
-
multiple:
|
362
|
-
showEdit: (
|
361
|
+
multiple: p,
|
362
|
+
showEdit: (w = (y = this._configService.getConfig(Sn)) == null ? void 0 : y.showEditOnDropdown) != null ? w : !0
|
363
363
|
}
|
364
364
|
};
|
365
365
|
break;
|
366
366
|
}
|
367
|
-
case
|
368
|
-
|
367
|
+
case pe.CASCADE: {
|
368
|
+
f = {
|
369
369
|
type: "cascader",
|
370
370
|
props: {
|
371
371
|
onChange: (I) => {
|
372
|
-
const
|
372
|
+
const _ = {
|
373
373
|
unitId: o,
|
374
374
|
subUnitId: a,
|
375
375
|
range: {
|
@@ -385,9 +385,9 @@ let Fe = class extends ye {
|
|
385
385
|
si: null
|
386
386
|
}
|
387
387
|
};
|
388
|
-
return this._commandService.syncExecuteCommand(st.id,
|
388
|
+
return this._commandService.syncExecuteCommand(st.id, _), this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(ft.id, {
|
389
389
|
visible: !1,
|
390
|
-
eventType:
|
390
|
+
eventType: pt.Keyboard,
|
391
391
|
unitId: o,
|
392
392
|
keycode: vt.ESC
|
393
393
|
}), !0;
|
@@ -399,12 +399,12 @@ let Fe = class extends ye {
|
|
399
399
|
};
|
400
400
|
break;
|
401
401
|
}
|
402
|
-
case
|
403
|
-
|
402
|
+
case pe.COLOR: {
|
403
|
+
f = {
|
404
404
|
type: "color",
|
405
405
|
props: {
|
406
406
|
onChange: (I) => {
|
407
|
-
const
|
407
|
+
const _ = {
|
408
408
|
unitId: o,
|
409
409
|
subUnitId: a,
|
410
410
|
range: {
|
@@ -420,9 +420,9 @@ let Fe = class extends ye {
|
|
420
420
|
si: null
|
421
421
|
}
|
422
422
|
};
|
423
|
-
return this._commandService.syncExecuteCommand(st.id,
|
423
|
+
return this._commandService.syncExecuteCommand(st.id, _), this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(ft.id, {
|
424
424
|
visible: !1,
|
425
|
-
eventType:
|
425
|
+
eventType: pt.Keyboard,
|
426
426
|
unitId: o,
|
427
427
|
keycode: vt.ESC
|
428
428
|
}), !0;
|
@@ -436,20 +436,20 @@ let Fe = class extends ye {
|
|
436
436
|
default:
|
437
437
|
throw new Error("[DataValidationDropdownManagerService]: unknown type!");
|
438
438
|
}
|
439
|
-
if (
|
440
|
-
...
|
439
|
+
if (g = this._cellDropdownManagerService.showDropdown({
|
440
|
+
...f,
|
441
441
|
onHide: () => {
|
442
442
|
this._activeDropdown = null, this._activeDropdown$.next(null);
|
443
443
|
}
|
444
|
-
}), !
|
444
|
+
}), !g)
|
445
445
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
446
|
-
const
|
447
|
-
|
446
|
+
const h = new Lr();
|
447
|
+
h.add(g), h.add({
|
448
448
|
dispose: () => {
|
449
|
-
var
|
450
|
-
(I = (
|
449
|
+
var p, I;
|
450
|
+
(I = (p = this._activeDropdown) == null ? void 0 : p.onHide) == null || I.call(p);
|
451
451
|
}
|
452
|
-
}), this._currentPopup =
|
452
|
+
}), this._currentPopup = h;
|
453
453
|
}
|
454
454
|
hideDropdown() {
|
455
455
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
@@ -482,32 +482,32 @@ let Fe = class extends ye {
|
|
482
482
|
});
|
483
483
|
}
|
484
484
|
};
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
],
|
498
|
-
const Mt = "DataValidationPanel",
|
485
|
+
Ue = Ui([
|
486
|
+
he(0, de),
|
487
|
+
he(1, E(Me)),
|
488
|
+
he(2, dr),
|
489
|
+
he(3, E(ie)),
|
490
|
+
he(4, E(Gn)),
|
491
|
+
he(5, E(Si)),
|
492
|
+
he(6, E(ie)),
|
493
|
+
he(7, ee),
|
494
|
+
he(8, gr),
|
495
|
+
he(9, E(be)),
|
496
|
+
he(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(me), o = e.get(pn), a = e.get(de), l = e.get(lr), s = qn(a);
|
505
505
|
if (!s) return !1;
|
506
|
-
const { unitId: d, subUnitId: u } = s,
|
507
|
-
i.open(), i.setActiveRule(
|
506
|
+
const { unitId: d, subUnitId: u } = s, g = r ? o.getRuleById(d, u, r) : void 0;
|
507
|
+
i.open(), i.setActiveRule(g && {
|
508
508
|
unitId: d,
|
509
509
|
subUnitId: u,
|
510
|
-
rule:
|
510
|
+
rule: g
|
511
511
|
});
|
512
512
|
const c = l.open({
|
513
513
|
id: Mt,
|
@@ -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(me).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(ee), r = e.get(me);
|
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,20 +549,20 @@ 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,
|
556
556
|
id: "data-validation.command.addRuleAndOpen",
|
557
557
|
handler(e) {
|
558
|
-
const t = e.get(
|
558
|
+
const t = e.get(de), 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(ee), 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, E(Ci)),
|
629
|
+
$e(1, E(wi)),
|
630
|
+
$e(2, de),
|
631
|
+
$e(3, E(ce)),
|
632
|
+
$e(4, dr),
|
633
|
+
$e(5, E(ie))
|
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,48 +644,48 @@ 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 =
|
648
|
-
row:
|
649
|
-
col:
|
650
|
-
},
|
651
|
-
|
652
|
-
const R =
|
653
|
-
startRow:
|
654
|
-
startColumn:
|
655
|
-
endColumn:
|
656
|
-
endRow:
|
657
|
-
},
|
647
|
+
const { source: o, target: a, unitId: l, subUnitId: s } = n, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = rn([o, a]), [g, c] = u.ranges, { mapFunc: f } = u, h = {
|
648
|
+
row: g.startRow,
|
649
|
+
col: g.startColumn
|
650
|
+
}, M = yi(g, c), y = new It(), w = /* @__PURE__ */ new Set();
|
651
|
+
M.forEach((v) => {
|
652
|
+
const R = v.repeatStartCell, A = v.relativeRange, N = {
|
653
|
+
startRow: h.row,
|
654
|
+
startColumn: h.col,
|
655
|
+
endColumn: h.col,
|
656
|
+
endRow: h.row
|
657
|
+
}, O = {
|
658
658
|
startRow: R.row,
|
659
659
|
startColumn: R.col,
|
660
660
|
endColumn: R.col,
|
661
661
|
endRow: R.row
|
662
662
|
};
|
663
|
-
Nr.foreach(
|
664
|
-
const
|
663
|
+
Nr.foreach(A, (L, D) => {
|
664
|
+
const T = Rt.getPositionRange(
|
665
665
|
{
|
666
|
-
startRow:
|
667
|
-
startColumn:
|
668
|
-
endColumn:
|
669
|
-
endRow:
|
666
|
+
startRow: L,
|
667
|
+
startColumn: D,
|
668
|
+
endColumn: D,
|
669
|
+
endRow: L
|
670
670
|
},
|
671
671
|
N
|
672
|
-
), { row: k, col:
|
672
|
+
), { row: k, col: B } = f(T.startRow, T.startColumn), z = this._sheetDataValidationModel.getRuleIdByLocation(l, s, k, B) || "", te = Rt.getPositionRange(
|
673
673
|
{
|
674
|
-
startRow:
|
675
|
-
startColumn:
|
676
|
-
endColumn:
|
677
|
-
endRow:
|
674
|
+
startRow: L,
|
675
|
+
startColumn: D,
|
676
|
+
endColumn: D,
|
677
|
+
endRow: L
|
678
678
|
},
|
679
|
-
|
680
|
-
), { row:
|
681
|
-
y.setValue(
|
679
|
+
O
|
680
|
+
), { row: W, col: ne } = f(te.startRow, te.startColumn);
|
681
|
+
y.setValue(W, ne, z), w.add(z);
|
682
682
|
});
|
683
683
|
});
|
684
|
-
const C = Array.from(
|
684
|
+
const C = Array.from(w).map((v) => ({ id: v, ranges: Gt(y, (R) => R === v) }));
|
685
685
|
d.addRangeRules(C);
|
686
|
-
const
|
686
|
+
const p = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: I, undoMutations: _ } = tn(l, s, p, this._injector, "patched", i === ot.ONLY_FORMAT);
|
687
687
|
return {
|
688
|
-
undos:
|
688
|
+
undos: _,
|
689
689
|
redos: I
|
690
690
|
};
|
691
691
|
}, r = {
|
@@ -710,8 +710,8 @@ let Je = class extends ye {
|
|
710
710
|
};
|
711
711
|
Je = Hi([
|
712
712
|
Bt(0, Ri),
|
713
|
-
Bt(1,
|
714
|
-
Bt(2,
|
713
|
+
Bt(1, E(ie)),
|
714
|
+
Bt(2, E(be))
|
715
715
|
], Je);
|
716
716
|
var $i = Object.getOwnPropertyDescriptor, ji = (e, t, r, n) => {
|
717
717
|
for (var i = n > 1 ? void 0 : n ? $i(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
@@ -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
|
});
|
@@ -746,9 +746,9 @@ let Qe = class extends ye {
|
|
746
746
|
return;
|
747
747
|
const { rows: a, cols: l } = o;
|
748
748
|
a.forEach((s, d) => {
|
749
|
-
l.forEach((u,
|
749
|
+
l.forEach((u, g) => {
|
750
750
|
const c = this._sheetDataValidationModel.getRuleIdByLocation(t, r, s, u);
|
751
|
-
i.setValue(d,
|
751
|
+
i.setValue(d, g, c != null ? c : "");
|
752
752
|
});
|
753
753
|
});
|
754
754
|
}
|
@@ -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,58 +769,58 @@ 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:
|
773
|
-
c.forEach(({ startRange:
|
772
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(r.unitId, r.subUnitId).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: g } = rn([r.copyRange, t]), c = Ln(d, u, !0), f = /* @__PURE__ */ new Map();
|
773
|
+
c.forEach(({ startRange: w }) => {
|
774
774
|
var C;
|
775
|
-
(C = this._copyInfo) == null || C.matrix.forValue((
|
776
|
-
const
|
775
|
+
(C = this._copyInfo) == null || C.matrix.forValue((p, I, _) => {
|
776
|
+
const v = Rt.getPositionRange(
|
777
777
|
{
|
778
|
-
startRow:
|
779
|
-
endRow:
|
778
|
+
startRow: p,
|
779
|
+
endRow: p,
|
780
780
|
startColumn: I,
|
781
781
|
endColumn: I
|
782
782
|
},
|
783
|
-
|
784
|
-
), R = `${o}-${
|
785
|
-
!this._sheetDataValidationModel.getRuleById(r.unitId, r.subUnitId, R) &&
|
786
|
-
const { row: N, col:
|
787
|
-
s.add(R), l.setValue(N,
|
783
|
+
w
|
784
|
+
), R = `${o}-${_}`, A = this._sheetDataValidationModel.getRuleById(i, o, _);
|
785
|
+
!this._sheetDataValidationModel.getRuleById(r.unitId, r.subUnitId, R) && A && f.set(R, { ...A, uid: R });
|
786
|
+
const { row: N, col: O } = g(v.startRow, v.startColumn);
|
787
|
+
s.add(R), l.setValue(N, O, R);
|
788
788
|
});
|
789
789
|
});
|
790
|
-
const
|
791
|
-
a.addRangeRules(
|
792
|
-
const { redoMutations:
|
790
|
+
const h = Array.from(s).map((w) => ({ id: w, ranges: Gt(l, (C) => C === w) }));
|
791
|
+
a.addRangeRules(h);
|
792
|
+
const { redoMutations: M, 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), f.values()),
|
796
796
|
this._injector,
|
797
797
|
"patched",
|
798
798
|
!1
|
799
799
|
);
|
800
800
|
return {
|
801
|
-
redos:
|
801
|
+
redos: M,
|
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:
|
806
|
-
|
807
|
-
var
|
808
|
-
(
|
809
|
-
const
|
805
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new It(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: g } = rn([r.copyRange, t]);
|
806
|
+
Ln(d, u, !0).forEach(({ startRange: y }) => {
|
807
|
+
var w;
|
808
|
+
(w = this._copyInfo) == null || w.matrix.forValue((C, p, I) => {
|
809
|
+
const _ = Rt.getPositionRange(
|
810
810
|
{
|
811
811
|
startRow: C,
|
812
812
|
endRow: C,
|
813
|
-
startColumn:
|
814
|
-
endColumn:
|
813
|
+
startColumn: p,
|
814
|
+
endColumn: p
|
815
815
|
},
|
816
816
|
y
|
817
|
-
), { row:
|
818
|
-
l.setValue(
|
817
|
+
), { row: v, col: R } = g(_.startRow, _.startColumn);
|
818
|
+
l.setValue(v, R, I), s.add(I);
|
819
819
|
});
|
820
820
|
});
|
821
|
-
const
|
822
|
-
a.addRangeRules(
|
823
|
-
const { redoMutations:
|
821
|
+
const f = Array.from(s).map((y) => ({ id: y, ranges: Gt(l, (w) => w === y) }));
|
822
|
+
a.addRangeRules(f);
|
823
|
+
const { redoMutations: h, undoMutations: M } = tn(
|
824
824
|
i,
|
825
825
|
o,
|
826
826
|
a.diff(this._sheetDataValidationModel.getRules(i, o)),
|
@@ -829,16 +829,16 @@ let Qe = class extends ye {
|
|
829
829
|
!1
|
830
830
|
);
|
831
831
|
return {
|
832
|
-
redos:
|
833
|
-
undos:
|
832
|
+
redos: h,
|
833
|
+
undos: M
|
834
834
|
};
|
835
835
|
}
|
836
836
|
}
|
837
837
|
};
|
838
838
|
Qe = ji([
|
839
839
|
Wt(0, bi),
|
840
|
-
Wt(1,
|
841
|
-
Wt(2,
|
840
|
+
Wt(1, E(ie)),
|
841
|
+
Wt(2, E(be))
|
842
842
|
], Qe);
|
843
843
|
var Yi = Object.getOwnPropertyDescriptor, Xi = (e, t, r, n) => {
|
844
844
|
for (var i = n > 1 ? void 0 : n ? Yi(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
@@ -852,55 +852,55 @@ 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
|
);
|
866
866
|
}
|
867
867
|
};
|
868
868
|
et = Xi([
|
869
|
-
Ht(0,
|
870
|
-
Ht(1,
|
871
|
-
Ht(2,
|
869
|
+
Ht(0, E(ce)),
|
870
|
+
Ht(1, ee),
|
871
|
+
Ht(2, E(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 = {
|
899
|
-
[
|
899
|
+
[gi.RULES]: {
|
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
|
}
|
@@ -949,7 +949,7 @@ let tt = class extends dn {
|
|
949
949
|
return;
|
950
950
|
const u = l.getActiveSheet();
|
951
951
|
if (!u) return;
|
952
|
-
const
|
952
|
+
const g = this._dropdownManagerService.activeDropdown, c = g == null ? void 0 : g.location;
|
953
953
|
if (c && c.unitId === n && c.subUnitId === i && c.row === o && c.col === a)
|
954
954
|
return;
|
955
955
|
this._dropdownManagerService.showDropdown(
|
@@ -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
|
983
|
+
var w, C, p, I, _;
|
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
|
991
|
-
let
|
992
|
-
const
|
990
|
+
const g = (w = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? w : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), f = t.rawData;
|
991
|
+
let h;
|
992
|
+
const M = {
|
993
993
|
get value() {
|
994
|
-
var
|
995
|
-
return
|
994
|
+
var v;
|
995
|
+
return h !== void 0 || (h = (v = re(f)) != null ? v : null), h;
|
996
996
|
}
|
997
997
|
}, y = {
|
998
998
|
get value() {
|
999
|
-
var
|
1000
|
-
return `${(
|
999
|
+
var v;
|
1000
|
+
return `${(v = M.value) != null ? v : ""}`;
|
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
|
+
...g === Ze.INVALID ? wr : null
|
1006
1006
|
}, e.customRender = [
|
1007
1007
|
...(C = e == null ? void 0 : e.customRender) != null ? C : [],
|
1008
1008
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
1009
1009
|
], e.fontRenderExtension = {
|
1010
1010
|
...e == null ? void 0 : e.fontRenderExtension,
|
1011
|
-
isSkip: ((
|
1011
|
+
isSkip: ((p = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : p.isSkip) || ((I = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : I.call(c, u, M.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 v = l.getStyles();
|
1017
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? v.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,
|
1022
|
-
const
|
1023
|
-
if (!
|
1021
|
+
var N, O, L, D, T, k;
|
1022
|
+
const v = (O = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(dt).getSkeletonParam(a)) == null ? void 0 : O.skeleton;
|
1023
|
+
if (!v)
|
1024
1024
|
return;
|
1025
|
-
const R =
|
1025
|
+
const R = v.worksheet.getMergedCell(n, i), A = {
|
1026
1026
|
data: e,
|
1027
|
-
style:
|
1028
|
-
primaryWithCoord:
|
1027
|
+
style: v.getStyles().getStyleByCell(e),
|
1028
|
+
primaryWithCoord: v.getCellWithCoordByIndex((L = R == null ? void 0 : R.startRow) != null ? L : n, (D = R == null ? void 0 : R.startColumn) != null ? D : 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 = (T = c == null ? void 0 : c.canvasRender) == null ? void 0 : T.calcCellAutoHeight) == null ? void 0 : k.call(T, A);
|
1037
1037
|
}, e.interceptorAutoWidth = () => {
|
1038
|
-
var N,
|
1039
|
-
const
|
1040
|
-
if (!
|
1038
|
+
var N, O, L, D, T, k;
|
1039
|
+
const v = (O = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(dt).getSkeletonParam(a)) == null ? void 0 : O.skeleton;
|
1040
|
+
if (!v)
|
1041
1041
|
return;
|
1042
|
-
const R =
|
1042
|
+
const R = v.worksheet.getMergedCell(n, i), A = {
|
1043
1043
|
data: e,
|
1044
|
-
style:
|
1045
|
-
primaryWithCoord:
|
1044
|
+
style: v.getStyles().getStyleByCell(e),
|
1045
|
+
primaryWithCoord: v.getCellWithCoordByIndex((L = R == null ? void 0 : R.startRow) != null ? L : n, (D = R == null ? void 0 : R.startColumn) != null ? D : i),
|
1046
1046
|
unitId: o,
|
1047
1047
|
subUnitId: a,
|
1048
1048
|
row: n,
|
@@ -1050,8 +1050,8 @@ let tt = class extends dn {
|
|
1050
1050
|
workbook: l,
|
1051
1051
|
worksheet: s
|
1052
1052
|
};
|
1053
|
-
return (k = (
|
1054
|
-
}, e.coverable = ((
|
1053
|
+
return (k = (T = c == null ? void 0 : c.canvasRender) == null ? void 0 : T.calcCellAutoWidth) == null ? void 0 : k.call(T, A);
|
1054
|
+
}, e.coverable = ((_ = e == null ? void 0 : e.coverable) != null ? _ : !0) && !(u.type === j.LIST || u.type === j.LIST_MULTIPLE), r(e);
|
1055
1055
|
}
|
1056
1056
|
}
|
1057
1057
|
)
|
@@ -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,
|
1082
|
-
K(1,
|
1083
|
-
K(2,
|
1084
|
-
K(3,
|
1085
|
-
K(4,
|
1086
|
-
K(5,
|
1087
|
-
K(6,
|
1088
|
-
K(7,
|
1089
|
-
K(8,
|
1090
|
-
K(9,
|
1091
|
-
K(10, Ur(
|
1081
|
+
K(0, ee),
|
1082
|
+
K(1, pi),
|
1083
|
+
K(2, Fe),
|
1084
|
+
K(3, de),
|
1085
|
+
K(4, E(pr)),
|
1086
|
+
K(5, E(Ue)),
|
1087
|
+
K(6, E(ie)),
|
1088
|
+
K(7, E(Me)),
|
1089
|
+
K(8, E(un)),
|
1090
|
+
K(9, E(ir)),
|
1091
|
+
K(10, Ur(gr))
|
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,40 +1105,40 @@ 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,
|
1108
|
+
var y, w, C, p, 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
|
1115
|
+
const g = (y = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? y : Ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), f = s.getCellRaw(n, i), h = re(f), M = `${h != null ? h : ""}`;
|
1116
1116
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
1117
1117
|
...e == null ? void 0 : e.markers,
|
1118
|
-
...
|
1118
|
+
...g === Ze.INVALID ? wr : null
|
1119
1119
|
}, e.customRender = [
|
1120
|
-
...(
|
1120
|
+
...(w = e == null ? void 0 : e.customRender) != null ? w : [],
|
1121
1121
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
1122
1122
|
], e.fontRenderExtension = {
|
1123
1123
|
...e == null ? void 0 : e.fontRenderExtension,
|
1124
|
-
isSkip: ((C = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : C.isSkip) || ((
|
1124
|
+
isSkip: ((C = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : C.isSkip) || ((p = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : p.call(c, u, h, t))
|
1125
1125
|
}, e.interceptorStyle = {
|
1126
1126
|
...e == null ? void 0 : e.interceptorStyle,
|
1127
|
-
...c == null ? void 0 : c.getExtraStyle(u,
|
1127
|
+
...c == null ? void 0 : c.getExtraStyle(u, M, {
|
1128
1128
|
get style() {
|
1129
|
-
const
|
1130
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
1129
|
+
const _ = l.getStyles();
|
1130
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? _.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
1131
1131
|
}
|
1132
1132
|
}, n, i)
|
1133
1133
|
}, e.interceptorAutoHeight = () => {
|
1134
|
-
var
|
1135
|
-
const
|
1136
|
-
if (!
|
1134
|
+
var A, N, O, L, D, T;
|
1135
|
+
const _ = (N = (A = this._renderManagerService.getRenderById(o)) == null ? void 0 : A.with(dt).getSkeletonParam(a)) == null ? void 0 : N.skeleton;
|
1136
|
+
if (!_)
|
1137
1137
|
return;
|
1138
|
-
const
|
1138
|
+
const v = _.worksheet.getMergedCell(n, i), R = {
|
1139
1139
|
data: e,
|
1140
|
-
style:
|
1141
|
-
primaryWithCoord:
|
1140
|
+
style: _.getStyles().getStyleByCell(e),
|
1141
|
+
primaryWithCoord: _.getCellWithCoordByIndex((O = v == null ? void 0 : v.startRow) != null ? O : n, (L = v == null ? void 0 : v.startColumn) != null ? L : 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 (T = (D = c == null ? void 0 : c.canvasRender) == null ? void 0 : D.calcCellAutoHeight) == null ? void 0 : T.call(D, R);
|
1150
1150
|
}, e.interceptorAutoWidth = () => {
|
1151
|
-
var
|
1152
|
-
const
|
1153
|
-
if (!
|
1151
|
+
var A, N, O, L, D, T;
|
1152
|
+
const _ = (N = (A = this._renderManagerService.getRenderById(o)) == null ? void 0 : A.with(dt).getSkeletonParam(a)) == null ? void 0 : N.skeleton;
|
1153
|
+
if (!_)
|
1154
1154
|
return;
|
1155
|
-
const
|
1155
|
+
const v = _.worksheet.getMergedCell(n, i), R = {
|
1156
1156
|
data: e,
|
1157
|
-
style:
|
1158
|
-
primaryWithCoord:
|
1157
|
+
style: _.getStyles().getStyleByCell(e),
|
1158
|
+
primaryWithCoord: _.getCellWithCoordByIndex((O = v == null ? void 0 : v.startRow) != null ? O : n, (L = v == null ? void 0 : v.startColumn) != null ? L : 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 (T = (D = c == null ? void 0 : c.canvasRender) == null ? void 0 : D.calcCellAutoWidth) == null ? void 0 : T.call(D, 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,
|
1192
|
-
K(2,
|
1193
|
-
K(3,
|
1194
|
-
K(4,
|
1195
|
-
K(5,
|
1196
|
-
K(6,
|
1197
|
-
],
|
1189
|
+
Un = Cr([
|
1190
|
+
K(0, ee),
|
1191
|
+
K(1, Fe),
|
1192
|
+
K(2, E(pr)),
|
1193
|
+
K(3, E(Me)),
|
1194
|
+
K(4, E(un)),
|
1195
|
+
K(5, E(ie)),
|
1196
|
+
K(6, E(ir))
|
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,17 +1221,17 @@ let Et = class extends ye {
|
|
1221
1221
|
}
|
1222
1222
|
};
|
1223
1223
|
Et = Qi([
|
1224
|
-
|
1225
|
-
|
1224
|
+
Fn(1, E(ie)),
|
1225
|
+
Fn(2, E(dt))
|
1226
1226
|
], Et);
|
1227
|
-
var
|
1228
|
-
return
|
1227
|
+
var se = function() {
|
1228
|
+
return se = Object.assign || function(e) {
|
1229
1229
|
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
1230
1230
|
t = arguments[r];
|
1231
1231
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
1232
1232
|
}
|
1233
1233
|
return e;
|
1234
|
-
},
|
1234
|
+
}, se.apply(this, arguments);
|
1235
1235
|
}, eo = function(e, t) {
|
1236
1236
|
var r = {};
|
1237
1237
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
@@ -1239,17 +1239,17 @@ 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
|
-
},
|
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 =
|
1244
|
-
return Ir(r, "".concat(n), { defIds: r.defIds, idSuffix: s.current },
|
1242
|
+
}, We = xe(function(e, t) {
|
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 = gt("_".concat(ro()));
|
1244
|
+
return Ir(r, "".concat(n), { defIds: r.defIds, idSuffix: s.current }, se({ ref: t, className: l }, a), o);
|
1245
1245
|
});
|
1246
1246
|
function Ir(e, t, r, n, i) {
|
1247
|
-
return Ie(e.tag,
|
1247
|
+
return Ie(e.tag, se(se({ key: t }, to(e, r, i)), n), (no(e, r).children || []).map(function(o, a) {
|
1248
1248
|
return Ir(o, "".concat(t, "-").concat(e.tag, "-").concat(a), r, void 0, i);
|
1249
1249
|
}));
|
1250
1250
|
}
|
1251
1251
|
function to(e, t, r) {
|
1252
|
-
var n =
|
1252
|
+
var n = se({}, e.attrs);
|
1253
1253
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(o) {
|
1254
1254
|
var a = o[0], l = o[1];
|
1255
1255
|
a === "mask" && typeof l == "string" && (n[a] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
@@ -1262,56 +1262,56 @@ function to(e, t, r) {
|
|
1262
1262
|
}
|
1263
1263
|
function no(e, t) {
|
1264
1264
|
var r, n = t.defIds;
|
1265
|
-
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ?
|
1266
|
-
return typeof i.attrs.id == "string" && n && n.includes(i.attrs.id) ?
|
1265
|
+
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? se(se({}, e), { children: e.children.map(function(i) {
|
1266
|
+
return typeof i.attrs.id == "string" && n && n.includes(i.attrs.id) ? se(se({}, i), { attrs: se(se({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
|
1267
1267
|
}) }) : e;
|
1268
1268
|
}
|
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 = F(
|
1323
|
+
const t = F(ce), r = F(fn), { value: n, onChange: i, extraComponent: o } = e, [a, l] = H(!1), s = o ? r.get(o) : null;
|
1324
1324
|
return /* @__PURE__ */ $(ut, { children: [
|
1325
1325
|
/* @__PURE__ */ $(
|
1326
1326
|
"div",
|
@@ -1329,7 +1329,7 @@ function uo(e) {
|
|
1329
1329
|
onClick: () => l(!a),
|
1330
1330
|
children: [
|
1331
1331
|
t.t("dataValidation.panel.options"),
|
1332
|
-
a ? /* @__PURE__ */ S(br, { className: "univer-ml-1" }) : /* @__PURE__ */ S(
|
1332
|
+
a ? /* @__PURE__ */ S(br, { className: "univer-ml-1" }) : /* @__PURE__ */ S(In, { className: "univer-ml-1" })
|
1333
1333
|
]
|
1334
1334
|
}
|
1335
1335
|
),
|
@@ -1340,13 +1340,13 @@ function uo(e) {
|
|
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__ */ S(
|
1349
|
-
/* @__PURE__ */ S(
|
1348
|
+
/* @__PURE__ */ S(Ae, { value: `${lt.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
1349
|
+
/* @__PURE__ */ S(Ae, { value: `${lt.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
|
1350
1350
|
]
|
1351
1351
|
}
|
1352
1352
|
)
|
@@ -1369,7 +1369,7 @@ function uo(e) {
|
|
1369
1369
|
)
|
1370
1370
|
}
|
1371
1371
|
),
|
1372
|
-
n.showErrorMessage ? /* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
1372
|
+
n.showErrorMessage ? /* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(Le, { value: n.error, onChange: (u) => i({ ...n, error: u }) }) }) : null
|
1373
1373
|
] })
|
1374
1374
|
] });
|
1375
1375
|
}
|
@@ -1380,248 +1380,248 @@ const ho = (e) => xr(
|
|
1380
1380
|
},
|
1381
1381
|
1e3
|
1382
1382
|
);
|
1383
|
-
function
|
1383
|
+
function go(e, t, r) {
|
1384
1384
|
var n, i, o, a;
|
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
|
-
function
|
1388
|
-
var
|
1389
|
-
const [e, t] =
|
1390
|
-
if (
|
1391
|
-
const
|
1392
|
-
|
1393
|
-
}, [
|
1394
|
-
|
1395
|
-
(
|
1396
|
-
const
|
1397
|
-
t((x) => x + 1),
|
1387
|
+
function po() {
|
1388
|
+
var b, U;
|
1389
|
+
const [e, t] = H(0), r = F(me), n = Pe(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = F(Me), d = F(de), u = F(fn), g = F(ee), c = F(pn), f = F(ce), [h, M] = H(a), y = s.getValidatorItem(h.type), [w, C] = H(!1), p = s.getValidatorsByScope(di.SHEET), [I, _] = H(() => h.ranges.map((m) => ({ unitId: "", sheetId: "", range: m }))), v = ct(() => ho(g), [g]), [R, A] = H(!1), [N, O] = H(!1), L = gt(null), D = F(Gn);
|
1390
|
+
if (ke(() => () => {
|
1391
|
+
const m = D.getCurrentLastSelection();
|
1392
|
+
m && D.setSelections([m]);
|
1393
|
+
}, [D]), ke(() => {
|
1394
|
+
g.onCommandExecuted((m) => {
|
1395
|
+
(m.id === Br.id || m.id === Wr.id) && setTimeout(() => {
|
1396
|
+
const P = c.getRuleById(i, o, l);
|
1397
|
+
t((x) => x + 1), P && (M(P), _(P.ranges.map((x) => ({ unitId: "", sheetId: "", range: x }))));
|
1398
1398
|
}, 20);
|
1399
1399
|
});
|
1400
|
-
}, [
|
1400
|
+
}, [g, c, l, o, i]), !y)
|
1401
1401
|
return null;
|
1402
|
-
const
|
1403
|
-
var
|
1404
|
-
(
|
1405
|
-
},
|
1406
|
-
const
|
1407
|
-
const
|
1408
|
-
if (
|
1409
|
-
const Or =
|
1410
|
-
return { ...
|
1402
|
+
const T = y.operators, k = y.operatorNames, B = h.operator ? ci.includes(h.operator) : !1, z = () => {
|
1403
|
+
var m, P, x;
|
1404
|
+
(P = (m = L.current) == null ? void 0 : m.editor) != null && P.isFocus() && te((x = L.current) == null ? void 0 : x.getValue()), !(!h.ranges.length || R) && (y.validatorFormula(h, i, o).success ? r.setActiveRule(null) : C(!0));
|
1405
|
+
}, te = nn((m) => {
|
1406
|
+
const P = m.split(",").filter(Boolean).map(Oi).map((J) => {
|
1407
|
+
const Rn = J.sheetName;
|
1408
|
+
if (Rn) {
|
1409
|
+
const Or = go(d, J.unitId, Rn);
|
1410
|
+
return { ...J, sheetId: Or };
|
1411
1411
|
}
|
1412
1412
|
return {
|
1413
|
-
...
|
1413
|
+
...J,
|
1414
1414
|
sheetId: ""
|
1415
1415
|
};
|
1416
1416
|
});
|
1417
|
-
if (Hr(
|
1417
|
+
if (Hr(P, I))
|
1418
1418
|
return;
|
1419
|
-
|
1420
|
-
const x =
|
1421
|
-
if (
|
1422
|
-
...
|
1419
|
+
_(P);
|
1420
|
+
const x = P.filter((J) => (!J.unitId || J.unitId === i) && (!J.sheetId || J.sheetId === o)).map((J) => J.range);
|
1421
|
+
if (M({
|
1422
|
+
...h,
|
1423
1423
|
ranges: x
|
1424
1424
|
}), x.length === 0)
|
1425
1425
|
return;
|
1426
|
-
const
|
1426
|
+
const ue = {
|
1427
1427
|
unitId: i,
|
1428
1428
|
subUnitId: o,
|
1429
1429
|
ruleId: l,
|
1430
1430
|
ranges: x
|
1431
1431
|
};
|
1432
|
-
|
1433
|
-
}),
|
1434
|
-
if (
|
1432
|
+
v(rr.id, ue);
|
1433
|
+
}), W = (m) => {
|
1434
|
+
if (yn(m, Tn(h)))
|
1435
1435
|
return;
|
1436
|
-
|
1437
|
-
...
|
1438
|
-
...
|
1436
|
+
M({
|
1437
|
+
...h,
|
1438
|
+
...m
|
1439
1439
|
});
|
1440
|
-
const
|
1440
|
+
const P = {
|
1441
1441
|
unitId: i,
|
1442
1442
|
subUnitId: o,
|
1443
1443
|
ruleId: l,
|
1444
|
-
setting:
|
1444
|
+
setting: m
|
1445
1445
|
};
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1446
|
+
v(
|
1447
|
+
Dn.id,
|
1448
|
+
P,
|
1449
1449
|
void 0
|
1450
1450
|
);
|
1451
|
-
},
|
1452
|
-
await
|
1451
|
+
}, ne = async () => {
|
1452
|
+
await g.executeCommand(or.id, {
|
1453
1453
|
ruleId: l,
|
1454
1454
|
unitId: i,
|
1455
1455
|
subUnitId: o
|
1456
1456
|
}), r.setActiveRule(null);
|
1457
|
-
},
|
1458
|
-
type:
|
1459
|
-
operator:
|
1460
|
-
formula1:
|
1461
|
-
formula2:
|
1462
|
-
allowBlank:
|
1463
|
-
},
|
1464
|
-
const
|
1465
|
-
if (!
|
1457
|
+
}, oe = {
|
1458
|
+
type: h.type,
|
1459
|
+
operator: h.operator,
|
1460
|
+
formula1: h.formula1,
|
1461
|
+
formula2: h.formula2,
|
1462
|
+
allowBlank: h.allowBlank
|
1463
|
+
}, Se = (m) => {
|
1464
|
+
const P = s.getValidatorItem(m);
|
1465
|
+
if (!P)
|
1466
1466
|
return;
|
1467
|
-
const x =
|
1468
|
-
...
|
1469
|
-
type:
|
1467
|
+
const x = P.operators, ue = c.getRuleById(i, o, l), J = m === (ue == null ? void 0 : ue.type) || m.includes("list") && (ue != null && ue.type.includes("list")) ? {
|
1468
|
+
...ue,
|
1469
|
+
type: m
|
1470
1470
|
} : {
|
1471
|
-
...
|
1472
|
-
type:
|
1471
|
+
...h,
|
1472
|
+
type: m,
|
1473
1473
|
operator: x[0],
|
1474
1474
|
formula1: void 0,
|
1475
1475
|
formula2: void 0
|
1476
1476
|
};
|
1477
|
-
|
1477
|
+
M(J), g.executeCommand(Dn.id, {
|
1478
1478
|
unitId: i,
|
1479
1479
|
subUnitId: o,
|
1480
|
-
ruleId:
|
1481
|
-
setting:
|
1480
|
+
ruleId: h.uid,
|
1481
|
+
setting: Tn(J)
|
1482
1482
|
});
|
1483
|
-
},
|
1484
|
-
|
1485
|
-
...
|
1486
|
-
...
|
1487
|
-
}),
|
1483
|
+
}, Ce = u.get(y.formulaInput), G = ct(() => I.map((m) => vr(m.range)).join(","), []), Z = On(h), ve = (m) => {
|
1484
|
+
yn(m, On(h)) || (M({
|
1485
|
+
...h,
|
1486
|
+
...m
|
1487
|
+
}), v(
|
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
|
+
}, q = T.length && !h.operator;
|
1497
1497
|
return /* @__PURE__ */ $("div", { "data-u-comp": "data-validation-detail", className: "univer-py-2", children: [
|
1498
1498
|
/* @__PURE__ */ S(
|
1499
1499
|
Y,
|
1500
1500
|
{
|
1501
|
-
label:
|
1502
|
-
error: !
|
1501
|
+
label: f.t("dataValidation.panel.range"),
|
1502
|
+
error: !h.ranges.length || R ? f.t("dataValidation.panel.rangeError") : "",
|
1503
1503
|
children: /* @__PURE__ */ S(
|
1504
1504
|
Ti,
|
1505
1505
|
{
|
1506
|
-
selectorRef:
|
1506
|
+
selectorRef: L,
|
1507
1507
|
unitId: i,
|
1508
1508
|
subUnitId: o,
|
1509
|
-
initialValue:
|
1510
|
-
onChange: (
|
1509
|
+
initialValue: G,
|
1510
|
+
onChange: (m, P) => {
|
1511
1511
|
var x;
|
1512
|
-
!N && ((x =
|
1512
|
+
!N && ((x = L.current) != null && x.verify()) && te(P);
|
1513
1513
|
},
|
1514
|
-
onFocusChange: (
|
1514
|
+
onFocusChange: (m, P) => {
|
1515
1515
|
var x;
|
1516
|
-
|
1516
|
+
O(m), !m && P && ((x = L.current) != null && x.verify()) && te(P);
|
1517
1517
|
},
|
1518
|
-
onVerify: (
|
1518
|
+
onVerify: (m) => A(!m)
|
1519
1519
|
}
|
1520
1520
|
)
|
1521
1521
|
}
|
1522
1522
|
),
|
1523
|
-
/* @__PURE__ */ S(Y, { label:
|
1524
|
-
|
1523
|
+
/* @__PURE__ */ S(Y, { label: f.t("dataValidation.panel.type"), children: /* @__PURE__ */ S(
|
1524
|
+
kn,
|
1525
1525
|
{
|
1526
1526
|
className: "univer-w-full",
|
1527
|
-
value:
|
1528
|
-
options: (
|
1529
|
-
label:
|
1530
|
-
value:
|
1527
|
+
value: h.type,
|
1528
|
+
options: (b = p == null ? void 0 : p.sort((m, P) => m.order - P.order)) == null ? void 0 : b.map((m) => ({
|
1529
|
+
label: f.t(m.title),
|
1530
|
+
value: m.id
|
1531
1531
|
})),
|
1532
|
-
onChange:
|
1532
|
+
onChange: Se
|
1533
1533
|
}
|
1534
1534
|
) }),
|
1535
|
-
|
1536
|
-
|
1535
|
+
T != null && T.length ? /* @__PURE__ */ S(Y, { label: f.t("dataValidation.panel.operator"), children: /* @__PURE__ */ S(
|
1536
|
+
kn,
|
1537
1537
|
{
|
1538
1538
|
className: "univer-w-full",
|
1539
|
-
value: `${
|
1539
|
+
value: `${h.operator}`,
|
1540
1540
|
options: [
|
1541
1541
|
{
|
1542
1542
|
value: "",
|
1543
|
-
label:
|
1543
|
+
label: f.t("dataValidation.operators.legal")
|
1544
1544
|
},
|
1545
|
-
...
|
1546
|
-
value: `${
|
1547
|
-
label: k[
|
1545
|
+
...T.map((m, P) => ({
|
1546
|
+
value: `${m}`,
|
1547
|
+
label: k[P]
|
1548
1548
|
}))
|
1549
1549
|
],
|
1550
|
-
onChange: (
|
1551
|
-
|
1552
|
-
...
|
1553
|
-
operator:
|
1550
|
+
onChange: (m) => {
|
1551
|
+
W({
|
1552
|
+
...oe,
|
1553
|
+
operator: m
|
1554
1554
|
});
|
1555
1555
|
}
|
1556
1556
|
}
|
1557
1557
|
) }) : null,
|
1558
|
-
|
1559
|
-
|
1558
|
+
Ce && !q ? /* @__PURE__ */ S(
|
1559
|
+
Ce,
|
1560
1560
|
{
|
1561
|
-
isTwoFormula:
|
1561
|
+
isTwoFormula: B,
|
1562
1562
|
value: {
|
1563
|
-
formula1:
|
1564
|
-
formula2:
|
1563
|
+
formula1: h.formula1,
|
1564
|
+
formula2: h.formula2
|
1565
1565
|
},
|
1566
|
-
onChange: (
|
1567
|
-
|
1568
|
-
...
|
1569
|
-
...
|
1566
|
+
onChange: (m) => {
|
1567
|
+
W({
|
1568
|
+
...oe,
|
1569
|
+
...m
|
1570
1570
|
});
|
1571
1571
|
},
|
1572
|
-
showError:
|
1573
|
-
validResult: y.validatorFormula(
|
1572
|
+
showError: w,
|
1573
|
+
validResult: y.validatorFormula(h, i, o),
|
1574
1574
|
unitId: i,
|
1575
1575
|
subUnitId: o,
|
1576
1576
|
ruleId: l
|
1577
1577
|
},
|
1578
|
-
e +
|
1578
|
+
e + h.type
|
1579
1579
|
) : null,
|
1580
1580
|
/* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
1581
1581
|
At,
|
1582
1582
|
{
|
1583
|
-
checked: (U =
|
1583
|
+
checked: (U = h.allowBlank) != null ? U : !0,
|
1584
1584
|
onChange: () => {
|
1585
|
-
var
|
1586
|
-
return
|
1587
|
-
...
|
1588
|
-
allowBlank: !((
|
1585
|
+
var m;
|
1586
|
+
return W({
|
1587
|
+
...oe,
|
1588
|
+
allowBlank: !((m = h.allowBlank) == null || m)
|
1589
1589
|
});
|
1590
1590
|
},
|
1591
|
-
children:
|
1591
|
+
children: f.t("dataValidation.panel.allowBlank")
|
1592
1592
|
}
|
1593
1593
|
) }),
|
1594
|
-
/* @__PURE__ */ S(uo, { value:
|
1594
|
+
/* @__PURE__ */ S(uo, { value: Z, onChange: ve, extraComponent: y.optionsInput }),
|
1595
1595
|
/* @__PURE__ */ $("div", { className: "univer-mt-5 univer-flex univer-flex-row univer-justify-end", children: [
|
1596
|
-
/* @__PURE__ */ S(Ge, { className: "univer-ml-3", onClick:
|
1597
|
-
/* @__PURE__ */ S(Ge, { className: "univer-ml-3", variant: "primary", onClick:
|
1596
|
+
/* @__PURE__ */ S(Ge, { className: "univer-ml-3", onClick: ne, children: f.t("dataValidation.panel.removeRule") }),
|
1597
|
+
/* @__PURE__ */ S(Ge, { className: "univer-ml-3", variant: "primary", onClick: z, children: f.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 = F(Me), l = F(
|
1603
|
-
var
|
1604
|
-
const
|
1602
|
+
const { rule: t, onClick: r, unitId: n, subUnitId: i, disable: o } = e, a = F(Me), l = F(ee), s = F(Ei), d = a.getValidatorItem(t.type), u = gt(void 0), [g, c] = H(!1), f = F(Xn), h = Pe(f.currentTheme$), M = ct(() => {
|
1603
|
+
var _;
|
1604
|
+
const w = f.getColorFromTheme("primary.600"), C = f.getColorFromTheme("loop-color.2"), p = (_ = f.getColorFromTheme(C)) != null ? _ : w, I = new $r(p).toRgb();
|
1605
1605
|
return {
|
1606
1606
|
fill: `rgba(${I.r}, ${I.g}, ${I.b}, 0.1)`,
|
1607
|
-
stroke:
|
1607
|
+
stroke: p
|
1608
1608
|
};
|
1609
|
-
}, [
|
1609
|
+
}, [h]), y = (w) => {
|
1610
1610
|
l.executeCommand(or.id, {
|
1611
1611
|
ruleId: t.uid,
|
1612
1612
|
unitId: n,
|
1613
1613
|
subUnitId: i
|
1614
|
-
}),
|
1614
|
+
}), w.stopPropagation();
|
1615
1615
|
};
|
1616
|
-
return
|
1617
|
-
var
|
1618
|
-
u.current && ((
|
1616
|
+
return ke(() => () => {
|
1617
|
+
var w;
|
1618
|
+
u.current && ((w = u.current) == null || w.forEach((C) => {
|
1619
1619
|
C && s.removeShape(C);
|
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
|
@@ -1634,15 +1634,15 @@ const vo = (e) => {
|
|
1634
1634
|
),
|
1635
1635
|
onClick: r,
|
1636
1636
|
onMouseEnter: () => {
|
1637
|
-
o || (c(!0), u.current = t.ranges.map((
|
1638
|
-
range:
|
1639
|
-
style:
|
1637
|
+
o || (c(!0), u.current = t.ranges.map((w) => s.addShape({
|
1638
|
+
range: w,
|
1639
|
+
style: M,
|
1640
1640
|
primary: null
|
1641
1641
|
})));
|
1642
1642
|
},
|
1643
1643
|
onMouseLeave: () => {
|
1644
|
-
var
|
1645
|
-
c(!1), (
|
1644
|
+
var w;
|
1645
|
+
c(!1), (w = u.current) == null || w.forEach((C) => {
|
1646
1646
|
C && s.removeShape(C);
|
1647
1647
|
}), u.current = void 0;
|
1648
1648
|
},
|
@@ -1658,15 +1658,15 @@ const vo = (e) => {
|
|
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
|
-
children: t.ranges.map((
|
1661
|
+
children: t.ranges.map((w) => vr(w)).join(",")
|
1662
1662
|
}
|
1663
1663
|
),
|
1664
|
-
|
1664
|
+
g ? /* @__PURE__ */ S(
|
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__ */ S(
|
1669
|
+
children: /* @__PURE__ */ S(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 = F(ie), r = F(
|
1678
|
-
|
1679
|
-
s(t.getRules(
|
1680
|
-
const C = t.ruleChange$.subscribe((
|
1681
|
-
|
1677
|
+
const t = F(ie), r = F(de), n = F(ee), i = F(be), o = F(me), a = F(ce), [l, s] = H([]), { workbook: d } = e, u = Pe(d.activeSheet$, void 0, !0), g = d.getUnitId(), c = u == null ? void 0 : u.getSheetId();
|
1678
|
+
ke(() => {
|
1679
|
+
s(t.getRules(g, c));
|
1680
|
+
const C = t.ruleChange$.subscribe((p) => {
|
1681
|
+
p.unitId === g && p.subUnitId === c && s(t.getRules(g, c));
|
1682
1682
|
});
|
1683
1683
|
return () => {
|
1684
1684
|
C.unsubscribe();
|
1685
1685
|
};
|
1686
|
-
}, [
|
1687
|
-
const
|
1688
|
-
const C = tr(i),
|
1689
|
-
unitId:
|
1686
|
+
}, [g, c, t]);
|
1687
|
+
const f = async () => {
|
1688
|
+
const C = tr(i), p = {
|
1689
|
+
unitId: g,
|
1690
1690
|
subUnitId: c,
|
1691
1691
|
rule: C
|
1692
1692
|
};
|
1693
|
-
await n.executeCommand(
|
1694
|
-
unitId:
|
1693
|
+
await n.executeCommand(hn.id, p), o.setActiveRule({
|
1694
|
+
unitId: g,
|
1695
1695
|
subUnitId: c,
|
1696
1696
|
rule: C
|
1697
1697
|
});
|
1698
|
-
},
|
1698
|
+
}, h = () => {
|
1699
1699
|
n.executeCommand(ti.id, {
|
1700
|
-
unitId:
|
1700
|
+
unitId: g,
|
1701
1701
|
subUnitId: c
|
1702
1702
|
});
|
1703
1703
|
}, y = ((C) => {
|
1704
|
-
const
|
1705
|
-
return C.map((
|
1706
|
-
})(l),
|
1704
|
+
const p = r.getCurrentUnitForType(X.UNIVER_SHEET), I = p.getActiveSheet(), _ = p.getUnitId(), v = I.getSheetId();
|
1705
|
+
return C.map((A) => Jr(i, _, v, A.ranges) ? { ...A } : { ...A, disable: !0 });
|
1706
|
+
})(l), w = y == null ? void 0 : y.some((C) => C.disable);
|
1707
1707
|
return /* @__PURE__ */ $("div", { className: "univer-pb-4", children: [
|
1708
1708
|
y == null ? void 0 : y.map((C) => {
|
1709
|
-
var
|
1709
|
+
var p;
|
1710
1710
|
return /* @__PURE__ */ S(
|
1711
1711
|
vo,
|
1712
1712
|
{
|
1713
|
-
unitId:
|
1713
|
+
unitId: g,
|
1714
1714
|
subUnitId: c,
|
1715
1715
|
onClick: () => {
|
1716
1716
|
C.disable || o.setActiveRule({
|
1717
|
-
unitId:
|
1717
|
+
unitId: g,
|
1718
1718
|
subUnitId: c,
|
1719
1719
|
rule: C
|
1720
1720
|
});
|
1721
1721
|
},
|
1722
1722
|
rule: C,
|
1723
|
-
disable: (
|
1723
|
+
disable: (p = C.disable) != null ? p : !1
|
1724
1724
|
},
|
1725
1725
|
C.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 && !
|
1730
|
-
/* @__PURE__ */ S(Ge, { variant: "primary", onClick:
|
1729
|
+
l.length && !w ? /* @__PURE__ */ S(Ge, { onClick: h, children: a.t("dataValidation.panel.removeAll") }) : null,
|
1730
|
+
/* @__PURE__ */ S(Ge, { variant: "primary", onClick: f, children: a.t("dataValidation.panel.add") })
|
1731
1731
|
] })
|
1732
1732
|
] });
|
1733
1733
|
}
|
1734
1734
|
const mo = () => {
|
1735
|
-
const e = F(
|
1735
|
+
const e = F(me), t = Pe(e.activeRule$, e.activeRule), r = F(de), 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__ */ S(
|
1744
|
+
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */ S(po, {}, t.rule.uid) : /* @__PURE__ */ S(fo, { workbook: n });
|
1745
1745
|
}, _o = (e) => {
|
1746
|
-
const { isTwoFormula: t = !1, value: r, onChange: n, showError: i, validResult: o } = e, a = F(
|
1746
|
+
const { isTwoFormula: t = !1, value: r, onChange: n, showError: i, validResult: o } = e, a = F(ce), l = i ? o == null ? void 0 : o.formula1 : "", s = i ? o == null ? void 0 : o.formula2 : "";
|
1747
1747
|
return t ? /* @__PURE__ */ $(ut, { children: [
|
1748
1748
|
/* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1749
|
-
|
1749
|
+
Le,
|
1750
1750
|
{
|
1751
1751
|
className: "univer-w-full",
|
1752
1752
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1761,7 +1761,7 @@ const mo = () => {
|
|
1761
1761
|
) }),
|
1762
1762
|
/* @__PURE__ */ S("div", { className: "-univer-mt-2 univer-mb-1 univer-text-sm univer-text-gray-400", children: a.t("dataValidation.panel.formulaAnd") }),
|
1763
1763
|
/* @__PURE__ */ S(Y, { error: s, children: /* @__PURE__ */ S(
|
1764
|
-
|
1764
|
+
Le,
|
1765
1765
|
{
|
1766
1766
|
className: "univer-w-full",
|
1767
1767
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1775,7 +1775,7 @@ const mo = () => {
|
|
1775
1775
|
}
|
1776
1776
|
) })
|
1777
1777
|
] }) : /* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1778
|
-
|
1778
|
+
Le,
|
1779
1779
|
{
|
1780
1780
|
className: "univer-w-full",
|
1781
1781
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1787,7 +1787,7 @@ const mo = () => {
|
|
1787
1787
|
) });
|
1788
1788
|
};
|
1789
1789
|
function So(e) {
|
1790
|
-
const { value: t, onChange: r, showError: n, validResult: i } = e, o = F(
|
1790
|
+
const { value: t, onChange: r, showError: n, validResult: i } = e, o = F(ce), a = n ? i == null ? void 0 : i.formula1 : "", l = n ? i == null ? void 0 : i.formula2 : "", [s, d] = H(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
1791
1791
|
return /* @__PURE__ */ $(ut, { children: [
|
1792
1792
|
/* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
1793
1793
|
At,
|
@@ -1804,7 +1804,7 @@ function So(e) {
|
|
1804
1804
|
}
|
1805
1805
|
) }),
|
1806
1806
|
s ? /* @__PURE__ */ S(Y, { label: o.t("dataValidation.checkbox.checked"), error: a, children: /* @__PURE__ */ S(
|
1807
|
-
|
1807
|
+
Le,
|
1808
1808
|
{
|
1809
1809
|
className: "univer-w-full",
|
1810
1810
|
placeholder: o.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1818,7 +1818,7 @@ function So(e) {
|
|
1818
1818
|
}
|
1819
1819
|
) }) : null,
|
1820
1820
|
s ? /* @__PURE__ */ S(Y, { label: o.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ S(
|
1821
|
-
|
1821
|
+
Le,
|
1822
1822
|
{
|
1823
1823
|
className: "univer-w-full",
|
1824
1824
|
placeholder: o.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1834,26 +1834,26 @@ function So(e) {
|
|
1834
1834
|
] });
|
1835
1835
|
}
|
1836
1836
|
function Co(e) {
|
1837
|
-
var
|
1838
|
-
const { unitId: t, subUnitId: r, value: n, onChange: i, showError: o, validResult: a } = e, l = o ? a == null ? void 0 : a.formula1 : void 0, s =
|
1837
|
+
var g;
|
1838
|
+
const { unitId: t, subUnitId: r, value: n, onChange: i, showError: o, validResult: a } = e, l = o ? a == null ? void 0 : a.formula1 : void 0, s = gt(null), [d, u] = H(!1);
|
1839
1839
|
return cr((c) => {
|
1840
|
-
var
|
1841
|
-
((
|
1840
|
+
var h;
|
1841
|
+
((h = s.current) == null ? void 0 : h.isClickOutSide(c)) && u(!1);
|
1842
1842
|
}), /* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1843
1843
|
fr,
|
1844
1844
|
{
|
1845
1845
|
ref: s,
|
1846
|
-
className:
|
1847
|
-
initValue: (
|
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
|
+
initValue: (g = n == null ? void 0 : n.formula1) != null ? g : "=",
|
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 f = (c != null ? c : "").trim();
|
1854
|
+
f !== (n == null ? void 0 : n.formula1) && (i == null || i({
|
1855
1855
|
...n,
|
1856
|
-
formula1:
|
1856
|
+
formula1: f
|
1857
1857
|
}));
|
1858
1858
|
},
|
1859
1859
|
onFocus: () => u(!0)
|
@@ -1886,7 +1886,7 @@ const wo = [
|
|
1886
1886
|
"#9E6DE3",
|
1887
1887
|
"#F248A6"
|
1888
1888
|
], Io = (e) => {
|
1889
|
-
const { value: t, onChange: r, disabled: n } = e, [i, o] =
|
1889
|
+
const { value: t, onChange: r, disabled: n } = e, [i, o] = H(!1);
|
1890
1890
|
return /* @__PURE__ */ S(
|
1891
1891
|
Vi,
|
1892
1892
|
{
|
@@ -1902,7 +1902,7 @@ const wo = [
|
|
1902
1902
|
(a) => /* @__PURE__ */ S(
|
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,7 +1916,7 @@ 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
1921
|
/* @__PURE__ */ S(
|
1922
1922
|
"div",
|
@@ -1925,16 +1925,16 @@ const wo = [
|
|
1925
1925
|
style: { background: t }
|
1926
1926
|
}
|
1927
1927
|
),
|
1928
|
-
/* @__PURE__ */ S(
|
1928
|
+
/* @__PURE__ */ S(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__ */ S("div", { className:
|
1936
|
+
return /* @__PURE__ */ $("div", { className: Ne("univer-flex univer-items-center univer-gap-2", n), children: [
|
1937
|
+
!t.isRef && /* @__PURE__ */ S("div", { className: Ne("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ S(Mr, {}) }),
|
1938
1938
|
/* @__PURE__ */ S(
|
1939
1939
|
Io,
|
1940
1940
|
{
|
@@ -1945,7 +1945,7 @@ const wo = [
|
|
1945
1945
|
}
|
1946
1946
|
),
|
1947
1947
|
/* @__PURE__ */ S(
|
1948
|
-
|
1948
|
+
Le,
|
1949
1949
|
{
|
1950
1950
|
disabled: t.isRef,
|
1951
1951
|
value: t.label,
|
@@ -1958,165 +1958,165 @@ const wo = [
|
|
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__ */ S(
|
1961
|
+
children: /* @__PURE__ */ S(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,
|
1969
|
-
|
1968
|
+
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, g] = H(() => Ve(s) ? "1" : "0"), [c, f] = H(u === "1" ? s : "="), [h, M] = H(u === "1" ? s : "="), y = F(ce), w = F(Me), C = F(pn), p = F(ni), [I, _] = H(() => d.split(",")), v = w.getValidatorItem(j.LIST), [R, A] = H([]), [N, O] = H(""), L = a ? o == null ? void 0 : o.formula1 : "", D = ct(() => C.ruleChange$.pipe(ur(16)), []), T = Pe(D), 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
|
1975
|
-
if (
|
1976
|
-
const
|
1977
|
-
|
1974
|
+
const b = C.getRuleById(n, i, l), U = b == null ? void 0 : b.formula1;
|
1975
|
+
if (Ve(U) && v && b) {
|
1976
|
+
const m = await v.getListAsync(b, n, i);
|
1977
|
+
A(m);
|
1978
1978
|
}
|
1979
1979
|
})();
|
1980
|
-
}, [C,
|
1981
|
-
|
1982
|
-
}, [
|
1983
|
-
const [
|
1984
|
-
const
|
1985
|
-
return
|
1986
|
-
label:
|
1987
|
-
color: U[
|
1980
|
+
}, [C, T, v, l, i, n]), ke(() => {
|
1981
|
+
Ve(s) && s !== h && (f(s), M(h));
|
1982
|
+
}, [h, s]);
|
1983
|
+
const [B, z] = H(() => {
|
1984
|
+
const b = u !== "1" ? ri(s) : [], U = d.split(",");
|
1985
|
+
return b.map((m, P) => ({
|
1986
|
+
label: m,
|
1987
|
+
color: U[P] || Te,
|
1988
1988
|
isRef: !1,
|
1989
|
-
id:
|
1989
|
+
id: bn(4)
|
1990
1990
|
}));
|
1991
|
-
}),
|
1992
|
-
const
|
1993
|
-
|
1994
|
-
},
|
1995
|
-
const U =
|
1996
|
-
U !== -1 && (
|
1997
|
-
},
|
1998
|
-
label:
|
1999
|
-
color:
|
1991
|
+
}), te = (b, U, m) => {
|
1992
|
+
const P = B.find((x) => x.id === b);
|
1993
|
+
P && (P.label = U, P.color = m, z([...B]));
|
1994
|
+
}, W = (b) => {
|
1995
|
+
const U = B.findIndex((m) => m.id === b);
|
1996
|
+
U !== -1 && (B.splice(U, 1), z([...B]));
|
1997
|
+
}, ne = d.split(","), oe = ct(() => R.map((b, U) => ({
|
1998
|
+
label: b,
|
1999
|
+
color: ne[U] || Te,
|
2000
2000
|
id: `${U}`,
|
2001
2001
|
isRef: !0
|
2002
|
-
})), [
|
2003
|
-
const
|
2004
|
-
|
2002
|
+
})), [ne, R]), Se = (b, U, m) => {
|
2003
|
+
const P = [...I];
|
2004
|
+
P[+b] = m, _(P), k({
|
2005
2005
|
formula1: s,
|
2006
|
-
formula2:
|
2006
|
+
formula2: P.join(",")
|
2007
2007
|
});
|
2008
|
-
},
|
2009
|
-
|
2010
|
-
...
|
2008
|
+
}, Ce = () => {
|
2009
|
+
z([
|
2010
|
+
...B,
|
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
|
2023
|
-
|
2024
|
-
labelList:
|
2025
|
-
item:
|
2026
|
-
})).forEach(({ item:
|
2027
|
-
|
2028
|
-
|
2022
|
+
const b = /* @__PURE__ */ new Set(), U = [];
|
2023
|
+
B.map((m) => ({
|
2024
|
+
labelList: m.label.split(","),
|
2025
|
+
item: m
|
2026
|
+
})).forEach(({ item: m, labelList: P }) => {
|
2027
|
+
P.forEach((x) => {
|
2028
|
+
b.has(x) || (b.add(x), U.push({
|
2029
2029
|
label: x,
|
2030
|
-
color:
|
2030
|
+
color: m.color
|
2031
2031
|
}));
|
2032
2032
|
});
|
2033
2033
|
}), k({
|
2034
|
-
formula1: er(U.map((
|
2035
|
-
formula2: U.map((
|
2034
|
+
formula1: er(U.map((m) => m.label)),
|
2035
|
+
formula2: U.map((m) => m.color === Te ? "" : m.color).join(",")
|
2036
2036
|
});
|
2037
|
-
}, [
|
2038
|
-
const
|
2039
|
-
if (!
|
2037
|
+
}, [B, k, u, h, I]);
|
2038
|
+
const G = nn(async (b) => {
|
2039
|
+
if (!Ve(b)) {
|
2040
2040
|
k == null || k({
|
2041
2041
|
formula1: "",
|
2042
2042
|
formula2: d
|
2043
2043
|
});
|
2044
2044
|
return;
|
2045
2045
|
}
|
2046
|
-
|
2047
|
-
formula1:
|
2046
|
+
p.getFormulaRefCheck(b) ? (k == null || k({
|
2047
|
+
formula1: Ve(b) ? b : "",
|
2048
2048
|
formula2: d
|
2049
|
-
}),
|
2049
|
+
}), O("")) : (k == null || k({
|
2050
2050
|
formula1: "",
|
2051
2051
|
formula2: d
|
2052
|
-
}),
|
2053
|
-
}),
|
2054
|
-
return cr((
|
2055
|
-
var
|
2056
|
-
((
|
2052
|
+
}), f("="), O(y.t("dataValidation.validFail.formulaError")));
|
2053
|
+
}), Z = gt(null), [ve, q] = H(!1);
|
2054
|
+
return cr((b) => {
|
2055
|
+
var m;
|
2056
|
+
((m = Z.current) == null ? void 0 : m.isClickOutSide(b)) && q(!1);
|
2057
2057
|
}), /* @__PURE__ */ $(ut, { children: [
|
2058
2058
|
/* @__PURE__ */ S(Y, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ $(
|
2059
|
-
|
2059
|
+
_n,
|
2060
2060
|
{
|
2061
2061
|
value: u,
|
2062
|
-
onChange: (
|
2063
|
-
|
2064
|
-
formula1:
|
2062
|
+
onChange: (b) => {
|
2063
|
+
g(b), f(h), b === "1" && k({
|
2064
|
+
formula1: h === "=" ? "" : h,
|
2065
2065
|
formula2: I.join(",")
|
2066
2066
|
});
|
2067
2067
|
},
|
2068
2068
|
children: [
|
2069
|
-
/* @__PURE__ */ S(
|
2070
|
-
/* @__PURE__ */ S(
|
2069
|
+
/* @__PURE__ */ S(Ae, { value: "0", children: y.t("dataValidation.list.customOptions") }),
|
2070
|
+
/* @__PURE__ */ S(Ae, { value: "1", children: y.t("dataValidation.list.refOptions") })
|
2071
2071
|
]
|
2072
2072
|
}
|
2073
2073
|
) }),
|
2074
|
-
u === "1" ? /* @__PURE__ */ $(Y, { error:
|
2074
|
+
u === "1" ? /* @__PURE__ */ $(Y, { error: L || N || void 0, children: [
|
2075
2075
|
/* @__PURE__ */ S(
|
2076
2076
|
fr,
|
2077
2077
|
{
|
2078
|
-
ref:
|
2079
|
-
className:
|
2078
|
+
ref: Z,
|
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
|
-
isFocus:
|
2083
|
+
isFocus: ve,
|
2084
2084
|
isSupportAcrossSheet: !0,
|
2085
|
-
onFocus: () =>
|
2086
|
-
onChange: (
|
2087
|
-
const U = (
|
2088
|
-
|
2085
|
+
onFocus: () => q(!0),
|
2086
|
+
onChange: (b = "") => {
|
2087
|
+
const U = (b != null ? b : "").trim();
|
2088
|
+
M(U), G(U);
|
2089
2089
|
}
|
2090
2090
|
}
|
2091
2091
|
),
|
2092
|
-
|
2093
|
-
|
2092
|
+
oe.length > 0 && /* @__PURE__ */ S("div", { className: "univer-mt-3", children: oe.map((b) => /* @__PURE__ */ S(
|
2093
|
+
xn,
|
2094
2094
|
{
|
2095
2095
|
className: "univer-mb-3",
|
2096
|
-
item:
|
2097
|
-
commonProps: { onItemChange:
|
2096
|
+
item: b,
|
2097
|
+
commonProps: { onItemChange: Se }
|
2098
2098
|
},
|
2099
|
-
|
2099
|
+
b.id
|
2100
2100
|
)) })
|
2101
|
-
] }) : /* @__PURE__ */ S(Y, { error:
|
2101
|
+
] }) : /* @__PURE__ */ S(Y, { error: L, children: /* @__PURE__ */ $("div", { className: "-univer-mt-3", children: [
|
2102
2102
|
/* @__PURE__ */ S(
|
2103
2103
|
Di,
|
2104
2104
|
{
|
2105
|
-
list:
|
2106
|
-
onListChange:
|
2105
|
+
list: B,
|
2106
|
+
onListChange: z,
|
2107
2107
|
rowHeight: 28,
|
2108
2108
|
margin: [0, 12],
|
2109
2109
|
draggableHandle: ".draggableHandle",
|
2110
|
-
itemRender: (
|
2111
|
-
|
2110
|
+
itemRender: (b) => /* @__PURE__ */ S(
|
2111
|
+
xn,
|
2112
2112
|
{
|
2113
|
-
item:
|
2113
|
+
item: b,
|
2114
2114
|
commonProps: {
|
2115
|
-
onItemChange:
|
2116
|
-
onItemDelete:
|
2115
|
+
onItemChange: te,
|
2116
|
+
onItemDelete: W
|
2117
2117
|
}
|
2118
2118
|
},
|
2119
|
-
|
2119
|
+
b.id
|
2120
2120
|
),
|
2121
2121
|
idKey: "id"
|
2122
2122
|
}
|
@@ -2125,7 +2125,7 @@ function Ro(e) {
|
|
2125
2125
|
"a",
|
2126
2126
|
{
|
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
|
-
onClick:
|
2128
|
+
onClick: Ce,
|
2129
2129
|
children: [
|
2130
2130
|
/* @__PURE__ */ S(yr, { className: "univer-mr-1" }),
|
2131
2131
|
y.t("dataValidation.list.add")
|
@@ -2145,7 +2145,7 @@ const yo = [
|
|
2145
2145
|
_o
|
2146
2146
|
],
|
2147
2147
|
[
|
2148
|
-
|
2148
|
+
gn,
|
2149
2149
|
Ro
|
2150
2150
|
],
|
2151
2151
|
[
|
@@ -2155,18 +2155,18 @@ 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 = F(
|
2159
|
-
return /* @__PURE__ */ S(Y, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ $(
|
2160
|
-
/* @__PURE__ */ S(
|
2161
|
-
/* @__PURE__ */ S(
|
2162
|
-
/* @__PURE__ */ S(
|
2158
|
+
const { value: t, onChange: r } = e, n = F(ce);
|
2159
|
+
return /* @__PURE__ */ S(Y, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ $(_n, { value: `${(i = t.renderMode) != null ? i : ae.CUSTOM}`, onChange: (o) => r({ ...t, renderMode: +o }), children: [
|
2160
|
+
/* @__PURE__ */ S(Ae, { value: `${ae.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2161
|
+
/* @__PURE__ */ S(Ae, { value: `${ae.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2162
|
+
/* @__PURE__ */ S(Ae, { value: `${ae.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 = F(
|
2169
|
+
const { value: t, onChange: r } = e, n = F(ce);
|
2170
2170
|
return /* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
2171
2171
|
At,
|
2172
2172
|
{
|
@@ -2189,21 +2189,21 @@ 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
|
}
|
2198
2198
|
_calc(e, t) {
|
2199
|
-
var d, u,
|
2199
|
+
var d, u, g;
|
2200
2200
|
const { vt: r, ht: n } = t || {}, i = e.endX - e.startX - _t * 2, o = e.endY - e.startY, a = ((d = t == null ? void 0 : t.fs) != null ? d : 10) * 1.6;
|
2201
2201
|
let l = 0, s = 0;
|
2202
2202
|
switch (r) {
|
2203
|
-
case
|
2203
|
+
case le.TOP:
|
2204
2204
|
s = 0;
|
2205
2205
|
break;
|
2206
|
-
case
|
2206
|
+
case le.BOTTOM:
|
2207
2207
|
s = 0 + (o - a);
|
2208
2208
|
break;
|
2209
2209
|
default:
|
@@ -2225,7 +2225,7 @@ let rn = class {
|
|
2225
2225
|
left: e.startX + l,
|
2226
2226
|
top: e.startY + s,
|
2227
2227
|
width: ((u = t == null ? void 0 : t.fs) != null ? u : 10) * 1.6,
|
2228
|
-
height: ((
|
2228
|
+
height: ((g = t == null ? void 0 : t.fs) != null ? g : 10) * 1.6
|
2229
2229
|
};
|
2230
2230
|
}
|
2231
2231
|
calcCellAutoHeight(e) {
|
@@ -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,
|
2243
|
-
const { formula1: n = ai, formula2: i = oi } = e, o = await this._formulaService.getRuleFormulaResult(t, r, e.uid), a = Ft((
|
2242
|
+
var d, u, g, c, f, h, M, y, w;
|
2243
|
+
const { formula1: n = ai, formula2: i = oi } = e, o = await this._formulaService.getRuleFormulaResult(t, r, e.uid), a = Ft((g = (u = (d = o == null ? void 0 : o[0]) == null ? void 0 : d.result) == null ? void 0 : u[0]) == null ? void 0 : g[0]), l = Ft((h = (f = (c = o == null ? void 0 : o[1]) == null ? void 0 : c.result) == null ? void 0 : f[0]) == null ? void 0 : h[0]), s = Vn(String(a)) && Vn(String(l));
|
2244
2244
|
return {
|
2245
|
-
formula1:
|
2246
|
-
formula2:
|
2245
|
+
formula1: Ve(n) ? Ft((w = (y = (M = o == null ? void 0 : o[0]) == null ? void 0 : M.result) == null ? void 0 : y[0]) == null ? void 0 : w[0]) : n,
|
2246
|
+
formula2: Ve(i) ? l : i,
|
2247
2247
|
isFormulaValid: s
|
2248
2248
|
};
|
2249
2249
|
}
|
2250
2250
|
drawWith(e, t) {
|
2251
|
-
var
|
2252
|
-
const { style: r, primaryWithCoord: n, unitId: i, subUnitId: o, worksheet: a, row: l, col: s } = t, d = n.isMergedMainCell ? n.mergeInfo : n, u = re(a.getCellRaw(l, s)),
|
2253
|
-
if (!
|
2251
|
+
var L, D, T, 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 = re(a.getCellRaw(l, s)), g = this._dataValidationModel.getRuleByLocation(i, o, l, s);
|
2253
|
+
if (!g)
|
2254
2254
|
return;
|
2255
|
-
const c = this._dataValidationModel.getValidator(
|
2256
|
-
if (!c || !((
|
2255
|
+
const c = this._dataValidationModel.getValidator(g.type);
|
2256
|
+
if (!c || !((L = c.skipDefaultFontRender) != null && L.call(c, g, u, { unitId: i, subUnitId: o, row: l, column: s })))
|
2257
2257
|
return;
|
2258
|
-
const
|
2258
|
+
const f = c.parseFormulaSync(g, i, o), { formula1: h } = f, M = this._calc(d, r), { a: y, d: w } = e.getTransform(), C = Mn(M.left, y), p = Mn(M.top, w), I = Yr.create().composeMatrix({
|
2259
2259
|
left: C,
|
2260
|
-
top:
|
2260
|
+
top: p,
|
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
|
-
}),
|
2269
|
-
e.save(), e.beginPath(), e.rect(d.startX, d.startY,
|
2268
|
+
}), _ = d.endX - d.startX, v = d.endY - d.startY;
|
2269
|
+
e.save(), e.beginPath(), e.rect(d.startX, d.startY, _, v), 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 A = ((D = r == null ? void 0 : r.fs) != null ? D : 10) * 1.6, N = String(u) === String(h), O = this._themeService.getColorFromTheme("primary.600");
|
2273
2273
|
Xr.drawWith(e, {
|
2274
2274
|
checked: N,
|
2275
|
-
width:
|
2276
|
-
height:
|
2277
|
-
fill: (k = (
|
2275
|
+
width: A,
|
2276
|
+
height: A,
|
2277
|
+
fill: (k = (T = r == null ? void 0 : r.cl) == null ? void 0 : T.rgb) != null ? k : O
|
2278
2278
|
}), e.restore();
|
2279
2279
|
}
|
2280
2280
|
isHit(e, t) {
|
@@ -2282,16 +2282,16 @@ let rn = class {
|
|
2282
2282
|
return s <= l && s >= a && d <= o && d >= i;
|
2283
2283
|
}
|
2284
2284
|
async onPointerDown(e, t) {
|
2285
|
-
var
|
2285
|
+
var h;
|
2286
2286
|
if (t.button === 2)
|
2287
2287
|
return;
|
2288
2288
|
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s = re(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
|
-
if (!u || !((
|
2292
|
+
if (!u || !((h = u.skipDefaultFontRender) != null && h.call(u, d, s, { unitId: n, subUnitId: i, row: a, column: l })))
|
2293
2293
|
return;
|
2294
|
-
const { formula1:
|
2294
|
+
const { formula1: g, formula2: c } = await this._parseFormula(d, n, i), f = {
|
2295
2295
|
range: {
|
2296
2296
|
startColumn: r.actualColumn,
|
2297
2297
|
endColumn: r.actualColumn,
|
@@ -2299,13 +2299,13 @@ let rn = class {
|
|
2299
2299
|
endRow: r.actualRow
|
2300
2300
|
},
|
2301
2301
|
value: {
|
2302
|
-
v: String(s) === si(String(
|
2302
|
+
v: String(s) === si(String(g)) ? c : g,
|
2303
2303
|
p: null
|
2304
2304
|
}
|
2305
2305
|
};
|
2306
2306
|
this._commandService.executeCommand(
|
2307
2307
|
st.id,
|
2308
|
-
|
2308
|
+
f
|
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, ee),
|
2322
|
+
je(1, de),
|
2323
|
+
je(2, E(ii)),
|
2324
|
+
je(3, E(Xn)),
|
2325
|
+
je(4, E(Fe)),
|
2326
|
+
je(5, E(ie))
|
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 _e = 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", gn);
|
2339
2339
|
this.injector = e;
|
2340
2340
|
}
|
2341
2341
|
};
|
2342
|
-
|
2343
|
-
To(0,
|
2344
|
-
],
|
2345
|
-
class Po extends
|
2342
|
+
_e = Oo([
|
2343
|
+
To(0, E(be))
|
2344
|
+
], _e);
|
2345
|
+
class Po extends _e {
|
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 _e {
|
2354
2354
|
constructor() {
|
2355
2355
|
super(...arguments);
|
2356
2356
|
V(this, "id", j.CUSTOM);
|
@@ -2358,23 +2358,23 @@ class Ao extends Ce {
|
|
2358
2358
|
}
|
2359
2359
|
}
|
2360
2360
|
const Lo = "data-validation.formula-input";
|
2361
|
-
class ko extends
|
2361
|
+
class ko extends _e {
|
2362
2362
|
constructor() {
|
2363
2363
|
super(...arguments);
|
2364
2364
|
V(this, "id", j.DATE);
|
2365
2365
|
V(this, "formulaInput", Lo);
|
2366
2366
|
V(this, "optionsInput", Vt.componentKey);
|
2367
|
-
V(this, "dropdownType",
|
2367
|
+
V(this, "dropdownType", pe.DATE);
|
2368
2368
|
}
|
2369
2369
|
}
|
2370
|
-
class No extends
|
2370
|
+
class No extends _e {
|
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,17 +2384,17 @@ 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:
|
2395
|
-
!s || s.width +
|
2396
|
-
width:
|
2397
|
-
height:
|
2394
|
+
const { layout: f } = c, { width: h, height: M } = f;
|
2395
|
+
!s || s.width + h + $t > o ? (s = {
|
2396
|
+
width: h,
|
2397
|
+
height: M,
|
2398
2398
|
items: [{
|
2399
2399
|
...c,
|
2400
2400
|
left: 0
|
@@ -2402,18 +2402,18 @@ function jt(e, t, r, n) {
|
|
2402
2402
|
}, d.push(s)) : (s.items.push({
|
2403
2403
|
...c,
|
2404
2404
|
left: s.width + $t
|
2405
|
-
}), s.width = s.width +
|
2405
|
+
}), s.width = s.width + h + $t);
|
2406
2406
|
});
|
2407
|
-
let u = 0,
|
2408
|
-
return d.forEach((c,
|
2409
|
-
|
2407
|
+
let u = 0, g = 0;
|
2408
|
+
return d.forEach((c, f) => {
|
2409
|
+
g = Math.max(g, c.width), f === d.length - 1 ? u += c.height : u += c.height + Dr;
|
2410
2410
|
}), {
|
2411
2411
|
lines: d,
|
2412
2412
|
totalHeight: u,
|
2413
2413
|
contentWidth: o,
|
2414
2414
|
contentHeight: a,
|
2415
2415
|
cellAutoHeight: u + Ot * 2,
|
2416
|
-
calcAutoWidth:
|
2416
|
+
calcAutoWidth: g + i
|
2417
2417
|
};
|
2418
2418
|
}
|
2419
2419
|
const xo = 8;
|
@@ -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,105 +2448,105 @@ 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
|
-
case
|
2455
|
-
a = (n -
|
2454
|
+
case le.MIDDLE:
|
2455
|
+
a = (n - De) / 2 + 4;
|
2456
2456
|
break;
|
2457
|
-
case
|
2458
|
-
a = n -
|
2457
|
+
case le.BOTTOM:
|
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,
|
2467
|
-
if (!
|
2465
|
+
var oe, Se;
|
2466
|
+
const { primaryWithCoord: i, row: o, col: a, style: l, data: s, subUnitId: d } = t, u = i.isMergedMainCell ? i.mergeInfo : i, g = s == null ? void 0 : s.fontRenderExtension, { leftOffset: c = 0, rightOffset: f = 0, topOffset: h = 0, downOffset: M = 0 } = g || {}, y = this._ensureMap(d), w = this._generateKey(o, a), C = i.isMergedMainCell ? i.mergeInfo.startRow : o, p = i.isMergedMainCell ? i.mergeInfo.startColumn : a, I = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, C, p);
|
2467
|
+
if (!I)
|
2468
2468
|
return;
|
2469
|
-
const
|
2470
|
-
if (!
|
2469
|
+
const _ = this._dataValidationModel.getValidator(I.type);
|
2470
|
+
if (!_)
|
2471
2471
|
return;
|
2472
|
-
const
|
2472
|
+
const v = {
|
2473
2473
|
startX: u.startX + c,
|
2474
|
-
endX: u.endX -
|
2475
|
-
startY: u.startY +
|
2476
|
-
endY: u.endY -
|
2477
|
-
},
|
2478
|
-
this._drawDownIcon(e,
|
2479
|
-
let
|
2480
|
-
switch (
|
2481
|
-
case
|
2482
|
-
|
2474
|
+
endX: u.endX - f,
|
2475
|
+
startY: u.startY + h,
|
2476
|
+
endY: u.endY - M
|
2477
|
+
}, R = v.endX - v.startX, A = v.endY - v.startY, { cl: N } = l || {}, O = (oe = typeof N == "object" ? N == null ? void 0 : N.rgb : N) != null ? oe : "#000", L = Oe(l != null ? l : void 0), { vt: D, ht: T } = l || {}, k = D != null ? D : le.MIDDLE, B = (Se = re(s)) != null ? Se : "", z = _.parseCellValue(B), te = _.getListWithColorMap(I), W = jt(z, L, R, A);
|
2478
|
+
this._drawDownIcon(e, v, R, A, k), e.save(), e.translateWithPrecision(v.startX, v.startY), e.beginPath(), e.rect(0, 0, R - De, A), e.clip(), e.translateWithPrecision(an, Ot);
|
2479
|
+
let ne = 0;
|
2480
|
+
switch (k) {
|
2481
|
+
case le.MIDDLE:
|
2482
|
+
ne = (W.contentHeight - W.totalHeight) / 2;
|
2483
2483
|
break;
|
2484
|
-
case
|
2485
|
-
|
2484
|
+
case le.BOTTOM:
|
2485
|
+
ne = W.contentHeight - W.totalHeight;
|
2486
2486
|
break;
|
2487
2487
|
}
|
2488
|
-
e.translateWithPrecision(0,
|
2488
|
+
e.translateWithPrecision(0, ne), W.lines.forEach((Ce, G) => {
|
2489
2489
|
e.save();
|
2490
|
-
const { width: Z, height:
|
2491
|
-
let
|
2490
|
+
const { width: Z, height: ve, items: q } = Ce;
|
2491
|
+
let b = 0;
|
2492
2492
|
switch (T) {
|
2493
2493
|
case Re.RIGHT:
|
2494
|
-
|
2494
|
+
b = W.contentWidth - Z;
|
2495
2495
|
break;
|
2496
2496
|
case Re.CENTER:
|
2497
|
-
|
2497
|
+
b = (W.contentWidth - Z) / 2;
|
2498
2498
|
break;
|
2499
2499
|
}
|
2500
|
-
e.translate(
|
2501
|
-
e.save(), e.translateWithPrecision(
|
2502
|
-
...
|
2503
|
-
info:
|
2504
|
-
color:
|
2505
|
-
fill:
|
2500
|
+
e.translate(b, G * (ve + Dr)), q.forEach((U) => {
|
2501
|
+
e.save(), e.translateWithPrecision(U.left, 0), Bo.drawWith(e, {
|
2502
|
+
...L,
|
2503
|
+
info: U,
|
2504
|
+
color: O,
|
2505
|
+
fill: te[U.text]
|
2506
2506
|
}), e.restore();
|
2507
2507
|
}), e.restore();
|
2508
|
-
}), e.restore(), y.set(
|
2509
|
-
left:
|
2510
|
-
top:
|
2511
|
-
width:
|
2512
|
-
height:
|
2508
|
+
}), e.restore(), y.set(w, {
|
2509
|
+
left: v.startX,
|
2510
|
+
top: v.startY,
|
2511
|
+
width: W.contentWidth + an + De,
|
2512
|
+
height: W.contentHeight + Ot * 2
|
2513
2513
|
});
|
2514
2514
|
}
|
2515
2515
|
calcCellAutoHeight(e) {
|
2516
|
-
var
|
2517
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
2518
|
-
startX:
|
2519
|
-
endX:
|
2520
|
-
startY:
|
2521
|
-
endY:
|
2522
|
-
},
|
2523
|
-
if (!
|
2516
|
+
var _;
|
2517
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, g = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
2518
|
+
startX: g.startX + l,
|
2519
|
+
endX: g.endX - s,
|
2520
|
+
startY: g.startY + d,
|
2521
|
+
endY: g.endY - u
|
2522
|
+
}, f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2523
|
+
if (!f)
|
2524
2524
|
return;
|
2525
|
-
const
|
2526
|
-
if (!
|
2525
|
+
const h = this._dataValidationModel.getValidator(f.type);
|
2526
|
+
if (!h)
|
2527
2527
|
return;
|
2528
|
-
const
|
2529
|
-
return jt(C,
|
2528
|
+
const M = c.endX - c.startX, y = c.endY - c.startY, w = (_ = re(n)) != null ? _ : "", C = h.parseCellValue(w), p = Oe(r != null ? r : void 0);
|
2529
|
+
return jt(C, p, M, y).cellAutoHeight;
|
2530
2530
|
}
|
2531
2531
|
calcCellAutoWidth(e) {
|
2532
|
-
var
|
2533
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
2534
|
-
startX:
|
2535
|
-
endX:
|
2536
|
-
startY:
|
2537
|
-
endY:
|
2538
|
-
},
|
2539
|
-
if (!
|
2532
|
+
var _;
|
2533
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, g = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
2534
|
+
startX: g.startX + l,
|
2535
|
+
endX: g.endX - s,
|
2536
|
+
startY: g.startY + d,
|
2537
|
+
endY: g.endY - u
|
2538
|
+
}, f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2539
|
+
if (!f)
|
2540
2540
|
return;
|
2541
|
-
const
|
2542
|
-
if (!
|
2541
|
+
const h = this._dataValidationModel.getValidator(f.type);
|
2542
|
+
if (!h)
|
2543
2543
|
return;
|
2544
|
-
const
|
2545
|
-
return jt(C,
|
2544
|
+
const M = c.endX - c.startX, y = c.endY - c.startY, w = (_ = re(n)) != null ? _ : "", C = h.parseCellValue(w), p = Oe(r != null ? r : void 0);
|
2545
|
+
return jt(C, p, M, 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,18 +2568,18 @@ 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,
|
2573
|
-
St(1,
|
2574
|
-
St(2,
|
2575
|
-
St(3,
|
2576
|
-
],
|
2577
|
-
class jo extends
|
2571
|
+
sn = Ho([
|
2572
|
+
St(0, ee),
|
2573
|
+
St(1, de),
|
2574
|
+
St(2, E(Fe)),
|
2575
|
+
St(3, E(ie))
|
2576
|
+
], sn);
|
2577
|
+
class jo extends _e {
|
2578
2578
|
constructor() {
|
2579
2579
|
super(...arguments);
|
2580
2580
|
V(this, "id", j.LIST_MULTIPLE);
|
2581
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2582
|
-
V(this, "dropdownType",
|
2581
|
+
V(this, "canvasRender", this.injector.createInstance(sn));
|
2582
|
+
V(this, "dropdownType", pe.MULTIPLE_LIST);
|
2583
2583
|
}
|
2584
2584
|
}
|
2585
2585
|
var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, r, n) => {
|
@@ -2587,15 +2587,15 @@ 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;
|
2594
2594
|
switch (i) {
|
2595
|
-
case
|
2595
|
+
case le.BOTTOM:
|
2596
2596
|
l = t - n - s;
|
2597
2597
|
break;
|
2598
|
-
case
|
2598
|
+
case le.MIDDLE:
|
2599
2599
|
l = (t - n) / 2;
|
2600
2600
|
break;
|
2601
2601
|
default:
|
@@ -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,13 +2631,13 @@ 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 = Q.pd.t, b: s = Q.pd.b } = a, d = r - ge;
|
2635
2635
|
let u;
|
2636
2636
|
switch (o) {
|
2637
|
-
case
|
2637
|
+
case le.MIDDLE:
|
2638
2638
|
u = (n - Ct) / 2;
|
2639
2639
|
break;
|
2640
|
-
case
|
2640
|
+
case le.BOTTOM:
|
2641
2641
|
u = n - s - i - Xe + (i / 2 - Ct / 2);
|
2642
2642
|
break;
|
2643
2643
|
default:
|
@@ -2648,157 +2648,157 @@ let sn = class {
|
|
2648
2648
|
}
|
2649
2649
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2650
2650
|
drawWith(e, t, r) {
|
2651
|
-
var
|
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,
|
2653
|
-
if (!
|
2651
|
+
var te, W, ne, oe, Se, Ce;
|
2652
|
+
const { primaryWithCoord: n, row: i, col: o, style: a, data: l, subUnitId: s } = t, d = n.isMergedMainCell ? n.mergeInfo : n, u = n.isMergedMainCell ? n.mergeInfo.startRow : i, g = n.isMergedMainCell ? n.mergeInfo.startColumn : o, c = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, u, g);
|
2653
|
+
if (!c)
|
2654
2654
|
return;
|
2655
|
-
const
|
2656
|
-
if (!
|
2655
|
+
const f = this._dataValidationModel.getValidator(c.type);
|
2656
|
+
if (!f)
|
2657
2657
|
return;
|
2658
|
-
const
|
2659
|
-
if (!
|
2658
|
+
const h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: M = 0, rightOffset: y = 0, topOffset: w = 0, downOffset: C = 0 } = h || {};
|
2659
|
+
if (!c || !f || !f || f.id.indexOf(j.LIST) !== 0 || !f.skipDefaultFontRender(c))
|
2660
2660
|
return;
|
2661
|
-
const
|
2662
|
-
startX: d.startX +
|
2663
|
-
endX: d.endX -
|
2664
|
-
startY: d.startY +
|
2665
|
-
endY: d.endY -
|
2666
|
-
},
|
2667
|
-
let { tb:
|
2668
|
-
|
2669
|
-
const
|
2670
|
-
if (
|
2671
|
-
const { l:
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2661
|
+
const p = {
|
2662
|
+
startX: d.startX + M,
|
2663
|
+
endX: d.endX - y,
|
2664
|
+
startY: d.startY + w,
|
2665
|
+
endY: d.endY - C
|
2666
|
+
}, I = p.endX - p.startX, _ = p.endY - p.startY, v = this._ensureMap(s), R = this._generateKey(i, o), A = f.getListWithColor(c), N = re(l), O = `${N != null ? N : ""}`, L = A.find((G) => G.label === O);
|
2667
|
+
let { tb: D, vt: T, ht: k, pd: B } = a || {};
|
2668
|
+
D = D != null ? D : fe.WRAP, T = T != null ? T : le.BOTTOM, k = k != null ? k : Q.ht, B = B != null ? B : Q.pd;
|
2669
|
+
const z = Oe(a).fontCache;
|
2670
|
+
if (c.renderMode === ae.ARROW) {
|
2671
|
+
const { l: G = Q.pd.l, t: Z = Q.pd.t, r: ve = Q.pd.r, b: q = Q.pd.b } = B, b = I - G - ve - ge - 4, U = new it(
|
2672
|
+
O,
|
2673
|
+
z,
|
2674
|
+
D === fe.WRAP,
|
2675
|
+
b,
|
2676
2676
|
1 / 0
|
2677
2677
|
);
|
2678
|
-
|
2679
|
-
const
|
2680
|
-
this._drawDownIcon(e,
|
2681
|
-
text:
|
2682
|
-
fontStyle:
|
2683
|
-
width:
|
2684
|
-
height:
|
2685
|
-
color: (
|
2686
|
-
strokeLine: !!((
|
2687
|
-
underline: !!((
|
2688
|
-
warp:
|
2678
|
+
U.calculate();
|
2679
|
+
const m = U.getTotalWidth(), P = U.getTotalHeight(), { paddingTop: x, paddingLeft: ue } = Wn(b, _ - Z - q, m, P, T, k, !0);
|
2680
|
+
this._drawDownIcon(e, p, I, _, P, T, B), e.save(), e.translateWithPrecision(p.startX + G, p.startY + Z), e.beginPath(), e.rect(0, 0, I - G - ve, _ - Z - q), e.clip(), e.translateWithPrecision(0, x), e.save(), e.translateWithPrecision(ue, 0), e.beginPath(), e.rect(0, 0, b, P), e.clip(), En.drawWith(e, {
|
2681
|
+
text: O,
|
2682
|
+
fontStyle: z,
|
2683
|
+
width: b,
|
2684
|
+
height: P,
|
2685
|
+
color: (te = a == null ? void 0 : a.cl) == null ? void 0 : te.rgb,
|
2686
|
+
strokeLine: !!((W = a == null ? void 0 : a.st) != null && W.s),
|
2687
|
+
underline: !!((ne = a == null ? void 0 : a.ul) != null && ne.s),
|
2688
|
+
warp: D === fe.WRAP,
|
2689
2689
|
hAlign: Re.LEFT
|
2690
|
-
},
|
2691
|
-
left:
|
2692
|
-
top:
|
2690
|
+
}, U), e.restore(), e.restore(), v.set(R, {
|
2691
|
+
left: p.endX - ge + r.rowHeaderWidth,
|
2692
|
+
top: p.startY + Z + r.columnHeaderHeight,
|
2693
2693
|
width: ge,
|
2694
|
-
height:
|
2694
|
+
height: _ - Z - q
|
2695
2695
|
});
|
2696
2696
|
} else {
|
2697
|
-
e.save(), e.translateWithPrecision(
|
2698
|
-
const
|
2699
|
-
|
2700
|
-
k,
|
2701
|
-
E === me.WRAP,
|
2697
|
+
e.save(), e.translateWithPrecision(p.startX, p.startY), e.beginPath(), e.rect(0, 0, I, _), e.clip();
|
2698
|
+
const G = I - we * 2 - Ye - ge - 4, Z = new it(
|
2699
|
+
O,
|
2702
2700
|
z,
|
2701
|
+
D === fe.WRAP,
|
2702
|
+
G,
|
2703
2703
|
1 / 0
|
2704
2704
|
);
|
2705
2705
|
Z.calculate();
|
2706
|
-
const
|
2707
|
-
e.translateWithPrecision(
|
2706
|
+
const ve = Z.getTotalWidth(), q = Z.getTotalHeight(), b = q + Yt * 2, U = Math.max(I - we * 2, 1), { paddingTop: m } = Wn(U, _, ve, b, T, k);
|
2707
|
+
e.translateWithPrecision(we, m), zn.drawWith(e, {
|
2708
|
+
width: U,
|
2709
|
+
height: b,
|
2710
|
+
fill: (L == null ? void 0 : L.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: O,
|
2714
|
+
fontStyle: z,
|
2708
2715
|
width: G,
|
2709
2716
|
height: q,
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
fontStyle: k,
|
2715
|
-
width: z,
|
2716
|
-
height: Q,
|
2717
|
-
color: (ne = a == null ? void 0 : a.cl) == null ? void 0 : ne.rgb,
|
2718
|
-
strokeLine: !!((oe = a == null ? void 0 : a.st) != null && oe.s),
|
2719
|
-
underline: !!((he = a == null ? void 0 : a.ul) != null && he.s),
|
2720
|
-
warp: E === me.WRAP,
|
2717
|
+
color: (oe = a == null ? void 0 : a.cl) == null ? void 0 : oe.rgb,
|
2718
|
+
strokeLine: !!((Se = a == null ? void 0 : a.st) != null && Se.s),
|
2719
|
+
underline: !!((Ce = a == null ? void 0 : a.ul) != null && Ce.s),
|
2720
|
+
warp: D === fe.WRAP,
|
2721
2721
|
hAlign: Re.LEFT
|
2722
|
-
}, Z), e.restore(), e.translateWithPrecision(
|
2723
|
-
left:
|
2724
|
-
top:
|
2725
|
-
width:
|
2726
|
-
height:
|
2722
|
+
}, Z), e.restore(), e.translateWithPrecision(G + Ye + 4, (q - Ct) / 2), e.fillStyle = Zo, e.fill(Bn), e.restore(), v.set(R, {
|
2723
|
+
left: p.startX + we + r.rowHeaderWidth,
|
2724
|
+
top: p.startY + m + r.columnHeaderHeight,
|
2725
|
+
width: U,
|
2726
|
+
height: b
|
2727
2727
|
});
|
2728
2728
|
}
|
2729
2729
|
}
|
2730
2730
|
calcCellAutoHeight(e) {
|
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:
|
2732
|
-
if (!c || c.renderMode ===
|
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: g = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2732
|
+
if (!c || c.renderMode === ae.TEXT)
|
2733
2733
|
return;
|
2734
|
-
const
|
2734
|
+
const f = {
|
2735
2735
|
startX: a.startX + s,
|
2736
2736
|
endX: a.endX - d,
|
2737
2737
|
startY: a.startY + u,
|
2738
|
-
endY: a.endY -
|
2739
|
-
},
|
2740
|
-
let { tb:
|
2741
|
-
const { t:
|
2742
|
-
if (
|
2743
|
-
const
|
2738
|
+
endY: a.endY - g
|
2739
|
+
}, h = f.endX - f.startX, M = re(n), y = `${M != null ? M : ""}`;
|
2740
|
+
let { tb: w, pd: C } = r || {};
|
2741
|
+
const { t: p = Q.pd.t, b: I = Q.pd.b } = C != null ? C : {};
|
2742
|
+
if (w = w != null ? w : fe.WRAP, c.renderMode === ae.ARROW) {
|
2743
|
+
const { l: _ = Q.pd.l, r: v = Q.pd.r } = C != null ? C : {}, R = h - _ - v - ge - 4, A = new it(
|
2744
2744
|
y,
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2745
|
+
Oe(r).fontCache,
|
2746
|
+
w === fe.WRAP,
|
2747
|
+
R,
|
2748
2748
|
1 / 0
|
2749
2749
|
);
|
2750
|
-
return
|
2750
|
+
return A.calculate(), A.getTotalHeight() + p + I + Xe * 2;
|
2751
2751
|
} else {
|
2752
|
-
const
|
2752
|
+
const _ = Math.max(h - we * 2 - Ye - ge - 4, 10), v = new it(
|
2753
2753
|
y,
|
2754
|
-
|
2755
|
-
|
2756
|
-
|
2754
|
+
Oe(r).fontCache,
|
2755
|
+
w === fe.WRAP,
|
2756
|
+
_,
|
2757
2757
|
1 / 0
|
2758
2758
|
);
|
2759
|
-
return
|
2759
|
+
return v.calculate(), v.getTotalHeight() + Xe * 2 + Yt * 2;
|
2760
2760
|
}
|
2761
2761
|
}
|
2762
2762
|
calcCellAutoWidth(e) {
|
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:
|
2764
|
-
if (!c || c.renderMode ===
|
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: g = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2764
|
+
if (!c || c.renderMode === ae.TEXT)
|
2765
2765
|
return;
|
2766
|
-
const
|
2766
|
+
const f = {
|
2767
2767
|
startX: a.startX + s,
|
2768
2768
|
endX: a.endX - d,
|
2769
2769
|
startY: a.startY + u,
|
2770
|
-
endY: a.endY -
|
2771
|
-
},
|
2772
|
-
let { tb:
|
2773
|
-
const { l:
|
2774
|
-
|
2775
|
-
let
|
2770
|
+
endY: a.endY - g
|
2771
|
+
}, h = f.endX - f.startX, M = re(n), y = `${M != null ? M : ""}`;
|
2772
|
+
let { tb: w, pd: C } = r || {};
|
2773
|
+
const { l: p = Q.pd.l, r: I = Q.pd.r } = C != null ? C : {};
|
2774
|
+
w = w != null ? w : fe.WRAP;
|
2775
|
+
let _ = we * 2 + ge;
|
2776
2776
|
switch (c.renderMode) {
|
2777
|
-
case
|
2778
|
-
|
2777
|
+
case ae.ARROW:
|
2778
|
+
_ = ge + 4 + I + p;
|
2779
2779
|
break;
|
2780
|
-
case
|
2781
|
-
|
2780
|
+
case ae.CUSTOM:
|
2781
|
+
_ = ge + we * 2 + Ye * 2 + I + p + Xt / 2 + 1;
|
2782
2782
|
break;
|
2783
2783
|
// default is CUSTOM
|
2784
2784
|
default:
|
2785
|
-
|
2785
|
+
_ = ge + we * 2 + Ye * 2 + I + p + Xt / 2 + 1;
|
2786
2786
|
}
|
2787
|
-
const
|
2787
|
+
const v = h - _, R = new it(
|
2788
2788
|
y,
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2789
|
+
Oe(r).fontCache,
|
2790
|
+
w === fe.WRAP,
|
2791
|
+
v,
|
2792
2792
|
1 / 0
|
2793
2793
|
);
|
2794
|
-
return R.calculate(), R.getTotalWidth() +
|
2794
|
+
return R.calculate(), R.getTotalWidth() + _;
|
2795
2795
|
}
|
2796
2796
|
isHit(e, t) {
|
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
|
-
if (!l || !a || l.renderMode ===
|
2798
|
+
if (!l || !a || l.renderMode === ae.TEXT)
|
2799
2799
|
return !1;
|
2800
|
-
const { top: s, left: d, width: u, height:
|
2801
|
-
return c >= d && c <= d + u &&
|
2800
|
+
const { top: s, left: d, width: u, height: g } = a, { x: c, y: f } = e;
|
2801
|
+
return c >= d && c <= d + u && f >= s && f <= s + g;
|
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
|
-
|
2824
|
-
at(0,
|
2825
|
-
at(1,
|
2826
|
-
at(2,
|
2827
|
-
at(3,
|
2828
|
-
at(4,
|
2829
|
-
],
|
2830
|
-
class Ko extends
|
2823
|
+
ln = Xo([
|
2824
|
+
at(0, de),
|
2825
|
+
at(1, E(ce)),
|
2826
|
+
at(2, ee),
|
2827
|
+
at(3, E(Fe)),
|
2828
|
+
at(4, E(ie))
|
2829
|
+
], ln);
|
2830
|
+
class Ko extends _e {
|
2831
2831
|
constructor() {
|
2832
2832
|
super(...arguments);
|
2833
2833
|
V(this, "id", j.LIST);
|
2834
|
-
V(this, "canvasRender", this.injector.createInstance(
|
2835
|
-
V(this, "dropdownType",
|
2834
|
+
V(this, "canvasRender", this.injector.createInstance(ln));
|
2835
|
+
V(this, "dropdownType", pe.LIST);
|
2836
2836
|
V(this, "optionsInput", Dt.componentKey);
|
2837
|
-
V(this, "formulaInput",
|
2837
|
+
V(this, "formulaInput", gn);
|
2838
2838
|
}
|
2839
2839
|
}
|
2840
|
-
class zo extends
|
2840
|
+
class zo extends _e {
|
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 _e {
|
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, E(be)),
|
2895
|
+
Zt(1, E(fn)),
|
2896
|
+
Zt(2, E(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
|
+
[me],
|
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, E(be)),
|
2953
|
+
Kt(2, ee),
|
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
|
+
[me],
|
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, E(be)),
|
3014
|
+
zt(2, ee),
|
3015
|
+
zt(3, dn)
|
3016
3016
|
], Tt);
|
3017
3017
|
export {
|
3018
|
-
|
3018
|
+
_e as BaseSheetDataValidatorView,
|
3019
3019
|
Hn as UniverSheetsDataValidationMobileUIPlugin,
|
3020
3020
|
Tt as UniverSheetsDataValidationUIPlugin
|
3021
3021
|
};
|