@univerjs/sheets-data-validation-ui 0.10.9 → 0.10.10
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 +763 -763
- package/lib/index.js +763 -763
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/index.js
CHANGED
@@ -1,18 +1,18 @@
|
|
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
|
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
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
|
8
|
-
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as
|
9
|
-
import { ISidebarService as lr, IDialogService as ui, IZenZoneService as dr, KeyCode as vt, MenuItemType as vn, getMenuHiddenObservable as hi, RibbonDataGroup as
|
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
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
|
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
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
|
15
|
-
import { jsxs as $, Fragment as ut, jsx as
|
14
|
+
import { createElement as Ie, forwardRef as xe, useRef as gt, useState as H, useMemo as ct, useEffect as ke } from "react";
|
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";
|
18
18
|
var Pi = Object.getOwnPropertyDescriptor, Ai = (e, t, r, n) => {
|
@@ -20,7 +20,7 @@ var Pi = Object.getOwnPropertyDescriptor, Ai = (e, t, r, n) => {
|
|
20
20
|
(a = e[o]) && (i = a(i) || i);
|
21
21
|
return i;
|
22
22
|
}, Nn = (e, t) => (r, n) => t(r, n, e);
|
23
|
-
let
|
23
|
+
let me = class extends ye {
|
24
24
|
constructor(t, r) {
|
25
25
|
super();
|
26
26
|
V(this, "_open$", new Pn(!1));
|
@@ -65,10 +65,10 @@ let _e = class extends ye {
|
|
65
65
|
this._activeRule = t, this._activeRule$.next(t);
|
66
66
|
}
|
67
67
|
};
|
68
|
-
|
69
|
-
Nn(0,
|
68
|
+
me = Ai([
|
69
|
+
Nn(0, de),
|
70
70
|
Nn(1, lr)
|
71
|
-
],
|
71
|
+
], me);
|
72
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--)
|
@@ -144,18 +144,18 @@ let qe = class extends ye {
|
|
144
144
|
}
|
145
145
|
};
|
146
146
|
qe = ki([
|
147
|
-
He(0,
|
148
|
-
He(1,
|
149
|
-
He(2,
|
147
|
+
He(0, E(un)),
|
148
|
+
He(1, E(ie)),
|
149
|
+
He(2, E(Me)),
|
150
150
|
He(3, ui),
|
151
|
-
He(4,
|
152
|
-
He(5,
|
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;
|
@@ -180,14 +180,14 @@ function Fi(e, t) {
|
|
180
180
|
}
|
181
181
|
}
|
182
182
|
let Ue = class extends ye {
|
183
|
-
constructor(t, r, n, i, o, a, l, s, d, u,
|
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 Ue = 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 Ue = 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 Ue = 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 Ue = 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
|
-
},
|
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
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,26 +385,26 @@ let Ue = 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;
|
394
394
|
},
|
395
395
|
defaultValue: Ut(s.getCellRaw(n, i)).split("/"),
|
396
|
-
options: JSON.parse((
|
396
|
+
options: JSON.parse((C = d.formula1) != null ? C : "[]")
|
397
397
|
},
|
398
398
|
location: r
|
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 Ue = 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 Ue = 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));
|
@@ -483,17 +483,17 @@ let Ue = class extends ye {
|
|
483
483
|
}
|
484
484
|
};
|
485
485
|
Ue = Ui([
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
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
497
|
], Ue);
|
498
498
|
const Mt = "DataValidationPanel", Be = {
|
499
499
|
id: "data-validation.operation.open-validation-panel",
|
@@ -501,13 +501,13 @@ const Mt = "DataValidationPanel", Be = {
|
|
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,
|
@@ -522,13 +522,13 @@ const Mt = "DataValidationPanel", Be = {
|
|
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(
|
531
|
+
const t = e.get(ee), r = e.get(me);
|
532
532
|
return r.open(), r.isOpen ? t.executeCommand(Cn.id) : t.executeCommand(Be.id), !0;
|
533
533
|
}
|
534
534
|
}, Lt = {
|
@@ -555,9 +555,9 @@ const Mt = "DataValidationPanel", Be = {
|
|
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
|
@@ -625,12 +625,12 @@ let ht = class extends ye {
|
|
625
625
|
}
|
626
626
|
};
|
627
627
|
ht = Bi([
|
628
|
-
$e(0,
|
629
|
-
$e(1,
|
630
|
-
$e(2,
|
631
|
-
$e(3,
|
628
|
+
$e(0, E(Ci)),
|
629
|
+
$e(1, E(wi)),
|
630
|
+
$e(2, de),
|
631
|
+
$e(3, E(ce)),
|
632
632
|
$e(4, dr),
|
633
|
-
$e(5,
|
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 = rn([o, a]), [
|
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
|
685
|
-
d.addRangeRules(
|
686
|
-
const
|
684
|
+
const C = Array.from(w).map((v) => ({ id: v, ranges: Gt(y, (R) => R === v) }));
|
685
|
+
d.addRangeRules(C);
|
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--)
|
@@ -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
|
}
|
@@ -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:
|
774
|
-
var
|
775
|
-
(
|
776
|
-
const
|
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
|
+
var C;
|
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:
|
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
806
|
Ln(d, u, !0).forEach(({ startRange: y }) => {
|
807
|
-
var
|
808
|
-
(
|
809
|
-
const
|
807
|
+
var w;
|
808
|
+
(w = this._copyInfo) == null || w.matrix.forValue((C, p, I) => {
|
809
|
+
const _ = Rt.getPositionRange(
|
810
810
|
{
|
811
|
-
startRow:
|
812
|
-
endRow:
|
813
|
-
startColumn:
|
814
|
-
endColumn:
|
811
|
+
startRow: C,
|
812
|
+
endRow: C,
|
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--)
|
@@ -866,9 +866,9 @@ let et = class extends ye {
|
|
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) {
|
@@ -896,7 +896,7 @@ function zi(e) {
|
|
896
896
|
};
|
897
897
|
}
|
898
898
|
const Gi = {
|
899
|
-
[
|
899
|
+
[gi.RULES]: {
|
900
900
|
[Sr]: {
|
901
901
|
order: 0,
|
902
902
|
menuItemFactory: Zi,
|
@@ -949,7 +949,7 @@ let tt = class extends cn {
|
|
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 cn {
|
|
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 cn {
|
|
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 cn {
|
|
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
|
)
|
@@ -1078,17 +1078,17 @@ let tt = class extends cn {
|
|
1078
1078
|
}
|
1079
1079
|
};
|
1080
1080
|
tt = Cr([
|
1081
|
-
K(0,
|
1082
|
-
K(1,
|
1081
|
+
K(0, ee),
|
1082
|
+
K(1, pi),
|
1083
1083
|
K(2, Fe),
|
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(
|
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
1093
|
let Un = class extends cn {
|
1094
1094
|
constructor(e, t, r, n, i, o, a) {
|
@@ -1105,40 +1105,40 @@ let Un = class extends cn {
|
|
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: ((
|
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 Un = class extends cn {
|
|
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 Un = class extends cn {
|
|
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
|
}
|
@@ -1187,13 +1187,13 @@ let Un = class extends cn {
|
|
1187
1187
|
}
|
1188
1188
|
};
|
1189
1189
|
Un = Cr([
|
1190
|
-
K(0,
|
1190
|
+
K(0, ee),
|
1191
1191
|
K(1, Fe),
|
1192
|
-
K(2,
|
1193
|
-
K(3,
|
1194
|
-
K(4,
|
1195
|
-
K(5,
|
1196
|
-
K(6,
|
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
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--)
|
@@ -1221,17 +1221,17 @@ let Et = class extends ye {
|
|
1221
1221
|
}
|
1222
1222
|
};
|
1223
1223
|
Et = Qi([
|
1224
|
-
Fn(1,
|
1225
|
-
Fn(2,
|
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]);
|
@@ -1240,16 +1240,16 @@ var le = function() {
|
|
1240
1240
|
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
|
1241
1241
|
return r;
|
1242
1242
|
}, We = xe(function(e, t) {
|
1243
|
-
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 },
|
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,8 +1262,8 @@ 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() {
|
@@ -1320,7 +1320,7 @@ var co = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
1320
1320
|
Mr.displayName = "SequenceIcon";
|
1321
1321
|
function uo(e) {
|
1322
1322
|
var d;
|
1323
|
-
const t =
|
1323
|
+
const t = 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,13 +1329,13 @@ function uo(e) {
|
|
1329
1329
|
onClick: () => l(!a),
|
1330
1330
|
children: [
|
1331
1331
|
t.t("dataValidation.panel.options"),
|
1332
|
-
a ? /* @__PURE__ */
|
1332
|
+
a ? /* @__PURE__ */ S(br, { className: "univer-ml-1" }) : /* @__PURE__ */ S(In, { className: "univer-ml-1" })
|
1333
1333
|
]
|
1334
1334
|
}
|
1335
1335
|
),
|
1336
1336
|
a && /* @__PURE__ */ $(ut, { children: [
|
1337
|
-
s ? /* @__PURE__ */
|
1338
|
-
/* @__PURE__ */
|
1337
|
+
s ? /* @__PURE__ */ S(s, { value: n, onChange: i }) : null,
|
1338
|
+
/* @__PURE__ */ S(
|
1339
1339
|
Y,
|
1340
1340
|
{
|
1341
1341
|
label: t.t("dataValidation.panel.invalid"),
|
@@ -1345,18 +1345,18 @@ function uo(e) {
|
|
1345
1345
|
value: `${(d = n.errorStyle) != null ? d : lt.WARNING}`,
|
1346
1346
|
onChange: (u) => i({ ...n, errorStyle: +u }),
|
1347
1347
|
children: [
|
1348
|
-
/* @__PURE__ */
|
1349
|
-
/* @__PURE__ */
|
1348
|
+
/* @__PURE__ */ 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
|
)
|
1353
1353
|
}
|
1354
1354
|
),
|
1355
|
-
/* @__PURE__ */
|
1355
|
+
/* @__PURE__ */ S(
|
1356
1356
|
Y,
|
1357
1357
|
{
|
1358
1358
|
label: t.t("dataValidation.panel.messageInfo"),
|
1359
|
-
children: /* @__PURE__ */
|
1359
|
+
children: /* @__PURE__ */ S(
|
1360
1360
|
At,
|
1361
1361
|
{
|
1362
1362
|
checked: n.showErrorMessage,
|
@@ -1369,7 +1369,7 @@ function uo(e) {
|
|
1369
1369
|
)
|
1370
1370
|
}
|
1371
1371
|
),
|
1372
|
-
n.showErrorMessage ? /* @__PURE__ */
|
1372
|
+
n.showErrorMessage ? /* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(Le, { value: n.error, onChange: (u) => i({ ...n, error: u }) }) }) : null
|
1373
1373
|
] })
|
1374
1374
|
] });
|
1375
1375
|
}
|
@@ -1380,111 +1380,111 @@ 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] =
|
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
1390
|
if (ke(() => () => {
|
1391
|
-
const m =
|
1392
|
-
m &&
|
1393
|
-
}, [
|
1394
|
-
|
1391
|
+
const m = D.getCurrentLastSelection();
|
1392
|
+
m && D.setSelections([m]);
|
1393
|
+
}, [D]), ke(() => {
|
1394
|
+
g.onCommandExecuted((m) => {
|
1395
1395
|
(m.id === Br.id || m.id === Wr.id) && setTimeout(() => {
|
1396
|
-
const
|
1397
|
-
t((x) => x + 1),
|
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 m,
|
1404
|
-
(
|
1405
|
-
},
|
1406
|
-
const
|
1407
|
-
const Rn =
|
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
1408
|
if (Rn) {
|
1409
|
-
const Or =
|
1410
|
-
return { ...
|
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 (yn(m, Tn(
|
1432
|
+
v(rr.id, ue);
|
1433
|
+
}), W = (m) => {
|
1434
|
+
if (yn(m, Tn(h)))
|
1435
1435
|
return;
|
1436
|
-
|
1437
|
-
...
|
1436
|
+
M({
|
1437
|
+
...h,
|
1438
1438
|
...m
|
1439
1439
|
});
|
1440
|
-
const
|
1440
|
+
const P = {
|
1441
1441
|
unitId: i,
|
1442
1442
|
subUnitId: o,
|
1443
1443
|
ruleId: l,
|
1444
1444
|
setting: m
|
1445
1445
|
};
|
1446
|
-
|
1446
|
+
v(
|
1447
1447
|
Dn.id,
|
1448
|
-
|
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
|
-
...
|
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
1469
|
type: m
|
1470
1470
|
} : {
|
1471
|
-
...
|
1471
|
+
...h,
|
1472
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: Tn(
|
1480
|
+
ruleId: h.uid,
|
1481
|
+
setting: Tn(J)
|
1482
1482
|
});
|
1483
|
-
},
|
1484
|
-
yn(m, On(
|
1485
|
-
...
|
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
1486
|
...m
|
1487
|
-
}),
|
1487
|
+
}), v(
|
1488
1488
|
ei.id,
|
1489
1489
|
{
|
1490
1490
|
unitId: i,
|
@@ -1493,130 +1493,130 @@ function go() {
|
|
1493
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
|
-
/* @__PURE__ */
|
1498
|
+
/* @__PURE__ */ S(
|
1499
1499
|
Y,
|
1500
1500
|
{
|
1501
|
-
label:
|
1502
|
-
error: !
|
1503
|
-
children: /* @__PURE__ */
|
1501
|
+
label: f.t("dataValidation.panel.range"),
|
1502
|
+
error: !h.ranges.length || R ? f.t("dataValidation.panel.rangeError") : "",
|
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: (m,
|
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: (m,
|
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: (m) =>
|
1518
|
+
onVerify: (m) => A(!m)
|
1519
1519
|
}
|
1520
1520
|
)
|
1521
1521
|
}
|
1522
1522
|
),
|
1523
|
-
/* @__PURE__ */
|
1523
|
+
/* @__PURE__ */ S(Y, { label: f.t("dataValidation.panel.type"), children: /* @__PURE__ */ S(
|
1524
1524
|
kn,
|
1525
1525
|
{
|
1526
1526
|
className: "univer-w-full",
|
1527
|
-
value:
|
1528
|
-
options: (
|
1529
|
-
label:
|
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
1530
|
value: m.id
|
1531
1531
|
})),
|
1532
|
-
onChange:
|
1532
|
+
onChange: Se
|
1533
1533
|
}
|
1534
1534
|
) }),
|
1535
|
-
|
1535
|
+
T != null && T.length ? /* @__PURE__ */ S(Y, { label: f.t("dataValidation.panel.operator"), children: /* @__PURE__ */ S(
|
1536
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
|
-
...
|
1545
|
+
...T.map((m, P) => ({
|
1546
1546
|
value: `${m}`,
|
1547
|
-
label: k[
|
1547
|
+
label: k[P]
|
1548
1548
|
}))
|
1549
1549
|
],
|
1550
1550
|
onChange: (m) => {
|
1551
|
-
|
1552
|
-
...
|
1551
|
+
W({
|
1552
|
+
...oe,
|
1553
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
1566
|
onChange: (m) => {
|
1567
|
-
|
1568
|
-
...
|
1567
|
+
W({
|
1568
|
+
...oe,
|
1569
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
|
-
/* @__PURE__ */
|
1580
|
+
/* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
1581
1581
|
At,
|
1582
1582
|
{
|
1583
|
-
checked: (
|
1583
|
+
checked: (U = h.allowBlank) != null ? U : !0,
|
1584
1584
|
onChange: () => {
|
1585
1585
|
var m;
|
1586
|
-
return
|
1587
|
-
...
|
1588
|
-
allowBlank: !((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__ */
|
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__ */
|
1597
|
-
/* @__PURE__ */
|
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 =
|
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
1616
|
return ke(() => () => {
|
1617
|
-
var
|
1618
|
-
u.current && ((
|
1619
|
-
|
1617
|
+
var w;
|
1618
|
+
u.current && ((w = u.current) == null || w.forEach((C) => {
|
1619
|
+
C && s.removeShape(C);
|
1620
1620
|
}));
|
1621
1621
|
}, [s]), /* @__PURE__ */ $(
|
1622
1622
|
"div",
|
@@ -1634,39 +1634,39 @@ 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), (
|
1646
|
-
|
1644
|
+
var w;
|
1645
|
+
c(!1), (w = u.current) == null || w.forEach((C) => {
|
1646
|
+
C && s.removeShape(C);
|
1647
1647
|
}), u.current = void 0;
|
1648
1648
|
},
|
1649
1649
|
children: [
|
1650
|
-
/* @__PURE__ */
|
1650
|
+
/* @__PURE__ */ S(
|
1651
1651
|
"div",
|
1652
1652
|
{
|
1653
1653
|
className: "univer-truncate univer-text-sm univer-font-medium univer-leading-[22px] univer-text-gray-900 dark:!univer-text-white",
|
1654
1654
|
children: d == null ? void 0 : d.generateRuleName(t)
|
1655
1655
|
}
|
1656
1656
|
),
|
1657
|
-
/* @__PURE__ */
|
1657
|
+
/* @__PURE__ */ S(
|
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__ */
|
1669
|
+
children: /* @__PURE__ */ S(wn, {})
|
1670
1670
|
}
|
1671
1671
|
) : null
|
1672
1672
|
]
|
@@ -1674,65 +1674,65 @@ const vo = (e) => {
|
|
1674
1674
|
);
|
1675
1675
|
};
|
1676
1676
|
function fo(e) {
|
1677
|
-
const t =
|
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
1678
|
ke(() => {
|
1679
|
-
s(t.getRules(
|
1680
|
-
const
|
1681
|
-
|
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
|
1689
|
-
unitId:
|
1686
|
+
}, [g, c, t]);
|
1687
|
+
const f = async () => {
|
1688
|
+
const C = tr(i), p = {
|
1689
|
+
unitId: g,
|
1690
1690
|
subUnitId: c,
|
1691
|
-
rule:
|
1691
|
+
rule: C
|
1692
1692
|
};
|
1693
|
-
await n.executeCommand(hn.id,
|
1694
|
-
unitId:
|
1693
|
+
await n.executeCommand(hn.id, p), o.setActiveRule({
|
1694
|
+
unitId: g,
|
1695
1695
|
subUnitId: c,
|
1696
|
-
rule:
|
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
|
-
}, y = ((
|
1704
|
-
const
|
1705
|
-
return
|
1706
|
-
})(l),
|
1703
|
+
}, y = ((C) => {
|
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
|
-
y == null ? void 0 : y.map((
|
1709
|
-
var
|
1710
|
-
return /* @__PURE__ */
|
1708
|
+
y == null ? void 0 : y.map((C) => {
|
1709
|
+
var p;
|
1710
|
+
return /* @__PURE__ */ S(
|
1711
1711
|
vo,
|
1712
1712
|
{
|
1713
|
-
unitId:
|
1713
|
+
unitId: g,
|
1714
1714
|
subUnitId: c,
|
1715
1715
|
onClick: () => {
|
1716
|
-
|
1717
|
-
unitId:
|
1716
|
+
C.disable || o.setActiveRule({
|
1717
|
+
unitId: g,
|
1718
1718
|
subUnitId: c,
|
1719
|
-
rule:
|
1719
|
+
rule: C
|
1720
1720
|
});
|
1721
1721
|
},
|
1722
|
-
rule:
|
1723
|
-
disable: (
|
1722
|
+
rule: C,
|
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__ */
|
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 =
|
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,
|
@@ -1741,11 +1741,11 @@ const mo = () => {
|
|
1741
1741
|
var o;
|
1742
1742
|
return (o = n == null ? void 0 : n.activeSheet$) != null ? o : mi(null);
|
1743
1743
|
}, void 0, void 0, []);
|
1744
|
-
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */
|
1744
|
+
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */ 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 =
|
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
|
-
/* @__PURE__ */
|
1748
|
+
/* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1749
1749
|
Le,
|
1750
1750
|
{
|
1751
1751
|
className: "univer-w-full",
|
@@ -1759,8 +1759,8 @@ const mo = () => {
|
|
1759
1759
|
}
|
1760
1760
|
}
|
1761
1761
|
) }),
|
1762
|
-
/* @__PURE__ */
|
1763
|
-
/* @__PURE__ */
|
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
|
+
/* @__PURE__ */ S(Y, { error: s, children: /* @__PURE__ */ S(
|
1764
1764
|
Le,
|
1765
1765
|
{
|
1766
1766
|
className: "univer-w-full",
|
@@ -1774,7 +1774,7 @@ const mo = () => {
|
|
1774
1774
|
}
|
1775
1775
|
}
|
1776
1776
|
) })
|
1777
|
-
] }) : /* @__PURE__ */
|
1777
|
+
] }) : /* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1778
1778
|
Le,
|
1779
1779
|
{
|
1780
1780
|
className: "univer-w-full",
|
@@ -1787,9 +1787,9 @@ const mo = () => {
|
|
1787
1787
|
) });
|
1788
1788
|
};
|
1789
1789
|
function So(e) {
|
1790
|
-
const { value: t, onChange: r, showError: n, validResult: i } = e, o =
|
1790
|
+
const { value: t, onChange: r, showError: n, validResult: i } = e, o = 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
|
-
/* @__PURE__ */
|
1792
|
+
/* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
1793
1793
|
At,
|
1794
1794
|
{
|
1795
1795
|
checked: s,
|
@@ -1803,7 +1803,7 @@ function So(e) {
|
|
1803
1803
|
children: o.t("dataValidation.checkbox.tips")
|
1804
1804
|
}
|
1805
1805
|
) }),
|
1806
|
-
s ? /* @__PURE__ */
|
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",
|
@@ -1817,7 +1817,7 @@ function So(e) {
|
|
1817
1817
|
}
|
1818
1818
|
}
|
1819
1819
|
) }) : null,
|
1820
|
-
s ? /* @__PURE__ */
|
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",
|
@@ -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
|
-
((
|
1842
|
-
}), /* @__PURE__ */
|
1840
|
+
var h;
|
1841
|
+
((h = s.current) == null ? void 0 : h.isClickOutSide(c)) && u(!1);
|
1842
|
+
}), /* @__PURE__ */ S(Y, { error: l, children: /* @__PURE__ */ S(
|
1843
1843
|
fr,
|
1844
1844
|
{
|
1845
1845
|
ref: s,
|
1846
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: (
|
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,20 +1886,20 @@ const wo = [
|
|
1886
1886
|
"#9E6DE3",
|
1887
1887
|
"#F248A6"
|
1888
1888
|
], Io = (e) => {
|
1889
|
-
const { value: t, onChange: r, disabled: n } = e, [i, o] =
|
1890
|
-
return /* @__PURE__ */
|
1889
|
+
const { value: t, onChange: r, disabled: n } = e, [i, o] = H(!1);
|
1890
|
+
return /* @__PURE__ */ S(
|
1891
1891
|
Vi,
|
1892
1892
|
{
|
1893
1893
|
align: "start",
|
1894
1894
|
disabled: n,
|
1895
1895
|
open: i,
|
1896
1896
|
onOpenChange: o,
|
1897
|
-
overlay: /* @__PURE__ */
|
1897
|
+
overlay: /* @__PURE__ */ S(
|
1898
1898
|
"div",
|
1899
1899
|
{
|
1900
1900
|
className: "univer-box-border univer-grid univer-w-fit univer-grid-cols-6 univer-flex-wrap univer-gap-2 univer-p-1.5",
|
1901
1901
|
children: wo.map(
|
1902
|
-
(a) => /* @__PURE__ */
|
1902
|
+
(a) => /* @__PURE__ */ S(
|
1903
1903
|
"div",
|
1904
1904
|
{
|
1905
1905
|
className: Ne("univer-box-border univer-size-4 univer-cursor-pointer univer-rounded", yt),
|
@@ -1918,14 +1918,14 @@ const wo = [
|
|
1918
1918
|
{
|
1919
1919
|
className: Ne("univer-box-border univer-inline-flex univer-h-8 univer-w-16 univer-cursor-pointer univer-items-center univer-justify-between univer-gap-2 univer-rounded-lg univer-bg-white univer-px-2.5 univer-transition-colors univer-duration-200 hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white", yt),
|
1920
1920
|
children: [
|
1921
|
-
/* @__PURE__ */
|
1921
|
+
/* @__PURE__ */ S(
|
1922
1922
|
"div",
|
1923
1923
|
{
|
1924
1924
|
className: "univer-box-border univer-h-4 univer-w-4 univer-rounded univer-text-base",
|
1925
1925
|
style: { background: t }
|
1926
1926
|
}
|
1927
1927
|
),
|
1928
|
-
/* @__PURE__ */
|
1928
|
+
/* @__PURE__ */ S(In, {})
|
1929
1929
|
]
|
1930
1930
|
}
|
1931
1931
|
)
|
@@ -1934,8 +1934,8 @@ const wo = [
|
|
1934
1934
|
}, xn = (e) => {
|
1935
1935
|
const { item: t, commonProps: r, className: n } = e, { onItemChange: i, onItemDelete: o } = r;
|
1936
1936
|
return /* @__PURE__ */ $("div", { className: Ne("univer-flex univer-items-center univer-gap-2", n), children: [
|
1937
|
-
!t.isRef && /* @__PURE__ */
|
1938
|
-
/* @__PURE__ */
|
1937
|
+
!t.isRef && /* @__PURE__ */ S("div", { className: Ne("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ S(Mr, {}) }),
|
1938
|
+
/* @__PURE__ */ S(
|
1939
1939
|
Io,
|
1940
1940
|
{
|
1941
1941
|
value: t.color,
|
@@ -1944,7 +1944,7 @@ const wo = [
|
|
1944
1944
|
}
|
1945
1945
|
}
|
1946
1946
|
),
|
1947
|
-
/* @__PURE__ */
|
1947
|
+
/* @__PURE__ */ S(
|
1948
1948
|
Le,
|
1949
1949
|
{
|
1950
1950
|
disabled: t.isRef,
|
@@ -1954,60 +1954,60 @@ const wo = [
|
|
1954
1954
|
}
|
1955
1955
|
}
|
1956
1956
|
),
|
1957
|
-
t.isRef ? null : /* @__PURE__ */
|
1957
|
+
t.isRef ? null : /* @__PURE__ */ S(
|
1958
1958
|
"div",
|
1959
1959
|
{
|
1960
1960
|
className: "univer-ml-1 univer-cursor-pointer univer-rounded univer-text-base hover:univer-bg-gray-200",
|
1961
|
-
children: /* @__PURE__ */
|
1961
|
+
children: /* @__PURE__ */ 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,
|
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
1969
|
ke(() => {
|
1970
1970
|
(async () => {
|
1971
1971
|
await new Promise((m) => {
|
1972
1972
|
setTimeout(() => m(!0), 100);
|
1973
1973
|
});
|
1974
|
-
const
|
1975
|
-
if (Ve(
|
1976
|
-
const m = await
|
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
|
-
}, [
|
1981
|
-
Ve(s) && s !==
|
1982
|
-
}, [
|
1983
|
-
const [
|
1984
|
-
const
|
1985
|
-
return
|
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
1986
|
label: m,
|
1987
|
-
color:
|
1987
|
+
color: U[P] || Te,
|
1988
1988
|
isRef: !1,
|
1989
1989
|
id: bn(4)
|
1990
1990
|
}));
|
1991
|
-
}),
|
1992
|
-
const
|
1993
|
-
|
1994
|
-
},
|
1995
|
-
const
|
1996
|
-
|
1997
|
-
},
|
1998
|
-
label:
|
1999
|
-
color:
|
2000
|
-
id: `${
|
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
|
+
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
2013
|
color: Te,
|
@@ -2019,104 +2019,104 @@ function Ro(e) {
|
|
2019
2019
|
ke(() => {
|
2020
2020
|
if (u === "1")
|
2021
2021
|
return;
|
2022
|
-
const
|
2023
|
-
|
2022
|
+
const b = /* @__PURE__ */ new Set(), U = [];
|
2023
|
+
B.map((m) => ({
|
2024
2024
|
labelList: m.label.split(","),
|
2025
2025
|
item: m
|
2026
|
-
})).forEach(({ item: m, labelList:
|
2027
|
-
|
2028
|
-
|
2026
|
+
})).forEach(({ item: m, labelList: P }) => {
|
2027
|
+
P.forEach((x) => {
|
2028
|
+
b.has(x) || (b.add(x), U.push({
|
2029
2029
|
label: x,
|
2030
2030
|
color: m.color
|
2031
2031
|
}));
|
2032
2032
|
});
|
2033
2033
|
}), k({
|
2034
|
-
formula1: er(
|
2035
|
-
formula2:
|
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 (!Ve(
|
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: Ve(
|
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((
|
2052
|
+
}), f("="), O(y.t("dataValidation.validFail.formulaError")));
|
2053
|
+
}), Z = gt(null), [ve, q] = H(!1);
|
2054
|
+
return cr((b) => {
|
2055
2055
|
var m;
|
2056
|
-
((m =
|
2056
|
+
((m = Z.current) == null ? void 0 : m.isClickOutSide(b)) && q(!1);
|
2057
2057
|
}), /* @__PURE__ */ $(ut, { children: [
|
2058
|
-
/* @__PURE__ */
|
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__ */
|
2070
|
-
/* @__PURE__ */
|
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:
|
2075
|
-
/* @__PURE__ */
|
2074
|
+
u === "1" ? /* @__PURE__ */ $(Y, { error: L || N || void 0, children: [
|
2075
|
+
/* @__PURE__ */ S(
|
2076
2076
|
fr,
|
2077
2077
|
{
|
2078
|
-
ref:
|
2078
|
+
ref: Z,
|
2079
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
|
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
|
-
|
2092
|
+
oe.length > 0 && /* @__PURE__ */ S("div", { className: "univer-mt-3", children: oe.map((b) => /* @__PURE__ */ S(
|
2093
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__ */
|
2102
|
-
/* @__PURE__ */
|
2101
|
+
] }) : /* @__PURE__ */ S(Y, { error: L, children: /* @__PURE__ */ $("div", { className: "-univer-mt-3", children: [
|
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: (
|
2110
|
+
itemRender: (b) => /* @__PURE__ */ S(
|
2111
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,9 +2125,9 @@ 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
|
-
/* @__PURE__ */
|
2130
|
+
/* @__PURE__ */ S(yr, { className: "univer-mr-1" }),
|
2131
2131
|
y.t("dataValidation.list.add")
|
2132
2132
|
]
|
2133
2133
|
}
|
@@ -2145,7 +2145,7 @@ const yo = [
|
|
2145
2145
|
_o
|
2146
2146
|
],
|
2147
2147
|
[
|
2148
|
-
|
2148
|
+
gn,
|
2149
2149
|
Ro
|
2150
2150
|
],
|
2151
2151
|
[
|
@@ -2155,19 +2155,19 @@ const yo = [
|
|
2155
2155
|
], bo = "LIST_RENDER_MODE_OPTION_INPUT";
|
2156
2156
|
function Dt(e) {
|
2157
2157
|
var i;
|
2158
|
-
const { value: t, onChange: r } = e, n =
|
2159
|
-
return /* @__PURE__ */
|
2160
|
-
/* @__PURE__ */
|
2161
|
-
/* @__PURE__ */
|
2162
|
-
/* @__PURE__ */
|
2158
|
+
const { value: t, onChange: r } = e, n = 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 =
|
2170
|
-
return /* @__PURE__ */
|
2169
|
+
const { value: t, onChange: r } = e, n = F(ce);
|
2170
|
+
return /* @__PURE__ */ S(Y, { children: /* @__PURE__ */ S(
|
2171
2171
|
At,
|
2172
2172
|
{
|
2173
2173
|
checked: (i = t.bizInfo) == null ? void 0 : i.showTime,
|
@@ -2196,14 +2196,14 @@ let on = class {
|
|
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 on = 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 on = 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: Ve(n) ? Ft((
|
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
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 =
|
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
|
2259
|
-
left:
|
2260
|
-
top:
|
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
|
+
left: C,
|
2260
|
+
top: p,
|
2261
2261
|
scaleX: 1,
|
2262
2262
|
scaleY: 1,
|
2263
2263
|
angle: 0,
|
@@ -2265,16 +2265,16 @@ let on = 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 on = 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
|
-
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s =
|
2288
|
+
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s = 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 on = 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) {
|
@@ -2318,31 +2318,31 @@ let on = class {
|
|
2318
2318
|
}
|
2319
2319
|
};
|
2320
2320
|
on = Do([
|
2321
|
-
je(0,
|
2322
|
-
je(1,
|
2323
|
-
je(2,
|
2324
|
-
je(3,
|
2325
|
-
je(4,
|
2326
|
-
je(5,
|
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
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);
|
@@ -2350,7 +2350,7 @@ class Po extends Se {
|
|
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,16 +2358,16 @@ class Ao extends Se {
|
|
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);
|
@@ -2391,10 +2391,10 @@ function jt(e, t, r, n) {
|
|
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;
|
@@ -2451,10 +2451,10 @@ let sn = class {
|
|
2451
2451
|
const o = r - De + 4;
|
2452
2452
|
let a = 4;
|
2453
2453
|
switch (i) {
|
2454
|
-
case
|
2454
|
+
case le.MIDDLE:
|
2455
2455
|
a = (n - De) / 2 + 4;
|
2456
2456
|
break;
|
2457
|
-
case
|
2457
|
+
case le.BOTTOM:
|
2458
2458
|
a = n - De + 4;
|
2459
2459
|
break;
|
2460
2460
|
}
|
@@ -2462,87 +2462,87 @@ let sn = class {
|
|
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(
|
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(
|
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;
|
@@ -2569,17 +2569,17 @@ let sn = class {
|
|
2569
2569
|
}
|
2570
2570
|
};
|
2571
2571
|
sn = Ho([
|
2572
|
-
St(0,
|
2573
|
-
St(1,
|
2574
|
-
St(2,
|
2575
|
-
St(3,
|
2572
|
+
St(0, ee),
|
2573
|
+
St(1, de),
|
2574
|
+
St(2, E(Fe)),
|
2575
|
+
St(3, E(ie))
|
2576
2576
|
], sn);
|
2577
|
-
class jo extends
|
2577
|
+
class jo extends _e {
|
2578
2578
|
constructor() {
|
2579
2579
|
super(...arguments);
|
2580
2580
|
V(this, "id", j.LIST_MULTIPLE);
|
2581
2581
|
V(this, "canvasRender", this.injector.createInstance(sn));
|
2582
|
-
V(this, "dropdownType",
|
2582
|
+
V(this, "dropdownType", pe.MULTIPLE_LIST);
|
2583
2583
|
}
|
2584
2584
|
}
|
2585
2585
|
var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, r, n) => {
|
@@ -2592,10 +2592,10 @@ 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:
|
@@ -2631,13 +2631,13 @@ let ln = 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 ln = 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: G =
|
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 G =
|
2699
|
-
|
2700
|
-
|
2701
|
-
|
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,
|
2700
|
+
z,
|
2701
|
+
D === fe.WRAP,
|
2702
2702
|
G,
|
2703
2703
|
1 / 0
|
2704
2704
|
);
|
2705
2705
|
Z.calculate();
|
2706
|
-
const
|
2707
|
-
e.translateWithPrecision(we,
|
2708
|
-
width:
|
2709
|
-
height:
|
2710
|
-
fill: (
|
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
2711
|
radius: Xt
|
2712
|
-
}), e.save(), e.translateWithPrecision(Ye, Yt), e.beginPath(), e.rect(0, 0, G,
|
2713
|
-
text:
|
2714
|
-
fontStyle:
|
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,
|
2715
2715
|
width: G,
|
2716
|
-
height:
|
2717
|
-
color: (
|
2718
|
-
strokeLine: !!((
|
2719
|
-
underline: !!((
|
2720
|
-
warp:
|
2716
|
+
height: q,
|
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(G + Ye + 4, (
|
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 { l:
|
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
2745
|
Oe(r).fontCache,
|
2746
|
-
|
2746
|
+
w === fe.WRAP,
|
2747
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
2754
|
Oe(r).fontCache,
|
2755
|
-
|
2756
|
-
|
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
2789
|
Oe(r).fontCache,
|
2790
|
-
|
2791
|
-
|
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)
|
@@ -2821,30 +2821,30 @@ let ln = class {
|
|
2821
2821
|
}
|
2822
2822
|
};
|
2823
2823
|
ln = Xo([
|
2824
|
-
at(0,
|
2825
|
-
at(1,
|
2826
|
-
at(2,
|
2827
|
-
at(3,
|
2828
|
-
at(4,
|
2824
|
+
at(0, de),
|
2825
|
+
at(1, E(ce)),
|
2826
|
+
at(2, ee),
|
2827
|
+
at(3, E(Fe)),
|
2828
|
+
at(4, E(ie))
|
2829
2829
|
], ln);
|
2830
|
-
class Ko extends
|
2830
|
+
class Ko extends _e {
|
2831
2831
|
constructor() {
|
2832
2832
|
super(...arguments);
|
2833
2833
|
V(this, "id", j.LIST);
|
2834
2834
|
V(this, "canvasRender", this.injector.createInstance(ln));
|
2835
|
-
V(this, "dropdownType",
|
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);
|
@@ -2891,9 +2891,9 @@ let nt = class extends cn {
|
|
2891
2891
|
}
|
2892
2892
|
};
|
2893
2893
|
nt = Jo([
|
2894
|
-
Zt(0,
|
2895
|
-
Zt(1,
|
2896
|
-
Zt(2,
|
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--)
|
@@ -2914,7 +2914,7 @@ let Hn = (wt = class extends Zn {
|
|
2914
2914
|
}
|
2915
2915
|
onStarting() {
|
2916
2916
|
[
|
2917
|
-
[
|
2917
|
+
[me],
|
2918
2918
|
[Ue],
|
2919
2919
|
[ht],
|
2920
2920
|
[Je],
|
@@ -2949,8 +2949,8 @@ 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
|
-
Kt(1,
|
2953
|
-
Kt(2,
|
2952
|
+
Kt(1, E(be)),
|
2953
|
+
Kt(2, ee),
|
2954
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) => {
|
@@ -2971,7 +2971,7 @@ let Tt = class extends Zn {
|
|
2971
2971
|
}
|
2972
2972
|
onStarting() {
|
2973
2973
|
[
|
2974
|
-
[
|
2974
|
+
[me],
|
2975
2975
|
[Ue],
|
2976
2976
|
[ht],
|
2977
2977
|
[Je],
|
@@ -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
|
-
zt(1,
|
3014
|
-
zt(2,
|
3013
|
+
zt(1, E(be)),
|
3014
|
+
zt(2, ee),
|
3015
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
|
};
|