@univerjs/sheets-data-validation-ui 0.5.3 → 0.5.4-nightly.202501131606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +618 -624
- package/lib/types/controllers/dv-permission.controller.d.ts +3 -3
- package/lib/umd/index.js +2 -2
- package/package.json +17 -16
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
@@ -1,18 +1,18 @@
|
|
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
3
|
var M = (e, t, o) => Wo(e, typeof t != "symbol" ? t + "" : t, o);
|
4
|
-
import Zt, { useState as W, forwardRef as we, useRef as
|
5
|
-
import { Inject as b, LocaleService as J, Disposable as De, DataValidationErrorStyle as it, useDependency as L, ICommandService as Q, dayjs as qt, numfmt as Jt, CellValueType as Ho, UniverInstanceType as Y, toDisposable as Yo, IUniverInstanceService as ge, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Xo, DisposableCollection as zo, CommandType as Je, BuildTextUtils as Ko, DataValidationRenderMode as de, DataValidationType as z, IConfigService as
|
6
|
-
import { Button as
|
7
|
-
import { DeviceInputEventType as nn, IRenderManagerService as Ve, fixLineWidthByScale as
|
8
|
-
import { SheetInterceptorService as
|
9
|
-
import { SheetDataValidationModel as oe, getCellValueOrigin as ie, getDataValidationCellValue as va, deserializeListOptions as
|
4
|
+
import Zt, { useState as W, forwardRef as we, useRef as We, createElement as Re, useMemo as He, useEffect as Ce } from "react";
|
5
|
+
import { Inject as b, LocaleService as J, Disposable as De, DataValidationErrorStyle as it, useDependency as L, ICommandService as Q, dayjs as qt, numfmt as Jt, CellValueType as Ho, UniverInstanceType as Y, toDisposable as Yo, IUniverInstanceService as ge, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Xo, DisposableCollection as zo, CommandType as Je, BuildTextUtils as Ko, DataValidationRenderMode as de, DataValidationType as z, IConfigService as pn, UndoCommand as Go, RedoCommand as Zo, isUnitRangesEqual as qo, debounce as Jo, shallowEqual as bn, Injector as Fe, DataValidationStatus as rt, ObjectMatrix as _t, Range as Qo, Rectangle as St, queryObjectMatrix as Qt, Optional as ea, RxDisposable as fn, InterceptorEffectEnum as Kn, sequenceExecute as Gn, bufferDebounceTime as ta, isFormulaString as Pe, Tools as en, ThemeService as na, VerticalAlign as ue, HorizontalAlign as Ye, DEFAULT_STYLES as le, WrapStrategy as Se, DocumentDataModel as oa, DEFAULT_EMPTY_DOCUMENT_VALUE as aa, BooleanNumber as Qe, Plugin as Zn, merge as qn } from "@univerjs/core";
|
6
|
+
import { Button as je, DatePanel as ia, Scrollbar as ra, FormLayout as Z, RadioGroup as mn, Radio as Ae, Checkbox as Ot, Input as xe, Select as tn, DraggableList as sa } from "@univerjs/design";
|
7
|
+
import { DeviceInputEventType as nn, IRenderManagerService as Ve, fixLineWidthByScale as En, Transform as la, CheckboxShape as da, CURSOR_TYPE as Xe, FontCache as ca, Shape as ua, Rect as Jn, getFontStyleString as jt, getDocsSkeletonPageSize as et, DocumentViewModel as ha, DocumentSkeleton as pa, Documents as fa } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as gn, AFTER_CELL_EDIT_ASYNC as ma, SetRangeValuesCommand as vn, SheetsSelectionsService as Qn, getSheetCommandTarget as eo, SheetPermissionCheckController as to, WorkbookEditablePermission as Ct, RangeProtectionPermissionEditPoint as It, WorksheetEditPermission as wt, checkRangesEditablePermission as ga, WorksheetSetCellStylePermission as on, INTERCEPTOR_POINT as no, InterceptCellContentPriority as oo } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as oe, getCellValueOrigin as ie, getDataValidationCellValue as va, deserializeListOptions as ao, serializeListOptions as io, UpdateSheetDataValidationRangeCommand as ro, UpdateSheetDataValidationSettingCommand as On, RemoveSheetDataValidationCommand as so, UpdateSheetDataValidationOptionsCommand as _a, createDefaultNewRule as lo, AddSheetDataValidationCommand as _n, RemoveSheetAllDataValidationCommand as Sa, DATA_VALIDATION_PLUGIN_NAME as co, getDataValidationDiffMutations as an, DataValidationCacheService as uo, DataValidationFormulaController as Ca, DataValidationFormulaService as Ia, getFormulaResult as Ft, isLegalFormulaResult as Ln, transformCheckboxValue as wa, CHECKBOX_FORMULA_1 as Ra, CHECKBOX_FORMULA_2 as Da } from "@univerjs/sheets-data-validation";
|
10
10
|
import { getPatternType as Va } from "@univerjs/sheets-numfmt";
|
11
|
-
import { SetCellEditVisibleOperation as
|
12
|
-
import { IDialogService as ja, KeyCode as sn, ISidebarService as mo, useObservable as
|
13
|
-
import { DataValidatorRegistryService as ye, DataValidationModel as Pt, DataValidatorRegistryScope as $a, TWO_FORMULA_OPERATOR_COUNT as ka, getRuleOptions as
|
11
|
+
import { SetCellEditVisibleOperation as ho, SheetCanvasPopManagerService as ya, IEditorBridgeService as po, IMarkSelectionService as Ma, HoverManagerService as ba, CellAlertManagerService as Ea, CellAlertType as Oa, IAutoFillService as La, APPLY_TYPE as tt, virtualizeDiscreteRanges as rn, getAutoFillRepeatRange as Pa, COPY_TYPE as Pn, rangeToDiscreteRange as Ta, PREDEFINED_HOOK_NAME as dt, getRepeatRange as Tn, ISheetClipboardService as Aa, getCurrentRangeDisable$ as xa, AutoHeightController as fo, SheetSkeletonManagerService as Rt } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as ja, KeyCode as sn, ISidebarService as mo, useObservable as Ne, ComponentManager as Lt, IZenZoneService as go, RectPopup as Fa, useEvent as ln, useSidebarClick as Sn, MenuItemType as Cn, getMenuHiddenObservable as Na, RibbonStartGroup as Ua, IMenuManagerService as Ba } from "@univerjs/ui";
|
13
|
+
import { DataValidatorRegistryService as ye, DataValidationModel as Pt, DataValidatorRegistryScope as $a, TWO_FORMULA_OPERATOR_COUNT as ka, getRuleOptions as An, getRuleSetting as xn } from "@univerjs/data-validation";
|
14
14
|
import { RichTextEditingMutation as Wa } from "@univerjs/docs";
|
15
|
-
import { filter as
|
15
|
+
import { filter as In, BehaviorSubject as jn, distinctUntilChanged as Ha, Subject as Ya, debounceTime as wn, bufferTime as vo } from "rxjs";
|
16
16
|
import { deserializeRangeWithSheet as Xa, serializeRange as _o } from "@univerjs/engine-formula";
|
17
17
|
import { RangeSelector as za, FormulaEditor as So } from "@univerjs/sheets-formula-ui";
|
18
18
|
var Nt = { exports: {} }, nt = {};
|
@@ -25,23 +25,23 @@ var Nt = { exports: {} }, nt = {};
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
27
27
|
*/
|
28
|
-
var
|
28
|
+
var Fn;
|
29
29
|
function Ka() {
|
30
|
-
if (
|
31
|
-
|
30
|
+
if (Fn) return nt;
|
31
|
+
Fn = 1;
|
32
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
33
|
function r(l, s, c) {
|
34
|
-
var u, p = {}, d = null,
|
35
|
-
c !== void 0 && (d = "" + c), s.key !== void 0 && (d = "" + s.key), s.ref !== void 0 && (
|
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
36
|
for (u in s) n.call(s, u) && !i.hasOwnProperty(u) && (p[u] = s[u]);
|
37
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:
|
38
|
+
return { $$typeof: t, type: l, key: d, ref: g, props: p, _owner: a.current };
|
39
39
|
}
|
40
40
|
return nt.Fragment = o, nt.jsx = r, nt.jsxs = r, nt;
|
41
41
|
}
|
42
|
-
var
|
42
|
+
var Nn;
|
43
43
|
function Ga() {
|
44
|
-
return
|
44
|
+
return Nn || (Nn = 1, Nt.exports = Ka()), Nt.exports;
|
45
45
|
}
|
46
46
|
var h = Ga(), Za = Object.defineProperty, qa = Object.getOwnPropertyDescriptor, Ja = (e, t, o, n) => {
|
47
47
|
for (var a = n > 1 ? void 0 : n ? qa(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
@@ -54,10 +54,10 @@ let st = class extends De {
|
|
54
54
|
}
|
55
55
|
_initEditorBridgeInterceptor() {
|
56
56
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
57
|
-
|
57
|
+
ma,
|
58
58
|
{
|
59
59
|
handler: async (e, t, o) => {
|
60
|
-
var
|
60
|
+
var C;
|
61
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), p = u ? this._dataValidationModel.getRuleById(l, s, u) : void 0;
|
62
62
|
if (!p || p.errorStyle !== it.STOP)
|
63
63
|
return o(Promise.resolve(n));
|
@@ -65,7 +65,7 @@ let st = class extends De {
|
|
65
65
|
if (!d || await d.validator(
|
66
66
|
{
|
67
67
|
value: ie(n),
|
68
|
-
interceptValue: ie((
|
68
|
+
interceptValue: ie((C = t == null ? void 0 : t.origin) != null ? C : n),
|
69
69
|
row: i,
|
70
70
|
column: r,
|
71
71
|
unitId: l,
|
@@ -77,7 +77,7 @@ let st = class extends De {
|
|
77
77
|
p
|
78
78
|
))
|
79
79
|
return o(Promise.resolve(n));
|
80
|
-
const
|
80
|
+
const f = a.getCellRaw(i, r);
|
81
81
|
return this._dialogService.open({
|
82
82
|
width: 368,
|
83
83
|
title: {
|
@@ -89,7 +89,7 @@ let st = class extends De {
|
|
89
89
|
},
|
90
90
|
footer: {
|
91
91
|
title: Zt.createElement(
|
92
|
-
|
92
|
+
je,
|
93
93
|
{
|
94
94
|
type: "primary",
|
95
95
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
@@ -100,7 +100,7 @@ let st = class extends De {
|
|
100
100
|
onClose: () => {
|
101
101
|
this._dialogService.close("reject-input-dialog");
|
102
102
|
}
|
103
|
-
}), o(Promise.resolve(
|
103
|
+
}), o(Promise.resolve(f));
|
104
104
|
}
|
105
105
|
}
|
106
106
|
);
|
@@ -117,7 +117,7 @@ let st = class extends De {
|
|
117
117
|
},
|
118
118
|
footer: {
|
119
119
|
title: Zt.createElement(
|
120
|
-
|
120
|
+
je,
|
121
121
|
{
|
122
122
|
type: "primary",
|
123
123
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
@@ -132,13 +132,13 @@ let st = class extends De {
|
|
132
132
|
}
|
133
133
|
};
|
134
134
|
st = Ja([
|
135
|
-
ot(0, b(
|
135
|
+
ot(0, b(gn)),
|
136
136
|
ot(1, b(oe)),
|
137
137
|
ot(2, b(ye)),
|
138
138
|
ot(3, ja),
|
139
139
|
ot(4, b(J))
|
140
140
|
], st);
|
141
|
-
const Qa = "univer-dv-date-dropdown", ei = "univer-dv-date-dropdown-btns",
|
141
|
+
const Qa = "univer-dv-date-dropdown", ei = "univer-dv-date-dropdown-btns", Un = {
|
142
142
|
dvDateDropdown: Qa,
|
143
143
|
dvDateDropdownBtns: ei
|
144
144
|
}, ti = (e) => {
|
@@ -151,20 +151,20 @@ const Qa = "univer-dv-date-dropdown", ei = "univer-dv-date-dropdown-btns", Nn =
|
|
151
151
|
return t;
|
152
152
|
};
|
153
153
|
function ni(e) {
|
154
|
-
var
|
155
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = L(Q), u = L(st), p = n.getCell(a, i), d = ie(n.getCellRaw(a, i)),
|
154
|
+
var m;
|
155
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = L(Q), u = L(st), p = n.getCell(a, i), d = ie(n.getCellRaw(a, i)), g = ti(d), [f, C] = W(g), R = f && f.isValid() ? f : qt(), v = L(J), w = L(oe), I = w.getRuleByLocation(r, l, a, i);
|
156
156
|
if (!I)
|
157
157
|
return null;
|
158
|
-
const V =
|
158
|
+
const V = w.getValidator(I.type);
|
159
159
|
if (!p || !V)
|
160
160
|
return;
|
161
|
-
const
|
162
|
-
var x, j,
|
163
|
-
if (!
|
161
|
+
const _ = !!((m = I.bizInfo) != null && m.showTime), S = async () => {
|
162
|
+
var x, j, N;
|
163
|
+
if (!R)
|
164
164
|
return;
|
165
|
-
const P =
|
165
|
+
const P = R.format(_ ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), F = (x = Jt.parseDate(P)) == null ? void 0 : x.v, T = s.getStyles().getStyleByCell(p), E = (N = (j = T == null ? void 0 : T.n) == null ? void 0 : j.pattern) != null ? N : "", A = Va(E);
|
166
166
|
I.errorStyle !== it.STOP || await V.validator({
|
167
|
-
value:
|
167
|
+
value: F,
|
168
168
|
unitId: r,
|
169
169
|
subUnitId: l,
|
170
170
|
row: a,
|
@@ -173,12 +173,12 @@ function ni(e) {
|
|
173
173
|
workbook: s,
|
174
174
|
interceptValue: P.replace("Z", "").replace("T", " "),
|
175
175
|
t: Ho.NUMBER
|
176
|
-
}, I) ? (o(), await c.executeCommand(
|
176
|
+
}, I) ? (o(), await c.executeCommand(ho.id, {
|
177
177
|
visible: !1,
|
178
178
|
eventType: nn.Keyboard,
|
179
179
|
unitId: r,
|
180
180
|
keycode: sn.ESC
|
181
|
-
}), await c.executeCommand(
|
181
|
+
}), await c.executeCommand(vn.id, {
|
182
182
|
unitId: r,
|
183
183
|
subUnitId: l,
|
184
184
|
range: {
|
@@ -188,36 +188,36 @@ function ni(e) {
|
|
188
188
|
endRow: a
|
189
189
|
},
|
190
190
|
value: {
|
191
|
-
v:
|
191
|
+
v: F,
|
192
192
|
t: 2,
|
193
193
|
p: null,
|
194
194
|
f: null,
|
195
195
|
si: null,
|
196
196
|
s: {
|
197
197
|
n: {
|
198
|
-
pattern:
|
198
|
+
pattern: _ ? A === "datetime" ? E : "yyyy-MM-dd hh:mm:ss" : A === "date" ? E : "yyyy-MM-dd"
|
199
199
|
}
|
200
200
|
}
|
201
201
|
}
|
202
202
|
})) : u.showReject(V.getRuleFinalError(I, { row: a, col: i, unitId: r, subUnitId: l }));
|
203
203
|
};
|
204
|
-
return /* @__PURE__ */ h.jsxs("div", { className:
|
204
|
+
return /* @__PURE__ */ h.jsxs("div", { className: Un.dvDateDropdown, children: [
|
205
205
|
/* @__PURE__ */ h.jsx(
|
206
206
|
ia,
|
207
207
|
{
|
208
|
-
defaultValue:
|
209
|
-
pickerValue:
|
210
|
-
showTime:
|
208
|
+
defaultValue: R,
|
209
|
+
pickerValue: R,
|
210
|
+
showTime: _ || void 0,
|
211
211
|
onSelect: async (y) => {
|
212
|
-
|
212
|
+
C(y);
|
213
213
|
},
|
214
214
|
onPanelChange: (y) => {
|
215
|
-
|
215
|
+
C(y);
|
216
216
|
},
|
217
217
|
disabledDate: (y) => !Jt.parseDate(y.format("YYYY-MM-DD"))
|
218
218
|
}
|
219
219
|
),
|
220
|
-
/* @__PURE__ */ h.jsx("div", { className:
|
220
|
+
/* @__PURE__ */ h.jsx("div", { className: Un.dvDateDropdownBtns, children: /* @__PURE__ */ h.jsx(je, { size: "small", type: "primary", onClick: S, disabled: !R.isValid(), children: v.t("dataValidation.alert.ok") }) })
|
221
221
|
] });
|
222
222
|
}
|
223
223
|
var ce = function() {
|
@@ -236,7 +236,7 @@ var ce = function() {
|
|
236
236
|
t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (o[n[a]] = e[n[a]]);
|
237
237
|
return o;
|
238
238
|
}, Me = we(function(e, t) {
|
239
|
-
var o = e.icon, n = e.id, a = e.className, i = e.extend, r = oi(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), s =
|
239
|
+
var o = e.icon, n = e.id, a = e.className, i = e.extend, r = oi(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), s = We("_".concat(ri()));
|
240
240
|
return Co(o, "".concat(n), { defIds: o.defIds, idSuffix: s.current }, ce({ ref: t, className: l }, r), i);
|
241
241
|
});
|
242
242
|
function Co(e, t, o, n, a) {
|
@@ -279,14 +279,14 @@ var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em"
|
|
279
279
|
}));
|
280
280
|
});
|
281
281
|
wo.displayName = "DataValidationSingle";
|
282
|
-
var di = { 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" } }] },
|
282
|
+
var di = { 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" } }] }, Rn = we(function(e, t) {
|
283
283
|
return Re(Me, Object.assign({}, e, {
|
284
284
|
id: "delete-single",
|
285
285
|
ref: t,
|
286
286
|
icon: di
|
287
287
|
}));
|
288
288
|
});
|
289
|
-
|
289
|
+
Rn.displayName = "DeleteSingle";
|
290
290
|
var ci = { 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" } }] }, Ro = we(function(e, t) {
|
291
291
|
return Re(Me, Object.assign({}, e, {
|
292
292
|
id: "increase-single",
|
@@ -319,22 +319,22 @@ var pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
319
319
|
}));
|
320
320
|
});
|
321
321
|
yo.displayName = "SequenceSingle";
|
322
|
-
var
|
323
|
-
for (var a = n > 1 ? void 0 : n ?
|
322
|
+
var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, gi = (e, t, o, n) => {
|
323
|
+
for (var a = n > 1 ? void 0 : n ? mi(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
324
324
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
325
|
-
return n && a &&
|
326
|
-
},
|
327
|
-
let
|
325
|
+
return n && a && fi(t, o, a), a;
|
326
|
+
}, Bn = (e, t) => (o, n) => t(o, n, e);
|
327
|
+
let fe = class extends De {
|
328
328
|
constructor(t, o) {
|
329
329
|
super();
|
330
|
-
M(this, "_open$", new
|
330
|
+
M(this, "_open$", new jn(!1));
|
331
331
|
M(this, "open$", this._open$.pipe(Ha()));
|
332
332
|
M(this, "_activeRule");
|
333
|
-
M(this, "_activeRule$", new
|
333
|
+
M(this, "_activeRule$", new jn(void 0));
|
334
334
|
M(this, "activeRule$", this._activeRule$.asObservable());
|
335
335
|
M(this, "_closeDisposable", null);
|
336
336
|
this._univerInstanceService = t, this._sidebarService = o, this.disposeWithMe(
|
337
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(
|
337
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(In((n) => !n)).subscribe(() => {
|
338
338
|
this.close();
|
339
339
|
})
|
340
340
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
@@ -369,12 +369,12 @@ let me = class extends De {
|
|
369
369
|
this._activeRule = t, this._activeRule$.next(t);
|
370
370
|
}
|
371
371
|
};
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
],
|
372
|
+
fe = gi([
|
373
|
+
Bn(0, ge),
|
374
|
+
Bn(1, mo)
|
375
|
+
], fe);
|
376
376
|
function vi() {
|
377
|
-
const e = L(Ie), t =
|
377
|
+
const e = L(Ie), t = Ne(e.activeDropdown$, e.activeDropdown), o = L(Lt);
|
378
378
|
if (!t)
|
379
379
|
return null;
|
380
380
|
const { location: n, componentKey: a } = t, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
@@ -501,18 +501,18 @@ Ie = Ci([
|
|
501
501
|
be(0, b(ya)),
|
502
502
|
be(1, ge),
|
503
503
|
be(2, b(ye)),
|
504
|
-
be(3,
|
504
|
+
be(3, go),
|
505
505
|
be(4, Ve),
|
506
506
|
be(5, b(oe)),
|
507
|
-
be(6, b(
|
507
|
+
be(6, b(Qn))
|
508
508
|
], Ie);
|
509
|
-
const Dt = "DataValidationPanel",
|
509
|
+
const Dt = "DataValidationPanel", Ue = {
|
510
510
|
id: "data-validation.operation.open-validation-panel",
|
511
511
|
type: Je.OPERATION,
|
512
512
|
handler(e, t) {
|
513
513
|
if (!t)
|
514
514
|
return !1;
|
515
|
-
const { ruleId: o, isAdd: n } = t, a = e.get(
|
515
|
+
const { ruleId: o, isAdd: n } = t, a = e.get(fe), i = e.get(Pt), r = e.get(ge), l = e.get(mo), s = eo(r);
|
516
516
|
if (!s) return !1;
|
517
517
|
const { unitId: c, subUnitId: u } = s, p = o ? i.getRuleById(c, u, o) : void 0;
|
518
518
|
a.open(), a.setActiveRule(p && {
|
@@ -529,18 +529,18 @@ const Dt = "DataValidationPanel", Be = {
|
|
529
529
|
});
|
530
530
|
return a.setCloseDisposable(d), !0;
|
531
531
|
}
|
532
|
-
},
|
532
|
+
}, Dn = {
|
533
533
|
id: "data-validation.operation.close-validation-panel",
|
534
534
|
type: Je.OPERATION,
|
535
535
|
handler(e) {
|
536
|
-
return e.get(
|
536
|
+
return e.get(fe).close(), !0;
|
537
537
|
}
|
538
538
|
}, bo = {
|
539
539
|
id: "data-validation.operation.toggle-validation-panel",
|
540
540
|
type: Je.OPERATION,
|
541
541
|
handler(e) {
|
542
|
-
const t = e.get(Q), o = e.get(
|
543
|
-
return o.open(), o.isOpen ? t.executeCommand(
|
542
|
+
const t = e.get(Q), o = e.get(fe);
|
543
|
+
return o.open(), o.isOpen ? t.executeCommand(Dn.id) : t.executeCommand(Ue.id), !0;
|
544
544
|
}
|
545
545
|
}, Tt = {
|
546
546
|
type: Je.OPERATION,
|
@@ -562,7 +562,7 @@ const Dt = "DataValidationPanel", Be = {
|
|
562
562
|
handler(e, t) {
|
563
563
|
return t ? (e.get(Ie).hideDropdown(), !0) : !1;
|
564
564
|
}
|
565
|
-
}, Te = "#ECECEC",
|
565
|
+
}, Te = "#ECECEC", Vn = "sheets-data-validation-ui.config", Vt = {}, Ii = "univer-dv-list-dropdown", wi = "univer-dv-list-dropdown-title", Ri = "univer-dv-list-dropdown-list", Di = "univer-dv-list-dropdown-list-container", Vi = "univer-dv-list-dropdown-selected-icon", yi = "univer-dv-list-dropdown-item-container", Mi = "univer-dv-list-dropdown-item", bi = "univer-dv-list-dropdown-split", Ei = "univer-dv-list-dropdown-edit", ve = {
|
566
566
|
dvListDropdown: Ii,
|
567
567
|
dvListDropdownTitle: wi,
|
568
568
|
dvListDropdownList: Ri,
|
@@ -573,55 +573,54 @@ const Dt = "DataValidationPanel", Be = {
|
|
573
573
|
dvListDropdownSplit: bi,
|
574
574
|
dvListDropdownEdit: Ei
|
575
575
|
}, Oi = (e) => {
|
576
|
-
var
|
577
|
-
const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u = L(J), p = L(
|
576
|
+
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(J), p = L(pn), d = s == null ? void 0 : s.toLowerCase(), { row: g, col: f, unitId: C, subUnitId: R } = c, v = a.filter((m) => d ? m.label.toLowerCase().includes(d) : !0), w = (S = (_ = p.getConfig(Vn)) == null ? void 0 : _.showEditOnDropdown) != null ? S : !0, I = L(to), V = He(() => I.permissionCheckWithRanges(
|
578
578
|
{
|
579
579
|
workbookTypes: [Ct],
|
580
580
|
rangeTypes: [It],
|
581
581
|
worksheetTypes: [wt]
|
582
582
|
},
|
583
|
-
[{ startColumn:
|
584
|
-
|
585
|
-
|
586
|
-
), [I,
|
583
|
+
[{ startColumn: f, startRow: g, endColumn: f, endRow: g }],
|
584
|
+
C,
|
585
|
+
R
|
586
|
+
), [I, f, g, C, R]);
|
587
587
|
return /* @__PURE__ */ h.jsxs("div", { className: ve.dvListDropdown, style: l, children: [
|
588
588
|
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownTitle, children: i }),
|
589
|
-
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownList, children: /* @__PURE__ */ h.jsx(ra, { children: /* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownListContainer, children:
|
590
|
-
const P = t.indexOf(
|
589
|
+
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownList, children: /* @__PURE__ */ h.jsx(ra, { children: /* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownListContainer, children: v.map((m, y) => {
|
590
|
+
const P = t.indexOf(m.value) > -1, F = () => {
|
591
591
|
let E;
|
592
|
-
P ? E = new Set(t.filter((x) => x !==
|
592
|
+
P ? E = new Set(t.filter((x) => x !== m.value)) : E = new Set(n ? [...t, m.value] : [m.value]);
|
593
593
|
const A = [];
|
594
594
|
a.forEach((x) => {
|
595
595
|
E.has(x.value) && A.push(x.value);
|
596
596
|
}), o(A);
|
597
|
-
}, T =
|
598
|
-
return /* @__PURE__ */ h.jsxs("div", { className: ve.dvListDropdownItemContainer, onClick:
|
599
|
-
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownItem, style: { background:
|
600
|
-
/* @__PURE__ */ h.jsx("span", { children:
|
601
|
-
/* @__PURE__ */ h.jsx("span", { style: { fontWeight: "bold" }, children:
|
602
|
-
/* @__PURE__ */ h.jsx("span", { children:
|
603
|
-
] }) :
|
597
|
+
}, T = m.label.toLocaleLowerCase().indexOf(d);
|
598
|
+
return /* @__PURE__ */ h.jsxs("div", { className: ve.dvListDropdownItemContainer, onClick: F, children: [
|
599
|
+
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownItem, style: { background: m.color || Te }, children: d && m.label.toLowerCase().includes(d) ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
600
|
+
/* @__PURE__ */ h.jsx("span", { children: m.label.substring(0, T) }),
|
601
|
+
/* @__PURE__ */ h.jsx("span", { style: { fontWeight: "bold" }, children: m.label.substring(T, T + d.length) }),
|
602
|
+
/* @__PURE__ */ h.jsx("span", { children: m.label.substring(T + d.length) })
|
603
|
+
] }) : m.label }),
|
604
604
|
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownSelectedIcon, children: P ? /* @__PURE__ */ h.jsx(Io, {}) : null })
|
605
605
|
] }, y);
|
606
606
|
}) }) }, s) }),
|
607
|
-
|
607
|
+
w && V ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
608
608
|
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownSplit }),
|
609
609
|
/* @__PURE__ */ h.jsx("div", { className: ve.dvListDropdownEdit, children: /* @__PURE__ */ h.jsx("a", { onClick: r, children: u.t("dataValidation.list.edit") }) })
|
610
610
|
] }) : null
|
611
611
|
] });
|
612
612
|
};
|
613
613
|
function Li(e) {
|
614
|
-
var j,
|
615
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = L(Pt), [c, u] = W(""), p = L(Q), d = L(J), [
|
616
|
-
|
617
|
-
const I = Fa.useContext(), V = ((
|
614
|
+
var j, N, H, X;
|
615
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = L(Pt), [c, u] = W(""), p = L(Q), d = L(J), [g, f] = W(""), C = L(po), R = L(ge), v = He(() => s.ruleChange$.pipe(wn(16)), []), w = L(oe);
|
616
|
+
Ne(v);
|
617
|
+
const I = Fa.useContext(), V = ((N = (j = I.current) == null ? void 0 : j.right) != null ? N : 0) - ((X = (H = I.current) == null ? void 0 : H.left) != null ? X : 0);
|
618
618
|
if (Ce(() => {
|
619
619
|
const k = p.onCommandExecuted((K) => {
|
620
620
|
var q, ee;
|
621
621
|
if (K.id === Wa.id) {
|
622
|
-
const te = K.params, { unitId: re } = te, ae =
|
623
|
-
if (!ae)
|
624
|
-
return;
|
622
|
+
const te = K.params, { unitId: re } = te, ae = R.getUnit(re, Y.UNIVER_DOC);
|
623
|
+
if (!ae || !C.isVisible().visible) return;
|
625
624
|
const se = Ko.transform.getPlainText((ee = (q = ae.getSnapshot().body) == null ? void 0 : q.dataStream) != null ? ee : "");
|
626
625
|
u(se);
|
627
626
|
}
|
@@ -629,22 +628,22 @@ function Li(e) {
|
|
629
628
|
return () => {
|
630
629
|
k.dispose();
|
631
630
|
};
|
632
|
-
}, [p,
|
631
|
+
}, [p, C, R]), !n)
|
633
632
|
return null;
|
634
|
-
const
|
635
|
-
if (!
|
633
|
+
const _ = w.getRuleByLocation(r, l, a, i);
|
634
|
+
if (!_)
|
636
635
|
return null;
|
637
|
-
const
|
638
|
-
if (!
|
636
|
+
const S = w.getValidator(_.type);
|
637
|
+
if (!S)
|
639
638
|
return null;
|
640
|
-
const
|
641
|
-
if (!
|
639
|
+
const m = n.getCell(a, i), y = (_ == null ? void 0 : _.renderMode) === de.CUSTOM || (_ == null ? void 0 : _.renderMode) === void 0;
|
640
|
+
if (!m || !_ || !S || S.id.indexOf(z.LIST) !== 0)
|
642
641
|
return;
|
643
|
-
const P =
|
644
|
-
p.executeCommand(
|
645
|
-
ruleId:
|
642
|
+
const P = _.type === z.LIST_MULTIPLE, F = S.getListWithColor(_, r, l), T = g || va(n.getCellRaw(a, i)), E = ao(T), A = () => {
|
643
|
+
p.executeCommand(Ue.id, {
|
644
|
+
ruleId: _.uid
|
646
645
|
}), o();
|
647
|
-
}, x =
|
646
|
+
}, x = F.map((k) => ({
|
648
647
|
label: k.label,
|
649
648
|
value: k.label,
|
650
649
|
color: y || k.color ? k.color : "transparent"
|
@@ -657,7 +656,7 @@ function Li(e) {
|
|
657
656
|
value: E,
|
658
657
|
multiple: P,
|
659
658
|
onChange: async (k) => {
|
660
|
-
const K =
|
659
|
+
const K = io(k), q = {
|
661
660
|
unitId: r,
|
662
661
|
subUnitId: l,
|
663
662
|
range: {
|
@@ -673,17 +672,17 @@ function Li(e) {
|
|
673
672
|
si: null
|
674
673
|
}
|
675
674
|
};
|
676
|
-
|
675
|
+
C.isVisible() && C.changeVisible({
|
677
676
|
visible: !1,
|
678
677
|
keycode: sn.ESC,
|
679
678
|
eventType: nn.Keyboard,
|
680
679
|
unitId: r
|
681
|
-
}),
|
680
|
+
}), f(K), P || o(), C.isVisible().visible && await p.executeCommand(ho.id, {
|
682
681
|
visible: !1,
|
683
682
|
eventType: nn.Keyboard,
|
684
683
|
unitId: r,
|
685
684
|
keycode: sn.ESC
|
686
|
-
}), p.executeCommand(
|
685
|
+
}), p.executeCommand(vn.id, q);
|
687
686
|
},
|
688
687
|
options: x,
|
689
688
|
onEdit: A,
|
@@ -716,8 +715,8 @@ function Ai(e) {
|
|
716
715
|
value: `${(c = n.errorStyle) != null ? c : it.WARNING}`,
|
717
716
|
onChange: (u) => a({ ...n, errorStyle: +u }),
|
718
717
|
children: [
|
719
|
-
/* @__PURE__ */ h.jsx(
|
720
|
-
/* @__PURE__ */ h.jsx(
|
718
|
+
/* @__PURE__ */ h.jsx(Ae, { value: `${it.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
719
|
+
/* @__PURE__ */ h.jsx(Ae, { value: `${it.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
|
721
720
|
]
|
722
721
|
}
|
723
722
|
)
|
@@ -740,11 +739,11 @@ function Ai(e) {
|
|
740
739
|
)
|
741
740
|
}
|
742
741
|
),
|
743
|
-
n.showErrorMessage ? /* @__PURE__ */ h.jsx(Z, { children: /* @__PURE__ */ h.jsx(
|
742
|
+
n.showErrorMessage ? /* @__PURE__ */ h.jsx(Z, { children: /* @__PURE__ */ h.jsx(xe, { value: n.error, onChange: (u) => a({ ...n, error: u }) }) }) : null
|
744
743
|
] })
|
745
744
|
] });
|
746
745
|
}
|
747
|
-
const xi = "univer-data-validation-detail", ji = "univer-data-validation-detail-form-item", Fi = "univer-data-validation-detail-buttons", Ni = "univer-data-validation-detail-button",
|
746
|
+
const xi = "univer-data-validation-detail", ji = "univer-data-validation-detail-form-item", Fi = "univer-data-validation-detail-buttons", Ni = "univer-data-validation-detail-button", Be = {
|
748
747
|
dataValidationDetail: xi,
|
749
748
|
dataValidationDetailFormItem: ji,
|
750
749
|
dataValidationDetailButtons: Fi,
|
@@ -762,7 +761,7 @@ function Bi(e, t, o) {
|
|
762
761
|
}
|
763
762
|
function $i() {
|
764
763
|
var se;
|
765
|
-
const [e, t] = W(0), o = L(
|
764
|
+
const [e, t] = W(0), o = L(fe), n = Ne(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = L(ye), c = L(ge), u = L(Lt), p = L(Q), d = L(Pt), g = L(J), [f, C] = W(r), R = s.getValidatorItem(f.type), [v, w] = W(!1), I = s.getValidatorsByScope($a.SHEET), [V, _] = W(() => f.ranges.map((O) => ({ unitId: "", sheetId: "", range: O }))), S = He(() => Ui(p), [p]), [m, y] = W(!1), P = We({}), [F, T] = W(!1), E = L(Qn);
|
766
765
|
if (Ce(() => () => {
|
767
766
|
const O = E.getCurrentLastSelection();
|
768
767
|
O && E.setSelections([O]);
|
@@ -770,14 +769,14 @@ function $i() {
|
|
770
769
|
p.onCommandExecuted((O) => {
|
771
770
|
(O.id === Go.id || O.id === Zo.id) && setTimeout(() => {
|
772
771
|
const D = d.getRuleById(a, i, l);
|
773
|
-
t((
|
772
|
+
t((U) => U + 1), D && (C(D), _(D.ranges.map((U) => ({ unitId: "", sheetId: "", range: U }))));
|
774
773
|
}, 20);
|
775
774
|
});
|
776
|
-
}, [p, d, l, i, a]), !
|
775
|
+
}, [p, d, l, i, a]), !R)
|
777
776
|
return null;
|
778
|
-
const A =
|
779
|
-
!
|
780
|
-
}, H =
|
777
|
+
const A = R.operators, x = R.operatorNames, j = f.operator ? ka.includes(f.operator) : !1, N = () => {
|
778
|
+
!f.ranges.length || m || (R.validatorFormula(f, a, i).success ? o.setActiveRule(null) : w(!0));
|
779
|
+
}, H = ln((O) => {
|
781
780
|
const D = O.split(",").filter(Boolean).map(Xa).map(($) => {
|
782
781
|
const _e = $.sheetName;
|
783
782
|
if (_e) {
|
@@ -791,25 +790,25 @@ function $i() {
|
|
791
790
|
});
|
792
791
|
if (qo(D, V))
|
793
792
|
return;
|
794
|
-
|
795
|
-
const
|
796
|
-
if (
|
797
|
-
...
|
798
|
-
ranges:
|
799
|
-
}),
|
793
|
+
_(D);
|
794
|
+
const U = D.filter(($) => (!$.unitId || $.unitId === a) && (!$.sheetId || $.sheetId === i)).map(($) => $.range);
|
795
|
+
if (C({
|
796
|
+
...f,
|
797
|
+
ranges: U
|
798
|
+
}), U.length === 0)
|
800
799
|
return;
|
801
800
|
const B = {
|
802
801
|
unitId: a,
|
803
802
|
subUnitId: i,
|
804
803
|
ruleId: l,
|
805
|
-
ranges:
|
804
|
+
ranges: U
|
806
805
|
};
|
807
|
-
|
806
|
+
S(ro.id, B);
|
808
807
|
}), X = (O) => {
|
809
|
-
if (
|
808
|
+
if (bn(O, xn(f)))
|
810
809
|
return;
|
811
|
-
|
812
|
-
...
|
810
|
+
C({
|
811
|
+
...f,
|
813
812
|
...O
|
814
813
|
});
|
815
814
|
const D = {
|
@@ -818,48 +817,48 @@ function $i() {
|
|
818
817
|
ruleId: l,
|
819
818
|
setting: O
|
820
819
|
};
|
821
|
-
|
822
|
-
|
820
|
+
S(
|
821
|
+
On.id,
|
823
822
|
D,
|
824
823
|
void 0
|
825
824
|
);
|
826
825
|
}, k = async () => {
|
827
|
-
await p.executeCommand(
|
826
|
+
await p.executeCommand(so.id, {
|
828
827
|
ruleId: l,
|
829
828
|
unitId: a,
|
830
829
|
subUnitId: i
|
831
830
|
}), o.setActiveRule(null);
|
832
831
|
}, K = {
|
833
|
-
type:
|
834
|
-
operator:
|
835
|
-
formula1:
|
836
|
-
formula2:
|
837
|
-
allowBlank:
|
832
|
+
type: f.type,
|
833
|
+
operator: f.operator,
|
834
|
+
formula1: f.formula1,
|
835
|
+
formula2: f.formula2,
|
836
|
+
allowBlank: f.allowBlank
|
838
837
|
}, q = (O) => {
|
839
838
|
const D = s.getValidatorItem(O);
|
840
839
|
if (!D)
|
841
840
|
return;
|
842
|
-
const
|
841
|
+
const U = D.operators, B = d.getRuleById(a, i, l), $ = O === (B == null ? void 0 : B.type) || O.includes("list") && (B != null && B.type.includes("list")) ? {
|
843
842
|
...B,
|
844
843
|
type: O
|
845
844
|
} : {
|
846
|
-
...
|
845
|
+
...f,
|
847
846
|
type: O,
|
848
|
-
operator:
|
847
|
+
operator: U[0],
|
849
848
|
formula1: void 0,
|
850
849
|
formula2: void 0
|
851
850
|
};
|
852
|
-
|
851
|
+
C($), p.executeCommand(On.id, {
|
853
852
|
unitId: a,
|
854
853
|
subUnitId: i,
|
855
|
-
ruleId:
|
856
|
-
setting:
|
854
|
+
ruleId: f.uid,
|
855
|
+
setting: xn($)
|
857
856
|
});
|
858
|
-
}, ee = u.get(
|
859
|
-
|
860
|
-
...
|
857
|
+
}, ee = u.get(R.formulaInput), te = He(() => V.map((O) => _o(O.range)).join(","), []), re = An(f), ae = (O) => {
|
858
|
+
bn(O, An(f)) || (C({
|
859
|
+
...f,
|
861
860
|
...O
|
862
|
-
}),
|
861
|
+
}), S(
|
863
862
|
_a.id,
|
864
863
|
{
|
865
864
|
unitId: a,
|
@@ -869,16 +868,16 @@ function $i() {
|
|
869
868
|
}
|
870
869
|
));
|
871
870
|
};
|
872
|
-
return
|
873
|
-
var
|
874
|
-
const D = (
|
871
|
+
return Sn((O) => {
|
872
|
+
var U;
|
873
|
+
const D = (U = P.current) == null ? void 0 : U.handleOutClick;
|
875
874
|
D && D(O, () => T(!1));
|
876
|
-
}), /* @__PURE__ */ h.jsxs("div", { className:
|
875
|
+
}), /* @__PURE__ */ h.jsxs("div", { className: Be.dataValidationDetail, children: [
|
877
876
|
/* @__PURE__ */ h.jsx(
|
878
877
|
Z,
|
879
878
|
{
|
880
|
-
label:
|
881
|
-
error: !
|
879
|
+
label: g.t("dataValidation.panel.range"),
|
880
|
+
error: !f.ranges.length || m ? g.t("dataValidation.panel.rangeError") : "",
|
882
881
|
children: /* @__PURE__ */ h.jsx(
|
883
882
|
za,
|
884
883
|
{
|
@@ -887,40 +886,40 @@ function $i() {
|
|
887
886
|
initValue: te,
|
888
887
|
onChange: H,
|
889
888
|
onFocus: () => T(!0),
|
890
|
-
isFocus:
|
889
|
+
isFocus: F,
|
891
890
|
actions: P.current,
|
892
891
|
onVerify: (O) => y(!O)
|
893
892
|
}
|
894
893
|
)
|
895
894
|
}
|
896
895
|
),
|
897
|
-
/* @__PURE__ */ h.jsx(Z, { label:
|
896
|
+
/* @__PURE__ */ h.jsx(Z, { label: g.t("dataValidation.panel.type"), children: /* @__PURE__ */ h.jsx(
|
898
897
|
tn,
|
899
898
|
{
|
900
899
|
options: I == null ? void 0 : I.map((O) => ({
|
901
|
-
label:
|
900
|
+
label: g.t(O.title),
|
902
901
|
value: O.id
|
903
902
|
})),
|
904
|
-
value:
|
903
|
+
value: f.type,
|
905
904
|
onChange: q,
|
906
|
-
className:
|
905
|
+
className: Be.dataValidationDetailFormItem
|
907
906
|
}
|
908
907
|
) }),
|
909
|
-
A != null && A.length ? /* @__PURE__ */ h.jsx(Z, { label:
|
908
|
+
A != null && A.length ? /* @__PURE__ */ h.jsx(Z, { label: g.t("dataValidation.panel.operator"), children: /* @__PURE__ */ h.jsx(
|
910
909
|
tn,
|
911
910
|
{
|
912
911
|
options: A.map((O, D) => ({
|
913
912
|
value: `${O}`,
|
914
913
|
label: x[D]
|
915
914
|
})),
|
916
|
-
value: `${
|
915
|
+
value: `${f.operator}`,
|
917
916
|
onChange: (O) => {
|
918
917
|
X({
|
919
918
|
...K,
|
920
919
|
operator: O
|
921
920
|
});
|
922
921
|
},
|
923
|
-
className:
|
922
|
+
className: Be.dataValidationDetailFormItem
|
924
923
|
}
|
925
924
|
) }) : null,
|
926
925
|
ee ? /* @__PURE__ */ h.jsx(
|
@@ -928,8 +927,8 @@ function $i() {
|
|
928
927
|
{
|
929
928
|
isTwoFormula: j,
|
930
929
|
value: {
|
931
|
-
formula1:
|
932
|
-
formula2:
|
930
|
+
formula1: f.formula1,
|
931
|
+
formula2: f.formula2
|
933
932
|
},
|
934
933
|
onChange: (O) => {
|
935
934
|
X({
|
@@ -937,32 +936,32 @@ function $i() {
|
|
937
936
|
...O
|
938
937
|
});
|
939
938
|
},
|
940
|
-
showError:
|
941
|
-
validResult:
|
939
|
+
showError: v,
|
940
|
+
validResult: R.validatorFormula(f, a, i),
|
942
941
|
unitId: a,
|
943
942
|
subUnitId: i,
|
944
943
|
ruleId: l
|
945
944
|
},
|
946
|
-
e +
|
945
|
+
e + f.type
|
947
946
|
) : null,
|
948
947
|
/* @__PURE__ */ h.jsx(Z, { children: /* @__PURE__ */ h.jsx(
|
949
948
|
Ot,
|
950
949
|
{
|
951
|
-
checked: (se =
|
950
|
+
checked: (se = f.allowBlank) != null ? se : !0,
|
952
951
|
onChange: () => {
|
953
952
|
var O;
|
954
953
|
return X({
|
955
954
|
...K,
|
956
|
-
allowBlank: !((O =
|
955
|
+
allowBlank: !((O = f.allowBlank) == null || O)
|
957
956
|
});
|
958
957
|
},
|
959
|
-
children:
|
958
|
+
children: g.t("dataValidation.panel.allowBlank")
|
960
959
|
}
|
961
960
|
) }),
|
962
|
-
/* @__PURE__ */ h.jsx(Ai, { value: re, onChange: ae, extraComponent:
|
963
|
-
/* @__PURE__ */ h.jsxs("div", { className:
|
964
|
-
/* @__PURE__ */ h.jsx(
|
965
|
-
/* @__PURE__ */ h.jsx(
|
961
|
+
/* @__PURE__ */ h.jsx(Ai, { value: re, onChange: ae, extraComponent: R.optionsInput }),
|
962
|
+
/* @__PURE__ */ h.jsxs("div", { className: Be.dataValidationDetailButtons, children: [
|
963
|
+
/* @__PURE__ */ h.jsx(je, { className: Be.dataValidationDetailButton, onClick: k, children: g.t("dataValidation.panel.removeRule") }),
|
964
|
+
/* @__PURE__ */ h.jsx(je, { className: Be.dataValidationDetailButton, type: "primary", onClick: N, children: g.t("dataValidation.panel.done") })
|
966
965
|
] })
|
967
966
|
] });
|
968
967
|
}
|
@@ -972,17 +971,17 @@ const ki = "univer-data-validation-item-container", Wi = "univer-data-validation
|
|
972
971
|
dataValidationItemContent: Hi,
|
973
972
|
dataValidationItemIcon: Yi
|
974
973
|
}, Xi = (e) => {
|
975
|
-
const { rule: t, onClick: o, unitId: n, subUnitId: a, disable: i } = e, r = L(ye), l = L(Q), s = L(Ma), c = r.getValidatorItem(t.type), u =
|
976
|
-
l.executeCommand(
|
974
|
+
const { rule: t, onClick: o, unitId: n, subUnitId: a, disable: i } = e, r = L(ye), l = L(Q), s = L(Ma), c = r.getValidatorItem(t.type), u = We(), [p, d] = W(!1), g = (f) => {
|
975
|
+
l.executeCommand(so.id, {
|
977
976
|
ruleId: t.uid,
|
978
977
|
unitId: n,
|
979
978
|
subUnitId: a
|
980
|
-
}),
|
979
|
+
}), f.stopPropagation();
|
981
980
|
};
|
982
981
|
return Ce(() => () => {
|
983
|
-
var
|
984
|
-
u.current && ((
|
985
|
-
|
982
|
+
var f;
|
983
|
+
u.current && ((f = u.current) == null || f.forEach((C) => {
|
984
|
+
C && s.removeShape(C);
|
986
985
|
}));
|
987
986
|
}, [s]), /* @__PURE__ */ h.jsxs(
|
988
987
|
"div",
|
@@ -990,8 +989,8 @@ const ki = "univer-data-validation-item-container", Wi = "univer-data-validation
|
|
990
989
|
className: ct.dataValidationItemContainer,
|
991
990
|
onClick: o,
|
992
991
|
onMouseEnter: () => {
|
993
|
-
i || (d(!0), u.current = t.ranges.map((
|
994
|
-
range:
|
992
|
+
i || (d(!0), u.current = t.ranges.map((f) => s.addShape({
|
993
|
+
range: f,
|
995
994
|
style: {
|
996
995
|
// hasAutoFill: false,
|
997
996
|
fill: "rgba(73, 184, 17, 0.05)",
|
@@ -1003,15 +1002,15 @@ const ki = "univer-data-validation-item-container", Wi = "univer-data-validation
|
|
1003
1002
|
})));
|
1004
1003
|
},
|
1005
1004
|
onMouseLeave: () => {
|
1006
|
-
var
|
1007
|
-
d(!1), (
|
1008
|
-
|
1005
|
+
var f;
|
1006
|
+
d(!1), (f = u.current) == null || f.forEach((C) => {
|
1007
|
+
C && s.removeShape(C);
|
1009
1008
|
}), u.current = void 0;
|
1010
1009
|
},
|
1011
1010
|
children: [
|
1012
1011
|
/* @__PURE__ */ h.jsx("div", { className: ct.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(t) }),
|
1013
|
-
/* @__PURE__ */ h.jsx("div", { className: ct.dataValidationItemContent, children: t.ranges.map((
|
1014
|
-
p ? /* @__PURE__ */ h.jsx("div", { className: ct.dataValidationItemIcon, onClick:
|
1012
|
+
/* @__PURE__ */ h.jsx("div", { className: ct.dataValidationItemContent, children: t.ranges.map((f) => _o(f)).join(",") }),
|
1013
|
+
p ? /* @__PURE__ */ h.jsx("div", { className: ct.dataValidationItemIcon, onClick: g, children: /* @__PURE__ */ h.jsx(Rn, {}) }) : null
|
1015
1014
|
]
|
1016
1015
|
}
|
1017
1016
|
);
|
@@ -1021,7 +1020,7 @@ const ki = "univer-data-validation-item-container", Wi = "univer-data-validation
|
|
1021
1020
|
dataValidationListButton: Gi
|
1022
1021
|
};
|
1023
1022
|
function Zi() {
|
1024
|
-
const e = L(ge), t =
|
1023
|
+
const e = L(ge), t = Ne(
|
1025
1024
|
() => e.getCurrentTypeOfUnit$(Y.UNIVER_SHEET),
|
1026
1025
|
void 0,
|
1027
1026
|
void 0,
|
@@ -1030,38 +1029,38 @@ function Zi() {
|
|
1030
1029
|
return t ? /* @__PURE__ */ h.jsx(qi, { workbook: t }) : null;
|
1031
1030
|
}
|
1032
1031
|
function qi(e) {
|
1033
|
-
const t = L(oe), o = L(ge), n = L(Q), a = L(
|
1032
|
+
const t = L(oe), o = L(ge), n = L(Q), a = L(Fe), i = L(fe), r = L(J), [l, s] = W([]), { workbook: c } = e, u = Ne(c.activeSheet$, void 0, !0), p = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
1034
1033
|
Ce(() => {
|
1035
1034
|
s(t.getRules(p, d));
|
1036
|
-
const
|
1035
|
+
const w = t.ruleChange$.subscribe((I) => {
|
1037
1036
|
I.unitId === p && I.subUnitId === d && s(t.getRules(p, d));
|
1038
1037
|
});
|
1039
1038
|
return () => {
|
1040
|
-
|
1039
|
+
w.unsubscribe();
|
1041
1040
|
};
|
1042
1041
|
}, [p, d, t]);
|
1043
|
-
const
|
1044
|
-
const
|
1042
|
+
const g = async () => {
|
1043
|
+
const w = lo(a), I = {
|
1045
1044
|
unitId: p,
|
1046
1045
|
subUnitId: d,
|
1047
|
-
rule:
|
1046
|
+
rule: w
|
1048
1047
|
};
|
1049
|
-
await n.executeCommand(
|
1048
|
+
await n.executeCommand(_n.id, I), i.setActiveRule({
|
1050
1049
|
unitId: p,
|
1051
1050
|
subUnitId: d,
|
1052
|
-
rule:
|
1051
|
+
rule: w
|
1053
1052
|
});
|
1054
|
-
},
|
1053
|
+
}, f = () => {
|
1055
1054
|
n.executeCommand(Sa.id, {
|
1056
1055
|
unitId: p,
|
1057
1056
|
subUnitId: d
|
1058
1057
|
});
|
1059
|
-
},
|
1060
|
-
const I = o.getCurrentUnitForType(Y.UNIVER_SHEET), V = I.getActiveSheet(),
|
1061
|
-
return
|
1062
|
-
})(l),
|
1058
|
+
}, R = ((w) => {
|
1059
|
+
const I = o.getCurrentUnitForType(Y.UNIVER_SHEET), V = I.getActiveSheet(), _ = I.getUnitId(), S = V.getSheetId();
|
1060
|
+
return w.map((y) => ga(a, _, S, y.ranges) ? { ...y } : { ...y, disable: !0 });
|
1061
|
+
})(l), v = R == null ? void 0 : R.some((w) => w.disable);
|
1063
1062
|
return /* @__PURE__ */ h.jsxs("div", { className: ut.dataValidationList, children: [
|
1064
|
-
|
1063
|
+
R == null ? void 0 : R.map((w) => {
|
1065
1064
|
var I;
|
1066
1065
|
return /* @__PURE__ */ h.jsx(
|
1067
1066
|
Xi,
|
@@ -1069,39 +1068,39 @@ function qi(e) {
|
|
1069
1068
|
unitId: p,
|
1070
1069
|
subUnitId: d,
|
1071
1070
|
onClick: () => {
|
1072
|
-
|
1071
|
+
w.disable || i.setActiveRule({
|
1073
1072
|
unitId: p,
|
1074
1073
|
subUnitId: d,
|
1075
|
-
rule:
|
1074
|
+
rule: w
|
1076
1075
|
});
|
1077
1076
|
},
|
1078
|
-
rule:
|
1079
|
-
disable: (I =
|
1077
|
+
rule: w,
|
1078
|
+
disable: (I = w.disable) != null ? I : !1
|
1080
1079
|
},
|
1081
|
-
|
1080
|
+
w.uid
|
1082
1081
|
);
|
1083
1082
|
}),
|
1084
1083
|
/* @__PURE__ */ h.jsxs("div", { className: ut.dataValidationListButtons, children: [
|
1085
|
-
l.length && !
|
1086
|
-
/* @__PURE__ */ h.jsx(
|
1084
|
+
l.length && !v ? /* @__PURE__ */ h.jsx(je, { className: ut.dataValidationListButton, onClick: f, children: r.t("dataValidation.panel.removeAll") }) : null,
|
1085
|
+
/* @__PURE__ */ h.jsx(je, { className: ut.dataValidationListButton, type: "primary", onClick: g, children: r.t("dataValidation.panel.add") })
|
1087
1086
|
] })
|
1088
1087
|
] });
|
1089
1088
|
}
|
1090
1089
|
const Ji = () => {
|
1091
|
-
const e = L(
|
1090
|
+
const e = L(fe), t = Ne(e.activeRule$, e.activeRule);
|
1092
1091
|
return t ? /* @__PURE__ */ h.jsx($i, {}, t.rule.uid) : /* @__PURE__ */ h.jsx(Zi, {});
|
1093
|
-
},
|
1092
|
+
}, yn = "data-validation.list.dropdown", Oo = "data-validation.date.dropdown", At = {
|
1094
1093
|
type: Je.COMMAND,
|
1095
1094
|
id: "data-validation.command.addRuleAndOpen",
|
1096
1095
|
handler(e) {
|
1097
|
-
const t = e.get(ge), o =
|
1096
|
+
const t = e.get(ge), o = eo(t);
|
1098
1097
|
if (!o) return !1;
|
1099
|
-
const { workbook: n, worksheet: a } = o, i =
|
1098
|
+
const { workbook: n, worksheet: a } = o, i = lo(e), r = e.get(Q), l = n.getUnitId(), s = a.getSheetId(), c = {
|
1100
1099
|
rule: i,
|
1101
1100
|
unitId: l,
|
1102
1101
|
subUnitId: s
|
1103
1102
|
};
|
1104
|
-
return r.syncExecuteCommand(
|
1103
|
+
return r.syncExecuteCommand(_n.id, c) ? (r.syncExecuteCommand(Ue.id, {
|
1105
1104
|
ruleId: i.uid,
|
1106
1105
|
isAdd: !0
|
1107
1106
|
}), !0) : !1;
|
@@ -1111,7 +1110,7 @@ var Qi = Object.defineProperty, er = Object.getOwnPropertyDescriptor, tr = (e, t
|
|
1111
1110
|
for (var a = n > 1 ? void 0 : n ? er(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1112
1111
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1113
1112
|
return n && a && Qi(t, o, a), a;
|
1114
|
-
},
|
1113
|
+
}, $e = (e, t) => (o, n) => t(o, n, e);
|
1115
1114
|
const Ee = "SHEET_DATA_VALIDATION_ALERT";
|
1116
1115
|
let lt = class extends De {
|
1117
1116
|
constructor(e, t, o, n, a, i) {
|
@@ -1121,7 +1120,7 @@ let lt = class extends De {
|
|
1121
1120
|
this._initCellAlertPopup(), this._initZenService();
|
1122
1121
|
}
|
1123
1122
|
_initCellAlertPopup() {
|
1124
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1123
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(wn(100)).subscribe((e) => {
|
1125
1124
|
var t;
|
1126
1125
|
if (e) {
|
1127
1126
|
const o = this._univerInstanceService.getUnit(e.location.unitId, Y.UNIVER_SHEET), n = o.getSheetBySheetId(e.location.subUnitId);
|
@@ -1164,12 +1163,12 @@ let lt = class extends De {
|
|
1164
1163
|
}
|
1165
1164
|
};
|
1166
1165
|
lt = tr([
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1166
|
+
$e(0, b(ba)),
|
1167
|
+
$e(1, b(Ea)),
|
1168
|
+
$e(2, ge),
|
1169
|
+
$e(3, b(J)),
|
1170
|
+
$e(4, go),
|
1171
|
+
$e(5, b(oe))
|
1173
1172
|
], lt);
|
1174
1173
|
var nr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, ar = (e, t, o, n) => {
|
1175
1174
|
for (var a = n > 1 ? void 0 : n ? or(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
@@ -1183,21 +1182,21 @@ let ze = class extends De {
|
|
1183
1182
|
// eslint-disable-next-line max-lines-per-function
|
1184
1183
|
_initAutoFill() {
|
1185
1184
|
const e = () => ({ redos: [], undos: [] }), t = (n, a) => {
|
1186
|
-
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = rn([i, r]), [p, d] = u.ranges, { mapFunc:
|
1185
|
+
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = rn([i, r]), [p, d] = u.ranges, { mapFunc: g } = u, f = {
|
1187
1186
|
row: p.startRow,
|
1188
1187
|
col: p.startColumn
|
1189
|
-
},
|
1190
|
-
|
1191
|
-
const
|
1188
|
+
}, C = Pa(p, d), R = new _t(), v = /* @__PURE__ */ new Set();
|
1189
|
+
C.forEach((S) => {
|
1190
|
+
const m = S.repeatStartCell, y = S.relativeRange, P = {
|
1191
|
+
startRow: f.row,
|
1192
|
+
startColumn: f.col,
|
1193
|
+
endColumn: f.col,
|
1194
|
+
endRow: f.row
|
1195
|
+
}, F = {
|
1192
1196
|
startRow: m.row,
|
1193
1197
|
startColumn: m.col,
|
1194
1198
|
endColumn: m.col,
|
1195
1199
|
endRow: m.row
|
1196
|
-
}, U = {
|
1197
|
-
startRow: v.row,
|
1198
|
-
startColumn: v.col,
|
1199
|
-
endColumn: v.col,
|
1200
|
-
endRow: v.row
|
1201
1200
|
};
|
1202
1201
|
Qo.foreach(y, (T, E) => {
|
1203
1202
|
const A = St.getPositionRange(
|
@@ -1208,27 +1207,27 @@ let ze = class extends De {
|
|
1208
1207
|
endRow: T
|
1209
1208
|
},
|
1210
1209
|
P
|
1211
|
-
), { row: x, col: j } =
|
1210
|
+
), { row: x, col: j } = g(A.startRow, A.startColumn), N = this._sheetDataValidationModel.getRuleIdByLocation(l, s, x, j) || "", H = St.getPositionRange(
|
1212
1211
|
{
|
1213
1212
|
startRow: T,
|
1214
1213
|
startColumn: E,
|
1215
1214
|
endColumn: E,
|
1216
1215
|
endRow: T
|
1217
1216
|
},
|
1218
|
-
|
1219
|
-
), { row: X, col: k } =
|
1220
|
-
|
1217
|
+
F
|
1218
|
+
), { row: X, col: k } = g(H.startRow, H.startColumn);
|
1219
|
+
R.setValue(X, k, N), v.add(N);
|
1221
1220
|
});
|
1222
1221
|
});
|
1223
|
-
const
|
1224
|
-
c.addRangeRules(
|
1225
|
-
const I = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: V, undoMutations:
|
1222
|
+
const w = Array.from(v).map((S) => ({ id: S, ranges: Qt(R, (m) => m === S) }));
|
1223
|
+
c.addRangeRules(w);
|
1224
|
+
const I = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: V, undoMutations: _ } = an(l, s, I, this._injector, "patched", a === tt.ONLY_FORMAT);
|
1226
1225
|
return {
|
1227
|
-
undos:
|
1226
|
+
undos: _,
|
1228
1227
|
redos: V
|
1229
1228
|
};
|
1230
1229
|
}, o = {
|
1231
|
-
id:
|
1230
|
+
id: co,
|
1232
1231
|
onBeforeFillData: (n) => {
|
1233
1232
|
const { source: a, unitId: i, subUnitId: r } = n;
|
1234
1233
|
for (const l of a.rows)
|
@@ -1250,7 +1249,7 @@ let ze = class extends De {
|
|
1250
1249
|
ze = ar([
|
1251
1250
|
Bt(0, La),
|
1252
1251
|
Bt(1, b(oe)),
|
1253
|
-
Bt(2, b(
|
1252
|
+
Bt(2, b(Fe))
|
1254
1253
|
], ze);
|
1255
1254
|
var ir = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, sr = (e, t, o, n) => {
|
1256
1255
|
for (var a = n > 1 ? void 0 : n ? rr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
@@ -1265,10 +1264,10 @@ let Ke = class extends De {
|
|
1265
1264
|
}
|
1266
1265
|
_initCopyPaste() {
|
1267
1266
|
this._sheetClipboardService.addClipboardHook({
|
1268
|
-
id:
|
1267
|
+
id: co,
|
1269
1268
|
onBeforeCopy: (t, o, n) => this._collect(t, o, n),
|
1270
1269
|
onPasteCells: (t, o, n, a) => {
|
1271
|
-
const { copyType: i =
|
1270
|
+
const { copyType: i = Pn.COPY, pasteType: r } = a, { range: l } = t || {}, { range: s, unitId: c, subUnitId: u } = o;
|
1272
1271
|
return this._generateMutations(s, { copyType: i, pasteType: r, copyRange: l, unitId: c, subUnitId: u });
|
1273
1272
|
}
|
1274
1273
|
});
|
@@ -1295,7 +1294,7 @@ let Ke = class extends De {
|
|
1295
1294
|
_generateMutations(t, o) {
|
1296
1295
|
if (!this._copyInfo)
|
1297
1296
|
return { redos: [], undos: [] };
|
1298
|
-
if (o.copyType ===
|
1297
|
+
if (o.copyType === Pn.CUT)
|
1299
1298
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1300
1299
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
|
1301
1300
|
return { redos: [], undos: [] };
|
@@ -1304,74 +1303,72 @@ let Ke = class extends De {
|
|
1304
1303
|
dt.SPECIAL_PASTE_VALUE,
|
1305
1304
|
dt.SPECIAL_PASTE_FORMAT,
|
1306
1305
|
dt.SPECIAL_PASTE_FORMULA
|
1307
|
-
].includes(
|
1308
|
-
o.pasteType
|
1309
|
-
))
|
1306
|
+
].includes(o.pasteType))
|
1310
1307
|
return { redos: [], undos: [] };
|
1311
|
-
const { unitId:
|
1312
|
-
if (o.unitId !==
|
1313
|
-
const
|
1314
|
-
|
1315
|
-
var
|
1316
|
-
(
|
1317
|
-
const
|
1308
|
+
const { unitId: a, subUnitId: i } = this._copyInfo;
|
1309
|
+
if (o.unitId !== a || i !== o.subUnitId) {
|
1310
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), l = new _t(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: p } = rn([o.copyRange, t]), d = Tn(c, u, !0), g = /* @__PURE__ */ new Map();
|
1311
|
+
d.forEach(({ startRange: v }) => {
|
1312
|
+
var w;
|
1313
|
+
(w = this._copyInfo) == null || w.matrix.forValue((I, V, _) => {
|
1314
|
+
const S = St.getPositionRange(
|
1318
1315
|
{
|
1319
|
-
startRow:
|
1320
|
-
endRow:
|
1321
|
-
startColumn:
|
1322
|
-
endColumn:
|
1316
|
+
startRow: I,
|
1317
|
+
endRow: I,
|
1318
|
+
startColumn: V,
|
1319
|
+
endColumn: V
|
1323
1320
|
},
|
1324
|
-
|
1325
|
-
),
|
1326
|
-
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId,
|
1327
|
-
const { row:
|
1328
|
-
|
1321
|
+
v
|
1322
|
+
), m = `${i}-${_}`, y = this._sheetDataValidationModel.getRuleById(a, i, _);
|
1323
|
+
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, m) && y && g.set(m, { ...y, uid: m });
|
1324
|
+
const { row: P, col: F } = p(S.startRow, S.startColumn);
|
1325
|
+
s.add(m), l.setValue(P, F, m);
|
1329
1326
|
});
|
1330
1327
|
});
|
1331
|
-
const f = Array.from(
|
1332
|
-
|
1333
|
-
const { redoMutations:
|
1328
|
+
const f = Array.from(s).map((v) => ({ id: v, ranges: Qt(l, (w) => w === v) }));
|
1329
|
+
r.addRangeRules(f);
|
1330
|
+
const { redoMutations: C, undoMutations: R } = an(
|
1334
1331
|
o.unitId,
|
1335
1332
|
o.subUnitId,
|
1336
|
-
|
1333
|
+
r.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), g.values()),
|
1337
1334
|
this._injector,
|
1338
1335
|
"patched",
|
1339
1336
|
!1
|
1340
1337
|
);
|
1341
1338
|
return {
|
1342
|
-
redos:
|
1343
|
-
undos:
|
1339
|
+
redos: C,
|
1340
|
+
undos: R
|
1344
1341
|
};
|
1345
1342
|
} else {
|
1346
|
-
const
|
1347
|
-
|
1348
|
-
var
|
1349
|
-
(
|
1350
|
-
const
|
1343
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), l = new _t(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: p } = rn([o.copyRange, t]);
|
1344
|
+
Tn(c, u, !0).forEach(({ startRange: R }) => {
|
1345
|
+
var v;
|
1346
|
+
(v = this._copyInfo) == null || v.matrix.forValue((w, I, V) => {
|
1347
|
+
const _ = St.getPositionRange(
|
1351
1348
|
{
|
1352
|
-
startRow:
|
1353
|
-
endRow:
|
1354
|
-
startColumn:
|
1355
|
-
endColumn:
|
1349
|
+
startRow: w,
|
1350
|
+
endRow: w,
|
1351
|
+
startColumn: I,
|
1352
|
+
endColumn: I
|
1356
1353
|
},
|
1357
|
-
|
1358
|
-
), { row:
|
1359
|
-
|
1354
|
+
R
|
1355
|
+
), { row: S, col: m } = p(_.startRow, _.startColumn);
|
1356
|
+
l.setValue(S, m, V), s.add(V);
|
1360
1357
|
});
|
1361
1358
|
});
|
1362
|
-
const
|
1363
|
-
|
1364
|
-
const { redoMutations: f, undoMutations:
|
1365
|
-
n,
|
1359
|
+
const g = Array.from(s).map((R) => ({ id: R, ranges: Qt(l, (v) => v === R) }));
|
1360
|
+
r.addRangeRules(g);
|
1361
|
+
const { redoMutations: f, undoMutations: C } = an(
|
1366
1362
|
a,
|
1367
|
-
i
|
1363
|
+
i,
|
1364
|
+
r.diff(this._sheetDataValidationModel.getRules(a, i)),
|
1368
1365
|
this._injector,
|
1369
1366
|
"patched",
|
1370
1367
|
!1
|
1371
1368
|
);
|
1372
1369
|
return {
|
1373
1370
|
redos: f,
|
1374
|
-
undos:
|
1371
|
+
undos: C
|
1375
1372
|
};
|
1376
1373
|
}
|
1377
1374
|
}
|
@@ -1379,7 +1376,7 @@ let Ke = class extends De {
|
|
1379
1376
|
Ke = sr([
|
1380
1377
|
$t(0, Aa),
|
1381
1378
|
$t(1, b(oe)),
|
1382
|
-
$t(2, b(
|
1379
|
+
$t(2, b(Fe))
|
1383
1380
|
], Ke);
|
1384
1381
|
var lr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, cr = (e, t, o, n) => {
|
1385
1382
|
for (var a = n > 1 ? void 0 : n ? dr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
@@ -1388,20 +1385,20 @@ var lr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, cr = (e, t
|
|
1388
1385
|
}, kt = (e, t) => (o, n) => t(o, n, e);
|
1389
1386
|
let Ge = class extends De {
|
1390
1387
|
constructor(e, t, o) {
|
1391
|
-
super(), this._localeService = e, this._commandService = t, this.
|
1388
|
+
super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = o, this._commandExecutedListener();
|
1392
1389
|
}
|
1393
1390
|
_commandExecutedListener() {
|
1394
1391
|
this.disposeWithMe(
|
1395
1392
|
this._commandService.beforeCommandExecuted((e) => {
|
1396
|
-
e.id ===
|
1393
|
+
e.id === _n.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1397
1394
|
workbookTypes: [Ct],
|
1398
1395
|
rangeTypes: [It],
|
1399
1396
|
worksheetTypes: [wt, on]
|
1400
|
-
}) || this.
|
1397
|
+
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === ro.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1401
1398
|
workbookTypes: [Ct],
|
1402
1399
|
rangeTypes: [It],
|
1403
1400
|
worksheetTypes: [wt, on]
|
1404
|
-
}, e.params.ranges) || this.
|
1401
|
+
}, e.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
1405
1402
|
})
|
1406
1403
|
);
|
1407
1404
|
}
|
@@ -1409,13 +1406,13 @@ let Ge = class extends De {
|
|
1409
1406
|
Ge = cr([
|
1410
1407
|
kt(0, b(J)),
|
1411
1408
|
kt(1, Q),
|
1412
|
-
kt(2, b(
|
1409
|
+
kt(2, b(to))
|
1413
1410
|
], Ge);
|
1414
1411
|
const Lo = "data-validation-single", Po = "sheet.menu.data-validation";
|
1415
1412
|
function ur(e) {
|
1416
1413
|
return {
|
1417
1414
|
id: Po,
|
1418
|
-
type:
|
1415
|
+
type: Cn.SUBITEMS,
|
1419
1416
|
icon: Lo,
|
1420
1417
|
tooltip: "dataValidation.title",
|
1421
1418
|
hidden$: Na(e, Y.UNIVER_SHEET),
|
@@ -1424,24 +1421,24 @@ function ur(e) {
|
|
1424
1421
|
}
|
1425
1422
|
function hr(e) {
|
1426
1423
|
return {
|
1427
|
-
id:
|
1424
|
+
id: Ue.id,
|
1428
1425
|
title: "dataValidation.panel.title",
|
1429
|
-
type:
|
1426
|
+
type: Cn.BUTTON
|
1430
1427
|
};
|
1431
1428
|
}
|
1432
1429
|
function pr(e) {
|
1433
1430
|
return {
|
1434
1431
|
id: At.id,
|
1435
1432
|
title: "dataValidation.panel.add",
|
1436
|
-
type:
|
1433
|
+
type: Cn.BUTTON
|
1437
1434
|
};
|
1438
1435
|
}
|
1439
|
-
const
|
1436
|
+
const fr = {
|
1440
1437
|
[Ua.FORMULAS_INSERT]: {
|
1441
1438
|
[Po]: {
|
1442
1439
|
order: 9,
|
1443
1440
|
menuItemFactory: ur,
|
1444
|
-
[
|
1441
|
+
[Ue.id]: {
|
1445
1442
|
order: 0,
|
1446
1443
|
menuItemFactory: hr
|
1447
1444
|
},
|
@@ -1452,10 +1449,10 @@ const mr = {
|
|
1452
1449
|
}
|
1453
1450
|
}
|
1454
1451
|
};
|
1455
|
-
var
|
1452
|
+
var mr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, To = (e, t, o, n) => {
|
1456
1453
|
for (var a = n > 1 ? void 0 : n ? gr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1457
1454
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1458
|
-
return n && a &&
|
1455
|
+
return n && a && mr(t, o, a), a;
|
1459
1456
|
}, G = (e, t) => (o, n) => t(o, n, e);
|
1460
1457
|
const Ao = {
|
1461
1458
|
tr: {
|
@@ -1463,12 +1460,12 @@ const Ao = {
|
|
1463
1460
|
color: "#fe4b4b"
|
1464
1461
|
}
|
1465
1462
|
};
|
1466
|
-
let Ze = class extends
|
1463
|
+
let Ze = class extends fn {
|
1467
1464
|
constructor(e, t, o, n, a, i, r, l, s, c, u) {
|
1468
1465
|
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();
|
1469
1466
|
}
|
1470
1467
|
_initMenu() {
|
1471
|
-
this._menuManagerService.mergeMenu(
|
1468
|
+
this._menuManagerService.mergeMenu(fr);
|
1472
1469
|
}
|
1473
1470
|
_initDropdown() {
|
1474
1471
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
|
@@ -1517,31 +1514,31 @@ let Ze = class extends pn {
|
|
1517
1514
|
_initViewModelIntercept() {
|
1518
1515
|
this.disposeWithMe(
|
1519
1516
|
this._sheetInterceptorService.intercept(
|
1520
|
-
|
1517
|
+
no.CELL_CONTENT,
|
1521
1518
|
{
|
1522
|
-
effect:
|
1519
|
+
effect: Kn.Style,
|
1523
1520
|
// must be after numfmt
|
1524
|
-
priority:
|
1521
|
+
priority: oo.DATA_VALIDATION,
|
1525
1522
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1526
1523
|
handler: (e, t, o) => {
|
1527
|
-
var
|
1524
|
+
var v, w, I, V, _;
|
1528
1525
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1529
1526
|
if (!c)
|
1530
1527
|
return o(e);
|
1531
1528
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1532
1529
|
if (!u)
|
1533
1530
|
return o(e);
|
1534
|
-
const p = (
|
1535
|
-
let
|
1536
|
-
const
|
1531
|
+
const p = (v = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? v : rt.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), g = t.rawData;
|
1532
|
+
let f;
|
1533
|
+
const C = {
|
1537
1534
|
get value() {
|
1538
|
-
var
|
1539
|
-
return
|
1535
|
+
var S;
|
1536
|
+
return f !== void 0 || (f = (S = ie(g)) != null ? S : null), f;
|
1540
1537
|
}
|
1541
|
-
},
|
1538
|
+
}, R = {
|
1542
1539
|
get value() {
|
1543
|
-
var
|
1544
|
-
return `${(
|
1540
|
+
var S;
|
1541
|
+
return `${(S = C.value) != null ? S : ""}`;
|
1545
1542
|
}
|
1546
1543
|
};
|
1547
1544
|
return o({
|
@@ -1551,31 +1548,31 @@ let Ze = class extends pn {
|
|
1551
1548
|
...p === rt.INVALID ? Ao : null
|
1552
1549
|
},
|
1553
1550
|
customRender: [
|
1554
|
-
...(
|
1551
|
+
...(w = e == null ? void 0 : e.customRender) != null ? w : [],
|
1555
1552
|
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1556
1553
|
],
|
1557
1554
|
fontRenderExtension: {
|
1558
1555
|
...e == null ? void 0 : e.fontRenderExtension,
|
1559
|
-
isSkip: ((I = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : I.isSkip) || ((V = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : V.call(d, u,
|
1556
|
+
isSkip: ((I = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : I.isSkip) || ((V = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : V.call(d, u, C.value, t))
|
1560
1557
|
},
|
1561
1558
|
interceptorStyle: {
|
1562
1559
|
...e == null ? void 0 : e.interceptorStyle,
|
1563
|
-
...d == null ? void 0 : d.getExtraStyle(u,
|
1560
|
+
...d == null ? void 0 : d.getExtraStyle(u, R.value, {
|
1564
1561
|
get style() {
|
1565
|
-
const
|
1566
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
1562
|
+
const S = l.getStyles();
|
1563
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? S.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
1567
1564
|
}
|
1568
1565
|
}, n, a)
|
1569
1566
|
},
|
1570
1567
|
interceptorAutoHeight: () => {
|
1571
|
-
var P,
|
1572
|
-
const
|
1573
|
-
if (!
|
1568
|
+
var P, F, T, E, A, x;
|
1569
|
+
const S = (F = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(Rt).getWorksheetSkeleton(r)) == null ? void 0 : F.skeleton;
|
1570
|
+
if (!S)
|
1574
1571
|
return;
|
1575
|
-
const
|
1572
|
+
const m = S.worksheet.getMergedCell(n, a), y = {
|
1576
1573
|
data: e,
|
1577
|
-
style:
|
1578
|
-
primaryWithCoord:
|
1574
|
+
style: S.getsStyles().getStyleByCell(e),
|
1575
|
+
primaryWithCoord: S.getCellWithCoordByIndex((T = m == null ? void 0 : m.startRow) != null ? T : n, (E = m == null ? void 0 : m.startColumn) != null ? E : a),
|
1579
1576
|
unitId: i,
|
1580
1577
|
subUnitId: r,
|
1581
1578
|
row: n,
|
@@ -1586,14 +1583,14 @@ let Ze = class extends pn {
|
|
1586
1583
|
return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : x.call(A, y);
|
1587
1584
|
},
|
1588
1585
|
interceptorAutoWidth: () => {
|
1589
|
-
var P,
|
1590
|
-
const
|
1591
|
-
if (!
|
1586
|
+
var P, F, T, E, A, x;
|
1587
|
+
const S = (F = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(Rt).getWorksheetSkeleton(r)) == null ? void 0 : F.skeleton;
|
1588
|
+
if (!S)
|
1592
1589
|
return;
|
1593
|
-
const
|
1590
|
+
const m = S.worksheet.getMergedCell(n, a), y = {
|
1594
1591
|
data: e,
|
1595
|
-
style:
|
1596
|
-
primaryWithCoord:
|
1592
|
+
style: S.getsStyles().getStyleByCell(e),
|
1593
|
+
primaryWithCoord: S.getCellWithCoordByIndex((T = m == null ? void 0 : m.startRow) != null ? T : n, (E = m == null ? void 0 : m.startColumn) != null ? E : a),
|
1597
1594
|
unitId: i,
|
1598
1595
|
subUnitId: r,
|
1599
1596
|
row: n,
|
@@ -1603,7 +1600,7 @@ let Ze = class extends pn {
|
|
1603
1600
|
};
|
1604
1601
|
return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoWidth) == null ? void 0 : x.call(A, y);
|
1605
1602
|
},
|
1606
|
-
coverable: ((
|
1603
|
+
coverable: ((_ = e == null ? void 0 : e.coverable) != null ? _ : !0) && !(u.type === z.LIST || u.type === z.LIST_MULTIPLE)
|
1607
1604
|
});
|
1608
1605
|
}
|
1609
1606
|
}
|
@@ -1614,7 +1611,7 @@ let Ze = class extends pn {
|
|
1614
1611
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1615
1612
|
// patched data-validation change don't need to re-calc row height
|
1616
1613
|
// re-calc of row height will be triggered precisely by the origin command
|
1617
|
-
|
1614
|
+
In((e) => e.source === "command"),
|
1618
1615
|
vo(100)
|
1619
1616
|
).subscribe((e) => {
|
1620
1617
|
if (e.length === 0)
|
@@ -1625,7 +1622,7 @@ let Ze = class extends pn {
|
|
1625
1622
|
(o.rule.type === z.LIST_MULTIPLE || o.rule.type === z.LIST) && (n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1626
1623
|
}), t.length) {
|
1627
1624
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1628
|
-
|
1625
|
+
Gn(o.redos, this._commandService);
|
1629
1626
|
}
|
1630
1627
|
});
|
1631
1628
|
}
|
@@ -1635,36 +1632,36 @@ Ze = To([
|
|
1635
1632
|
G(1, Ba),
|
1636
1633
|
G(2, Ve),
|
1637
1634
|
G(3, ge),
|
1638
|
-
G(4, b(
|
1635
|
+
G(4, b(fo)),
|
1639
1636
|
G(5, b(Ie)),
|
1640
1637
|
G(6, b(oe)),
|
1641
1638
|
G(7, b(ye)),
|
1642
|
-
G(8, b(
|
1643
|
-
G(9, b(
|
1644
|
-
G(10, ea(
|
1639
|
+
G(8, b(gn)),
|
1640
|
+
G(9, b(uo)),
|
1641
|
+
G(10, ea(po))
|
1645
1642
|
], Ze);
|
1646
|
-
let
|
1643
|
+
let $n = class extends fn {
|
1647
1644
|
constructor(e, t, o, n, a, i, r) {
|
1648
1645
|
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();
|
1649
1646
|
}
|
1650
1647
|
_initViewModelIntercept() {
|
1651
1648
|
this.disposeWithMe(
|
1652
1649
|
this._sheetInterceptorService.intercept(
|
1653
|
-
|
1650
|
+
no.CELL_CONTENT,
|
1654
1651
|
{
|
1655
|
-
effect:
|
1652
|
+
effect: Kn.Style,
|
1656
1653
|
// must be after numfmt
|
1657
|
-
priority:
|
1654
|
+
priority: oo.DATA_VALIDATION,
|
1658
1655
|
// eslint-disable-next-line complexity
|
1659
1656
|
handler: (e, t, o) => {
|
1660
|
-
var
|
1657
|
+
var R, v, w, I, V;
|
1661
1658
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1662
1659
|
if (!c)
|
1663
1660
|
return o(e);
|
1664
1661
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1665
1662
|
if (!u)
|
1666
1663
|
return o(e);
|
1667
|
-
const p = (
|
1664
|
+
const p = (R = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? R : rt.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), g = s.getCellRaw(n, a), f = ie(g), C = `${f != null ? f : ""}`;
|
1668
1665
|
return o({
|
1669
1666
|
...e,
|
1670
1667
|
markers: {
|
@@ -1672,31 +1669,31 @@ let Bn = class extends pn {
|
|
1672
1669
|
...p === rt.INVALID ? Ao : null
|
1673
1670
|
},
|
1674
1671
|
customRender: [
|
1675
|
-
...(
|
1672
|
+
...(v = e == null ? void 0 : e.customRender) != null ? v : [],
|
1676
1673
|
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1677
1674
|
],
|
1678
1675
|
fontRenderExtension: {
|
1679
1676
|
...e == null ? void 0 : e.fontRenderExtension,
|
1680
|
-
isSkip: ((
|
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, f, t))
|
1681
1678
|
},
|
1682
1679
|
interceptorStyle: {
|
1683
1680
|
...e == null ? void 0 : e.interceptorStyle,
|
1684
|
-
...d == null ? void 0 : d.getExtraStyle(u,
|
1681
|
+
...d == null ? void 0 : d.getExtraStyle(u, C, {
|
1685
1682
|
get style() {
|
1686
|
-
const
|
1687
|
-
return (typeof (e == null ? void 0 : e.s) == "string" ?
|
1683
|
+
const _ = l.getStyles();
|
1684
|
+
return (typeof (e == null ? void 0 : e.s) == "string" ? _.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
1688
1685
|
}
|
1689
1686
|
}, n, a)
|
1690
1687
|
},
|
1691
1688
|
interceptorAutoHeight: () => {
|
1692
|
-
var y, P,
|
1693
|
-
const
|
1694
|
-
if (!
|
1689
|
+
var y, P, F, T, E, A;
|
1690
|
+
const _ = (P = (y = this._renderManagerService.getRenderById(i)) == null ? void 0 : y.with(Rt).getWorksheetSkeleton(r)) == null ? void 0 : P.skeleton;
|
1691
|
+
if (!_)
|
1695
1692
|
return;
|
1696
|
-
const
|
1693
|
+
const S = _.worksheet.getMergedCell(n, a), m = {
|
1697
1694
|
data: e,
|
1698
|
-
style:
|
1699
|
-
primaryWithCoord:
|
1695
|
+
style: _.getsStyles().getStyleByCell(e),
|
1696
|
+
primaryWithCoord: _.getCellWithCoordByIndex((F = S == null ? void 0 : S.startRow) != null ? F : n, (T = S == null ? void 0 : S.startColumn) != null ? T : a),
|
1700
1697
|
unitId: i,
|
1701
1698
|
subUnitId: r,
|
1702
1699
|
row: n,
|
@@ -1704,7 +1701,7 @@ let Bn = class extends pn {
|
|
1704
1701
|
workbook: l,
|
1705
1702
|
worksheet: s
|
1706
1703
|
};
|
1707
|
-
return (A = (E = d == null ? void 0 : d.canvasRender) == null ? void 0 : E.calcCellAutoHeight) == null ? void 0 : A.call(E,
|
1704
|
+
return (A = (E = d == null ? void 0 : d.canvasRender) == null ? void 0 : E.calcCellAutoHeight) == null ? void 0 : A.call(E, m);
|
1708
1705
|
},
|
1709
1706
|
coverable: ((V = e == null ? void 0 : e.coverable) != null ? V : !0) && !(u.type === z.LIST || u.type === z.LIST_MULTIPLE)
|
1710
1707
|
});
|
@@ -1715,7 +1712,7 @@ let Bn = class extends pn {
|
|
1715
1712
|
}
|
1716
1713
|
_initAutoHeight() {
|
1717
1714
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1718
|
-
|
1715
|
+
In((e) => e.source === "command"),
|
1719
1716
|
vo(16)
|
1720
1717
|
).subscribe((e) => {
|
1721
1718
|
const t = [];
|
@@ -1724,25 +1721,25 @@ let Bn = class extends pn {
|
|
1724
1721
|
(n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1725
1722
|
}), t.length) {
|
1726
1723
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1727
|
-
|
1724
|
+
Gn(o.redos, this._commandService);
|
1728
1725
|
}
|
1729
1726
|
});
|
1730
1727
|
}
|
1731
1728
|
};
|
1732
|
-
|
1729
|
+
$n = To([
|
1733
1730
|
G(0, Q),
|
1734
1731
|
G(1, Ve),
|
1735
|
-
G(2, b(
|
1732
|
+
G(2, b(fo)),
|
1736
1733
|
G(3, b(ye)),
|
1737
|
-
G(4, b(
|
1734
|
+
G(4, b(gn)),
|
1738
1735
|
G(5, b(oe)),
|
1739
|
-
G(6, b(
|
1740
|
-
],
|
1736
|
+
G(6, b(uo))
|
1737
|
+
], $n);
|
1741
1738
|
var vr = Object.defineProperty, _r = Object.getOwnPropertyDescriptor, Sr = (e, t, o, n) => {
|
1742
1739
|
for (var a = n > 1 ? void 0 : n ? _r(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1743
1740
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1744
1741
|
return n && a && vr(t, o, a), a;
|
1745
|
-
},
|
1742
|
+
}, kn = (e, t) => (o, n) => t(o, n, e);
|
1746
1743
|
let yt = class extends De {
|
1747
1744
|
constructor(e, t, o) {
|
1748
1745
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
@@ -1764,8 +1761,8 @@ let yt = class extends De {
|
|
1764
1761
|
}
|
1765
1762
|
};
|
1766
1763
|
yt = Sr([
|
1767
|
-
|
1768
|
-
|
1764
|
+
kn(1, b(oe)),
|
1765
|
+
kn(2, b(Rt))
|
1769
1766
|
], yt);
|
1770
1767
|
const Cr = "univer-data-validation-formula", Ir = "univer-data-validation-formula-and", wr = "univer-data-validation-formula-list-item", Rr = "univer-data-validation-formula-list-item-icon", Dr = "univer-data-validation-formula-list-item-drag", Vr = "univer-data-validation-formula-list-add", yr = "univer-data-validation-formula-color-select", Mr = "univer-data-validation-formula-color-select-panel", br = "univer-data-validation-formula-color-item", ne = {
|
1771
1768
|
dataValidationFormula: Cr,
|
@@ -1781,7 +1778,7 @@ const Cr = "univer-data-validation-formula", Ir = "univer-data-validation-formul
|
|
1781
1778
|
const { isTwoFormula: t = !1, value: o, onChange: n, showError: a, validResult: i } = e, r = L(J), l = a ? i == null ? void 0 : i.formula1 : "", s = a ? i == null ? void 0 : i.formula2 : "";
|
1782
1779
|
return t ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
1783
1780
|
/* @__PURE__ */ h.jsx(Z, { error: l, children: /* @__PURE__ */ h.jsx(
|
1784
|
-
|
1781
|
+
xe,
|
1785
1782
|
{
|
1786
1783
|
className: ne.dataValidationFormula,
|
1787
1784
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1796,7 +1793,7 @@ const Cr = "univer-data-validation-formula", Ir = "univer-data-validation-formul
|
|
1796
1793
|
) }),
|
1797
1794
|
/* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaAnd, children: r.t("dataValidation.panel.formulaAnd") }),
|
1798
1795
|
/* @__PURE__ */ h.jsx(Z, { error: s, children: /* @__PURE__ */ h.jsx(
|
1799
|
-
|
1796
|
+
xe,
|
1800
1797
|
{
|
1801
1798
|
className: ne.dataValidationFormula,
|
1802
1799
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1810,7 +1807,7 @@ const Cr = "univer-data-validation-formula", Ir = "univer-data-validation-formul
|
|
1810
1807
|
}
|
1811
1808
|
) })
|
1812
1809
|
] }) : /* @__PURE__ */ h.jsx(Z, { error: l, children: /* @__PURE__ */ h.jsx(
|
1813
|
-
|
1810
|
+
xe,
|
1814
1811
|
{
|
1815
1812
|
className: ne.dataValidationFormula,
|
1816
1813
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
@@ -1839,7 +1836,7 @@ function Or(e) {
|
|
1839
1836
|
}
|
1840
1837
|
) }),
|
1841
1838
|
s ? /* @__PURE__ */ h.jsx(Z, { label: i.t("dataValidation.checkbox.checked"), error: r, children: /* @__PURE__ */ h.jsx(
|
1842
|
-
|
1839
|
+
xe,
|
1843
1840
|
{
|
1844
1841
|
className: ne.dataValidationFormula,
|
1845
1842
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1853,7 +1850,7 @@ function Or(e) {
|
|
1853
1850
|
}
|
1854
1851
|
) }) : null,
|
1855
1852
|
s ? /* @__PURE__ */ h.jsx(Z, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ h.jsx(
|
1856
|
-
|
1853
|
+
xe,
|
1857
1854
|
{
|
1858
1855
|
className: ne.dataValidationFormula,
|
1859
1856
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
@@ -1870,23 +1867,23 @@ function Or(e) {
|
|
1870
1867
|
}
|
1871
1868
|
function Lr(e) {
|
1872
1869
|
var p;
|
1873
|
-
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 =
|
1874
|
-
return
|
1875
|
-
var
|
1876
|
-
const
|
1877
|
-
|
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 = We({}), [c, u] = W(!1);
|
1871
|
+
return Sn((d) => {
|
1872
|
+
var f;
|
1873
|
+
const g = (f = s.current) == null ? void 0 : f.handleOutClick;
|
1874
|
+
g && g(d, () => u(!1));
|
1878
1875
|
}), /* @__PURE__ */ h.jsx(
|
1879
1876
|
So,
|
1880
1877
|
{
|
1881
|
-
initValue: (p = n == null ? void 0 : n.formula1) != null ? p : "",
|
1878
|
+
initValue: (p = n == null ? void 0 : n.formula1) != null ? p : "=",
|
1882
1879
|
unitId: t,
|
1883
1880
|
subUnitId: o,
|
1884
1881
|
isFocus: c,
|
1885
1882
|
onChange: (d) => {
|
1886
|
-
const
|
1887
|
-
|
1883
|
+
const g = (d != null ? d : "").trim();
|
1884
|
+
g !== (n == null ? void 0 : n.formula1) && (a == null || a({
|
1888
1885
|
...n,
|
1889
|
-
formula1:
|
1886
|
+
formula1: g
|
1890
1887
|
}));
|
1891
1888
|
},
|
1892
1889
|
errorText: l,
|
@@ -1969,7 +1966,7 @@ const Tr = [
|
|
1969
1966
|
) })
|
1970
1967
|
}
|
1971
1968
|
);
|
1972
|
-
},
|
1969
|
+
}, Wn = (e) => {
|
1973
1970
|
const { item: t, commonProps: o, style: n } = e, { onItemChange: a, onItemDelete: i } = o;
|
1974
1971
|
return /* @__PURE__ */ h.jsxs("div", { className: ne.dataValidationFormulaListItem, style: n, children: [
|
1975
1972
|
t.isRef ? null : /* @__PURE__ */ h.jsx("div", { className: Pr(ne.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ h.jsx(yo, {}) }),
|
@@ -1983,7 +1980,7 @@ const Tr = [
|
|
1983
1980
|
}
|
1984
1981
|
),
|
1985
1982
|
/* @__PURE__ */ h.jsx(
|
1986
|
-
|
1983
|
+
xe,
|
1987
1984
|
{
|
1988
1985
|
disabled: t.isRef,
|
1989
1986
|
value: t.label,
|
@@ -1992,54 +1989,54 @@ const Tr = [
|
|
1992
1989
|
}
|
1993
1990
|
}
|
1994
1991
|
),
|
1995
|
-
t.isRef ? null : /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ h.jsx(
|
1992
|
+
t.isRef ? null : /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ h.jsx(Rn, { onClick: () => i(t.id) }) })
|
1996
1993
|
] });
|
1997
1994
|
};
|
1998
1995
|
function xr(e) {
|
1999
1996
|
const { value: t, onChange: o = () => {
|
2000
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u =
|
1997
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = We(null), [p, d] = W(() => Pe(s) ? "1" : "0"), [g, f] = W(p === "1" ? s : "="), [C, R] = W(p === "1" ? s : "="), v = L(J), w = L(ye), I = L(Pt), V = L(Ca), [_, S] = W(() => c.split(",")), m = w.getValidatorItem(z.LIST), [y, P] = W([]), [F, T] = W(""), E = r ? i == null ? void 0 : i.formula1 : "", A = He(() => I.ruleChange$.pipe(wn(16)), []), x = Ne(A), j = ln(o);
|
2001
1998
|
Ce(() => {
|
2002
1999
|
(async () => {
|
2003
2000
|
await new Promise((B) => {
|
2004
2001
|
setTimeout(() => B(!0), 100);
|
2005
2002
|
});
|
2006
|
-
const D = I.getRuleById(n, a, l),
|
2007
|
-
if (Pe(
|
2008
|
-
const B = await
|
2003
|
+
const D = I.getRuleById(n, a, l), U = D == null ? void 0 : D.formula1;
|
2004
|
+
if (Pe(U) && m && D) {
|
2005
|
+
const B = await m.getListAsync(D, n, a);
|
2009
2006
|
P(B);
|
2010
2007
|
}
|
2011
2008
|
})();
|
2012
|
-
}, [I, x,
|
2013
|
-
Pe(s) && s !==
|
2014
|
-
}, [
|
2015
|
-
const [
|
2016
|
-
const D = p !== "1" ?
|
2009
|
+
}, [I, x, m, l, a, n]), Ce(() => {
|
2010
|
+
Pe(s) && s !== C && (f(s), R(C));
|
2011
|
+
}, [C, s]);
|
2012
|
+
const [N, H] = W(() => {
|
2013
|
+
const D = p !== "1" ? ao(s) : [], U = c.split(",");
|
2017
2014
|
return D.map((B, $) => ({
|
2018
2015
|
label: B,
|
2019
|
-
color:
|
2016
|
+
color: U[$] || Te,
|
2020
2017
|
isRef: !1,
|
2021
2018
|
id: en.generateRandomId(4)
|
2022
2019
|
}));
|
2023
|
-
}), X = (D,
|
2024
|
-
const $ =
|
2025
|
-
$ && ($.label =
|
2020
|
+
}), X = (D, U, B) => {
|
2021
|
+
const $ = N.find((_e) => _e.id === D);
|
2022
|
+
$ && ($.label = U, $.color = B, H([...N]));
|
2026
2023
|
}, k = (D) => {
|
2027
|
-
const
|
2028
|
-
|
2029
|
-
}, K = c.split(","), q =
|
2024
|
+
const U = N.findIndex((B) => B.id === D);
|
2025
|
+
U !== -1 && (N.splice(U, 1), H([...N]));
|
2026
|
+
}, K = c.split(","), q = He(() => y.map((D, U) => ({
|
2030
2027
|
label: D,
|
2031
|
-
color: K[
|
2032
|
-
id: `${
|
2028
|
+
color: K[U] || Te,
|
2029
|
+
id: `${U}`,
|
2033
2030
|
isRef: !0
|
2034
|
-
})), [K, y]), ee = (D,
|
2035
|
-
const $ = [...
|
2036
|
-
$[+D] = B,
|
2031
|
+
})), [K, y]), ee = (D, U, B) => {
|
2032
|
+
const $ = [..._];
|
2033
|
+
$[+D] = B, S($), j({
|
2037
2034
|
formula1: s,
|
2038
2035
|
formula2: $.join(",")
|
2039
2036
|
});
|
2040
2037
|
}, te = () => {
|
2041
2038
|
H([
|
2042
|
-
...
|
2039
|
+
...N,
|
2043
2040
|
{
|
2044
2041
|
label: "",
|
2045
2042
|
color: Te,
|
@@ -2051,59 +2048,56 @@ function xr(e) {
|
|
2051
2048
|
Ce(() => {
|
2052
2049
|
if (p === "1")
|
2053
2050
|
return;
|
2054
|
-
const D = /* @__PURE__ */ new Set(),
|
2055
|
-
|
2051
|
+
const D = /* @__PURE__ */ new Set(), U = [];
|
2052
|
+
N.map((B) => ({
|
2056
2053
|
labelList: B.label.split(","),
|
2057
2054
|
item: B
|
2058
2055
|
})).forEach(({ item: B, labelList: $ }) => {
|
2059
2056
|
$.forEach((_e) => {
|
2060
|
-
D.has(_e) || (D.add(_e),
|
2057
|
+
D.has(_e) || (D.add(_e), U.push({
|
2061
2058
|
label: _e,
|
2062
2059
|
color: B.color
|
2063
2060
|
}));
|
2064
2061
|
});
|
2065
2062
|
}), j({
|
2066
|
-
formula1:
|
2067
|
-
formula2:
|
2063
|
+
formula1: io(U.map((B) => B.label)),
|
2064
|
+
formula2: U.map((B) => B.color === Te ? "" : B.color).join(",")
|
2068
2065
|
});
|
2069
|
-
}, [
|
2070
|
-
const re =
|
2071
|
-
|
2072
|
-
|
2073
|
-
j == null || j({
|
2074
|
-
formula1: "",
|
2075
|
-
formula2: c
|
2076
|
-
});
|
2077
|
-
return;
|
2078
|
-
}
|
2079
|
-
V.getFormulaRefCheck(D) ? (j == null || j({
|
2080
|
-
formula1: Pe(D) ? D : "",
|
2081
|
-
formula2: c
|
2082
|
-
}), T("")) : (j == null || j({
|
2066
|
+
}, [N, j, p, C, _]);
|
2067
|
+
const re = ln(async (D) => {
|
2068
|
+
if (!Pe(D)) {
|
2069
|
+
j == null || j({
|
2083
2070
|
formula1: "",
|
2084
2071
|
formula2: c
|
2085
|
-
})
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2072
|
+
});
|
2073
|
+
return;
|
2074
|
+
}
|
2075
|
+
V.getFormulaRefCheck(D) ? (j == null || j({
|
2076
|
+
formula1: Pe(D) ? D : "",
|
2077
|
+
formula2: c
|
2078
|
+
}), T("")) : (j == null || j({
|
2079
|
+
formula1: "",
|
2080
|
+
formula2: c
|
2081
|
+
}), f("="), T(v.t("dataValidation.validFail.formulaError")));
|
2082
|
+
}), ae = We({}), [se, O] = W(!1);
|
2083
|
+
return Sn((D) => {
|
2090
2084
|
var B;
|
2091
|
-
const
|
2092
|
-
|
2085
|
+
const U = (B = ae.current) == null ? void 0 : B.handleOutClick;
|
2086
|
+
U && U(D, () => O(!1));
|
2093
2087
|
}), /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
2094
|
-
/* @__PURE__ */ h.jsx(Z, { label:
|
2088
|
+
/* @__PURE__ */ h.jsx(Z, { label: v.t("dataValidation.list.options"), children: /* @__PURE__ */ h.jsxs(
|
2095
2089
|
mn,
|
2096
2090
|
{
|
2097
2091
|
value: p,
|
2098
2092
|
onChange: (D) => {
|
2099
|
-
d(D),
|
2100
|
-
formula1:
|
2101
|
-
formula2:
|
2093
|
+
d(D), f(C), D === "1" && j({
|
2094
|
+
formula1: C === "=" ? "" : C,
|
2095
|
+
formula2: _.join(",")
|
2102
2096
|
});
|
2103
2097
|
},
|
2104
2098
|
children: [
|
2105
|
-
/* @__PURE__ */ h.jsx(
|
2106
|
-
/* @__PURE__ */ h.jsx(
|
2099
|
+
/* @__PURE__ */ h.jsx(Ae, { value: "0", children: v.t("dataValidation.list.customOptions") }),
|
2100
|
+
/* @__PURE__ */ h.jsx(Ae, { value: "1", children: v.t("dataValidation.list.refOptions") })
|
2107
2101
|
]
|
2108
2102
|
}
|
2109
2103
|
) }),
|
@@ -2111,32 +2105,32 @@ function xr(e) {
|
|
2111
2105
|
/* @__PURE__ */ h.jsx(
|
2112
2106
|
So,
|
2113
2107
|
{
|
2114
|
-
initValue:
|
2108
|
+
initValue: g,
|
2115
2109
|
unitId: n,
|
2116
2110
|
subUnitId: a,
|
2117
2111
|
isFocus: se,
|
2118
2112
|
onChange: (D = "") => {
|
2119
|
-
const
|
2120
|
-
|
2113
|
+
const U = (D != null ? D : "").trim();
|
2114
|
+
R(U), re(U);
|
2121
2115
|
},
|
2122
|
-
errorText: E ||
|
2116
|
+
errorText: E || F || void 0,
|
2123
2117
|
onFocus: () => O(!0),
|
2124
2118
|
actions: ae.current,
|
2125
2119
|
isSupportAcrossSheet: !0
|
2126
2120
|
}
|
2127
2121
|
),
|
2128
|
-
/* @__PURE__ */ h.jsx("div", { ref: u, style: { marginTop: "12px" }, children: q.map((D) => /* @__PURE__ */ h.jsx(
|
2122
|
+
/* @__PURE__ */ h.jsx("div", { ref: u, style: { marginTop: "12px" }, children: q.map((D) => /* @__PURE__ */ h.jsx(Wn, { item: D, commonProps: { onItemChange: ee }, style: { marginBottom: 12 } }, D.id)) })
|
2129
2123
|
] }) : /* @__PURE__ */ h.jsx(Z, { error: E, children: /* @__PURE__ */ h.jsxs("div", { ref: u, style: { marginTop: "-12px" }, children: [
|
2130
2124
|
/* @__PURE__ */ h.jsx(
|
2131
2125
|
sa,
|
2132
2126
|
{
|
2133
|
-
list:
|
2127
|
+
list: N,
|
2134
2128
|
onListChange: H,
|
2135
2129
|
rowHeight: 32,
|
2136
2130
|
margin: [0, 12],
|
2137
2131
|
draggableHandle: ".draggableHandle",
|
2138
2132
|
itemRender: (D) => /* @__PURE__ */ h.jsx(
|
2139
|
-
|
2133
|
+
Wn,
|
2140
2134
|
{
|
2141
2135
|
item: D,
|
2142
2136
|
commonProps: {
|
@@ -2151,12 +2145,12 @@ function xr(e) {
|
|
2151
2145
|
),
|
2152
2146
|
/* @__PURE__ */ h.jsxs("a", { className: ne.dataValidationFormulaListAdd, onClick: te, children: [
|
2153
2147
|
/* @__PURE__ */ h.jsx(Ro, {}),
|
2154
|
-
|
2148
|
+
v.t("dataValidation.list.add")
|
2155
2149
|
] })
|
2156
2150
|
] }) })
|
2157
2151
|
] });
|
2158
2152
|
}
|
2159
|
-
const jo = "data-validation.custom-formula-input", xt = "data-validation.formula-input",
|
2153
|
+
const jo = "data-validation.custom-formula-input", xt = "data-validation.formula-input", Mn = "data-validation.list-formula-input", Fo = "data-validation.checkbox-formula-input", jr = [
|
2160
2154
|
[
|
2161
2155
|
jo,
|
2162
2156
|
Lr
|
@@ -2166,7 +2160,7 @@ const jo = "data-validation.custom-formula-input", xt = "data-validation.formula
|
|
2166
2160
|
Er
|
2167
2161
|
],
|
2168
2162
|
[
|
2169
|
-
|
2163
|
+
Mn,
|
2170
2164
|
xr
|
2171
2165
|
],
|
2172
2166
|
[
|
@@ -2178,9 +2172,9 @@ function Mt(e) {
|
|
2178
2172
|
var a;
|
2179
2173
|
const { value: t, onChange: o } = e, n = L(J);
|
2180
2174
|
return /* @__PURE__ */ h.jsx(Z, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ h.jsxs(mn, { value: `${(a = t.renderMode) != null ? a : de.CUSTOM}`, onChange: (i) => o({ ...t, renderMode: +i }), children: [
|
2181
|
-
/* @__PURE__ */ h.jsx(
|
2182
|
-
/* @__PURE__ */ h.jsx(
|
2183
|
-
/* @__PURE__ */ h.jsx(
|
2175
|
+
/* @__PURE__ */ h.jsx(Ae, { value: `${de.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2176
|
+
/* @__PURE__ */ h.jsx(Ae, { value: `${de.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2177
|
+
/* @__PURE__ */ h.jsx(Ae, { value: `${de.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2184
2178
|
] }) });
|
2185
2179
|
}
|
2186
2180
|
Mt.componentKey = Fr;
|
@@ -2212,7 +2206,7 @@ var Ur = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, $r = (e, t
|
|
2212
2206
|
return n && a && Ur(t, o, a), a;
|
2213
2207
|
}, at = (e, t) => (o, n) => t(o, n, e);
|
2214
2208
|
const ht = 6;
|
2215
|
-
let
|
2209
|
+
let dn = class {
|
2216
2210
|
constructor(e, t, o, n, a) {
|
2217
2211
|
this._commandService = e, this._formulaService = t, this._themeService = o, this._renderManagerService = n, this._dataValidationModel = a;
|
2218
2212
|
}
|
@@ -2260,10 +2254,10 @@ let ln = class {
|
|
2260
2254
|
return ((o = t == null ? void 0 : t.fs) != null ? o : 10) * 1.6;
|
2261
2255
|
}
|
2262
2256
|
async _parseFormula(e, t, o) {
|
2263
|
-
var c, u, p, d,
|
2264
|
-
const { formula1: n = Ra, formula2: a = Da } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = Ft((p = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : p[0]), l = Ft((
|
2257
|
+
var c, u, p, d, g, f, C, R, v;
|
2258
|
+
const { formula1: n = Ra, formula2: a = Da } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = Ft((p = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : p[0]), l = Ft((f = (g = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : g[0]) == null ? void 0 : f[0]), s = Ln(String(r)) && Ln(String(l));
|
2265
2259
|
return {
|
2266
|
-
formula1: Pe(n) ? Ft((
|
2260
|
+
formula1: Pe(n) ? Ft((v = (R = (C = i == null ? void 0 : i[0]) == null ? void 0 : C.result) == null ? void 0 : R[0]) == null ? void 0 : v[0]) : n,
|
2267
2261
|
formula2: Pe(a) ? l : a,
|
2268
2262
|
isFormulaValid: s
|
2269
2263
|
};
|
@@ -2276,10 +2270,10 @@ let ln = class {
|
|
2276
2270
|
const d = this._dataValidationModel.getValidator(p.type);
|
2277
2271
|
if (!d)
|
2278
2272
|
return;
|
2279
|
-
const
|
2273
|
+
const g = this._themeService.getCurrentTheme();
|
2280
2274
|
if (!((E = d.skipDefaultFontRender) != null && E.call(d, p, u, { unitId: a, subUnitId: i, row: l, column: s })))
|
2281
2275
|
return;
|
2282
|
-
const
|
2276
|
+
const f = d.parseFormulaSync(p, a, i), { formula1: C } = f, R = this._calc(c, o), { a: v, d: w } = e.getTransform(), I = En(R.left, v), V = En(R.top, w), _ = la.create().composeMatrix({
|
2283
2277
|
left: I,
|
2284
2278
|
top: V,
|
2285
2279
|
scaleX: 1,
|
@@ -2289,13 +2283,13 @@ let ln = class {
|
|
2289
2283
|
skewY: 0,
|
2290
2284
|
flipX: !1,
|
2291
2285
|
flipY: !1
|
2292
|
-
}),
|
2293
|
-
e.save(), e.beginPath(), e.rect(c.startX, c.startY,
|
2294
|
-
const y =
|
2286
|
+
}), S = c.endX - c.startX, m = c.endY - c.startY;
|
2287
|
+
e.save(), e.beginPath(), e.rect(c.startX, c.startY, S, m), e.clip();
|
2288
|
+
const y = _.getMatrix();
|
2295
2289
|
e.transform(y[0], y[1], y[2], y[3], y[4], y[5]);
|
2296
|
-
const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6,
|
2290
|
+
const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, F = String(u) === String(C), T = g.hyacinth500;
|
2297
2291
|
da.drawWith(e, {
|
2298
|
-
checked:
|
2292
|
+
checked: F,
|
2299
2293
|
width: P,
|
2300
2294
|
height: P,
|
2301
2295
|
fill: (j = (x = o == null ? void 0 : o.cl) == null ? void 0 : x.rgb) != null ? j : T
|
@@ -2306,16 +2300,16 @@ let ln = class {
|
|
2306
2300
|
return s <= l && s >= r && c <= i && c >= a;
|
2307
2301
|
}
|
2308
2302
|
async onPointerDown(e, t) {
|
2309
|
-
var
|
2303
|
+
var f;
|
2310
2304
|
if (t.button === 2)
|
2311
2305
|
return;
|
2312
2306
|
const { primaryWithCoord: o, unitId: n, subUnitId: a, worksheet: i, row: r, col: l } = e, s = ie(i.getCellRaw(r, l)), c = this._dataValidationModel.getRuleByLocation(n, a, r, l);
|
2313
2307
|
if (!c)
|
2314
2308
|
return;
|
2315
2309
|
const u = this._dataValidationModel.getValidator(c.type);
|
2316
|
-
if (!u || !((
|
2310
|
+
if (!u || !((f = u.skipDefaultFontRender) != null && f.call(u, c, s, { unitId: n, subUnitId: a, row: r, column: l })))
|
2317
2311
|
return;
|
2318
|
-
const { formula1: p, formula2: d } = await this._parseFormula(c, n, a),
|
2312
|
+
const { formula1: p, formula2: d } = await this._parseFormula(c, n, a), g = {
|
2319
2313
|
range: {
|
2320
2314
|
startColumn: o.actualColumn,
|
2321
2315
|
endColumn: o.actualColumn,
|
@@ -2328,8 +2322,8 @@ let ln = class {
|
|
2328
2322
|
}
|
2329
2323
|
};
|
2330
2324
|
this._commandService.executeCommand(
|
2331
|
-
|
2332
|
-
|
2325
|
+
vn.id,
|
2326
|
+
g
|
2333
2327
|
);
|
2334
2328
|
}
|
2335
2329
|
onPointerEnter(e, t) {
|
@@ -2341,39 +2335,39 @@ let ln = class {
|
|
2341
2335
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2342
2336
|
}
|
2343
2337
|
};
|
2344
|
-
|
2338
|
+
dn = $r([
|
2345
2339
|
at(0, Q),
|
2346
2340
|
at(1, b(Ia)),
|
2347
2341
|
at(2, b(na)),
|
2348
2342
|
at(3, b(Ve)),
|
2349
2343
|
at(4, b(oe))
|
2350
|
-
],
|
2344
|
+
], dn);
|
2351
2345
|
var kr = Object.defineProperty, Wr = Object.getOwnPropertyDescriptor, Hr = (e, t, o, n) => {
|
2352
2346
|
for (var a = n > 1 ? void 0 : n ? Wr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2353
2347
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2354
2348
|
return n && a && kr(t, o, a), a;
|
2355
2349
|
}, Yr = (e, t) => (o, n) => t(o, n, e);
|
2356
|
-
let
|
2350
|
+
let me = class {
|
2357
2351
|
constructor(e) {
|
2358
2352
|
M(this, "canvasRender", null);
|
2359
2353
|
M(this, "dropdown");
|
2360
2354
|
M(this, "optionsInput");
|
2361
|
-
M(this, "formulaInput",
|
2355
|
+
M(this, "formulaInput", Mn);
|
2362
2356
|
this.injector = e;
|
2363
2357
|
}
|
2364
2358
|
};
|
2365
|
-
|
2366
|
-
Yr(0, b(
|
2367
|
-
],
|
2368
|
-
class Xr extends
|
2359
|
+
me = Hr([
|
2360
|
+
Yr(0, b(Fe))
|
2361
|
+
], me);
|
2362
|
+
class Xr extends me {
|
2369
2363
|
constructor() {
|
2370
2364
|
super(...arguments);
|
2371
2365
|
M(this, "id", z.CHECKBOX);
|
2372
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2366
|
+
M(this, "canvasRender", this.injector.createInstance(dn));
|
2373
2367
|
M(this, "formulaInput", Fo);
|
2374
2368
|
}
|
2375
2369
|
}
|
2376
|
-
class zr extends
|
2370
|
+
class zr extends me {
|
2377
2371
|
constructor() {
|
2378
2372
|
super(...arguments);
|
2379
2373
|
M(this, "id", z.CUSTOM);
|
@@ -2381,7 +2375,7 @@ class zr extends fe {
|
|
2381
2375
|
}
|
2382
2376
|
}
|
2383
2377
|
const Kr = "data-validation.formula-input";
|
2384
|
-
class Gr extends
|
2378
|
+
class Gr extends me {
|
2385
2379
|
constructor() {
|
2386
2380
|
super(...arguments);
|
2387
2381
|
M(this, "id", z.DATE);
|
@@ -2390,14 +2384,14 @@ class Gr extends fe {
|
|
2390
2384
|
M(this, "dropdown", Oo);
|
2391
2385
|
}
|
2392
2386
|
}
|
2393
|
-
class Zr extends
|
2387
|
+
class Zr extends me {
|
2394
2388
|
constructor() {
|
2395
2389
|
super(...arguments);
|
2396
2390
|
M(this, "id", z.DECIMAL);
|
2397
2391
|
M(this, "formulaInput", xt);
|
2398
2392
|
}
|
2399
2393
|
}
|
2400
|
-
const No = 4, qr = 0, Wt = 4, Uo = 4,
|
2394
|
+
const No = 4, qr = 0, Wt = 4, Uo = 4, cn = 6, Et = 6, Le = 14;
|
2401
2395
|
function Jr(e, t) {
|
2402
2396
|
const o = ca.getTextSize(e, t), n = o.width + No * 2, { ba: a, bd: i } = o, r = a + i;
|
2403
2397
|
return {
|
@@ -2407,17 +2401,17 @@ function Jr(e, t) {
|
|
2407
2401
|
};
|
2408
2402
|
}
|
2409
2403
|
function Ht(e, t, o, n) {
|
2410
|
-
const a = Le +
|
2404
|
+
const a = Le + cn * 2, i = o - a, r = n - Et * 2, l = e.map((d) => ({
|
2411
2405
|
layout: Jr(d, t),
|
2412
2406
|
text: d
|
2413
2407
|
}));
|
2414
2408
|
let s;
|
2415
2409
|
const c = [];
|
2416
2410
|
l.forEach((d) => {
|
2417
|
-
const { layout:
|
2418
|
-
!s || s.width +
|
2419
|
-
width:
|
2420
|
-
height:
|
2411
|
+
const { layout: g } = d, { width: f, height: C } = g;
|
2412
|
+
!s || s.width + f + Wt > i ? (s = {
|
2413
|
+
width: f,
|
2414
|
+
height: C,
|
2421
2415
|
items: [{
|
2422
2416
|
...d,
|
2423
2417
|
left: 0
|
@@ -2425,11 +2419,11 @@ function Ht(e, t, o, n) {
|
|
2425
2419
|
}, c.push(s)) : (s.items.push({
|
2426
2420
|
...d,
|
2427
2421
|
left: s.width + Wt
|
2428
|
-
}), s.width = s.width +
|
2422
|
+
}), s.width = s.width + f + Wt);
|
2429
2423
|
});
|
2430
2424
|
let u = 0, p = 0;
|
2431
|
-
return c.forEach((d,
|
2432
|
-
p = Math.max(p, d.width),
|
2425
|
+
return c.forEach((d, g) => {
|
2426
|
+
p = Math.max(p, d.width), g === c.length - 1 ? u += d.height : u += d.height + Uo;
|
2433
2427
|
}), {
|
2434
2428
|
lines: c,
|
2435
2429
|
totalHeight: u,
|
@@ -2443,7 +2437,7 @@ const Qr = 8;
|
|
2443
2437
|
class es extends ua {
|
2444
2438
|
static drawWith(t, o) {
|
2445
2439
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
|
2446
|
-
t.save(),
|
2440
|
+
t.save(), Jn.drawWith(t, {
|
2447
2441
|
width: l.width,
|
2448
2442
|
height: l.height,
|
2449
2443
|
radius: Qr,
|
@@ -2457,7 +2451,7 @@ var ts = Object.defineProperty, ns = Object.getOwnPropertyDescriptor, os = (e, t
|
|
2457
2451
|
return n && a && ts(t, o, a), a;
|
2458
2452
|
}, Yt = (e, t) => (o, n) => t(o, n, e);
|
2459
2453
|
const as = 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");
|
2460
|
-
let
|
2454
|
+
let un = class {
|
2461
2455
|
constructor(e, t, o) {
|
2462
2456
|
M(this, "zIndex");
|
2463
2457
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2486,38 +2480,38 @@ let cn = class {
|
|
2486
2480
|
// eslint-disable-next-line max-lines-per-function
|
2487
2481
|
drawWith(e, t, o, n) {
|
2488
2482
|
var X, k;
|
2489
|
-
const { primaryWithCoord: a, row: i, col: r, style: l, data: s, subUnitId: c } = t, u = a.isMergedMainCell ? a.mergeInfo : a, p = s == null ? void 0 : s.fontRenderExtension, { leftOffset: d = 0, rightOffset:
|
2490
|
-
if (!
|
2483
|
+
const { primaryWithCoord: a, row: i, col: r, style: l, data: s, subUnitId: c } = t, u = a.isMergedMainCell ? a.mergeInfo : a, p = s == null ? void 0 : s.fontRenderExtension, { leftOffset: d = 0, rightOffset: g = 0, topOffset: f = 0, downOffset: C = 0 } = p || {}, R = this._ensureMap(c), v = this._generateKey(i, r), w = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, i, r);
|
2484
|
+
if (!w)
|
2491
2485
|
return;
|
2492
|
-
const I = this._dataValidationModel.getValidator(
|
2486
|
+
const I = this._dataValidationModel.getValidator(w.type);
|
2493
2487
|
if (!I)
|
2494
2488
|
return;
|
2495
2489
|
const V = {
|
2496
2490
|
startX: u.startX + d,
|
2497
|
-
endX: u.endX -
|
2498
|
-
startY: u.startY +
|
2499
|
-
endY: u.endY -
|
2500
|
-
},
|
2501
|
-
this._drawDownIcon(e, V,
|
2491
|
+
endX: u.endX - g,
|
2492
|
+
startY: u.startY + f,
|
2493
|
+
endY: u.endY - C
|
2494
|
+
}, _ = V.endX - V.startX, S = V.endY - V.startY, { cl: m } = l || {}, y = (X = typeof m == "object" ? m == null ? void 0 : m.rgb : m) != null ? X : "#000", P = jt(l != null ? l : void 0), { vt: F, ht: T } = l || {}, E = F != null ? F : ue.MIDDLE, A = (k = ie(s)) != null ? k : "", x = I.parseCellValue(A), j = I.getListWithColorMap(w), N = Ht(x, P, _, S);
|
2495
|
+
this._drawDownIcon(e, V, _, S, E), e.save(), e.translateWithPrecision(V.startX, V.startY), e.beginPath(), e.rect(0, 0, _ - Le, S), e.clip(), e.translateWithPrecision(cn, Et);
|
2502
2496
|
let H = 0;
|
2503
2497
|
switch (E) {
|
2504
2498
|
case ue.MIDDLE:
|
2505
|
-
H = (
|
2499
|
+
H = (N.contentHeight - N.totalHeight) / 2;
|
2506
2500
|
break;
|
2507
2501
|
case ue.BOTTOM:
|
2508
|
-
H =
|
2502
|
+
H = N.contentHeight - N.totalHeight;
|
2509
2503
|
break;
|
2510
2504
|
}
|
2511
|
-
e.translateWithPrecision(0, H),
|
2505
|
+
e.translateWithPrecision(0, H), N.lines.forEach((K, q) => {
|
2512
2506
|
e.save();
|
2513
2507
|
const { width: ee, height: te, items: re } = K;
|
2514
2508
|
let ae = 0;
|
2515
2509
|
switch (T) {
|
2516
2510
|
case Ye.RIGHT:
|
2517
|
-
ae =
|
2511
|
+
ae = N.contentWidth - ee;
|
2518
2512
|
break;
|
2519
2513
|
case Ye.CENTER:
|
2520
|
-
ae = (
|
2514
|
+
ae = (N.contentWidth - ee) / 2;
|
2521
2515
|
break;
|
2522
2516
|
}
|
2523
2517
|
e.translate(ae, q * (te + Uo)), re.forEach((se) => {
|
@@ -2528,44 +2522,44 @@ let cn = class {
|
|
2528
2522
|
fill: j[se.text]
|
2529
2523
|
}), e.restore();
|
2530
2524
|
}), e.restore();
|
2531
|
-
}), e.restore(),
|
2525
|
+
}), e.restore(), R.set(v, {
|
2532
2526
|
left: V.startX,
|
2533
2527
|
top: V.startY,
|
2534
|
-
width:
|
2535
|
-
height:
|
2528
|
+
width: N.contentWidth + cn + Le,
|
2529
|
+
height: N.contentHeight + Et * 2
|
2536
2530
|
});
|
2537
2531
|
}
|
2538
2532
|
calcCellAutoHeight(e) {
|
2539
|
-
var
|
2533
|
+
var _;
|
2540
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 || {}, p = t.isMergedMainCell ? t.mergeInfo : t, d = {
|
2541
2535
|
startX: p.startX + l,
|
2542
2536
|
endX: p.endX - s,
|
2543
2537
|
startY: p.startY + c,
|
2544
2538
|
endY: p.endY - u
|
2545
|
-
},
|
2546
|
-
if (!
|
2539
|
+
}, g = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2540
|
+
if (!g)
|
2547
2541
|
return;
|
2548
|
-
const
|
2549
|
-
if (!
|
2542
|
+
const f = this._dataValidationModel.getValidator(g.type);
|
2543
|
+
if (!f)
|
2550
2544
|
return;
|
2551
|
-
const
|
2552
|
-
return Ht(
|
2545
|
+
const C = d.endX - d.startX, R = d.endY - d.startY, v = (_ = ie(n)) != null ? _ : "", w = f.parseCellValue(v), I = jt(o != null ? o : void 0);
|
2546
|
+
return Ht(w, I, C, R).cellAutoHeight;
|
2553
2547
|
}
|
2554
2548
|
calcCellAutoWidth(e) {
|
2555
|
-
var
|
2549
|
+
var _;
|
2556
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 || {}, p = t.isMergedMainCell ? t.mergeInfo : t, d = {
|
2557
2551
|
startX: p.startX + l,
|
2558
2552
|
endX: p.endX - s,
|
2559
2553
|
startY: p.startY + c,
|
2560
2554
|
endY: p.endY - u
|
2561
|
-
},
|
2562
|
-
if (!
|
2555
|
+
}, g = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2556
|
+
if (!g)
|
2563
2557
|
return;
|
2564
|
-
const
|
2565
|
-
if (!
|
2558
|
+
const f = this._dataValidationModel.getValidator(g.type);
|
2559
|
+
if (!f)
|
2566
2560
|
return;
|
2567
|
-
const
|
2568
|
-
return Ht(
|
2561
|
+
const C = d.endX - d.startX, R = d.endY - d.startY, v = (_ = ie(n)) != null ? _ : "", w = f.parseCellValue(v), I = jt(o != null ? o : void 0);
|
2562
|
+
return Ht(w, I, C, R).calcAutoWidth;
|
2569
2563
|
}
|
2570
2564
|
isHit(e, t) {
|
2571
2565
|
const { primaryWithCoord: o } = t, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = e;
|
@@ -2591,17 +2585,17 @@ let cn = class {
|
|
2591
2585
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2592
2586
|
}
|
2593
2587
|
};
|
2594
|
-
|
2588
|
+
un = os([
|
2595
2589
|
Yt(0, Q),
|
2596
2590
|
Yt(1, b(Ve)),
|
2597
2591
|
Yt(2, b(oe))
|
2598
|
-
],
|
2599
|
-
class is extends
|
2592
|
+
], un);
|
2593
|
+
class is extends me {
|
2600
2594
|
constructor() {
|
2601
2595
|
super(...arguments);
|
2602
2596
|
M(this, "id", z.LIST_MULTIPLE);
|
2603
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2604
|
-
M(this, "dropdown",
|
2597
|
+
M(this, "canvasRender", this.injector.createInstance(un));
|
2598
|
+
M(this, "dropdown", yn);
|
2605
2599
|
}
|
2606
2600
|
}
|
2607
2601
|
var rs = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, ls = (e, t, o, n) => {
|
@@ -2609,7 +2603,7 @@ var rs = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, ls = (e, t
|
|
2609
2603
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2610
2604
|
return n && a && rs(t, o, a), a;
|
2611
2605
|
}, pt = (e, t) => (o, n) => t(o, n, e);
|
2612
|
-
const Oe = 4,
|
2606
|
+
const Oe = 4, ft = 4, he = 14, pe = 6, ke = 4, Xt = 8, ds = "#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");
|
2613
2607
|
function cs(e, t) {
|
2614
2608
|
const o = e.length;
|
2615
2609
|
return {
|
@@ -2658,14 +2652,14 @@ function Bo(e, t, o) {
|
|
2658
2652
|
docViewModel: i
|
2659
2653
|
};
|
2660
2654
|
}
|
2661
|
-
function
|
2655
|
+
function mt(e, t, o) {
|
2662
2656
|
const {
|
2663
2657
|
documentSkeleton: n,
|
2664
2658
|
docModel: a,
|
2665
2659
|
docViewModel: i
|
2666
2660
|
} = Bo(e, t, o);
|
2667
2661
|
return {
|
2668
|
-
documents: new
|
2662
|
+
documents: new fa(`DOCUMENTS_${en.generateRandomId()}`, n, {
|
2669
2663
|
pageMarginLeft: 0,
|
2670
2664
|
pageMarginTop: 0
|
2671
2665
|
}),
|
@@ -2674,9 +2668,9 @@ function ft(e, t, o) {
|
|
2674
2668
|
docViewModel: i
|
2675
2669
|
};
|
2676
2670
|
}
|
2677
|
-
function
|
2671
|
+
function Yn(e, t, o, n, a, i, r = !0) {
|
2678
2672
|
let l = 0;
|
2679
|
-
const s = r ?
|
2673
|
+
const s = r ? ke : 0;
|
2680
2674
|
switch (a) {
|
2681
2675
|
case ue.BOTTOM:
|
2682
2676
|
l = t - n - s;
|
@@ -2688,7 +2682,7 @@ function Hn(e, t, o, n, a, i, r = !0) {
|
|
2688
2682
|
l = s;
|
2689
2683
|
break;
|
2690
2684
|
}
|
2691
|
-
l = Math.max(
|
2685
|
+
l = Math.max(ke, l);
|
2692
2686
|
let c = 0;
|
2693
2687
|
switch (i) {
|
2694
2688
|
case Ye.CENTER:
|
@@ -2703,7 +2697,7 @@ function Hn(e, t, o, n, a, i, r = !0) {
|
|
2703
2697
|
paddingTop: l
|
2704
2698
|
};
|
2705
2699
|
}
|
2706
|
-
let
|
2700
|
+
let hn = class {
|
2707
2701
|
constructor(e, t, o, n) {
|
2708
2702
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2709
2703
|
M(this, "zIndex");
|
@@ -2721,16 +2715,16 @@ let un = class {
|
|
2721
2715
|
let u;
|
2722
2716
|
switch (i) {
|
2723
2717
|
case ue.MIDDLE:
|
2724
|
-
u = (n -
|
2718
|
+
u = (n - ft) / 2;
|
2725
2719
|
break;
|
2726
2720
|
case ue.BOTTOM:
|
2727
|
-
u = n - s - a -
|
2721
|
+
u = n - s - a - ke + (a / 2 - ft / 2);
|
2728
2722
|
break;
|
2729
2723
|
default:
|
2730
|
-
u = l +
|
2724
|
+
u = l + ke + (a / 2 - ft / 2);
|
2731
2725
|
break;
|
2732
2726
|
}
|
2733
|
-
e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(
|
2727
|
+
e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(Hn), e.restore();
|
2734
2728
|
}
|
2735
2729
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2736
2730
|
drawWith(e, t, o) {
|
@@ -2740,41 +2734,41 @@ let un = class {
|
|
2740
2734
|
const p = this._dataValidationModel.getValidator(u.type);
|
2741
2735
|
if (!p)
|
2742
2736
|
return;
|
2743
|
-
const d = l == null ? void 0 : l.fontRenderExtension, { leftOffset:
|
2737
|
+
const d = l == null ? void 0 : l.fontRenderExtension, { leftOffset: g = 0, rightOffset: f = 0, topOffset: C = 0, downOffset: R = 0 } = d || {};
|
2744
2738
|
if (!u || !p || !p || p.id.indexOf(z.LIST) !== 0 || !p.skipDefaultFontRender(u))
|
2745
2739
|
return;
|
2746
|
-
const
|
2747
|
-
startX: c.startX +
|
2748
|
-
endX: c.endX -
|
2749
|
-
startY: c.startY +
|
2750
|
-
endY: c.endY -
|
2751
|
-
},
|
2752
|
-
let { tb:
|
2753
|
-
if (
|
2754
|
-
const { l: x = le.pd.l, t: j = le.pd.t, r:
|
2755
|
-
|
2756
|
-
const ee = et(k), { height: te, width: re } = ee, { paddingTop: ae, paddingLeft: se } =
|
2757
|
-
this._drawDownIcon(e,
|
2758
|
-
left:
|
2759
|
-
top:
|
2740
|
+
const v = {
|
2741
|
+
startX: c.startX + g,
|
2742
|
+
endX: c.endX - f,
|
2743
|
+
startY: c.startY + C,
|
2744
|
+
endY: c.endY - R
|
2745
|
+
}, w = v.endX - v.startX, I = v.endY - v.startY, V = this._ensureMap(s), _ = this._generateKey(a, i), S = p.getListWithColor(u), m = ie(l), y = `${m != null ? m : ""}`, P = S.find((x) => x.label === y);
|
2746
|
+
let { tb: F, vt: T, ht: E, pd: A } = r || {};
|
2747
|
+
if (F = F != null ? F : Se.WRAP, T = T != null ? T : ue.BOTTOM, E = E != null ? E : le.ht, A = A != null ? A : le.pd, u.renderMode === de.ARROW) {
|
2748
|
+
const { l: x = le.pd.l, t: j = le.pd.t, r: N = le.pd.r, b: H = le.pd.b } = A, X = w - x - N - he - 4, { documentSkeleton: k, documents: K, docModel: q } = mt(y, this._localeService, r);
|
2749
|
+
F === Se.WRAP && q.updateDocumentDataPageSize(Math.max(X, 1)), k.calculate(), k.getActualSize();
|
2750
|
+
const ee = et(k), { height: te, width: re } = ee, { paddingTop: ae, paddingLeft: se } = Yn(X, I - j - H, re, te, T, E, !0);
|
2751
|
+
this._drawDownIcon(e, v, w, I, te, T, A), e.save(), e.translateWithPrecision(v.startX + x, v.startY + j), e.beginPath(), e.rect(0, 0, w - x - N, I - j - H), e.clip(), e.translateWithPrecision(0, ae), e.save(), e.translateWithPrecision(Oe, 0), e.beginPath(), e.rect(0, 0, X, te), e.clip(), K.render(e), e.translateWithPrecision(se, 0), e.restore(), e.restore(), V.set(_, {
|
2752
|
+
left: v.endX + x + o.rowHeaderWidth - he,
|
2753
|
+
top: v.startY + j + o.columnHeaderHeight,
|
2760
2754
|
width: he,
|
2761
2755
|
height: I - j - H
|
2762
2756
|
});
|
2763
2757
|
} else {
|
2764
|
-
e.save(), e.translateWithPrecision(
|
2765
|
-
const x =
|
2766
|
-
|
2767
|
-
const X = et(j), { height: k, width: K } = X, { paddingTop: q, paddingLeft: ee } =
|
2758
|
+
e.save(), e.translateWithPrecision(v.startX, v.startY), e.beginPath(), e.rect(0, 0, w, I), e.clip();
|
2759
|
+
const x = w - pe * 2 - Oe - he - 4, { documentSkeleton: j, documents: N, docModel: H } = mt(y, this._localeService, r);
|
2760
|
+
F === Se.WRAP && H.updateDocumentDataPageSize(Math.max(x, 1)), j.calculate();
|
2761
|
+
const X = et(j), { height: k, width: K } = X, { paddingTop: q, paddingLeft: ee } = Yn(x, I, K, k, T, E);
|
2768
2762
|
e.translateWithPrecision(pe, q);
|
2769
|
-
const te = Math.max(
|
2770
|
-
|
2763
|
+
const te = Math.max(w - pe * 2, 1), re = k;
|
2764
|
+
Jn.drawWith(e, {
|
2771
2765
|
width: te,
|
2772
2766
|
height: re,
|
2773
2767
|
fill: (P == null ? void 0 : P.color) || Te,
|
2774
2768
|
radius: Xt
|
2775
|
-
}), e.save(), e.translateWithPrecision(Oe, 0), e.beginPath(), e.rect(0, 0, x, k), e.clip(), e.translateWithPrecision(ee, 0),
|
2776
|
-
left:
|
2777
|
-
top:
|
2769
|
+
}), e.save(), e.translateWithPrecision(Oe, 0), e.beginPath(), e.rect(0, 0, x, k), e.clip(), e.translateWithPrecision(ee, 0), N.render(e), e.restore(), e.translateWithPrecision(x + Oe + 4, (k - ft) / 2), e.fillStyle = ds, e.fill(Hn), e.restore(), V.set(_, {
|
2770
|
+
left: v.startX + pe + o.rowHeaderWidth,
|
2771
|
+
top: v.startY + q + o.columnHeaderHeight,
|
2778
2772
|
width: te,
|
2779
2773
|
height: re
|
2780
2774
|
});
|
@@ -2784,62 +2778,62 @@ let un = class {
|
|
2784
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: p = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2785
2779
|
if (!d || d.renderMode === de.TEXT)
|
2786
2780
|
return;
|
2787
|
-
const
|
2781
|
+
const g = {
|
2788
2782
|
startX: r.startX + s,
|
2789
2783
|
endX: r.endX - c,
|
2790
2784
|
startY: r.startY + u,
|
2791
2785
|
endY: r.endY - p
|
2792
|
-
},
|
2793
|
-
let { tb:
|
2794
|
-
const { t: I = le.pd.t, b: V = le.pd.b } =
|
2795
|
-
if (
|
2796
|
-
const
|
2797
|
-
|
2798
|
-
const y = et(
|
2799
|
-
return P + I + V +
|
2786
|
+
}, f = g.endX - g.startX, C = ie(n), R = `${C != null ? C : ""}`;
|
2787
|
+
let { tb: v, pd: w } = o || {};
|
2788
|
+
const { t: I = le.pd.t, b: V = le.pd.b } = w != null ? w : {};
|
2789
|
+
if (v = v != null ? v : Se.WRAP, d.renderMode === de.ARROW) {
|
2790
|
+
const _ = f - he, { documentSkeleton: S, docModel: m } = mt(R, this._localeService, o);
|
2791
|
+
v === Se.WRAP && m.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate(), S.getActualSize();
|
2792
|
+
const y = et(S), { height: P } = y;
|
2793
|
+
return P + I + V + ke * 2;
|
2800
2794
|
} else {
|
2801
|
-
const
|
2802
|
-
|
2803
|
-
const y = et(
|
2795
|
+
const _ = f - pe * 2 - Oe - he, { documentSkeleton: S, docModel: m } = Bo(R, this._localeService, o);
|
2796
|
+
v === Se.WRAP && m.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate();
|
2797
|
+
const y = et(S), {
|
2804
2798
|
height: P
|
2805
2799
|
} = y;
|
2806
|
-
return P +
|
2800
|
+
return P + ke * 2;
|
2807
2801
|
}
|
2808
2802
|
}
|
2809
2803
|
calcCellAutoWidth(e) {
|
2810
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: p = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2811
2805
|
if (!d || d.renderMode === de.TEXT)
|
2812
2806
|
return;
|
2813
|
-
const
|
2807
|
+
const g = {
|
2814
2808
|
startX: r.startX + s,
|
2815
2809
|
endX: r.endX - c,
|
2816
2810
|
startY: r.startY + u,
|
2817
2811
|
endY: r.endY - p
|
2818
|
-
},
|
2819
|
-
let { tb:
|
2820
|
-
const { l: I = le.pd.l, r: V = le.pd.r } =
|
2821
|
-
|
2822
|
-
let
|
2812
|
+
}, f = g.endX - g.startX, C = ie(n), R = `${C != null ? C : ""}`;
|
2813
|
+
let { tb: v, pd: w } = o || {};
|
2814
|
+
const { l: I = le.pd.l, r: V = le.pd.r } = w != null ? w : {};
|
2815
|
+
v = v != null ? v : Se.WRAP;
|
2816
|
+
let _ = pe * 2 + he;
|
2823
2817
|
switch (d.renderMode) {
|
2824
2818
|
case de.ARROW:
|
2825
|
-
|
2819
|
+
_ = he + pe * 2 + V + I;
|
2826
2820
|
break;
|
2827
2821
|
case de.CUSTOM:
|
2828
|
-
|
2822
|
+
_ = he + pe * 2 + Oe * 2 + V + I + Xt / 2 + 1;
|
2829
2823
|
break;
|
2830
2824
|
// default is CUSTOM
|
2831
2825
|
default:
|
2832
|
-
|
2826
|
+
_ = he + pe * 2 + Oe * 2 + V + I + Xt / 2 + 1;
|
2833
2827
|
}
|
2834
|
-
const
|
2835
|
-
return
|
2828
|
+
const S = f - _, { documentSkeleton: m, docModel: y } = mt(R, this._localeService, o);
|
2829
|
+
return v === Se.WRAP && y.updateDocumentDataPageSize(Math.max(S, 1)), m.calculate(), m.getActualSize(), et(m).width + _;
|
2836
2830
|
}
|
2837
2831
|
isHit(e, t) {
|
2838
2832
|
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);
|
2839
2833
|
if (!l || !r || l.renderMode === de.TEXT)
|
2840
2834
|
return !1;
|
2841
|
-
const { top: s, left: c, width: u, height: p } = r, { x: d, y:
|
2842
|
-
return d >= c && d <= c + u &&
|
2835
|
+
const { top: s, left: c, width: u, height: p } = r, { x: d, y: g } = e;
|
2836
|
+
return d >= c && d <= c + u && g >= s && g <= s + p;
|
2843
2837
|
}
|
2844
2838
|
onPointerDown(e, t) {
|
2845
2839
|
if (t.button === 2)
|
@@ -2861,42 +2855,42 @@ let un = class {
|
|
2861
2855
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2862
2856
|
}
|
2863
2857
|
};
|
2864
|
-
|
2858
|
+
hn = ls([
|
2865
2859
|
pt(0, b(J)),
|
2866
2860
|
pt(1, Q),
|
2867
2861
|
pt(2, b(Ve)),
|
2868
2862
|
pt(3, b(oe))
|
2869
|
-
],
|
2870
|
-
class us extends
|
2863
|
+
], hn);
|
2864
|
+
class us extends me {
|
2871
2865
|
constructor() {
|
2872
2866
|
super(...arguments);
|
2873
2867
|
M(this, "id", z.LIST);
|
2874
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2875
|
-
M(this, "dropdown",
|
2868
|
+
M(this, "canvasRender", this.injector.createInstance(hn));
|
2869
|
+
M(this, "dropdown", yn);
|
2876
2870
|
M(this, "optionsInput", Mt.componentKey);
|
2877
|
-
M(this, "formulaInput",
|
2871
|
+
M(this, "formulaInput", Mn);
|
2878
2872
|
}
|
2879
2873
|
}
|
2880
|
-
class hs extends
|
2874
|
+
class hs extends me {
|
2881
2875
|
constructor() {
|
2882
2876
|
super(...arguments);
|
2883
2877
|
M(this, "id", z.TEXT_LENGTH);
|
2884
2878
|
M(this, "formulaInput", xt);
|
2885
2879
|
}
|
2886
2880
|
}
|
2887
|
-
class ps extends
|
2881
|
+
class ps extends me {
|
2888
2882
|
constructor() {
|
2889
2883
|
super(...arguments);
|
2890
2884
|
M(this, "id", z.WHOLE);
|
2891
2885
|
M(this, "formulaInput", xt);
|
2892
2886
|
}
|
2893
2887
|
}
|
2894
|
-
var
|
2895
|
-
for (var a = n > 1 ? void 0 : n ?
|
2888
|
+
var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, gs = (e, t, o, n) => {
|
2889
|
+
for (var a = n > 1 ? void 0 : n ? ms(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2896
2890
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2897
|
-
return n && a &&
|
2891
|
+
return n && a && fs(t, o, a), a;
|
2898
2892
|
}, zt = (e, t) => (o, n) => t(o, n, e);
|
2899
|
-
let qe = class extends
|
2893
|
+
let qe = class extends fn {
|
2900
2894
|
constructor(e, t, o) {
|
2901
2895
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2902
2896
|
}
|
@@ -2905,7 +2899,7 @@ let qe = class extends pn {
|
|
2905
2899
|
[Lo, wo],
|
2906
2900
|
[Dt, Ji],
|
2907
2901
|
[Mo, vi],
|
2908
|
-
[
|
2902
|
+
[yn, Li],
|
2909
2903
|
[Oo, ni],
|
2910
2904
|
[Mt.componentKey, Mt],
|
2911
2905
|
[bt.componentKey, bt],
|
@@ -2934,7 +2928,7 @@ let qe = class extends pn {
|
|
2934
2928
|
}
|
2935
2929
|
};
|
2936
2930
|
qe = gs([
|
2937
|
-
zt(0, b(
|
2931
|
+
zt(0, b(Fe)),
|
2938
2932
|
zt(1, b(Lt)),
|
2939
2933
|
zt(2, b(ye))
|
2940
2934
|
], qe);
|
@@ -2945,19 +2939,19 @@ var vs = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, Ss = (e, t
|
|
2945
2939
|
}, Kt = (e, t) => (o, n) => t(o, n, e);
|
2946
2940
|
const Cs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2947
2941
|
var gt;
|
2948
|
-
let
|
2942
|
+
let Xn = (gt = class extends Zn {
|
2949
2943
|
constructor(e = Vt, t, o, n) {
|
2950
2944
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
2951
|
-
const { menu: a, ...i } =
|
2945
|
+
const { menu: a, ...i } = qn(
|
2952
2946
|
{},
|
2953
2947
|
Vt,
|
2954
2948
|
this._config
|
2955
2949
|
);
|
2956
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
2950
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
2957
2951
|
}
|
2958
2952
|
onStarting() {
|
2959
2953
|
[
|
2960
|
-
[
|
2954
|
+
[fe],
|
2961
2955
|
[Ie],
|
2962
2956
|
[lt],
|
2963
2957
|
[ze],
|
@@ -2972,8 +2966,8 @@ let Yn = (gt = class extends Gn {
|
|
2972
2966
|
At,
|
2973
2967
|
Tt,
|
2974
2968
|
Eo,
|
2975
|
-
|
2976
|
-
|
2969
|
+
Dn,
|
2970
|
+
Ue,
|
2977
2971
|
bo
|
2978
2972
|
].forEach((e) => {
|
2979
2973
|
this._commandService.registerCommand(e);
|
@@ -2992,11 +2986,11 @@ let Yn = (gt = class extends Gn {
|
|
2992
2986
|
this._injector.get(ze);
|
2993
2987
|
}
|
2994
2988
|
}, M(gt, "pluginName", Cs), M(gt, "type", Y.UNIVER_SHEET), gt);
|
2995
|
-
|
2996
|
-
Kt(1, b(
|
2989
|
+
Xn = Ss([
|
2990
|
+
Kt(1, b(Fe)),
|
2997
2991
|
Kt(2, Q),
|
2998
|
-
Kt(3,
|
2999
|
-
],
|
2992
|
+
Kt(3, pn)
|
2993
|
+
], Xn);
|
3000
2994
|
var Is = Object.defineProperty, ws = Object.getOwnPropertyDescriptor, Rs = (e, t, o, n) => {
|
3001
2995
|
for (var a = n > 1 ? void 0 : n ? ws(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
3002
2996
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
@@ -3004,19 +2998,19 @@ var Is = Object.defineProperty, ws = Object.getOwnPropertyDescriptor, Rs = (e, t
|
|
3004
2998
|
}, Gt = (e, t) => (o, n) => t(o, n, e);
|
3005
2999
|
const Ds = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
3006
3000
|
var vt;
|
3007
|
-
let
|
3001
|
+
let zn = (vt = class extends Zn {
|
3008
3002
|
constructor(e = Vt, t, o, n) {
|
3009
3003
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
3010
|
-
const { menu: a, ...i } =
|
3004
|
+
const { menu: a, ...i } = qn(
|
3011
3005
|
{},
|
3012
3006
|
Vt,
|
3013
3007
|
this._config
|
3014
3008
|
);
|
3015
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
3009
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
3016
3010
|
}
|
3017
3011
|
onStarting() {
|
3018
3012
|
[
|
3019
|
-
[
|
3013
|
+
[fe],
|
3020
3014
|
[Ie],
|
3021
3015
|
[lt],
|
3022
3016
|
[ze],
|
@@ -3030,8 +3024,8 @@ let Xn = (vt = class extends Gn {
|
|
3030
3024
|
At,
|
3031
3025
|
Tt,
|
3032
3026
|
Eo,
|
3033
|
-
|
3034
|
-
|
3027
|
+
Dn,
|
3028
|
+
Ue,
|
3035
3029
|
bo
|
3036
3030
|
].forEach((e) => {
|
3037
3031
|
this._commandService.registerCommand(e);
|
@@ -3050,14 +3044,14 @@ let Xn = (vt = class extends Gn {
|
|
3050
3044
|
this._injector.get(ze);
|
3051
3045
|
}
|
3052
3046
|
}, M(vt, "pluginName", Ds), M(vt, "type", Y.UNIVER_SHEET), vt);
|
3053
|
-
|
3054
|
-
Gt(1, b(
|
3047
|
+
zn = Rs([
|
3048
|
+
Gt(1, b(Fe)),
|
3055
3049
|
Gt(2, Q),
|
3056
|
-
Gt(3,
|
3057
|
-
],
|
3050
|
+
Gt(3, pn)
|
3051
|
+
], zn);
|
3058
3052
|
export {
|
3059
3053
|
Oo as DATE_DROPDOWN_KEY,
|
3060
|
-
|
3061
|
-
|
3062
|
-
|
3054
|
+
yn as LIST_DROPDOWN_KEY,
|
3055
|
+
zn as UniverSheetsDataValidationMobileUIPlugin,
|
3056
|
+
Xn as UniverSheetsDataValidationUIPlugin
|
3063
3057
|
};
|