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