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