@univerjs/sheets-data-validation-ui 0.15.4 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +1260 -1237
- package/lib/index.js +1260 -1237
- package/lib/types/controllers/dv-auto-fill.controller.d.ts +1 -1
- package/lib/types/services/data-validation-panel.service.d.ts +3 -0
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var V = (e, t, n) =>
|
|
4
|
-
import { Disposable as
|
|
5
|
-
import { DeviceInputEventType as
|
|
6
|
-
import { SheetInterceptorService as
|
|
7
|
-
import { SheetDataValidationModel as
|
|
8
|
-
import { DataValidatorRegistryService as
|
|
9
|
-
import { ISidebarService as
|
|
10
|
-
import { filter as
|
|
11
|
-
import { getPatternType as
|
|
12
|
-
import { ISheetCellDropdownManagerService as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { createElement as
|
|
15
|
-
import { jsxs as
|
|
16
|
-
import { deserializeRangeWithSheet as
|
|
17
|
-
import { RangeSelector as
|
|
18
|
-
var
|
|
19
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
1
|
+
var Lr = Object.defineProperty;
|
|
2
|
+
var kr = (e, t, n) => t in e ? Lr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var V = (e, t, n) => kr(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { Disposable as De, UniverInstanceType as H, toDisposable as Nr, IUniverInstanceService as pe, Inject as E, LocaleService as ge, DataValidationErrorStyle as ct, DataValidationStatus as ze, ICommandService as oe, Injector as Ve, IConfigService as hn, DataValidationRenderMode as ue, DisposableCollection as Ur, dayjs as $t, numfmt as Yn, CellValueType as Fr, CommandType as ot, DataValidationType as X, ObjectMatrix as yt, Range as $r, Rectangle as Mt, queryObjectMatrix as Qt, Optional as xr, RxDisposable as pn, InterceptorEffectEnum as Xn, sequenceExecute as Zn, bufferDebounceTime as Br, debounce as Wr, UndoCommand as Hr, RedoCommand as jr, isUnitRangesEqual as Yr, shallowEqual as bn, ThemeService as zn, ColorKit as Xr, isFormulaString as Pe, generateRandomId as En, VerticalAlign as he, HorizontalAlign as Ee, DEFAULT_STYLES as re, WrapStrategy as Se, Plugin as Kn, merge as Gn, DependentOn as Zr } from "@univerjs/core";
|
|
5
|
+
import { DeviceInputEventType as mt, IRenderManagerService as xe, fixLineWidthByScale as Dn, Transform as zr, CheckboxShape as Kr, getCurrentTypeOfRenderer as Ke, CURSOR_TYPE as Ge, FontCache as Gr, Shape as qr, Rect as qn, getFontStyleString as Le, DocSimpleSkeleton as at, Text as Vn } from "@univerjs/engine-render";
|
|
6
|
+
import { SheetInterceptorService as gn, VALIDATE_CELL as Jr, SheetsSelectionsService as Jn, SetRangeValuesCommand as dt, getSheetCommandTarget as Qn, IAutoFillService as Qr, AUTO_FILL_APPLY_TYPE as st, AutoFillTools as eo, rangeToDiscreteRange as to, SheetPermissionCheckController as no, WorksheetEditPermission as en, WorksheetSetCellStylePermission as tn, RangeProtectionPermissionEditPoint as nn, WorkbookEditablePermission as rn, INTERCEPTOR_POINT as er, InterceptCellContentPriority as tr, SetWorksheetActiveOperation as ro, checkRangesEditablePermission as oo } from "@univerjs/sheets";
|
|
7
|
+
import { SheetDataValidationModel as ae, SheetsDataValidationValidatorService as io, getDataValidationCellValue as xt, getCellValueOrigin as ie, serializeListOptions as nr, createDefaultNewRule as rr, AddSheetDataValidationCommand as vn, DATA_VALIDATION_PLUGIN_NAME as or, getDataValidationDiffMutations as on, UpdateSheetDataValidationRangeCommand as ir, DataValidationCacheService as ar, UpdateSheetDataValidationSettingCommand as Tn, UpdateSheetDataValidationOptionsCommand as ao, RemoveSheetDataValidationCommand as sr, RemoveSheetAllDataValidationCommand as so, DataValidationFormulaController as lo, deserializeListOptions as co, CUSTOM_FORMULA_INPUT_NAME as lr, BASE_FORMULA_INPUT_NAME as kt, LIST_FORMULA_INPUT_NAME as mn, CHECKBOX_FORMULA_INPUT_NAME as dr, DataValidationFormulaService as uo, CHECKBOX_FORMULA_2 as ho, CHECKBOX_FORMULA_1 as po, getFormulaResult as Bt, isLegalFormulaResult as On, transformCheckboxValue as go, UniverSheetsDataValidationPlugin as vo } from "@univerjs/sheets-data-validation";
|
|
8
|
+
import { DataValidatorRegistryService as Te, DataValidatorDropdownType as fe, DataValidationModel as fn, DataValidatorRegistryScope as mo, TWO_FORMULA_OPERATOR_COUNT as fo, getRuleOptions as An, getRuleSetting as Pn } from "@univerjs/data-validation";
|
|
9
|
+
import { ISidebarService as cr, IDialogService as _o, IZenZoneService as ur, KeyCode as ft, MenuItemType as _n, getMenuHiddenObservable as So, RibbonDataGroup as Co, IMenuManagerService as Io, useDependency as F, ComponentManager as Sn, useObservable as Re, useEvent as an, useSidebarClick as hr } from "@univerjs/ui";
|
|
10
|
+
import { filter as Cn, BehaviorSubject as Ln, distinctUntilChanged as wo, Subject as Ro, debounceTime as pr, bufferTime as gr, of as vr } from "rxjs";
|
|
11
|
+
import { getPatternType as yo } from "@univerjs/sheets-numfmt";
|
|
12
|
+
import { ISheetCellDropdownManagerService as Mo, IEditorBridgeService as mr, SetCellEditVisibleOperation as _t, HoverManagerService as bo, CellAlertManagerService as Eo, CellAlertType as Do, virtualizeDiscreteRanges as sn, ISheetClipboardService as Vo, COPY_TYPE as kn, PREDEFINED_HOOK_NAME_PASTE as St, getRepeatRange as Nn, getCurrentRangeDisable$ as To, AutoHeightController as fr, SheetSkeletonManagerService as ut, IMarkSelectionService as Oo } from "@univerjs/sheets-ui";
|
|
13
|
+
import { Button as qe, FormLayout as Z, RadioGroup as In, Radio as Ne, Checkbox as Nt, Input as Ue, Select as Un, clsx as Fe, borderClassName as bt, DraggableList as Ao, Dropdown as Po } from "@univerjs/design";
|
|
14
|
+
import { createElement as ye, useRef as vt, forwardRef as it, useState as W, useMemo as ht, useEffect as be } from "react";
|
|
15
|
+
import { jsxs as Y, Fragment as pt, jsx as S } from "react/jsx-runtime";
|
|
16
|
+
import { deserializeRangeWithSheet as Lo, serializeRange as _r } from "@univerjs/engine-formula";
|
|
17
|
+
import { RangeSelector as ko, FormulaEditor as Sr } from "@univerjs/sheets-formula-ui";
|
|
18
|
+
var No = Object.getOwnPropertyDescriptor, Uo = (e, t, n, r) => {
|
|
19
|
+
for (var o = r > 1 ? void 0 : r ? No(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
20
20
|
(a = e[i]) && (o = a(o) || o);
|
|
21
21
|
return o;
|
|
22
|
-
},
|
|
23
|
-
let
|
|
22
|
+
}, Fn = (e, t) => (n, r) => t(n, r, e);
|
|
23
|
+
let _e = class extends De {
|
|
24
24
|
constructor(t, n) {
|
|
25
25
|
super();
|
|
26
|
-
V(this, "_open$", new
|
|
27
|
-
V(this, "open$", this._open$.pipe(
|
|
26
|
+
V(this, "_open$", new Ln(!1));
|
|
27
|
+
V(this, "open$", this._open$.pipe(wo()));
|
|
28
28
|
V(this, "_activeRule");
|
|
29
|
-
V(this, "_activeRule$", new
|
|
29
|
+
V(this, "_activeRule$", new Ln(void 0));
|
|
30
30
|
V(this, "activeRule$", this._activeRule$.asObservable());
|
|
31
31
|
V(this, "_closeDisposable", null);
|
|
32
|
+
// Record the worksheet to which the rule using the range selector belongs, so that the rule list is not switched when making cross-sheet selections
|
|
33
|
+
V(this, "_focusFormulaEditorActiveRuleSubUnitId", null);
|
|
32
34
|
this._univerInstanceService = t, this._sidebarService = n, this.disposeWithMe(
|
|
33
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
35
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(Cn((r) => !r)).subscribe(() => {
|
|
34
36
|
this.close();
|
|
35
37
|
})
|
|
36
38
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((r) => {
|
|
37
|
-
r.id ===
|
|
39
|
+
r.id === Vt && (r.visible || setTimeout(() => {
|
|
38
40
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
|
39
41
|
}));
|
|
40
42
|
}));
|
|
@@ -57,40 +59,46 @@ let me = class extends Re {
|
|
|
57
59
|
this._open$.next(!1), (t = this._closeDisposable) == null || t.dispose();
|
|
58
60
|
}
|
|
59
61
|
setCloseDisposable(t) {
|
|
60
|
-
this._closeDisposable =
|
|
62
|
+
this._closeDisposable = Nr(() => {
|
|
61
63
|
t.dispose(), this._closeDisposable = null;
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
setActiveRule(t) {
|
|
65
67
|
this._activeRule = t, this._activeRule$.next(t);
|
|
66
68
|
}
|
|
69
|
+
setFocusFormulaEditorActiveRuleSubUnitId(t) {
|
|
70
|
+
this._focusFormulaEditorActiveRuleSubUnitId = t;
|
|
71
|
+
}
|
|
72
|
+
getFocusFormulaEditorActiveRuleSubUnitId() {
|
|
73
|
+
return this._focusFormulaEditorActiveRuleSubUnitId;
|
|
74
|
+
}
|
|
67
75
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
72
|
-
const
|
|
73
|
-
var
|
|
74
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
76
|
+
_e = Uo([
|
|
77
|
+
Fn(0, pe),
|
|
78
|
+
Fn(1, cr)
|
|
79
|
+
], _e);
|
|
80
|
+
const ke = "#ECECEC", Et = "sheets-data-validation-ui.config", Dt = {};
|
|
81
|
+
var Fo = Object.getOwnPropertyDescriptor, $o = (e, t, n, r) => {
|
|
82
|
+
for (var o = r > 1 ? void 0 : r ? Fo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
75
83
|
(a = e[i]) && (o = a(o) || o);
|
|
76
84
|
return o;
|
|
77
|
-
},
|
|
78
|
-
let
|
|
85
|
+
}, He = (e, t) => (n, r) => t(n, r, e);
|
|
86
|
+
let Je = class extends De {
|
|
79
87
|
constructor(e, t, n, r, o, i) {
|
|
80
88
|
super(), this._sheetInterceptorService = e, this._dataValidationModel = t, this._dataValidatorRegistryService = n, this._dialogService = r, this._localeService = o, this._sheetsDataValidationValidatorService = i, this._initEditorBridgeInterceptor();
|
|
81
89
|
}
|
|
82
90
|
_initEditorBridgeInterceptor() {
|
|
83
91
|
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
84
|
-
|
|
92
|
+
Jr,
|
|
85
93
|
{
|
|
86
94
|
handler: async (e, t, n) => {
|
|
87
95
|
const r = await e, { row: o, col: i, unitId: a, subUnitId: l } = t, s = this._dataValidationModel.getRuleIdByLocation(a, l, o, i), d = s ? this._dataValidationModel.getRuleById(a, l, s) : void 0;
|
|
88
96
|
if (r === !1)
|
|
89
97
|
return n(Promise.resolve(!1));
|
|
90
|
-
if (!d || d.errorStyle !==
|
|
98
|
+
if (!d || d.errorStyle !== ct.STOP)
|
|
91
99
|
return n(Promise.resolve(!0));
|
|
92
100
|
const u = this._dataValidatorRegistryService.getValidatorItem(d.type);
|
|
93
|
-
return !u || await this._sheetsDataValidationValidatorService.validatorCell(a, l, o, i) ===
|
|
101
|
+
return !u || await this._sheetsDataValidationValidatorService.validatorCell(a, l, o, i) === ze.VALID ? n(Promise.resolve(!0)) : (this._dialogService.open({
|
|
94
102
|
width: 368,
|
|
95
103
|
title: {
|
|
96
104
|
title: this._localeService.t("dataValidation.alert.title")
|
|
@@ -100,8 +108,8 @@ let Ke = class extends Re {
|
|
|
100
108
|
title: u.getRuleFinalError(d, { row: o, col: i, unitId: a, subUnitId: l })
|
|
101
109
|
},
|
|
102
110
|
footer: {
|
|
103
|
-
title:
|
|
104
|
-
|
|
111
|
+
title: ye(
|
|
112
|
+
qe,
|
|
105
113
|
{
|
|
106
114
|
variant: "primary",
|
|
107
115
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
|
@@ -128,8 +136,8 @@ let Ke = class extends Re {
|
|
|
128
136
|
title: e
|
|
129
137
|
},
|
|
130
138
|
footer: {
|
|
131
|
-
title:
|
|
132
|
-
|
|
139
|
+
title: ye(
|
|
140
|
+
qe,
|
|
133
141
|
{
|
|
134
142
|
variant: "primary",
|
|
135
143
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
|
@@ -143,31 +151,31 @@ let Ke = class extends Re {
|
|
|
143
151
|
});
|
|
144
152
|
}
|
|
145
153
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
],
|
|
154
|
-
var
|
|
155
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
154
|
+
Je = $o([
|
|
155
|
+
He(0, E(gn)),
|
|
156
|
+
He(1, E(ae)),
|
|
157
|
+
He(2, E(Te)),
|
|
158
|
+
He(3, _o),
|
|
159
|
+
He(4, E(ge)),
|
|
160
|
+
He(5, E(io))
|
|
161
|
+
], Je);
|
|
162
|
+
var xo = Object.getOwnPropertyDescriptor, Bo = (e, t, n, r) => {
|
|
163
|
+
for (var o = r > 1 ? void 0 : r ? xo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
156
164
|
(a = e[i]) && (o = a(o) || o);
|
|
157
165
|
return o;
|
|
158
|
-
},
|
|
159
|
-
const
|
|
166
|
+
}, ve = (e, t) => (n, r) => t(n, r, e);
|
|
167
|
+
const Wt = (e) => {
|
|
160
168
|
if (e == null || typeof e == "boolean")
|
|
161
169
|
return;
|
|
162
|
-
if (e === "") return
|
|
170
|
+
if (e === "") return $t();
|
|
163
171
|
if (typeof e == "number" || !Number.isNaN(+e))
|
|
164
|
-
return
|
|
165
|
-
const t =
|
|
172
|
+
return $t(Yn.format("yyyy-MM-dd HH:mm:ss", Number(e)));
|
|
173
|
+
const t = $t(e);
|
|
166
174
|
if (t.isValid())
|
|
167
175
|
return t;
|
|
168
176
|
};
|
|
169
|
-
function
|
|
170
|
-
const n =
|
|
177
|
+
function Wo(e, t) {
|
|
178
|
+
const n = yo(t);
|
|
171
179
|
if (e === n)
|
|
172
180
|
return t;
|
|
173
181
|
switch (e) {
|
|
@@ -179,15 +187,15 @@ function Fo(e, t) {
|
|
|
179
187
|
return "HH:mm:ss";
|
|
180
188
|
}
|
|
181
189
|
}
|
|
182
|
-
let
|
|
183
|
-
constructor(t, n, r, o, i, a, l, s, d, u,
|
|
190
|
+
let $e = class extends De {
|
|
191
|
+
constructor(t, n, r, o, i, a, l, s, d, u, h) {
|
|
184
192
|
super();
|
|
185
193
|
V(this, "_activeDropdown");
|
|
186
|
-
V(this, "_activeDropdown$", new
|
|
194
|
+
V(this, "_activeDropdown$", new Ro());
|
|
187
195
|
V(this, "_currentPopup", null);
|
|
188
196
|
V(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
|
189
197
|
V(this, "_zenVisible", !1);
|
|
190
|
-
this._univerInstanceService = t, this._dataValidatorRegistryService = n, this._zenZoneService = r, this._dataValidationModel = o, this._sheetsSelectionsService = i, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService =
|
|
198
|
+
this._univerInstanceService = t, this._dataValidatorRegistryService = n, this._zenZoneService = r, this._dataValidationModel = o, this._sheetsSelectionsService = i, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService = h, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
|
|
191
199
|
this._activeDropdown$.complete();
|
|
192
200
|
});
|
|
193
201
|
}
|
|
@@ -200,7 +208,7 @@ let Ne = class extends Re {
|
|
|
200
208
|
}));
|
|
201
209
|
}
|
|
202
210
|
_getDropdownByCell(t, n, r, o) {
|
|
203
|
-
const i = t ? this._univerInstanceService.getUnit(t,
|
|
211
|
+
const i = t ? this._univerInstanceService.getUnit(t, H.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(H.UNIVER_SHEET);
|
|
204
212
|
if (!i)
|
|
205
213
|
return;
|
|
206
214
|
const a = n ? i.getSheetBySheetId(n) : i.getActiveSheet();
|
|
@@ -219,7 +227,7 @@ let Ne = class extends Re {
|
|
|
219
227
|
}
|
|
220
228
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
221
229
|
showDropdown(t) {
|
|
222
|
-
var
|
|
230
|
+
var D, v, C, f, w, b;
|
|
223
231
|
const { location: n } = t, { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = n;
|
|
224
232
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
|
225
233
|
return;
|
|
@@ -230,13 +238,13 @@ let Ne = class extends Re {
|
|
|
230
238
|
const u = this._dataValidatorRegistryService.getValidatorItem(d.type);
|
|
231
239
|
if (!(u != null && u.dropdownType))
|
|
232
240
|
return;
|
|
233
|
-
let
|
|
234
|
-
const c = async (
|
|
235
|
-
var
|
|
236
|
-
if (!
|
|
241
|
+
let h;
|
|
242
|
+
const c = async (g, p) => {
|
|
243
|
+
var U, k, x;
|
|
244
|
+
if (!g)
|
|
237
245
|
return !0;
|
|
238
|
-
const _ =
|
|
239
|
-
return d.errorStyle !==
|
|
246
|
+
const _ = g, T = s.getCell(r, o), A = _.format(p === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), P = (U = Yn.parseDate(A)) == null ? void 0 : U.v, L = p === "time" ? P % 1 : P, y = l.getStyles().getStyleByCell(T), O = (x = (k = y == null ? void 0 : y.n) == null ? void 0 : k.pattern) != null ? x : "";
|
|
247
|
+
return d.errorStyle !== ct.STOP || await u.validator({
|
|
240
248
|
value: L,
|
|
241
249
|
unitId: i,
|
|
242
250
|
subUnitId: a,
|
|
@@ -244,9 +252,9 @@ let Ne = class extends Re {
|
|
|
244
252
|
column: o,
|
|
245
253
|
worksheet: s,
|
|
246
254
|
workbook: l,
|
|
247
|
-
interceptValue:
|
|
248
|
-
t:
|
|
249
|
-
}, d) ? (await this._commandService.executeCommand(
|
|
255
|
+
interceptValue: A.replace("Z", "").replace("T", " "),
|
|
256
|
+
t: Fr.NUMBER
|
|
257
|
+
}, d) ? (await this._commandService.executeCommand(dt.id, {
|
|
250
258
|
unitId: i,
|
|
251
259
|
subUnitId: a,
|
|
252
260
|
range: {
|
|
@@ -263,35 +271,35 @@ let Ne = class extends Re {
|
|
|
263
271
|
si: null,
|
|
264
272
|
s: {
|
|
265
273
|
n: {
|
|
266
|
-
pattern:
|
|
274
|
+
pattern: Wo(p, O)
|
|
267
275
|
}
|
|
268
276
|
}
|
|
269
277
|
}
|
|
270
|
-
}), await this._commandService.executeCommand(
|
|
278
|
+
}), await this._commandService.executeCommand(_t.id, {
|
|
271
279
|
visible: !1,
|
|
272
|
-
eventType:
|
|
280
|
+
eventType: mt.Keyboard,
|
|
273
281
|
unitId: i,
|
|
274
|
-
keycode:
|
|
275
|
-
}), !0) : (this._injector.has(
|
|
282
|
+
keycode: ft.ESC
|
|
283
|
+
}), !0) : (this._injector.has(Je) && this._injector.get(Je).showReject(u.getRuleFinalError(d, { row: r, col: o, unitId: i, subUnitId: a })), !1);
|
|
276
284
|
};
|
|
277
285
|
let m;
|
|
278
286
|
switch (u.dropdownType) {
|
|
279
|
-
case
|
|
280
|
-
const
|
|
287
|
+
case fe.DATE: {
|
|
288
|
+
const g = ie(s.getCellRaw(r, o)), p = Wt(g), _ = !!((D = d.bizInfo) != null && D.showTime);
|
|
281
289
|
m = {
|
|
282
290
|
location: n,
|
|
283
291
|
type: "datepicker",
|
|
284
292
|
props: {
|
|
285
293
|
showTime: _,
|
|
286
|
-
onChange: (
|
|
294
|
+
onChange: (T) => c(T, _ ? "datetime" : "date"),
|
|
287
295
|
defaultValue: p,
|
|
288
296
|
patternType: "date"
|
|
289
297
|
}
|
|
290
298
|
};
|
|
291
299
|
break;
|
|
292
300
|
}
|
|
293
|
-
case
|
|
294
|
-
const
|
|
301
|
+
case fe.TIME: {
|
|
302
|
+
const g = ie(s.getCellRaw(r, o)), p = Wt(g);
|
|
295
303
|
m = {
|
|
296
304
|
location: n,
|
|
297
305
|
type: "datepicker",
|
|
@@ -303,8 +311,8 @@ let Ne = class extends Re {
|
|
|
303
311
|
};
|
|
304
312
|
break;
|
|
305
313
|
}
|
|
306
|
-
case
|
|
307
|
-
const
|
|
314
|
+
case fe.DATETIME: {
|
|
315
|
+
const g = ie(s.getCellRaw(r, o)), p = Wt(g);
|
|
308
316
|
m = {
|
|
309
317
|
location: n,
|
|
310
318
|
type: "datepicker",
|
|
@@ -316,10 +324,10 @@ let Ne = class extends Re {
|
|
|
316
324
|
};
|
|
317
325
|
break;
|
|
318
326
|
}
|
|
319
|
-
case
|
|
320
|
-
case
|
|
321
|
-
const
|
|
322
|
-
const
|
|
327
|
+
case fe.LIST:
|
|
328
|
+
case fe.MULTIPLE_LIST: {
|
|
329
|
+
const g = u.dropdownType === fe.MULTIPLE_LIST, p = async (y) => {
|
|
330
|
+
const O = nr(y), U = {
|
|
323
331
|
unitId: i,
|
|
324
332
|
subUnitId: a,
|
|
325
333
|
range: {
|
|
@@ -329,26 +337,26 @@ let Ne = class extends Re {
|
|
|
329
337
|
endRow: r
|
|
330
338
|
},
|
|
331
339
|
value: {
|
|
332
|
-
v:
|
|
340
|
+
v: O,
|
|
333
341
|
p: null,
|
|
334
342
|
f: null,
|
|
335
343
|
si: null
|
|
336
344
|
}
|
|
337
345
|
};
|
|
338
|
-
return this._commandService.executeCommand(
|
|
346
|
+
return this._commandService.executeCommand(dt.id, U), this._editorBridgeService.isVisible().visible && await this._commandService.executeCommand(_t.id, {
|
|
339
347
|
visible: !1,
|
|
340
|
-
eventType:
|
|
348
|
+
eventType: mt.Keyboard,
|
|
341
349
|
unitId: i,
|
|
342
|
-
keycode:
|
|
343
|
-
}), !
|
|
344
|
-
}, _ = (d == null ? void 0 : d.renderMode) ===
|
|
345
|
-
this._commandService.executeCommand(
|
|
350
|
+
keycode: ft.ESC
|
|
351
|
+
}), !g;
|
|
352
|
+
}, _ = (d == null ? void 0 : d.renderMode) === ue.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, T = u.getListWithColor(d, i, a), A = xt(s.getCellRaw(r, o)), P = () => {
|
|
353
|
+
this._commandService.executeCommand(Be.id, {
|
|
346
354
|
ruleId: d.uid
|
|
347
|
-
}),
|
|
348
|
-
}, L =
|
|
355
|
+
}), h == null || h.dispose();
|
|
356
|
+
}, L = T.map((y) => ({
|
|
349
357
|
label: y.label,
|
|
350
358
|
value: y.label,
|
|
351
|
-
color: _ || y.color ? y.color ||
|
|
359
|
+
color: _ || y.color ? y.color || ke : "transparent"
|
|
352
360
|
}));
|
|
353
361
|
m = {
|
|
354
362
|
location: n,
|
|
@@ -356,16 +364,16 @@ let Ne = class extends Re {
|
|
|
356
364
|
props: {
|
|
357
365
|
onChange: (y) => p(y),
|
|
358
366
|
options: L,
|
|
359
|
-
onEdit:
|
|
360
|
-
defaultValue:
|
|
361
|
-
multiple:
|
|
362
|
-
showEdit: (
|
|
363
|
-
showSearch: (
|
|
367
|
+
onEdit: P,
|
|
368
|
+
defaultValue: A,
|
|
369
|
+
multiple: g,
|
|
370
|
+
showEdit: (C = (v = this._configService.getConfig(Et)) == null ? void 0 : v.showEditOnDropdown) != null ? C : !0,
|
|
371
|
+
showSearch: (w = (f = this._configService.getConfig(Et)) == null ? void 0 : f.showSearchOnDropdown) != null ? w : !0
|
|
364
372
|
}
|
|
365
373
|
};
|
|
366
374
|
break;
|
|
367
375
|
}
|
|
368
|
-
case
|
|
376
|
+
case fe.CASCADE: {
|
|
369
377
|
m = {
|
|
370
378
|
type: "cascader",
|
|
371
379
|
props: {
|
|
@@ -386,21 +394,21 @@ let Ne = class extends Re {
|
|
|
386
394
|
si: null
|
|
387
395
|
}
|
|
388
396
|
};
|
|
389
|
-
return this._commandService.syncExecuteCommand(
|
|
397
|
+
return this._commandService.syncExecuteCommand(dt.id, _), this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(_t.id, {
|
|
390
398
|
visible: !1,
|
|
391
|
-
eventType:
|
|
399
|
+
eventType: mt.Keyboard,
|
|
392
400
|
unitId: i,
|
|
393
|
-
keycode:
|
|
401
|
+
keycode: ft.ESC
|
|
394
402
|
}), !0;
|
|
395
403
|
},
|
|
396
|
-
defaultValue:
|
|
404
|
+
defaultValue: xt(s.getCellRaw(r, o)).split("/"),
|
|
397
405
|
options: JSON.parse((b = d.formula1) != null ? b : "[]")
|
|
398
406
|
},
|
|
399
407
|
location: n
|
|
400
408
|
};
|
|
401
409
|
break;
|
|
402
410
|
}
|
|
403
|
-
case
|
|
411
|
+
case fe.COLOR: {
|
|
404
412
|
m = {
|
|
405
413
|
type: "color",
|
|
406
414
|
props: {
|
|
@@ -421,14 +429,14 @@ let Ne = class extends Re {
|
|
|
421
429
|
si: null
|
|
422
430
|
}
|
|
423
431
|
};
|
|
424
|
-
return this._commandService.syncExecuteCommand(
|
|
432
|
+
return this._commandService.syncExecuteCommand(dt.id, _), this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(_t.id, {
|
|
425
433
|
visible: !1,
|
|
426
|
-
eventType:
|
|
434
|
+
eventType: mt.Keyboard,
|
|
427
435
|
unitId: i,
|
|
428
|
-
keycode:
|
|
436
|
+
keycode: ft.ESC
|
|
429
437
|
}), !0;
|
|
430
438
|
},
|
|
431
|
-
defaultValue:
|
|
439
|
+
defaultValue: xt(s.getCellRaw(r, o))
|
|
432
440
|
},
|
|
433
441
|
location: n
|
|
434
442
|
};
|
|
@@ -437,26 +445,26 @@ let Ne = class extends Re {
|
|
|
437
445
|
default:
|
|
438
446
|
throw new Error("[DataValidationDropdownManagerService]: unknown type!");
|
|
439
447
|
}
|
|
440
|
-
if (
|
|
448
|
+
if (h = this._cellDropdownManagerService.showDropdown({
|
|
441
449
|
...m,
|
|
442
450
|
onHide: () => {
|
|
443
451
|
this._activeDropdown = null, this._activeDropdown$.next(null);
|
|
444
452
|
}
|
|
445
|
-
}), !
|
|
453
|
+
}), !h)
|
|
446
454
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
|
447
|
-
const
|
|
448
|
-
|
|
455
|
+
const I = new Ur();
|
|
456
|
+
I.add(h), I.add({
|
|
449
457
|
dispose: () => {
|
|
450
|
-
var
|
|
451
|
-
(p = (
|
|
458
|
+
var g, p;
|
|
459
|
+
(p = (g = this._activeDropdown) == null ? void 0 : g.onHide) == null || p.call(g);
|
|
452
460
|
}
|
|
453
|
-
}), this._currentPopup =
|
|
461
|
+
}), this._currentPopup = I;
|
|
454
462
|
}
|
|
455
463
|
hideDropdown() {
|
|
456
464
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
|
457
465
|
}
|
|
458
466
|
showDataValidationDropdown(t, n, r, o, i) {
|
|
459
|
-
const a = this._univerInstanceService.getUnit(t,
|
|
467
|
+
const a = this._univerInstanceService.getUnit(t, H.UNIVER_SHEET);
|
|
460
468
|
if (!a)
|
|
461
469
|
return;
|
|
462
470
|
const l = a.getSheetBySheetId(n);
|
|
@@ -483,62 +491,62 @@ let Ne = class extends Re {
|
|
|
483
491
|
});
|
|
484
492
|
}
|
|
485
493
|
};
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
],
|
|
499
|
-
const
|
|
494
|
+
$e = Bo([
|
|
495
|
+
ve(0, pe),
|
|
496
|
+
ve(1, E(Te)),
|
|
497
|
+
ve(2, ur),
|
|
498
|
+
ve(3, E(ae)),
|
|
499
|
+
ve(4, E(Jn)),
|
|
500
|
+
ve(5, E(Mo)),
|
|
501
|
+
ve(6, E(ae)),
|
|
502
|
+
ve(7, oe),
|
|
503
|
+
ve(8, mr),
|
|
504
|
+
ve(9, E(Ve)),
|
|
505
|
+
ve(10, hn)
|
|
506
|
+
], $e);
|
|
507
|
+
const Vt = "DataValidationPanel", Be = {
|
|
500
508
|
id: "data-validation.operation.open-validation-panel",
|
|
501
|
-
type:
|
|
509
|
+
type: ot.OPERATION,
|
|
502
510
|
handler(e, t) {
|
|
503
511
|
if (!t)
|
|
504
512
|
return !1;
|
|
505
|
-
const { ruleId: n, isAdd: r } = t, o = e.get(
|
|
513
|
+
const { ruleId: n, isAdd: r } = t, o = e.get(_e), i = e.get(fn), a = e.get(pe), l = e.get(cr), s = Qn(a);
|
|
506
514
|
if (!s) return !1;
|
|
507
|
-
const { unitId: d, subUnitId: u } = s,
|
|
508
|
-
o.open(), o.setActiveRule(
|
|
515
|
+
const { unitId: d, subUnitId: u } = s, h = n ? i.getRuleById(d, u, n) : void 0;
|
|
516
|
+
o.open(), o.setActiveRule(h && {
|
|
509
517
|
unitId: d,
|
|
510
518
|
subUnitId: u,
|
|
511
|
-
rule:
|
|
519
|
+
rule: h
|
|
512
520
|
});
|
|
513
521
|
const c = l.open({
|
|
514
|
-
id:
|
|
522
|
+
id: Vt,
|
|
515
523
|
header: { title: r ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
|
516
|
-
children: { label:
|
|
524
|
+
children: { label: Vt },
|
|
517
525
|
width: 312,
|
|
518
526
|
onClose: () => o.close()
|
|
519
527
|
});
|
|
520
528
|
return o.setCloseDisposable(c), !0;
|
|
521
529
|
}
|
|
522
|
-
},
|
|
530
|
+
}, wn = {
|
|
523
531
|
id: "data-validation.operation.close-validation-panel",
|
|
524
|
-
type:
|
|
532
|
+
type: ot.OPERATION,
|
|
525
533
|
handler(e) {
|
|
526
|
-
return e.get(
|
|
534
|
+
return e.get(_e).close(), !0;
|
|
527
535
|
}
|
|
528
|
-
},
|
|
536
|
+
}, Cr = {
|
|
529
537
|
id: "data-validation.operation.toggle-validation-panel",
|
|
530
|
-
type:
|
|
538
|
+
type: ot.OPERATION,
|
|
531
539
|
handler(e) {
|
|
532
|
-
const t = e.get(
|
|
533
|
-
return n.open(), n.isOpen ? t.executeCommand(
|
|
540
|
+
const t = e.get(oe), n = e.get(_e);
|
|
541
|
+
return n.open(), n.isOpen ? t.executeCommand(wn.id) : t.executeCommand(Be.id), !0;
|
|
534
542
|
}
|
|
535
|
-
},
|
|
536
|
-
type:
|
|
543
|
+
}, Ut = {
|
|
544
|
+
type: ot.OPERATION,
|
|
537
545
|
id: "sheet.operation.show-data-validation-dropdown",
|
|
538
546
|
handler(e, t) {
|
|
539
547
|
if (!t)
|
|
540
548
|
return !1;
|
|
541
|
-
const n = e.get(
|
|
549
|
+
const n = e.get($e), { unitId: r, subUnitId: o, row: i, column: a } = t, l = n.activeDropdown, s = l == null ? void 0 : l.location;
|
|
542
550
|
return s && s.unitId === r && s.subUnitId === o && s.row === i && s.col === a || n.showDataValidationDropdown(
|
|
543
551
|
r,
|
|
544
552
|
o,
|
|
@@ -546,36 +554,36 @@ const bt = "DataValidationPanel", Fe = {
|
|
|
546
554
|
a
|
|
547
555
|
), !0;
|
|
548
556
|
}
|
|
549
|
-
},
|
|
550
|
-
type:
|
|
557
|
+
}, Ir = {
|
|
558
|
+
type: ot.OPERATION,
|
|
551
559
|
id: "sheet.operation.hide-data-validation-dropdown",
|
|
552
560
|
handler(e, t) {
|
|
553
|
-
return t ? (e.get(
|
|
561
|
+
return t ? (e.get($e).hideDropdown(), !0) : !1;
|
|
554
562
|
}
|
|
555
|
-
},
|
|
556
|
-
type:
|
|
563
|
+
}, Ft = {
|
|
564
|
+
type: ot.COMMAND,
|
|
557
565
|
id: "data-validation.command.addRuleAndOpen",
|
|
558
566
|
handler(e) {
|
|
559
|
-
const t = e.get(
|
|
567
|
+
const t = e.get(pe), n = Qn(t);
|
|
560
568
|
if (!n) return !1;
|
|
561
|
-
const { workbook: r, worksheet: o } = n, i =
|
|
569
|
+
const { workbook: r, worksheet: o } = n, i = rr(e), a = e.get(oe), l = r.getUnitId(), s = o.getSheetId(), d = {
|
|
562
570
|
rule: i,
|
|
563
571
|
unitId: l,
|
|
564
572
|
subUnitId: s
|
|
565
573
|
};
|
|
566
|
-
return a.syncExecuteCommand(
|
|
574
|
+
return a.syncExecuteCommand(vn.id, d) ? (a.syncExecuteCommand(Be.id, {
|
|
567
575
|
ruleId: i.uid,
|
|
568
576
|
isAdd: !0
|
|
569
577
|
}), !0) : !1;
|
|
570
578
|
}
|
|
571
579
|
};
|
|
572
|
-
var
|
|
573
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
580
|
+
var Ho = Object.getOwnPropertyDescriptor, jo = (e, t, n, r) => {
|
|
581
|
+
for (var o = r > 1 ? void 0 : r ? Ho(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
574
582
|
(a = e[i]) && (o = a(o) || o);
|
|
575
583
|
return o;
|
|
576
|
-
},
|
|
577
|
-
const
|
|
578
|
-
let
|
|
584
|
+
}, je = (e, t) => (n, r) => t(n, r, e);
|
|
585
|
+
const Oe = "SHEET_DATA_VALIDATION_ALERT";
|
|
586
|
+
let gt = class extends De {
|
|
579
587
|
constructor(e, t, n, r, o, i) {
|
|
580
588
|
super(), this._hoverManagerService = e, this._cellAlertManagerService = t, this._univerInstanceService = n, this._localeService = r, this._zenZoneService = o, this._dataValidationModel = i, this._init();
|
|
581
589
|
}
|
|
@@ -583,143 +591,143 @@ let ut = class extends Re {
|
|
|
583
591
|
this._initCellAlertPopup(), this._initZenService();
|
|
584
592
|
}
|
|
585
593
|
_initCellAlertPopup() {
|
|
586
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
|
594
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(pr(100)).subscribe((e) => {
|
|
587
595
|
var t;
|
|
588
596
|
if (e) {
|
|
589
|
-
const n = this._univerInstanceService.getUnit(e.location.unitId,
|
|
597
|
+
const n = this._univerInstanceService.getUnit(e.location.unitId, H.UNIVER_SHEET), r = n.getSheetBySheetId(e.location.subUnitId);
|
|
590
598
|
if (!r) return;
|
|
591
599
|
const o = this._dataValidationModel.getRuleByLocation(e.location.unitId, e.location.subUnitId, e.location.row, e.location.col);
|
|
592
600
|
if (!o) {
|
|
593
|
-
this._cellAlertManagerService.removeAlert(
|
|
601
|
+
this._cellAlertManagerService.removeAlert(Oe);
|
|
594
602
|
return;
|
|
595
603
|
}
|
|
596
|
-
if (this._dataValidationModel.validator(o, { ...e.location, workbook: n, worksheet: r }) ===
|
|
597
|
-
const a = this._cellAlertManagerService.currentAlert.get(
|
|
604
|
+
if (this._dataValidationModel.validator(o, { ...e.location, workbook: n, worksheet: r }) === ze.INVALID) {
|
|
605
|
+
const a = this._cellAlertManagerService.currentAlert.get(Oe), l = (t = a == null ? void 0 : a.alert) == null ? void 0 : t.location;
|
|
598
606
|
if (l && l.row === e.location.row && l.col === e.location.col && l.subUnitId === e.location.subUnitId && l.unitId === e.location.unitId) {
|
|
599
|
-
this._cellAlertManagerService.removeAlert(
|
|
607
|
+
this._cellAlertManagerService.removeAlert(Oe);
|
|
600
608
|
return;
|
|
601
609
|
}
|
|
602
610
|
const s = this._dataValidationModel.getValidator(o.type);
|
|
603
611
|
if (!s) {
|
|
604
|
-
this._cellAlertManagerService.removeAlert(
|
|
612
|
+
this._cellAlertManagerService.removeAlert(Oe);
|
|
605
613
|
return;
|
|
606
614
|
}
|
|
607
615
|
this._cellAlertManagerService.showAlert({
|
|
608
|
-
type:
|
|
616
|
+
type: Do.ERROR,
|
|
609
617
|
title: this._localeService.t("dataValidation.error.title"),
|
|
610
618
|
message: s == null ? void 0 : s.getRuleFinalError(o, e.location),
|
|
611
619
|
location: e.location,
|
|
612
620
|
width: 200,
|
|
613
621
|
height: 74,
|
|
614
|
-
key:
|
|
622
|
+
key: Oe
|
|
615
623
|
});
|
|
616
624
|
return;
|
|
617
625
|
}
|
|
618
626
|
}
|
|
619
|
-
this._cellAlertManagerService.removeAlert(
|
|
627
|
+
this._cellAlertManagerService.removeAlert(Oe);
|
|
620
628
|
}));
|
|
621
629
|
}
|
|
622
630
|
_initZenService() {
|
|
623
631
|
this.disposeWithMe(this._zenZoneService.visible$.subscribe((e) => {
|
|
624
|
-
e && this._cellAlertManagerService.removeAlert(
|
|
632
|
+
e && this._cellAlertManagerService.removeAlert(Oe);
|
|
625
633
|
}));
|
|
626
634
|
}
|
|
627
635
|
};
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
],
|
|
636
|
-
var
|
|
637
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
636
|
+
gt = jo([
|
|
637
|
+
je(0, E(bo)),
|
|
638
|
+
je(1, E(Eo)),
|
|
639
|
+
je(2, pe),
|
|
640
|
+
je(3, E(ge)),
|
|
641
|
+
je(4, ur),
|
|
642
|
+
je(5, E(ae))
|
|
643
|
+
], gt);
|
|
644
|
+
var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, n, r) => {
|
|
645
|
+
for (var o = r > 1 ? void 0 : r ? Yo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
638
646
|
(a = e[i]) && (o = a(o) || o);
|
|
639
647
|
return o;
|
|
640
|
-
},
|
|
641
|
-
let
|
|
648
|
+
}, Ht = (e, t) => (n, r) => t(n, r, e);
|
|
649
|
+
let Qe = class extends De {
|
|
642
650
|
constructor(e, t, n) {
|
|
643
651
|
super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = n, this._initAutoFill();
|
|
644
652
|
}
|
|
645
653
|
// eslint-disable-next-line max-lines-per-function
|
|
646
654
|
_initAutoFill() {
|
|
647
655
|
const e = () => ({ redos: [], undos: [] }), t = (r, o) => {
|
|
648
|
-
const { source: i, target: a, unitId: l, subUnitId: s } = r, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u =
|
|
649
|
-
row:
|
|
650
|
-
col:
|
|
651
|
-
},
|
|
652
|
-
|
|
653
|
-
const _ = p.repeatStartCell,
|
|
654
|
-
startRow:
|
|
655
|
-
startColumn:
|
|
656
|
-
endColumn:
|
|
657
|
-
endRow:
|
|
658
|
-
},
|
|
656
|
+
const { source: i, target: a, unitId: l, subUnitId: s } = r, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = sn([i, a]), [h, c] = u.ranges, { mapFunc: m } = u, I = {
|
|
657
|
+
row: h.startRow,
|
|
658
|
+
col: h.startColumn
|
|
659
|
+
}, D = eo.getAutoFillRepeatRange(h, c), v = new yt(), C = /* @__PURE__ */ new Set();
|
|
660
|
+
D.forEach((p) => {
|
|
661
|
+
const _ = p.repeatStartCell, T = p.relativeRange, A = {
|
|
662
|
+
startRow: I.row,
|
|
663
|
+
startColumn: I.col,
|
|
664
|
+
endColumn: I.col,
|
|
665
|
+
endRow: I.row
|
|
666
|
+
}, P = {
|
|
659
667
|
startRow: _.row,
|
|
660
668
|
startColumn: _.col,
|
|
661
669
|
endColumn: _.col,
|
|
662
670
|
endRow: _.row
|
|
663
671
|
};
|
|
664
|
-
|
|
665
|
-
const
|
|
672
|
+
$r.foreach(T, (L, y) => {
|
|
673
|
+
const O = Mt.getPositionRange(
|
|
666
674
|
{
|
|
667
675
|
startRow: L,
|
|
668
676
|
startColumn: y,
|
|
669
677
|
endColumn: y,
|
|
670
678
|
endRow: L
|
|
671
679
|
},
|
|
672
|
-
|
|
673
|
-
), { row:
|
|
680
|
+
A
|
|
681
|
+
), { row: U, col: k } = m(O.startRow, O.startColumn), x = this._sheetDataValidationModel.getRuleIdByLocation(l, s, U, k) || "", te = Mt.getPositionRange(
|
|
674
682
|
{
|
|
675
683
|
startRow: L,
|
|
676
684
|
startColumn: y,
|
|
677
685
|
endColumn: y,
|
|
678
686
|
endRow: L
|
|
679
687
|
},
|
|
680
|
-
|
|
681
|
-
), { row:
|
|
682
|
-
|
|
688
|
+
P
|
|
689
|
+
), { row: j, col: se } = m(te.startRow, te.startColumn);
|
|
690
|
+
v.setValue(j, se, x), C.add(x);
|
|
683
691
|
});
|
|
684
692
|
});
|
|
685
|
-
const
|
|
686
|
-
d.addRangeRules(
|
|
687
|
-
const
|
|
693
|
+
const f = Array.from(C).map((p) => ({ id: p, ranges: Qt(v, (_) => _ === p) }));
|
|
694
|
+
d.addRangeRules(f);
|
|
695
|
+
const w = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: b, undoMutations: g } = on(l, s, w, this._injector, "patched", o === st.ONLY_FORMAT);
|
|
688
696
|
return {
|
|
689
|
-
undos:
|
|
697
|
+
undos: g,
|
|
690
698
|
redos: b
|
|
691
699
|
};
|
|
692
700
|
}, n = {
|
|
693
|
-
id:
|
|
701
|
+
id: or,
|
|
694
702
|
onBeforeFillData: (r) => {
|
|
695
703
|
const { source: o, unitId: i, subUnitId: a } = r;
|
|
696
704
|
for (const l of o.rows)
|
|
697
705
|
for (const s of o.cols) {
|
|
698
706
|
const d = this._sheetDataValidationModel.getRuleByLocation(i, a, l, s);
|
|
699
|
-
if (d && d.type ===
|
|
700
|
-
this._autoFillService.setDisableApplyType(
|
|
707
|
+
if (d && d.type === X.CHECKBOX) {
|
|
708
|
+
this._autoFillService.setDisableApplyType(st.SERIES, !0);
|
|
701
709
|
return;
|
|
702
710
|
}
|
|
703
711
|
}
|
|
704
712
|
},
|
|
705
|
-
onFillData: (r, o, i) => i ===
|
|
713
|
+
onFillData: (r, o, i) => i === st.COPY || i === st.ONLY_FORMAT || i === st.SERIES ? t(r, i) : e(),
|
|
706
714
|
onAfterFillData: () => {
|
|
707
715
|
}
|
|
708
716
|
};
|
|
709
717
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
710
718
|
}
|
|
711
719
|
};
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
],
|
|
717
|
-
var
|
|
718
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
720
|
+
Qe = Xo([
|
|
721
|
+
Ht(0, Qr),
|
|
722
|
+
Ht(1, E(ae)),
|
|
723
|
+
Ht(2, E(Ve))
|
|
724
|
+
], Qe);
|
|
725
|
+
var Zo = Object.getOwnPropertyDescriptor, zo = (e, t, n, r) => {
|
|
726
|
+
for (var o = r > 1 ? void 0 : r ? Zo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
719
727
|
(a = e[i]) && (o = a(o) || o);
|
|
720
728
|
return o;
|
|
721
|
-
},
|
|
722
|
-
let
|
|
729
|
+
}, jt = (e, t) => (n, r) => t(n, r, e);
|
|
730
|
+
let et = class extends De {
|
|
723
731
|
constructor(t, n, r) {
|
|
724
732
|
super();
|
|
725
733
|
V(this, "_copyInfo");
|
|
@@ -727,29 +735,29 @@ let qe = class extends Re {
|
|
|
727
735
|
}
|
|
728
736
|
_initCopyPaste() {
|
|
729
737
|
this._sheetClipboardService.addClipboardHook({
|
|
730
|
-
id:
|
|
738
|
+
id: or,
|
|
731
739
|
onBeforeCopy: (t, n, r) => this._collect(t, n, r),
|
|
732
740
|
onPasteCells: (t, n, r, o) => {
|
|
733
|
-
const { copyType: i =
|
|
741
|
+
const { copyType: i = kn.COPY, pasteType: a } = o, { range: l } = t || {}, { range: s, unitId: d, subUnitId: u } = n;
|
|
734
742
|
return this._generateMutations(s, { copyType: i, pasteType: a, copyRange: l, unitId: d, subUnitId: u });
|
|
735
743
|
}
|
|
736
744
|
});
|
|
737
745
|
}
|
|
738
746
|
_collect(t, n, r) {
|
|
739
|
-
const o = new
|
|
747
|
+
const o = new yt();
|
|
740
748
|
this._copyInfo = {
|
|
741
749
|
unitId: t,
|
|
742
750
|
subUnitId: n,
|
|
743
751
|
matrix: o
|
|
744
752
|
};
|
|
745
|
-
const i = this._injector.invoke((s) =>
|
|
753
|
+
const i = this._injector.invoke((s) => to(r, s, t, n));
|
|
746
754
|
if (!i)
|
|
747
755
|
return;
|
|
748
756
|
const { rows: a, cols: l } = i;
|
|
749
757
|
a.forEach((s, d) => {
|
|
750
|
-
l.forEach((u,
|
|
758
|
+
l.forEach((u, h) => {
|
|
751
759
|
const c = this._sheetDataValidationModel.getRuleIdByLocation(t, n, s, u);
|
|
752
|
-
o.setValue(d,
|
|
760
|
+
o.setValue(d, h, c != null ? c : "");
|
|
753
761
|
});
|
|
754
762
|
});
|
|
755
763
|
}
|
|
@@ -757,40 +765,40 @@ let qe = class extends Re {
|
|
|
757
765
|
_generateMutations(t, n) {
|
|
758
766
|
if (!this._copyInfo)
|
|
759
767
|
return { redos: [], undos: [] };
|
|
760
|
-
if (n.copyType ===
|
|
768
|
+
if (n.copyType === kn.CUT)
|
|
761
769
|
return this._copyInfo = null, { redos: [], undos: [] };
|
|
762
770
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
763
771
|
return { redos: [], undos: [] };
|
|
764
772
|
if ([
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
773
|
+
St.SPECIAL_PASTE_COL_WIDTH,
|
|
774
|
+
St.SPECIAL_PASTE_VALUE,
|
|
775
|
+
St.SPECIAL_PASTE_FORMAT,
|
|
776
|
+
St.SPECIAL_PASTE_FORMULA
|
|
769
777
|
].includes(n.pasteType))
|
|
770
778
|
return { redos: [], undos: [] };
|
|
771
779
|
const { unitId: o, subUnitId: i } = this._copyInfo;
|
|
772
780
|
if (n.unitId !== o || i !== n.subUnitId) {
|
|
773
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(n.unitId, n.subUnitId).clone(), l = new
|
|
774
|
-
c.forEach(({ startRange:
|
|
775
|
-
var
|
|
776
|
-
(
|
|
777
|
-
const p =
|
|
781
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(n.unitId, n.subUnitId).clone(), l = new yt(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } = sn([n.copyRange, t]), c = Nn(d, u, !0), m = /* @__PURE__ */ new Map();
|
|
782
|
+
c.forEach(({ startRange: C }) => {
|
|
783
|
+
var f;
|
|
784
|
+
(f = this._copyInfo) == null || f.matrix.forValue((w, b, g) => {
|
|
785
|
+
const p = Mt.getPositionRange(
|
|
778
786
|
{
|
|
779
|
-
startRow:
|
|
780
|
-
endRow:
|
|
787
|
+
startRow: w,
|
|
788
|
+
endRow: w,
|
|
781
789
|
startColumn: b,
|
|
782
790
|
endColumn: b
|
|
783
791
|
},
|
|
784
|
-
|
|
785
|
-
), _ = `${i}-${
|
|
786
|
-
!this._sheetDataValidationModel.getRuleById(n.unitId, n.subUnitId, _) &&
|
|
787
|
-
const { row:
|
|
788
|
-
s.add(_), l.setValue(
|
|
792
|
+
C
|
|
793
|
+
), _ = `${i}-${g}`, T = this._sheetDataValidationModel.getRuleById(o, i, g);
|
|
794
|
+
!this._sheetDataValidationModel.getRuleById(n.unitId, n.subUnitId, _) && T && m.set(_, { ...T, uid: _ });
|
|
795
|
+
const { row: A, col: P } = h(p.startRow, p.startColumn);
|
|
796
|
+
s.add(_), l.setValue(A, P, _);
|
|
789
797
|
});
|
|
790
798
|
});
|
|
791
|
-
const
|
|
792
|
-
a.addRangeRules(
|
|
793
|
-
const { redoMutations:
|
|
799
|
+
const I = Array.from(s).map((C) => ({ id: C, ranges: Qt(l, (f) => f === C) }));
|
|
800
|
+
a.addRangeRules(I);
|
|
801
|
+
const { redoMutations: D, undoMutations: v } = on(
|
|
794
802
|
n.unitId,
|
|
795
803
|
n.subUnitId,
|
|
796
804
|
a.diffWithAddition(this._sheetDataValidationModel.getRules(n.unitId, n.subUnitId), m.values()),
|
|
@@ -799,29 +807,29 @@ let qe = class extends Re {
|
|
|
799
807
|
!1
|
|
800
808
|
);
|
|
801
809
|
return {
|
|
802
|
-
redos:
|
|
803
|
-
undos:
|
|
810
|
+
redos: D,
|
|
811
|
+
undos: v
|
|
804
812
|
};
|
|
805
813
|
} else {
|
|
806
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(o, i).clone(), l = new
|
|
807
|
-
|
|
808
|
-
var
|
|
809
|
-
(
|
|
810
|
-
const
|
|
814
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(o, i).clone(), l = new yt(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: h } = sn([n.copyRange, t]);
|
|
815
|
+
Nn(d, u, !0).forEach(({ startRange: v }) => {
|
|
816
|
+
var C;
|
|
817
|
+
(C = this._copyInfo) == null || C.matrix.forValue((f, w, b) => {
|
|
818
|
+
const g = Mt.getPositionRange(
|
|
811
819
|
{
|
|
812
|
-
startRow:
|
|
813
|
-
endRow:
|
|
814
|
-
startColumn:
|
|
815
|
-
endColumn:
|
|
820
|
+
startRow: f,
|
|
821
|
+
endRow: f,
|
|
822
|
+
startColumn: w,
|
|
823
|
+
endColumn: w
|
|
816
824
|
},
|
|
817
|
-
|
|
818
|
-
), { row: p, col: _ } = g
|
|
825
|
+
v
|
|
826
|
+
), { row: p, col: _ } = h(g.startRow, g.startColumn);
|
|
819
827
|
l.setValue(p, _, b), s.add(b);
|
|
820
828
|
});
|
|
821
829
|
});
|
|
822
|
-
const m = Array.from(s).map((
|
|
830
|
+
const m = Array.from(s).map((v) => ({ id: v, ranges: Qt(l, (C) => C === v) }));
|
|
823
831
|
a.addRangeRules(m);
|
|
824
|
-
const { redoMutations:
|
|
832
|
+
const { redoMutations: I, undoMutations: D } = on(
|
|
825
833
|
o,
|
|
826
834
|
i,
|
|
827
835
|
a.diff(this._sheetDataValidationModel.getRules(o, i)),
|
|
@@ -830,112 +838,112 @@ let qe = class extends Re {
|
|
|
830
838
|
!1
|
|
831
839
|
);
|
|
832
840
|
return {
|
|
833
|
-
redos:
|
|
834
|
-
undos:
|
|
841
|
+
redos: I,
|
|
842
|
+
undos: D
|
|
835
843
|
};
|
|
836
844
|
}
|
|
837
845
|
}
|
|
838
846
|
};
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
],
|
|
844
|
-
var
|
|
845
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
847
|
+
et = zo([
|
|
848
|
+
jt(0, Vo),
|
|
849
|
+
jt(1, E(ae)),
|
|
850
|
+
jt(2, E(Ve))
|
|
851
|
+
], et);
|
|
852
|
+
var Ko = Object.getOwnPropertyDescriptor, Go = (e, t, n, r) => {
|
|
853
|
+
for (var o = r > 1 ? void 0 : r ? Ko(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
846
854
|
(a = e[i]) && (o = a(o) || o);
|
|
847
855
|
return o;
|
|
848
|
-
},
|
|
849
|
-
let
|
|
856
|
+
}, Yt = (e, t) => (n, r) => t(n, r, e);
|
|
857
|
+
let tt = class extends De {
|
|
850
858
|
constructor(e, t, n) {
|
|
851
859
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = n, this._commandExecutedListener();
|
|
852
860
|
}
|
|
853
861
|
_commandExecutedListener() {
|
|
854
862
|
this.disposeWithMe(
|
|
855
863
|
this._commandService.beforeCommandExecuted((e) => {
|
|
856
|
-
if (e.id ===
|
|
864
|
+
if (e.id === vn.id) {
|
|
857
865
|
const { unitId: t, subUnitId: n, rule: { ranges: r } } = e.params;
|
|
858
866
|
this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
859
|
-
workbookTypes: [
|
|
860
|
-
rangeTypes: [
|
|
861
|
-
worksheetTypes: [
|
|
867
|
+
workbookTypes: [rn],
|
|
868
|
+
rangeTypes: [nn],
|
|
869
|
+
worksheetTypes: [en, tn]
|
|
862
870
|
}, r, t, n) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
|
|
863
871
|
}
|
|
864
|
-
if (e.id ===
|
|
872
|
+
if (e.id === ir.id) {
|
|
865
873
|
const { unitId: t, subUnitId: n, ranges: r } = e.params;
|
|
866
874
|
this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
867
|
-
workbookTypes: [
|
|
868
|
-
rangeTypes: [
|
|
869
|
-
worksheetTypes: [
|
|
875
|
+
workbookTypes: [rn],
|
|
876
|
+
rangeTypes: [nn],
|
|
877
|
+
worksheetTypes: [en, tn]
|
|
870
878
|
}, r, t, n) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
|
|
871
879
|
}
|
|
872
880
|
})
|
|
873
881
|
);
|
|
874
882
|
}
|
|
875
883
|
};
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
],
|
|
881
|
-
const
|
|
882
|
-
function
|
|
884
|
+
tt = Go([
|
|
885
|
+
Yt(0, E(ge)),
|
|
886
|
+
Yt(1, oe),
|
|
887
|
+
Yt(2, E(no))
|
|
888
|
+
], tt);
|
|
889
|
+
const wr = "sheet.menu.data-validation";
|
|
890
|
+
function qo(e) {
|
|
883
891
|
return {
|
|
884
|
-
id:
|
|
885
|
-
type:
|
|
892
|
+
id: wr,
|
|
893
|
+
type: _n.SUBITEMS,
|
|
886
894
|
icon: "DataValidationIcon",
|
|
887
895
|
tooltip: "dataValidation.title",
|
|
888
|
-
hidden$:
|
|
889
|
-
disabled$:
|
|
896
|
+
hidden$: So(e, H.UNIVER_SHEET),
|
|
897
|
+
disabled$: To(e, { workbookTypes: [rn], worksheetTypes: [tn, en], rangeTypes: [nn] })
|
|
890
898
|
};
|
|
891
899
|
}
|
|
892
|
-
function
|
|
900
|
+
function Jo(e) {
|
|
893
901
|
return {
|
|
894
|
-
id:
|
|
902
|
+
id: Be.id,
|
|
895
903
|
title: "dataValidation.panel.title",
|
|
896
|
-
type:
|
|
904
|
+
type: _n.BUTTON
|
|
897
905
|
};
|
|
898
906
|
}
|
|
899
|
-
function
|
|
907
|
+
function Qo(e) {
|
|
900
908
|
return {
|
|
901
|
-
id:
|
|
909
|
+
id: Ft.id,
|
|
902
910
|
title: "dataValidation.panel.add",
|
|
903
|
-
type:
|
|
911
|
+
type: _n.BUTTON
|
|
904
912
|
};
|
|
905
913
|
}
|
|
906
|
-
const
|
|
907
|
-
[
|
|
908
|
-
[
|
|
914
|
+
const ei = {
|
|
915
|
+
[Co.RULES]: {
|
|
916
|
+
[wr]: {
|
|
909
917
|
order: 0,
|
|
910
|
-
menuItemFactory:
|
|
911
|
-
[
|
|
918
|
+
menuItemFactory: qo,
|
|
919
|
+
[Be.id]: {
|
|
912
920
|
order: 0,
|
|
913
|
-
menuItemFactory:
|
|
921
|
+
menuItemFactory: Jo
|
|
914
922
|
},
|
|
915
|
-
[
|
|
923
|
+
[Ft.id]: {
|
|
916
924
|
order: 1,
|
|
917
|
-
menuItemFactory:
|
|
925
|
+
menuItemFactory: Qo
|
|
918
926
|
}
|
|
919
927
|
}
|
|
920
928
|
}
|
|
921
929
|
};
|
|
922
|
-
var
|
|
923
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
930
|
+
var ti = Object.getOwnPropertyDescriptor, Rr = (e, t, n, r) => {
|
|
931
|
+
for (var o = r > 1 ? void 0 : r ? ti(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
924
932
|
(a = e[i]) && (o = a(o) || o);
|
|
925
933
|
return o;
|
|
926
934
|
}, K = (e, t) => (n, r) => t(n, r, e);
|
|
927
|
-
const
|
|
935
|
+
const yr = {
|
|
928
936
|
tr: {
|
|
929
937
|
size: 6,
|
|
930
938
|
color: "#fe4b4b"
|
|
931
939
|
}
|
|
932
940
|
};
|
|
933
|
-
let
|
|
941
|
+
let nt = class extends pn {
|
|
934
942
|
constructor(e, t, n, r, o, i, a, l, s, d, u) {
|
|
935
943
|
super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = n, this._univerInstanceService = r, this._autoHeightController = o, this._dropdownManagerService = i, this._sheetDataValidationModel = a, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = d, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
|
936
944
|
}
|
|
937
945
|
_initMenu() {
|
|
938
|
-
this._menuManagerService.mergeMenu(
|
|
946
|
+
this._menuManagerService.mergeMenu(ei);
|
|
939
947
|
}
|
|
940
948
|
_initDropdown() {
|
|
941
949
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
|
|
@@ -957,7 +965,7 @@ let Qe = class extends cn {
|
|
|
957
965
|
return;
|
|
958
966
|
const u = l.getActiveSheet();
|
|
959
967
|
if (!u) return;
|
|
960
|
-
const
|
|
968
|
+
const h = this._dropdownManagerService.activeDropdown, c = h == null ? void 0 : h.location;
|
|
961
969
|
if (c && c.unitId === r && c.subUnitId === o && c.row === i && c.col === a)
|
|
962
970
|
return;
|
|
963
971
|
this._dropdownManagerService.showDropdown(
|
|
@@ -981,56 +989,56 @@ let Qe = class extends cn {
|
|
|
981
989
|
_initViewModelIntercept() {
|
|
982
990
|
this.disposeWithMe(
|
|
983
991
|
this._sheetInterceptorService.intercept(
|
|
984
|
-
|
|
992
|
+
er.CELL_CONTENT,
|
|
985
993
|
{
|
|
986
|
-
effect:
|
|
994
|
+
effect: Xn.Style,
|
|
987
995
|
// must be after numfmt
|
|
988
|
-
priority:
|
|
996
|
+
priority: tr.DATA_VALIDATION,
|
|
989
997
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
990
998
|
handler: (e, t, n) => {
|
|
991
|
-
var
|
|
999
|
+
var C, f, w, b, g;
|
|
992
1000
|
const { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(i, a, r, o);
|
|
993
1001
|
if (!d)
|
|
994
1002
|
return n(e);
|
|
995
1003
|
const u = this._sheetDataValidationModel.getRuleById(i, a, d);
|
|
996
1004
|
if (!u)
|
|
997
1005
|
return n(e);
|
|
998
|
-
const
|
|
999
|
-
let
|
|
1000
|
-
const
|
|
1006
|
+
const h = (C = this._dataValidationCacheService.getValue(i, a, r, o)) != null ? C : ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), m = t.rawData;
|
|
1007
|
+
let I;
|
|
1008
|
+
const D = {
|
|
1001
1009
|
get value() {
|
|
1002
1010
|
var p;
|
|
1003
|
-
return
|
|
1011
|
+
return I !== void 0 || (I = (p = ie(m)) != null ? p : null), I;
|
|
1004
1012
|
}
|
|
1005
|
-
},
|
|
1013
|
+
}, v = {
|
|
1006
1014
|
get value() {
|
|
1007
1015
|
var p;
|
|
1008
|
-
return `${(p =
|
|
1016
|
+
return `${(p = D.value) != null ? p : ""}`;
|
|
1009
1017
|
}
|
|
1010
1018
|
};
|
|
1011
1019
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
|
1012
1020
|
...e == null ? void 0 : e.markers,
|
|
1013
|
-
...
|
|
1021
|
+
...h === ze.INVALID ? yr : null
|
|
1014
1022
|
}, e.customRender = [
|
|
1015
|
-
...(
|
|
1023
|
+
...(f = e == null ? void 0 : e.customRender) != null ? f : [],
|
|
1016
1024
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
|
1017
1025
|
], e.fontRenderExtension = {
|
|
1018
1026
|
...e == null ? void 0 : e.fontRenderExtension,
|
|
1019
|
-
isSkip: ((
|
|
1027
|
+
isSkip: ((w = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : w.isSkip) || ((b = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : b.call(c, u, D.value, t))
|
|
1020
1028
|
}, e.interceptorStyle = {
|
|
1021
1029
|
...e == null ? void 0 : e.interceptorStyle,
|
|
1022
|
-
...c == null ? void 0 : c.getExtraStyle(u,
|
|
1030
|
+
...c == null ? void 0 : c.getExtraStyle(u, v.value, {
|
|
1023
1031
|
get style() {
|
|
1024
1032
|
const p = l.getStyles();
|
|
1025
1033
|
return (typeof (e == null ? void 0 : e.s) == "string" ? p.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
|
1026
1034
|
}
|
|
1027
1035
|
}, r, o)
|
|
1028
1036
|
}, e.interceptorAutoHeight = () => {
|
|
1029
|
-
var
|
|
1030
|
-
const p = (
|
|
1037
|
+
var A, P, L, y, O, U;
|
|
1038
|
+
const p = (P = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(ut).getSkeletonParam(a)) == null ? void 0 : P.skeleton;
|
|
1031
1039
|
if (!p)
|
|
1032
1040
|
return;
|
|
1033
|
-
const _ = p.worksheet.getMergedCell(r, o),
|
|
1041
|
+
const _ = p.worksheet.getMergedCell(r, o), T = {
|
|
1034
1042
|
data: e,
|
|
1035
1043
|
style: p.getStyles().getStyleByCell(e),
|
|
1036
1044
|
primaryWithCoord: p.getCellWithCoordByIndex((L = _ == null ? void 0 : _.startRow) != null ? L : r, (y = _ == null ? void 0 : _.startColumn) != null ? y : o),
|
|
@@ -1041,13 +1049,13 @@ let Qe = class extends cn {
|
|
|
1041
1049
|
workbook: l,
|
|
1042
1050
|
worksheet: s
|
|
1043
1051
|
};
|
|
1044
|
-
return (
|
|
1052
|
+
return (U = (O = c == null ? void 0 : c.canvasRender) == null ? void 0 : O.calcCellAutoHeight) == null ? void 0 : U.call(O, T);
|
|
1045
1053
|
}, e.interceptorAutoWidth = () => {
|
|
1046
|
-
var
|
|
1047
|
-
const p = (
|
|
1054
|
+
var A, P, L, y, O, U;
|
|
1055
|
+
const p = (P = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(ut).getSkeletonParam(a)) == null ? void 0 : P.skeleton;
|
|
1048
1056
|
if (!p)
|
|
1049
1057
|
return;
|
|
1050
|
-
const _ = p.worksheet.getMergedCell(r, o),
|
|
1058
|
+
const _ = p.worksheet.getMergedCell(r, o), T = {
|
|
1051
1059
|
data: e,
|
|
1052
1060
|
style: p.getStyles().getStyleByCell(e),
|
|
1053
1061
|
primaryWithCoord: p.getCellWithCoordByIndex((L = _ == null ? void 0 : _.startRow) != null ? L : r, (y = _ == null ? void 0 : _.startColumn) != null ? y : o),
|
|
@@ -1058,8 +1066,8 @@ let Qe = class extends cn {
|
|
|
1058
1066
|
workbook: l,
|
|
1059
1067
|
worksheet: s
|
|
1060
1068
|
};
|
|
1061
|
-
return (
|
|
1062
|
-
}, e.coverable = ((
|
|
1069
|
+
return (U = (O = c == null ? void 0 : c.canvasRender) == null ? void 0 : O.calcCellAutoWidth) == null ? void 0 : U.call(O, T);
|
|
1070
|
+
}, e.coverable = ((g = e == null ? void 0 : e.coverable) != null ? g : !0) && !(u.type === X.LIST || u.type === X.LIST_MULTIPLE), n(e);
|
|
1063
1071
|
}
|
|
1064
1072
|
}
|
|
1065
1073
|
)
|
|
@@ -1069,36 +1077,36 @@ let Qe = class extends cn {
|
|
|
1069
1077
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
|
1070
1078
|
// patched data-validation change don't need to re-calc row height
|
|
1071
1079
|
// re-calc of row height will be triggered precisely by the origin command
|
|
1072
|
-
|
|
1073
|
-
|
|
1080
|
+
Cn((e) => e.source === "command"),
|
|
1081
|
+
gr(100)
|
|
1074
1082
|
).subscribe((e) => {
|
|
1075
1083
|
if (e.length === 0)
|
|
1076
1084
|
return;
|
|
1077
1085
|
const t = [];
|
|
1078
1086
|
if (e.forEach((n) => {
|
|
1079
1087
|
var r;
|
|
1080
|
-
(n.rule.type ===
|
|
1088
|
+
(n.rule.type === X.LIST_MULTIPLE || n.rule.type === X.LIST) && (r = n.rule) != null && r.ranges && t.push(...n.rule.ranges);
|
|
1081
1089
|
}), t.length) {
|
|
1082
1090
|
const n = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
|
1083
|
-
|
|
1091
|
+
Zn(n.redos, this._commandService);
|
|
1084
1092
|
}
|
|
1085
1093
|
});
|
|
1086
1094
|
}
|
|
1087
1095
|
};
|
|
1088
|
-
|
|
1089
|
-
K(0,
|
|
1090
|
-
K(1,
|
|
1091
|
-
K(2,
|
|
1092
|
-
K(3,
|
|
1093
|
-
K(4,
|
|
1094
|
-
K(5,
|
|
1095
|
-
K(6,
|
|
1096
|
-
K(7,
|
|
1097
|
-
K(8,
|
|
1098
|
-
K(9,
|
|
1099
|
-
K(10,
|
|
1100
|
-
],
|
|
1101
|
-
let
|
|
1096
|
+
nt = Rr([
|
|
1097
|
+
K(0, oe),
|
|
1098
|
+
K(1, Io),
|
|
1099
|
+
K(2, xe),
|
|
1100
|
+
K(3, pe),
|
|
1101
|
+
K(4, E(fr)),
|
|
1102
|
+
K(5, E($e)),
|
|
1103
|
+
K(6, E(ae)),
|
|
1104
|
+
K(7, E(Te)),
|
|
1105
|
+
K(8, E(gn)),
|
|
1106
|
+
K(9, E(ar)),
|
|
1107
|
+
K(10, xr(mr))
|
|
1108
|
+
], nt);
|
|
1109
|
+
let $n = class extends pn {
|
|
1102
1110
|
constructor(e, t, n, r, o, i, a) {
|
|
1103
1111
|
super(), this._commandService = e, this._renderManagerService = t, this._autoHeightController = n, this._dataValidatorRegistryService = r, this._sheetInterceptorService = o, this._sheetDataValidationModel = i, this._dataValidationCacheService = a, this._initViewModelIntercept(), this._initAutoHeight();
|
|
1104
1112
|
}
|
|
@@ -1106,47 +1114,47 @@ let Nn = class extends cn {
|
|
|
1106
1114
|
_initViewModelIntercept() {
|
|
1107
1115
|
this.disposeWithMe(
|
|
1108
1116
|
this._sheetInterceptorService.intercept(
|
|
1109
|
-
|
|
1117
|
+
er.CELL_CONTENT,
|
|
1110
1118
|
{
|
|
1111
|
-
effect:
|
|
1119
|
+
effect: Xn.Style,
|
|
1112
1120
|
// must be after numfmt
|
|
1113
|
-
priority:
|
|
1121
|
+
priority: tr.DATA_VALIDATION,
|
|
1114
1122
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1115
1123
|
handler: (e, t, n) => {
|
|
1116
|
-
var
|
|
1124
|
+
var v, C, f, w, b;
|
|
1117
1125
|
const { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(i, a, r, o);
|
|
1118
1126
|
if (!d)
|
|
1119
1127
|
return n(e);
|
|
1120
1128
|
const u = this._sheetDataValidationModel.getRuleById(i, a, d);
|
|
1121
1129
|
if (!u)
|
|
1122
1130
|
return n(e);
|
|
1123
|
-
const
|
|
1131
|
+
const h = (v = this._dataValidationCacheService.getValue(i, a, r, o)) != null ? v : ze.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), m = s.getCellRaw(r, o), I = ie(m), D = `${I != null ? I : ""}`;
|
|
1124
1132
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
|
1125
1133
|
...e == null ? void 0 : e.markers,
|
|
1126
|
-
...
|
|
1134
|
+
...h === ze.INVALID ? yr : null
|
|
1127
1135
|
}, e.customRender = [
|
|
1128
|
-
...(
|
|
1136
|
+
...(C = e == null ? void 0 : e.customRender) != null ? C : [],
|
|
1129
1137
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
|
1130
1138
|
], e.fontRenderExtension = {
|
|
1131
1139
|
...e == null ? void 0 : e.fontRenderExtension,
|
|
1132
|
-
isSkip: ((
|
|
1140
|
+
isSkip: ((f = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : f.isSkip) || ((w = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : w.call(c, u, I, t))
|
|
1133
1141
|
}, e.interceptorStyle = {
|
|
1134
1142
|
...e == null ? void 0 : e.interceptorStyle,
|
|
1135
|
-
...c == null ? void 0 : c.getExtraStyle(u,
|
|
1143
|
+
...c == null ? void 0 : c.getExtraStyle(u, D, {
|
|
1136
1144
|
get style() {
|
|
1137
|
-
const
|
|
1138
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
|
1145
|
+
const g = l.getStyles();
|
|
1146
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? g.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
|
1139
1147
|
}
|
|
1140
1148
|
}, r, o)
|
|
1141
1149
|
}, e.interceptorAutoHeight = () => {
|
|
1142
|
-
var
|
|
1143
|
-
const
|
|
1144
|
-
if (!
|
|
1150
|
+
var T, A, P, L, y, O;
|
|
1151
|
+
const g = (A = (T = this._renderManagerService.getRenderById(i)) == null ? void 0 : T.with(ut).getSkeletonParam(a)) == null ? void 0 : A.skeleton;
|
|
1152
|
+
if (!g)
|
|
1145
1153
|
return;
|
|
1146
|
-
const p =
|
|
1154
|
+
const p = g.worksheet.getMergedCell(r, o), _ = {
|
|
1147
1155
|
data: e,
|
|
1148
|
-
style:
|
|
1149
|
-
primaryWithCoord:
|
|
1156
|
+
style: g.getStyles().getStyleByCell(e),
|
|
1157
|
+
primaryWithCoord: g.getCellWithCoordByIndex((P = p == null ? void 0 : p.startRow) != null ? P : r, (L = p == null ? void 0 : p.startColumn) != null ? L : o),
|
|
1150
1158
|
unitId: i,
|
|
1151
1159
|
subUnitId: a,
|
|
1152
1160
|
row: r,
|
|
@@ -1154,16 +1162,16 @@ let Nn = class extends cn {
|
|
|
1154
1162
|
workbook: l,
|
|
1155
1163
|
worksheet: s
|
|
1156
1164
|
};
|
|
1157
|
-
return (
|
|
1165
|
+
return (O = (y = c == null ? void 0 : c.canvasRender) == null ? void 0 : y.calcCellAutoHeight) == null ? void 0 : O.call(y, _);
|
|
1158
1166
|
}, e.interceptorAutoWidth = () => {
|
|
1159
|
-
var
|
|
1160
|
-
const
|
|
1161
|
-
if (!
|
|
1167
|
+
var T, A, P, L, y, O;
|
|
1168
|
+
const g = (A = (T = this._renderManagerService.getRenderById(i)) == null ? void 0 : T.with(ut).getSkeletonParam(a)) == null ? void 0 : A.skeleton;
|
|
1169
|
+
if (!g)
|
|
1162
1170
|
return;
|
|
1163
|
-
const p =
|
|
1171
|
+
const p = g.worksheet.getMergedCell(r, o), _ = {
|
|
1164
1172
|
data: e,
|
|
1165
|
-
style:
|
|
1166
|
-
primaryWithCoord:
|
|
1173
|
+
style: g.getStyles().getStyleByCell(e),
|
|
1174
|
+
primaryWithCoord: g.getCellWithCoordByIndex((P = p == null ? void 0 : p.startRow) != null ? P : r, (L = p == null ? void 0 : p.startColumn) != null ? L : o),
|
|
1167
1175
|
unitId: i,
|
|
1168
1176
|
subUnitId: a,
|
|
1169
1177
|
row: r,
|
|
@@ -1171,8 +1179,8 @@ let Nn = class extends cn {
|
|
|
1171
1179
|
workbook: l,
|
|
1172
1180
|
worksheet: s
|
|
1173
1181
|
};
|
|
1174
|
-
return (
|
|
1175
|
-
}, e.coverable = ((b = e == null ? void 0 : e.coverable) != null ? b : !0) && !(u.type ===
|
|
1182
|
+
return (O = (y = c == null ? void 0 : c.canvasRender) == null ? void 0 : y.calcCellAutoWidth) == null ? void 0 : O.call(y, _);
|
|
1183
|
+
}, e.coverable = ((b = e == null ? void 0 : e.coverable) != null ? b : !0) && !(u.type === X.LIST || u.type === X.LIST_MULTIPLE), n(e);
|
|
1176
1184
|
}
|
|
1177
1185
|
}
|
|
1178
1186
|
)
|
|
@@ -1180,35 +1188,35 @@ let Nn = class extends cn {
|
|
|
1180
1188
|
}
|
|
1181
1189
|
_initAutoHeight() {
|
|
1182
1190
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
|
1183
|
-
|
|
1184
|
-
|
|
1191
|
+
Cn((e) => e.source === "command"),
|
|
1192
|
+
gr(16)
|
|
1185
1193
|
).subscribe((e) => {
|
|
1186
1194
|
const t = [];
|
|
1187
1195
|
if (e.forEach((n) => {
|
|
1188
1196
|
var r;
|
|
1189
|
-
(n.rule.type ===
|
|
1197
|
+
(n.rule.type === X.LIST_MULTIPLE || n.rule.type === X.LIST) && (r = n.rule) != null && r.ranges && t.push(...n.rule.ranges);
|
|
1190
1198
|
}), t.length) {
|
|
1191
1199
|
const n = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
|
1192
|
-
|
|
1200
|
+
Zn(n.redos, this._commandService);
|
|
1193
1201
|
}
|
|
1194
1202
|
});
|
|
1195
1203
|
}
|
|
1196
1204
|
};
|
|
1197
|
-
|
|
1198
|
-
K(0,
|
|
1199
|
-
K(1,
|
|
1200
|
-
K(2,
|
|
1201
|
-
K(3,
|
|
1202
|
-
K(4,
|
|
1203
|
-
K(5,
|
|
1204
|
-
K(6,
|
|
1205
|
-
],
|
|
1206
|
-
var
|
|
1207
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
1205
|
+
$n = Rr([
|
|
1206
|
+
K(0, oe),
|
|
1207
|
+
K(1, xe),
|
|
1208
|
+
K(2, E(fr)),
|
|
1209
|
+
K(3, E(Te)),
|
|
1210
|
+
K(4, E(gn)),
|
|
1211
|
+
K(5, E(ae)),
|
|
1212
|
+
K(6, E(ar))
|
|
1213
|
+
], $n);
|
|
1214
|
+
var ni = Object.getOwnPropertyDescriptor, ri = (e, t, n, r) => {
|
|
1215
|
+
for (var o = r > 1 ? void 0 : r ? ni(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1208
1216
|
(a = e[i]) && (o = a(o) || o);
|
|
1209
1217
|
return o;
|
|
1210
|
-
},
|
|
1211
|
-
let
|
|
1218
|
+
}, xn = (e, t) => (n, r) => t(n, r, e);
|
|
1219
|
+
let Tt = class extends De {
|
|
1212
1220
|
constructor(e, t, n) {
|
|
1213
1221
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = n, this._initSkeletonChange();
|
|
1214
1222
|
}
|
|
@@ -1225,16 +1233,16 @@ let Et = class extends Re {
|
|
|
1225
1233
|
(i = this._sheetSkeletonManagerService.getSkeletonParam(o)) == null || i.skeleton.makeDirty(!0);
|
|
1226
1234
|
}), (r = this._context.mainComponent) == null || r.makeForceDirty();
|
|
1227
1235
|
};
|
|
1228
|
-
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(
|
|
1236
|
+
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(Br(16)).subscribe(e));
|
|
1229
1237
|
}
|
|
1230
1238
|
};
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
],
|
|
1235
|
-
function
|
|
1236
|
-
const { icon: n, id: r, className: o, extend: i, ...a } = t, l = `univerjs-icon univerjs-icon-${r} ${o || ""}`.trim(), s =
|
|
1237
|
-
return
|
|
1239
|
+
Tt = ri([
|
|
1240
|
+
xn(1, E(ae)),
|
|
1241
|
+
xn(2, E(ut))
|
|
1242
|
+
], Tt);
|
|
1243
|
+
function We({ ref: e, ...t }) {
|
|
1244
|
+
const { icon: n, id: r, className: o, extend: i, ...a } = t, l = `univerjs-icon univerjs-icon-${r} ${o || ""}`.trim(), s = vt(`_${ai()}`);
|
|
1245
|
+
return Mr(n, `${r}`, {
|
|
1238
1246
|
defIds: n.defIds,
|
|
1239
1247
|
idSuffix: s.current
|
|
1240
1248
|
}, {
|
|
@@ -1243,14 +1251,14 @@ function $e({ ref: e, ...t }) {
|
|
|
1243
1251
|
...a
|
|
1244
1252
|
}, i);
|
|
1245
1253
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1254
|
+
function Mr(e, t, n, r, o) {
|
|
1255
|
+
return ye(e.tag, {
|
|
1248
1256
|
key: t,
|
|
1249
|
-
...
|
|
1257
|
+
...oi(e, n, o),
|
|
1250
1258
|
...r
|
|
1251
|
-
}, (
|
|
1259
|
+
}, (ii(e, n).children || []).map((i, a) => Mr(i, `${t}-${e.tag}-${a}`, n, void 0, o)));
|
|
1252
1260
|
}
|
|
1253
|
-
function
|
|
1261
|
+
function oi(e, t, n) {
|
|
1254
1262
|
const r = { ...e.attrs };
|
|
1255
1263
|
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), e.tag === "mask" && r.id && (r.id = r.id + t.idSuffix), Object.entries(r).forEach(([i, a]) => {
|
|
1256
1264
|
i === "mask" && typeof a == "string" && (r[i] = a.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
@@ -1260,7 +1268,7 @@ function ei(e, t, n) {
|
|
|
1260
1268
|
typeof a == "string" && (r[i] = a.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
1261
1269
|
})), r;
|
|
1262
1270
|
}
|
|
1263
|
-
function
|
|
1271
|
+
function ii(e, t) {
|
|
1264
1272
|
var r;
|
|
1265
1273
|
const { defIds: n } = t;
|
|
1266
1274
|
return !n || n.length === 0 ? e : e.tag === "defs" && ((r = e.children) != null && r.length) ? {
|
|
@@ -1274,11 +1282,11 @@ function ti(e, t) {
|
|
|
1274
1282
|
} : o)
|
|
1275
1283
|
} : e;
|
|
1276
1284
|
}
|
|
1277
|
-
function
|
|
1285
|
+
function ai() {
|
|
1278
1286
|
return Math.random().toString(36).substring(2, 8);
|
|
1279
1287
|
}
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1288
|
+
We.displayName = "UniverIcon";
|
|
1289
|
+
const si = {
|
|
1282
1290
|
tag: "svg",
|
|
1283
1291
|
attrs: {
|
|
1284
1292
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1321,15 +1329,15 @@ const ri = {
|
|
|
1321
1329
|
}
|
|
1322
1330
|
}
|
|
1323
1331
|
]
|
|
1324
|
-
},
|
|
1325
|
-
return
|
|
1332
|
+
}, br = it(function(t, n) {
|
|
1333
|
+
return ye(We, Object.assign({}, t, {
|
|
1326
1334
|
id: "data-validation-icon",
|
|
1327
1335
|
ref: n,
|
|
1328
|
-
icon:
|
|
1336
|
+
icon: si
|
|
1329
1337
|
}));
|
|
1330
1338
|
});
|
|
1331
|
-
|
|
1332
|
-
const
|
|
1339
|
+
br.displayName = "DataValidationIcon";
|
|
1340
|
+
const li = {
|
|
1333
1341
|
tag: "svg",
|
|
1334
1342
|
attrs: {
|
|
1335
1343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1370,15 +1378,15 @@ const oi = {
|
|
|
1370
1378
|
}
|
|
1371
1379
|
}
|
|
1372
1380
|
]
|
|
1373
|
-
},
|
|
1374
|
-
return
|
|
1381
|
+
}, Rn = it(function(t, n) {
|
|
1382
|
+
return ye(We, Object.assign({}, t, {
|
|
1375
1383
|
id: "delete-icon",
|
|
1376
1384
|
ref: n,
|
|
1377
|
-
icon:
|
|
1385
|
+
icon: li
|
|
1378
1386
|
}));
|
|
1379
1387
|
});
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1388
|
+
Rn.displayName = "DeleteIcon";
|
|
1389
|
+
const di = {
|
|
1382
1390
|
tag: "svg",
|
|
1383
1391
|
attrs: {
|
|
1384
1392
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1394,15 +1402,15 @@ const ii = {
|
|
|
1394
1402
|
d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"
|
|
1395
1403
|
}
|
|
1396
1404
|
}]
|
|
1397
|
-
},
|
|
1398
|
-
return
|
|
1405
|
+
}, Er = it(function(t, n) {
|
|
1406
|
+
return ye(We, Object.assign({}, t, {
|
|
1399
1407
|
id: "increase-icon",
|
|
1400
1408
|
ref: n,
|
|
1401
|
-
icon:
|
|
1409
|
+
icon: di
|
|
1402
1410
|
}));
|
|
1403
1411
|
});
|
|
1404
|
-
|
|
1405
|
-
const
|
|
1412
|
+
Er.displayName = "IncreaseIcon";
|
|
1413
|
+
const ci = {
|
|
1406
1414
|
tag: "svg",
|
|
1407
1415
|
attrs: {
|
|
1408
1416
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1420,15 +1428,15 @@ const ai = {
|
|
|
1420
1428
|
clipRule: "evenodd"
|
|
1421
1429
|
}
|
|
1422
1430
|
}]
|
|
1423
|
-
},
|
|
1424
|
-
return
|
|
1431
|
+
}, yn = it(function(t, n) {
|
|
1432
|
+
return ye(We, Object.assign({}, t, {
|
|
1425
1433
|
id: "more-down-icon",
|
|
1426
1434
|
ref: n,
|
|
1427
|
-
icon:
|
|
1435
|
+
icon: ci
|
|
1428
1436
|
}));
|
|
1429
1437
|
});
|
|
1430
|
-
|
|
1431
|
-
const
|
|
1438
|
+
yn.displayName = "MoreDownIcon";
|
|
1439
|
+
const ui = {
|
|
1432
1440
|
tag: "svg",
|
|
1433
1441
|
attrs: {
|
|
1434
1442
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1446,15 +1454,15 @@ const si = {
|
|
|
1446
1454
|
clipRule: "evenodd"
|
|
1447
1455
|
}
|
|
1448
1456
|
}]
|
|
1449
|
-
},
|
|
1450
|
-
return
|
|
1457
|
+
}, Dr = it(function(t, n) {
|
|
1458
|
+
return ye(We, Object.assign({}, t, {
|
|
1451
1459
|
id: "more-up-icon",
|
|
1452
1460
|
ref: n,
|
|
1453
|
-
icon:
|
|
1461
|
+
icon: ui
|
|
1454
1462
|
}));
|
|
1455
1463
|
});
|
|
1456
|
-
|
|
1457
|
-
const
|
|
1464
|
+
Dr.displayName = "MoreUpIcon";
|
|
1465
|
+
const hi = {
|
|
1458
1466
|
tag: "svg",
|
|
1459
1467
|
attrs: {
|
|
1460
1468
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1507,54 +1515,54 @@ const li = {
|
|
|
1507
1515
|
}
|
|
1508
1516
|
}
|
|
1509
1517
|
]
|
|
1510
|
-
},
|
|
1511
|
-
return
|
|
1518
|
+
}, Vr = it(function(t, n) {
|
|
1519
|
+
return ye(We, Object.assign({}, t, {
|
|
1512
1520
|
id: "sequence-icon",
|
|
1513
1521
|
ref: n,
|
|
1514
|
-
icon:
|
|
1522
|
+
icon: hi
|
|
1515
1523
|
}));
|
|
1516
1524
|
});
|
|
1517
|
-
|
|
1518
|
-
function
|
|
1525
|
+
Vr.displayName = "SequenceIcon";
|
|
1526
|
+
function pi(e) {
|
|
1519
1527
|
var d;
|
|
1520
|
-
const t = F(
|
|
1521
|
-
return /* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1528
|
+
const t = F(ge), n = F(Sn), { value: r, onChange: o, extraComponent: i } = e, [a, l] = W(!1), s = i ? n.get(i) : null;
|
|
1529
|
+
return /* @__PURE__ */ Y(pt, { children: [
|
|
1530
|
+
/* @__PURE__ */ Y(
|
|
1523
1531
|
"div",
|
|
1524
1532
|
{
|
|
1525
1533
|
className: "univer-mb-3 univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1526
1534
|
onClick: () => l(!a),
|
|
1527
1535
|
children: [
|
|
1528
1536
|
t.t("dataValidation.panel.options"),
|
|
1529
|
-
a ? /* @__PURE__ */
|
|
1537
|
+
a ? /* @__PURE__ */ S(Dr, { className: "univer-ml-1" }) : /* @__PURE__ */ S(yn, { className: "univer-ml-1" })
|
|
1530
1538
|
]
|
|
1531
1539
|
}
|
|
1532
1540
|
),
|
|
1533
|
-
a && /* @__PURE__ */
|
|
1534
|
-
s ? /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
|
|
1541
|
+
a && /* @__PURE__ */ Y(pt, { children: [
|
|
1542
|
+
s ? /* @__PURE__ */ S(s, { value: r, onChange: o }) : null,
|
|
1543
|
+
/* @__PURE__ */ S(
|
|
1544
|
+
Z,
|
|
1537
1545
|
{
|
|
1538
1546
|
label: t.t("dataValidation.panel.invalid"),
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1540
|
-
|
|
1547
|
+
children: /* @__PURE__ */ Y(
|
|
1548
|
+
In,
|
|
1541
1549
|
{
|
|
1542
|
-
value: `${(d = r.errorStyle) != null ? d :
|
|
1550
|
+
value: `${(d = r.errorStyle) != null ? d : ct.WARNING}`,
|
|
1543
1551
|
onChange: (u) => o({ ...r, errorStyle: +u }),
|
|
1544
1552
|
children: [
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ S(Ne, { value: `${ct.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
|
1554
|
+
/* @__PURE__ */ S(Ne, { value: `${ct.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
|
|
1547
1555
|
]
|
|
1548
1556
|
}
|
|
1549
1557
|
)
|
|
1550
1558
|
}
|
|
1551
1559
|
),
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
|
|
1560
|
+
/* @__PURE__ */ S(
|
|
1561
|
+
Z,
|
|
1554
1562
|
{
|
|
1555
1563
|
label: t.t("dataValidation.panel.messageInfo"),
|
|
1556
|
-
children: /* @__PURE__ */
|
|
1557
|
-
|
|
1564
|
+
children: /* @__PURE__ */ S(
|
|
1565
|
+
Nt,
|
|
1558
1566
|
{
|
|
1559
1567
|
checked: r.showErrorMessage,
|
|
1560
1568
|
onChange: () => o({
|
|
@@ -1566,259 +1574,272 @@ function di(e) {
|
|
|
1566
1574
|
)
|
|
1567
1575
|
}
|
|
1568
1576
|
),
|
|
1569
|
-
r.showErrorMessage ? /* @__PURE__ */
|
|
1577
|
+
r.showErrorMessage ? /* @__PURE__ */ S(Z, { children: /* @__PURE__ */ S(Ue, { value: r.error, onChange: (u) => o({ ...r, error: u }) }) }) : null
|
|
1570
1578
|
] })
|
|
1571
1579
|
] });
|
|
1572
1580
|
}
|
|
1573
|
-
const
|
|
1581
|
+
const gi = (e) => Wr(
|
|
1574
1582
|
async (t, n, r, o) => {
|
|
1575
1583
|
const i = await e.executeCommand(t, n, r);
|
|
1576
1584
|
o == null || o(i);
|
|
1577
1585
|
},
|
|
1578
1586
|
1e3
|
|
1579
1587
|
);
|
|
1580
|
-
function
|
|
1588
|
+
function vi(e, t, n) {
|
|
1581
1589
|
var r, o, i, a;
|
|
1582
|
-
return t ? ((o = (r = e.getUnit(t)) == null ? void 0 : r.getSheetBySheetName(n)) == null ? void 0 : o.getSheetId()) || "" : ((a = (i = e.getCurrentUnitForType(
|
|
1590
|
+
return t ? ((o = (r = e.getUnit(t)) == null ? void 0 : r.getSheetBySheetName(n)) == null ? void 0 : o.getSheetId()) || "" : ((a = (i = e.getCurrentUnitForType(H.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(n)) == null ? void 0 : a.getSheetId()) || "";
|
|
1583
1591
|
}
|
|
1584
|
-
function
|
|
1585
|
-
var
|
|
1586
|
-
const [e, t] = W(0), n = F(
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1592
|
+
function mi() {
|
|
1593
|
+
var N, J;
|
|
1594
|
+
const [e, t] = W(0), n = F(_e), r = Re(n.activeRule$, n.activeRule), { unitId: o, subUnitId: i, rule: a } = r || {}, l = a.uid, s = F(Te), d = F(pe), u = F(Sn), h = F(oe), c = F(fn), m = F(ge), I = Re(
|
|
1595
|
+
() => d.getCurrentTypeOfUnit$(H.UNIVER_SHEET),
|
|
1596
|
+
void 0,
|
|
1597
|
+
void 0,
|
|
1598
|
+
[]
|
|
1599
|
+
), D = Re(() => {
|
|
1600
|
+
var R;
|
|
1601
|
+
return (R = I == null ? void 0 : I.activeSheet$) != null ? R : vr(null);
|
|
1602
|
+
}, void 0, void 0, []), [v, C] = W(a), f = s.getValidatorItem(v.type), [w, b] = W(!1), g = s.getValidatorsByScope(mo.SHEET), [p, _] = W(() => v.ranges.map((R) => ({ unitId: "", sheetId: "", range: R }))), T = ht(() => gi(h), [h]), [A, P] = W(!1), [L, y] = W(!1), O = vt(null), U = F(Jn);
|
|
1603
|
+
if (be(() => () => {
|
|
1604
|
+
const R = U.getCurrentLastSelection();
|
|
1605
|
+
R && U.setSelections([R]);
|
|
1606
|
+
}, [U]), be(() => {
|
|
1607
|
+
h.onCommandExecuted((R) => {
|
|
1608
|
+
(R.id === Hr.id || R.id === jr.id) && setTimeout(() => {
|
|
1609
|
+
const B = c.getRuleById(o, i, l);
|
|
1610
|
+
t((z) => z + 1), B && (C(B), _(B.ranges.map((z) => ({ unitId: "", sheetId: "", range: z }))));
|
|
1595
1611
|
}, 20);
|
|
1596
1612
|
});
|
|
1597
|
-
}, [
|
|
1613
|
+
}, [h, c, l, i, o]), !f)
|
|
1598
1614
|
return null;
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1615
|
+
const k = f.operators, x = f.operatorNames, te = v.operator ? fo.includes(v.operator) : !1, j = () => {
|
|
1616
|
+
(D == null ? void 0 : D.getSheetId()) !== i && h.syncExecuteCommand(ro.id, {
|
|
1617
|
+
unitId: o,
|
|
1618
|
+
subUnitId: i
|
|
1619
|
+
});
|
|
1620
|
+
}, se = () => {
|
|
1621
|
+
var R, B, z;
|
|
1622
|
+
(B = (R = O.current) == null ? void 0 : R.editor) != null && B.isFocus() && le((z = O.current) == null ? void 0 : z.getValue()), !(!v.ranges.length || A) && (f.validatorFormula(v, o, i).success ? n.setActiveRule(null) : b(!0), j());
|
|
1623
|
+
}, le = an((R) => {
|
|
1624
|
+
const B = R.split(",").filter(Boolean).map(Lo).map((ne) => {
|
|
1625
|
+
const Mn = ne.sheetName;
|
|
1626
|
+
if (Mn) {
|
|
1627
|
+
const Pr = vi(d, ne.unitId, Mn);
|
|
1628
|
+
return { ...ne, sheetId: Pr };
|
|
1608
1629
|
}
|
|
1609
1630
|
return {
|
|
1610
|
-
...
|
|
1631
|
+
...ne,
|
|
1611
1632
|
sheetId: ""
|
|
1612
1633
|
};
|
|
1613
1634
|
});
|
|
1614
|
-
if (
|
|
1635
|
+
if (Yr(B, p))
|
|
1615
1636
|
return;
|
|
1616
|
-
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1619
|
-
...
|
|
1620
|
-
ranges:
|
|
1621
|
-
}),
|
|
1637
|
+
_(B);
|
|
1638
|
+
const z = B.filter((ne) => (!ne.unitId || ne.unitId === o) && (!ne.sheetId || ne.sheetId === i)).map((ne) => ne.range);
|
|
1639
|
+
if (C({
|
|
1640
|
+
...v,
|
|
1641
|
+
ranges: z
|
|
1642
|
+
}), z.length === 0)
|
|
1622
1643
|
return;
|
|
1623
|
-
const
|
|
1644
|
+
const Ie = {
|
|
1624
1645
|
unitId: o,
|
|
1625
1646
|
subUnitId: i,
|
|
1626
1647
|
ruleId: l,
|
|
1627
|
-
ranges:
|
|
1648
|
+
ranges: z
|
|
1628
1649
|
};
|
|
1629
|
-
|
|
1630
|
-
}),
|
|
1631
|
-
if (
|
|
1650
|
+
T(ir.id, Ie);
|
|
1651
|
+
}), de = (R) => {
|
|
1652
|
+
if (bn(R, Pn(v)))
|
|
1632
1653
|
return;
|
|
1633
|
-
|
|
1634
|
-
...
|
|
1635
|
-
...
|
|
1654
|
+
C({
|
|
1655
|
+
...v,
|
|
1656
|
+
...R
|
|
1636
1657
|
});
|
|
1637
|
-
const
|
|
1658
|
+
const B = {
|
|
1638
1659
|
unitId: o,
|
|
1639
1660
|
subUnitId: i,
|
|
1640
1661
|
ruleId: l,
|
|
1641
|
-
setting:
|
|
1662
|
+
setting: R
|
|
1642
1663
|
};
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1664
|
+
T(
|
|
1665
|
+
Tn.id,
|
|
1666
|
+
B,
|
|
1646
1667
|
void 0
|
|
1647
1668
|
);
|
|
1648
|
-
},
|
|
1649
|
-
await
|
|
1669
|
+
}, Me = async () => {
|
|
1670
|
+
await h.executeCommand(sr.id, {
|
|
1650
1671
|
ruleId: l,
|
|
1651
1672
|
unitId: o,
|
|
1652
1673
|
subUnitId: i
|
|
1653
|
-
}), n.setActiveRule(null);
|
|
1654
|
-
},
|
|
1655
|
-
type:
|
|
1656
|
-
operator:
|
|
1657
|
-
formula1:
|
|
1658
|
-
formula2:
|
|
1659
|
-
allowBlank:
|
|
1660
|
-
},
|
|
1661
|
-
const
|
|
1662
|
-
if (!
|
|
1674
|
+
}), n.setActiveRule(null), j();
|
|
1675
|
+
}, Q = {
|
|
1676
|
+
type: v.type,
|
|
1677
|
+
operator: v.operator,
|
|
1678
|
+
formula1: v.formula1,
|
|
1679
|
+
formula2: v.formula2,
|
|
1680
|
+
allowBlank: v.allowBlank
|
|
1681
|
+
}, G = (R) => {
|
|
1682
|
+
const B = s.getValidatorItem(R);
|
|
1683
|
+
if (!B)
|
|
1663
1684
|
return;
|
|
1664
|
-
const
|
|
1665
|
-
...
|
|
1666
|
-
type:
|
|
1685
|
+
const z = B.operators, Ie = c.getRuleById(o, i, l), ne = R === (Ie == null ? void 0 : Ie.type) || R.includes("list") && (Ie != null && Ie.type.includes("list")) ? {
|
|
1686
|
+
...Ie,
|
|
1687
|
+
type: R
|
|
1667
1688
|
} : {
|
|
1668
|
-
...
|
|
1669
|
-
type:
|
|
1670
|
-
operator:
|
|
1689
|
+
...v,
|
|
1690
|
+
type: R,
|
|
1691
|
+
operator: z[0],
|
|
1671
1692
|
formula1: void 0,
|
|
1672
1693
|
formula2: void 0
|
|
1673
1694
|
};
|
|
1674
|
-
|
|
1695
|
+
C(ne), h.executeCommand(Tn.id, {
|
|
1675
1696
|
unitId: o,
|
|
1676
1697
|
subUnitId: i,
|
|
1677
|
-
ruleId:
|
|
1678
|
-
setting:
|
|
1698
|
+
ruleId: v.uid,
|
|
1699
|
+
setting: Pn(ne)
|
|
1679
1700
|
});
|
|
1680
|
-
},
|
|
1681
|
-
|
|
1682
|
-
...
|
|
1683
|
-
...
|
|
1684
|
-
}),
|
|
1685
|
-
|
|
1701
|
+
}, ce = u.get(f.formulaInput), ee = ht(() => p.map((R) => _r(R.range)).join(","), []), q = An(v), M = (R) => {
|
|
1702
|
+
bn(R, An(v)) || (C({
|
|
1703
|
+
...v,
|
|
1704
|
+
...R
|
|
1705
|
+
}), T(
|
|
1706
|
+
ao.id,
|
|
1686
1707
|
{
|
|
1687
1708
|
unitId: o,
|
|
1688
1709
|
subUnitId: i,
|
|
1689
1710
|
ruleId: l,
|
|
1690
|
-
options:
|
|
1711
|
+
options: R
|
|
1691
1712
|
}
|
|
1692
1713
|
));
|
|
1693
|
-
},
|
|
1694
|
-
return /* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
|
|
1714
|
+
}, $ = k.length && !v.operator;
|
|
1715
|
+
return /* @__PURE__ */ Y("div", { "data-u-comp": "data-validation-detail", className: "univer-py-2", children: [
|
|
1716
|
+
/* @__PURE__ */ S(
|
|
1717
|
+
Z,
|
|
1697
1718
|
{
|
|
1698
1719
|
label: m.t("dataValidation.panel.range"),
|
|
1699
|
-
error: !
|
|
1700
|
-
children: /* @__PURE__ */
|
|
1701
|
-
|
|
1720
|
+
error: !v.ranges.length || A ? m.t("dataValidation.panel.rangeError") : "",
|
|
1721
|
+
children: /* @__PURE__ */ S(
|
|
1722
|
+
ko,
|
|
1702
1723
|
{
|
|
1703
|
-
selectorRef:
|
|
1724
|
+
selectorRef: O,
|
|
1704
1725
|
unitId: o,
|
|
1705
1726
|
subUnitId: i,
|
|
1706
|
-
initialValue:
|
|
1707
|
-
onChange: (
|
|
1708
|
-
var
|
|
1709
|
-
!
|
|
1727
|
+
initialValue: ee,
|
|
1728
|
+
onChange: (R, B) => {
|
|
1729
|
+
var z;
|
|
1730
|
+
!L && ((z = O.current) != null && z.verify()) && le(B);
|
|
1710
1731
|
},
|
|
1711
|
-
onFocusChange: (
|
|
1712
|
-
var
|
|
1713
|
-
|
|
1732
|
+
onFocusChange: (R, B) => {
|
|
1733
|
+
var z;
|
|
1734
|
+
y(R), !R && B && ((z = O.current) != null && z.verify()) && le(B);
|
|
1714
1735
|
},
|
|
1715
|
-
onVerify: (
|
|
1736
|
+
onVerify: (R) => P(!R)
|
|
1716
1737
|
}
|
|
1717
1738
|
)
|
|
1718
1739
|
}
|
|
1719
1740
|
),
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
|
|
1741
|
+
/* @__PURE__ */ S(Z, { label: m.t("dataValidation.panel.type"), children: /* @__PURE__ */ S(
|
|
1742
|
+
Un,
|
|
1722
1743
|
{
|
|
1723
1744
|
className: "univer-w-full",
|
|
1724
|
-
value:
|
|
1725
|
-
options: (
|
|
1726
|
-
label: m.t(
|
|
1727
|
-
value:
|
|
1745
|
+
value: v.type,
|
|
1746
|
+
options: (N = g == null ? void 0 : g.sort((R, B) => R.order - B.order)) == null ? void 0 : N.map((R) => ({
|
|
1747
|
+
label: m.t(R.title),
|
|
1748
|
+
value: R.id
|
|
1728
1749
|
})),
|
|
1729
|
-
onChange:
|
|
1750
|
+
onChange: G
|
|
1730
1751
|
}
|
|
1731
1752
|
) }),
|
|
1732
|
-
|
|
1733
|
-
|
|
1753
|
+
k != null && k.length ? /* @__PURE__ */ S(Z, { label: m.t("dataValidation.panel.operator"), children: /* @__PURE__ */ S(
|
|
1754
|
+
Un,
|
|
1734
1755
|
{
|
|
1735
1756
|
className: "univer-w-full",
|
|
1736
|
-
value: `${
|
|
1757
|
+
value: `${v.operator}`,
|
|
1737
1758
|
options: [
|
|
1738
1759
|
{
|
|
1739
1760
|
value: "",
|
|
1740
1761
|
label: m.t("dataValidation.operators.legal")
|
|
1741
1762
|
},
|
|
1742
|
-
...
|
|
1743
|
-
value: `${
|
|
1744
|
-
label:
|
|
1763
|
+
...k.map((R, B) => ({
|
|
1764
|
+
value: `${R}`,
|
|
1765
|
+
label: x[B]
|
|
1745
1766
|
}))
|
|
1746
1767
|
],
|
|
1747
|
-
onChange: (
|
|
1748
|
-
|
|
1749
|
-
...
|
|
1750
|
-
operator:
|
|
1768
|
+
onChange: (R) => {
|
|
1769
|
+
de({
|
|
1770
|
+
...Q,
|
|
1771
|
+
operator: R
|
|
1751
1772
|
});
|
|
1752
1773
|
}
|
|
1753
1774
|
}
|
|
1754
1775
|
) }) : null,
|
|
1755
|
-
|
|
1756
|
-
|
|
1776
|
+
ce && !$ ? /* @__PURE__ */ S(
|
|
1777
|
+
ce,
|
|
1757
1778
|
{
|
|
1758
|
-
isTwoFormula:
|
|
1779
|
+
isTwoFormula: te,
|
|
1759
1780
|
value: {
|
|
1760
|
-
formula1:
|
|
1761
|
-
formula2:
|
|
1781
|
+
formula1: v.formula1,
|
|
1782
|
+
formula2: v.formula2
|
|
1762
1783
|
},
|
|
1763
|
-
onChange: (
|
|
1764
|
-
|
|
1765
|
-
...
|
|
1766
|
-
...
|
|
1784
|
+
onChange: (R) => {
|
|
1785
|
+
de({
|
|
1786
|
+
...Q,
|
|
1787
|
+
...R
|
|
1767
1788
|
});
|
|
1768
1789
|
},
|
|
1769
1790
|
showError: w,
|
|
1770
|
-
validResult:
|
|
1791
|
+
validResult: f.validatorFormula(v, o, i),
|
|
1771
1792
|
unitId: o,
|
|
1772
1793
|
subUnitId: i,
|
|
1773
1794
|
ruleId: l
|
|
1774
1795
|
},
|
|
1775
|
-
e +
|
|
1796
|
+
e + v.type
|
|
1776
1797
|
) : null,
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
|
|
1798
|
+
/* @__PURE__ */ S(Z, { children: /* @__PURE__ */ S(
|
|
1799
|
+
Nt,
|
|
1779
1800
|
{
|
|
1780
|
-
checked: (
|
|
1801
|
+
checked: (J = v.allowBlank) != null ? J : !0,
|
|
1781
1802
|
onChange: () => {
|
|
1782
|
-
var
|
|
1783
|
-
return
|
|
1784
|
-
...
|
|
1785
|
-
allowBlank: !((
|
|
1803
|
+
var R;
|
|
1804
|
+
return de({
|
|
1805
|
+
...Q,
|
|
1806
|
+
allowBlank: !((R = v.allowBlank) == null || R)
|
|
1786
1807
|
});
|
|
1787
1808
|
},
|
|
1788
1809
|
children: m.t("dataValidation.panel.allowBlank")
|
|
1789
1810
|
}
|
|
1790
1811
|
) }),
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ S(pi, { value: q, onChange: M, extraComponent: f.optionsInput }),
|
|
1813
|
+
/* @__PURE__ */ Y("div", { className: "univer-mt-5 univer-flex univer-flex-row univer-justify-end", children: [
|
|
1814
|
+
/* @__PURE__ */ S(qe, { className: "univer-ml-3", onClick: Me, children: m.t("dataValidation.panel.removeRule") }),
|
|
1815
|
+
/* @__PURE__ */ S(qe, { className: "univer-ml-3", variant: "primary", onClick: se, children: m.t("dataValidation.panel.done") })
|
|
1795
1816
|
] })
|
|
1796
1817
|
] });
|
|
1797
1818
|
}
|
|
1798
|
-
const
|
|
1799
|
-
const { rule: t, onClick: n, unitId: r, subUnitId: o, disable: i } = e, a = F(
|
|
1800
|
-
var
|
|
1801
|
-
const
|
|
1819
|
+
const fi = (e) => {
|
|
1820
|
+
const { rule: t, onClick: n, unitId: r, subUnitId: o, disable: i } = e, a = F(Te), l = F(oe), s = F(Oo), d = a.getValidatorItem(t.type), u = vt(void 0), [h, c] = W(!1), m = F(zn), I = Re(m.currentTheme$), D = ht(() => {
|
|
1821
|
+
var g;
|
|
1822
|
+
const C = m.getColorFromTheme("primary.600"), f = m.getColorFromTheme("loop-color.2"), w = (g = m.getColorFromTheme(f)) != null ? g : C, b = new Xr(w).toRgb();
|
|
1802
1823
|
return {
|
|
1803
1824
|
fill: `rgba(${b.r}, ${b.g}, ${b.b}, 0.1)`,
|
|
1804
|
-
stroke:
|
|
1825
|
+
stroke: w
|
|
1805
1826
|
};
|
|
1806
|
-
}, [
|
|
1807
|
-
l.executeCommand(
|
|
1827
|
+
}, [I]), v = (C) => {
|
|
1828
|
+
l.executeCommand(sr.id, {
|
|
1808
1829
|
ruleId: t.uid,
|
|
1809
1830
|
unitId: r,
|
|
1810
1831
|
subUnitId: o
|
|
1811
|
-
}),
|
|
1832
|
+
}), C.stopPropagation();
|
|
1812
1833
|
};
|
|
1813
|
-
return
|
|
1814
|
-
var
|
|
1815
|
-
u.current && ((
|
|
1816
|
-
|
|
1834
|
+
return be(() => () => {
|
|
1835
|
+
var C;
|
|
1836
|
+
u.current && ((C = u.current) == null || C.forEach((f) => {
|
|
1837
|
+
f && s.removeShape(f);
|
|
1817
1838
|
}));
|
|
1818
|
-
}, [s]), /* @__PURE__ */
|
|
1839
|
+
}, [s]), /* @__PURE__ */ Y(
|
|
1819
1840
|
"div",
|
|
1820
1841
|
{
|
|
1821
|
-
className:
|
|
1842
|
+
className: Fe(
|
|
1822
1843
|
`
|
|
1823
1844
|
univer-bg-secondary univer-relative univer--mx-2 univer-box-border univer-flex univer-w-[287px]
|
|
1824
1845
|
univer-cursor-pointer univer-flex-col univer-justify-between univer-overflow-hidden univer-rounded-md
|
|
@@ -1831,119 +1852,119 @@ const pi = (e) => {
|
|
|
1831
1852
|
),
|
|
1832
1853
|
onClick: n,
|
|
1833
1854
|
onMouseEnter: () => {
|
|
1834
|
-
i || (c(!0), u.current = t.ranges.map((
|
|
1835
|
-
range:
|
|
1836
|
-
style:
|
|
1855
|
+
i || (c(!0), u.current = t.ranges.map((C) => s.addShape({
|
|
1856
|
+
range: C,
|
|
1857
|
+
style: D,
|
|
1837
1858
|
primary: null
|
|
1838
1859
|
})));
|
|
1839
1860
|
},
|
|
1840
1861
|
onMouseLeave: () => {
|
|
1841
|
-
var
|
|
1842
|
-
c(!1), (
|
|
1843
|
-
|
|
1862
|
+
var C;
|
|
1863
|
+
c(!1), (C = u.current) == null || C.forEach((f) => {
|
|
1864
|
+
f && s.removeShape(f);
|
|
1844
1865
|
}), u.current = void 0;
|
|
1845
1866
|
},
|
|
1846
1867
|
children: [
|
|
1847
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ S(
|
|
1848
1869
|
"div",
|
|
1849
1870
|
{
|
|
1850
1871
|
className: "univer-truncate univer-text-sm univer-font-medium univer-leading-[22px] univer-text-gray-900 dark:!univer-text-white",
|
|
1851
1872
|
children: d == null ? void 0 : d.generateRuleName(t)
|
|
1852
1873
|
}
|
|
1853
1874
|
),
|
|
1854
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ S(
|
|
1855
1876
|
"div",
|
|
1856
1877
|
{
|
|
1857
1878
|
className: "univer-text-secondary univer-truncate univer-text-xs univer-leading-[18px] dark:!univer-text-gray-300",
|
|
1858
|
-
children: t.ranges.map((
|
|
1879
|
+
children: t.ranges.map((C) => _r(C)).join(",")
|
|
1859
1880
|
}
|
|
1860
1881
|
),
|
|
1861
|
-
|
|
1882
|
+
h ? /* @__PURE__ */ S(
|
|
1862
1883
|
"div",
|
|
1863
1884
|
{
|
|
1864
1885
|
className: "univer-absolute univer-right-2 univer-top-[19px] univer-flex univer-size-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",
|
|
1865
|
-
onClick:
|
|
1866
|
-
children: /* @__PURE__ */
|
|
1886
|
+
onClick: v,
|
|
1887
|
+
children: /* @__PURE__ */ S(Rn, {})
|
|
1867
1888
|
}
|
|
1868
1889
|
) : null
|
|
1869
1890
|
]
|
|
1870
1891
|
}
|
|
1871
1892
|
);
|
|
1872
1893
|
};
|
|
1873
|
-
function
|
|
1874
|
-
const t = F(
|
|
1875
|
-
|
|
1876
|
-
s(t.getRules(
|
|
1877
|
-
const
|
|
1878
|
-
|
|
1894
|
+
function _i(e) {
|
|
1895
|
+
const t = F(ae), n = F(pe), r = F(oe), o = F(Ve), i = F(_e), a = F(ge), [l, s] = W([]), { workbook: d } = e, u = Re(d.activeSheet$, void 0, !0), h = d.getUnitId(), c = u == null ? void 0 : u.getSheetId();
|
|
1896
|
+
be(() => {
|
|
1897
|
+
s(t.getRules(h, c));
|
|
1898
|
+
const f = t.ruleChange$.subscribe((w) => {
|
|
1899
|
+
w.unitId === h && w.subUnitId === c && s(t.getRules(h, c));
|
|
1879
1900
|
});
|
|
1880
1901
|
return () => {
|
|
1881
|
-
|
|
1902
|
+
f.unsubscribe();
|
|
1882
1903
|
};
|
|
1883
|
-
}, [
|
|
1904
|
+
}, [h, c, t]);
|
|
1884
1905
|
const m = async () => {
|
|
1885
|
-
const
|
|
1886
|
-
unitId:
|
|
1906
|
+
const f = rr(o), w = {
|
|
1907
|
+
unitId: h,
|
|
1887
1908
|
subUnitId: c,
|
|
1888
|
-
rule:
|
|
1909
|
+
rule: f
|
|
1889
1910
|
};
|
|
1890
|
-
await r.executeCommand(
|
|
1891
|
-
unitId:
|
|
1911
|
+
await r.executeCommand(vn.id, w), i.setActiveRule({
|
|
1912
|
+
unitId: h,
|
|
1892
1913
|
subUnitId: c,
|
|
1893
|
-
rule:
|
|
1914
|
+
rule: f
|
|
1894
1915
|
});
|
|
1895
|
-
},
|
|
1896
|
-
r.executeCommand(
|
|
1897
|
-
unitId:
|
|
1916
|
+
}, I = () => {
|
|
1917
|
+
r.executeCommand(so.id, {
|
|
1918
|
+
unitId: h,
|
|
1898
1919
|
subUnitId: c
|
|
1899
1920
|
});
|
|
1900
|
-
},
|
|
1901
|
-
const
|
|
1902
|
-
return
|
|
1903
|
-
})(l),
|
|
1904
|
-
return /* @__PURE__ */
|
|
1905
|
-
|
|
1906
|
-
var
|
|
1907
|
-
return /* @__PURE__ */
|
|
1908
|
-
|
|
1921
|
+
}, v = ((f) => {
|
|
1922
|
+
const w = n.getCurrentUnitForType(H.UNIVER_SHEET), b = w.getActiveSheet(), g = w.getUnitId(), p = b.getSheetId();
|
|
1923
|
+
return f.map((T) => oo(o, g, p, T.ranges) ? { ...T } : { ...T, disable: !0 });
|
|
1924
|
+
})(l), C = v == null ? void 0 : v.some((f) => f.disable);
|
|
1925
|
+
return /* @__PURE__ */ Y("div", { className: "univer-pb-4", children: [
|
|
1926
|
+
v == null ? void 0 : v.map((f) => {
|
|
1927
|
+
var w;
|
|
1928
|
+
return /* @__PURE__ */ S(
|
|
1929
|
+
fi,
|
|
1909
1930
|
{
|
|
1910
|
-
unitId:
|
|
1931
|
+
unitId: h,
|
|
1911
1932
|
subUnitId: c,
|
|
1912
1933
|
onClick: () => {
|
|
1913
|
-
|
|
1914
|
-
unitId:
|
|
1934
|
+
f.disable || i.setActiveRule({
|
|
1935
|
+
unitId: h,
|
|
1915
1936
|
subUnitId: c,
|
|
1916
|
-
rule:
|
|
1937
|
+
rule: f
|
|
1917
1938
|
});
|
|
1918
1939
|
},
|
|
1919
|
-
rule:
|
|
1920
|
-
disable: (
|
|
1940
|
+
rule: f,
|
|
1941
|
+
disable: (w = f.disable) != null ? w : !1
|
|
1921
1942
|
},
|
|
1922
|
-
|
|
1943
|
+
f.uid
|
|
1923
1944
|
);
|
|
1924
1945
|
}),
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
l.length && !
|
|
1927
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ Y("div", { className: "univer-mt-4 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
|
|
1947
|
+
l.length && !C ? /* @__PURE__ */ S(qe, { onClick: I, children: a.t("dataValidation.panel.removeAll") }) : null,
|
|
1948
|
+
/* @__PURE__ */ S(qe, { variant: "primary", onClick: m, children: a.t("dataValidation.panel.add") })
|
|
1928
1949
|
] })
|
|
1929
1950
|
] });
|
|
1930
1951
|
}
|
|
1931
|
-
const
|
|
1932
|
-
const e = F(
|
|
1933
|
-
() => n.getCurrentTypeOfUnit$(
|
|
1952
|
+
const Si = () => {
|
|
1953
|
+
const e = F(_e), t = Re(e.activeRule$, e.activeRule), n = F(pe), r = Re(
|
|
1954
|
+
() => n.getCurrentTypeOfUnit$(H.UNIVER_SHEET),
|
|
1934
1955
|
void 0,
|
|
1935
1956
|
void 0,
|
|
1936
1957
|
[]
|
|
1937
|
-
), o =
|
|
1958
|
+
), o = Re(() => {
|
|
1938
1959
|
var i;
|
|
1939
|
-
return (i = r == null ? void 0 : r.activeSheet$) != null ? i :
|
|
1960
|
+
return (i = r == null ? void 0 : r.activeSheet$) != null ? i : vr(null);
|
|
1940
1961
|
}, void 0, void 0, []);
|
|
1941
|
-
return !r || !o ? null : t && t.subUnitId === o.getSheetId() ? /* @__PURE__ */
|
|
1942
|
-
},
|
|
1943
|
-
const { isTwoFormula: t = !1, value: n, onChange: r, showError: o, validResult: i } = e, a = F(
|
|
1944
|
-
return t ? /* @__PURE__ */
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
|
|
1962
|
+
return !r || !o ? null : t && (t.subUnitId === o.getSheetId() || t.subUnitId === e.getFocusFormulaEditorActiveRuleSubUnitId()) ? /* @__PURE__ */ S(mi, {}, t.rule.uid) : /* @__PURE__ */ S(_i, { workbook: r });
|
|
1963
|
+
}, Ci = (e) => {
|
|
1964
|
+
const { isTwoFormula: t = !1, value: n, onChange: r, showError: o, validResult: i } = e, a = F(ge), l = o ? i == null ? void 0 : i.formula1 : "", s = o ? i == null ? void 0 : i.formula2 : "";
|
|
1965
|
+
return t ? /* @__PURE__ */ Y(pt, { children: [
|
|
1966
|
+
/* @__PURE__ */ S(Z, { error: l, children: /* @__PURE__ */ S(
|
|
1967
|
+
Ue,
|
|
1947
1968
|
{
|
|
1948
1969
|
className: "univer-w-full",
|
|
1949
1970
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
|
@@ -1956,9 +1977,9 @@ const vi = () => {
|
|
|
1956
1977
|
}
|
|
1957
1978
|
}
|
|
1958
1979
|
) }),
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
|
|
1980
|
+
/* @__PURE__ */ S("div", { className: "-univer-mt-2 univer-mb-1 univer-text-sm univer-text-gray-400", children: a.t("dataValidation.panel.formulaAnd") }),
|
|
1981
|
+
/* @__PURE__ */ S(Z, { error: s, children: /* @__PURE__ */ S(
|
|
1982
|
+
Ue,
|
|
1962
1983
|
{
|
|
1963
1984
|
className: "univer-w-full",
|
|
1964
1985
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
|
@@ -1971,8 +1992,8 @@ const vi = () => {
|
|
|
1971
1992
|
}
|
|
1972
1993
|
}
|
|
1973
1994
|
) })
|
|
1974
|
-
] }) : /* @__PURE__ */
|
|
1975
|
-
|
|
1995
|
+
] }) : /* @__PURE__ */ S(Z, { error: l, children: /* @__PURE__ */ S(
|
|
1996
|
+
Ue,
|
|
1976
1997
|
{
|
|
1977
1998
|
className: "univer-w-full",
|
|
1978
1999
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
|
@@ -1983,11 +2004,11 @@ const vi = () => {
|
|
|
1983
2004
|
}
|
|
1984
2005
|
) });
|
|
1985
2006
|
};
|
|
1986
|
-
function
|
|
1987
|
-
const { value: t, onChange: n, showError: r, validResult: o } = e, i = F(
|
|
1988
|
-
return /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
|
|
2007
|
+
function Ii(e) {
|
|
2008
|
+
const { value: t, onChange: n, showError: r, validResult: o } = e, i = F(ge), a = r ? o == null ? void 0 : o.formula1 : "", l = r ? o == null ? void 0 : o.formula2 : "", [s, d] = W(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
|
2009
|
+
return /* @__PURE__ */ Y(pt, { children: [
|
|
2010
|
+
/* @__PURE__ */ S(Z, { children: /* @__PURE__ */ S(
|
|
2011
|
+
Nt,
|
|
1991
2012
|
{
|
|
1992
2013
|
checked: s,
|
|
1993
2014
|
onChange: (u) => {
|
|
@@ -2000,8 +2021,8 @@ function fi(e) {
|
|
|
2000
2021
|
children: i.t("dataValidation.checkbox.tips")
|
|
2001
2022
|
}
|
|
2002
2023
|
) }),
|
|
2003
|
-
s ? /* @__PURE__ */
|
|
2004
|
-
|
|
2024
|
+
s ? /* @__PURE__ */ S(Z, { label: i.t("dataValidation.checkbox.checked"), error: a, children: /* @__PURE__ */ S(
|
|
2025
|
+
Ue,
|
|
2005
2026
|
{
|
|
2006
2027
|
className: "univer-w-full",
|
|
2007
2028
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
|
@@ -2014,8 +2035,8 @@ function fi(e) {
|
|
|
2014
2035
|
}
|
|
2015
2036
|
}
|
|
2016
2037
|
) }) : null,
|
|
2017
|
-
s ? /* @__PURE__ */
|
|
2018
|
-
|
|
2038
|
+
s ? /* @__PURE__ */ S(Z, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ S(
|
|
2039
|
+
Ue,
|
|
2019
2040
|
{
|
|
2020
2041
|
className: "univer-w-full",
|
|
2021
2042
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
|
@@ -2030,18 +2051,18 @@ function fi(e) {
|
|
|
2030
2051
|
) }) : null
|
|
2031
2052
|
] });
|
|
2032
2053
|
}
|
|
2033
|
-
function
|
|
2034
|
-
var
|
|
2035
|
-
const { unitId: t, subUnitId: n, value: r, onChange: o, showError: i, validResult: a } = e, l = i ? a == null ? void 0 : a.formula1 : void 0, s =
|
|
2036
|
-
return
|
|
2037
|
-
var
|
|
2038
|
-
(
|
|
2039
|
-
}), /* @__PURE__ */
|
|
2040
|
-
|
|
2054
|
+
function wi(e) {
|
|
2055
|
+
var h;
|
|
2056
|
+
const { unitId: t, subUnitId: n, value: r, onChange: o, showError: i, validResult: a } = e, l = i ? a == null ? void 0 : a.formula1 : void 0, s = vt(null), [d, u] = W(!1);
|
|
2057
|
+
return hr((c) => {
|
|
2058
|
+
var I;
|
|
2059
|
+
(I = s.current) != null && I.isClickOutSide(c) && u(!1);
|
|
2060
|
+
}), /* @__PURE__ */ S(Z, { error: l, children: /* @__PURE__ */ S(
|
|
2061
|
+
Sr,
|
|
2041
2062
|
{
|
|
2042
2063
|
ref: s,
|
|
2043
|
-
className:
|
|
2044
|
-
initValue: (
|
|
2064
|
+
className: Fe("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", bt),
|
|
2065
|
+
initValue: (h = r == null ? void 0 : r.formula1) != null ? h : "=",
|
|
2045
2066
|
unitId: t,
|
|
2046
2067
|
subUnitId: n,
|
|
2047
2068
|
isFocus: d,
|
|
@@ -2057,7 +2078,7 @@ function _i(e) {
|
|
|
2057
2078
|
}
|
|
2058
2079
|
) });
|
|
2059
2080
|
}
|
|
2060
|
-
const
|
|
2081
|
+
const Ri = [
|
|
2061
2082
|
"#FFFFFF",
|
|
2062
2083
|
"#FEE7E7",
|
|
2063
2084
|
"#FEF0E6",
|
|
@@ -2082,24 +2103,24 @@ const Ci = [
|
|
|
2082
2103
|
"#3A60F7",
|
|
2083
2104
|
"#9E6DE3",
|
|
2084
2105
|
"#F248A6"
|
|
2085
|
-
],
|
|
2106
|
+
], yi = (e) => {
|
|
2086
2107
|
const { value: t, onChange: n, disabled: r } = e, [o, i] = W(!1);
|
|
2087
|
-
return /* @__PURE__ */
|
|
2088
|
-
|
|
2108
|
+
return /* @__PURE__ */ S(
|
|
2109
|
+
Po,
|
|
2089
2110
|
{
|
|
2090
2111
|
align: "start",
|
|
2091
2112
|
disabled: r,
|
|
2092
2113
|
open: o,
|
|
2093
2114
|
onOpenChange: i,
|
|
2094
|
-
overlay: /* @__PURE__ */
|
|
2115
|
+
overlay: /* @__PURE__ */ S(
|
|
2095
2116
|
"div",
|
|
2096
2117
|
{
|
|
2097
2118
|
className: "univer-box-border univer-grid univer-w-fit univer-grid-cols-6 univer-flex-wrap univer-gap-2 univer-p-1.5",
|
|
2098
|
-
children:
|
|
2099
|
-
(a) => /* @__PURE__ */
|
|
2119
|
+
children: Ri.map(
|
|
2120
|
+
(a) => /* @__PURE__ */ S(
|
|
2100
2121
|
"div",
|
|
2101
2122
|
{
|
|
2102
|
-
className:
|
|
2123
|
+
className: Fe("univer-box-border univer-size-4 univer-cursor-pointer univer-rounded", bt),
|
|
2103
2124
|
style: { background: a },
|
|
2104
2125
|
onClick: () => {
|
|
2105
2126
|
n(a), i(!1);
|
|
@@ -2110,30 +2131,30 @@ const Ci = [
|
|
|
2110
2131
|
)
|
|
2111
2132
|
}
|
|
2112
2133
|
),
|
|
2113
|
-
children: /* @__PURE__ */
|
|
2134
|
+
children: /* @__PURE__ */ Y(
|
|
2114
2135
|
"div",
|
|
2115
2136
|
{
|
|
2116
|
-
className:
|
|
2137
|
+
className: Fe("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", bt),
|
|
2117
2138
|
children: [
|
|
2118
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ S(
|
|
2119
2140
|
"div",
|
|
2120
2141
|
{
|
|
2121
2142
|
className: "univer-box-border univer-size-4 univer-rounded univer-text-base",
|
|
2122
2143
|
style: { background: t }
|
|
2123
2144
|
}
|
|
2124
2145
|
),
|
|
2125
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ S(yn, {})
|
|
2126
2147
|
]
|
|
2127
2148
|
}
|
|
2128
2149
|
)
|
|
2129
2150
|
}
|
|
2130
2151
|
);
|
|
2131
|
-
},
|
|
2152
|
+
}, Bn = (e) => {
|
|
2132
2153
|
const { item: t, commonProps: n, className: r } = e, { onItemChange: o, onItemDelete: i } = n;
|
|
2133
|
-
return /* @__PURE__ */
|
|
2134
|
-
!t.isRef && /* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2136
|
-
|
|
2154
|
+
return /* @__PURE__ */ Y("div", { className: Fe("univer-flex univer-items-center univer-gap-2", r), children: [
|
|
2155
|
+
!t.isRef && /* @__PURE__ */ S("div", { className: Fe("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ S(Vr, {}) }),
|
|
2156
|
+
/* @__PURE__ */ S(
|
|
2157
|
+
yi,
|
|
2137
2158
|
{
|
|
2138
2159
|
value: t.color,
|
|
2139
2160
|
onChange: (a) => {
|
|
@@ -2141,8 +2162,8 @@ const Ci = [
|
|
|
2141
2162
|
}
|
|
2142
2163
|
}
|
|
2143
2164
|
),
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
|
|
2165
|
+
/* @__PURE__ */ S(
|
|
2166
|
+
Ue,
|
|
2146
2167
|
{
|
|
2147
2168
|
disabled: t.isRef,
|
|
2148
2169
|
value: t.label,
|
|
@@ -2151,166 +2172,168 @@ const Ci = [
|
|
|
2151
2172
|
}
|
|
2152
2173
|
}
|
|
2153
2174
|
),
|
|
2154
|
-
t.isRef ? null : /* @__PURE__ */
|
|
2175
|
+
t.isRef ? null : /* @__PURE__ */ S(
|
|
2155
2176
|
"div",
|
|
2156
2177
|
{
|
|
2157
2178
|
className: "univer-ml-1 univer-cursor-pointer univer-rounded univer-text-base hover:univer-bg-gray-200",
|
|
2158
|
-
children: /* @__PURE__ */
|
|
2179
|
+
children: /* @__PURE__ */ S(Rn, { onClick: () => i(t.id) })
|
|
2159
2180
|
}
|
|
2160
2181
|
)
|
|
2161
2182
|
] });
|
|
2162
2183
|
};
|
|
2163
|
-
function
|
|
2184
|
+
function Mi(e) {
|
|
2164
2185
|
const { value: t, onChange: n = () => {
|
|
2165
|
-
}, unitId: r, subUnitId: o, validResult: i, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u,
|
|
2166
|
-
|
|
2186
|
+
}, unitId: r, subUnitId: o, validResult: i, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, h] = W(() => Pe(s) ? "1" : "0"), [c, m] = W(u === "1" ? s : "="), [I, D] = W(u === "1" ? s : "="), v = F(ge), C = F(Te), f = F(fn), w = F(lo), b = F(_e), [g, p] = W(() => d.split(",")), _ = C.getValidatorItem(X.LIST), [T, A] = W([]), [P, L] = W(""), y = a ? i == null ? void 0 : i.formula1 : "", O = ht(() => f.ruleChange$.pipe(pr(16)), []), U = Re(O), k = an(n);
|
|
2187
|
+
be(() => {
|
|
2167
2188
|
(async () => {
|
|
2168
|
-
await new Promise((
|
|
2169
|
-
setTimeout(() =>
|
|
2189
|
+
await new Promise((N) => {
|
|
2190
|
+
setTimeout(() => N(!0), 100);
|
|
2170
2191
|
});
|
|
2171
|
-
const M =
|
|
2172
|
-
if (
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2192
|
+
const M = f.getRuleById(r, o, l), $ = M == null ? void 0 : M.formula1;
|
|
2193
|
+
if (Pe($) && _ && M) {
|
|
2194
|
+
const N = await _.getListAsync(M, r, o);
|
|
2195
|
+
A(N);
|
|
2175
2196
|
}
|
|
2176
2197
|
})();
|
|
2177
|
-
}, [
|
|
2178
|
-
|
|
2179
|
-
}, [
|
|
2180
|
-
const [x,
|
|
2181
|
-
const M = u !== "1" ?
|
|
2182
|
-
return M.map((
|
|
2183
|
-
label:
|
|
2184
|
-
color:
|
|
2198
|
+
}, [f, U, _, l, o, r]), be(() => {
|
|
2199
|
+
Pe(s) && s !== I && (m(s), D(I));
|
|
2200
|
+
}, [I, s]);
|
|
2201
|
+
const [x, te] = W(() => {
|
|
2202
|
+
const M = u !== "1" ? co(s) : [], $ = d.split(",");
|
|
2203
|
+
return M.map((N, J) => ({
|
|
2204
|
+
label: N,
|
|
2205
|
+
color: $[J] || ke,
|
|
2185
2206
|
isRef: !1,
|
|
2186
|
-
id:
|
|
2207
|
+
id: En(4)
|
|
2187
2208
|
}));
|
|
2188
|
-
}),
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2191
|
-
},
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2194
|
-
},
|
|
2209
|
+
}), j = (M, $, N) => {
|
|
2210
|
+
const J = x.find((R) => R.id === M);
|
|
2211
|
+
J && (J.label = $, J.color = N, te([...x]));
|
|
2212
|
+
}, se = (M) => {
|
|
2213
|
+
const $ = x.findIndex((N) => N.id === M);
|
|
2214
|
+
$ !== -1 && (x.splice($, 1), te([...x]));
|
|
2215
|
+
}, le = d.split(","), de = ht(() => T.map((M, $) => ({
|
|
2195
2216
|
label: M,
|
|
2196
|
-
color:
|
|
2197
|
-
id: `${
|
|
2217
|
+
color: le[$] || ke,
|
|
2218
|
+
id: `${$}`,
|
|
2198
2219
|
isRef: !0
|
|
2199
|
-
})), [
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2220
|
+
})), [le, T]), Me = (M, $, N) => {
|
|
2221
|
+
const J = [...g];
|
|
2222
|
+
J[+M] = N, p(J), k({
|
|
2202
2223
|
formula1: s,
|
|
2203
|
-
formula2:
|
|
2224
|
+
formula2: J.join(",")
|
|
2204
2225
|
});
|
|
2205
|
-
},
|
|
2206
|
-
|
|
2226
|
+
}, Q = () => {
|
|
2227
|
+
te([
|
|
2207
2228
|
...x,
|
|
2208
2229
|
{
|
|
2209
2230
|
label: "",
|
|
2210
|
-
color:
|
|
2231
|
+
color: ke,
|
|
2211
2232
|
isRef: !1,
|
|
2212
|
-
id:
|
|
2233
|
+
id: En(4)
|
|
2213
2234
|
}
|
|
2214
2235
|
]);
|
|
2215
2236
|
};
|
|
2216
|
-
|
|
2237
|
+
be(() => {
|
|
2217
2238
|
if (u === "1")
|
|
2218
2239
|
return;
|
|
2219
|
-
const M = /* @__PURE__ */ new Set(),
|
|
2220
|
-
x.map((
|
|
2221
|
-
labelList:
|
|
2222
|
-
item:
|
|
2223
|
-
})).forEach(({ item:
|
|
2224
|
-
|
|
2225
|
-
M.has(
|
|
2226
|
-
label:
|
|
2227
|
-
color:
|
|
2240
|
+
const M = /* @__PURE__ */ new Set(), $ = [];
|
|
2241
|
+
x.map((N) => ({
|
|
2242
|
+
labelList: N.label.split(","),
|
|
2243
|
+
item: N
|
|
2244
|
+
})).forEach(({ item: N, labelList: J }) => {
|
|
2245
|
+
J.forEach((R) => {
|
|
2246
|
+
M.has(R) || (M.add(R), $.push({
|
|
2247
|
+
label: R,
|
|
2248
|
+
color: N.color
|
|
2228
2249
|
}));
|
|
2229
2250
|
});
|
|
2230
|
-
}),
|
|
2231
|
-
formula1:
|
|
2232
|
-
formula2:
|
|
2251
|
+
}), k({
|
|
2252
|
+
formula1: nr($.map((N) => N.label)),
|
|
2253
|
+
formula2: $.map((N) => N.color === ke ? "" : N.color).join(",")
|
|
2233
2254
|
});
|
|
2234
|
-
}, [x,
|
|
2235
|
-
const
|
|
2236
|
-
if (!
|
|
2237
|
-
|
|
2255
|
+
}, [x, k, u, I, g]);
|
|
2256
|
+
const G = an(async (M) => {
|
|
2257
|
+
if (!Pe(M)) {
|
|
2258
|
+
k == null || k({
|
|
2238
2259
|
formula1: "",
|
|
2239
2260
|
formula2: d
|
|
2240
2261
|
});
|
|
2241
2262
|
return;
|
|
2242
2263
|
}
|
|
2243
|
-
|
|
2244
|
-
formula1:
|
|
2264
|
+
w.getFormulaRefCheck(M) ? (k == null || k({
|
|
2265
|
+
formula1: Pe(M) ? M : "",
|
|
2245
2266
|
formula2: d
|
|
2246
|
-
}),
|
|
2267
|
+
}), L("")) : (k == null || k({
|
|
2247
2268
|
formula1: "",
|
|
2248
2269
|
formula2: d
|
|
2249
|
-
}), m("="),
|
|
2250
|
-
}),
|
|
2251
|
-
return
|
|
2252
|
-
var
|
|
2253
|
-
(
|
|
2254
|
-
}),
|
|
2255
|
-
|
|
2256
|
-
|
|
2270
|
+
}), m("="), L(v.t("dataValidation.validFail.formulaError")));
|
|
2271
|
+
}), ce = vt(null), [ee, q] = W(!1);
|
|
2272
|
+
return hr((M) => {
|
|
2273
|
+
var N;
|
|
2274
|
+
(N = ce.current) != null && N.isClickOutSide(M) && q(!1);
|
|
2275
|
+
}), be(() => {
|
|
2276
|
+
ee ? b.setFocusFormulaEditorActiveRuleSubUnitId(o) : b.setFocusFormulaEditorActiveRuleSubUnitId(null);
|
|
2277
|
+
}, [ee, o, b]), /* @__PURE__ */ Y(pt, { children: [
|
|
2278
|
+
/* @__PURE__ */ S(Z, { label: v.t("dataValidation.list.options"), children: /* @__PURE__ */ Y(
|
|
2279
|
+
In,
|
|
2257
2280
|
{
|
|
2258
2281
|
value: u,
|
|
2259
2282
|
onChange: (M) => {
|
|
2260
|
-
|
|
2261
|
-
formula1:
|
|
2262
|
-
formula2:
|
|
2283
|
+
h(M), m(I), M === "1" && k({
|
|
2284
|
+
formula1: I === "=" ? "" : I,
|
|
2285
|
+
formula2: g.join(",")
|
|
2263
2286
|
});
|
|
2264
2287
|
},
|
|
2265
2288
|
children: [
|
|
2266
|
-
/* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ S(Ne, { value: "0", children: v.t("dataValidation.list.customOptions") }),
|
|
2290
|
+
/* @__PURE__ */ S(Ne, { value: "1", children: v.t("dataValidation.list.refOptions") })
|
|
2268
2291
|
]
|
|
2269
2292
|
}
|
|
2270
2293
|
) }),
|
|
2271
|
-
u === "1" ? /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
|
|
2294
|
+
u === "1" ? /* @__PURE__ */ Y(Z, { error: y || P || void 0, children: [
|
|
2295
|
+
/* @__PURE__ */ S(
|
|
2296
|
+
Sr,
|
|
2274
2297
|
{
|
|
2275
|
-
ref:
|
|
2276
|
-
className:
|
|
2298
|
+
ref: ce,
|
|
2299
|
+
className: Fe("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", bt),
|
|
2277
2300
|
initValue: c,
|
|
2278
2301
|
unitId: r,
|
|
2279
2302
|
subUnitId: o,
|
|
2280
|
-
isFocus:
|
|
2303
|
+
isFocus: ee,
|
|
2281
2304
|
isSupportAcrossSheet: !0,
|
|
2282
|
-
onFocus: () =>
|
|
2305
|
+
onFocus: () => q(!0),
|
|
2283
2306
|
onChange: (M = "") => {
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2307
|
+
const $ = (M != null ? M : "").trim();
|
|
2308
|
+
D($), G($);
|
|
2286
2309
|
}
|
|
2287
2310
|
}
|
|
2288
2311
|
),
|
|
2289
|
-
|
|
2290
|
-
|
|
2312
|
+
de.length > 0 && /* @__PURE__ */ S("div", { className: "univer-mt-3", children: de.map((M) => /* @__PURE__ */ S(
|
|
2313
|
+
Bn,
|
|
2291
2314
|
{
|
|
2292
2315
|
className: "univer-mb-3",
|
|
2293
2316
|
item: M,
|
|
2294
|
-
commonProps: { onItemChange:
|
|
2317
|
+
commonProps: { onItemChange: Me }
|
|
2295
2318
|
},
|
|
2296
2319
|
M.id
|
|
2297
2320
|
)) })
|
|
2298
|
-
] }) : /* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
|
|
2321
|
+
] }) : /* @__PURE__ */ S(Z, { error: y, children: /* @__PURE__ */ Y("div", { className: "-univer-mt-3", children: [
|
|
2322
|
+
/* @__PURE__ */ S(
|
|
2323
|
+
Ao,
|
|
2301
2324
|
{
|
|
2302
2325
|
list: x,
|
|
2303
|
-
onListChange:
|
|
2326
|
+
onListChange: te,
|
|
2304
2327
|
rowHeight: 28,
|
|
2305
2328
|
margin: [0, 12],
|
|
2306
2329
|
draggableHandle: ".draggableHandle",
|
|
2307
|
-
itemRender: (M) => /* @__PURE__ */
|
|
2308
|
-
|
|
2330
|
+
itemRender: (M) => /* @__PURE__ */ S(
|
|
2331
|
+
Bn,
|
|
2309
2332
|
{
|
|
2310
2333
|
item: M,
|
|
2311
2334
|
commonProps: {
|
|
2312
|
-
onItemChange:
|
|
2313
|
-
onItemDelete:
|
|
2335
|
+
onItemChange: j,
|
|
2336
|
+
onItemDelete: se
|
|
2314
2337
|
}
|
|
2315
2338
|
},
|
|
2316
2339
|
M.id
|
|
@@ -2318,54 +2341,54 @@ function wi(e) {
|
|
|
2318
2341
|
idKey: "id"
|
|
2319
2342
|
}
|
|
2320
2343
|
),
|
|
2321
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ Y(
|
|
2322
2345
|
"a",
|
|
2323
2346
|
{
|
|
2324
2347
|
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",
|
|
2325
|
-
onClick:
|
|
2348
|
+
onClick: Q,
|
|
2326
2349
|
children: [
|
|
2327
|
-
/* @__PURE__ */
|
|
2328
|
-
|
|
2350
|
+
/* @__PURE__ */ S(Er, { className: "univer-mr-1" }),
|
|
2351
|
+
v.t("dataValidation.list.add")
|
|
2329
2352
|
]
|
|
2330
2353
|
}
|
|
2331
2354
|
)
|
|
2332
2355
|
] }) })
|
|
2333
2356
|
] });
|
|
2334
2357
|
}
|
|
2335
|
-
const
|
|
2358
|
+
const bi = [
|
|
2336
2359
|
[
|
|
2337
|
-
|
|
2338
|
-
|
|
2360
|
+
lr,
|
|
2361
|
+
wi
|
|
2339
2362
|
],
|
|
2340
2363
|
[
|
|
2341
|
-
|
|
2342
|
-
|
|
2364
|
+
kt,
|
|
2365
|
+
Ci
|
|
2343
2366
|
],
|
|
2344
2367
|
[
|
|
2345
|
-
|
|
2346
|
-
|
|
2368
|
+
mn,
|
|
2369
|
+
Mi
|
|
2347
2370
|
],
|
|
2348
2371
|
[
|
|
2349
|
-
|
|
2350
|
-
|
|
2372
|
+
dr,
|
|
2373
|
+
Ii
|
|
2351
2374
|
]
|
|
2352
|
-
],
|
|
2353
|
-
function
|
|
2375
|
+
], Ei = "LIST_RENDER_MODE_OPTION_INPUT";
|
|
2376
|
+
function Ot(e) {
|
|
2354
2377
|
var o;
|
|
2355
|
-
const { value: t, onChange: n } = e, r = F(
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
-
/* @__PURE__ */
|
|
2359
|
-
/* @__PURE__ */
|
|
2378
|
+
const { value: t, onChange: n } = e, r = F(ge);
|
|
2379
|
+
return /* @__PURE__ */ S(Z, { label: r.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ Y(In, { value: `${(o = t.renderMode) != null ? o : ue.CUSTOM}`, onChange: (i) => n({ ...t, renderMode: +i }), children: [
|
|
2380
|
+
/* @__PURE__ */ S(Ne, { value: `${ue.CUSTOM}`, children: r.t("dataValidation.renderMode.chip") }),
|
|
2381
|
+
/* @__PURE__ */ S(Ne, { value: `${ue.ARROW}`, children: r.t("dataValidation.renderMode.arrow") }),
|
|
2382
|
+
/* @__PURE__ */ S(Ne, { value: `${ue.TEXT}`, children: r.t("dataValidation.renderMode.text") })
|
|
2360
2383
|
] }) });
|
|
2361
2384
|
}
|
|
2362
|
-
|
|
2363
|
-
const
|
|
2364
|
-
function
|
|
2385
|
+
Ot.componentKey = Ei;
|
|
2386
|
+
const Di = "DATE_SHOW_TIME_OPTION";
|
|
2387
|
+
function At(e) {
|
|
2365
2388
|
var o;
|
|
2366
|
-
const { value: t, onChange: n } = e, r = F(
|
|
2367
|
-
return /* @__PURE__ */
|
|
2368
|
-
|
|
2389
|
+
const { value: t, onChange: n } = e, r = F(ge);
|
|
2390
|
+
return /* @__PURE__ */ S(Z, { children: /* @__PURE__ */ S(
|
|
2391
|
+
Nt,
|
|
2369
2392
|
{
|
|
2370
2393
|
checked: (o = t.bizInfo) == null ? void 0 : o.showTime,
|
|
2371
2394
|
onChange: (i) => {
|
|
@@ -2381,26 +2404,26 @@ function Vt(e) {
|
|
|
2381
2404
|
}
|
|
2382
2405
|
) });
|
|
2383
2406
|
}
|
|
2384
|
-
|
|
2385
|
-
var
|
|
2386
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
2407
|
+
At.componentKey = Di;
|
|
2408
|
+
var Vi = Object.getOwnPropertyDescriptor, Ti = (e, t, n, r) => {
|
|
2409
|
+
for (var o = r > 1 ? void 0 : r ? Vi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2387
2410
|
(a = e[i]) && (o = a(o) || o);
|
|
2388
2411
|
return o;
|
|
2389
|
-
},
|
|
2390
|
-
const
|
|
2391
|
-
let
|
|
2412
|
+
}, Ye = (e, t) => (n, r) => t(n, r, e);
|
|
2413
|
+
const Ct = 6;
|
|
2414
|
+
let ln = class {
|
|
2392
2415
|
constructor(e, t, n, r, o, i) {
|
|
2393
2416
|
this._commandService = e, this._univerInstanceService = t, this._formulaService = n, this._themeService = r, this._renderManagerService = o, this._dataValidationModel = i;
|
|
2394
2417
|
}
|
|
2395
2418
|
_calc(e, t) {
|
|
2396
|
-
var d, u,
|
|
2397
|
-
const { vt: n, ht: r } = t || {}, o = e.endX - e.startX -
|
|
2419
|
+
var d, u, h;
|
|
2420
|
+
const { vt: n, ht: r } = t || {}, o = e.endX - e.startX - Ct * 2, i = e.endY - e.startY, a = ((d = t == null ? void 0 : t.fs) != null ? d : 10) * 1.6;
|
|
2398
2421
|
let l = 0, s = 0;
|
|
2399
2422
|
switch (n) {
|
|
2400
|
-
case
|
|
2423
|
+
case he.TOP:
|
|
2401
2424
|
s = 0;
|
|
2402
2425
|
break;
|
|
2403
|
-
case
|
|
2426
|
+
case he.BOTTOM:
|
|
2404
2427
|
s = 0 + (i - a);
|
|
2405
2428
|
break;
|
|
2406
2429
|
default:
|
|
@@ -2408,21 +2431,21 @@ let on = class {
|
|
|
2408
2431
|
break;
|
|
2409
2432
|
}
|
|
2410
2433
|
switch (r) {
|
|
2411
|
-
case
|
|
2412
|
-
l =
|
|
2434
|
+
case Ee.LEFT:
|
|
2435
|
+
l = Ct;
|
|
2413
2436
|
break;
|
|
2414
|
-
case
|
|
2415
|
-
l =
|
|
2437
|
+
case Ee.RIGHT:
|
|
2438
|
+
l = Ct + (o - a);
|
|
2416
2439
|
break;
|
|
2417
2440
|
default:
|
|
2418
|
-
l =
|
|
2441
|
+
l = Ct + (o - a) / 2;
|
|
2419
2442
|
break;
|
|
2420
2443
|
}
|
|
2421
2444
|
return {
|
|
2422
2445
|
left: e.startX + l,
|
|
2423
2446
|
top: e.startY + s,
|
|
2424
2447
|
width: ((u = t == null ? void 0 : t.fs) != null ? u : 10) * 1.6,
|
|
2425
|
-
height: ((
|
|
2448
|
+
height: ((h = t == null ? void 0 : t.fs) != null ? h : 10) * 1.6
|
|
2426
2449
|
};
|
|
2427
2450
|
}
|
|
2428
2451
|
calcCellAutoHeight(e) {
|
|
@@ -2436,25 +2459,25 @@ let on = class {
|
|
|
2436
2459
|
return ((n = t == null ? void 0 : t.fs) != null ? n : 10) * 1.6;
|
|
2437
2460
|
}
|
|
2438
2461
|
async _parseFormula(e, t, n) {
|
|
2439
|
-
var d, u,
|
|
2440
|
-
const { formula1: r =
|
|
2462
|
+
var d, u, h, c, m, I, D, v, C;
|
|
2463
|
+
const { formula1: r = po, formula2: o = ho } = e, i = await this._formulaService.getRuleFormulaResult(t, n, e.uid), a = Bt((h = (u = (d = i == null ? void 0 : i[0]) == null ? void 0 : d.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Bt((I = (m = (c = i == null ? void 0 : i[1]) == null ? void 0 : c.result) == null ? void 0 : m[0]) == null ? void 0 : I[0]), s = On(String(a)) && On(String(l));
|
|
2441
2464
|
return {
|
|
2442
|
-
formula1:
|
|
2443
|
-
formula2:
|
|
2465
|
+
formula1: Pe(r) ? Bt((C = (v = (D = i == null ? void 0 : i[0]) == null ? void 0 : D.result) == null ? void 0 : v[0]) == null ? void 0 : C[0]) : r,
|
|
2466
|
+
formula2: Pe(o) ? l : o,
|
|
2444
2467
|
isFormulaValid: s
|
|
2445
2468
|
};
|
|
2446
2469
|
}
|
|
2447
2470
|
drawWith(e, t) {
|
|
2448
|
-
var L, y,
|
|
2449
|
-
const { style: n, primaryWithCoord: r, unitId: o, subUnitId: i, worksheet: a, row: l, col: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u =
|
|
2450
|
-
if (!
|
|
2471
|
+
var L, y, O, U;
|
|
2472
|
+
const { style: n, primaryWithCoord: r, unitId: o, subUnitId: i, worksheet: a, row: l, col: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = ie(a.getCellRaw(l, s)), h = this._dataValidationModel.getRuleByLocation(o, i, l, s);
|
|
2473
|
+
if (!h)
|
|
2451
2474
|
return;
|
|
2452
|
-
const c = this._dataValidationModel.getValidator(
|
|
2453
|
-
if (!c || !((L = c.skipDefaultFontRender) != null && L.call(c,
|
|
2475
|
+
const c = this._dataValidationModel.getValidator(h.type);
|
|
2476
|
+
if (!c || !((L = c.skipDefaultFontRender) != null && L.call(c, h, u, { unitId: o, subUnitId: i, row: l, column: s })))
|
|
2454
2477
|
return;
|
|
2455
|
-
const m = c.parseFormulaSync(
|
|
2456
|
-
left:
|
|
2457
|
-
top:
|
|
2478
|
+
const m = c.parseFormulaSync(h, o, i), { formula1: I } = m, D = this._calc(d, n), { a: v, d: C } = e.getTransform(), f = Dn(D.left, v), w = Dn(D.top, C), b = zr.create().composeMatrix({
|
|
2479
|
+
left: f,
|
|
2480
|
+
top: w,
|
|
2458
2481
|
scaleX: 1,
|
|
2459
2482
|
scaleY: 1,
|
|
2460
2483
|
angle: 0,
|
|
@@ -2462,16 +2485,16 @@ let on = class {
|
|
|
2462
2485
|
skewY: 0,
|
|
2463
2486
|
flipX: !1,
|
|
2464
2487
|
flipY: !1
|
|
2465
|
-
}),
|
|
2466
|
-
e.save(), e.beginPath(), e.rect(d.startX, d.startY,
|
|
2488
|
+
}), g = d.endX - d.startX, p = d.endY - d.startY;
|
|
2489
|
+
e.save(), e.beginPath(), e.rect(d.startX, d.startY, g, p), e.clip();
|
|
2467
2490
|
const _ = b.getMatrix();
|
|
2468
2491
|
e.transform(_[0], _[1], _[2], _[3], _[4], _[5]);
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2471
|
-
checked:
|
|
2472
|
-
width:
|
|
2473
|
-
height:
|
|
2474
|
-
fill: (
|
|
2492
|
+
const T = ((y = n == null ? void 0 : n.fs) != null ? y : 10) * 1.6, A = String(u) === String(I), P = this._themeService.getColorFromTheme("primary.600");
|
|
2493
|
+
Kr.drawWith(e, {
|
|
2494
|
+
checked: A,
|
|
2495
|
+
width: T,
|
|
2496
|
+
height: T,
|
|
2497
|
+
fill: (U = (O = n == null ? void 0 : n.cl) == null ? void 0 : O.rgb) != null ? U : P
|
|
2475
2498
|
}), e.restore();
|
|
2476
2499
|
}
|
|
2477
2500
|
isHit(e, t) {
|
|
@@ -2479,16 +2502,16 @@ let on = class {
|
|
|
2479
2502
|
return s <= l && s >= a && d <= i && d >= o;
|
|
2480
2503
|
}
|
|
2481
2504
|
async onPointerDown(e, t) {
|
|
2482
|
-
var
|
|
2505
|
+
var I;
|
|
2483
2506
|
if (t.button === 2)
|
|
2484
2507
|
return;
|
|
2485
|
-
const { primaryWithCoord: n, unitId: r, subUnitId: o, worksheet: i, row: a, col: l } = e, s =
|
|
2508
|
+
const { primaryWithCoord: n, unitId: r, subUnitId: o, worksheet: i, row: a, col: l } = e, s = ie(i.getCellRaw(a, l)), d = this._dataValidationModel.getRuleByLocation(r, o, a, l);
|
|
2486
2509
|
if (!d)
|
|
2487
2510
|
return;
|
|
2488
2511
|
const u = this._dataValidationModel.getValidator(d.type);
|
|
2489
|
-
if (!u || !((
|
|
2512
|
+
if (!u || !((I = u.skipDefaultFontRender) != null && I.call(u, d, s, { unitId: r, subUnitId: o, row: a, column: l })))
|
|
2490
2513
|
return;
|
|
2491
|
-
const { formula1:
|
|
2514
|
+
const { formula1: h, formula2: c } = await this._parseFormula(d, r, o), m = {
|
|
2492
2515
|
range: {
|
|
2493
2516
|
startColumn: n.actualColumn,
|
|
2494
2517
|
endColumn: n.actualColumn,
|
|
@@ -2496,142 +2519,142 @@ let on = class {
|
|
|
2496
2519
|
endRow: n.actualRow
|
|
2497
2520
|
},
|
|
2498
2521
|
value: {
|
|
2499
|
-
v: String(s) ===
|
|
2522
|
+
v: String(s) === go(String(h)) ? c : h,
|
|
2500
2523
|
p: null
|
|
2501
2524
|
}
|
|
2502
2525
|
};
|
|
2503
2526
|
this._commandService.executeCommand(
|
|
2504
|
-
|
|
2527
|
+
dt.id,
|
|
2505
2528
|
m
|
|
2506
2529
|
);
|
|
2507
2530
|
}
|
|
2508
2531
|
onPointerEnter(e, t) {
|
|
2509
2532
|
var n, r;
|
|
2510
|
-
(r = (n =
|
|
2533
|
+
(r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ge.POINTER);
|
|
2511
2534
|
}
|
|
2512
2535
|
onPointerLeave(e, t) {
|
|
2513
2536
|
var n, r;
|
|
2514
|
-
(r = (n =
|
|
2537
|
+
(r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ge.DEFAULT);
|
|
2515
2538
|
}
|
|
2516
2539
|
};
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
],
|
|
2525
|
-
var
|
|
2526
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
2540
|
+
ln = Ti([
|
|
2541
|
+
Ye(0, oe),
|
|
2542
|
+
Ye(1, pe),
|
|
2543
|
+
Ye(2, E(uo)),
|
|
2544
|
+
Ye(3, E(zn)),
|
|
2545
|
+
Ye(4, E(xe)),
|
|
2546
|
+
Ye(5, E(ae))
|
|
2547
|
+
], ln);
|
|
2548
|
+
var Oi = Object.getOwnPropertyDescriptor, Ai = (e, t, n, r) => {
|
|
2549
|
+
for (var o = r > 1 ? void 0 : r ? Oi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2527
2550
|
(a = e[i]) && (o = a(o) || o);
|
|
2528
2551
|
return o;
|
|
2529
|
-
},
|
|
2530
|
-
let
|
|
2552
|
+
}, Pi = (e, t) => (n, r) => t(n, r, e);
|
|
2553
|
+
let Ce = class {
|
|
2531
2554
|
constructor(e) {
|
|
2532
2555
|
V(this, "canvasRender", null);
|
|
2533
2556
|
V(this, "dropdownType");
|
|
2534
2557
|
V(this, "optionsInput");
|
|
2535
|
-
V(this, "formulaInput",
|
|
2558
|
+
V(this, "formulaInput", mn);
|
|
2536
2559
|
this.injector = e;
|
|
2537
2560
|
}
|
|
2538
2561
|
};
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
],
|
|
2542
|
-
class
|
|
2562
|
+
Ce = Ai([
|
|
2563
|
+
Pi(0, E(Ve))
|
|
2564
|
+
], Ce);
|
|
2565
|
+
class Li extends Ce {
|
|
2543
2566
|
constructor() {
|
|
2544
2567
|
super(...arguments);
|
|
2545
|
-
V(this, "id",
|
|
2546
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
2547
|
-
V(this, "formulaInput",
|
|
2568
|
+
V(this, "id", X.CHECKBOX);
|
|
2569
|
+
V(this, "canvasRender", this.injector.createInstance(ln));
|
|
2570
|
+
V(this, "formulaInput", dr);
|
|
2548
2571
|
}
|
|
2549
2572
|
}
|
|
2550
|
-
class
|
|
2573
|
+
class ki extends Ce {
|
|
2551
2574
|
constructor() {
|
|
2552
2575
|
super(...arguments);
|
|
2553
|
-
V(this, "id",
|
|
2554
|
-
V(this, "formulaInput",
|
|
2576
|
+
V(this, "id", X.CUSTOM);
|
|
2577
|
+
V(this, "formulaInput", lr);
|
|
2555
2578
|
}
|
|
2556
2579
|
}
|
|
2557
|
-
const
|
|
2558
|
-
class
|
|
2580
|
+
const Ni = "data-validation.formula-input";
|
|
2581
|
+
class Ui extends Ce {
|
|
2559
2582
|
constructor() {
|
|
2560
2583
|
super(...arguments);
|
|
2561
|
-
V(this, "id",
|
|
2562
|
-
V(this, "formulaInput",
|
|
2563
|
-
V(this, "optionsInput",
|
|
2564
|
-
V(this, "dropdownType",
|
|
2584
|
+
V(this, "id", X.DATE);
|
|
2585
|
+
V(this, "formulaInput", Ni);
|
|
2586
|
+
V(this, "optionsInput", At.componentKey);
|
|
2587
|
+
V(this, "dropdownType", fe.DATE);
|
|
2565
2588
|
}
|
|
2566
2589
|
}
|
|
2567
|
-
class
|
|
2590
|
+
class Fi extends Ce {
|
|
2568
2591
|
constructor() {
|
|
2569
2592
|
super(...arguments);
|
|
2570
|
-
V(this, "id",
|
|
2571
|
-
V(this, "formulaInput",
|
|
2593
|
+
V(this, "id", X.DECIMAL);
|
|
2594
|
+
V(this, "formulaInput", kt);
|
|
2572
2595
|
}
|
|
2573
2596
|
}
|
|
2574
|
-
const
|
|
2575
|
-
function
|
|
2576
|
-
const n =
|
|
2597
|
+
const Tr = 4, $i = 0, Xt = 4, Or = 4, dn = 6, Pt = 6, Ae = 14;
|
|
2598
|
+
function xi(e, t) {
|
|
2599
|
+
const n = Gr.getTextSize(e, t), r = n.width + Tr * 2, { ba: o, bd: i } = n, a = o + i;
|
|
2577
2600
|
return {
|
|
2578
2601
|
width: r,
|
|
2579
|
-
height: a +
|
|
2602
|
+
height: a + $i * 2,
|
|
2580
2603
|
ba: o
|
|
2581
2604
|
};
|
|
2582
2605
|
}
|
|
2583
|
-
function
|
|
2584
|
-
const o =
|
|
2585
|
-
layout:
|
|
2606
|
+
function Zt(e, t, n, r) {
|
|
2607
|
+
const o = Ae + dn * 2, i = n - o, a = r - Pt * 2, l = e.map((c) => ({
|
|
2608
|
+
layout: xi(c, t),
|
|
2586
2609
|
text: c
|
|
2587
2610
|
}));
|
|
2588
2611
|
let s;
|
|
2589
2612
|
const d = [];
|
|
2590
2613
|
l.forEach((c) => {
|
|
2591
|
-
const { layout: m } = c, { width:
|
|
2592
|
-
!s || s.width +
|
|
2593
|
-
width:
|
|
2594
|
-
height:
|
|
2614
|
+
const { layout: m } = c, { width: I, height: D } = m;
|
|
2615
|
+
!s || s.width + I + Xt > i ? (s = {
|
|
2616
|
+
width: I,
|
|
2617
|
+
height: D,
|
|
2595
2618
|
items: [{
|
|
2596
2619
|
...c,
|
|
2597
2620
|
left: 0
|
|
2598
2621
|
}]
|
|
2599
2622
|
}, d.push(s)) : (s.items.push({
|
|
2600
2623
|
...c,
|
|
2601
|
-
left: s.width +
|
|
2602
|
-
}), s.width = s.width +
|
|
2624
|
+
left: s.width + Xt
|
|
2625
|
+
}), s.width = s.width + I + Xt);
|
|
2603
2626
|
});
|
|
2604
|
-
let u = 0,
|
|
2627
|
+
let u = 0, h = 0;
|
|
2605
2628
|
return d.forEach((c, m) => {
|
|
2606
|
-
|
|
2629
|
+
h = Math.max(h, c.width), m === d.length - 1 ? u += c.height : u += c.height + Or;
|
|
2607
2630
|
}), {
|
|
2608
2631
|
lines: d,
|
|
2609
2632
|
totalHeight: u,
|
|
2610
2633
|
contentWidth: i,
|
|
2611
2634
|
contentHeight: a,
|
|
2612
|
-
cellAutoHeight: u +
|
|
2613
|
-
calcAutoWidth:
|
|
2635
|
+
cellAutoHeight: u + Pt * 2,
|
|
2636
|
+
calcAutoWidth: h + o
|
|
2614
2637
|
};
|
|
2615
2638
|
}
|
|
2616
|
-
const
|
|
2617
|
-
class
|
|
2639
|
+
const Bi = 8;
|
|
2640
|
+
class Wi extends qr {
|
|
2618
2641
|
static drawWith(t, n) {
|
|
2619
2642
|
const { fontString: r, info: o, fill: i, color: a } = n, { layout: l, text: s } = o;
|
|
2620
|
-
t.save(),
|
|
2643
|
+
t.save(), qn.drawWith(t, {
|
|
2621
2644
|
width: l.width,
|
|
2622
2645
|
height: l.height,
|
|
2623
|
-
radius:
|
|
2624
|
-
fill: i ||
|
|
2625
|
-
}), t.translateWithPrecision(
|
|
2646
|
+
radius: Bi,
|
|
2647
|
+
fill: i || ke
|
|
2648
|
+
}), t.translateWithPrecision(Tr, l.ba), t.font = r, t.fillStyle = a, t.fillText(s, 0, 0), t.restore();
|
|
2626
2649
|
}
|
|
2627
2650
|
}
|
|
2628
|
-
var
|
|
2629
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
2651
|
+
var Hi = Object.getOwnPropertyDescriptor, ji = (e, t, n, r) => {
|
|
2652
|
+
for (var o = r > 1 ? void 0 : r ? Hi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2630
2653
|
(a = e[i]) && (o = a(o) || o);
|
|
2631
2654
|
return o;
|
|
2632
|
-
},
|
|
2633
|
-
const
|
|
2634
|
-
let
|
|
2655
|
+
}, It = (e, t) => (n, r) => t(n, r, e);
|
|
2656
|
+
const Yi = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
|
|
2657
|
+
let cn = class {
|
|
2635
2658
|
constructor(e, t, n, r) {
|
|
2636
2659
|
V(this, "zIndex");
|
|
2637
2660
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
@@ -2645,105 +2668,105 @@ let sn = class {
|
|
|
2645
2668
|
return `${e}.${t}`;
|
|
2646
2669
|
}
|
|
2647
2670
|
_drawDownIcon(e, t, n, r, o) {
|
|
2648
|
-
const i = n -
|
|
2671
|
+
const i = n - Ae + 4;
|
|
2649
2672
|
let a = 4;
|
|
2650
2673
|
switch (o) {
|
|
2651
|
-
case
|
|
2652
|
-
a = (r -
|
|
2674
|
+
case he.MIDDLE:
|
|
2675
|
+
a = (r - Ae) / 2 + 4;
|
|
2653
2676
|
break;
|
|
2654
|
-
case
|
|
2655
|
-
a = r -
|
|
2677
|
+
case he.BOTTOM:
|
|
2678
|
+
a = r - Ae + 4;
|
|
2656
2679
|
break;
|
|
2657
2680
|
}
|
|
2658
|
-
e.save(), e.translateWithPrecision(t.startX + i, t.startY + a), e.fillStyle = "#565656", e.fill(
|
|
2681
|
+
e.save(), e.translateWithPrecision(t.startX + i, t.startY + a), e.fillStyle = "#565656", e.fill(Yi), e.restore();
|
|
2659
2682
|
}
|
|
2660
2683
|
// eslint-disable-next-line max-lines-per-function
|
|
2661
2684
|
drawWith(e, t, n, r) {
|
|
2662
|
-
var
|
|
2663
|
-
const { primaryWithCoord: o, row: i, col: a, style: l, data: s, subUnitId: d } = t, u = o.isMergedMainCell ? o.mergeInfo : o,
|
|
2685
|
+
var le, de;
|
|
2686
|
+
const { primaryWithCoord: o, row: i, col: a, style: l, data: s, subUnitId: d } = t, u = o.isMergedMainCell ? o.mergeInfo : o, h = s == null ? void 0 : s.fontRenderExtension, { leftOffset: c = 0, rightOffset: m = 0, topOffset: I = 0, downOffset: D = 0 } = h || {}, v = this._ensureMap(d), C = this._generateKey(i, a), f = o.isMergedMainCell ? o.mergeInfo.startRow : i, w = o.isMergedMainCell ? o.mergeInfo.startColumn : a, b = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, f, w);
|
|
2664
2687
|
if (!b)
|
|
2665
2688
|
return;
|
|
2666
|
-
const
|
|
2667
|
-
if (!
|
|
2689
|
+
const g = this._dataValidationModel.getValidator(b.type);
|
|
2690
|
+
if (!g)
|
|
2668
2691
|
return;
|
|
2669
2692
|
const p = {
|
|
2670
2693
|
startX: u.startX + c,
|
|
2671
2694
|
endX: u.endX - m,
|
|
2672
|
-
startY: u.startY +
|
|
2673
|
-
endY: u.endY -
|
|
2674
|
-
}, _ = p.endX - p.startX,
|
|
2675
|
-
this._drawDownIcon(e, p, _,
|
|
2676
|
-
let
|
|
2677
|
-
switch (
|
|
2678
|
-
case
|
|
2679
|
-
|
|
2695
|
+
startY: u.startY + I,
|
|
2696
|
+
endY: u.endY - D
|
|
2697
|
+
}, _ = p.endX - p.startX, T = p.endY - p.startY, { cl: A } = l || {}, P = (le = typeof A == "object" ? A == null ? void 0 : A.rgb : A) != null ? le : "#000", L = Le(l != null ? l : void 0), { vt: y, ht: O } = l || {}, U = y != null ? y : he.MIDDLE, k = (de = ie(s)) != null ? de : "", x = g.parseCellValue(k), te = g.getListWithColorMap(b), j = Zt(x, L, _, T);
|
|
2698
|
+
this._drawDownIcon(e, p, _, T, U), e.save(), e.translateWithPrecision(p.startX, p.startY), e.beginPath(), e.rect(0, 0, _ - Ae, T), e.clip(), e.translateWithPrecision(dn, Pt);
|
|
2699
|
+
let se = 0;
|
|
2700
|
+
switch (U) {
|
|
2701
|
+
case he.MIDDLE:
|
|
2702
|
+
se = (j.contentHeight - j.totalHeight) / 2;
|
|
2680
2703
|
break;
|
|
2681
|
-
case
|
|
2682
|
-
|
|
2704
|
+
case he.BOTTOM:
|
|
2705
|
+
se = j.contentHeight - j.totalHeight;
|
|
2683
2706
|
break;
|
|
2684
2707
|
}
|
|
2685
|
-
e.translateWithPrecision(0,
|
|
2708
|
+
e.translateWithPrecision(0, se), j.lines.forEach((Me, Q) => {
|
|
2686
2709
|
e.save();
|
|
2687
|
-
const { width:
|
|
2688
|
-
let
|
|
2689
|
-
switch (
|
|
2690
|
-
case
|
|
2691
|
-
|
|
2710
|
+
const { width: G, height: ce, items: ee } = Me;
|
|
2711
|
+
let q = 0;
|
|
2712
|
+
switch (O) {
|
|
2713
|
+
case Ee.RIGHT:
|
|
2714
|
+
q = j.contentWidth - G;
|
|
2692
2715
|
break;
|
|
2693
|
-
case
|
|
2694
|
-
|
|
2716
|
+
case Ee.CENTER:
|
|
2717
|
+
q = (j.contentWidth - G) / 2;
|
|
2695
2718
|
break;
|
|
2696
2719
|
}
|
|
2697
|
-
e.translate(
|
|
2698
|
-
e.save(), e.translateWithPrecision(
|
|
2720
|
+
e.translate(q, Q * (ce + Or)), ee.forEach((M) => {
|
|
2721
|
+
e.save(), e.translateWithPrecision(M.left, 0), Wi.drawWith(e, {
|
|
2699
2722
|
...L,
|
|
2700
|
-
info:
|
|
2701
|
-
color:
|
|
2702
|
-
fill:
|
|
2723
|
+
info: M,
|
|
2724
|
+
color: P,
|
|
2725
|
+
fill: te[M.text]
|
|
2703
2726
|
}), e.restore();
|
|
2704
2727
|
}), e.restore();
|
|
2705
|
-
}), e.restore(),
|
|
2728
|
+
}), e.restore(), v.set(C, {
|
|
2706
2729
|
left: p.startX,
|
|
2707
2730
|
top: p.startY,
|
|
2708
|
-
width:
|
|
2709
|
-
height:
|
|
2731
|
+
width: j.contentWidth + dn + Ae,
|
|
2732
|
+
height: j.contentHeight + Pt * 2
|
|
2710
2733
|
});
|
|
2711
2734
|
}
|
|
2712
2735
|
calcCellAutoHeight(e) {
|
|
2713
|
-
var
|
|
2714
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
|
2715
|
-
startX:
|
|
2716
|
-
endX:
|
|
2717
|
-
startY:
|
|
2718
|
-
endY:
|
|
2736
|
+
var g;
|
|
2737
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, h = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
|
2738
|
+
startX: h.startX + l,
|
|
2739
|
+
endX: h.endX - s,
|
|
2740
|
+
startY: h.startY + d,
|
|
2741
|
+
endY: h.endY - u
|
|
2719
2742
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2720
2743
|
if (!m)
|
|
2721
2744
|
return;
|
|
2722
|
-
const
|
|
2723
|
-
if (!
|
|
2745
|
+
const I = this._dataValidationModel.getValidator(m.type);
|
|
2746
|
+
if (!I)
|
|
2724
2747
|
return;
|
|
2725
|
-
const
|
|
2726
|
-
return
|
|
2748
|
+
const D = c.endX - c.startX, v = c.endY - c.startY, C = (g = ie(r)) != null ? g : "", f = I.parseCellValue(C), w = Le(n != null ? n : void 0);
|
|
2749
|
+
return Zt(f, w, D, v).cellAutoHeight;
|
|
2727
2750
|
}
|
|
2728
2751
|
calcCellAutoWidth(e) {
|
|
2729
|
-
var
|
|
2730
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
|
2731
|
-
startX:
|
|
2732
|
-
endX:
|
|
2733
|
-
startY:
|
|
2734
|
-
endY:
|
|
2752
|
+
var g;
|
|
2753
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, h = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
|
2754
|
+
startX: h.startX + l,
|
|
2755
|
+
endX: h.endX - s,
|
|
2756
|
+
startY: h.startY + d,
|
|
2757
|
+
endY: h.endY - u
|
|
2735
2758
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2736
2759
|
if (!m)
|
|
2737
2760
|
return;
|
|
2738
|
-
const
|
|
2739
|
-
if (!
|
|
2761
|
+
const I = this._dataValidationModel.getValidator(m.type);
|
|
2762
|
+
if (!I)
|
|
2740
2763
|
return;
|
|
2741
|
-
const
|
|
2742
|
-
return
|
|
2764
|
+
const D = c.endX - c.startX, v = c.endY - c.startY, C = (g = ie(r)) != null ? g : "", f = I.parseCellValue(C), w = Le(n != null ? n : void 0);
|
|
2765
|
+
return Zt(f, w, D, v).calcAutoWidth;
|
|
2743
2766
|
}
|
|
2744
2767
|
isHit(e, t) {
|
|
2745
2768
|
const { primaryWithCoord: n } = t, r = n.isMergedMainCell ? n.mergeInfo : n, { endX: o } = r, { x: i } = e;
|
|
2746
|
-
return i >= o -
|
|
2769
|
+
return i >= o - Ae && i <= o;
|
|
2747
2770
|
}
|
|
2748
2771
|
onPointerDown(e, t) {
|
|
2749
2772
|
if (t.button === 2)
|
|
@@ -2754,67 +2777,67 @@ let sn = class {
|
|
|
2754
2777
|
row: o,
|
|
2755
2778
|
column: i
|
|
2756
2779
|
};
|
|
2757
|
-
this._commandService.executeCommand(
|
|
2780
|
+
this._commandService.executeCommand(Ut.id, a);
|
|
2758
2781
|
}
|
|
2759
2782
|
onPointerEnter(e, t) {
|
|
2760
2783
|
var n, r;
|
|
2761
|
-
return (r = (n =
|
|
2784
|
+
return (r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null ? void 0 : r.setCursor(Ge.POINTER);
|
|
2762
2785
|
}
|
|
2763
2786
|
onPointerLeave(e, t) {
|
|
2764
2787
|
var n, r;
|
|
2765
|
-
return (r = (n =
|
|
2788
|
+
return (r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null ? void 0 : r.setCursor(Ge.DEFAULT);
|
|
2766
2789
|
}
|
|
2767
2790
|
};
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
],
|
|
2774
|
-
class
|
|
2791
|
+
cn = ji([
|
|
2792
|
+
It(0, oe),
|
|
2793
|
+
It(1, pe),
|
|
2794
|
+
It(2, E(xe)),
|
|
2795
|
+
It(3, E(ae))
|
|
2796
|
+
], cn);
|
|
2797
|
+
class Xi extends Ce {
|
|
2775
2798
|
constructor() {
|
|
2776
2799
|
super(...arguments);
|
|
2777
|
-
V(this, "id",
|
|
2778
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
2779
|
-
V(this, "dropdownType",
|
|
2800
|
+
V(this, "id", X.LIST_MULTIPLE);
|
|
2801
|
+
V(this, "canvasRender", this.injector.createInstance(cn));
|
|
2802
|
+
V(this, "dropdownType", fe.MULTIPLE_LIST);
|
|
2780
2803
|
}
|
|
2781
2804
|
}
|
|
2782
|
-
var
|
|
2783
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
2805
|
+
var Zi = Object.getOwnPropertyDescriptor, zi = (e, t, n, r) => {
|
|
2806
|
+
for (var o = r > 1 ? void 0 : r ? Zi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2784
2807
|
(a = e[i]) && (o = a(o) || o);
|
|
2785
2808
|
return o;
|
|
2786
|
-
},
|
|
2787
|
-
const
|
|
2788
|
-
function
|
|
2809
|
+
}, lt = (e, t) => (n, r) => t(n, r, e);
|
|
2810
|
+
const Xe = 4, wt = 4, me = 14, zt = 1, we = 6, Ze = 3, Kt = 8, Ki = "#565656", Wn = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
|
|
2811
|
+
function Hn(e, t, n, r, o, i, a = !0) {
|
|
2789
2812
|
let l = 0;
|
|
2790
|
-
const s = a ?
|
|
2813
|
+
const s = a ? Ze : 0;
|
|
2791
2814
|
switch (o) {
|
|
2792
|
-
case
|
|
2815
|
+
case he.BOTTOM:
|
|
2793
2816
|
l = t - r - s;
|
|
2794
2817
|
break;
|
|
2795
|
-
case
|
|
2818
|
+
case he.MIDDLE:
|
|
2796
2819
|
l = (t - r) / 2;
|
|
2797
2820
|
break;
|
|
2798
2821
|
default:
|
|
2799
2822
|
l = s;
|
|
2800
2823
|
break;
|
|
2801
2824
|
}
|
|
2802
|
-
l = Math.max(
|
|
2825
|
+
l = Math.max(Ze, l);
|
|
2803
2826
|
let d = 0;
|
|
2804
2827
|
switch (i) {
|
|
2805
|
-
case
|
|
2828
|
+
case Ee.CENTER:
|
|
2806
2829
|
d = (e - n) / 2;
|
|
2807
2830
|
break;
|
|
2808
|
-
case
|
|
2831
|
+
case Ee.RIGHT:
|
|
2809
2832
|
d = e - n;
|
|
2810
2833
|
break;
|
|
2811
2834
|
}
|
|
2812
|
-
return d = Math.max(
|
|
2835
|
+
return d = Math.max(we, d), {
|
|
2813
2836
|
paddingLeft: d,
|
|
2814
2837
|
paddingTop: l
|
|
2815
2838
|
};
|
|
2816
2839
|
}
|
|
2817
|
-
let
|
|
2840
|
+
let un = class {
|
|
2818
2841
|
constructor(e, t, n, r, o) {
|
|
2819
2842
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
2820
2843
|
V(this, "zIndex");
|
|
@@ -2828,174 +2851,174 @@ let ln = class {
|
|
|
2828
2851
|
return `${e}.${t}`;
|
|
2829
2852
|
}
|
|
2830
2853
|
_drawDownIcon(e, t, n, r, o, i, a) {
|
|
2831
|
-
const { t: l =
|
|
2854
|
+
const { t: l = re.pd.t, b: s = re.pd.b } = a, d = n - me;
|
|
2832
2855
|
let u;
|
|
2833
2856
|
switch (i) {
|
|
2834
|
-
case
|
|
2835
|
-
u = (r -
|
|
2857
|
+
case he.MIDDLE:
|
|
2858
|
+
u = (r - wt) / 2;
|
|
2836
2859
|
break;
|
|
2837
|
-
case
|
|
2838
|
-
u = r - s - o -
|
|
2860
|
+
case he.BOTTOM:
|
|
2861
|
+
u = r - s - o - Ze + (o / 2 - wt / 2);
|
|
2839
2862
|
break;
|
|
2840
2863
|
default:
|
|
2841
|
-
u = l +
|
|
2864
|
+
u = l + Ze + (o / 2 - wt / 2);
|
|
2842
2865
|
break;
|
|
2843
2866
|
}
|
|
2844
|
-
e.save(), e.translateWithPrecision(t.startX + d, t.startY + u), e.fillStyle = "#565656", e.fill(
|
|
2867
|
+
e.save(), e.translateWithPrecision(t.startX + d, t.startY + u), e.fillStyle = "#565656", e.fill(Wn), e.restore();
|
|
2845
2868
|
}
|
|
2846
2869
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2847
2870
|
drawWith(e, t, n) {
|
|
2848
|
-
var
|
|
2849
|
-
const { primaryWithCoord: r, row: o, col: i, style: a, data: l, subUnitId: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = r.isMergedMainCell ? r.mergeInfo.startRow : o,
|
|
2871
|
+
var te, j, se, le, de, Me;
|
|
2872
|
+
const { primaryWithCoord: r, row: o, col: i, style: a, data: l, subUnitId: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = r.isMergedMainCell ? r.mergeInfo.startRow : o, h = r.isMergedMainCell ? r.mergeInfo.startColumn : i, c = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, u, h);
|
|
2850
2873
|
if (!c)
|
|
2851
2874
|
return;
|
|
2852
2875
|
const m = this._dataValidationModel.getValidator(c.type);
|
|
2853
2876
|
if (!m)
|
|
2854
2877
|
return;
|
|
2855
|
-
const
|
|
2856
|
-
if (!c || !m || !m || m.id.indexOf(
|
|
2878
|
+
const I = l == null ? void 0 : l.fontRenderExtension, { leftOffset: D = 0, rightOffset: v = 0, topOffset: C = 0, downOffset: f = 0 } = I || {};
|
|
2879
|
+
if (!c || !m || !m || m.id.indexOf(X.LIST) !== 0 || !m.skipDefaultFontRender(c))
|
|
2857
2880
|
return;
|
|
2858
|
-
const
|
|
2859
|
-
startX: d.startX +
|
|
2860
|
-
endX: d.endX -
|
|
2861
|
-
startY: d.startY +
|
|
2862
|
-
endY: d.endY -
|
|
2863
|
-
}, b =
|
|
2864
|
-
let { tb: y, vt:
|
|
2865
|
-
y = y != null ? y :
|
|
2866
|
-
const
|
|
2867
|
-
if (c.renderMode ===
|
|
2868
|
-
const { l:
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
y ===
|
|
2872
|
-
|
|
2881
|
+
const w = {
|
|
2882
|
+
startX: d.startX + D,
|
|
2883
|
+
endX: d.endX - v,
|
|
2884
|
+
startY: d.startY + C,
|
|
2885
|
+
endY: d.endY - f
|
|
2886
|
+
}, b = w.endX - w.startX, g = w.endY - w.startY, p = this._ensureMap(s), _ = this._generateKey(o, i), T = m.getListWithColorMap(c), A = ie(l), P = `${A != null ? A : ""}`, L = T[P];
|
|
2887
|
+
let { tb: y, vt: O, ht: U, pd: k } = a || {};
|
|
2888
|
+
y = y != null ? y : Se.WRAP, O = O != null ? O : he.BOTTOM, U = U != null ? U : re.ht, k = k != null ? k : re.pd;
|
|
2889
|
+
const x = Le(a).fontCache;
|
|
2890
|
+
if (c.renderMode === ue.ARROW) {
|
|
2891
|
+
const { l: Q = re.pd.l, t: G = re.pd.t, r: ce = re.pd.r, b: ee = re.pd.b } = k, q = b - Q - ce - me - 4, M = new at(
|
|
2892
|
+
P,
|
|
2893
|
+
x,
|
|
2894
|
+
y === Se.WRAP,
|
|
2895
|
+
q,
|
|
2873
2896
|
1 / 0
|
|
2874
2897
|
);
|
|
2875
|
-
|
|
2876
|
-
const
|
|
2877
|
-
this._drawDownIcon(e,
|
|
2878
|
-
text:
|
|
2879
|
-
fontStyle:
|
|
2880
|
-
width:
|
|
2881
|
-
height:
|
|
2882
|
-
color: (
|
|
2883
|
-
strokeLine: !!((
|
|
2884
|
-
underline: !!((
|
|
2885
|
-
warp: y ===
|
|
2886
|
-
hAlign:
|
|
2887
|
-
},
|
|
2888
|
-
left:
|
|
2889
|
-
top:
|
|
2890
|
-
width:
|
|
2891
|
-
height:
|
|
2898
|
+
M.calculate();
|
|
2899
|
+
const $ = M.getTotalWidth(), N = M.getTotalHeight(), { paddingTop: J, paddingLeft: R } = Hn(q, g - G - ee, $, N, O, U, !0);
|
|
2900
|
+
this._drawDownIcon(e, w, b, g, N, O, k), e.save(), e.translateWithPrecision(w.startX + Q, w.startY + G), e.beginPath(), e.rect(0, 0, b - Q - ce, g - G - ee), e.clip(), e.translateWithPrecision(0, J), e.save(), e.translateWithPrecision(R, 0), e.beginPath(), e.rect(0, 0, q, N), e.clip(), Vn.drawWith(e, {
|
|
2901
|
+
text: P,
|
|
2902
|
+
fontStyle: x,
|
|
2903
|
+
width: q,
|
|
2904
|
+
height: N,
|
|
2905
|
+
color: (te = a == null ? void 0 : a.cl) == null ? void 0 : te.rgb,
|
|
2906
|
+
strokeLine: !!((j = a == null ? void 0 : a.st) != null && j.s),
|
|
2907
|
+
underline: !!((se = a == null ? void 0 : a.ul) != null && se.s),
|
|
2908
|
+
warp: y === Se.WRAP,
|
|
2909
|
+
hAlign: Ee.LEFT
|
|
2910
|
+
}, M), e.restore(), e.restore(), p.set(_, {
|
|
2911
|
+
left: w.endX - me + n.rowHeaderWidth,
|
|
2912
|
+
top: w.startY + G + n.columnHeaderHeight,
|
|
2913
|
+
width: me,
|
|
2914
|
+
height: g - G - ee
|
|
2892
2915
|
});
|
|
2893
2916
|
} else {
|
|
2894
|
-
e.save(), e.translateWithPrecision(
|
|
2895
|
-
const
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
y ===
|
|
2899
|
-
|
|
2917
|
+
e.save(), e.translateWithPrecision(w.startX, w.startY), e.beginPath(), e.rect(0, 0, b, g), e.clip();
|
|
2918
|
+
const Q = b - we * 2 - Xe - me - 4, G = new at(
|
|
2919
|
+
P,
|
|
2920
|
+
x,
|
|
2921
|
+
y === Se.WRAP,
|
|
2922
|
+
Q,
|
|
2900
2923
|
1 / 0
|
|
2901
2924
|
);
|
|
2902
|
-
|
|
2903
|
-
const
|
|
2904
|
-
e.translateWithPrecision(
|
|
2905
|
-
width:
|
|
2906
|
-
height:
|
|
2907
|
-
fill: L ||
|
|
2908
|
-
radius:
|
|
2909
|
-
}), e.save(), e.translateWithPrecision(
|
|
2910
|
-
text:
|
|
2911
|
-
fontStyle:
|
|
2912
|
-
width:
|
|
2913
|
-
height:
|
|
2914
|
-
color: (
|
|
2915
|
-
strokeLine: !!((
|
|
2916
|
-
underline: !!((
|
|
2917
|
-
warp: y ===
|
|
2918
|
-
hAlign:
|
|
2919
|
-
},
|
|
2920
|
-
left:
|
|
2921
|
-
top:
|
|
2922
|
-
width:
|
|
2923
|
-
height:
|
|
2925
|
+
G.calculate();
|
|
2926
|
+
const ce = G.getTotalWidth(), ee = G.getTotalHeight(), q = ee + zt * 2, M = Math.max(b - we * 2, 1), { paddingTop: $ } = Hn(M, g, ce, q, O, U);
|
|
2927
|
+
e.translateWithPrecision(we, $), qn.drawWith(e, {
|
|
2928
|
+
width: M,
|
|
2929
|
+
height: q,
|
|
2930
|
+
fill: L || ke,
|
|
2931
|
+
radius: Kt
|
|
2932
|
+
}), e.save(), e.translateWithPrecision(Xe, zt), e.beginPath(), e.rect(0, 0, Q, ee), e.clip(), Vn.drawWith(e, {
|
|
2933
|
+
text: P,
|
|
2934
|
+
fontStyle: x,
|
|
2935
|
+
width: Q,
|
|
2936
|
+
height: ee,
|
|
2937
|
+
color: (le = a == null ? void 0 : a.cl) == null ? void 0 : le.rgb,
|
|
2938
|
+
strokeLine: !!((de = a == null ? void 0 : a.st) != null && de.s),
|
|
2939
|
+
underline: !!((Me = a == null ? void 0 : a.ul) != null && Me.s),
|
|
2940
|
+
warp: y === Se.WRAP,
|
|
2941
|
+
hAlign: Ee.LEFT
|
|
2942
|
+
}, G), e.restore(), e.translateWithPrecision(Q + Xe + 4, (ee - wt) / 2), e.fillStyle = Ki, e.fill(Wn), e.restore(), p.set(_, {
|
|
2943
|
+
left: w.startX + we + n.rowHeaderWidth,
|
|
2944
|
+
top: w.startY + $ + n.columnHeaderHeight,
|
|
2945
|
+
width: M,
|
|
2946
|
+
height: q
|
|
2924
2947
|
});
|
|
2925
2948
|
}
|
|
2926
2949
|
}
|
|
2927
2950
|
calcCellAutoHeight(e) {
|
|
2928
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset:
|
|
2929
|
-
if (!c || c.renderMode ===
|
|
2951
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2952
|
+
if (!c || c.renderMode === ue.TEXT)
|
|
2930
2953
|
return;
|
|
2931
2954
|
const m = {
|
|
2932
2955
|
startX: a.startX + s,
|
|
2933
2956
|
endX: a.endX - d,
|
|
2934
2957
|
startY: a.startY + u,
|
|
2935
|
-
endY: a.endY -
|
|
2936
|
-
},
|
|
2937
|
-
let { tb:
|
|
2938
|
-
const { t:
|
|
2939
|
-
if (
|
|
2940
|
-
const { l:
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2958
|
+
endY: a.endY - h
|
|
2959
|
+
}, I = m.endX - m.startX, D = ie(r), v = `${D != null ? D : ""}`;
|
|
2960
|
+
let { tb: C, pd: f } = n || {};
|
|
2961
|
+
const { t: w = re.pd.t, b = re.pd.b } = f != null ? f : {};
|
|
2962
|
+
if (C = C != null ? C : Se.WRAP, c.renderMode === ue.ARROW) {
|
|
2963
|
+
const { l: g = re.pd.l, r: p = re.pd.r } = f != null ? f : {}, _ = I - g - p - me - 4, T = new at(
|
|
2964
|
+
v,
|
|
2965
|
+
Le(n).fontCache,
|
|
2966
|
+
C === Se.WRAP,
|
|
2944
2967
|
_,
|
|
2945
2968
|
1 / 0
|
|
2946
2969
|
);
|
|
2947
|
-
return
|
|
2970
|
+
return T.calculate(), T.getTotalHeight() + w + b + Ze * 2;
|
|
2948
2971
|
} else {
|
|
2949
|
-
const
|
|
2950
|
-
R,
|
|
2951
|
-
Ve(n).fontCache,
|
|
2952
|
-
w === ve.WRAP,
|
|
2972
|
+
const g = Math.max(I - we * 2 - Xe - me - 4, 10), p = new at(
|
|
2953
2973
|
v,
|
|
2974
|
+
Le(n).fontCache,
|
|
2975
|
+
C === Se.WRAP,
|
|
2976
|
+
g,
|
|
2954
2977
|
1 / 0
|
|
2955
2978
|
);
|
|
2956
|
-
return p.calculate(), p.getTotalHeight() +
|
|
2979
|
+
return p.calculate(), p.getTotalHeight() + Ze * 2 + zt * 2;
|
|
2957
2980
|
}
|
|
2958
2981
|
}
|
|
2959
2982
|
calcCellAutoWidth(e) {
|
|
2960
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset:
|
|
2961
|
-
if (!c || c.renderMode ===
|
|
2983
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2984
|
+
if (!c || c.renderMode === ue.TEXT)
|
|
2962
2985
|
return;
|
|
2963
2986
|
const m = {
|
|
2964
2987
|
startX: a.startX + s,
|
|
2965
2988
|
endX: a.endX - d,
|
|
2966
2989
|
startY: a.startY + u,
|
|
2967
|
-
endY: a.endY -
|
|
2968
|
-
},
|
|
2969
|
-
let { tb:
|
|
2970
|
-
const { l:
|
|
2971
|
-
|
|
2972
|
-
let
|
|
2990
|
+
endY: a.endY - h
|
|
2991
|
+
}, I = m.endX - m.startX, D = ie(r), v = `${D != null ? D : ""}`;
|
|
2992
|
+
let { tb: C, pd: f } = n || {};
|
|
2993
|
+
const { l: w = re.pd.l, r: b = re.pd.r } = f != null ? f : {};
|
|
2994
|
+
C = C != null ? C : Se.WRAP;
|
|
2995
|
+
let g = we * 2 + me;
|
|
2973
2996
|
switch (c.renderMode) {
|
|
2974
|
-
case
|
|
2975
|
-
|
|
2997
|
+
case ue.ARROW:
|
|
2998
|
+
g = me + 4 + b + w;
|
|
2976
2999
|
break;
|
|
2977
|
-
case
|
|
2978
|
-
|
|
3000
|
+
case ue.CUSTOM:
|
|
3001
|
+
g = me + we * 2 + Xe * 2 + b + w + Kt / 2 + 1;
|
|
2979
3002
|
break;
|
|
2980
3003
|
// default is CUSTOM
|
|
2981
3004
|
default:
|
|
2982
|
-
|
|
3005
|
+
g = me + we * 2 + Xe * 2 + b + w + Kt / 2 + 1;
|
|
2983
3006
|
}
|
|
2984
|
-
const p =
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
3007
|
+
const p = I - g, _ = new at(
|
|
3008
|
+
v,
|
|
3009
|
+
Le(n).fontCache,
|
|
3010
|
+
C === Se.WRAP,
|
|
2988
3011
|
p,
|
|
2989
3012
|
1 / 0
|
|
2990
3013
|
);
|
|
2991
|
-
return _.calculate(), _.getTotalWidth() +
|
|
3014
|
+
return _.calculate(), _.getTotalWidth() + g;
|
|
2992
3015
|
}
|
|
2993
3016
|
isHit(e, t) {
|
|
2994
3017
|
const { subUnitId: n, row: r, col: o } = t, a = this._ensureMap(n).get(this._generateKey(r, o)), l = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, r, o);
|
|
2995
|
-
if (!l || !a || l.renderMode ===
|
|
3018
|
+
if (!l || !a || l.renderMode === ue.TEXT)
|
|
2996
3019
|
return !1;
|
|
2997
|
-
const { top: s, left: d, width: u, height:
|
|
2998
|
-
return c >= d && c <= d + u && m >= s && m <= s +
|
|
3020
|
+
const { top: s, left: d, width: u, height: h } = a, { x: c, y: m } = e;
|
|
3021
|
+
return c >= d && c <= d + u && m >= s && m <= s + h;
|
|
2999
3022
|
}
|
|
3000
3023
|
onPointerDown(e, t) {
|
|
3001
3024
|
if (t.button === 2)
|
|
@@ -3006,64 +3029,64 @@ let ln = class {
|
|
|
3006
3029
|
row: o,
|
|
3007
3030
|
column: i
|
|
3008
3031
|
};
|
|
3009
|
-
this._commandService.executeCommand(
|
|
3032
|
+
this._commandService.executeCommand(Ut.id, a);
|
|
3010
3033
|
}
|
|
3011
3034
|
onPointerEnter(e, t) {
|
|
3012
3035
|
var n, r;
|
|
3013
|
-
(r = (n =
|
|
3036
|
+
(r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ge.POINTER);
|
|
3014
3037
|
}
|
|
3015
3038
|
onPointerLeave(e, t) {
|
|
3016
3039
|
var n, r;
|
|
3017
|
-
(r = (n =
|
|
3040
|
+
(r = (n = Ke(H.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ge.DEFAULT);
|
|
3018
3041
|
}
|
|
3019
3042
|
};
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
],
|
|
3027
|
-
class
|
|
3043
|
+
un = zi([
|
|
3044
|
+
lt(0, pe),
|
|
3045
|
+
lt(1, E(ge)),
|
|
3046
|
+
lt(2, oe),
|
|
3047
|
+
lt(3, E(xe)),
|
|
3048
|
+
lt(4, E(ae))
|
|
3049
|
+
], un);
|
|
3050
|
+
class Gi extends Ce {
|
|
3028
3051
|
constructor() {
|
|
3029
3052
|
super(...arguments);
|
|
3030
|
-
V(this, "id",
|
|
3031
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
3032
|
-
V(this, "dropdownType",
|
|
3033
|
-
V(this, "optionsInput",
|
|
3034
|
-
V(this, "formulaInput",
|
|
3053
|
+
V(this, "id", X.LIST);
|
|
3054
|
+
V(this, "canvasRender", this.injector.createInstance(un));
|
|
3055
|
+
V(this, "dropdownType", fe.LIST);
|
|
3056
|
+
V(this, "optionsInput", Ot.componentKey);
|
|
3057
|
+
V(this, "formulaInput", mn);
|
|
3035
3058
|
}
|
|
3036
3059
|
}
|
|
3037
|
-
class
|
|
3060
|
+
class qi extends Ce {
|
|
3038
3061
|
constructor() {
|
|
3039
3062
|
super(...arguments);
|
|
3040
|
-
V(this, "id",
|
|
3041
|
-
V(this, "formulaInput",
|
|
3063
|
+
V(this, "id", X.TEXT_LENGTH);
|
|
3064
|
+
V(this, "formulaInput", kt);
|
|
3042
3065
|
}
|
|
3043
3066
|
}
|
|
3044
|
-
class
|
|
3067
|
+
class Ji extends Ce {
|
|
3045
3068
|
constructor() {
|
|
3046
3069
|
super(...arguments);
|
|
3047
|
-
V(this, "id",
|
|
3048
|
-
V(this, "formulaInput",
|
|
3070
|
+
V(this, "id", X.WHOLE);
|
|
3071
|
+
V(this, "formulaInput", kt);
|
|
3049
3072
|
}
|
|
3050
3073
|
}
|
|
3051
|
-
var
|
|
3052
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
3074
|
+
var Qi = Object.getOwnPropertyDescriptor, ea = (e, t, n, r) => {
|
|
3075
|
+
for (var o = r > 1 ? void 0 : r ? Qi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3053
3076
|
(a = e[i]) && (o = a(o) || o);
|
|
3054
3077
|
return o;
|
|
3055
|
-
},
|
|
3056
|
-
let
|
|
3078
|
+
}, Gt = (e, t) => (n, r) => t(n, r, e);
|
|
3079
|
+
let rt = class extends pn {
|
|
3057
3080
|
constructor(e, t, n) {
|
|
3058
3081
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = n, this._initComponents(), this._registerValidatorViews();
|
|
3059
3082
|
}
|
|
3060
3083
|
_initComponents() {
|
|
3061
3084
|
[
|
|
3062
|
-
["DataValidationIcon",
|
|
3063
|
-
[
|
|
3064
|
-
[
|
|
3065
|
-
[
|
|
3066
|
-
...
|
|
3085
|
+
["DataValidationIcon", br],
|
|
3086
|
+
[Vt, Si],
|
|
3087
|
+
[Ot.componentKey, Ot],
|
|
3088
|
+
[At.componentKey, At],
|
|
3089
|
+
...bi
|
|
3067
3090
|
].forEach(([e, t]) => {
|
|
3068
3091
|
this.disposeWithMe(this._componentManger.register(
|
|
3069
3092
|
e,
|
|
@@ -3073,146 +3096,146 @@ let et = class extends cn {
|
|
|
3073
3096
|
}
|
|
3074
3097
|
_registerValidatorViews() {
|
|
3075
3098
|
[
|
|
3099
|
+
Fi,
|
|
3100
|
+
Ji,
|
|
3101
|
+
qi,
|
|
3102
|
+
Ui,
|
|
3076
3103
|
Li,
|
|
3077
|
-
|
|
3078
|
-
Zi,
|
|
3079
|
-
Pi,
|
|
3080
|
-
Ti,
|
|
3104
|
+
Gi,
|
|
3081
3105
|
Xi,
|
|
3082
|
-
|
|
3083
|
-
Oi
|
|
3106
|
+
ki
|
|
3084
3107
|
].forEach((e) => {
|
|
3085
3108
|
const t = this._injector.createInstance(e), n = this._dataValidatorRegistryService.getValidatorItem(t.id);
|
|
3086
3109
|
n && (n.formulaInput = t.formulaInput, n.canvasRender = t.canvasRender, n.dropdownType = t.dropdownType, n.optionsInput = t.optionsInput);
|
|
3087
3110
|
});
|
|
3088
3111
|
}
|
|
3089
3112
|
};
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
],
|
|
3095
|
-
var
|
|
3096
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
3113
|
+
rt = ea([
|
|
3114
|
+
Gt(0, E(Ve)),
|
|
3115
|
+
Gt(1, E(Sn)),
|
|
3116
|
+
Gt(2, E(Te))
|
|
3117
|
+
], rt);
|
|
3118
|
+
var ta = Object.getOwnPropertyDescriptor, na = (e, t, n, r) => {
|
|
3119
|
+
for (var o = r > 1 ? void 0 : r ? ta(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3097
3120
|
(a = e[i]) && (o = a(o) || o);
|
|
3098
3121
|
return o;
|
|
3099
|
-
},
|
|
3100
|
-
const
|
|
3101
|
-
var
|
|
3102
|
-
let
|
|
3103
|
-
constructor(e =
|
|
3122
|
+
}, qt = (e, t) => (n, r) => t(n, r, e);
|
|
3123
|
+
const ra = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
|
3124
|
+
var Rt;
|
|
3125
|
+
let jn = (Rt = class extends Kn {
|
|
3126
|
+
constructor(e = Dt, t, n, r) {
|
|
3104
3127
|
super(), this._config = e, this._injector = t, this._commandService = n, this._configService = r;
|
|
3105
|
-
const { menu: o, ...i } =
|
|
3128
|
+
const { menu: o, ...i } = Gn(
|
|
3106
3129
|
{},
|
|
3107
|
-
|
|
3130
|
+
Dt,
|
|
3108
3131
|
this._config
|
|
3109
3132
|
);
|
|
3110
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
3133
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Et, i);
|
|
3111
3134
|
}
|
|
3112
3135
|
onStarting() {
|
|
3113
3136
|
[
|
|
3114
|
-
[
|
|
3115
|
-
[
|
|
3116
|
-
[
|
|
3117
|
-
[Ge],
|
|
3137
|
+
[_e],
|
|
3138
|
+
[$e],
|
|
3139
|
+
[gt],
|
|
3118
3140
|
[Qe],
|
|
3119
|
-
[
|
|
3120
|
-
[
|
|
3121
|
-
[et]
|
|
3141
|
+
[nt],
|
|
3142
|
+
[tt],
|
|
3143
|
+
[et],
|
|
3144
|
+
[rt]
|
|
3122
3145
|
].forEach((e) => {
|
|
3123
3146
|
this._injector.add(e);
|
|
3124
3147
|
}), [
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3148
|
+
Ft,
|
|
3149
|
+
Ut,
|
|
3150
|
+
Ir,
|
|
3151
|
+
wn,
|
|
3152
|
+
Be,
|
|
3153
|
+
Cr
|
|
3131
3154
|
].forEach((e) => {
|
|
3132
3155
|
this._commandService.registerCommand(e);
|
|
3133
3156
|
});
|
|
3134
3157
|
}
|
|
3135
3158
|
onReady() {
|
|
3136
|
-
this._injector.get(
|
|
3137
|
-
|
|
3138
|
-
[
|
|
3159
|
+
this._injector.get(et), this._injector.get(tt), this._injector.get(xe).registerRenderModule(
|
|
3160
|
+
H.UNIVER_SHEET,
|
|
3161
|
+
[Tt]
|
|
3139
3162
|
);
|
|
3140
3163
|
}
|
|
3141
3164
|
onRendered() {
|
|
3142
|
-
this._injector.get(
|
|
3165
|
+
this._injector.get(rt), this._injector.get(nt);
|
|
3143
3166
|
}
|
|
3144
3167
|
onSteady() {
|
|
3145
|
-
this._injector.get(
|
|
3146
|
-
}
|
|
3147
|
-
}, V(
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
],
|
|
3153
|
-
var
|
|
3154
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
3168
|
+
this._injector.get(Qe);
|
|
3169
|
+
}
|
|
3170
|
+
}, V(Rt, "pluginName", ra), V(Rt, "type", H.UNIVER_SHEET), Rt);
|
|
3171
|
+
jn = na([
|
|
3172
|
+
qt(1, E(Ve)),
|
|
3173
|
+
qt(2, oe),
|
|
3174
|
+
qt(3, hn)
|
|
3175
|
+
], jn);
|
|
3176
|
+
var oa = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, aa = (e, t, n) => t in e ? oa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, sa = (e, t, n, r) => {
|
|
3177
|
+
for (var o = r > 1 ? void 0 : r ? ia(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3155
3178
|
(a = e[i]) && (o = a(o) || o);
|
|
3156
3179
|
return o;
|
|
3157
|
-
},
|
|
3158
|
-
const
|
|
3159
|
-
let
|
|
3160
|
-
constructor(e =
|
|
3180
|
+
}, Jt = (e, t) => (n, r) => t(n, r, e), Ar = (e, t, n) => aa(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3181
|
+
const la = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
|
3182
|
+
let Lt = class extends Kn {
|
|
3183
|
+
constructor(e = Dt, t, n, r) {
|
|
3161
3184
|
super(), this._config = e, this._injector = t, this._commandService = n, this._configService = r;
|
|
3162
|
-
const { menu: o, ...i } =
|
|
3185
|
+
const { menu: o, ...i } = Gn(
|
|
3163
3186
|
{},
|
|
3164
|
-
|
|
3187
|
+
Dt,
|
|
3165
3188
|
this._config
|
|
3166
3189
|
);
|
|
3167
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
3190
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Et, i);
|
|
3168
3191
|
}
|
|
3169
3192
|
onStarting() {
|
|
3170
3193
|
[
|
|
3171
|
-
[
|
|
3172
|
-
[
|
|
3173
|
-
[
|
|
3174
|
-
[Ge],
|
|
3194
|
+
[_e],
|
|
3195
|
+
[$e],
|
|
3196
|
+
[gt],
|
|
3175
3197
|
[Qe],
|
|
3198
|
+
[nt],
|
|
3199
|
+
[tt],
|
|
3200
|
+
[et],
|
|
3176
3201
|
[Je],
|
|
3177
|
-
[
|
|
3178
|
-
[Ke],
|
|
3179
|
-
[et]
|
|
3202
|
+
[rt]
|
|
3180
3203
|
].forEach((e) => {
|
|
3181
3204
|
this._injector.add(e);
|
|
3182
3205
|
}), [
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3206
|
+
Ft,
|
|
3207
|
+
Ut,
|
|
3208
|
+
Ir,
|
|
3209
|
+
wn,
|
|
3210
|
+
Be,
|
|
3211
|
+
Cr
|
|
3189
3212
|
].forEach((e) => {
|
|
3190
3213
|
this._commandService.registerCommand(e);
|
|
3191
3214
|
});
|
|
3192
3215
|
}
|
|
3193
3216
|
onReady() {
|
|
3194
|
-
this._injector.get(
|
|
3195
|
-
|
|
3196
|
-
[
|
|
3217
|
+
this._injector.get(et), this._injector.get(tt), this._injector.get(Je), this._injector.get(gt), this._injector.get(xe).registerRenderModule(
|
|
3218
|
+
H.UNIVER_SHEET,
|
|
3219
|
+
[Tt]
|
|
3197
3220
|
);
|
|
3198
3221
|
}
|
|
3199
3222
|
onRendered() {
|
|
3200
|
-
this._injector.get(
|
|
3223
|
+
this._injector.get(rt), this._injector.get(nt);
|
|
3201
3224
|
}
|
|
3202
3225
|
onSteady() {
|
|
3203
|
-
this._injector.get(
|
|
3226
|
+
this._injector.get(Qe);
|
|
3204
3227
|
}
|
|
3205
3228
|
};
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
],
|
|
3229
|
+
Ar(Lt, "pluginName", la);
|
|
3230
|
+
Ar(Lt, "type", H.UNIVER_SHEET);
|
|
3231
|
+
Lt = sa([
|
|
3232
|
+
Zr(vo),
|
|
3233
|
+
Jt(1, E(Ve)),
|
|
3234
|
+
Jt(2, oe),
|
|
3235
|
+
Jt(3, hn)
|
|
3236
|
+
], Lt);
|
|
3214
3237
|
export {
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3238
|
+
Ce as BaseSheetDataValidatorView,
|
|
3239
|
+
jn as UniverSheetsDataValidationMobileUIPlugin,
|
|
3240
|
+
Lt as UniverSheetsDataValidationUIPlugin
|
|
3218
3241
|
};
|