@univerjs/sheets-data-validation-ui 0.15.0-insiders.20251227-c108ce3 → 0.15.0-insiders.20260107-3441c7a
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 +728 -727
- package/lib/index.js +728 -727
- package/lib/types/controllers/config.schema.d.ts +9 -0
- package/lib/umd/index.js +2 -2
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Tr = Object.defineProperty;
|
|
2
2
|
var Or = (e, t, n) => t in e ? Tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var V = (e, t, n) => Or(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { Disposable as Re, UniverInstanceType as
|
|
4
|
+
import { Disposable as Re, UniverInstanceType as Z, toDisposable as Ar, IUniverInstanceService as le, Inject as D, LocaleService as de, DataValidationErrorStyle as st, DataValidationStatus as Ye, ICommandService as te, Injector as ye, IConfigService as dn, DataValidationRenderMode as ae, DisposableCollection as Pr, dayjs as Nt, numfmt as Wn, CellValueType as Lr, CommandType as tt, DataValidationType as Y, ObjectMatrix as wt, Range as kr, Rectangle as It, queryObjectMatrix as zt, Optional as Nr, RxDisposable as cn, InterceptorEffectEnum as Hn, sequenceExecute as jn, bufferDebounceTime as Ur, debounce as Fr, UndoCommand as $r, RedoCommand as xr, isUnitRangesEqual as Br, shallowEqual as Rn, ThemeService as Yn, ColorKit as Wr, isFormulaString as De, generateRandomId as yn, VerticalAlign as se, HorizontalAlign as Ie, DEFAULT_STYLES as ee, WrapStrategy as ve, Plugin as Xn, merge as Zn, DependentOn as Hr } from "@univerjs/core";
|
|
5
5
|
import { DeviceInputEventType as pt, IRenderManagerService as Ue, fixLineWidthByScale as Mn, Transform as jr, CheckboxShape as Yr, getCurrentTypeOfRenderer as Xe, CURSOR_TYPE as Ze, FontCache as Xr, Shape as Zr, Rect as Kn, getFontStyleString as Ve, DocSimpleSkeleton as rt, Text as bn } from "@univerjs/engine-render";
|
|
6
|
-
import { SheetInterceptorService as
|
|
7
|
-
import { SheetDataValidationModel as oe, SheetsDataValidationValidatorService as Jr, getDataValidationCellValue as
|
|
8
|
-
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as pe, DataValidationModel as
|
|
9
|
-
import { ISidebarService as sr, IDialogService as uo, IZenZoneService as lr, KeyCode as gt, MenuItemType as
|
|
10
|
-
import { filter as
|
|
6
|
+
import { SheetInterceptorService as un, VALIDATE_CELL as Kr, SheetsSelectionsService as Gn, SetRangeValuesCommand as at, getSheetCommandTarget as zn, rangeToDiscreteRange as Gr, SheetPermissionCheckController as zr, WorksheetEditPermission as qt, WorksheetSetCellStylePermission as Jt, RangeProtectionPermissionEditPoint as Qt, WorkbookEditablePermission as en, INTERCEPTOR_POINT as qn, InterceptCellContentPriority as Jn, checkRangesEditablePermission as qr } from "@univerjs/sheets";
|
|
7
|
+
import { SheetDataValidationModel as oe, SheetsDataValidationValidatorService as Jr, getDataValidationCellValue as Ut, getCellValueOrigin as re, serializeListOptions as Qn, createDefaultNewRule as er, AddSheetDataValidationCommand as hn, DATA_VALIDATION_PLUGIN_NAME as tr, getDataValidationDiffMutations as tn, UpdateSheetDataValidationRangeCommand as nr, DataValidationCacheService as rr, UpdateSheetDataValidationSettingCommand as En, UpdateSheetDataValidationOptionsCommand as Qr, RemoveSheetDataValidationCommand as or, RemoveSheetAllDataValidationCommand as eo, DataValidationFormulaController as to, deserializeListOptions as no, CUSTOM_FORMULA_INPUT_NAME as ir, BASE_FORMULA_INPUT_NAME as At, LIST_FORMULA_INPUT_NAME as pn, CHECKBOX_FORMULA_INPUT_NAME as ar, DataValidationFormulaService as ro, CHECKBOX_FORMULA_2 as oo, CHECKBOX_FORMULA_1 as io, getFormulaResult as Ft, isLegalFormulaResult as Dn, transformCheckboxValue as ao, UniverSheetsDataValidationPlugin as so } from "@univerjs/sheets-data-validation";
|
|
8
|
+
import { DataValidatorRegistryService as Me, DataValidatorDropdownType as pe, DataValidationModel as gn, DataValidatorRegistryScope as lo, TWO_FORMULA_OPERATOR_COUNT as co, getRuleOptions as Vn, getRuleSetting as Tn } from "@univerjs/data-validation";
|
|
9
|
+
import { ISidebarService as sr, IDialogService as uo, IZenZoneService as lr, KeyCode as gt, MenuItemType as vn, getMenuHiddenObservable as ho, RibbonDataGroup as po, IMenuManagerService as go, useDependency as F, ComponentManager as mn, useObservable as Oe, useEvent as nn, useSidebarClick as dr } from "@univerjs/ui";
|
|
10
|
+
import { filter as fn, BehaviorSubject as On, distinctUntilChanged as vo, Subject as mo, debounceTime as cr, bufferTime as ur, of as fo } from "rxjs";
|
|
11
11
|
import { getPatternType as _o } from "@univerjs/sheets-numfmt";
|
|
12
|
-
import { ISheetCellDropdownManagerService as Co, IEditorBridgeService as hr, SetCellEditVisibleOperation as vt, HoverManagerService as So, CellAlertManagerService as
|
|
13
|
-
import { Button as Ke, FormLayout as
|
|
14
|
-
import { createElement as
|
|
15
|
-
import { jsxs as
|
|
12
|
+
import { ISheetCellDropdownManagerService as Co, IEditorBridgeService as hr, SetCellEditVisibleOperation as vt, HoverManagerService as So, CellAlertManagerService as wo, CellAlertType as Io, IAutoFillService as Ro, APPLY_TYPE as ot, virtualizeDiscreteRanges as rn, getAutoFillRepeatRange as yo, ISheetClipboardService as Mo, COPY_TYPE as An, PREDEFINED_HOOK_NAME_PASTE as mt, getRepeatRange as Pn, getCurrentRangeDisable$ as bo, AutoHeightController as pr, SheetSkeletonManagerService as lt, IMarkSelectionService as Eo } from "@univerjs/sheets-ui";
|
|
13
|
+
import { Button as Ke, FormLayout as X, RadioGroup as _n, Radio as Ae, Checkbox as Pt, Input as Pe, Select as Ln, clsx as ke, borderClassName as Rt, DraggableList as Do, Dropdown as Vo } from "@univerjs/design";
|
|
14
|
+
import { createElement as we, useRef as ht, forwardRef as nt, useState as W, useMemo as dt, useEffect as Le } from "react";
|
|
15
|
+
import { jsxs as j, Fragment as ct, jsx as C } from "react/jsx-runtime";
|
|
16
16
|
import { deserializeRangeWithSheet as To, serializeRange as gr } from "@univerjs/engine-formula";
|
|
17
17
|
import { RangeSelector as Oo, FormulaEditor as vr } from "@univerjs/sheets-formula-ui";
|
|
18
18
|
var Ao = Object.getOwnPropertyDescriptor, Po = (e, t, n, r) => {
|
|
@@ -30,11 +30,11 @@ let me = class extends Re {
|
|
|
30
30
|
V(this, "activeRule$", this._activeRule$.asObservable());
|
|
31
31
|
V(this, "_closeDisposable", null);
|
|
32
32
|
this._univerInstanceService = t, this._sidebarService = n, this.disposeWithMe(
|
|
33
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
33
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Z.UNIVER_SHEET).pipe(fn((r) => !r)).subscribe(() => {
|
|
34
34
|
this.close();
|
|
35
35
|
})
|
|
36
36
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((r) => {
|
|
37
|
-
r.id ===
|
|
37
|
+
r.id === bt && (r.visible || setTimeout(() => {
|
|
38
38
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
|
39
39
|
}));
|
|
40
40
|
}));
|
|
@@ -69,7 +69,7 @@ me = Po([
|
|
|
69
69
|
kn(0, le),
|
|
70
70
|
kn(1, sr)
|
|
71
71
|
], me);
|
|
72
|
-
const Te = "#ECECEC",
|
|
72
|
+
const Te = "#ECECEC", yt = "sheets-data-validation-ui.config", Mt = {};
|
|
73
73
|
var Lo = Object.getOwnPropertyDescriptor, ko = (e, t, n, r) => {
|
|
74
74
|
for (var o = r > 1 ? void 0 : r ? Lo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
75
75
|
(a = e[i]) && (o = a(o) || o);
|
|
@@ -100,7 +100,7 @@ let Ge = class extends Re {
|
|
|
100
100
|
title: u.getRuleFinalError(d, { row: o, col: i, unitId: a, subUnitId: l })
|
|
101
101
|
},
|
|
102
102
|
footer: {
|
|
103
|
-
title:
|
|
103
|
+
title: we(
|
|
104
104
|
Ke,
|
|
105
105
|
{
|
|
106
106
|
variant: "primary",
|
|
@@ -128,7 +128,7 @@ let Ge = class extends Re {
|
|
|
128
128
|
title: e
|
|
129
129
|
},
|
|
130
130
|
footer: {
|
|
131
|
-
title:
|
|
131
|
+
title: we(
|
|
132
132
|
Ke,
|
|
133
133
|
{
|
|
134
134
|
variant: "primary",
|
|
@@ -144,25 +144,25 @@ let Ge = class extends Re {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
Ge = ko([
|
|
147
|
-
xe(0,
|
|
148
|
-
xe(1,
|
|
149
|
-
xe(2,
|
|
147
|
+
xe(0, D(un)),
|
|
148
|
+
xe(1, D(oe)),
|
|
149
|
+
xe(2, D(Me)),
|
|
150
150
|
xe(3, uo),
|
|
151
|
-
xe(4,
|
|
152
|
-
xe(5,
|
|
151
|
+
xe(4, D(de)),
|
|
152
|
+
xe(5, D(Jr))
|
|
153
153
|
], Ge);
|
|
154
154
|
var No = Object.getOwnPropertyDescriptor, Uo = (e, t, n, r) => {
|
|
155
155
|
for (var o = r > 1 ? void 0 : r ? No(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
156
156
|
(a = e[i]) && (o = a(o) || o);
|
|
157
157
|
return o;
|
|
158
158
|
}, ue = (e, t) => (n, r) => t(n, r, e);
|
|
159
|
-
const
|
|
159
|
+
const $t = (e) => {
|
|
160
160
|
if (e == null || typeof e == "boolean")
|
|
161
161
|
return;
|
|
162
|
-
if (e === "") return
|
|
162
|
+
if (e === "") return Nt();
|
|
163
163
|
if (typeof e == "number" || !Number.isNaN(+e))
|
|
164
|
-
return
|
|
165
|
-
const t =
|
|
164
|
+
return Nt(Wn.format("yyyy-MM-dd HH:mm:ss", Number(e)));
|
|
165
|
+
const t = Nt(e);
|
|
166
166
|
if (t.isValid())
|
|
167
167
|
return t;
|
|
168
168
|
};
|
|
@@ -180,14 +180,14 @@ function Fo(e, t) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
let Ne = class extends Re {
|
|
183
|
-
constructor(t, n, r, o, i, a, l, s, d, u,
|
|
183
|
+
constructor(t, n, r, o, i, a, l, s, d, u, g) {
|
|
184
184
|
super();
|
|
185
185
|
V(this, "_activeDropdown");
|
|
186
186
|
V(this, "_activeDropdown$", new mo());
|
|
187
187
|
V(this, "_currentPopup", null);
|
|
188
188
|
V(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
|
189
189
|
V(this, "_zenVisible", !1);
|
|
190
|
-
this._univerInstanceService = t, this._dataValidatorRegistryService = n, this._zenZoneService = r, this._dataValidationModel = o, this._sheetsSelectionsService = i, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService =
|
|
190
|
+
this._univerInstanceService = t, this._dataValidatorRegistryService = n, this._zenZoneService = r, this._dataValidationModel = o, this._sheetsSelectionsService = i, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = d, this._injector = u, this._configService = g, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
|
|
191
191
|
this._activeDropdown$.complete();
|
|
192
192
|
});
|
|
193
193
|
}
|
|
@@ -200,7 +200,7 @@ let Ne = class extends Re {
|
|
|
200
200
|
}));
|
|
201
201
|
}
|
|
202
202
|
_getDropdownByCell(t, n, r, o) {
|
|
203
|
-
const i = t ? this._univerInstanceService.getUnit(t,
|
|
203
|
+
const i = t ? this._univerInstanceService.getUnit(t, Z.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(Z.UNIVER_SHEET);
|
|
204
204
|
if (!i)
|
|
205
205
|
return;
|
|
206
206
|
const a = n ? i.getSheetBySheetId(n) : i.getActiveSheet();
|
|
@@ -219,7 +219,7 @@ let Ne = class extends Re {
|
|
|
219
219
|
}
|
|
220
220
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
221
221
|
showDropdown(t) {
|
|
222
|
-
var
|
|
222
|
+
var E, R, w, S, I, b;
|
|
223
223
|
const { location: n } = t, { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = n;
|
|
224
224
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
|
225
225
|
return;
|
|
@@ -230,21 +230,21 @@ let Ne = class extends Re {
|
|
|
230
230
|
const u = this._dataValidatorRegistryService.getValidatorItem(d.type);
|
|
231
231
|
if (!(u != null && u.dropdownType))
|
|
232
232
|
return;
|
|
233
|
-
let
|
|
234
|
-
const c = async (
|
|
235
|
-
var
|
|
236
|
-
if (!
|
|
233
|
+
let g;
|
|
234
|
+
const c = async (v, p) => {
|
|
235
|
+
var A, x, H;
|
|
236
|
+
if (!v)
|
|
237
237
|
return !0;
|
|
238
|
-
const _ =
|
|
238
|
+
const _ = v, P = s.getCell(r, o), k = _.format(p === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), U = (A = Wn.parseDate(k)) == null ? void 0 : A.v, L = p === "time" ? U % 1 : U, y = l.getStyles().getStyleByCell(P), T = (H = (x = y == null ? void 0 : y.n) == null ? void 0 : x.pattern) != null ? H : "";
|
|
239
239
|
return d.errorStyle !== st.STOP || await u.validator({
|
|
240
|
-
value:
|
|
240
|
+
value: L,
|
|
241
241
|
unitId: i,
|
|
242
242
|
subUnitId: a,
|
|
243
243
|
row: r,
|
|
244
244
|
column: o,
|
|
245
245
|
worksheet: s,
|
|
246
246
|
workbook: l,
|
|
247
|
-
interceptValue:
|
|
247
|
+
interceptValue: k.replace("Z", "").replace("T", " "),
|
|
248
248
|
t: Lr.NUMBER
|
|
249
249
|
}, d) ? (await this._commandService.executeCommand(at.id, {
|
|
250
250
|
unitId: i,
|
|
@@ -256,14 +256,14 @@ let Ne = class extends Re {
|
|
|
256
256
|
endRow: r
|
|
257
257
|
},
|
|
258
258
|
value: {
|
|
259
|
-
v:
|
|
259
|
+
v: L,
|
|
260
260
|
t: 2,
|
|
261
261
|
p: null,
|
|
262
262
|
f: null,
|
|
263
263
|
si: null,
|
|
264
264
|
s: {
|
|
265
265
|
n: {
|
|
266
|
-
pattern: Fo(
|
|
266
|
+
pattern: Fo(p, T)
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -277,40 +277,40 @@ let Ne = class extends Re {
|
|
|
277
277
|
let m;
|
|
278
278
|
switch (u.dropdownType) {
|
|
279
279
|
case pe.DATE: {
|
|
280
|
-
const
|
|
280
|
+
const v = re(s.getCellRaw(r, o)), p = $t(v), _ = !!((E = d.bizInfo) != null && E.showTime);
|
|
281
281
|
m = {
|
|
282
282
|
location: n,
|
|
283
283
|
type: "datepicker",
|
|
284
284
|
props: {
|
|
285
285
|
showTime: _,
|
|
286
|
-
onChange: (
|
|
287
|
-
defaultValue:
|
|
286
|
+
onChange: (P) => c(P, _ ? "datetime" : "date"),
|
|
287
|
+
defaultValue: p,
|
|
288
288
|
patternType: "date"
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
break;
|
|
292
292
|
}
|
|
293
293
|
case pe.TIME: {
|
|
294
|
-
const
|
|
294
|
+
const v = re(s.getCellRaw(r, o)), p = $t(v);
|
|
295
295
|
m = {
|
|
296
296
|
location: n,
|
|
297
297
|
type: "datepicker",
|
|
298
298
|
props: {
|
|
299
299
|
onChange: (_) => c(_, "time"),
|
|
300
|
-
defaultValue:
|
|
300
|
+
defaultValue: p,
|
|
301
301
|
patternType: "time"
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
304
|
break;
|
|
305
305
|
}
|
|
306
306
|
case pe.DATETIME: {
|
|
307
|
-
const
|
|
307
|
+
const v = re(s.getCellRaw(r, o)), p = $t(v);
|
|
308
308
|
m = {
|
|
309
309
|
location: n,
|
|
310
310
|
type: "datepicker",
|
|
311
311
|
props: {
|
|
312
312
|
onChange: (_) => c(_, "datetime"),
|
|
313
|
-
defaultValue:
|
|
313
|
+
defaultValue: p,
|
|
314
314
|
patternType: "datetime"
|
|
315
315
|
}
|
|
316
316
|
};
|
|
@@ -318,8 +318,8 @@ let Ne = class extends Re {
|
|
|
318
318
|
}
|
|
319
319
|
case pe.LIST:
|
|
320
320
|
case pe.MULTIPLE_LIST: {
|
|
321
|
-
const
|
|
322
|
-
const
|
|
321
|
+
const v = u.dropdownType === pe.MULTIPLE_LIST, p = async (y) => {
|
|
322
|
+
const T = Qn(y), A = {
|
|
323
323
|
unitId: i,
|
|
324
324
|
subUnitId: a,
|
|
325
325
|
range: {
|
|
@@ -329,37 +329,38 @@ let Ne = class extends Re {
|
|
|
329
329
|
endRow: r
|
|
330
330
|
},
|
|
331
331
|
value: {
|
|
332
|
-
v:
|
|
332
|
+
v: T,
|
|
333
333
|
p: null,
|
|
334
334
|
f: null,
|
|
335
335
|
si: null
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
return this._commandService.executeCommand(at.id,
|
|
338
|
+
return this._commandService.executeCommand(at.id, A), this._editorBridgeService.isVisible().visible && await this._commandService.executeCommand(vt.id, {
|
|
339
339
|
visible: !1,
|
|
340
340
|
eventType: pt.Keyboard,
|
|
341
341
|
unitId: i,
|
|
342
342
|
keycode: gt.ESC
|
|
343
|
-
}), !
|
|
344
|
-
}, _ = (d == null ? void 0 : d.renderMode) === ae.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0,
|
|
343
|
+
}), !v;
|
|
344
|
+
}, _ = (d == null ? void 0 : d.renderMode) === ae.CUSTOM || (d == null ? void 0 : d.renderMode) === void 0, P = u.getListWithColor(d, i, a), k = Ut(s.getCellRaw(r, o)), U = () => {
|
|
345
345
|
this._commandService.executeCommand(Fe.id, {
|
|
346
346
|
ruleId: d.uid
|
|
347
|
-
}),
|
|
348
|
-
},
|
|
349
|
-
label:
|
|
350
|
-
value:
|
|
351
|
-
color: _ ||
|
|
347
|
+
}), g == null || g.dispose();
|
|
348
|
+
}, L = P.map((y) => ({
|
|
349
|
+
label: y.label,
|
|
350
|
+
value: y.label,
|
|
351
|
+
color: _ || y.color ? y.color || Te : "transparent"
|
|
352
352
|
}));
|
|
353
353
|
m = {
|
|
354
354
|
location: n,
|
|
355
355
|
type: "list",
|
|
356
356
|
props: {
|
|
357
|
-
onChange: (
|
|
358
|
-
options:
|
|
359
|
-
onEdit:
|
|
360
|
-
defaultValue:
|
|
361
|
-
multiple:
|
|
362
|
-
showEdit: (
|
|
357
|
+
onChange: (y) => p(y),
|
|
358
|
+
options: L,
|
|
359
|
+
onEdit: U,
|
|
360
|
+
defaultValue: k,
|
|
361
|
+
multiple: v,
|
|
362
|
+
showEdit: (w = (R = this._configService.getConfig(yt)) == null ? void 0 : R.showEditOnDropdown) != null ? w : !0,
|
|
363
|
+
showSearch: (I = (S = this._configService.getConfig(yt)) == null ? void 0 : S.showSearchOnDropdown) != null ? I : !0
|
|
363
364
|
}
|
|
364
365
|
};
|
|
365
366
|
break;
|
|
@@ -368,7 +369,7 @@ let Ne = class extends Re {
|
|
|
368
369
|
m = {
|
|
369
370
|
type: "cascader",
|
|
370
371
|
props: {
|
|
371
|
-
onChange: (
|
|
372
|
+
onChange: (p) => {
|
|
372
373
|
const _ = {
|
|
373
374
|
unitId: i,
|
|
374
375
|
subUnitId: a,
|
|
@@ -379,7 +380,7 @@ let Ne = class extends Re {
|
|
|
379
380
|
endRow: r
|
|
380
381
|
},
|
|
381
382
|
value: {
|
|
382
|
-
v:
|
|
383
|
+
v: p.join("/"),
|
|
383
384
|
p: null,
|
|
384
385
|
f: null,
|
|
385
386
|
si: null
|
|
@@ -392,8 +393,8 @@ let Ne = class extends Re {
|
|
|
392
393
|
keycode: gt.ESC
|
|
393
394
|
}), !0;
|
|
394
395
|
},
|
|
395
|
-
defaultValue:
|
|
396
|
-
options: JSON.parse((
|
|
396
|
+
defaultValue: Ut(s.getCellRaw(r, o)).split("/"),
|
|
397
|
+
options: JSON.parse((b = d.formula1) != null ? b : "[]")
|
|
397
398
|
},
|
|
398
399
|
location: n
|
|
399
400
|
};
|
|
@@ -403,7 +404,7 @@ let Ne = class extends Re {
|
|
|
403
404
|
m = {
|
|
404
405
|
type: "color",
|
|
405
406
|
props: {
|
|
406
|
-
onChange: (
|
|
407
|
+
onChange: (p) => {
|
|
407
408
|
const _ = {
|
|
408
409
|
unitId: i,
|
|
409
410
|
subUnitId: a,
|
|
@@ -414,7 +415,7 @@ let Ne = class extends Re {
|
|
|
414
415
|
endRow: r
|
|
415
416
|
},
|
|
416
417
|
value: {
|
|
417
|
-
v:
|
|
418
|
+
v: p,
|
|
418
419
|
p: null,
|
|
419
420
|
f: null,
|
|
420
421
|
si: null
|
|
@@ -427,7 +428,7 @@ let Ne = class extends Re {
|
|
|
427
428
|
keycode: gt.ESC
|
|
428
429
|
}), !0;
|
|
429
430
|
},
|
|
430
|
-
defaultValue:
|
|
431
|
+
defaultValue: Ut(s.getCellRaw(r, o))
|
|
431
432
|
},
|
|
432
433
|
location: n
|
|
433
434
|
};
|
|
@@ -436,18 +437,18 @@ let Ne = class extends Re {
|
|
|
436
437
|
default:
|
|
437
438
|
throw new Error("[DataValidationDropdownManagerService]: unknown type!");
|
|
438
439
|
}
|
|
439
|
-
if (
|
|
440
|
+
if (g = this._cellDropdownManagerService.showDropdown({
|
|
440
441
|
...m,
|
|
441
442
|
onHide: () => {
|
|
442
443
|
this._activeDropdown = null, this._activeDropdown$.next(null);
|
|
443
444
|
}
|
|
444
|
-
}), !
|
|
445
|
+
}), !g)
|
|
445
446
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
|
446
447
|
const h = new Pr();
|
|
447
|
-
h.add(
|
|
448
|
+
h.add(g), h.add({
|
|
448
449
|
dispose: () => {
|
|
449
|
-
var
|
|
450
|
-
(
|
|
450
|
+
var v, p;
|
|
451
|
+
(p = (v = this._activeDropdown) == null ? void 0 : v.onHide) == null || p.call(v);
|
|
451
452
|
}
|
|
452
453
|
}), this._currentPopup = h;
|
|
453
454
|
}
|
|
@@ -455,7 +456,7 @@ let Ne = class extends Re {
|
|
|
455
456
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
|
456
457
|
}
|
|
457
458
|
showDataValidationDropdown(t, n, r, o, i) {
|
|
458
|
-
const a = this._univerInstanceService.getUnit(t,
|
|
459
|
+
const a = this._univerInstanceService.getUnit(t, Z.UNIVER_SHEET);
|
|
459
460
|
if (!a)
|
|
460
461
|
return;
|
|
461
462
|
const l = a.getSheetBySheetId(n);
|
|
@@ -484,35 +485,35 @@ let Ne = class extends Re {
|
|
|
484
485
|
};
|
|
485
486
|
Ne = Uo([
|
|
486
487
|
ue(0, le),
|
|
487
|
-
ue(1,
|
|
488
|
+
ue(1, D(Me)),
|
|
488
489
|
ue(2, lr),
|
|
489
|
-
ue(3,
|
|
490
|
-
ue(4,
|
|
491
|
-
ue(5,
|
|
492
|
-
ue(6,
|
|
493
|
-
ue(7,
|
|
490
|
+
ue(3, D(oe)),
|
|
491
|
+
ue(4, D(Gn)),
|
|
492
|
+
ue(5, D(Co)),
|
|
493
|
+
ue(6, D(oe)),
|
|
494
|
+
ue(7, te),
|
|
494
495
|
ue(8, hr),
|
|
495
|
-
ue(9,
|
|
496
|
-
ue(10,
|
|
496
|
+
ue(9, D(ye)),
|
|
497
|
+
ue(10, dn)
|
|
497
498
|
], Ne);
|
|
498
|
-
const
|
|
499
|
+
const bt = "DataValidationPanel", Fe = {
|
|
499
500
|
id: "data-validation.operation.open-validation-panel",
|
|
500
501
|
type: tt.OPERATION,
|
|
501
502
|
handler(e, t) {
|
|
502
503
|
if (!t)
|
|
503
504
|
return !1;
|
|
504
|
-
const { ruleId: n, isAdd: r } = t, o = e.get(me), i = e.get(
|
|
505
|
+
const { ruleId: n, isAdd: r } = t, o = e.get(me), i = e.get(gn), a = e.get(le), l = e.get(sr), s = zn(a);
|
|
505
506
|
if (!s) return !1;
|
|
506
|
-
const { unitId: d, subUnitId: u } = s,
|
|
507
|
-
o.open(), o.setActiveRule(
|
|
507
|
+
const { unitId: d, subUnitId: u } = s, g = n ? i.getRuleById(d, u, n) : void 0;
|
|
508
|
+
o.open(), o.setActiveRule(g && {
|
|
508
509
|
unitId: d,
|
|
509
510
|
subUnitId: u,
|
|
510
|
-
rule:
|
|
511
|
+
rule: g
|
|
511
512
|
});
|
|
512
513
|
const c = l.open({
|
|
513
|
-
id:
|
|
514
|
+
id: bt,
|
|
514
515
|
header: { title: r ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
|
515
|
-
children: { label:
|
|
516
|
+
children: { label: bt },
|
|
516
517
|
width: 312,
|
|
517
518
|
onClose: () => o.close()
|
|
518
519
|
});
|
|
@@ -528,10 +529,10 @@ const Mt = "DataValidationPanel", Fe = {
|
|
|
528
529
|
id: "data-validation.operation.toggle-validation-panel",
|
|
529
530
|
type: tt.OPERATION,
|
|
530
531
|
handler(e) {
|
|
531
|
-
const t = e.get(
|
|
532
|
+
const t = e.get(te), n = e.get(me);
|
|
532
533
|
return n.open(), n.isOpen ? t.executeCommand(Cn.id) : t.executeCommand(Fe.id), !0;
|
|
533
534
|
}
|
|
534
|
-
},
|
|
535
|
+
}, Lt = {
|
|
535
536
|
type: tt.OPERATION,
|
|
536
537
|
id: "sheet.operation.show-data-validation-dropdown",
|
|
537
538
|
handler(e, t) {
|
|
@@ -551,18 +552,18 @@ const Mt = "DataValidationPanel", Fe = {
|
|
|
551
552
|
handler(e, t) {
|
|
552
553
|
return t ? (e.get(Ne).hideDropdown(), !0) : !1;
|
|
553
554
|
}
|
|
554
|
-
},
|
|
555
|
+
}, kt = {
|
|
555
556
|
type: tt.COMMAND,
|
|
556
557
|
id: "data-validation.command.addRuleAndOpen",
|
|
557
558
|
handler(e) {
|
|
558
559
|
const t = e.get(le), n = zn(t);
|
|
559
560
|
if (!n) return !1;
|
|
560
|
-
const { workbook: r, worksheet: o } = n, i = er(e), a = e.get(
|
|
561
|
+
const { workbook: r, worksheet: o } = n, i = er(e), a = e.get(te), l = r.getUnitId(), s = o.getSheetId(), d = {
|
|
561
562
|
rule: i,
|
|
562
563
|
unitId: l,
|
|
563
564
|
subUnitId: s
|
|
564
565
|
};
|
|
565
|
-
return a.syncExecuteCommand(
|
|
566
|
+
return a.syncExecuteCommand(hn.id, d) ? (a.syncExecuteCommand(Fe.id, {
|
|
566
567
|
ruleId: i.uid,
|
|
567
568
|
isAdd: !0
|
|
568
569
|
}), !0) : !1;
|
|
@@ -585,7 +586,7 @@ let ut = class extends Re {
|
|
|
585
586
|
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(cr(100)).subscribe((e) => {
|
|
586
587
|
var t;
|
|
587
588
|
if (e) {
|
|
588
|
-
const n = this._univerInstanceService.getUnit(e.location.unitId,
|
|
589
|
+
const n = this._univerInstanceService.getUnit(e.location.unitId, Z.UNIVER_SHEET), r = n.getSheetBySheetId(e.location.subUnitId);
|
|
589
590
|
if (!r) return;
|
|
590
591
|
const o = this._dataValidationModel.getRuleByLocation(e.location.unitId, e.location.subUnitId, e.location.row, e.location.col);
|
|
591
592
|
if (!o) {
|
|
@@ -604,7 +605,7 @@ let ut = class extends Re {
|
|
|
604
605
|
return;
|
|
605
606
|
}
|
|
606
607
|
this._cellAlertManagerService.showAlert({
|
|
607
|
-
type:
|
|
608
|
+
type: Io.ERROR,
|
|
608
609
|
title: this._localeService.t("dataValidation.error.title"),
|
|
609
610
|
message: s == null ? void 0 : s.getRuleFinalError(o, e.location),
|
|
610
611
|
location: e.location,
|
|
@@ -625,18 +626,18 @@ let ut = class extends Re {
|
|
|
625
626
|
}
|
|
626
627
|
};
|
|
627
628
|
ut = xo([
|
|
628
|
-
Be(0,
|
|
629
|
-
Be(1,
|
|
629
|
+
Be(0, D(So)),
|
|
630
|
+
Be(1, D(wo)),
|
|
630
631
|
Be(2, le),
|
|
631
|
-
Be(3,
|
|
632
|
+
Be(3, D(de)),
|
|
632
633
|
Be(4, lr),
|
|
633
|
-
Be(5,
|
|
634
|
+
Be(5, D(oe))
|
|
634
635
|
], ut);
|
|
635
636
|
var Bo = Object.getOwnPropertyDescriptor, Wo = (e, t, n, r) => {
|
|
636
637
|
for (var o = r > 1 ? void 0 : r ? Bo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
637
638
|
(a = e[i]) && (o = a(o) || o);
|
|
638
639
|
return o;
|
|
639
|
-
},
|
|
640
|
+
}, xt = (e, t) => (n, r) => t(n, r, e);
|
|
640
641
|
let ze = class extends Re {
|
|
641
642
|
constructor(e, t, n) {
|
|
642
643
|
super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = n, this._initAutoFill();
|
|
@@ -644,49 +645,49 @@ let ze = class extends Re {
|
|
|
644
645
|
// eslint-disable-next-line max-lines-per-function
|
|
645
646
|
_initAutoFill() {
|
|
646
647
|
const e = () => ({ redos: [], undos: [] }), t = (r, o) => {
|
|
647
|
-
const { source: i, target: a, unitId: l, subUnitId: s } = r, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u =
|
|
648
|
-
row:
|
|
649
|
-
col:
|
|
650
|
-
},
|
|
651
|
-
|
|
652
|
-
const
|
|
648
|
+
const { source: i, target: a, unitId: l, subUnitId: s } = r, d = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = rn([i, a]), [g, c] = u.ranges, { mapFunc: m } = u, h = {
|
|
649
|
+
row: g.startRow,
|
|
650
|
+
col: g.startColumn
|
|
651
|
+
}, E = yo(g, c), R = new wt(), w = /* @__PURE__ */ new Set();
|
|
652
|
+
E.forEach((p) => {
|
|
653
|
+
const _ = p.repeatStartCell, P = p.relativeRange, k = {
|
|
653
654
|
startRow: h.row,
|
|
654
655
|
startColumn: h.col,
|
|
655
656
|
endColumn: h.col,
|
|
656
657
|
endRow: h.row
|
|
657
|
-
},
|
|
658
|
-
startRow:
|
|
659
|
-
startColumn:
|
|
660
|
-
endColumn:
|
|
661
|
-
endRow:
|
|
658
|
+
}, U = {
|
|
659
|
+
startRow: _.row,
|
|
660
|
+
startColumn: _.col,
|
|
661
|
+
endColumn: _.col,
|
|
662
|
+
endRow: _.row
|
|
662
663
|
};
|
|
663
|
-
kr.foreach(P, (
|
|
664
|
-
const
|
|
664
|
+
kr.foreach(P, (L, y) => {
|
|
665
|
+
const T = It.getPositionRange(
|
|
665
666
|
{
|
|
666
|
-
startRow:
|
|
667
|
-
startColumn:
|
|
668
|
-
endColumn:
|
|
669
|
-
endRow:
|
|
667
|
+
startRow: L,
|
|
668
|
+
startColumn: y,
|
|
669
|
+
endColumn: y,
|
|
670
|
+
endRow: L
|
|
670
671
|
},
|
|
671
672
|
k
|
|
672
|
-
), { row:
|
|
673
|
+
), { row: A, col: x } = m(T.startRow, T.startColumn), H = this._sheetDataValidationModel.getRuleIdByLocation(l, s, A, x) || "", q = It.getPositionRange(
|
|
673
674
|
{
|
|
674
|
-
startRow:
|
|
675
|
-
startColumn:
|
|
676
|
-
endColumn:
|
|
677
|
-
endRow:
|
|
675
|
+
startRow: L,
|
|
676
|
+
startColumn: y,
|
|
677
|
+
endColumn: y,
|
|
678
|
+
endRow: L
|
|
678
679
|
},
|
|
679
|
-
|
|
680
|
-
), { row: B, col: ne } = m(
|
|
681
|
-
|
|
680
|
+
U
|
|
681
|
+
), { row: B, col: ne } = m(q.startRow, q.startColumn);
|
|
682
|
+
R.setValue(B, ne, H), w.add(H);
|
|
682
683
|
});
|
|
683
684
|
});
|
|
684
|
-
const S = Array.from(
|
|
685
|
+
const S = Array.from(w).map((p) => ({ id: p, ranges: zt(R, (_) => _ === p) }));
|
|
685
686
|
d.addRangeRules(S);
|
|
686
|
-
const
|
|
687
|
+
const I = d.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: b, undoMutations: v } = tn(l, s, I, this._injector, "patched", o === ot.ONLY_FORMAT);
|
|
687
688
|
return {
|
|
688
|
-
undos:
|
|
689
|
-
redos:
|
|
689
|
+
undos: v,
|
|
690
|
+
redos: b
|
|
690
691
|
};
|
|
691
692
|
}, n = {
|
|
692
693
|
id: tr,
|
|
@@ -695,7 +696,7 @@ let ze = class extends Re {
|
|
|
695
696
|
for (const l of o.rows)
|
|
696
697
|
for (const s of o.cols) {
|
|
697
698
|
const d = this._sheetDataValidationModel.getRuleByLocation(i, a, l, s);
|
|
698
|
-
if (d && d.type ===
|
|
699
|
+
if (d && d.type === Y.CHECKBOX) {
|
|
699
700
|
this._autoFillService.setDisableApplyType(ot.SERIES, !0);
|
|
700
701
|
return;
|
|
701
702
|
}
|
|
@@ -709,15 +710,15 @@ let ze = class extends Re {
|
|
|
709
710
|
}
|
|
710
711
|
};
|
|
711
712
|
ze = Wo([
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
713
|
+
xt(0, Ro),
|
|
714
|
+
xt(1, D(oe)),
|
|
715
|
+
xt(2, D(ye))
|
|
715
716
|
], ze);
|
|
716
717
|
var Ho = Object.getOwnPropertyDescriptor, jo = (e, t, n, r) => {
|
|
717
718
|
for (var o = r > 1 ? void 0 : r ? Ho(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
718
719
|
(a = e[i]) && (o = a(o) || o);
|
|
719
720
|
return o;
|
|
720
|
-
},
|
|
721
|
+
}, Bt = (e, t) => (n, r) => t(n, r, e);
|
|
721
722
|
let qe = class extends Re {
|
|
722
723
|
constructor(t, n, r) {
|
|
723
724
|
super();
|
|
@@ -735,7 +736,7 @@ let qe = class extends Re {
|
|
|
735
736
|
});
|
|
736
737
|
}
|
|
737
738
|
_collect(t, n, r) {
|
|
738
|
-
const o = new
|
|
739
|
+
const o = new wt();
|
|
739
740
|
this._copyInfo = {
|
|
740
741
|
unitId: t,
|
|
741
742
|
subUnitId: n,
|
|
@@ -746,9 +747,9 @@ let qe = class extends Re {
|
|
|
746
747
|
return;
|
|
747
748
|
const { rows: a, cols: l } = i;
|
|
748
749
|
a.forEach((s, d) => {
|
|
749
|
-
l.forEach((u,
|
|
750
|
+
l.forEach((u, g) => {
|
|
750
751
|
const c = this._sheetDataValidationModel.getRuleIdByLocation(t, n, s, u);
|
|
751
|
-
o.setValue(d,
|
|
752
|
+
o.setValue(d, g, c != null ? c : "");
|
|
752
753
|
});
|
|
753
754
|
});
|
|
754
755
|
}
|
|
@@ -769,27 +770,27 @@ let qe = class extends Re {
|
|
|
769
770
|
return { redos: [], undos: [] };
|
|
770
771
|
const { unitId: o, subUnitId: i } = this._copyInfo;
|
|
771
772
|
if (n.unitId !== o || i !== n.subUnitId) {
|
|
772
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(n.unitId, n.subUnitId).clone(), l = new
|
|
773
|
-
c.forEach(({ startRange:
|
|
773
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(n.unitId, n.subUnitId).clone(), l = new wt(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: g } = rn([n.copyRange, t]), c = Pn(d, u, !0), m = /* @__PURE__ */ new Map();
|
|
774
|
+
c.forEach(({ startRange: w }) => {
|
|
774
775
|
var S;
|
|
775
|
-
(S = this._copyInfo) == null || S.matrix.forValue((
|
|
776
|
-
const
|
|
776
|
+
(S = this._copyInfo) == null || S.matrix.forValue((I, b, v) => {
|
|
777
|
+
const p = It.getPositionRange(
|
|
777
778
|
{
|
|
778
|
-
startRow:
|
|
779
|
-
endRow:
|
|
780
|
-
startColumn:
|
|
781
|
-
endColumn:
|
|
779
|
+
startRow: I,
|
|
780
|
+
endRow: I,
|
|
781
|
+
startColumn: b,
|
|
782
|
+
endColumn: b
|
|
782
783
|
},
|
|
783
|
-
|
|
784
|
-
),
|
|
785
|
-
!this._sheetDataValidationModel.getRuleById(n.unitId, n.subUnitId,
|
|
786
|
-
const { row: k, col:
|
|
787
|
-
s.add(
|
|
784
|
+
w
|
|
785
|
+
), _ = `${i}-${v}`, P = this._sheetDataValidationModel.getRuleById(o, i, v);
|
|
786
|
+
!this._sheetDataValidationModel.getRuleById(n.unitId, n.subUnitId, _) && P && m.set(_, { ...P, uid: _ });
|
|
787
|
+
const { row: k, col: U } = g(p.startRow, p.startColumn);
|
|
788
|
+
s.add(_), l.setValue(k, U, _);
|
|
788
789
|
});
|
|
789
790
|
});
|
|
790
|
-
const h = Array.from(s).map((
|
|
791
|
+
const h = Array.from(s).map((w) => ({ id: w, ranges: zt(l, (S) => S === w) }));
|
|
791
792
|
a.addRangeRules(h);
|
|
792
|
-
const { redoMutations:
|
|
793
|
+
const { redoMutations: E, undoMutations: R } = tn(
|
|
793
794
|
n.unitId,
|
|
794
795
|
n.subUnitId,
|
|
795
796
|
a.diffWithAddition(this._sheetDataValidationModel.getRules(n.unitId, n.subUnitId), m.values()),
|
|
@@ -798,29 +799,29 @@ let qe = class extends Re {
|
|
|
798
799
|
!1
|
|
799
800
|
);
|
|
800
801
|
return {
|
|
801
|
-
redos:
|
|
802
|
-
undos:
|
|
802
|
+
redos: E,
|
|
803
|
+
undos: R
|
|
803
804
|
};
|
|
804
805
|
} else {
|
|
805
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(o, i).clone(), l = new
|
|
806
|
-
Pn(d, u, !0).forEach(({ startRange:
|
|
807
|
-
var
|
|
808
|
-
(
|
|
809
|
-
const
|
|
806
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(o, i).clone(), l = new wt(), s = /* @__PURE__ */ new Set(), { ranges: [d, u], mapFunc: g } = rn([n.copyRange, t]);
|
|
807
|
+
Pn(d, u, !0).forEach(({ startRange: R }) => {
|
|
808
|
+
var w;
|
|
809
|
+
(w = this._copyInfo) == null || w.matrix.forValue((S, I, b) => {
|
|
810
|
+
const v = It.getPositionRange(
|
|
810
811
|
{
|
|
811
812
|
startRow: S,
|
|
812
813
|
endRow: S,
|
|
813
|
-
startColumn:
|
|
814
|
-
endColumn:
|
|
814
|
+
startColumn: I,
|
|
815
|
+
endColumn: I
|
|
815
816
|
},
|
|
816
|
-
|
|
817
|
-
), { row:
|
|
818
|
-
l.setValue(
|
|
817
|
+
R
|
|
818
|
+
), { row: p, col: _ } = g(v.startRow, v.startColumn);
|
|
819
|
+
l.setValue(p, _, b), s.add(b);
|
|
819
820
|
});
|
|
820
821
|
});
|
|
821
|
-
const m = Array.from(s).map((
|
|
822
|
+
const m = Array.from(s).map((R) => ({ id: R, ranges: zt(l, (w) => w === R) }));
|
|
822
823
|
a.addRangeRules(m);
|
|
823
|
-
const { redoMutations: h, undoMutations:
|
|
824
|
+
const { redoMutations: h, undoMutations: E } = tn(
|
|
824
825
|
o,
|
|
825
826
|
i,
|
|
826
827
|
a.diff(this._sheetDataValidationModel.getRules(o, i)),
|
|
@@ -830,21 +831,21 @@ let qe = class extends Re {
|
|
|
830
831
|
);
|
|
831
832
|
return {
|
|
832
833
|
redos: h,
|
|
833
|
-
undos:
|
|
834
|
+
undos: E
|
|
834
835
|
};
|
|
835
836
|
}
|
|
836
837
|
}
|
|
837
838
|
};
|
|
838
839
|
qe = jo([
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
Bt(0, Mo),
|
|
841
|
+
Bt(1, D(oe)),
|
|
842
|
+
Bt(2, D(ye))
|
|
842
843
|
], qe);
|
|
843
844
|
var Yo = Object.getOwnPropertyDescriptor, Xo = (e, t, n, r) => {
|
|
844
845
|
for (var o = r > 1 ? void 0 : r ? Yo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
845
846
|
(a = e[i]) && (o = a(o) || o);
|
|
846
847
|
return o;
|
|
847
|
-
},
|
|
848
|
+
}, Wt = (e, t) => (n, r) => t(n, r, e);
|
|
848
849
|
let Je = class extends Re {
|
|
849
850
|
constructor(e, t, n) {
|
|
850
851
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = n, this._commandExecutedListener();
|
|
@@ -852,20 +853,20 @@ let Je = class extends Re {
|
|
|
852
853
|
_commandExecutedListener() {
|
|
853
854
|
this.disposeWithMe(
|
|
854
855
|
this._commandService.beforeCommandExecuted((e) => {
|
|
855
|
-
if (e.id ===
|
|
856
|
+
if (e.id === hn.id) {
|
|
856
857
|
const { unitId: t, subUnitId: n, rule: { ranges: r } } = e.params;
|
|
857
858
|
this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
858
|
-
workbookTypes: [
|
|
859
|
-
rangeTypes: [
|
|
860
|
-
worksheetTypes: [
|
|
859
|
+
workbookTypes: [en],
|
|
860
|
+
rangeTypes: [Qt],
|
|
861
|
+
worksheetTypes: [qt, Jt]
|
|
861
862
|
}, r, t, n) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
|
|
862
863
|
}
|
|
863
864
|
if (e.id === nr.id) {
|
|
864
865
|
const { unitId: t, subUnitId: n, ranges: r } = e.params;
|
|
865
866
|
this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
866
|
-
workbookTypes: [
|
|
867
|
-
rangeTypes: [
|
|
868
|
-
worksheetTypes: [
|
|
867
|
+
workbookTypes: [en],
|
|
868
|
+
rangeTypes: [Qt],
|
|
869
|
+
worksheetTypes: [qt, Jt]
|
|
869
870
|
}, r, t, n) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
|
|
870
871
|
}
|
|
871
872
|
})
|
|
@@ -873,33 +874,33 @@ let Je = class extends Re {
|
|
|
873
874
|
}
|
|
874
875
|
};
|
|
875
876
|
Je = Xo([
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
877
|
+
Wt(0, D(de)),
|
|
878
|
+
Wt(1, te),
|
|
879
|
+
Wt(2, D(zr))
|
|
879
880
|
], Je);
|
|
880
881
|
const _r = "sheet.menu.data-validation";
|
|
881
882
|
function Zo(e) {
|
|
882
883
|
return {
|
|
883
884
|
id: _r,
|
|
884
|
-
type:
|
|
885
|
+
type: vn.SUBITEMS,
|
|
885
886
|
icon: "DataValidationIcon",
|
|
886
887
|
tooltip: "dataValidation.title",
|
|
887
|
-
hidden$: ho(e,
|
|
888
|
-
disabled$: bo(e, { workbookTypes: [
|
|
888
|
+
hidden$: ho(e, Z.UNIVER_SHEET),
|
|
889
|
+
disabled$: bo(e, { workbookTypes: [en], worksheetTypes: [Jt, qt], rangeTypes: [Qt] })
|
|
889
890
|
};
|
|
890
891
|
}
|
|
891
892
|
function Ko(e) {
|
|
892
893
|
return {
|
|
893
894
|
id: Fe.id,
|
|
894
895
|
title: "dataValidation.panel.title",
|
|
895
|
-
type:
|
|
896
|
+
type: vn.BUTTON
|
|
896
897
|
};
|
|
897
898
|
}
|
|
898
899
|
function Go(e) {
|
|
899
900
|
return {
|
|
900
|
-
id:
|
|
901
|
+
id: kt.id,
|
|
901
902
|
title: "dataValidation.panel.add",
|
|
902
|
-
type:
|
|
903
|
+
type: vn.BUTTON
|
|
903
904
|
};
|
|
904
905
|
}
|
|
905
906
|
const zo = {
|
|
@@ -911,7 +912,7 @@ const zo = {
|
|
|
911
912
|
order: 0,
|
|
912
913
|
menuItemFactory: Ko
|
|
913
914
|
},
|
|
914
|
-
[
|
|
915
|
+
[kt.id]: {
|
|
915
916
|
order: 1,
|
|
916
917
|
menuItemFactory: Go
|
|
917
918
|
}
|
|
@@ -922,14 +923,14 @@ var qo = Object.getOwnPropertyDescriptor, Cr = (e, t, n, r) => {
|
|
|
922
923
|
for (var o = r > 1 ? void 0 : r ? qo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
923
924
|
(a = e[i]) && (o = a(o) || o);
|
|
924
925
|
return o;
|
|
925
|
-
},
|
|
926
|
+
}, G = (e, t) => (n, r) => t(n, r, e);
|
|
926
927
|
const Sr = {
|
|
927
928
|
tr: {
|
|
928
929
|
size: 6,
|
|
929
930
|
color: "#fe4b4b"
|
|
930
931
|
}
|
|
931
932
|
};
|
|
932
|
-
let Qe = class extends
|
|
933
|
+
let Qe = class extends cn {
|
|
933
934
|
constructor(e, t, n, r, o, i, a, l, s, d, u) {
|
|
934
935
|
super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = n, this._univerInstanceService = r, this._autoHeightController = o, this._dropdownManagerService = i, this._sheetDataValidationModel = a, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = d, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
|
935
936
|
}
|
|
@@ -956,7 +957,7 @@ let Qe = class extends dn {
|
|
|
956
957
|
return;
|
|
957
958
|
const u = l.getActiveSheet();
|
|
958
959
|
if (!u) return;
|
|
959
|
-
const
|
|
960
|
+
const g = this._dropdownManagerService.activeDropdown, c = g == null ? void 0 : g.location;
|
|
960
961
|
if (c && c.unitId === r && c.subUnitId === o && c.row === i && c.col === a)
|
|
961
962
|
return;
|
|
962
963
|
this._dropdownManagerService.showDropdown(
|
|
@@ -987,52 +988,52 @@ let Qe = class extends dn {
|
|
|
987
988
|
priority: Jn.DATA_VALIDATION,
|
|
988
989
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
989
990
|
handler: (e, t, n) => {
|
|
990
|
-
var
|
|
991
|
+
var w, S, I, b, v;
|
|
991
992
|
const { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(i, a, r, o);
|
|
992
993
|
if (!d)
|
|
993
994
|
return n(e);
|
|
994
995
|
const u = this._sheetDataValidationModel.getRuleById(i, a, d);
|
|
995
996
|
if (!u)
|
|
996
997
|
return n(e);
|
|
997
|
-
const
|
|
998
|
+
const g = (w = this._dataValidationCacheService.getValue(i, a, r, o)) != null ? w : Ye.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), m = t.rawData;
|
|
998
999
|
let h;
|
|
999
|
-
const
|
|
1000
|
+
const E = {
|
|
1000
1001
|
get value() {
|
|
1001
|
-
var
|
|
1002
|
-
return h !== void 0 || (h = (
|
|
1002
|
+
var p;
|
|
1003
|
+
return h !== void 0 || (h = (p = re(m)) != null ? p : null), h;
|
|
1003
1004
|
}
|
|
1004
|
-
},
|
|
1005
|
+
}, R = {
|
|
1005
1006
|
get value() {
|
|
1006
|
-
var
|
|
1007
|
-
return `${(
|
|
1007
|
+
var p;
|
|
1008
|
+
return `${(p = E.value) != null ? p : ""}`;
|
|
1008
1009
|
}
|
|
1009
1010
|
};
|
|
1010
1011
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
|
1011
1012
|
...e == null ? void 0 : e.markers,
|
|
1012
|
-
...
|
|
1013
|
+
...g === Ye.INVALID ? Sr : null
|
|
1013
1014
|
}, e.customRender = [
|
|
1014
1015
|
...(S = e == null ? void 0 : e.customRender) != null ? S : [],
|
|
1015
1016
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
|
1016
1017
|
], e.fontRenderExtension = {
|
|
1017
1018
|
...e == null ? void 0 : e.fontRenderExtension,
|
|
1018
|
-
isSkip: ((
|
|
1019
|
+
isSkip: ((I = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : I.isSkip) || ((b = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : b.call(c, u, E.value, t))
|
|
1019
1020
|
}, e.interceptorStyle = {
|
|
1020
1021
|
...e == null ? void 0 : e.interceptorStyle,
|
|
1021
|
-
...c == null ? void 0 : c.getExtraStyle(u,
|
|
1022
|
+
...c == null ? void 0 : c.getExtraStyle(u, R.value, {
|
|
1022
1023
|
get style() {
|
|
1023
|
-
const
|
|
1024
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
|
1024
|
+
const p = l.getStyles();
|
|
1025
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? p.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
|
1025
1026
|
}
|
|
1026
1027
|
}, r, o)
|
|
1027
1028
|
}, e.interceptorAutoHeight = () => {
|
|
1028
|
-
var k,
|
|
1029
|
-
const
|
|
1030
|
-
if (!
|
|
1029
|
+
var k, U, L, y, T, A;
|
|
1030
|
+
const p = (U = (k = this._renderManagerService.getRenderById(i)) == null ? void 0 : k.with(lt).getSkeletonParam(a)) == null ? void 0 : U.skeleton;
|
|
1031
|
+
if (!p)
|
|
1031
1032
|
return;
|
|
1032
|
-
const
|
|
1033
|
+
const _ = p.worksheet.getMergedCell(r, o), P = {
|
|
1033
1034
|
data: e,
|
|
1034
|
-
style:
|
|
1035
|
-
primaryWithCoord:
|
|
1035
|
+
style: p.getStyles().getStyleByCell(e),
|
|
1036
|
+
primaryWithCoord: p.getCellWithCoordByIndex((L = _ == null ? void 0 : _.startRow) != null ? L : r, (y = _ == null ? void 0 : _.startColumn) != null ? y : o),
|
|
1036
1037
|
unitId: i,
|
|
1037
1038
|
subUnitId: a,
|
|
1038
1039
|
row: r,
|
|
@@ -1040,16 +1041,16 @@ let Qe = class extends dn {
|
|
|
1040
1041
|
workbook: l,
|
|
1041
1042
|
worksheet: s
|
|
1042
1043
|
};
|
|
1043
|
-
return (
|
|
1044
|
+
return (A = (T = c == null ? void 0 : c.canvasRender) == null ? void 0 : T.calcCellAutoHeight) == null ? void 0 : A.call(T, P);
|
|
1044
1045
|
}, e.interceptorAutoWidth = () => {
|
|
1045
|
-
var k,
|
|
1046
|
-
const
|
|
1047
|
-
if (!
|
|
1046
|
+
var k, U, L, y, T, A;
|
|
1047
|
+
const p = (U = (k = this._renderManagerService.getRenderById(i)) == null ? void 0 : k.with(lt).getSkeletonParam(a)) == null ? void 0 : U.skeleton;
|
|
1048
|
+
if (!p)
|
|
1048
1049
|
return;
|
|
1049
|
-
const
|
|
1050
|
+
const _ = p.worksheet.getMergedCell(r, o), P = {
|
|
1050
1051
|
data: e,
|
|
1051
|
-
style:
|
|
1052
|
-
primaryWithCoord:
|
|
1052
|
+
style: p.getStyles().getStyleByCell(e),
|
|
1053
|
+
primaryWithCoord: p.getCellWithCoordByIndex((L = _ == null ? void 0 : _.startRow) != null ? L : r, (y = _ == null ? void 0 : _.startColumn) != null ? y : o),
|
|
1053
1054
|
unitId: i,
|
|
1054
1055
|
subUnitId: a,
|
|
1055
1056
|
row: r,
|
|
@@ -1057,8 +1058,8 @@ let Qe = class extends dn {
|
|
|
1057
1058
|
workbook: l,
|
|
1058
1059
|
worksheet: s
|
|
1059
1060
|
};
|
|
1060
|
-
return (
|
|
1061
|
-
}, e.coverable = ((
|
|
1061
|
+
return (A = (T = c == null ? void 0 : c.canvasRender) == null ? void 0 : T.calcCellAutoWidth) == null ? void 0 : A.call(T, P);
|
|
1062
|
+
}, e.coverable = ((v = e == null ? void 0 : e.coverable) != null ? v : !0) && !(u.type === Y.LIST || u.type === Y.LIST_MULTIPLE), n(e);
|
|
1062
1063
|
}
|
|
1063
1064
|
}
|
|
1064
1065
|
)
|
|
@@ -1068,7 +1069,7 @@ let Qe = class extends dn {
|
|
|
1068
1069
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
|
1069
1070
|
// patched data-validation change don't need to re-calc row height
|
|
1070
1071
|
// re-calc of row height will be triggered precisely by the origin command
|
|
1071
|
-
|
|
1072
|
+
fn((e) => e.source === "command"),
|
|
1072
1073
|
ur(100)
|
|
1073
1074
|
).subscribe((e) => {
|
|
1074
1075
|
if (e.length === 0)
|
|
@@ -1076,7 +1077,7 @@ let Qe = class extends dn {
|
|
|
1076
1077
|
const t = [];
|
|
1077
1078
|
if (e.forEach((n) => {
|
|
1078
1079
|
var r;
|
|
1079
|
-
(n.rule.type ===
|
|
1080
|
+
(n.rule.type === Y.LIST_MULTIPLE || n.rule.type === Y.LIST) && (r = n.rule) != null && r.ranges && t.push(...n.rule.ranges);
|
|
1080
1081
|
}), t.length) {
|
|
1081
1082
|
const n = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
|
1082
1083
|
jn(n.redos, this._commandService);
|
|
@@ -1085,19 +1086,19 @@ let Qe = class extends dn {
|
|
|
1085
1086
|
}
|
|
1086
1087
|
};
|
|
1087
1088
|
Qe = Cr([
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1089
|
+
G(0, te),
|
|
1090
|
+
G(1, go),
|
|
1091
|
+
G(2, Ue),
|
|
1092
|
+
G(3, le),
|
|
1093
|
+
G(4, D(pr)),
|
|
1094
|
+
G(5, D(Ne)),
|
|
1095
|
+
G(6, D(oe)),
|
|
1096
|
+
G(7, D(Me)),
|
|
1097
|
+
G(8, D(un)),
|
|
1098
|
+
G(9, D(rr)),
|
|
1099
|
+
G(10, Nr(hr))
|
|
1099
1100
|
], Qe);
|
|
1100
|
-
let Nn = class extends
|
|
1101
|
+
let Nn = class extends cn {
|
|
1101
1102
|
constructor(e, t, n, r, o, i, a) {
|
|
1102
1103
|
super(), this._commandService = e, this._renderManagerService = t, this._autoHeightController = n, this._dataValidatorRegistryService = r, this._sheetInterceptorService = o, this._sheetDataValidationModel = i, this._dataValidationCacheService = a, this._initViewModelIntercept(), this._initAutoHeight();
|
|
1103
1104
|
}
|
|
@@ -1112,40 +1113,40 @@ let Nn = class extends dn {
|
|
|
1112
1113
|
priority: Jn.DATA_VALIDATION,
|
|
1113
1114
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1114
1115
|
handler: (e, t, n) => {
|
|
1115
|
-
var
|
|
1116
|
+
var R, w, S, I, b;
|
|
1116
1117
|
const { row: r, col: o, unitId: i, subUnitId: a, workbook: l, worksheet: s } = t, d = this._sheetDataValidationModel.getRuleIdByLocation(i, a, r, o);
|
|
1117
1118
|
if (!d)
|
|
1118
1119
|
return n(e);
|
|
1119
1120
|
const u = this._sheetDataValidationModel.getRuleById(i, a, d);
|
|
1120
1121
|
if (!u)
|
|
1121
1122
|
return n(e);
|
|
1122
|
-
const
|
|
1123
|
+
const g = (R = this._dataValidationCacheService.getValue(i, a, r, o)) != null ? R : Ye.VALID, c = this._dataValidatorRegistryService.getValidatorItem(u.type), m = s.getCellRaw(r, o), h = re(m), E = `${h != null ? h : ""}`;
|
|
1123
1124
|
return (!e || e === t.rawData) && (e = { ...t.rawData }), e.markers = {
|
|
1124
1125
|
...e == null ? void 0 : e.markers,
|
|
1125
|
-
...
|
|
1126
|
+
...g === Ye.INVALID ? Sr : null
|
|
1126
1127
|
}, e.customRender = [
|
|
1127
|
-
...(
|
|
1128
|
+
...(w = e == null ? void 0 : e.customRender) != null ? w : [],
|
|
1128
1129
|
...c != null && c.canvasRender ? [c.canvasRender] : []
|
|
1129
1130
|
], e.fontRenderExtension = {
|
|
1130
1131
|
...e == null ? void 0 : e.fontRenderExtension,
|
|
1131
|
-
isSkip: ((S = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : S.isSkip) || ((
|
|
1132
|
+
isSkip: ((S = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : S.isSkip) || ((I = c == null ? void 0 : c.skipDefaultFontRender) == null ? void 0 : I.call(c, u, h, t))
|
|
1132
1133
|
}, e.interceptorStyle = {
|
|
1133
1134
|
...e == null ? void 0 : e.interceptorStyle,
|
|
1134
|
-
...c == null ? void 0 : c.getExtraStyle(u,
|
|
1135
|
+
...c == null ? void 0 : c.getExtraStyle(u, E, {
|
|
1135
1136
|
get style() {
|
|
1136
|
-
const
|
|
1137
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
|
1137
|
+
const v = l.getStyles();
|
|
1138
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? v.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
|
1138
1139
|
}
|
|
1139
1140
|
}, r, o)
|
|
1140
1141
|
}, e.interceptorAutoHeight = () => {
|
|
1141
|
-
var P, k,
|
|
1142
|
-
const
|
|
1143
|
-
if (!
|
|
1142
|
+
var P, k, U, L, y, T;
|
|
1143
|
+
const v = (k = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(lt).getSkeletonParam(a)) == null ? void 0 : k.skeleton;
|
|
1144
|
+
if (!v)
|
|
1144
1145
|
return;
|
|
1145
|
-
const
|
|
1146
|
+
const p = v.worksheet.getMergedCell(r, o), _ = {
|
|
1146
1147
|
data: e,
|
|
1147
|
-
style:
|
|
1148
|
-
primaryWithCoord:
|
|
1148
|
+
style: v.getStyles().getStyleByCell(e),
|
|
1149
|
+
primaryWithCoord: v.getCellWithCoordByIndex((U = p == null ? void 0 : p.startRow) != null ? U : r, (L = p == null ? void 0 : p.startColumn) != null ? L : o),
|
|
1149
1150
|
unitId: i,
|
|
1150
1151
|
subUnitId: a,
|
|
1151
1152
|
row: r,
|
|
@@ -1153,16 +1154,16 @@ let Nn = class extends dn {
|
|
|
1153
1154
|
workbook: l,
|
|
1154
1155
|
worksheet: s
|
|
1155
1156
|
};
|
|
1156
|
-
return (
|
|
1157
|
+
return (T = (y = c == null ? void 0 : c.canvasRender) == null ? void 0 : y.calcCellAutoHeight) == null ? void 0 : T.call(y, _);
|
|
1157
1158
|
}, e.interceptorAutoWidth = () => {
|
|
1158
|
-
var P, k,
|
|
1159
|
-
const
|
|
1160
|
-
if (!
|
|
1159
|
+
var P, k, U, L, y, T;
|
|
1160
|
+
const v = (k = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(lt).getSkeletonParam(a)) == null ? void 0 : k.skeleton;
|
|
1161
|
+
if (!v)
|
|
1161
1162
|
return;
|
|
1162
|
-
const
|
|
1163
|
+
const p = v.worksheet.getMergedCell(r, o), _ = {
|
|
1163
1164
|
data: e,
|
|
1164
|
-
style:
|
|
1165
|
-
primaryWithCoord:
|
|
1165
|
+
style: v.getStyles().getStyleByCell(e),
|
|
1166
|
+
primaryWithCoord: v.getCellWithCoordByIndex((U = p == null ? void 0 : p.startRow) != null ? U : r, (L = p == null ? void 0 : p.startColumn) != null ? L : o),
|
|
1166
1167
|
unitId: i,
|
|
1167
1168
|
subUnitId: a,
|
|
1168
1169
|
row: r,
|
|
@@ -1170,8 +1171,8 @@ let Nn = class extends dn {
|
|
|
1170
1171
|
workbook: l,
|
|
1171
1172
|
worksheet: s
|
|
1172
1173
|
};
|
|
1173
|
-
return (
|
|
1174
|
-
}, e.coverable = ((
|
|
1174
|
+
return (T = (y = c == null ? void 0 : c.canvasRender) == null ? void 0 : y.calcCellAutoWidth) == null ? void 0 : T.call(y, _);
|
|
1175
|
+
}, e.coverable = ((b = e == null ? void 0 : e.coverable) != null ? b : !0) && !(u.type === Y.LIST || u.type === Y.LIST_MULTIPLE), n(e);
|
|
1175
1176
|
}
|
|
1176
1177
|
}
|
|
1177
1178
|
)
|
|
@@ -1179,13 +1180,13 @@ let Nn = class extends dn {
|
|
|
1179
1180
|
}
|
|
1180
1181
|
_initAutoHeight() {
|
|
1181
1182
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
|
1182
|
-
|
|
1183
|
+
fn((e) => e.source === "command"),
|
|
1183
1184
|
ur(16)
|
|
1184
1185
|
).subscribe((e) => {
|
|
1185
1186
|
const t = [];
|
|
1186
1187
|
if (e.forEach((n) => {
|
|
1187
1188
|
var r;
|
|
1188
|
-
(n.rule.type ===
|
|
1189
|
+
(n.rule.type === Y.LIST_MULTIPLE || n.rule.type === Y.LIST) && (r = n.rule) != null && r.ranges && t.push(...n.rule.ranges);
|
|
1189
1190
|
}), t.length) {
|
|
1190
1191
|
const n = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
|
1191
1192
|
jn(n.redos, this._commandService);
|
|
@@ -1194,20 +1195,20 @@ let Nn = class extends dn {
|
|
|
1194
1195
|
}
|
|
1195
1196
|
};
|
|
1196
1197
|
Nn = Cr([
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1198
|
+
G(0, te),
|
|
1199
|
+
G(1, Ue),
|
|
1200
|
+
G(2, D(pr)),
|
|
1201
|
+
G(3, D(Me)),
|
|
1202
|
+
G(4, D(un)),
|
|
1203
|
+
G(5, D(oe)),
|
|
1204
|
+
G(6, D(rr))
|
|
1204
1205
|
], Nn);
|
|
1205
1206
|
var Jo = Object.getOwnPropertyDescriptor, Qo = (e, t, n, r) => {
|
|
1206
1207
|
for (var o = r > 1 ? void 0 : r ? Jo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
1207
1208
|
(a = e[i]) && (o = a(o) || o);
|
|
1208
1209
|
return o;
|
|
1209
1210
|
}, Un = (e, t) => (n, r) => t(n, r, e);
|
|
1210
|
-
let
|
|
1211
|
+
let Et = class extends Re {
|
|
1211
1212
|
constructor(e, t, n) {
|
|
1212
1213
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = n, this._initSkeletonChange();
|
|
1213
1214
|
}
|
|
@@ -1227,13 +1228,13 @@ let bt = class extends Re {
|
|
|
1227
1228
|
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(Ur(16)).subscribe(e));
|
|
1228
1229
|
}
|
|
1229
1230
|
};
|
|
1230
|
-
|
|
1231
|
-
Un(1,
|
|
1232
|
-
Un(2,
|
|
1233
|
-
],
|
|
1231
|
+
Et = Qo([
|
|
1232
|
+
Un(1, D(oe)),
|
|
1233
|
+
Un(2, D(lt))
|
|
1234
|
+
], Et);
|
|
1234
1235
|
function $e({ ref: e, ...t }) {
|
|
1235
1236
|
const { icon: n, id: r, className: o, extend: i, ...a } = t, l = `univerjs-icon univerjs-icon-${r} ${o || ""}`.trim(), s = ht(`_${ni()}`);
|
|
1236
|
-
return
|
|
1237
|
+
return wr(n, `${r}`, {
|
|
1237
1238
|
defIds: n.defIds,
|
|
1238
1239
|
idSuffix: s.current
|
|
1239
1240
|
}, {
|
|
@@ -1242,12 +1243,12 @@ function $e({ ref: e, ...t }) {
|
|
|
1242
1243
|
...a
|
|
1243
1244
|
}, i);
|
|
1244
1245
|
}
|
|
1245
|
-
function
|
|
1246
|
-
return
|
|
1246
|
+
function wr(e, t, n, r, o) {
|
|
1247
|
+
return we(e.tag, {
|
|
1247
1248
|
key: t,
|
|
1248
1249
|
...ei(e, n, o),
|
|
1249
1250
|
...r
|
|
1250
|
-
}, (ti(e, n).children || []).map((i, a) =>
|
|
1251
|
+
}, (ti(e, n).children || []).map((i, a) => wr(i, `${t}-${e.tag}-${a}`, n, void 0, o)));
|
|
1251
1252
|
}
|
|
1252
1253
|
function ei(e, t, n) {
|
|
1253
1254
|
const r = { ...e.attrs };
|
|
@@ -1320,14 +1321,14 @@ const ri = {
|
|
|
1320
1321
|
}
|
|
1321
1322
|
}
|
|
1322
1323
|
]
|
|
1323
|
-
},
|
|
1324
|
-
return
|
|
1324
|
+
}, Ir = nt(function(t, n) {
|
|
1325
|
+
return we($e, Object.assign({}, t, {
|
|
1325
1326
|
id: "data-validation-icon",
|
|
1326
1327
|
ref: n,
|
|
1327
1328
|
icon: ri
|
|
1328
1329
|
}));
|
|
1329
1330
|
});
|
|
1330
|
-
|
|
1331
|
+
Ir.displayName = "DataValidationIcon";
|
|
1331
1332
|
const oi = {
|
|
1332
1333
|
tag: "svg",
|
|
1333
1334
|
attrs: {
|
|
@@ -1370,7 +1371,7 @@ const oi = {
|
|
|
1370
1371
|
}
|
|
1371
1372
|
]
|
|
1372
1373
|
}, Sn = nt(function(t, n) {
|
|
1373
|
-
return
|
|
1374
|
+
return we($e, Object.assign({}, t, {
|
|
1374
1375
|
id: "delete-icon",
|
|
1375
1376
|
ref: n,
|
|
1376
1377
|
icon: oi
|
|
@@ -1394,7 +1395,7 @@ const ii = {
|
|
|
1394
1395
|
}
|
|
1395
1396
|
}]
|
|
1396
1397
|
}, Rr = nt(function(t, n) {
|
|
1397
|
-
return
|
|
1398
|
+
return we($e, Object.assign({}, t, {
|
|
1398
1399
|
id: "increase-icon",
|
|
1399
1400
|
ref: n,
|
|
1400
1401
|
icon: ii
|
|
@@ -1419,14 +1420,14 @@ const ai = {
|
|
|
1419
1420
|
clipRule: "evenodd"
|
|
1420
1421
|
}
|
|
1421
1422
|
}]
|
|
1422
|
-
},
|
|
1423
|
-
return
|
|
1423
|
+
}, wn = nt(function(t, n) {
|
|
1424
|
+
return we($e, Object.assign({}, t, {
|
|
1424
1425
|
id: "more-down-icon",
|
|
1425
1426
|
ref: n,
|
|
1426
1427
|
icon: ai
|
|
1427
1428
|
}));
|
|
1428
1429
|
});
|
|
1429
|
-
|
|
1430
|
+
wn.displayName = "MoreDownIcon";
|
|
1430
1431
|
const si = {
|
|
1431
1432
|
tag: "svg",
|
|
1432
1433
|
attrs: {
|
|
@@ -1446,7 +1447,7 @@ const si = {
|
|
|
1446
1447
|
}
|
|
1447
1448
|
}]
|
|
1448
1449
|
}, yr = nt(function(t, n) {
|
|
1449
|
-
return
|
|
1450
|
+
return we($e, Object.assign({}, t, {
|
|
1450
1451
|
id: "more-up-icon",
|
|
1451
1452
|
ref: n,
|
|
1452
1453
|
icon: si
|
|
@@ -1507,7 +1508,7 @@ const li = {
|
|
|
1507
1508
|
}
|
|
1508
1509
|
]
|
|
1509
1510
|
}, Mr = nt(function(t, n) {
|
|
1510
|
-
return
|
|
1511
|
+
return we($e, Object.assign({}, t, {
|
|
1511
1512
|
id: "sequence-icon",
|
|
1512
1513
|
ref: n,
|
|
1513
1514
|
icon: li
|
|
@@ -1516,27 +1517,27 @@ const li = {
|
|
|
1516
1517
|
Mr.displayName = "SequenceIcon";
|
|
1517
1518
|
function di(e) {
|
|
1518
1519
|
var d;
|
|
1519
|
-
const t = F(de), n = F(
|
|
1520
|
-
return /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1520
|
+
const t = F(de), n = F(mn), { value: r, onChange: o, extraComponent: i } = e, [a, l] = W(!1), s = i ? n.get(i) : null;
|
|
1521
|
+
return /* @__PURE__ */ j(ct, { children: [
|
|
1522
|
+
/* @__PURE__ */ j(
|
|
1522
1523
|
"div",
|
|
1523
1524
|
{
|
|
1524
1525
|
className: "univer-mb-3 univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-text-gray-900 dark:!univer-text-white",
|
|
1525
1526
|
onClick: () => l(!a),
|
|
1526
1527
|
children: [
|
|
1527
1528
|
t.t("dataValidation.panel.options"),
|
|
1528
|
-
a ? /* @__PURE__ */ C(yr, { className: "univer-ml-1" }) : /* @__PURE__ */ C(
|
|
1529
|
+
a ? /* @__PURE__ */ C(yr, { className: "univer-ml-1" }) : /* @__PURE__ */ C(wn, { className: "univer-ml-1" })
|
|
1529
1530
|
]
|
|
1530
1531
|
}
|
|
1531
1532
|
),
|
|
1532
|
-
a && /* @__PURE__ */
|
|
1533
|
+
a && /* @__PURE__ */ j(ct, { children: [
|
|
1533
1534
|
s ? /* @__PURE__ */ C(s, { value: r, onChange: o }) : null,
|
|
1534
1535
|
/* @__PURE__ */ C(
|
|
1535
|
-
|
|
1536
|
+
X,
|
|
1536
1537
|
{
|
|
1537
1538
|
label: t.t("dataValidation.panel.invalid"),
|
|
1538
|
-
children: /* @__PURE__ */
|
|
1539
|
-
|
|
1539
|
+
children: /* @__PURE__ */ j(
|
|
1540
|
+
_n,
|
|
1540
1541
|
{
|
|
1541
1542
|
value: `${(d = r.errorStyle) != null ? d : st.WARNING}`,
|
|
1542
1543
|
onChange: (u) => o({ ...r, errorStyle: +u }),
|
|
@@ -1549,11 +1550,11 @@ function di(e) {
|
|
|
1549
1550
|
}
|
|
1550
1551
|
),
|
|
1551
1552
|
/* @__PURE__ */ C(
|
|
1552
|
-
|
|
1553
|
+
X,
|
|
1553
1554
|
{
|
|
1554
1555
|
label: t.t("dataValidation.panel.messageInfo"),
|
|
1555
1556
|
children: /* @__PURE__ */ C(
|
|
1556
|
-
|
|
1557
|
+
Pt,
|
|
1557
1558
|
{
|
|
1558
1559
|
checked: r.showErrorMessage,
|
|
1559
1560
|
onChange: () => o({
|
|
@@ -1565,7 +1566,7 @@ function di(e) {
|
|
|
1565
1566
|
)
|
|
1566
1567
|
}
|
|
1567
1568
|
),
|
|
1568
|
-
r.showErrorMessage ? /* @__PURE__ */ C(
|
|
1569
|
+
r.showErrorMessage ? /* @__PURE__ */ C(X, { children: /* @__PURE__ */ C(Pe, { value: r.error, onChange: (u) => o({ ...r, error: u }) }) }) : null
|
|
1569
1570
|
] })
|
|
1570
1571
|
] });
|
|
1571
1572
|
}
|
|
@@ -1578,43 +1579,43 @@ const ci = (e) => Fr(
|
|
|
1578
1579
|
);
|
|
1579
1580
|
function ui(e, t, n) {
|
|
1580
1581
|
var r, o, i, a;
|
|
1581
|
-
return t ? ((o = (r = e.getUnit(t)) == null ? void 0 : r.getSheetBySheetName(n)) == null ? void 0 : o.getSheetId()) || "" : ((a = (i = e.getCurrentUnitForType(
|
|
1582
|
+
return t ? ((o = (r = e.getUnit(t)) == null ? void 0 : r.getSheetBySheetName(n)) == null ? void 0 : o.getSheetId()) || "" : ((a = (i = e.getCurrentUnitForType(Z.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(n)) == null ? void 0 : a.getSheetId()) || "";
|
|
1582
1583
|
}
|
|
1583
1584
|
function hi() {
|
|
1584
|
-
var M,
|
|
1585
|
-
const [e, t] = W(0), n = F(me), r = Oe(n.activeRule$, n.activeRule), { unitId: o, subUnitId: i, rule: a } = r || {}, l = a.uid, s = F(Me), d = F(le), u = F(
|
|
1585
|
+
var M, N;
|
|
1586
|
+
const [e, t] = W(0), n = F(me), r = Oe(n.activeRule$, n.activeRule), { unitId: o, subUnitId: i, rule: a } = r || {}, l = a.uid, s = F(Me), d = F(le), u = F(mn), g = F(te), c = F(gn), m = F(de), [h, E] = W(a), R = s.getValidatorItem(h.type), [w, S] = W(!1), I = s.getValidatorsByScope(lo.SHEET), [b, v] = W(() => h.ranges.map((f) => ({ unitId: "", sheetId: "", range: f }))), p = dt(() => ci(g), [g]), [_, P] = W(!1), [k, U] = W(!1), L = ht(null), y = F(Gn);
|
|
1586
1587
|
if (Le(() => () => {
|
|
1587
|
-
const f =
|
|
1588
|
-
f &&
|
|
1589
|
-
}, [
|
|
1590
|
-
|
|
1588
|
+
const f = y.getCurrentLastSelection();
|
|
1589
|
+
f && y.setSelections([f]);
|
|
1590
|
+
}, [y]), Le(() => {
|
|
1591
|
+
g.onCommandExecuted((f) => {
|
|
1591
1592
|
(f.id === $r.id || f.id === xr.id) && setTimeout(() => {
|
|
1592
|
-
const
|
|
1593
|
-
t(($) => $ + 1),
|
|
1593
|
+
const O = c.getRuleById(o, i, l);
|
|
1594
|
+
t(($) => $ + 1), O && (E(O), v(O.ranges.map(($) => ({ unitId: "", sheetId: "", range: $ }))));
|
|
1594
1595
|
}, 20);
|
|
1595
1596
|
});
|
|
1596
|
-
}, [
|
|
1597
|
+
}, [g, c, l, i, o]), !R)
|
|
1597
1598
|
return null;
|
|
1598
|
-
const
|
|
1599
|
-
var f,
|
|
1600
|
-
(
|
|
1601
|
-
},
|
|
1602
|
-
const
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1605
|
-
const Vr = ui(d,
|
|
1606
|
-
return { ...
|
|
1599
|
+
const T = R.operators, A = R.operatorNames, x = h.operator ? co.includes(h.operator) : !1, H = () => {
|
|
1600
|
+
var f, O, $;
|
|
1601
|
+
(O = (f = L.current) == null ? void 0 : f.editor) != null && O.isFocus() && q(($ = L.current) == null ? void 0 : $.getValue()), !(!h.ranges.length || _) && (R.validatorFormula(h, o, i).success ? n.setActiveRule(null) : S(!0));
|
|
1602
|
+
}, q = nn((f) => {
|
|
1603
|
+
const O = f.split(",").filter(Boolean).map(To).map((Q) => {
|
|
1604
|
+
const In = Q.sheetName;
|
|
1605
|
+
if (In) {
|
|
1606
|
+
const Vr = ui(d, Q.unitId, In);
|
|
1607
|
+
return { ...Q, sheetId: Vr };
|
|
1607
1608
|
}
|
|
1608
1609
|
return {
|
|
1609
|
-
...
|
|
1610
|
+
...Q,
|
|
1610
1611
|
sheetId: ""
|
|
1611
1612
|
};
|
|
1612
1613
|
});
|
|
1613
|
-
if (Br(
|
|
1614
|
+
if (Br(O, b))
|
|
1614
1615
|
return;
|
|
1615
|
-
|
|
1616
|
-
const $ =
|
|
1617
|
-
if (
|
|
1616
|
+
v(O);
|
|
1617
|
+
const $ = O.filter((Q) => (!Q.unitId || Q.unitId === o) && (!Q.sheetId || Q.sheetId === i)).map((Q) => Q.range);
|
|
1618
|
+
if (E({
|
|
1618
1619
|
...h,
|
|
1619
1620
|
ranges: $
|
|
1620
1621
|
}), $.length === 0)
|
|
@@ -1625,27 +1626,27 @@ function hi() {
|
|
|
1625
1626
|
ruleId: l,
|
|
1626
1627
|
ranges: $
|
|
1627
1628
|
};
|
|
1628
|
-
|
|
1629
|
+
p(nr.id, ce);
|
|
1629
1630
|
}), B = (f) => {
|
|
1630
1631
|
if (Rn(f, Tn(h)))
|
|
1631
1632
|
return;
|
|
1632
|
-
|
|
1633
|
+
E({
|
|
1633
1634
|
...h,
|
|
1634
1635
|
...f
|
|
1635
1636
|
});
|
|
1636
|
-
const
|
|
1637
|
+
const O = {
|
|
1637
1638
|
unitId: o,
|
|
1638
1639
|
subUnitId: i,
|
|
1639
1640
|
ruleId: l,
|
|
1640
1641
|
setting: f
|
|
1641
1642
|
};
|
|
1642
|
-
|
|
1643
|
+
p(
|
|
1643
1644
|
En.id,
|
|
1644
|
-
|
|
1645
|
+
O,
|
|
1645
1646
|
void 0
|
|
1646
1647
|
);
|
|
1647
1648
|
}, ne = async () => {
|
|
1648
|
-
await
|
|
1649
|
+
await g.executeCommand(or.id, {
|
|
1649
1650
|
ruleId: l,
|
|
1650
1651
|
unitId: o,
|
|
1651
1652
|
subUnitId: i
|
|
@@ -1657,10 +1658,10 @@ function hi() {
|
|
|
1657
1658
|
formula2: h.formula2,
|
|
1658
1659
|
allowBlank: h.allowBlank
|
|
1659
1660
|
}, _e = (f) => {
|
|
1660
|
-
const
|
|
1661
|
-
if (!
|
|
1661
|
+
const O = s.getValidatorItem(f);
|
|
1662
|
+
if (!O)
|
|
1662
1663
|
return;
|
|
1663
|
-
const $ =
|
|
1664
|
+
const $ = O.operators, ce = c.getRuleById(o, i, l), Q = f === (ce == null ? void 0 : ce.type) || f.includes("list") && (ce != null && ce.type.includes("list")) ? {
|
|
1664
1665
|
...ce,
|
|
1665
1666
|
type: f
|
|
1666
1667
|
} : {
|
|
@@ -1670,17 +1671,17 @@ function hi() {
|
|
|
1670
1671
|
formula1: void 0,
|
|
1671
1672
|
formula2: void 0
|
|
1672
1673
|
};
|
|
1673
|
-
|
|
1674
|
+
E(Q), g.executeCommand(En.id, {
|
|
1674
1675
|
unitId: o,
|
|
1675
1676
|
subUnitId: i,
|
|
1676
1677
|
ruleId: h.uid,
|
|
1677
|
-
setting: Tn(
|
|
1678
|
+
setting: Tn(Q)
|
|
1678
1679
|
});
|
|
1679
|
-
}, Ce = u.get(
|
|
1680
|
-
Rn(f, Vn(h)) || (
|
|
1680
|
+
}, Ce = u.get(R.formulaInput), J = dt(() => b.map((f) => gr(f.range)).join(","), []), K = Vn(h), ge = (f) => {
|
|
1681
|
+
Rn(f, Vn(h)) || (E({
|
|
1681
1682
|
...h,
|
|
1682
1683
|
...f
|
|
1683
|
-
}),
|
|
1684
|
+
}), p(
|
|
1684
1685
|
Qr.id,
|
|
1685
1686
|
{
|
|
1686
1687
|
unitId: o,
|
|
@@ -1689,46 +1690,46 @@ function hi() {
|
|
|
1689
1690
|
options: f
|
|
1690
1691
|
}
|
|
1691
1692
|
));
|
|
1692
|
-
}, z =
|
|
1693
|
-
return /* @__PURE__ */
|
|
1693
|
+
}, z = T.length && !h.operator;
|
|
1694
|
+
return /* @__PURE__ */ j("div", { "data-u-comp": "data-validation-detail", className: "univer-py-2", children: [
|
|
1694
1695
|
/* @__PURE__ */ C(
|
|
1695
|
-
|
|
1696
|
+
X,
|
|
1696
1697
|
{
|
|
1697
1698
|
label: m.t("dataValidation.panel.range"),
|
|
1698
|
-
error: !h.ranges.length ||
|
|
1699
|
+
error: !h.ranges.length || _ ? m.t("dataValidation.panel.rangeError") : "",
|
|
1699
1700
|
children: /* @__PURE__ */ C(
|
|
1700
1701
|
Oo,
|
|
1701
1702
|
{
|
|
1702
|
-
selectorRef:
|
|
1703
|
+
selectorRef: L,
|
|
1703
1704
|
unitId: o,
|
|
1704
1705
|
subUnitId: i,
|
|
1705
|
-
initialValue:
|
|
1706
|
-
onChange: (f,
|
|
1706
|
+
initialValue: J,
|
|
1707
|
+
onChange: (f, O) => {
|
|
1707
1708
|
var $;
|
|
1708
|
-
!k && (($ =
|
|
1709
|
+
!k && (($ = L.current) != null && $.verify()) && q(O);
|
|
1709
1710
|
},
|
|
1710
|
-
onFocusChange: (f,
|
|
1711
|
+
onFocusChange: (f, O) => {
|
|
1711
1712
|
var $;
|
|
1712
|
-
|
|
1713
|
+
U(f), !f && O && (($ = L.current) != null && $.verify()) && q(O);
|
|
1713
1714
|
},
|
|
1714
1715
|
onVerify: (f) => P(!f)
|
|
1715
1716
|
}
|
|
1716
1717
|
)
|
|
1717
1718
|
}
|
|
1718
1719
|
),
|
|
1719
|
-
/* @__PURE__ */ C(
|
|
1720
|
+
/* @__PURE__ */ C(X, { label: m.t("dataValidation.panel.type"), children: /* @__PURE__ */ C(
|
|
1720
1721
|
Ln,
|
|
1721
1722
|
{
|
|
1722
1723
|
className: "univer-w-full",
|
|
1723
1724
|
value: h.type,
|
|
1724
|
-
options: (M =
|
|
1725
|
+
options: (M = I == null ? void 0 : I.sort((f, O) => f.order - O.order)) == null ? void 0 : M.map((f) => ({
|
|
1725
1726
|
label: m.t(f.title),
|
|
1726
1727
|
value: f.id
|
|
1727
1728
|
})),
|
|
1728
1729
|
onChange: _e
|
|
1729
1730
|
}
|
|
1730
1731
|
) }),
|
|
1731
|
-
|
|
1732
|
+
T != null && T.length ? /* @__PURE__ */ C(X, { label: m.t("dataValidation.panel.operator"), children: /* @__PURE__ */ C(
|
|
1732
1733
|
Ln,
|
|
1733
1734
|
{
|
|
1734
1735
|
className: "univer-w-full",
|
|
@@ -1738,9 +1739,9 @@ function hi() {
|
|
|
1738
1739
|
value: "",
|
|
1739
1740
|
label: m.t("dataValidation.operators.legal")
|
|
1740
1741
|
},
|
|
1741
|
-
...
|
|
1742
|
+
...T.map((f, O) => ({
|
|
1742
1743
|
value: `${f}`,
|
|
1743
|
-
label:
|
|
1744
|
+
label: A[O]
|
|
1744
1745
|
}))
|
|
1745
1746
|
],
|
|
1746
1747
|
onChange: (f) => {
|
|
@@ -1765,18 +1766,18 @@ function hi() {
|
|
|
1765
1766
|
...f
|
|
1766
1767
|
});
|
|
1767
1768
|
},
|
|
1768
|
-
showError:
|
|
1769
|
-
validResult:
|
|
1769
|
+
showError: w,
|
|
1770
|
+
validResult: R.validatorFormula(h, o, i),
|
|
1770
1771
|
unitId: o,
|
|
1771
1772
|
subUnitId: i,
|
|
1772
1773
|
ruleId: l
|
|
1773
1774
|
},
|
|
1774
1775
|
e + h.type
|
|
1775
1776
|
) : null,
|
|
1776
|
-
/* @__PURE__ */ C(
|
|
1777
|
-
|
|
1777
|
+
/* @__PURE__ */ C(X, { children: /* @__PURE__ */ C(
|
|
1778
|
+
Pt,
|
|
1778
1779
|
{
|
|
1779
|
-
checked: (
|
|
1780
|
+
checked: (N = h.allowBlank) != null ? N : !0,
|
|
1780
1781
|
onChange: () => {
|
|
1781
1782
|
var f;
|
|
1782
1783
|
return B({
|
|
@@ -1787,34 +1788,34 @@ function hi() {
|
|
|
1787
1788
|
children: m.t("dataValidation.panel.allowBlank")
|
|
1788
1789
|
}
|
|
1789
1790
|
) }),
|
|
1790
|
-
/* @__PURE__ */ C(di, { value:
|
|
1791
|
-
/* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ C(di, { value: K, onChange: ge, extraComponent: R.optionsInput }),
|
|
1792
|
+
/* @__PURE__ */ j("div", { className: "univer-mt-5 univer-flex univer-flex-row univer-justify-end", children: [
|
|
1792
1793
|
/* @__PURE__ */ C(Ke, { className: "univer-ml-3", onClick: ne, children: m.t("dataValidation.panel.removeRule") }),
|
|
1793
|
-
/* @__PURE__ */ C(Ke, { className: "univer-ml-3", variant: "primary", onClick:
|
|
1794
|
+
/* @__PURE__ */ C(Ke, { className: "univer-ml-3", variant: "primary", onClick: H, children: m.t("dataValidation.panel.done") })
|
|
1794
1795
|
] })
|
|
1795
1796
|
] });
|
|
1796
1797
|
}
|
|
1797
1798
|
const pi = (e) => {
|
|
1798
|
-
const { rule: t, onClick: n, unitId: r, subUnitId: o, disable: i } = e, a = F(Me), l = F(
|
|
1799
|
-
var
|
|
1800
|
-
const
|
|
1799
|
+
const { rule: t, onClick: n, unitId: r, subUnitId: o, disable: i } = e, a = F(Me), l = F(te), s = F(Eo), d = a.getValidatorItem(t.type), u = ht(void 0), [g, c] = W(!1), m = F(Yn), h = Oe(m.currentTheme$), E = dt(() => {
|
|
1800
|
+
var v;
|
|
1801
|
+
const w = m.getColorFromTheme("primary.600"), S = m.getColorFromTheme("loop-color.2"), I = (v = m.getColorFromTheme(S)) != null ? v : w, b = new Wr(I).toRgb();
|
|
1801
1802
|
return {
|
|
1802
|
-
fill: `rgba(${
|
|
1803
|
-
stroke:
|
|
1803
|
+
fill: `rgba(${b.r}, ${b.g}, ${b.b}, 0.1)`,
|
|
1804
|
+
stroke: I
|
|
1804
1805
|
};
|
|
1805
|
-
}, [h]),
|
|
1806
|
+
}, [h]), R = (w) => {
|
|
1806
1807
|
l.executeCommand(or.id, {
|
|
1807
1808
|
ruleId: t.uid,
|
|
1808
1809
|
unitId: r,
|
|
1809
1810
|
subUnitId: o
|
|
1810
|
-
}),
|
|
1811
|
+
}), w.stopPropagation();
|
|
1811
1812
|
};
|
|
1812
1813
|
return Le(() => () => {
|
|
1813
|
-
var
|
|
1814
|
-
u.current && ((
|
|
1814
|
+
var w;
|
|
1815
|
+
u.current && ((w = u.current) == null || w.forEach((S) => {
|
|
1815
1816
|
S && s.removeShape(S);
|
|
1816
1817
|
}));
|
|
1817
|
-
}, [s]), /* @__PURE__ */
|
|
1818
|
+
}, [s]), /* @__PURE__ */ j(
|
|
1818
1819
|
"div",
|
|
1819
1820
|
{
|
|
1820
1821
|
className: ke(
|
|
@@ -1830,15 +1831,15 @@ const pi = (e) => {
|
|
|
1830
1831
|
),
|
|
1831
1832
|
onClick: n,
|
|
1832
1833
|
onMouseEnter: () => {
|
|
1833
|
-
i || (c(!0), u.current = t.ranges.map((
|
|
1834
|
-
range:
|
|
1835
|
-
style:
|
|
1834
|
+
i || (c(!0), u.current = t.ranges.map((w) => s.addShape({
|
|
1835
|
+
range: w,
|
|
1836
|
+
style: E,
|
|
1836
1837
|
primary: null
|
|
1837
1838
|
})));
|
|
1838
1839
|
},
|
|
1839
1840
|
onMouseLeave: () => {
|
|
1840
|
-
var
|
|
1841
|
-
c(!1), (
|
|
1841
|
+
var w;
|
|
1842
|
+
c(!1), (w = u.current) == null || w.forEach((S) => {
|
|
1842
1843
|
S && s.removeShape(S);
|
|
1843
1844
|
}), u.current = void 0;
|
|
1844
1845
|
},
|
|
@@ -1854,14 +1855,14 @@ const pi = (e) => {
|
|
|
1854
1855
|
"div",
|
|
1855
1856
|
{
|
|
1856
1857
|
className: "univer-text-secondary univer-truncate univer-text-xs univer-leading-[18px] dark:!univer-text-gray-300",
|
|
1857
|
-
children: t.ranges.map((
|
|
1858
|
+
children: t.ranges.map((w) => gr(w)).join(",")
|
|
1858
1859
|
}
|
|
1859
1860
|
),
|
|
1860
|
-
|
|
1861
|
+
g ? /* @__PURE__ */ C(
|
|
1861
1862
|
"div",
|
|
1862
1863
|
{
|
|
1863
1864
|
className: "univer-absolute univer-right-2 univer-top-[19px] univer-flex univer-h-5 univer-w-5 univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-200 dark:!univer-text-gray-300 dark:hover:!univer-bg-gray-700",
|
|
1864
|
-
onClick:
|
|
1865
|
+
onClick: R,
|
|
1865
1866
|
children: /* @__PURE__ */ C(Sn, {})
|
|
1866
1867
|
}
|
|
1867
1868
|
) : null
|
|
@@ -1870,66 +1871,66 @@ const pi = (e) => {
|
|
|
1870
1871
|
);
|
|
1871
1872
|
};
|
|
1872
1873
|
function gi(e) {
|
|
1873
|
-
const t = F(oe), n = F(le), r = F(
|
|
1874
|
+
const t = F(oe), n = F(le), r = F(te), o = F(ye), i = F(me), a = F(de), [l, s] = W([]), { workbook: d } = e, u = Oe(d.activeSheet$, void 0, !0), g = d.getUnitId(), c = u == null ? void 0 : u.getSheetId();
|
|
1874
1875
|
Le(() => {
|
|
1875
|
-
s(t.getRules(
|
|
1876
|
-
const S = t.ruleChange$.subscribe((
|
|
1877
|
-
|
|
1876
|
+
s(t.getRules(g, c));
|
|
1877
|
+
const S = t.ruleChange$.subscribe((I) => {
|
|
1878
|
+
I.unitId === g && I.subUnitId === c && s(t.getRules(g, c));
|
|
1878
1879
|
});
|
|
1879
1880
|
return () => {
|
|
1880
1881
|
S.unsubscribe();
|
|
1881
1882
|
};
|
|
1882
|
-
}, [
|
|
1883
|
+
}, [g, c, t]);
|
|
1883
1884
|
const m = async () => {
|
|
1884
|
-
const S = er(o),
|
|
1885
|
-
unitId:
|
|
1885
|
+
const S = er(o), I = {
|
|
1886
|
+
unitId: g,
|
|
1886
1887
|
subUnitId: c,
|
|
1887
1888
|
rule: S
|
|
1888
1889
|
};
|
|
1889
|
-
await r.executeCommand(
|
|
1890
|
-
unitId:
|
|
1890
|
+
await r.executeCommand(hn.id, I), i.setActiveRule({
|
|
1891
|
+
unitId: g,
|
|
1891
1892
|
subUnitId: c,
|
|
1892
1893
|
rule: S
|
|
1893
1894
|
});
|
|
1894
1895
|
}, h = () => {
|
|
1895
1896
|
r.executeCommand(eo.id, {
|
|
1896
|
-
unitId:
|
|
1897
|
+
unitId: g,
|
|
1897
1898
|
subUnitId: c
|
|
1898
1899
|
});
|
|
1899
|
-
},
|
|
1900
|
-
const
|
|
1901
|
-
return S.map((P) => qr(o,
|
|
1902
|
-
})(l),
|
|
1903
|
-
return /* @__PURE__ */
|
|
1904
|
-
|
|
1905
|
-
var
|
|
1900
|
+
}, R = ((S) => {
|
|
1901
|
+
const I = n.getCurrentUnitForType(Z.UNIVER_SHEET), b = I.getActiveSheet(), v = I.getUnitId(), p = b.getSheetId();
|
|
1902
|
+
return S.map((P) => qr(o, v, p, P.ranges) ? { ...P } : { ...P, disable: !0 });
|
|
1903
|
+
})(l), w = R == null ? void 0 : R.some((S) => S.disable);
|
|
1904
|
+
return /* @__PURE__ */ j("div", { className: "univer-pb-4", children: [
|
|
1905
|
+
R == null ? void 0 : R.map((S) => {
|
|
1906
|
+
var I;
|
|
1906
1907
|
return /* @__PURE__ */ C(
|
|
1907
1908
|
pi,
|
|
1908
1909
|
{
|
|
1909
|
-
unitId:
|
|
1910
|
+
unitId: g,
|
|
1910
1911
|
subUnitId: c,
|
|
1911
1912
|
onClick: () => {
|
|
1912
1913
|
S.disable || i.setActiveRule({
|
|
1913
|
-
unitId:
|
|
1914
|
+
unitId: g,
|
|
1914
1915
|
subUnitId: c,
|
|
1915
1916
|
rule: S
|
|
1916
1917
|
});
|
|
1917
1918
|
},
|
|
1918
1919
|
rule: S,
|
|
1919
|
-
disable: (
|
|
1920
|
+
disable: (I = S.disable) != null ? I : !1
|
|
1920
1921
|
},
|
|
1921
1922
|
S.uid
|
|
1922
1923
|
);
|
|
1923
1924
|
}),
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
l.length && !
|
|
1925
|
+
/* @__PURE__ */ j("div", { className: "univer-mt-4 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
|
|
1926
|
+
l.length && !w ? /* @__PURE__ */ C(Ke, { onClick: h, children: a.t("dataValidation.panel.removeAll") }) : null,
|
|
1926
1927
|
/* @__PURE__ */ C(Ke, { variant: "primary", onClick: m, children: a.t("dataValidation.panel.add") })
|
|
1927
1928
|
] })
|
|
1928
1929
|
] });
|
|
1929
1930
|
}
|
|
1930
1931
|
const vi = () => {
|
|
1931
1932
|
const e = F(me), t = Oe(e.activeRule$, e.activeRule), n = F(le), r = Oe(
|
|
1932
|
-
() => n.getCurrentTypeOfUnit$(
|
|
1933
|
+
() => n.getCurrentTypeOfUnit$(Z.UNIVER_SHEET),
|
|
1933
1934
|
void 0,
|
|
1934
1935
|
void 0,
|
|
1935
1936
|
[]
|
|
@@ -1940,8 +1941,8 @@ const vi = () => {
|
|
|
1940
1941
|
return !r || !o ? null : t && t.subUnitId === o.getSheetId() ? /* @__PURE__ */ C(hi, {}, t.rule.uid) : /* @__PURE__ */ C(gi, { workbook: r });
|
|
1941
1942
|
}, mi = (e) => {
|
|
1942
1943
|
const { isTwoFormula: t = !1, value: n, onChange: r, showError: o, validResult: i } = e, a = F(de), l = o ? i == null ? void 0 : i.formula1 : "", s = o ? i == null ? void 0 : i.formula2 : "";
|
|
1943
|
-
return t ? /* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */ C(
|
|
1944
|
+
return t ? /* @__PURE__ */ j(ct, { children: [
|
|
1945
|
+
/* @__PURE__ */ C(X, { error: l, children: /* @__PURE__ */ C(
|
|
1945
1946
|
Pe,
|
|
1946
1947
|
{
|
|
1947
1948
|
className: "univer-w-full",
|
|
@@ -1956,7 +1957,7 @@ const vi = () => {
|
|
|
1956
1957
|
}
|
|
1957
1958
|
) }),
|
|
1958
1959
|
/* @__PURE__ */ C("div", { className: "-univer-mt-2 univer-mb-1 univer-text-sm univer-text-gray-400", children: a.t("dataValidation.panel.formulaAnd") }),
|
|
1959
|
-
/* @__PURE__ */ C(
|
|
1960
|
+
/* @__PURE__ */ C(X, { error: s, children: /* @__PURE__ */ C(
|
|
1960
1961
|
Pe,
|
|
1961
1962
|
{
|
|
1962
1963
|
className: "univer-w-full",
|
|
@@ -1970,7 +1971,7 @@ const vi = () => {
|
|
|
1970
1971
|
}
|
|
1971
1972
|
}
|
|
1972
1973
|
) })
|
|
1973
|
-
] }) : /* @__PURE__ */ C(
|
|
1974
|
+
] }) : /* @__PURE__ */ C(X, { error: l, children: /* @__PURE__ */ C(
|
|
1974
1975
|
Pe,
|
|
1975
1976
|
{
|
|
1976
1977
|
className: "univer-w-full",
|
|
@@ -1984,9 +1985,9 @@ const vi = () => {
|
|
|
1984
1985
|
};
|
|
1985
1986
|
function fi(e) {
|
|
1986
1987
|
const { value: t, onChange: n, showError: r, validResult: o } = e, i = F(de), a = r ? o == null ? void 0 : o.formula1 : "", l = r ? o == null ? void 0 : o.formula2 : "", [s, d] = W(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
|
1987
|
-
return /* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */ C(
|
|
1989
|
-
|
|
1988
|
+
return /* @__PURE__ */ j(ct, { children: [
|
|
1989
|
+
/* @__PURE__ */ C(X, { children: /* @__PURE__ */ C(
|
|
1990
|
+
Pt,
|
|
1990
1991
|
{
|
|
1991
1992
|
checked: s,
|
|
1992
1993
|
onChange: (u) => {
|
|
@@ -1999,7 +2000,7 @@ function fi(e) {
|
|
|
1999
2000
|
children: i.t("dataValidation.checkbox.tips")
|
|
2000
2001
|
}
|
|
2001
2002
|
) }),
|
|
2002
|
-
s ? /* @__PURE__ */ C(
|
|
2003
|
+
s ? /* @__PURE__ */ C(X, { label: i.t("dataValidation.checkbox.checked"), error: a, children: /* @__PURE__ */ C(
|
|
2003
2004
|
Pe,
|
|
2004
2005
|
{
|
|
2005
2006
|
className: "univer-w-full",
|
|
@@ -2013,7 +2014,7 @@ function fi(e) {
|
|
|
2013
2014
|
}
|
|
2014
2015
|
}
|
|
2015
2016
|
) }) : null,
|
|
2016
|
-
s ? /* @__PURE__ */ C(
|
|
2017
|
+
s ? /* @__PURE__ */ C(X, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ C(
|
|
2017
2018
|
Pe,
|
|
2018
2019
|
{
|
|
2019
2020
|
className: "univer-w-full",
|
|
@@ -2030,17 +2031,17 @@ function fi(e) {
|
|
|
2030
2031
|
] });
|
|
2031
2032
|
}
|
|
2032
2033
|
function _i(e) {
|
|
2033
|
-
var
|
|
2034
|
+
var g;
|
|
2034
2035
|
const { unitId: t, subUnitId: n, value: r, onChange: o, showError: i, validResult: a } = e, l = i ? a == null ? void 0 : a.formula1 : void 0, s = ht(null), [d, u] = W(!1);
|
|
2035
2036
|
return dr((c) => {
|
|
2036
2037
|
var h;
|
|
2037
2038
|
(h = s.current) != null && h.isClickOutSide(c) && u(!1);
|
|
2038
|
-
}), /* @__PURE__ */ C(
|
|
2039
|
+
}), /* @__PURE__ */ C(X, { error: l, children: /* @__PURE__ */ C(
|
|
2039
2040
|
vr,
|
|
2040
2041
|
{
|
|
2041
2042
|
ref: s,
|
|
2042
2043
|
className: ke("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", Rt),
|
|
2043
|
-
initValue: (
|
|
2044
|
+
initValue: (g = r == null ? void 0 : r.formula1) != null ? g : "=",
|
|
2044
2045
|
unitId: t,
|
|
2045
2046
|
subUnitId: n,
|
|
2046
2047
|
isFocus: d,
|
|
@@ -2109,7 +2110,7 @@ const Ci = [
|
|
|
2109
2110
|
)
|
|
2110
2111
|
}
|
|
2111
2112
|
),
|
|
2112
|
-
children: /* @__PURE__ */
|
|
2113
|
+
children: /* @__PURE__ */ j(
|
|
2113
2114
|
"div",
|
|
2114
2115
|
{
|
|
2115
2116
|
className: ke("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", Rt),
|
|
@@ -2121,7 +2122,7 @@ const Ci = [
|
|
|
2121
2122
|
style: { background: t }
|
|
2122
2123
|
}
|
|
2123
2124
|
),
|
|
2124
|
-
/* @__PURE__ */ C(
|
|
2125
|
+
/* @__PURE__ */ C(wn, {})
|
|
2125
2126
|
]
|
|
2126
2127
|
}
|
|
2127
2128
|
)
|
|
@@ -2129,7 +2130,7 @@ const Ci = [
|
|
|
2129
2130
|
);
|
|
2130
2131
|
}, Fn = (e) => {
|
|
2131
2132
|
const { item: t, commonProps: n, className: r } = e, { onItemChange: o, onItemDelete: i } = n;
|
|
2132
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ j("div", { className: ke("univer-flex univer-items-center univer-gap-2", r), children: [
|
|
2133
2134
|
!t.isRef && /* @__PURE__ */ C("div", { className: ke("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ C(Mr, {}) }),
|
|
2134
2135
|
/* @__PURE__ */ C(
|
|
2135
2136
|
Si,
|
|
@@ -2159,50 +2160,50 @@ const Ci = [
|
|
|
2159
2160
|
)
|
|
2160
2161
|
] });
|
|
2161
2162
|
};
|
|
2162
|
-
function
|
|
2163
|
+
function wi(e) {
|
|
2163
2164
|
const { value: t, onChange: n = () => {
|
|
2164
|
-
}, unitId: r, subUnitId: o, validResult: i, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u,
|
|
2165
|
+
}, unitId: r, subUnitId: o, validResult: i, showError: a, ruleId: l } = e, { formula1: s = "", formula2: d = "" } = t || {}, [u, g] = W(() => De(s) ? "1" : "0"), [c, m] = W(u === "1" ? s : "="), [h, E] = W(u === "1" ? s : "="), R = F(de), w = F(Me), S = F(gn), I = F(to), [b, v] = W(() => d.split(",")), p = w.getValidatorItem(Y.LIST), [_, P] = W([]), [k, U] = W(""), L = a ? i == null ? void 0 : i.formula1 : "", y = dt(() => S.ruleChange$.pipe(cr(16)), []), T = Oe(y), A = nn(n);
|
|
2165
2166
|
Le(() => {
|
|
2166
2167
|
(async () => {
|
|
2167
2168
|
await new Promise((f) => {
|
|
2168
2169
|
setTimeout(() => f(!0), 100);
|
|
2169
2170
|
});
|
|
2170
|
-
const M = S.getRuleById(r, o, l),
|
|
2171
|
-
if (De(
|
|
2172
|
-
const f = await
|
|
2171
|
+
const M = S.getRuleById(r, o, l), N = M == null ? void 0 : M.formula1;
|
|
2172
|
+
if (De(N) && p && M) {
|
|
2173
|
+
const f = await p.getListAsync(M, r, o);
|
|
2173
2174
|
P(f);
|
|
2174
2175
|
}
|
|
2175
2176
|
})();
|
|
2176
|
-
}, [S,
|
|
2177
|
-
De(s) && s !== h && (m(s),
|
|
2177
|
+
}, [S, T, p, l, o, r]), Le(() => {
|
|
2178
|
+
De(s) && s !== h && (m(s), E(h));
|
|
2178
2179
|
}, [h, s]);
|
|
2179
|
-
const [x,
|
|
2180
|
-
const M = u !== "1" ? no(s) : [],
|
|
2181
|
-
return M.map((f,
|
|
2180
|
+
const [x, H] = W(() => {
|
|
2181
|
+
const M = u !== "1" ? no(s) : [], N = d.split(",");
|
|
2182
|
+
return M.map((f, O) => ({
|
|
2182
2183
|
label: f,
|
|
2183
|
-
color:
|
|
2184
|
+
color: N[O] || Te,
|
|
2184
2185
|
isRef: !1,
|
|
2185
2186
|
id: yn(4)
|
|
2186
2187
|
}));
|
|
2187
|
-
}),
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2188
|
+
}), q = (M, N, f) => {
|
|
2189
|
+
const O = x.find(($) => $.id === M);
|
|
2190
|
+
O && (O.label = N, O.color = f, H([...x]));
|
|
2190
2191
|
}, B = (M) => {
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2193
|
-
}, ne = d.split(","), ie = dt(() =>
|
|
2192
|
+
const N = x.findIndex((f) => f.id === M);
|
|
2193
|
+
N !== -1 && (x.splice(N, 1), H([...x]));
|
|
2194
|
+
}, ne = d.split(","), ie = dt(() => _.map((M, N) => ({
|
|
2194
2195
|
label: M,
|
|
2195
|
-
color: ne[
|
|
2196
|
-
id: `${
|
|
2196
|
+
color: ne[N] || Te,
|
|
2197
|
+
id: `${N}`,
|
|
2197
2198
|
isRef: !0
|
|
2198
|
-
})), [ne,
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2199
|
+
})), [ne, _]), _e = (M, N, f) => {
|
|
2200
|
+
const O = [...b];
|
|
2201
|
+
O[+M] = f, v(O), A({
|
|
2201
2202
|
formula1: s,
|
|
2202
|
-
formula2:
|
|
2203
|
+
formula2: O.join(",")
|
|
2203
2204
|
});
|
|
2204
2205
|
}, Ce = () => {
|
|
2205
|
-
|
|
2206
|
+
H([
|
|
2206
2207
|
...x,
|
|
2207
2208
|
{
|
|
2208
2209
|
label: "",
|
|
@@ -2215,63 +2216,63 @@ function Ii(e) {
|
|
|
2215
2216
|
Le(() => {
|
|
2216
2217
|
if (u === "1")
|
|
2217
2218
|
return;
|
|
2218
|
-
const M = /* @__PURE__ */ new Set(),
|
|
2219
|
+
const M = /* @__PURE__ */ new Set(), N = [];
|
|
2219
2220
|
x.map((f) => ({
|
|
2220
2221
|
labelList: f.label.split(","),
|
|
2221
2222
|
item: f
|
|
2222
|
-
})).forEach(({ item: f, labelList:
|
|
2223
|
-
|
|
2224
|
-
M.has($) || (M.add($),
|
|
2223
|
+
})).forEach(({ item: f, labelList: O }) => {
|
|
2224
|
+
O.forEach(($) => {
|
|
2225
|
+
M.has($) || (M.add($), N.push({
|
|
2225
2226
|
label: $,
|
|
2226
2227
|
color: f.color
|
|
2227
2228
|
}));
|
|
2228
2229
|
});
|
|
2229
|
-
}),
|
|
2230
|
-
formula1: Qn(
|
|
2231
|
-
formula2:
|
|
2230
|
+
}), A({
|
|
2231
|
+
formula1: Qn(N.map((f) => f.label)),
|
|
2232
|
+
formula2: N.map((f) => f.color === Te ? "" : f.color).join(",")
|
|
2232
2233
|
});
|
|
2233
|
-
}, [x,
|
|
2234
|
-
const
|
|
2234
|
+
}, [x, A, u, h, b]);
|
|
2235
|
+
const J = nn(async (M) => {
|
|
2235
2236
|
if (!De(M)) {
|
|
2236
|
-
|
|
2237
|
+
A == null || A({
|
|
2237
2238
|
formula1: "",
|
|
2238
2239
|
formula2: d
|
|
2239
2240
|
});
|
|
2240
2241
|
return;
|
|
2241
2242
|
}
|
|
2242
|
-
|
|
2243
|
+
I.getFormulaRefCheck(M) ? (A == null || A({
|
|
2243
2244
|
formula1: De(M) ? M : "",
|
|
2244
2245
|
formula2: d
|
|
2245
|
-
}),
|
|
2246
|
+
}), U("")) : (A == null || A({
|
|
2246
2247
|
formula1: "",
|
|
2247
2248
|
formula2: d
|
|
2248
|
-
}), m("="),
|
|
2249
|
-
}),
|
|
2249
|
+
}), m("="), U(R.t("dataValidation.validFail.formulaError")));
|
|
2250
|
+
}), K = ht(null), [ge, z] = W(!1);
|
|
2250
2251
|
return dr((M) => {
|
|
2251
2252
|
var f;
|
|
2252
|
-
(f =
|
|
2253
|
-
}), /* @__PURE__ */
|
|
2254
|
-
/* @__PURE__ */ C(
|
|
2255
|
-
|
|
2253
|
+
(f = K.current) != null && f.isClickOutSide(M) && z(!1);
|
|
2254
|
+
}), /* @__PURE__ */ j(ct, { children: [
|
|
2255
|
+
/* @__PURE__ */ C(X, { label: R.t("dataValidation.list.options"), children: /* @__PURE__ */ j(
|
|
2256
|
+
_n,
|
|
2256
2257
|
{
|
|
2257
2258
|
value: u,
|
|
2258
2259
|
onChange: (M) => {
|
|
2259
|
-
|
|
2260
|
+
g(M), m(h), M === "1" && A({
|
|
2260
2261
|
formula1: h === "=" ? "" : h,
|
|
2261
|
-
formula2:
|
|
2262
|
+
formula2: b.join(",")
|
|
2262
2263
|
});
|
|
2263
2264
|
},
|
|
2264
2265
|
children: [
|
|
2265
|
-
/* @__PURE__ */ C(Ae, { value: "0", children:
|
|
2266
|
-
/* @__PURE__ */ C(Ae, { value: "1", children:
|
|
2266
|
+
/* @__PURE__ */ C(Ae, { value: "0", children: R.t("dataValidation.list.customOptions") }),
|
|
2267
|
+
/* @__PURE__ */ C(Ae, { value: "1", children: R.t("dataValidation.list.refOptions") })
|
|
2267
2268
|
]
|
|
2268
2269
|
}
|
|
2269
2270
|
) }),
|
|
2270
|
-
u === "1" ? /* @__PURE__ */
|
|
2271
|
+
u === "1" ? /* @__PURE__ */ j(X, { error: L || k || void 0, children: [
|
|
2271
2272
|
/* @__PURE__ */ C(
|
|
2272
2273
|
vr,
|
|
2273
2274
|
{
|
|
2274
|
-
ref:
|
|
2275
|
+
ref: K,
|
|
2275
2276
|
className: ke("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", Rt),
|
|
2276
2277
|
initValue: c,
|
|
2277
2278
|
unitId: r,
|
|
@@ -2280,8 +2281,8 @@ function Ii(e) {
|
|
|
2280
2281
|
isSupportAcrossSheet: !0,
|
|
2281
2282
|
onFocus: () => z(!0),
|
|
2282
2283
|
onChange: (M = "") => {
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2284
|
+
const N = (M != null ? M : "").trim();
|
|
2285
|
+
E(N), J(N);
|
|
2285
2286
|
}
|
|
2286
2287
|
}
|
|
2287
2288
|
),
|
|
@@ -2294,12 +2295,12 @@ function Ii(e) {
|
|
|
2294
2295
|
},
|
|
2295
2296
|
M.id
|
|
2296
2297
|
)) })
|
|
2297
|
-
] }) : /* @__PURE__ */ C(
|
|
2298
|
+
] }) : /* @__PURE__ */ C(X, { error: L, children: /* @__PURE__ */ j("div", { className: "-univer-mt-3", children: [
|
|
2298
2299
|
/* @__PURE__ */ C(
|
|
2299
2300
|
Do,
|
|
2300
2301
|
{
|
|
2301
2302
|
list: x,
|
|
2302
|
-
onListChange:
|
|
2303
|
+
onListChange: H,
|
|
2303
2304
|
rowHeight: 28,
|
|
2304
2305
|
margin: [0, 12],
|
|
2305
2306
|
draggableHandle: ".draggableHandle",
|
|
@@ -2308,7 +2309,7 @@ function Ii(e) {
|
|
|
2308
2309
|
{
|
|
2309
2310
|
item: M,
|
|
2310
2311
|
commonProps: {
|
|
2311
|
-
onItemChange:
|
|
2312
|
+
onItemChange: q,
|
|
2312
2313
|
onItemDelete: B
|
|
2313
2314
|
}
|
|
2314
2315
|
},
|
|
@@ -2317,54 +2318,54 @@ function Ii(e) {
|
|
|
2317
2318
|
idKey: "id"
|
|
2318
2319
|
}
|
|
2319
2320
|
),
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ j(
|
|
2321
2322
|
"a",
|
|
2322
2323
|
{
|
|
2323
2324
|
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",
|
|
2324
2325
|
onClick: Ce,
|
|
2325
2326
|
children: [
|
|
2326
2327
|
/* @__PURE__ */ C(Rr, { className: "univer-mr-1" }),
|
|
2327
|
-
|
|
2328
|
+
R.t("dataValidation.list.add")
|
|
2328
2329
|
]
|
|
2329
2330
|
}
|
|
2330
2331
|
)
|
|
2331
2332
|
] }) })
|
|
2332
2333
|
] });
|
|
2333
2334
|
}
|
|
2334
|
-
const
|
|
2335
|
+
const Ii = [
|
|
2335
2336
|
[
|
|
2336
2337
|
ir,
|
|
2337
2338
|
_i
|
|
2338
2339
|
],
|
|
2339
2340
|
[
|
|
2340
|
-
|
|
2341
|
+
At,
|
|
2341
2342
|
mi
|
|
2342
2343
|
],
|
|
2343
2344
|
[
|
|
2344
|
-
|
|
2345
|
-
|
|
2345
|
+
pn,
|
|
2346
|
+
wi
|
|
2346
2347
|
],
|
|
2347
2348
|
[
|
|
2348
2349
|
ar,
|
|
2349
2350
|
fi
|
|
2350
2351
|
]
|
|
2351
2352
|
], Ri = "LIST_RENDER_MODE_OPTION_INPUT";
|
|
2352
|
-
function
|
|
2353
|
+
function Dt(e) {
|
|
2353
2354
|
var o;
|
|
2354
2355
|
const { value: t, onChange: n } = e, r = F(de);
|
|
2355
|
-
return /* @__PURE__ */ C(
|
|
2356
|
+
return /* @__PURE__ */ C(X, { label: r.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ j(_n, { value: `${(o = t.renderMode) != null ? o : ae.CUSTOM}`, onChange: (i) => n({ ...t, renderMode: +i }), children: [
|
|
2356
2357
|
/* @__PURE__ */ C(Ae, { value: `${ae.CUSTOM}`, children: r.t("dataValidation.renderMode.chip") }),
|
|
2357
2358
|
/* @__PURE__ */ C(Ae, { value: `${ae.ARROW}`, children: r.t("dataValidation.renderMode.arrow") }),
|
|
2358
2359
|
/* @__PURE__ */ C(Ae, { value: `${ae.TEXT}`, children: r.t("dataValidation.renderMode.text") })
|
|
2359
2360
|
] }) });
|
|
2360
2361
|
}
|
|
2361
|
-
|
|
2362
|
+
Dt.componentKey = Ri;
|
|
2362
2363
|
const yi = "DATE_SHOW_TIME_OPTION";
|
|
2363
|
-
function
|
|
2364
|
+
function Vt(e) {
|
|
2364
2365
|
var o;
|
|
2365
2366
|
const { value: t, onChange: n } = e, r = F(de);
|
|
2366
|
-
return /* @__PURE__ */ C(
|
|
2367
|
-
|
|
2367
|
+
return /* @__PURE__ */ C(X, { children: /* @__PURE__ */ C(
|
|
2368
|
+
Pt,
|
|
2368
2369
|
{
|
|
2369
2370
|
checked: (o = t.bizInfo) == null ? void 0 : o.showTime,
|
|
2370
2371
|
onChange: (i) => {
|
|
@@ -2380,19 +2381,19 @@ function Dt(e) {
|
|
|
2380
2381
|
}
|
|
2381
2382
|
) });
|
|
2382
2383
|
}
|
|
2383
|
-
|
|
2384
|
+
Vt.componentKey = yi;
|
|
2384
2385
|
var Mi = Object.getOwnPropertyDescriptor, bi = (e, t, n, r) => {
|
|
2385
2386
|
for (var o = r > 1 ? void 0 : r ? Mi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2386
2387
|
(a = e[i]) && (o = a(o) || o);
|
|
2387
2388
|
return o;
|
|
2388
2389
|
}, We = (e, t) => (n, r) => t(n, r, e);
|
|
2389
2390
|
const ft = 6;
|
|
2390
|
-
let
|
|
2391
|
+
let on = class {
|
|
2391
2392
|
constructor(e, t, n, r, o, i) {
|
|
2392
2393
|
this._commandService = e, this._univerInstanceService = t, this._formulaService = n, this._themeService = r, this._renderManagerService = o, this._dataValidationModel = i;
|
|
2393
2394
|
}
|
|
2394
2395
|
_calc(e, t) {
|
|
2395
|
-
var d, u,
|
|
2396
|
+
var d, u, g;
|
|
2396
2397
|
const { vt: n, ht: r } = t || {}, o = e.endX - e.startX - ft * 2, i = e.endY - e.startY, a = ((d = t == null ? void 0 : t.fs) != null ? d : 10) * 1.6;
|
|
2397
2398
|
let l = 0, s = 0;
|
|
2398
2399
|
switch (n) {
|
|
@@ -2407,10 +2408,10 @@ let rn = class {
|
|
|
2407
2408
|
break;
|
|
2408
2409
|
}
|
|
2409
2410
|
switch (r) {
|
|
2410
|
-
case
|
|
2411
|
+
case Ie.LEFT:
|
|
2411
2412
|
l = ft;
|
|
2412
2413
|
break;
|
|
2413
|
-
case
|
|
2414
|
+
case Ie.RIGHT:
|
|
2414
2415
|
l = ft + (o - a);
|
|
2415
2416
|
break;
|
|
2416
2417
|
default:
|
|
@@ -2421,7 +2422,7 @@ let rn = class {
|
|
|
2421
2422
|
left: e.startX + l,
|
|
2422
2423
|
top: e.startY + s,
|
|
2423
2424
|
width: ((u = t == null ? void 0 : t.fs) != null ? u : 10) * 1.6,
|
|
2424
|
-
height: ((
|
|
2425
|
+
height: ((g = t == null ? void 0 : t.fs) != null ? g : 10) * 1.6
|
|
2425
2426
|
};
|
|
2426
2427
|
}
|
|
2427
2428
|
calcCellAutoHeight(e) {
|
|
@@ -2435,25 +2436,25 @@ let rn = class {
|
|
|
2435
2436
|
return ((n = t == null ? void 0 : t.fs) != null ? n : 10) * 1.6;
|
|
2436
2437
|
}
|
|
2437
2438
|
async _parseFormula(e, t, n) {
|
|
2438
|
-
var d, u,
|
|
2439
|
-
const { formula1: r = io, formula2: o = oo } = e, i = await this._formulaService.getRuleFormulaResult(t, n, e.uid), a =
|
|
2439
|
+
var d, u, g, c, m, h, E, R, w;
|
|
2440
|
+
const { formula1: r = io, formula2: o = oo } = e, i = await this._formulaService.getRuleFormulaResult(t, n, e.uid), a = Ft((g = (u = (d = i == null ? void 0 : i[0]) == null ? void 0 : d.result) == null ? void 0 : u[0]) == null ? void 0 : g[0]), l = Ft((h = (m = (c = i == null ? void 0 : i[1]) == null ? void 0 : c.result) == null ? void 0 : m[0]) == null ? void 0 : h[0]), s = Dn(String(a)) && Dn(String(l));
|
|
2440
2441
|
return {
|
|
2441
|
-
formula1: De(r) ?
|
|
2442
|
+
formula1: De(r) ? Ft((w = (R = (E = i == null ? void 0 : i[0]) == null ? void 0 : E.result) == null ? void 0 : R[0]) == null ? void 0 : w[0]) : r,
|
|
2442
2443
|
formula2: De(o) ? l : o,
|
|
2443
2444
|
isFormulaValid: s
|
|
2444
2445
|
};
|
|
2445
2446
|
}
|
|
2446
2447
|
drawWith(e, t) {
|
|
2447
|
-
var
|
|
2448
|
-
const { style: n, primaryWithCoord: r, unitId: o, subUnitId: i, worksheet: a, row: l, col: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = re(a.getCellRaw(l, s)),
|
|
2449
|
-
if (!
|
|
2448
|
+
var L, y, T, A;
|
|
2449
|
+
const { style: n, primaryWithCoord: r, unitId: o, subUnitId: i, worksheet: a, row: l, col: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = re(a.getCellRaw(l, s)), g = this._dataValidationModel.getRuleByLocation(o, i, l, s);
|
|
2450
|
+
if (!g)
|
|
2450
2451
|
return;
|
|
2451
|
-
const c = this._dataValidationModel.getValidator(
|
|
2452
|
-
if (!c || !((
|
|
2452
|
+
const c = this._dataValidationModel.getValidator(g.type);
|
|
2453
|
+
if (!c || !((L = c.skipDefaultFontRender) != null && L.call(c, g, u, { unitId: o, subUnitId: i, row: l, column: s })))
|
|
2453
2454
|
return;
|
|
2454
|
-
const m = c.parseFormulaSync(
|
|
2455
|
+
const m = c.parseFormulaSync(g, o, i), { formula1: h } = m, E = this._calc(d, n), { a: R, d: w } = e.getTransform(), S = Mn(E.left, R), I = Mn(E.top, w), b = jr.create().composeMatrix({
|
|
2455
2456
|
left: S,
|
|
2456
|
-
top:
|
|
2457
|
+
top: I,
|
|
2457
2458
|
scaleX: 1,
|
|
2458
2459
|
scaleY: 1,
|
|
2459
2460
|
angle: 0,
|
|
@@ -2461,16 +2462,16 @@ let rn = class {
|
|
|
2461
2462
|
skewY: 0,
|
|
2462
2463
|
flipX: !1,
|
|
2463
2464
|
flipY: !1
|
|
2464
|
-
}),
|
|
2465
|
-
e.save(), e.beginPath(), e.rect(d.startX, d.startY,
|
|
2466
|
-
const
|
|
2467
|
-
e.transform(
|
|
2468
|
-
const P = ((
|
|
2465
|
+
}), v = d.endX - d.startX, p = d.endY - d.startY;
|
|
2466
|
+
e.save(), e.beginPath(), e.rect(d.startX, d.startY, v, p), e.clip();
|
|
2467
|
+
const _ = b.getMatrix();
|
|
2468
|
+
e.transform(_[0], _[1], _[2], _[3], _[4], _[5]);
|
|
2469
|
+
const P = ((y = n == null ? void 0 : n.fs) != null ? y : 10) * 1.6, k = String(u) === String(h), U = this._themeService.getColorFromTheme("primary.600");
|
|
2469
2470
|
Yr.drawWith(e, {
|
|
2470
2471
|
checked: k,
|
|
2471
2472
|
width: P,
|
|
2472
2473
|
height: P,
|
|
2473
|
-
fill: (
|
|
2474
|
+
fill: (A = (T = n == null ? void 0 : n.cl) == null ? void 0 : T.rgb) != null ? A : U
|
|
2474
2475
|
}), e.restore();
|
|
2475
2476
|
}
|
|
2476
2477
|
isHit(e, t) {
|
|
@@ -2487,7 +2488,7 @@ let rn = class {
|
|
|
2487
2488
|
const u = this._dataValidationModel.getValidator(d.type);
|
|
2488
2489
|
if (!u || !((h = u.skipDefaultFontRender) != null && h.call(u, d, s, { unitId: r, subUnitId: o, row: a, column: l })))
|
|
2489
2490
|
return;
|
|
2490
|
-
const { formula1:
|
|
2491
|
+
const { formula1: g, formula2: c } = await this._parseFormula(d, r, o), m = {
|
|
2491
2492
|
range: {
|
|
2492
2493
|
startColumn: n.actualColumn,
|
|
2493
2494
|
endColumn: n.actualColumn,
|
|
@@ -2495,7 +2496,7 @@ let rn = class {
|
|
|
2495
2496
|
endRow: n.actualRow
|
|
2496
2497
|
},
|
|
2497
2498
|
value: {
|
|
2498
|
-
v: String(s) === ao(String(
|
|
2499
|
+
v: String(s) === ao(String(g)) ? c : g,
|
|
2499
2500
|
p: null
|
|
2500
2501
|
}
|
|
2501
2502
|
};
|
|
@@ -2506,21 +2507,21 @@ let rn = class {
|
|
|
2506
2507
|
}
|
|
2507
2508
|
onPointerEnter(e, t) {
|
|
2508
2509
|
var n, r;
|
|
2509
|
-
(r = (n = Xe(
|
|
2510
|
+
(r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ze.POINTER);
|
|
2510
2511
|
}
|
|
2511
2512
|
onPointerLeave(e, t) {
|
|
2512
2513
|
var n, r;
|
|
2513
|
-
(r = (n = Xe(
|
|
2514
|
+
(r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ze.DEFAULT);
|
|
2514
2515
|
}
|
|
2515
2516
|
};
|
|
2516
|
-
|
|
2517
|
-
We(0,
|
|
2517
|
+
on = bi([
|
|
2518
|
+
We(0, te),
|
|
2518
2519
|
We(1, le),
|
|
2519
|
-
We(2,
|
|
2520
|
-
We(3,
|
|
2521
|
-
We(4,
|
|
2522
|
-
We(5,
|
|
2523
|
-
],
|
|
2520
|
+
We(2, D(ro)),
|
|
2521
|
+
We(3, D(Yn)),
|
|
2522
|
+
We(4, D(Ue)),
|
|
2523
|
+
We(5, D(oe))
|
|
2524
|
+
], on);
|
|
2524
2525
|
var Ei = Object.getOwnPropertyDescriptor, Di = (e, t, n, r) => {
|
|
2525
2526
|
for (var o = r > 1 ? void 0 : r ? Ei(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
2526
2527
|
(a = e[i]) && (o = a(o) || o);
|
|
@@ -2531,25 +2532,25 @@ let fe = class {
|
|
|
2531
2532
|
V(this, "canvasRender", null);
|
|
2532
2533
|
V(this, "dropdownType");
|
|
2533
2534
|
V(this, "optionsInput");
|
|
2534
|
-
V(this, "formulaInput",
|
|
2535
|
+
V(this, "formulaInput", pn);
|
|
2535
2536
|
this.injector = e;
|
|
2536
2537
|
}
|
|
2537
2538
|
};
|
|
2538
2539
|
fe = Di([
|
|
2539
|
-
Vi(0,
|
|
2540
|
+
Vi(0, D(ye))
|
|
2540
2541
|
], fe);
|
|
2541
2542
|
class Ti extends fe {
|
|
2542
2543
|
constructor() {
|
|
2543
2544
|
super(...arguments);
|
|
2544
|
-
V(this, "id",
|
|
2545
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
2545
|
+
V(this, "id", Y.CHECKBOX);
|
|
2546
|
+
V(this, "canvasRender", this.injector.createInstance(on));
|
|
2546
2547
|
V(this, "formulaInput", ar);
|
|
2547
2548
|
}
|
|
2548
2549
|
}
|
|
2549
2550
|
class Oi extends fe {
|
|
2550
2551
|
constructor() {
|
|
2551
2552
|
super(...arguments);
|
|
2552
|
-
V(this, "id",
|
|
2553
|
+
V(this, "id", Y.CUSTOM);
|
|
2553
2554
|
V(this, "formulaInput", ir);
|
|
2554
2555
|
}
|
|
2555
2556
|
}
|
|
@@ -2557,20 +2558,20 @@ const Ai = "data-validation.formula-input";
|
|
|
2557
2558
|
class Pi extends fe {
|
|
2558
2559
|
constructor() {
|
|
2559
2560
|
super(...arguments);
|
|
2560
|
-
V(this, "id",
|
|
2561
|
+
V(this, "id", Y.DATE);
|
|
2561
2562
|
V(this, "formulaInput", Ai);
|
|
2562
|
-
V(this, "optionsInput",
|
|
2563
|
+
V(this, "optionsInput", Vt.componentKey);
|
|
2563
2564
|
V(this, "dropdownType", pe.DATE);
|
|
2564
2565
|
}
|
|
2565
2566
|
}
|
|
2566
2567
|
class Li extends fe {
|
|
2567
2568
|
constructor() {
|
|
2568
2569
|
super(...arguments);
|
|
2569
|
-
V(this, "id",
|
|
2570
|
-
V(this, "formulaInput",
|
|
2570
|
+
V(this, "id", Y.DECIMAL);
|
|
2571
|
+
V(this, "formulaInput", At);
|
|
2571
2572
|
}
|
|
2572
2573
|
}
|
|
2573
|
-
const br = 4, ki = 0,
|
|
2574
|
+
const br = 4, ki = 0, Ht = 4, Er = 4, an = 6, Tt = 6, Ee = 14;
|
|
2574
2575
|
function Ni(e, t) {
|
|
2575
2576
|
const n = Xr.getTextSize(e, t), r = n.width + br * 2, { ba: o, bd: i } = n, a = o + i;
|
|
2576
2577
|
return {
|
|
@@ -2579,37 +2580,37 @@ function Ni(e, t) {
|
|
|
2579
2580
|
ba: o
|
|
2580
2581
|
};
|
|
2581
2582
|
}
|
|
2582
|
-
function
|
|
2583
|
-
const o = Ee +
|
|
2583
|
+
function jt(e, t, n, r) {
|
|
2584
|
+
const o = Ee + an * 2, i = n - o, a = r - Tt * 2, l = e.map((c) => ({
|
|
2584
2585
|
layout: Ni(c, t),
|
|
2585
2586
|
text: c
|
|
2586
2587
|
}));
|
|
2587
2588
|
let s;
|
|
2588
2589
|
const d = [];
|
|
2589
2590
|
l.forEach((c) => {
|
|
2590
|
-
const { layout: m } = c, { width: h, height:
|
|
2591
|
-
!s || s.width + h +
|
|
2591
|
+
const { layout: m } = c, { width: h, height: E } = m;
|
|
2592
|
+
!s || s.width + h + Ht > i ? (s = {
|
|
2592
2593
|
width: h,
|
|
2593
|
-
height:
|
|
2594
|
+
height: E,
|
|
2594
2595
|
items: [{
|
|
2595
2596
|
...c,
|
|
2596
2597
|
left: 0
|
|
2597
2598
|
}]
|
|
2598
2599
|
}, d.push(s)) : (s.items.push({
|
|
2599
2600
|
...c,
|
|
2600
|
-
left: s.width +
|
|
2601
|
-
}), s.width = s.width + h +
|
|
2601
|
+
left: s.width + Ht
|
|
2602
|
+
}), s.width = s.width + h + Ht);
|
|
2602
2603
|
});
|
|
2603
|
-
let u = 0,
|
|
2604
|
+
let u = 0, g = 0;
|
|
2604
2605
|
return d.forEach((c, m) => {
|
|
2605
|
-
|
|
2606
|
+
g = Math.max(g, c.width), m === d.length - 1 ? u += c.height : u += c.height + Er;
|
|
2606
2607
|
}), {
|
|
2607
2608
|
lines: d,
|
|
2608
2609
|
totalHeight: u,
|
|
2609
2610
|
contentWidth: i,
|
|
2610
2611
|
contentHeight: a,
|
|
2611
|
-
cellAutoHeight: u +
|
|
2612
|
-
calcAutoWidth:
|
|
2612
|
+
cellAutoHeight: u + Tt * 2,
|
|
2613
|
+
calcAutoWidth: g + o
|
|
2613
2614
|
};
|
|
2614
2615
|
}
|
|
2615
2616
|
const Ui = 8;
|
|
@@ -2630,7 +2631,7 @@ var $i = Object.getOwnPropertyDescriptor, xi = (e, t, n, r) => {
|
|
|
2630
2631
|
return o;
|
|
2631
2632
|
}, _t = (e, t) => (n, r) => t(n, r, e);
|
|
2632
2633
|
const Bi = 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");
|
|
2633
|
-
let
|
|
2634
|
+
let sn = class {
|
|
2634
2635
|
constructor(e, t, n, r) {
|
|
2635
2636
|
V(this, "zIndex");
|
|
2636
2637
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
@@ -2659,21 +2660,21 @@ let an = class {
|
|
|
2659
2660
|
// eslint-disable-next-line max-lines-per-function
|
|
2660
2661
|
drawWith(e, t, n, r) {
|
|
2661
2662
|
var ie, _e;
|
|
2662
|
-
const { primaryWithCoord: o, row: i, col: a, style: l, data: s, subUnitId: d } = t, u = o.isMergedMainCell ? o.mergeInfo : o,
|
|
2663
|
-
if (!
|
|
2663
|
+
const { primaryWithCoord: o, row: i, col: a, style: l, data: s, subUnitId: d } = t, u = o.isMergedMainCell ? o.mergeInfo : o, g = s == null ? void 0 : s.fontRenderExtension, { leftOffset: c = 0, rightOffset: m = 0, topOffset: h = 0, downOffset: E = 0 } = g || {}, R = this._ensureMap(d), w = this._generateKey(i, a), S = o.isMergedMainCell ? o.mergeInfo.startRow : i, I = o.isMergedMainCell ? o.mergeInfo.startColumn : a, b = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, S, I);
|
|
2664
|
+
if (!b)
|
|
2664
2665
|
return;
|
|
2665
|
-
const
|
|
2666
|
-
if (!
|
|
2666
|
+
const v = this._dataValidationModel.getValidator(b.type);
|
|
2667
|
+
if (!v)
|
|
2667
2668
|
return;
|
|
2668
|
-
const
|
|
2669
|
+
const p = {
|
|
2669
2670
|
startX: u.startX + c,
|
|
2670
2671
|
endX: u.endX - m,
|
|
2671
2672
|
startY: u.startY + h,
|
|
2672
|
-
endY: u.endY -
|
|
2673
|
-
},
|
|
2674
|
-
this._drawDownIcon(e,
|
|
2673
|
+
endY: u.endY - E
|
|
2674
|
+
}, _ = p.endX - p.startX, P = p.endY - p.startY, { cl: k } = l || {}, U = (ie = typeof k == "object" ? k == null ? void 0 : k.rgb : k) != null ? ie : "#000", L = Ve(l != null ? l : void 0), { vt: y, ht: T } = l || {}, A = y != null ? y : se.MIDDLE, x = (_e = re(s)) != null ? _e : "", H = v.parseCellValue(x), q = v.getListWithColorMap(b), B = jt(H, L, _, P);
|
|
2675
|
+
this._drawDownIcon(e, p, _, P, A), e.save(), e.translateWithPrecision(p.startX, p.startY), e.beginPath(), e.rect(0, 0, _ - Ee, P), e.clip(), e.translateWithPrecision(an, Tt);
|
|
2675
2676
|
let ne = 0;
|
|
2676
|
-
switch (
|
|
2677
|
+
switch (A) {
|
|
2677
2678
|
case se.MIDDLE:
|
|
2678
2679
|
ne = (B.contentHeight - B.totalHeight) / 2;
|
|
2679
2680
|
break;
|
|
@@ -2681,64 +2682,64 @@ let an = class {
|
|
|
2681
2682
|
ne = B.contentHeight - B.totalHeight;
|
|
2682
2683
|
break;
|
|
2683
2684
|
}
|
|
2684
|
-
e.translateWithPrecision(0, ne), B.lines.forEach((Ce,
|
|
2685
|
+
e.translateWithPrecision(0, ne), B.lines.forEach((Ce, J) => {
|
|
2685
2686
|
e.save();
|
|
2686
|
-
const { width:
|
|
2687
|
+
const { width: K, height: ge, items: z } = Ce;
|
|
2687
2688
|
let M = 0;
|
|
2688
|
-
switch (
|
|
2689
|
-
case
|
|
2690
|
-
M = B.contentWidth -
|
|
2689
|
+
switch (T) {
|
|
2690
|
+
case Ie.RIGHT:
|
|
2691
|
+
M = B.contentWidth - K;
|
|
2691
2692
|
break;
|
|
2692
|
-
case
|
|
2693
|
-
M = (B.contentWidth -
|
|
2693
|
+
case Ie.CENTER:
|
|
2694
|
+
M = (B.contentWidth - K) / 2;
|
|
2694
2695
|
break;
|
|
2695
2696
|
}
|
|
2696
|
-
e.translate(M,
|
|
2697
|
-
e.save(), e.translateWithPrecision(
|
|
2698
|
-
...
|
|
2699
|
-
info:
|
|
2700
|
-
color:
|
|
2701
|
-
fill:
|
|
2697
|
+
e.translate(M, J * (ge + Er)), z.forEach((N) => {
|
|
2698
|
+
e.save(), e.translateWithPrecision(N.left, 0), Fi.drawWith(e, {
|
|
2699
|
+
...L,
|
|
2700
|
+
info: N,
|
|
2701
|
+
color: U,
|
|
2702
|
+
fill: q[N.text]
|
|
2702
2703
|
}), e.restore();
|
|
2703
2704
|
}), e.restore();
|
|
2704
|
-
}), e.restore(),
|
|
2705
|
-
left:
|
|
2706
|
-
top:
|
|
2707
|
-
width: B.contentWidth +
|
|
2708
|
-
height: B.contentHeight +
|
|
2705
|
+
}), e.restore(), R.set(w, {
|
|
2706
|
+
left: p.startX,
|
|
2707
|
+
top: p.startY,
|
|
2708
|
+
width: B.contentWidth + an + Ee,
|
|
2709
|
+
height: B.contentHeight + Tt * 2
|
|
2709
2710
|
});
|
|
2710
2711
|
}
|
|
2711
2712
|
calcCellAutoHeight(e) {
|
|
2712
|
-
var
|
|
2713
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
|
2714
|
-
startX:
|
|
2715
|
-
endX:
|
|
2716
|
-
startY:
|
|
2717
|
-
endY:
|
|
2713
|
+
var v;
|
|
2714
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, g = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
|
2715
|
+
startX: g.startX + l,
|
|
2716
|
+
endX: g.endX - s,
|
|
2717
|
+
startY: g.startY + d,
|
|
2718
|
+
endY: g.endY - u
|
|
2718
2719
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2719
2720
|
if (!m)
|
|
2720
2721
|
return;
|
|
2721
2722
|
const h = this._dataValidationModel.getValidator(m.type);
|
|
2722
2723
|
if (!h)
|
|
2723
2724
|
return;
|
|
2724
|
-
const
|
|
2725
|
-
return
|
|
2725
|
+
const E = c.endX - c.startX, R = c.endY - c.startY, w = (v = re(r)) != null ? v : "", S = h.parseCellValue(w), I = Ve(n != null ? n : void 0);
|
|
2726
|
+
return jt(S, I, E, R).cellAutoHeight;
|
|
2726
2727
|
}
|
|
2727
2728
|
calcCellAutoWidth(e) {
|
|
2728
|
-
var
|
|
2729
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {},
|
|
2730
|
-
startX:
|
|
2731
|
-
endX:
|
|
2732
|
-
startY:
|
|
2733
|
-
endY:
|
|
2729
|
+
var v;
|
|
2730
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = r == null ? void 0 : r.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: d = 0, downOffset: u = 0 } = a || {}, g = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
|
2731
|
+
startX: g.startX + l,
|
|
2732
|
+
endX: g.endX - s,
|
|
2733
|
+
startY: g.startY + d,
|
|
2734
|
+
endY: g.endY - u
|
|
2734
2735
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2735
2736
|
if (!m)
|
|
2736
2737
|
return;
|
|
2737
2738
|
const h = this._dataValidationModel.getValidator(m.type);
|
|
2738
2739
|
if (!h)
|
|
2739
2740
|
return;
|
|
2740
|
-
const
|
|
2741
|
-
return
|
|
2741
|
+
const E = c.endX - c.startX, R = c.endY - c.startY, w = (v = re(r)) != null ? v : "", S = h.parseCellValue(w), I = Ve(n != null ? n : void 0);
|
|
2742
|
+
return jt(S, I, E, R).calcAutoWidth;
|
|
2742
2743
|
}
|
|
2743
2744
|
isHit(e, t) {
|
|
2744
2745
|
const { primaryWithCoord: n } = t, r = n.isMergedMainCell ? n.mergeInfo : n, { endX: o } = r, { x: i } = e;
|
|
@@ -2753,28 +2754,28 @@ let an = class {
|
|
|
2753
2754
|
row: o,
|
|
2754
2755
|
column: i
|
|
2755
2756
|
};
|
|
2756
|
-
this._commandService.executeCommand(
|
|
2757
|
+
this._commandService.executeCommand(Lt.id, a);
|
|
2757
2758
|
}
|
|
2758
2759
|
onPointerEnter(e, t) {
|
|
2759
2760
|
var n, r;
|
|
2760
|
-
return (r = (n = Xe(
|
|
2761
|
+
return (r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null ? void 0 : r.setCursor(Ze.POINTER);
|
|
2761
2762
|
}
|
|
2762
2763
|
onPointerLeave(e, t) {
|
|
2763
2764
|
var n, r;
|
|
2764
|
-
return (r = (n = Xe(
|
|
2765
|
+
return (r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null ? void 0 : r.setCursor(Ze.DEFAULT);
|
|
2765
2766
|
}
|
|
2766
2767
|
};
|
|
2767
|
-
|
|
2768
|
-
_t(0,
|
|
2768
|
+
sn = xi([
|
|
2769
|
+
_t(0, te),
|
|
2769
2770
|
_t(1, le),
|
|
2770
|
-
_t(2,
|
|
2771
|
-
_t(3,
|
|
2772
|
-
],
|
|
2771
|
+
_t(2, D(Ue)),
|
|
2772
|
+
_t(3, D(oe))
|
|
2773
|
+
], sn);
|
|
2773
2774
|
class Wi extends fe {
|
|
2774
2775
|
constructor() {
|
|
2775
2776
|
super(...arguments);
|
|
2776
|
-
V(this, "id",
|
|
2777
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
2777
|
+
V(this, "id", Y.LIST_MULTIPLE);
|
|
2778
|
+
V(this, "canvasRender", this.injector.createInstance(sn));
|
|
2778
2779
|
V(this, "dropdownType", pe.MULTIPLE_LIST);
|
|
2779
2780
|
}
|
|
2780
2781
|
}
|
|
@@ -2783,7 +2784,7 @@ var Hi = Object.getOwnPropertyDescriptor, ji = (e, t, n, r) => {
|
|
|
2783
2784
|
(a = e[i]) && (o = a(o) || o);
|
|
2784
2785
|
return o;
|
|
2785
2786
|
}, it = (e, t) => (n, r) => t(n, r, e);
|
|
2786
|
-
const He = 4, Ct = 4, he = 14,
|
|
2787
|
+
const He = 4, Ct = 4, he = 14, Yt = 1, Se = 6, je = 3, Xt = 8, Yi = "#565656", $n = 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");
|
|
2787
2788
|
function xn(e, t, n, r, o, i, a = !0) {
|
|
2788
2789
|
let l = 0;
|
|
2789
2790
|
const s = a ? je : 0;
|
|
@@ -2801,10 +2802,10 @@ function xn(e, t, n, r, o, i, a = !0) {
|
|
|
2801
2802
|
l = Math.max(je, l);
|
|
2802
2803
|
let d = 0;
|
|
2803
2804
|
switch (i) {
|
|
2804
|
-
case
|
|
2805
|
+
case Ie.CENTER:
|
|
2805
2806
|
d = (e - n) / 2;
|
|
2806
2807
|
break;
|
|
2807
|
-
case
|
|
2808
|
+
case Ie.RIGHT:
|
|
2808
2809
|
d = e - n;
|
|
2809
2810
|
break;
|
|
2810
2811
|
}
|
|
@@ -2813,7 +2814,7 @@ function xn(e, t, n, r, o, i, a = !0) {
|
|
|
2813
2814
|
paddingTop: l
|
|
2814
2815
|
};
|
|
2815
2816
|
}
|
|
2816
|
-
let
|
|
2817
|
+
let ln = class {
|
|
2817
2818
|
constructor(e, t, n, r, o) {
|
|
2818
2819
|
V(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
2819
2820
|
V(this, "zIndex");
|
|
@@ -2827,7 +2828,7 @@ let sn = class {
|
|
|
2827
2828
|
return `${e}.${t}`;
|
|
2828
2829
|
}
|
|
2829
2830
|
_drawDownIcon(e, t, n, r, o, i, a) {
|
|
2830
|
-
const { t: l =
|
|
2831
|
+
const { t: l = ee.pd.t, b: s = ee.pd.b } = a, d = n - he;
|
|
2831
2832
|
let u;
|
|
2832
2833
|
switch (i) {
|
|
2833
2834
|
case se.MIDDLE:
|
|
@@ -2844,157 +2845,157 @@ let sn = class {
|
|
|
2844
2845
|
}
|
|
2845
2846
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2846
2847
|
drawWith(e, t, n) {
|
|
2847
|
-
var
|
|
2848
|
-
const { primaryWithCoord: r, row: o, col: i, style: a, data: l, subUnitId: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = r.isMergedMainCell ? r.mergeInfo.startRow : o,
|
|
2848
|
+
var q, B, ne, ie, _e, Ce;
|
|
2849
|
+
const { primaryWithCoord: r, row: o, col: i, style: a, data: l, subUnitId: s } = t, d = r.isMergedMainCell ? r.mergeInfo : r, u = r.isMergedMainCell ? r.mergeInfo.startRow : o, g = r.isMergedMainCell ? r.mergeInfo.startColumn : i, c = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, u, g);
|
|
2849
2850
|
if (!c)
|
|
2850
2851
|
return;
|
|
2851
2852
|
const m = this._dataValidationModel.getValidator(c.type);
|
|
2852
2853
|
if (!m)
|
|
2853
2854
|
return;
|
|
2854
|
-
const h = l == null ? void 0 : l.fontRenderExtension, { leftOffset:
|
|
2855
|
-
if (!c || !m || !m || m.id.indexOf(
|
|
2855
|
+
const h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: E = 0, rightOffset: R = 0, topOffset: w = 0, downOffset: S = 0 } = h || {};
|
|
2856
|
+
if (!c || !m || !m || m.id.indexOf(Y.LIST) !== 0 || !m.skipDefaultFontRender(c))
|
|
2856
2857
|
return;
|
|
2857
|
-
const
|
|
2858
|
-
startX: d.startX +
|
|
2859
|
-
endX: d.endX -
|
|
2860
|
-
startY: d.startY +
|
|
2858
|
+
const I = {
|
|
2859
|
+
startX: d.startX + E,
|
|
2860
|
+
endX: d.endX - R,
|
|
2861
|
+
startY: d.startY + w,
|
|
2861
2862
|
endY: d.endY - S
|
|
2862
|
-
},
|
|
2863
|
-
let { tb:
|
|
2864
|
-
|
|
2865
|
-
const
|
|
2863
|
+
}, b = I.endX - I.startX, v = I.endY - I.startY, p = this._ensureMap(s), _ = this._generateKey(o, i), P = m.getListWithColorMap(c), k = re(l), U = `${k != null ? k : ""}`, L = P[U];
|
|
2864
|
+
let { tb: y, vt: T, ht: A, pd: x } = a || {};
|
|
2865
|
+
y = y != null ? y : ve.WRAP, T = T != null ? T : se.BOTTOM, A = A != null ? A : ee.ht, x = x != null ? x : ee.pd;
|
|
2866
|
+
const H = Ve(a).fontCache;
|
|
2866
2867
|
if (c.renderMode === ae.ARROW) {
|
|
2867
|
-
const { l:
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2868
|
+
const { l: J = ee.pd.l, t: K = ee.pd.t, r: ge = ee.pd.r, b: z = ee.pd.b } = x, M = b - J - ge - he - 4, N = new rt(
|
|
2869
|
+
U,
|
|
2870
|
+
H,
|
|
2871
|
+
y === ve.WRAP,
|
|
2871
2872
|
M,
|
|
2872
2873
|
1 / 0
|
|
2873
2874
|
);
|
|
2874
|
-
|
|
2875
|
-
const f =
|
|
2876
|
-
this._drawDownIcon(e,
|
|
2877
|
-
text:
|
|
2878
|
-
fontStyle:
|
|
2875
|
+
N.calculate();
|
|
2876
|
+
const f = N.getTotalWidth(), O = N.getTotalHeight(), { paddingTop: $, paddingLeft: ce } = xn(M, v - K - z, f, O, T, A, !0);
|
|
2877
|
+
this._drawDownIcon(e, I, b, v, O, T, x), e.save(), e.translateWithPrecision(I.startX + J, I.startY + K), e.beginPath(), e.rect(0, 0, b - J - ge, v - K - z), e.clip(), e.translateWithPrecision(0, $), e.save(), e.translateWithPrecision(ce, 0), e.beginPath(), e.rect(0, 0, M, O), e.clip(), bn.drawWith(e, {
|
|
2878
|
+
text: U,
|
|
2879
|
+
fontStyle: H,
|
|
2879
2880
|
width: M,
|
|
2880
|
-
height:
|
|
2881
|
-
color: (
|
|
2881
|
+
height: O,
|
|
2882
|
+
color: (q = a == null ? void 0 : a.cl) == null ? void 0 : q.rgb,
|
|
2882
2883
|
strokeLine: !!((B = a == null ? void 0 : a.st) != null && B.s),
|
|
2883
2884
|
underline: !!((ne = a == null ? void 0 : a.ul) != null && ne.s),
|
|
2884
|
-
warp:
|
|
2885
|
-
hAlign:
|
|
2886
|
-
},
|
|
2887
|
-
left:
|
|
2888
|
-
top:
|
|
2885
|
+
warp: y === ve.WRAP,
|
|
2886
|
+
hAlign: Ie.LEFT
|
|
2887
|
+
}, N), e.restore(), e.restore(), p.set(_, {
|
|
2888
|
+
left: I.endX - he + n.rowHeaderWidth,
|
|
2889
|
+
top: I.startY + K + n.columnHeaderHeight,
|
|
2889
2890
|
width: he,
|
|
2890
|
-
height:
|
|
2891
|
+
height: v - K - z
|
|
2891
2892
|
});
|
|
2892
2893
|
} else {
|
|
2893
|
-
e.save(), e.translateWithPrecision(
|
|
2894
|
-
const
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2894
|
+
e.save(), e.translateWithPrecision(I.startX, I.startY), e.beginPath(), e.rect(0, 0, b, v), e.clip();
|
|
2895
|
+
const J = b - Se * 2 - He - he - 4, K = new rt(
|
|
2896
|
+
U,
|
|
2897
|
+
H,
|
|
2898
|
+
y === ve.WRAP,
|
|
2899
|
+
J,
|
|
2899
2900
|
1 / 0
|
|
2900
2901
|
);
|
|
2901
|
-
|
|
2902
|
-
const ge =
|
|
2902
|
+
K.calculate();
|
|
2903
|
+
const ge = K.getTotalWidth(), z = K.getTotalHeight(), M = z + Yt * 2, N = Math.max(b - Se * 2, 1), { paddingTop: f } = xn(N, v, ge, M, T, A);
|
|
2903
2904
|
e.translateWithPrecision(Se, f), Kn.drawWith(e, {
|
|
2904
|
-
width:
|
|
2905
|
+
width: N,
|
|
2905
2906
|
height: M,
|
|
2906
|
-
fill:
|
|
2907
|
-
radius:
|
|
2908
|
-
}), e.save(), e.translateWithPrecision(He,
|
|
2909
|
-
text:
|
|
2910
|
-
fontStyle:
|
|
2911
|
-
width:
|
|
2907
|
+
fill: L || Te,
|
|
2908
|
+
radius: Xt
|
|
2909
|
+
}), e.save(), e.translateWithPrecision(He, Yt), e.beginPath(), e.rect(0, 0, J, z), e.clip(), bn.drawWith(e, {
|
|
2910
|
+
text: U,
|
|
2911
|
+
fontStyle: H,
|
|
2912
|
+
width: J,
|
|
2912
2913
|
height: z,
|
|
2913
2914
|
color: (ie = a == null ? void 0 : a.cl) == null ? void 0 : ie.rgb,
|
|
2914
2915
|
strokeLine: !!((_e = a == null ? void 0 : a.st) != null && _e.s),
|
|
2915
2916
|
underline: !!((Ce = a == null ? void 0 : a.ul) != null && Ce.s),
|
|
2916
|
-
warp:
|
|
2917
|
-
hAlign:
|
|
2918
|
-
},
|
|
2919
|
-
left:
|
|
2920
|
-
top:
|
|
2921
|
-
width:
|
|
2917
|
+
warp: y === ve.WRAP,
|
|
2918
|
+
hAlign: Ie.LEFT
|
|
2919
|
+
}, K), e.restore(), e.translateWithPrecision(J + He + 4, (z - Ct) / 2), e.fillStyle = Yi, e.fill($n), e.restore(), p.set(_, {
|
|
2920
|
+
left: I.startX + Se + n.rowHeaderWidth,
|
|
2921
|
+
top: I.startY + f + n.columnHeaderHeight,
|
|
2922
|
+
width: N,
|
|
2922
2923
|
height: M
|
|
2923
2924
|
});
|
|
2924
2925
|
}
|
|
2925
2926
|
}
|
|
2926
2927
|
calcCellAutoHeight(e) {
|
|
2927
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset:
|
|
2928
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: g = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2928
2929
|
if (!c || c.renderMode === ae.TEXT)
|
|
2929
2930
|
return;
|
|
2930
2931
|
const m = {
|
|
2931
2932
|
startX: a.startX + s,
|
|
2932
2933
|
endX: a.endX - d,
|
|
2933
2934
|
startY: a.startY + u,
|
|
2934
|
-
endY: a.endY -
|
|
2935
|
-
}, h = m.endX - m.startX,
|
|
2936
|
-
let { tb:
|
|
2937
|
-
const { t:
|
|
2938
|
-
if (
|
|
2939
|
-
const { l:
|
|
2940
|
-
y,
|
|
2941
|
-
Ve(n).fontCache,
|
|
2942
|
-
I === ve.WRAP,
|
|
2935
|
+
endY: a.endY - g
|
|
2936
|
+
}, h = m.endX - m.startX, E = re(r), R = `${E != null ? E : ""}`;
|
|
2937
|
+
let { tb: w, pd: S } = n || {};
|
|
2938
|
+
const { t: I = ee.pd.t, b = ee.pd.b } = S != null ? S : {};
|
|
2939
|
+
if (w = w != null ? w : ve.WRAP, c.renderMode === ae.ARROW) {
|
|
2940
|
+
const { l: v = ee.pd.l, r: p = ee.pd.r } = S != null ? S : {}, _ = h - v - p - he - 4, P = new rt(
|
|
2943
2941
|
R,
|
|
2942
|
+
Ve(n).fontCache,
|
|
2943
|
+
w === ve.WRAP,
|
|
2944
|
+
_,
|
|
2944
2945
|
1 / 0
|
|
2945
2946
|
);
|
|
2946
|
-
return P.calculate(), P.getTotalHeight() +
|
|
2947
|
+
return P.calculate(), P.getTotalHeight() + I + b + je * 2;
|
|
2947
2948
|
} else {
|
|
2948
|
-
const
|
|
2949
|
-
|
|
2949
|
+
const v = Math.max(h - Se * 2 - He - he - 4, 10), p = new rt(
|
|
2950
|
+
R,
|
|
2950
2951
|
Ve(n).fontCache,
|
|
2951
|
-
|
|
2952
|
-
|
|
2952
|
+
w === ve.WRAP,
|
|
2953
|
+
v,
|
|
2953
2954
|
1 / 0
|
|
2954
2955
|
);
|
|
2955
|
-
return
|
|
2956
|
+
return p.calculate(), p.getTotalHeight() + je * 2 + Yt * 2;
|
|
2956
2957
|
}
|
|
2957
2958
|
}
|
|
2958
2959
|
calcCellAutoWidth(e) {
|
|
2959
|
-
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset:
|
|
2960
|
+
const { primaryWithCoord: t, style: n, data: r, row: o, col: i } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = r == null ? void 0 : r.fontRenderExtension, { leftOffset: s = 0, rightOffset: d = 0, topOffset: u = 0, downOffset: g = 0 } = l || {}, c = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, o, i);
|
|
2960
2961
|
if (!c || c.renderMode === ae.TEXT)
|
|
2961
2962
|
return;
|
|
2962
2963
|
const m = {
|
|
2963
2964
|
startX: a.startX + s,
|
|
2964
2965
|
endX: a.endX - d,
|
|
2965
2966
|
startY: a.startY + u,
|
|
2966
|
-
endY: a.endY -
|
|
2967
|
-
}, h = m.endX - m.startX,
|
|
2968
|
-
let { tb:
|
|
2969
|
-
const { l:
|
|
2970
|
-
|
|
2971
|
-
let
|
|
2967
|
+
endY: a.endY - g
|
|
2968
|
+
}, h = m.endX - m.startX, E = re(r), R = `${E != null ? E : ""}`;
|
|
2969
|
+
let { tb: w, pd: S } = n || {};
|
|
2970
|
+
const { l: I = ee.pd.l, r: b = ee.pd.r } = S != null ? S : {};
|
|
2971
|
+
w = w != null ? w : ve.WRAP;
|
|
2972
|
+
let v = Se * 2 + he;
|
|
2972
2973
|
switch (c.renderMode) {
|
|
2973
2974
|
case ae.ARROW:
|
|
2974
|
-
|
|
2975
|
+
v = he + 4 + b + I;
|
|
2975
2976
|
break;
|
|
2976
2977
|
case ae.CUSTOM:
|
|
2977
|
-
|
|
2978
|
+
v = he + Se * 2 + He * 2 + b + I + Xt / 2 + 1;
|
|
2978
2979
|
break;
|
|
2979
2980
|
// default is CUSTOM
|
|
2980
2981
|
default:
|
|
2981
|
-
|
|
2982
|
+
v = he + Se * 2 + He * 2 + b + I + Xt / 2 + 1;
|
|
2982
2983
|
}
|
|
2983
|
-
const
|
|
2984
|
-
|
|
2984
|
+
const p = h - v, _ = new rt(
|
|
2985
|
+
R,
|
|
2985
2986
|
Ve(n).fontCache,
|
|
2986
|
-
|
|
2987
|
-
|
|
2987
|
+
w === ve.WRAP,
|
|
2988
|
+
p,
|
|
2988
2989
|
1 / 0
|
|
2989
2990
|
);
|
|
2990
|
-
return
|
|
2991
|
+
return _.calculate(), _.getTotalWidth() + v;
|
|
2991
2992
|
}
|
|
2992
2993
|
isHit(e, t) {
|
|
2993
2994
|
const { subUnitId: n, row: r, col: o } = t, a = this._ensureMap(n).get(this._generateKey(r, o)), l = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, r, o);
|
|
2994
2995
|
if (!l || !a || l.renderMode === ae.TEXT)
|
|
2995
2996
|
return !1;
|
|
2996
|
-
const { top: s, left: d, width: u, height:
|
|
2997
|
-
return c >= d && c <= d + u && m >= s && m <= s +
|
|
2997
|
+
const { top: s, left: d, width: u, height: g } = a, { x: c, y: m } = e;
|
|
2998
|
+
return c >= d && c <= d + u && m >= s && m <= s + g;
|
|
2998
2999
|
}
|
|
2999
3000
|
onPointerDown(e, t) {
|
|
3000
3001
|
if (t.button === 2)
|
|
@@ -3005,64 +3006,64 @@ let sn = class {
|
|
|
3005
3006
|
row: o,
|
|
3006
3007
|
column: i
|
|
3007
3008
|
};
|
|
3008
|
-
this._commandService.executeCommand(
|
|
3009
|
+
this._commandService.executeCommand(Lt.id, a);
|
|
3009
3010
|
}
|
|
3010
3011
|
onPointerEnter(e, t) {
|
|
3011
3012
|
var n, r;
|
|
3012
|
-
(r = (n = Xe(
|
|
3013
|
+
(r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ze.POINTER);
|
|
3013
3014
|
}
|
|
3014
3015
|
onPointerLeave(e, t) {
|
|
3015
3016
|
var n, r;
|
|
3016
|
-
(r = (n = Xe(
|
|
3017
|
+
(r = (n = Xe(Z.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : n.mainComponent) == null || r.setCursor(Ze.DEFAULT);
|
|
3017
3018
|
}
|
|
3018
3019
|
};
|
|
3019
|
-
|
|
3020
|
+
ln = ji([
|
|
3020
3021
|
it(0, le),
|
|
3021
|
-
it(1,
|
|
3022
|
-
it(2,
|
|
3023
|
-
it(3,
|
|
3024
|
-
it(4,
|
|
3025
|
-
],
|
|
3022
|
+
it(1, D(de)),
|
|
3023
|
+
it(2, te),
|
|
3024
|
+
it(3, D(Ue)),
|
|
3025
|
+
it(4, D(oe))
|
|
3026
|
+
], ln);
|
|
3026
3027
|
class Xi extends fe {
|
|
3027
3028
|
constructor() {
|
|
3028
3029
|
super(...arguments);
|
|
3029
|
-
V(this, "id",
|
|
3030
|
-
V(this, "canvasRender", this.injector.createInstance(
|
|
3030
|
+
V(this, "id", Y.LIST);
|
|
3031
|
+
V(this, "canvasRender", this.injector.createInstance(ln));
|
|
3031
3032
|
V(this, "dropdownType", pe.LIST);
|
|
3032
|
-
V(this, "optionsInput",
|
|
3033
|
-
V(this, "formulaInput",
|
|
3033
|
+
V(this, "optionsInput", Dt.componentKey);
|
|
3034
|
+
V(this, "formulaInput", pn);
|
|
3034
3035
|
}
|
|
3035
3036
|
}
|
|
3036
3037
|
class Zi extends fe {
|
|
3037
3038
|
constructor() {
|
|
3038
3039
|
super(...arguments);
|
|
3039
|
-
V(this, "id",
|
|
3040
|
-
V(this, "formulaInput",
|
|
3040
|
+
V(this, "id", Y.TEXT_LENGTH);
|
|
3041
|
+
V(this, "formulaInput", At);
|
|
3041
3042
|
}
|
|
3042
3043
|
}
|
|
3043
3044
|
class Ki extends fe {
|
|
3044
3045
|
constructor() {
|
|
3045
3046
|
super(...arguments);
|
|
3046
|
-
V(this, "id",
|
|
3047
|
-
V(this, "formulaInput",
|
|
3047
|
+
V(this, "id", Y.WHOLE);
|
|
3048
|
+
V(this, "formulaInput", At);
|
|
3048
3049
|
}
|
|
3049
3050
|
}
|
|
3050
3051
|
var Gi = Object.getOwnPropertyDescriptor, zi = (e, t, n, r) => {
|
|
3051
3052
|
for (var o = r > 1 ? void 0 : r ? Gi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3052
3053
|
(a = e[i]) && (o = a(o) || o);
|
|
3053
3054
|
return o;
|
|
3054
|
-
},
|
|
3055
|
-
let et = class extends
|
|
3055
|
+
}, Zt = (e, t) => (n, r) => t(n, r, e);
|
|
3056
|
+
let et = class extends cn {
|
|
3056
3057
|
constructor(e, t, n) {
|
|
3057
3058
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = n, this._initComponents(), this._registerValidatorViews();
|
|
3058
3059
|
}
|
|
3059
3060
|
_initComponents() {
|
|
3060
3061
|
[
|
|
3061
|
-
["DataValidationIcon",
|
|
3062
|
-
[
|
|
3063
|
-
[Et.componentKey, Et],
|
|
3062
|
+
["DataValidationIcon", Ir],
|
|
3063
|
+
[bt, vi],
|
|
3064
3064
|
[Dt.componentKey, Dt],
|
|
3065
|
-
|
|
3065
|
+
[Vt.componentKey, Vt],
|
|
3066
|
+
...Ii
|
|
3066
3067
|
].forEach(([e, t]) => {
|
|
3067
3068
|
this.disposeWithMe(this._componentManger.register(
|
|
3068
3069
|
e,
|
|
@@ -3087,26 +3088,26 @@ let et = class extends dn {
|
|
|
3087
3088
|
}
|
|
3088
3089
|
};
|
|
3089
3090
|
et = zi([
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3091
|
+
Zt(0, D(ye)),
|
|
3092
|
+
Zt(1, D(mn)),
|
|
3093
|
+
Zt(2, D(Me))
|
|
3093
3094
|
], et);
|
|
3094
3095
|
var qi = Object.getOwnPropertyDescriptor, Ji = (e, t, n, r) => {
|
|
3095
3096
|
for (var o = r > 1 ? void 0 : r ? qi(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3096
3097
|
(a = e[i]) && (o = a(o) || o);
|
|
3097
3098
|
return o;
|
|
3098
|
-
},
|
|
3099
|
+
}, Kt = (e, t) => (n, r) => t(n, r, e);
|
|
3099
3100
|
const Qi = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
|
3100
3101
|
var St;
|
|
3101
3102
|
let Bn = (St = class extends Xn {
|
|
3102
|
-
constructor(e =
|
|
3103
|
+
constructor(e = Mt, t, n, r) {
|
|
3103
3104
|
super(), this._config = e, this._injector = t, this._commandService = n, this._configService = r;
|
|
3104
3105
|
const { menu: o, ...i } = Zn(
|
|
3105
3106
|
{},
|
|
3106
|
-
|
|
3107
|
+
Mt,
|
|
3107
3108
|
this._config
|
|
3108
3109
|
);
|
|
3109
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
3110
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(yt, i);
|
|
3110
3111
|
}
|
|
3111
3112
|
onStarting() {
|
|
3112
3113
|
[
|
|
@@ -3121,8 +3122,8 @@ let Bn = (St = class extends Xn {
|
|
|
3121
3122
|
].forEach((e) => {
|
|
3122
3123
|
this._injector.add(e);
|
|
3123
3124
|
}), [
|
|
3125
|
+
kt,
|
|
3124
3126
|
Lt,
|
|
3125
|
-
Pt,
|
|
3126
3127
|
fr,
|
|
3127
3128
|
Cn,
|
|
3128
3129
|
Fe,
|
|
@@ -3133,8 +3134,8 @@ let Bn = (St = class extends Xn {
|
|
|
3133
3134
|
}
|
|
3134
3135
|
onReady() {
|
|
3135
3136
|
this._injector.get(qe), this._injector.get(Je), this._injector.get(Ue).registerRenderModule(
|
|
3136
|
-
|
|
3137
|
-
[
|
|
3137
|
+
Z.UNIVER_SHEET,
|
|
3138
|
+
[Et]
|
|
3138
3139
|
);
|
|
3139
3140
|
}
|
|
3140
3141
|
onRendered() {
|
|
@@ -3143,27 +3144,27 @@ let Bn = (St = class extends Xn {
|
|
|
3143
3144
|
onSteady() {
|
|
3144
3145
|
this._injector.get(ze);
|
|
3145
3146
|
}
|
|
3146
|
-
}, V(St, "pluginName", Qi), V(St, "type",
|
|
3147
|
+
}, V(St, "pluginName", Qi), V(St, "type", Z.UNIVER_SHEET), St);
|
|
3147
3148
|
Bn = Ji([
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3149
|
+
Kt(1, D(ye)),
|
|
3150
|
+
Kt(2, te),
|
|
3151
|
+
Kt(3, dn)
|
|
3151
3152
|
], Bn);
|
|
3152
3153
|
var ea = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, na = (e, t, n) => t in e ? ea(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ra = (e, t, n, r) => {
|
|
3153
3154
|
for (var o = r > 1 ? void 0 : r ? ta(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3154
3155
|
(a = e[i]) && (o = a(o) || o);
|
|
3155
3156
|
return o;
|
|
3156
|
-
},
|
|
3157
|
+
}, Gt = (e, t) => (n, r) => t(n, r, e), Dr = (e, t, n) => na(e, typeof t != "symbol" ? t + "" : t, n);
|
|
3157
3158
|
const oa = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
|
3158
|
-
let
|
|
3159
|
-
constructor(e =
|
|
3159
|
+
let Ot = class extends Xn {
|
|
3160
|
+
constructor(e = Mt, t, n, r) {
|
|
3160
3161
|
super(), this._config = e, this._injector = t, this._commandService = n, this._configService = r;
|
|
3161
3162
|
const { menu: o, ...i } = Zn(
|
|
3162
3163
|
{},
|
|
3163
|
-
|
|
3164
|
+
Mt,
|
|
3164
3165
|
this._config
|
|
3165
3166
|
);
|
|
3166
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
3167
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(yt, i);
|
|
3167
3168
|
}
|
|
3168
3169
|
onStarting() {
|
|
3169
3170
|
[
|
|
@@ -3179,8 +3180,8 @@ let Tt = class extends Xn {
|
|
|
3179
3180
|
].forEach((e) => {
|
|
3180
3181
|
this._injector.add(e);
|
|
3181
3182
|
}), [
|
|
3183
|
+
kt,
|
|
3182
3184
|
Lt,
|
|
3183
|
-
Pt,
|
|
3184
3185
|
fr,
|
|
3185
3186
|
Cn,
|
|
3186
3187
|
Fe,
|
|
@@ -3191,8 +3192,8 @@ let Tt = class extends Xn {
|
|
|
3191
3192
|
}
|
|
3192
3193
|
onReady() {
|
|
3193
3194
|
this._injector.get(qe), this._injector.get(Je), this._injector.get(Ge), this._injector.get(ut), this._injector.get(Ue).registerRenderModule(
|
|
3194
|
-
|
|
3195
|
-
[
|
|
3195
|
+
Z.UNIVER_SHEET,
|
|
3196
|
+
[Et]
|
|
3196
3197
|
);
|
|
3197
3198
|
}
|
|
3198
3199
|
onRendered() {
|
|
@@ -3202,16 +3203,16 @@ let Tt = class extends Xn {
|
|
|
3202
3203
|
this._injector.get(ze);
|
|
3203
3204
|
}
|
|
3204
3205
|
};
|
|
3205
|
-
Dr(
|
|
3206
|
-
Dr(
|
|
3207
|
-
|
|
3206
|
+
Dr(Ot, "pluginName", oa);
|
|
3207
|
+
Dr(Ot, "type", Z.UNIVER_SHEET);
|
|
3208
|
+
Ot = ra([
|
|
3208
3209
|
Hr(so),
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
],
|
|
3210
|
+
Gt(1, D(ye)),
|
|
3211
|
+
Gt(2, te),
|
|
3212
|
+
Gt(3, dn)
|
|
3213
|
+
], Ot);
|
|
3213
3214
|
export {
|
|
3214
3215
|
fe as BaseSheetDataValidatorView,
|
|
3215
3216
|
Bn as UniverSheetsDataValidationMobileUIPlugin,
|
|
3216
|
-
|
|
3217
|
+
Ot as UniverSheetsDataValidationUIPlugin
|
|
3217
3218
|
};
|