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