@univerjs/sheets-data-validation-ui 0.6.3-nightly.202503051607 → 0.6.4-nightly.202503101606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +541 -555
- package/lib/types/controllers/dv-reject-input.controller.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +17 -17
package/lib/es/index.js
CHANGED
@@ -2,63 +2,48 @@ var Wo = Object.defineProperty;
|
|
2
2
|
var Ho = (t, e, o) => e in t ? Wo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
3
3
|
var E = (t, e, o) => Ho(t, typeof e != "symbol" ? e + "" : e, o);
|
4
4
|
import { jsxs as Y, jsx as m, Fragment as Rt } from "react/jsx-runtime";
|
5
|
-
import { Inject as b, LocaleService as Q, Disposable as Vt, DataValidationErrorStyle as
|
5
|
+
import { Inject as b, LocaleService as Q, Disposable as Vt, DataValidationErrorStyle as de, DataValidationStatus as Kt, ICommandService as tt, dayjs as qe, numfmt as Je, CellValueType as xo, UniverInstanceType as X, toDisposable as jo, IUniverInstanceService as rt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yo, DisposableCollection as Xo, CommandType as ae, BuildTextUtils as zo, DataValidationRenderMode as ct, DataValidationType as K, IConfigService as mn, debounce as Ko, UndoCommand as Go, RedoCommand as Zo, isUnitRangesEqual as qo, shallowEqual as En, ThemeService as zn, ColorKit as Jo, Injector as Wt, ObjectMatrix as Ie, Range as Qo, Rectangle as we, queryObjectMatrix as Qe, Optional as ta, RxDisposable as gn, InterceptorEffectEnum as Kn, sequenceExecute as Gn, bufferDebounceTime as ea, isFormulaString as kt, Tools as tn, VerticalAlign as ht, HorizontalAlign as Gt, DEFAULT_STYLES as dt, WrapStrategy as It, DocumentDataModel as na, BooleanNumber as ie, DEFAULT_EMPTY_DOCUMENT_VALUE as oa, Plugin as Zn, merge as qn } from "@univerjs/core";
|
6
6
|
import { Button as Bt, DatePanel as aa, Scrollbar as ia, FormLayout as q, RadioGroup as fn, Radio as Nt, Checkbox as Pe, Input as Ut, Select as en, DraggableList as ra, clsx as sa } from "@univerjs/design";
|
7
|
-
import { DeviceInputEventType as nn, IRenderManagerService as yt, fixLineWidthByScale as bn, Transform as la, CheckboxShape as da, getCurrentTypeOfRenderer as
|
8
|
-
import { SheetInterceptorService as vn,
|
9
|
-
import { SheetDataValidationModel as at, getCellValueOrigin as
|
10
|
-
import { getPatternType as
|
11
|
-
import { SetCellEditVisibleOperation as rn, SheetCanvasPopManagerService as
|
12
|
-
import { IDialogService as
|
13
|
-
import An, { useState as j, forwardRef as Mt, useRef as
|
14
|
-
import { DataValidatorRegistryService as bt, DataValidationModel as ke, DataValidatorRegistryScope as
|
15
|
-
import { RichTextEditingMutation as
|
16
|
-
import { filter as In, BehaviorSubject as Nn, distinctUntilChanged as
|
17
|
-
import { deserializeRangeWithSheet as
|
18
|
-
import { RangeSelector as
|
19
|
-
var
|
20
|
-
for (var a = n > 1 ? void 0 : n ?
|
7
|
+
import { DeviceInputEventType as nn, IRenderManagerService as yt, fixLineWidthByScale as bn, Transform as la, CheckboxShape as da, getCurrentTypeOfRenderer as Zt, CURSOR_TYPE as qt, FontCache as ca, Shape as ua, Rect as Jn, getFontStyleString as Be, getDocsSkeletonPageSize as re, Documents as ha, DocumentViewModel as pa, DocumentSkeleton as ma } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as vn, VALIDATE_CELL as ga, SetRangeValuesCommand as _n, SheetsSelectionsService as Qn, getSheetCommandTarget as to, SheetPermissionCheckController as eo, WorksheetEditPermission as Re, RangeProtectionPermissionEditPoint as De, WorkbookEditablePermission as Ve, checkRangesEditablePermission as fa, rangeToDiscreteRange as va, WorksheetSetCellStylePermission as on, INTERCEPTOR_POINT as no, InterceptCellContentPriority as oo } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as at, SheetsDataValidationValidatorService as _a, getCellValueOrigin as mt, getDataValidationCellValue as Sa, deserializeListOptions as ao, serializeListOptions as io, UpdateSheetDataValidationRangeCommand as ro, UpdateSheetDataValidationSettingCommand as On, UpdateSheetDataValidationOptionsCommand as Ca, RemoveSheetDataValidationCommand as so, RemoveSheetAllDataValidationCommand as Ia, createDefaultNewRule as lo, AddSheetDataValidationCommand as Sn, DATA_VALIDATION_PLUGIN_NAME as co, getDataValidationDiffMutations as an, DataValidationCacheService as uo, DataValidationFormulaController as wa, DataValidationFormulaService as Ra, CHECKBOX_FORMULA_2 as Da, CHECKBOX_FORMULA_1 as Va, getFormulaResult as $e, isLegalFormulaResult as Ln, transformCheckboxValue as ya } from "@univerjs/sheets-data-validation";
|
10
|
+
import { getPatternType as Ma } from "@univerjs/sheets-numfmt";
|
11
|
+
import { SetCellEditVisibleOperation as rn, SheetCanvasPopManagerService as Ea, IEditorBridgeService as ho, IMarkSelectionService as ba, HoverManagerService as Oa, CellAlertManagerService as La, CellAlertType as Ta, IAutoFillService as Pa, APPLY_TYPE as se, virtualizeDiscreteRanges as sn, getAutoFillRepeatRange as Aa, ISheetClipboardService as ka, COPY_TYPE as Tn, PREDEFINED_HOOK_NAME as he, getRepeatRange as Pn, getCurrentRangeDisable$ as Fa, AutoHeightController as po, SheetSkeletonManagerService as ye } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as Na, useDependency as T, KeyCode as ln, ISidebarService as mo, useObservable as St, ComponentManager as Ae, IZenZoneService as go, RectPopup as Ua, useEvent as dn, MenuItemType as Cn, getMenuHiddenObservable as Ba, RibbonStartGroup as $a, IMenuManagerService as Wa, useSidebarClick as fo } from "@univerjs/ui";
|
13
|
+
import An, { useState as j, forwardRef as Mt, useRef as Jt, createElement as Et, useMemo as $t, useEffect as wt } from "react";
|
14
|
+
import { DataValidatorRegistryService as bt, DataValidationModel as ke, DataValidatorRegistryScope as Ha, TWO_FORMULA_OPERATOR_COUNT as xa, getRuleOptions as kn, getRuleSetting as Fn } from "@univerjs/data-validation";
|
15
|
+
import { RichTextEditingMutation as ja } from "@univerjs/docs";
|
16
|
+
import { filter as In, BehaviorSubject as Nn, distinctUntilChanged as Ya, Subject as Xa, debounceTime as wn, of as za, bufferTime as vo } from "rxjs";
|
17
|
+
import { deserializeRangeWithSheet as Ka, serializeRange as _o } from "@univerjs/engine-formula";
|
18
|
+
import { RangeSelector as Ga, FormulaEditor as So } from "@univerjs/sheets-formula-ui";
|
19
|
+
var Za = Object.getOwnPropertyDescriptor, qa = (t, e, o, n) => {
|
20
|
+
for (var a = n > 1 ? void 0 : n ? Za(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
21
21
|
(r = t[i]) && (a = r(a) || a);
|
22
22
|
return a;
|
23
|
-
},
|
23
|
+
}, xt = (t, e) => (o, n) => e(o, n, t);
|
24
24
|
let ce = class extends Vt {
|
25
|
-
constructor(t, e, o, n, a) {
|
26
|
-
super(), this._sheetInterceptorService = t, this._dataValidationModel = e, this._dataValidatorRegistryService = o, this._dialogService = n, this._localeService = a, this._initEditorBridgeInterceptor();
|
25
|
+
constructor(t, e, o, n, a, i) {
|
26
|
+
super(), this._sheetInterceptorService = t, this._dataValidationModel = e, this._dataValidatorRegistryService = o, this._dialogService = n, this._localeService = a, this._sheetsDataValidationValidatorService = i, this._initEditorBridgeInterceptor();
|
27
27
|
}
|
28
28
|
_initEditorBridgeInterceptor() {
|
29
29
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
30
30
|
ga,
|
31
31
|
{
|
32
32
|
handler: async (t, e, o) => {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
value: rt(n),
|
41
|
-
interceptValue: rt((R = e == null ? void 0 : e.origin) != null ? R : n),
|
42
|
-
row: i,
|
43
|
-
column: r,
|
44
|
-
unitId: s,
|
45
|
-
subUnitId: l,
|
46
|
-
worksheet: a,
|
47
|
-
workbook: c,
|
48
|
-
t: n == null ? void 0 : n.t
|
49
|
-
},
|
50
|
-
h
|
51
|
-
))
|
52
|
-
return o(Promise.resolve(n));
|
53
|
-
const p = a.getCellRaw(i, r);
|
54
|
-
return this._dialogService.open({
|
33
|
+
const n = await t, { row: a, col: i, unitId: r, subUnitId: s } = e, l = this._dataValidationModel.getRuleIdByLocation(r, s, a, i), c = l ? this._dataValidationModel.getRuleById(r, s, l) : void 0;
|
34
|
+
if (n === !1)
|
35
|
+
return o(Promise.resolve(!1));
|
36
|
+
if (!c || c.errorStyle !== de.STOP)
|
37
|
+
return o(Promise.resolve(!0));
|
38
|
+
const u = this._dataValidatorRegistryService.getValidatorItem(c.type);
|
39
|
+
return !u || await this._sheetsDataValidationValidatorService.validatorCell(r, s, a, i) === Kt.VALID ? o(Promise.resolve(!0)) : (this._dialogService.open({
|
55
40
|
width: 368,
|
56
41
|
title: {
|
57
42
|
title: this._localeService.t("dataValidation.alert.title")
|
58
43
|
},
|
59
44
|
id: "reject-input-dialog",
|
60
45
|
children: {
|
61
|
-
title:
|
46
|
+
title: u.getRuleFinalError(c, { row: a, col: i, unitId: r, subUnitId: s })
|
62
47
|
},
|
63
48
|
footer: {
|
64
49
|
title: An.createElement(
|
@@ -73,7 +58,7 @@ let ce = class extends Vt {
|
|
73
58
|
onClose: () => {
|
74
59
|
this._dialogService.close("reject-input-dialog");
|
75
60
|
}
|
76
|
-
}), o(Promise.resolve(
|
61
|
+
}), o(Promise.resolve(!1)));
|
77
62
|
}
|
78
63
|
}
|
79
64
|
);
|
@@ -104,17 +89,18 @@ let ce = class extends Vt {
|
|
104
89
|
});
|
105
90
|
}
|
106
91
|
};
|
107
|
-
ce =
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
92
|
+
ce = qa([
|
93
|
+
xt(0, b(vn)),
|
94
|
+
xt(1, b(at)),
|
95
|
+
xt(2, b(bt)),
|
96
|
+
xt(3, Na),
|
97
|
+
xt(4, b(Q)),
|
98
|
+
xt(5, b(_a))
|
113
99
|
], ce);
|
114
|
-
const
|
115
|
-
dvDateDropdown:
|
116
|
-
dvDateDropdownBtns:
|
117
|
-
},
|
100
|
+
const Ja = "univer-dv-date-dropdown", Qa = "univer-dv-date-dropdown-btns", Un = {
|
101
|
+
dvDateDropdown: Ja,
|
102
|
+
dvDateDropdownBtns: Qa
|
103
|
+
}, ti = (t) => {
|
118
104
|
if (t == null || typeof t == "boolean")
|
119
105
|
return;
|
120
106
|
if (typeof t == "number" || !Number.isNaN(+t))
|
@@ -123,20 +109,20 @@ const qa = "univer-dv-date-dropdown", Ja = "univer-dv-date-dropdown-btns", Un =
|
|
123
109
|
if (e.isValid())
|
124
110
|
return e;
|
125
111
|
};
|
126
|
-
function
|
112
|
+
function ei(t) {
|
127
113
|
var v;
|
128
|
-
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s, workbook: l } = e, c = T(tt), u = T(ce), h = n.getCell(a, i), d =
|
129
|
-
if (!
|
114
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s, workbook: l } = e, c = T(tt), u = T(ce), h = n.getCell(a, i), d = mt(n.getCellRaw(a, i)), C = ti(d), [p, R] = j(C), w = p && p.isValid() ? p : qe(), g = T(Q), f = T(at), _ = f.getRuleByLocation(r, s, a, i);
|
115
|
+
if (!_)
|
130
116
|
return null;
|
131
|
-
const V = f.getValidator(
|
117
|
+
const V = f.getValidator(_.type);
|
132
118
|
if (!h || !V)
|
133
119
|
return;
|
134
|
-
const
|
120
|
+
const S = !!((v = _.bizInfo) != null && v.showTime), I = async () => {
|
135
121
|
var F, N, B;
|
136
122
|
if (!w)
|
137
123
|
return;
|
138
|
-
const P = w.format(
|
139
|
-
|
124
|
+
const P = w.format(S ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (F = Je.parseDate(P)) == null ? void 0 : F.v, O = l.getStyles().getStyleByCell(h), L = (B = (N = O == null ? void 0 : O.n) == null ? void 0 : N.pattern) != null ? B : "", A = Ma(L);
|
125
|
+
_.errorStyle !== de.STOP || await V.validator({
|
140
126
|
value: U,
|
141
127
|
unitId: r,
|
142
128
|
subUnitId: s,
|
@@ -146,7 +132,7 @@ function ti(t) {
|
|
146
132
|
workbook: l,
|
147
133
|
interceptValue: P.replace("Z", "").replace("T", " "),
|
148
134
|
t: xo.NUMBER
|
149
|
-
},
|
135
|
+
}, _) ? (o(), await c.executeCommand(rn.id, {
|
150
136
|
visible: !1,
|
151
137
|
eventType: nn.Keyboard,
|
152
138
|
unitId: r,
|
@@ -168,11 +154,11 @@ function ti(t) {
|
|
168
154
|
si: null,
|
169
155
|
s: {
|
170
156
|
n: {
|
171
|
-
pattern:
|
157
|
+
pattern: S ? A === "datetime" ? L : "yyyy-MM-dd hh:mm:ss" : A === "date" ? L : "yyyy-MM-dd"
|
172
158
|
}
|
173
159
|
}
|
174
160
|
}
|
175
|
-
})) : u.showReject(V.getRuleFinalError(
|
161
|
+
})) : u.showReject(V.getRuleFinalError(_, { row: a, col: i, unitId: r, subUnitId: s }));
|
176
162
|
};
|
177
163
|
return /* @__PURE__ */ Y("div", { className: Un.dvDateDropdown, children: [
|
178
164
|
/* @__PURE__ */ m(
|
@@ -180,7 +166,7 @@ function ti(t) {
|
|
180
166
|
{
|
181
167
|
defaultValue: w,
|
182
168
|
pickerValue: w,
|
183
|
-
showTime:
|
169
|
+
showTime: S || void 0,
|
184
170
|
onSelect: async (y) => {
|
185
171
|
R(y);
|
186
172
|
},
|
@@ -193,15 +179,15 @@ function ti(t) {
|
|
193
179
|
/* @__PURE__ */ m("div", { className: Un.dvDateDropdownBtns, children: /* @__PURE__ */ m(Bt, { size: "small", type: "primary", onClick: I, disabled: !w.isValid(), children: g.t("dataValidation.alert.ok") }) })
|
194
180
|
] });
|
195
181
|
}
|
196
|
-
var
|
197
|
-
return
|
182
|
+
var ut = function() {
|
183
|
+
return ut = Object.assign || function(t) {
|
198
184
|
for (var e, o = 1, n = arguments.length; o < n; o++) {
|
199
185
|
e = arguments[o];
|
200
186
|
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
|
201
187
|
}
|
202
188
|
return t;
|
203
|
-
},
|
204
|
-
},
|
189
|
+
}, ut.apply(this, arguments);
|
190
|
+
}, ni = function(t, e) {
|
205
191
|
var o = {};
|
206
192
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
|
207
193
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
@@ -209,16 +195,16 @@ var ht = function() {
|
|
209
195
|
e.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[a]) && (o[n[a]] = t[n[a]]);
|
210
196
|
return o;
|
211
197
|
}, Ot = Mt(function(t, e) {
|
212
|
-
var o = t.icon, n = t.id, a = t.className, i = t.extend, r =
|
213
|
-
return Co(o, "".concat(n), { defIds: o.defIds, idSuffix: l.current },
|
198
|
+
var o = t.icon, n = t.id, a = t.className, i = t.extend, r = ni(t, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), l = Jt("_".concat(ii()));
|
199
|
+
return Co(o, "".concat(n), { defIds: o.defIds, idSuffix: l.current }, ut({ ref: e, className: s }, r), i);
|
214
200
|
});
|
215
201
|
function Co(t, e, o, n, a) {
|
216
|
-
return Et(t.tag,
|
202
|
+
return Et(t.tag, ut(ut({ key: e }, oi(t, o, a)), n), (ai(t, o).children || []).map(function(i, r) {
|
217
203
|
return Co(i, "".concat(e, "-").concat(t.tag, "-").concat(r), o, void 0, a);
|
218
204
|
}));
|
219
205
|
}
|
220
|
-
function
|
221
|
-
var n =
|
206
|
+
function oi(t, e, o) {
|
207
|
+
var n = ut({}, t.attrs);
|
222
208
|
o != null && o.colorChannel1 && n.fill === "colorChannel1" && (n.fill = o.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(i) {
|
223
209
|
var r = i[0], s = i[1];
|
224
210
|
r === "mask" && typeof s == "string" && (n[r] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
@@ -229,74 +215,74 @@ function ni(t, e, o) {
|
|
229
215
|
typeof s == "string" && (n[r] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
230
216
|
})), n;
|
231
217
|
}
|
232
|
-
function
|
218
|
+
function ai(t, e) {
|
233
219
|
var o, n = e.defIds;
|
234
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((o = t.children) === null || o === void 0) && o.length) ?
|
235
|
-
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ?
|
220
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((o = t.children) === null || o === void 0) && o.length) ? ut(ut({}, t), { children: t.children.map(function(a) {
|
221
|
+
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ut(ut({}, a), { attrs: ut(ut({}, a.attrs), { id: a.attrs.id + e.idSuffix }) }) : a;
|
236
222
|
}) }) : t;
|
237
223
|
}
|
238
|
-
function
|
224
|
+
function ii() {
|
239
225
|
return Math.random().toString(36).substring(2, 8);
|
240
226
|
}
|
241
227
|
Ot.displayName = "UniverIcon";
|
242
|
-
var
|
228
|
+
var ri = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Io = Mt(function(t, e) {
|
243
229
|
return Et(Ot, Object.assign({}, t, {
|
244
230
|
id: "check-mark-single",
|
245
231
|
ref: e,
|
246
|
-
icon:
|
232
|
+
icon: ri
|
247
233
|
}));
|
248
234
|
});
|
249
235
|
Io.displayName = "CheckMarkSingle";
|
250
|
-
var
|
236
|
+
var si = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.4917 3.07803C1.4917 2.19437 2.20804 1.47803 3.0917 1.47803H5.6917C6.57536 1.47803 7.2917 2.19437 7.2917 3.07803V5.67803C7.2917 6.56168 6.57535 7.27803 5.6917 7.27803H3.0917C2.20804 7.27803 1.4917 6.56168 1.4917 5.67803V3.07803ZM3.0917 2.67803C2.87078 2.67803 2.6917 2.85711 2.6917 3.07803V5.67803C2.6917 5.89894 2.87079 6.07803 3.0917 6.07803H5.6917C5.91261 6.07803 6.0917 5.89894 6.0917 5.67803V3.07803C6.0917 2.85711 5.91261 2.67803 5.6917 2.67803H3.0917Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.6175 2.45279C14.8518 2.68711 14.8518 3.06701 14.6175 3.30132L11.6151 6.30365C11.3957 6.52307 11.0451 6.53897 10.8067 6.34031L8.80915 4.67566C8.55458 4.46352 8.52019 4.08518 8.73233 3.83062 8.94447 3.57605 9.32281 3.54166 9.57737 3.7538L11.154 5.06767 13.769 2.45278C14.0033 2.21847 14.3832 2.21848 14.6175 2.45279zM14.1175 9.19746C14.3518 9.43178 14.3518 9.81168 14.1175 10.046L12.5418 11.6217 14.1175 13.1975C14.3518 13.4318 14.3518 13.8117 14.1175 14.046 13.8832 14.2803 13.5033 14.2803 13.269 14.046L11.6933 12.4703 10.1175 14.046C9.88321 14.2803 9.50331 14.2803 9.269 14.046 9.03468 13.8117 9.03468 13.4318 9.269 13.1975L10.8447 11.6217 9.269 10.046C9.03468 9.81168 9.03468 9.43178 9.269 9.19746 9.50331 8.96315 9.88321 8.96315 10.1175 9.19746L11.6933 10.7732 13.269 9.19746C13.5033 8.96315 13.8832 8.96315 14.1175 9.19746z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.0917 8.72168C2.20804 8.72168 1.4917 9.43802 1.4917 10.3217V12.9217C1.4917 13.8053 2.20804 14.5217 3.0917 14.5217H5.6917C6.57535 14.5217 7.2917 13.8053 7.2917 12.9217V10.3217C7.2917 9.43802 6.57536 8.72168 5.6917 8.72168H3.0917ZM2.6917 10.3217C2.6917 10.1008 2.87078 9.92168 3.0917 9.92168H5.6917C5.91261 9.92168 6.0917 10.1008 6.0917 10.3217V12.9217C6.0917 13.1426 5.91261 13.3217 5.6917 13.3217H3.0917C2.87079 13.3217 2.6917 13.1426 2.6917 12.9217V10.3217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wo = Mt(function(t, e) {
|
251
237
|
return Et(Ot, Object.assign({}, t, {
|
252
238
|
id: "data-validation-single",
|
253
239
|
ref: e,
|
254
|
-
icon:
|
240
|
+
icon: si
|
255
241
|
}));
|
256
242
|
});
|
257
243
|
wo.displayName = "DataValidationSingle";
|
258
|
-
var
|
244
|
+
var li = { 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 = Mt(function(t, e) {
|
259
245
|
return Et(Ot, Object.assign({}, t, {
|
260
246
|
id: "delete-single",
|
261
247
|
ref: e,
|
262
|
-
icon:
|
248
|
+
icon: li
|
263
249
|
}));
|
264
250
|
});
|
265
251
|
Rn.displayName = "DeleteSingle";
|
266
|
-
var
|
252
|
+
var di = { 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 = Mt(function(t, e) {
|
267
253
|
return Et(Ot, Object.assign({}, t, {
|
268
254
|
id: "increase-single",
|
269
255
|
ref: e,
|
270
|
-
icon:
|
256
|
+
icon: di
|
271
257
|
}));
|
272
258
|
});
|
273
259
|
Ro.displayName = "IncreaseSingle";
|
274
|
-
var
|
260
|
+
var ci = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Do = Mt(function(t, e) {
|
275
261
|
return Et(Ot, Object.assign({}, t, {
|
276
262
|
id: "more-down-single",
|
277
263
|
ref: e,
|
278
|
-
icon:
|
264
|
+
icon: ci
|
279
265
|
}));
|
280
266
|
});
|
281
267
|
Do.displayName = "MoreDownSingle";
|
282
|
-
var
|
268
|
+
var ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Vo = Mt(function(t, e) {
|
283
269
|
return Et(Ot, Object.assign({}, t, {
|
284
270
|
id: "more-up-single",
|
285
271
|
ref: e,
|
286
|
-
icon:
|
272
|
+
icon: ui
|
287
273
|
}));
|
288
274
|
});
|
289
275
|
Vo.displayName = "MoreUpSingle";
|
290
|
-
var
|
276
|
+
var hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_622_8", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { fill: "currentColor", mask: "url(#mask0_622_8)" }, children: [{ tag: "path", attrs: { d: "M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z" } }] }] }, yo = Mt(function(t, e) {
|
291
277
|
return Et(Ot, Object.assign({}, t, {
|
292
278
|
id: "sequence-single",
|
293
279
|
ref: e,
|
294
|
-
icon:
|
280
|
+
icon: hi
|
295
281
|
}));
|
296
282
|
});
|
297
283
|
yo.displayName = "SequenceSingle";
|
298
|
-
var
|
299
|
-
for (var a = n > 1 ? void 0 : n ?
|
284
|
+
var pi = Object.getOwnPropertyDescriptor, mi = (t, e, o, n) => {
|
285
|
+
for (var a = n > 1 ? void 0 : n ? pi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
300
286
|
(r = t[i]) && (a = r(a) || a);
|
301
287
|
return a;
|
302
288
|
}, Bn = (t, e) => (o, n) => e(o, n, t);
|
@@ -304,7 +290,7 @@ let ft = class extends Vt {
|
|
304
290
|
constructor(e, o) {
|
305
291
|
super();
|
306
292
|
E(this, "_open$", new Nn(!1));
|
307
|
-
E(this, "open$", this._open$.pipe(
|
293
|
+
E(this, "open$", this._open$.pipe(Ya()));
|
308
294
|
E(this, "_activeRule");
|
309
295
|
E(this, "_activeRule$", new Nn(void 0));
|
310
296
|
E(this, "activeRule$", this._activeRule$.asObservable());
|
@@ -345,11 +331,11 @@ let ft = class extends Vt {
|
|
345
331
|
this._activeRule = e, this._activeRule$.next(e);
|
346
332
|
}
|
347
333
|
};
|
348
|
-
ft =
|
349
|
-
Bn(0,
|
334
|
+
ft = mi([
|
335
|
+
Bn(0, rt),
|
350
336
|
Bn(1, mo)
|
351
337
|
], ft);
|
352
|
-
function
|
338
|
+
function gi() {
|
353
339
|
const t = T(Dt), e = St(t.activeDropdown$, t.activeDropdown), o = T(Ae);
|
354
340
|
if (!e)
|
355
341
|
return null;
|
@@ -366,8 +352,8 @@ function mi() {
|
|
366
352
|
) : null;
|
367
353
|
}
|
368
354
|
const Mo = "sheet.ui.dropdown";
|
369
|
-
var
|
370
|
-
for (var a = n > 1 ? void 0 : n ?
|
355
|
+
var fi = Object.getOwnPropertyDescriptor, vi = (t, e, o, n) => {
|
356
|
+
for (var a = n > 1 ? void 0 : n ? fi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
371
357
|
(r = t[i]) && (a = r(a) || a);
|
372
358
|
return a;
|
373
359
|
}, Lt = (t, e) => (o, n) => e(o, n, t);
|
@@ -375,7 +361,7 @@ let Dt = class extends Vt {
|
|
375
361
|
constructor(e, o, n, a, i, r, s) {
|
376
362
|
super();
|
377
363
|
E(this, "_activeDropdown");
|
378
|
-
E(this, "_activeDropdown$", new
|
364
|
+
E(this, "_activeDropdown$", new Xa());
|
379
365
|
E(this, "_currentPopup", null);
|
380
366
|
E(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
381
367
|
E(this, "_zenVisible", !1);
|
@@ -470,9 +456,9 @@ let Dt = class extends Vt {
|
|
470
456
|
});
|
471
457
|
}
|
472
458
|
};
|
473
|
-
Dt =
|
474
|
-
Lt(0, b(
|
475
|
-
Lt(1,
|
459
|
+
Dt = vi([
|
460
|
+
Lt(0, b(Ea)),
|
461
|
+
Lt(1, rt),
|
476
462
|
Lt(2, b(bt)),
|
477
463
|
Lt(3, go),
|
478
464
|
Lt(4, yt),
|
@@ -481,11 +467,11 @@ Dt = fi([
|
|
481
467
|
], Dt);
|
482
468
|
const Me = "DataValidationPanel", Ht = {
|
483
469
|
id: "data-validation.operation.open-validation-panel",
|
484
|
-
type:
|
470
|
+
type: ae.OPERATION,
|
485
471
|
handler(t, e) {
|
486
472
|
if (!e)
|
487
473
|
return !1;
|
488
|
-
const { ruleId: o, isAdd: n } = e, a = t.get(ft), i = t.get(ke), r = t.get(
|
474
|
+
const { ruleId: o, isAdd: n } = e, a = t.get(ft), i = t.get(ke), r = t.get(rt), s = t.get(mo), l = to(r);
|
489
475
|
if (!l) return !1;
|
490
476
|
const { unitId: c, subUnitId: u } = l, h = o ? i.getRuleById(c, u, o) : void 0;
|
491
477
|
a.open(), a.setActiveRule(h && {
|
@@ -504,19 +490,19 @@ const Me = "DataValidationPanel", Ht = {
|
|
504
490
|
}
|
505
491
|
}, Dn = {
|
506
492
|
id: "data-validation.operation.close-validation-panel",
|
507
|
-
type:
|
493
|
+
type: ae.OPERATION,
|
508
494
|
handler(t) {
|
509
495
|
return t.get(ft).close(), !0;
|
510
496
|
}
|
511
497
|
}, Eo = {
|
512
498
|
id: "data-validation.operation.toggle-validation-panel",
|
513
|
-
type:
|
499
|
+
type: ae.OPERATION,
|
514
500
|
handler(t) {
|
515
501
|
const e = t.get(tt), o = t.get(ft);
|
516
502
|
return o.open(), o.isOpen ? e.executeCommand(Dn.id) : e.executeCommand(Ht.id), !0;
|
517
503
|
}
|
518
504
|
}, Fe = {
|
519
|
-
type:
|
505
|
+
type: ae.OPERATION,
|
520
506
|
id: "sheet.operation.show-data-validation-dropdown",
|
521
507
|
handler(t, e) {
|
522
508
|
if (!e)
|
@@ -530,33 +516,33 @@ const Me = "DataValidationPanel", Ht = {
|
|
530
516
|
), !0;
|
531
517
|
}
|
532
518
|
}, bo = {
|
533
|
-
type:
|
519
|
+
type: ae.OPERATION,
|
534
520
|
id: "sheet.operation.hide-data-validation-dropdown",
|
535
521
|
handler(t, e) {
|
536
522
|
return e ? (t.get(Dt).hideDropdown(), !0) : !1;
|
537
523
|
}
|
538
|
-
}, Ft = "#ECECEC", Vn = "sheets-data-validation-ui.config", Ee = {},
|
539
|
-
dvListDropdown:
|
540
|
-
dvListDropdownTitle:
|
541
|
-
dvListDropdownList:
|
542
|
-
dvListDropdownListContainer:
|
543
|
-
dvListDropdownSelectedIcon:
|
544
|
-
dvListDropdownItemContainer:
|
545
|
-
dvListDropdownItem:
|
546
|
-
dvListDropdownSplit:
|
547
|
-
dvListDropdownEdit:
|
548
|
-
},
|
549
|
-
var
|
550
|
-
const { value: e, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: s, filter: l, location: c } = t, u = T(Q), h = T(mn), d = l == null ? void 0 : l.toLowerCase(), { row:
|
524
|
+
}, Ft = "#ECECEC", Vn = "sheets-data-validation-ui.config", Ee = {}, _i = "univer-dv-list-dropdown", Si = "univer-dv-list-dropdown-title", Ci = "univer-dv-list-dropdown-list", Ii = "univer-dv-list-dropdown-list-container", wi = "univer-dv-list-dropdown-selected-icon", Ri = "univer-dv-list-dropdown-item-container", Di = "univer-dv-list-dropdown-item", Vi = "univer-dv-list-dropdown-split", yi = "univer-dv-list-dropdown-edit", _t = {
|
525
|
+
dvListDropdown: _i,
|
526
|
+
dvListDropdownTitle: Si,
|
527
|
+
dvListDropdownList: Ci,
|
528
|
+
dvListDropdownListContainer: Ii,
|
529
|
+
dvListDropdownSelectedIcon: wi,
|
530
|
+
dvListDropdownItemContainer: Ri,
|
531
|
+
dvListDropdownItem: Di,
|
532
|
+
dvListDropdownSplit: Vi,
|
533
|
+
dvListDropdownEdit: yi
|
534
|
+
}, Mi = (t) => {
|
535
|
+
var S, I;
|
536
|
+
const { value: e, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: s, filter: l, location: c } = t, u = T(Q), h = T(mn), d = l == null ? void 0 : l.toLowerCase(), { row: C, col: p, unitId: R, subUnitId: w } = c, g = a.filter((v) => d ? v.label.toLowerCase().includes(d) : !0), f = (I = (S = h.getConfig(Vn)) == null ? void 0 : S.showEditOnDropdown) != null ? I : !0, _ = T(eo), V = $t(() => _.permissionCheckWithRanges(
|
551
537
|
{
|
552
538
|
workbookTypes: [Ve],
|
553
539
|
rangeTypes: [De],
|
554
540
|
worksheetTypes: [Re]
|
555
541
|
},
|
556
|
-
[{ startColumn: p, startRow:
|
542
|
+
[{ startColumn: p, startRow: C, endColumn: p, endRow: C }],
|
557
543
|
R,
|
558
544
|
w
|
559
|
-
), [
|
545
|
+
), [_, p, C, R, w]);
|
560
546
|
return /* @__PURE__ */ Y("div", { className: _t.dvListDropdown, style: s, children: [
|
561
547
|
/* @__PURE__ */ m("div", { className: _t.dvListDropdownTitle, children: i }),
|
562
548
|
/* @__PURE__ */ m("div", { className: _t.dvListDropdownList, children: /* @__PURE__ */ m(ia, { children: /* @__PURE__ */ m("div", { className: _t.dvListDropdownListContainer, children: g.map((v, y) => {
|
@@ -583,19 +569,19 @@ const Me = "DataValidationPanel", Ht = {
|
|
583
569
|
] }) : null
|
584
570
|
] });
|
585
571
|
};
|
586
|
-
function
|
572
|
+
function Ei(t) {
|
587
573
|
var N, B, x, z;
|
588
|
-
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s } = e, l = T(ke), [c, u] = j(""), h = T(tt), d = T(Q), [
|
574
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s } = e, l = T(ke), [c, u] = j(""), h = T(tt), d = T(Q), [C, p] = j(""), R = T(ho), w = T(rt), g = $t(() => l.ruleChange$.pipe(wn(16)), []), f = T(at);
|
589
575
|
St(g);
|
590
|
-
const
|
576
|
+
const _ = Ua.useContext(), V = ((B = (N = _.current) == null ? void 0 : N.right) != null ? B : 0) - ((z = (x = _.current) == null ? void 0 : x.left) != null ? z : 0);
|
591
577
|
if (wt(() => {
|
592
578
|
const H = h.onCommandExecuted((G) => {
|
593
579
|
var J, et;
|
594
|
-
if (G.id ===
|
595
|
-
const nt = G.params, { unitId:
|
580
|
+
if (G.id === ja.id) {
|
581
|
+
const nt = G.params, { unitId: st } = nt, it = w.getUnit(st, X.UNIVER_DOC);
|
596
582
|
if (!it || !R.isVisible().visible) return;
|
597
|
-
const
|
598
|
-
u(
|
583
|
+
const lt = zo.transform.getPlainText((et = (J = it.getSnapshot().body) == null ? void 0 : J.dataStream) != null ? et : "");
|
584
|
+
u(lt);
|
599
585
|
}
|
600
586
|
});
|
601
587
|
return () => {
|
@@ -603,18 +589,18 @@ function Mi(t) {
|
|
603
589
|
};
|
604
590
|
}, [h, R, w]), !n)
|
605
591
|
return null;
|
606
|
-
const
|
607
|
-
if (!
|
592
|
+
const S = f.getRuleByLocation(r, s, a, i);
|
593
|
+
if (!S)
|
608
594
|
return null;
|
609
|
-
const I = f.getValidator(
|
595
|
+
const I = f.getValidator(S.type);
|
610
596
|
if (!I)
|
611
597
|
return null;
|
612
|
-
const v = n.getCell(a, i), y = (
|
613
|
-
if (!v || !
|
598
|
+
const v = n.getCell(a, i), y = (S == null ? void 0 : S.renderMode) === ct.CUSTOM || (S == null ? void 0 : S.renderMode) === void 0;
|
599
|
+
if (!v || !S || !I || I.id.indexOf(K.LIST) !== 0)
|
614
600
|
return;
|
615
|
-
const P =
|
601
|
+
const P = S.type === K.LIST_MULTIPLE, U = I.getListWithColor(S, r, s), O = C || Sa(n.getCellRaw(a, i)), L = ao(O), A = () => {
|
616
602
|
h.executeCommand(Ht.id, {
|
617
|
-
ruleId:
|
603
|
+
ruleId: S.uid
|
618
604
|
}), o();
|
619
605
|
}, F = U.map((H) => ({
|
620
606
|
label: H.label,
|
@@ -622,7 +608,7 @@ function Mi(t) {
|
|
622
608
|
color: y || H.color ? H.color : "transparent"
|
623
609
|
}));
|
624
610
|
return /* @__PURE__ */ m(
|
625
|
-
|
611
|
+
Mi,
|
626
612
|
{
|
627
613
|
style: { minWidth: V, maxWidth: Math.max(V, 200) },
|
628
614
|
title: P ? d.t("dataValidation.listMultiple.dropdown") : d.t("dataValidation.list.dropdown"),
|
@@ -664,11 +650,11 @@ function Mi(t) {
|
|
664
650
|
}
|
665
651
|
);
|
666
652
|
}
|
667
|
-
const
|
668
|
-
dataValidationOptionsButton:
|
669
|
-
dataValidationOptionsButtonIcon:
|
653
|
+
const bi = "univer-data-validation-options-button", Oi = "univer-data-validation-options-button-icon", We = {
|
654
|
+
dataValidationOptionsButton: bi,
|
655
|
+
dataValidationOptionsButtonIcon: Oi
|
670
656
|
};
|
671
|
-
function
|
657
|
+
function Li(t) {
|
672
658
|
var c;
|
673
659
|
const e = T(Q), o = T(Ae), { value: n, onChange: a, extraComponent: i } = t, [r, s] = j(!1), l = i ? o.get(i) : null;
|
674
660
|
return /* @__PURE__ */ Y(Rt, { children: [
|
@@ -685,11 +671,11 @@ function Oi(t) {
|
|
685
671
|
children: /* @__PURE__ */ Y(
|
686
672
|
fn,
|
687
673
|
{
|
688
|
-
value: `${(c = n.errorStyle) != null ? c :
|
674
|
+
value: `${(c = n.errorStyle) != null ? c : de.WARNING}`,
|
689
675
|
onChange: (u) => a({ ...n, errorStyle: +u }),
|
690
676
|
children: [
|
691
|
-
/* @__PURE__ */ m(Nt, { value: `${
|
692
|
-
/* @__PURE__ */ m(Nt, { value: `${
|
677
|
+
/* @__PURE__ */ m(Nt, { value: `${de.WARNING}`, children: e.t("dataValidation.panel.showWarning") }),
|
678
|
+
/* @__PURE__ */ m(Nt, { value: `${de.STOP}`, children: e.t("dataValidation.panel.rejectInput") })
|
693
679
|
]
|
694
680
|
}
|
695
681
|
)
|
@@ -716,25 +702,25 @@ function Oi(t) {
|
|
716
702
|
] })
|
717
703
|
] });
|
718
704
|
}
|
719
|
-
const
|
720
|
-
dataValidationDetail:
|
721
|
-
dataValidationDetailFormItem:
|
722
|
-
dataValidationDetailButtons:
|
723
|
-
dataValidationDetailButton:
|
724
|
-
},
|
705
|
+
const Ti = "univer-data-validation-detail", Pi = "univer-data-validation-detail-form-item", Ai = "univer-data-validation-detail-buttons", ki = "univer-data-validation-detail-button", jt = {
|
706
|
+
dataValidationDetail: Ti,
|
707
|
+
dataValidationDetailFormItem: Pi,
|
708
|
+
dataValidationDetailButtons: Ai,
|
709
|
+
dataValidationDetailButton: ki
|
710
|
+
}, Fi = (t) => Ko(
|
725
711
|
async (e, o, n, a) => {
|
726
712
|
const i = await t.executeCommand(e, o, n);
|
727
713
|
a == null || a(i);
|
728
714
|
},
|
729
715
|
1e3
|
730
716
|
);
|
731
|
-
function
|
717
|
+
function Ni(t, e, o) {
|
732
718
|
var n, a, i, r;
|
733
719
|
return e ? ((a = (n = t.getUnit(e)) == null ? void 0 : n.getSheetBySheetName(o)) == null ? void 0 : a.getSheetId()) || "" : ((r = (i = t.getCurrentUnitForType(X.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(o)) == null ? void 0 : r.getSheetId()) || "";
|
734
720
|
}
|
735
|
-
function
|
736
|
-
var
|
737
|
-
const [t, e] = j(0), o = T(ft), n = St(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, s = r.uid, l = T(bt), c = T(
|
721
|
+
function Ui() {
|
722
|
+
var lt;
|
723
|
+
const [t, e] = j(0), o = T(ft), n = St(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, s = r.uid, l = T(bt), c = T(rt), u = T(Ae), h = T(tt), d = T(ke), C = T(Q), [p, R] = j(r), w = l.getValidatorItem(p.type), [g, f] = j(!1), _ = l.getValidatorsByScope(Ha.SHEET), [V, S] = j(() => p.ranges.map((M) => ({ unitId: "", sheetId: "", range: M }))), I = $t(() => Fi(h), [h]), [v, y] = j(!1), [P, U] = j(!1), O = Jt(null), L = T(Qn);
|
738
724
|
if (wt(() => () => {
|
739
725
|
const M = L.getCurrentLastSelection();
|
740
726
|
M && L.setSelections([M]);
|
@@ -742,19 +728,19 @@ function Ni() {
|
|
742
728
|
h.onCommandExecuted((M) => {
|
743
729
|
(M.id === Go.id || M.id === Zo.id) && setTimeout(() => {
|
744
730
|
const D = d.getRuleById(a, i, s);
|
745
|
-
e((k) => k + 1), D && (R(D),
|
731
|
+
e((k) => k + 1), D && (R(D), S(D.ranges.map((k) => ({ unitId: "", sheetId: "", range: k }))));
|
746
732
|
}, 20);
|
747
733
|
});
|
748
734
|
}, [h, d, s, i, a]), !w)
|
749
735
|
return null;
|
750
|
-
const A = w.operators, F = w.operatorNames, N = p.operator ?
|
736
|
+
const A = w.operators, F = w.operatorNames, N = p.operator ? xa.includes(p.operator) : !1, B = () => {
|
751
737
|
var M, D, k;
|
752
738
|
(D = (M = O.current) == null ? void 0 : M.editor) != null && D.isFocus() && x((k = O.current) == null ? void 0 : k.getValue()), !(!p.ranges.length || v) && (w.validatorFormula(p, a, i).success ? o.setActiveRule(null) : f(!0));
|
753
739
|
}, x = dn((M) => {
|
754
|
-
const D = M.split(",").filter(Boolean).map(
|
740
|
+
const D = M.split(",").filter(Boolean).map(Ka).map((W) => {
|
755
741
|
const Ct = W.sheetName;
|
756
742
|
if (Ct) {
|
757
|
-
const $o =
|
743
|
+
const $o = Ni(c, W.unitId, Ct);
|
758
744
|
return { ...W, sheetId: $o };
|
759
745
|
}
|
760
746
|
return {
|
@@ -764,7 +750,7 @@ function Ni() {
|
|
764
750
|
});
|
765
751
|
if (qo(D, V))
|
766
752
|
return;
|
767
|
-
|
753
|
+
S(D);
|
768
754
|
const k = D.filter((W) => (!W.unitId || W.unitId === a) && (!W.sheetId || W.sheetId === i)).map((W) => W.range);
|
769
755
|
if (R({
|
770
756
|
...p,
|
@@ -828,12 +814,12 @@ function Ni() {
|
|
828
814
|
ruleId: p.uid,
|
829
815
|
setting: Fn(W)
|
830
816
|
});
|
831
|
-
}, et = u.get(w.formulaInput), nt = $t(() => V.map((M) => _o(M.range)).join(","), []),
|
817
|
+
}, et = u.get(w.formulaInput), nt = $t(() => V.map((M) => _o(M.range)).join(","), []), st = kn(p), it = (M) => {
|
832
818
|
En(M, kn(p)) || (R({
|
833
819
|
...p,
|
834
820
|
...M
|
835
821
|
}), I(
|
836
|
-
|
822
|
+
Ca.id,
|
837
823
|
{
|
838
824
|
unitId: a,
|
839
825
|
subUnitId: i,
|
@@ -842,14 +828,14 @@ function Ni() {
|
|
842
828
|
}
|
843
829
|
));
|
844
830
|
};
|
845
|
-
return /* @__PURE__ */ Y("div", { className:
|
831
|
+
return /* @__PURE__ */ Y("div", { className: jt.dataValidationDetail, children: [
|
846
832
|
/* @__PURE__ */ m(
|
847
833
|
q,
|
848
834
|
{
|
849
|
-
label:
|
850
|
-
error: !p.ranges.length || v ?
|
835
|
+
label: C.t("dataValidation.panel.range"),
|
836
|
+
error: !p.ranges.length || v ? C.t("dataValidation.panel.rangeError") : "",
|
851
837
|
children: /* @__PURE__ */ m(
|
852
|
-
|
838
|
+
Ga,
|
853
839
|
{
|
854
840
|
selectorRef: O,
|
855
841
|
unitId: a,
|
@@ -868,19 +854,19 @@ function Ni() {
|
|
868
854
|
)
|
869
855
|
}
|
870
856
|
),
|
871
|
-
/* @__PURE__ */ m(q, { label:
|
857
|
+
/* @__PURE__ */ m(q, { label: C.t("dataValidation.panel.type"), children: /* @__PURE__ */ m(
|
872
858
|
en,
|
873
859
|
{
|
874
|
-
options:
|
875
|
-
label:
|
860
|
+
options: _ == null ? void 0 : _.map((M) => ({
|
861
|
+
label: C.t(M.title),
|
876
862
|
value: M.id
|
877
863
|
})),
|
878
864
|
value: p.type,
|
879
865
|
onChange: J,
|
880
|
-
className:
|
866
|
+
className: jt.dataValidationDetailFormItem
|
881
867
|
}
|
882
868
|
) }),
|
883
|
-
A != null && A.length ? /* @__PURE__ */ m(q, { label:
|
869
|
+
A != null && A.length ? /* @__PURE__ */ m(q, { label: C.t("dataValidation.panel.operator"), children: /* @__PURE__ */ m(
|
884
870
|
en,
|
885
871
|
{
|
886
872
|
options: A.map((M, D) => ({
|
@@ -894,10 +880,10 @@ function Ni() {
|
|
894
880
|
operator: M
|
895
881
|
});
|
896
882
|
},
|
897
|
-
className:
|
883
|
+
className: jt.dataValidationDetailFormItem
|
898
884
|
}
|
899
885
|
) }) : null,
|
900
|
-
et ? /* @__PURE__ */ m(
|
886
|
+
et ? /* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
901
887
|
et,
|
902
888
|
{
|
903
889
|
isTwoFormula: N,
|
@@ -918,11 +904,11 @@ function Ni() {
|
|
918
904
|
ruleId: s
|
919
905
|
},
|
920
906
|
t + p.type
|
921
|
-
) : null,
|
907
|
+
) }) : null,
|
922
908
|
/* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
923
909
|
Pe,
|
924
910
|
{
|
925
|
-
checked: (
|
911
|
+
checked: (lt = p.allowBlank) != null ? lt : !0,
|
926
912
|
onChange: () => {
|
927
913
|
var M;
|
928
914
|
return z({
|
@@ -930,25 +916,25 @@ function Ni() {
|
|
930
916
|
allowBlank: !((M = p.allowBlank) == null || M)
|
931
917
|
});
|
932
918
|
},
|
933
|
-
children:
|
919
|
+
children: C.t("dataValidation.panel.allowBlank")
|
934
920
|
}
|
935
921
|
) }),
|
936
|
-
/* @__PURE__ */ m(
|
937
|
-
/* @__PURE__ */ Y("div", { className:
|
938
|
-
/* @__PURE__ */ m(Bt, { className:
|
939
|
-
/* @__PURE__ */ m(Bt, { className:
|
922
|
+
/* @__PURE__ */ m(Li, { value: st, onChange: it, extraComponent: w.optionsInput }),
|
923
|
+
/* @__PURE__ */ Y("div", { className: jt.dataValidationDetailButtons, children: [
|
924
|
+
/* @__PURE__ */ m(Bt, { className: jt.dataValidationDetailButton, onClick: H, children: C.t("dataValidation.panel.removeRule") }),
|
925
|
+
/* @__PURE__ */ m(Bt, { className: jt.dataValidationDetailButton, type: "primary", onClick: B, children: C.t("dataValidation.panel.done") })
|
940
926
|
] })
|
941
927
|
] });
|
942
928
|
}
|
943
|
-
const
|
944
|
-
dataValidationItemContainer:
|
945
|
-
dataValidationItemTitle:
|
946
|
-
dataValidationItemContent:
|
947
|
-
dataValidationItemIcon:
|
948
|
-
},
|
949
|
-
const { rule: e, onClick: o, unitId: n, subUnitId: a, disable: i } = t, r = T(bt), s = T(tt), l = T(
|
950
|
-
var
|
951
|
-
const g = (
|
929
|
+
const Bi = "univer-data-validation-item-container", $i = "univer-data-validation-item-title", Wi = "univer-data-validation-item-content", Hi = "univer-data-validation-item-icon", pe = {
|
930
|
+
dataValidationItemContainer: Bi,
|
931
|
+
dataValidationItemTitle: $i,
|
932
|
+
dataValidationItemContent: Wi,
|
933
|
+
dataValidationItemIcon: Hi
|
934
|
+
}, xi = (t) => {
|
935
|
+
const { rule: e, onClick: o, unitId: n, subUnitId: a, disable: i } = t, r = T(bt), s = T(tt), l = T(ba), c = r.getValidatorItem(e.type), u = Jt(void 0), [h, d] = j(!1), C = T(zn), p = St(C.currentTheme$), R = $t(() => {
|
936
|
+
var _;
|
937
|
+
const g = (_ = p == null ? void 0 : p.loopColor2) != null ? _ : "#49B811", f = new Jo(g).toRgb();
|
952
938
|
return {
|
953
939
|
fill: `rgba(${f.r}, ${f.g}, ${f.b}, 0.1)`,
|
954
940
|
stroke: g
|
@@ -990,47 +976,47 @@ const Ui = "univer-data-validation-item-container", Bi = "univer-data-validation
|
|
990
976
|
]
|
991
977
|
}
|
992
978
|
);
|
993
|
-
},
|
994
|
-
dataValidationList:
|
995
|
-
dataValidationListButtons:
|
996
|
-
dataValidationListButton:
|
979
|
+
}, ji = "univer-data-validation-list", Yi = "univer-data-validation-list-buttons", Xi = "univer-data-validation-list-button", me = {
|
980
|
+
dataValidationList: ji,
|
981
|
+
dataValidationListButtons: Yi,
|
982
|
+
dataValidationListButton: Xi
|
997
983
|
};
|
998
|
-
function
|
999
|
-
const e = T(at), o = T(
|
984
|
+
function zi(t) {
|
985
|
+
const e = T(at), o = T(rt), n = T(tt), a = T(Wt), i = T(ft), r = T(Q), [s, l] = j([]), { workbook: c } = t, u = St(c.activeSheet$, void 0, !0), h = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
1000
986
|
wt(() => {
|
1001
987
|
l(e.getRules(h, d));
|
1002
|
-
const f = e.ruleChange$.subscribe((
|
1003
|
-
|
988
|
+
const f = e.ruleChange$.subscribe((_) => {
|
989
|
+
_.unitId === h && _.subUnitId === d && l(e.getRules(h, d));
|
1004
990
|
});
|
1005
991
|
return () => {
|
1006
992
|
f.unsubscribe();
|
1007
993
|
};
|
1008
994
|
}, [h, d, e]);
|
1009
|
-
const
|
1010
|
-
const f = lo(a),
|
995
|
+
const C = async () => {
|
996
|
+
const f = lo(a), _ = {
|
1011
997
|
unitId: h,
|
1012
998
|
subUnitId: d,
|
1013
999
|
rule: f
|
1014
1000
|
};
|
1015
|
-
await n.executeCommand(Sn.id,
|
1001
|
+
await n.executeCommand(Sn.id, _), i.setActiveRule({
|
1016
1002
|
unitId: h,
|
1017
1003
|
subUnitId: d,
|
1018
1004
|
rule: f
|
1019
1005
|
});
|
1020
1006
|
}, p = () => {
|
1021
|
-
n.executeCommand(
|
1007
|
+
n.executeCommand(Ia.id, {
|
1022
1008
|
unitId: h,
|
1023
1009
|
subUnitId: d
|
1024
1010
|
});
|
1025
1011
|
}, w = ((f) => {
|
1026
|
-
const
|
1027
|
-
return f.map((y) => fa(a,
|
1012
|
+
const _ = o.getCurrentUnitForType(X.UNIVER_SHEET), V = _.getActiveSheet(), S = _.getUnitId(), I = V.getSheetId();
|
1013
|
+
return f.map((y) => fa(a, S, I, y.ranges) ? { ...y } : { ...y, disable: !0 });
|
1028
1014
|
})(s), g = w == null ? void 0 : w.some((f) => f.disable);
|
1029
1015
|
return /* @__PURE__ */ Y("div", { className: me.dataValidationList, children: [
|
1030
1016
|
w == null ? void 0 : w.map((f) => {
|
1031
|
-
var
|
1017
|
+
var _;
|
1032
1018
|
return /* @__PURE__ */ m(
|
1033
|
-
|
1019
|
+
xi,
|
1034
1020
|
{
|
1035
1021
|
unitId: h,
|
1036
1022
|
subUnitId: d,
|
@@ -1042,33 +1028,33 @@ function Xi(t) {
|
|
1042
1028
|
});
|
1043
1029
|
},
|
1044
1030
|
rule: f,
|
1045
|
-
disable: (
|
1031
|
+
disable: (_ = f.disable) != null ? _ : !1
|
1046
1032
|
},
|
1047
1033
|
f.uid
|
1048
1034
|
);
|
1049
1035
|
}),
|
1050
1036
|
/* @__PURE__ */ Y("div", { className: me.dataValidationListButtons, children: [
|
1051
1037
|
s.length && !g ? /* @__PURE__ */ m(Bt, { className: me.dataValidationListButton, onClick: p, children: r.t("dataValidation.panel.removeAll") }) : null,
|
1052
|
-
/* @__PURE__ */ m(Bt, { className: me.dataValidationListButton, type: "primary", onClick:
|
1038
|
+
/* @__PURE__ */ m(Bt, { className: me.dataValidationListButton, type: "primary", onClick: C, children: r.t("dataValidation.panel.add") })
|
1053
1039
|
] })
|
1054
1040
|
] });
|
1055
1041
|
}
|
1056
|
-
const
|
1057
|
-
const t = T(ft), e = St(t.activeRule$, t.activeRule), o = T(
|
1042
|
+
const Ki = () => {
|
1043
|
+
const t = T(ft), e = St(t.activeRule$, t.activeRule), o = T(rt), n = St(
|
1058
1044
|
() => o.getCurrentTypeOfUnit$(X.UNIVER_SHEET),
|
1059
1045
|
void 0,
|
1060
1046
|
void 0,
|
1061
1047
|
[]
|
1062
1048
|
), a = St(() => {
|
1063
1049
|
var i;
|
1064
|
-
return (i = n == null ? void 0 : n.activeSheet$) != null ? i :
|
1050
|
+
return (i = n == null ? void 0 : n.activeSheet$) != null ? i : za(null);
|
1065
1051
|
}, void 0, void 0, []);
|
1066
|
-
return !n || !a ? null : e && e.subUnitId === a.getSheetId() ? /* @__PURE__ */ m(
|
1052
|
+
return !n || !a ? null : e && e.subUnitId === a.getSheetId() ? /* @__PURE__ */ m(Ui, {}, e.rule.uid) : /* @__PURE__ */ m(zi, { workbook: n });
|
1067
1053
|
}, yn = "data-validation.list.dropdown", Oo = "data-validation.date.dropdown", Ne = {
|
1068
|
-
type:
|
1054
|
+
type: ae.COMMAND,
|
1069
1055
|
id: "data-validation.command.addRuleAndOpen",
|
1070
1056
|
handler(t) {
|
1071
|
-
const e = t.get(
|
1057
|
+
const e = t.get(rt), o = to(e);
|
1072
1058
|
if (!o) return !1;
|
1073
1059
|
const { workbook: n, worksheet: a } = o, i = lo(t), r = t.get(tt), s = n.getUnitId(), l = a.getSheetId(), c = {
|
1074
1060
|
rule: i,
|
@@ -1081,11 +1067,11 @@ const zi = () => {
|
|
1081
1067
|
}), !0) : !1;
|
1082
1068
|
}
|
1083
1069
|
};
|
1084
|
-
var
|
1085
|
-
for (var a = n > 1 ? void 0 : n ?
|
1070
|
+
var Gi = Object.getOwnPropertyDescriptor, Zi = (t, e, o, n) => {
|
1071
|
+
for (var a = n > 1 ? void 0 : n ? Gi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1086
1072
|
(r = t[i]) && (a = r(a) || a);
|
1087
1073
|
return a;
|
1088
|
-
},
|
1074
|
+
}, Yt = (t, e) => (o, n) => e(o, n, t);
|
1089
1075
|
const Tt = "SHEET_DATA_VALIDATION_ALERT";
|
1090
1076
|
let ue = class extends Vt {
|
1091
1077
|
constructor(t, e, o, n, a, i) {
|
@@ -1105,7 +1091,7 @@ let ue = class extends Vt {
|
|
1105
1091
|
this._cellAlertManagerService.removeAlert(Tt);
|
1106
1092
|
return;
|
1107
1093
|
}
|
1108
|
-
if (this._dataValidationModel.validator(a, { ...t.location, workbook: o, worksheet: n }) ===
|
1094
|
+
if (this._dataValidationModel.validator(a, { ...t.location, workbook: o, worksheet: n }) === Kt.INVALID) {
|
1109
1095
|
const r = this._cellAlertManagerService.currentAlert.get(Tt), s = (e = r == null ? void 0 : r.alert) == null ? void 0 : e.location;
|
1110
1096
|
if (s && s.row === t.location.row && s.col === t.location.col && s.subUnitId === t.location.subUnitId && s.unitId === t.location.unitId) {
|
1111
1097
|
this._cellAlertManagerService.removeAlert(Tt);
|
@@ -1117,7 +1103,7 @@ let ue = class extends Vt {
|
|
1117
1103
|
return;
|
1118
1104
|
}
|
1119
1105
|
this._cellAlertManagerService.showAlert({
|
1120
|
-
type:
|
1106
|
+
type: Ta.ERROR,
|
1121
1107
|
title: this._localeService.t("dataValidation.error.title"),
|
1122
1108
|
message: l == null ? void 0 : l.getRuleFinalError(a, t.location),
|
1123
1109
|
location: t.location,
|
@@ -1137,30 +1123,30 @@ let ue = class extends Vt {
|
|
1137
1123
|
}));
|
1138
1124
|
}
|
1139
1125
|
};
|
1140
|
-
ue =
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1126
|
+
ue = Zi([
|
1127
|
+
Yt(0, b(Oa)),
|
1128
|
+
Yt(1, b(La)),
|
1129
|
+
Yt(2, rt),
|
1130
|
+
Yt(3, b(Q)),
|
1131
|
+
Yt(4, go),
|
1132
|
+
Yt(5, b(at))
|
1147
1133
|
], ue);
|
1148
|
-
var
|
1149
|
-
for (var a = n > 1 ? void 0 : n ?
|
1134
|
+
var qi = Object.getOwnPropertyDescriptor, Ji = (t, e, o, n) => {
|
1135
|
+
for (var a = n > 1 ? void 0 : n ? qi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1150
1136
|
(r = t[i]) && (a = r(a) || a);
|
1151
1137
|
return a;
|
1152
1138
|
}, He = (t, e) => (o, n) => e(o, n, t);
|
1153
|
-
let
|
1139
|
+
let Qt = class extends Vt {
|
1154
1140
|
constructor(t, e, o) {
|
1155
1141
|
super(), this._autoFillService = t, this._sheetDataValidationModel = e, this._injector = o, this._initAutoFill();
|
1156
1142
|
}
|
1157
1143
|
// eslint-disable-next-line max-lines-per-function
|
1158
1144
|
_initAutoFill() {
|
1159
1145
|
const t = () => ({ redos: [], undos: [] }), e = (n, a) => {
|
1160
|
-
const { source: i, target: r, unitId: s, subUnitId: l } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(s, l).clone(), u = sn([i, r]), [h, d] = u.ranges, { mapFunc:
|
1146
|
+
const { source: i, target: r, unitId: s, subUnitId: l } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(s, l).clone(), u = sn([i, r]), [h, d] = u.ranges, { mapFunc: C } = u, p = {
|
1161
1147
|
row: h.startRow,
|
1162
1148
|
col: h.startColumn
|
1163
|
-
}, R =
|
1149
|
+
}, R = Aa(h, d), w = new Ie(), g = /* @__PURE__ */ new Set();
|
1164
1150
|
R.forEach((I) => {
|
1165
1151
|
const v = I.repeatStartCell, y = I.relativeRange, P = {
|
1166
1152
|
startRow: p.row,
|
@@ -1182,7 +1168,7 @@ let qt = class extends Vt {
|
|
1182
1168
|
endRow: O
|
1183
1169
|
},
|
1184
1170
|
P
|
1185
|
-
), { row: F, col: N } =
|
1171
|
+
), { row: F, col: N } = C(A.startRow, A.startColumn), B = this._sheetDataValidationModel.getRuleIdByLocation(s, l, F, N) || "", x = we.getPositionRange(
|
1186
1172
|
{
|
1187
1173
|
startRow: O,
|
1188
1174
|
startColumn: L,
|
@@ -1190,15 +1176,15 @@ let qt = class extends Vt {
|
|
1190
1176
|
endRow: O
|
1191
1177
|
},
|
1192
1178
|
U
|
1193
|
-
), { row: z, col: H } =
|
1179
|
+
), { row: z, col: H } = C(x.startRow, x.startColumn);
|
1194
1180
|
w.setValue(z, H, B), g.add(B);
|
1195
1181
|
});
|
1196
1182
|
});
|
1197
1183
|
const f = Array.from(g).map((I) => ({ id: I, ranges: Qe(w, (v) => v === I) }));
|
1198
1184
|
c.addRangeRules(f);
|
1199
|
-
const
|
1185
|
+
const _ = c.diff(this._sheetDataValidationModel.getRules(s, l)), { redoMutations: V, undoMutations: S } = an(s, l, _, this._injector, "patched", a === se.ONLY_FORMAT);
|
1200
1186
|
return {
|
1201
|
-
undos:
|
1187
|
+
undos: S,
|
1202
1188
|
redos: V
|
1203
1189
|
};
|
1204
1190
|
}, o = {
|
@@ -1209,29 +1195,29 @@ let qt = class extends Vt {
|
|
1209
1195
|
for (const l of a.cols) {
|
1210
1196
|
const c = this._sheetDataValidationModel.getRuleByLocation(i, r, s, l);
|
1211
1197
|
if (c && c.type === K.CHECKBOX) {
|
1212
|
-
this._autoFillService.setDisableApplyType(
|
1198
|
+
this._autoFillService.setDisableApplyType(se.SERIES, !0);
|
1213
1199
|
return;
|
1214
1200
|
}
|
1215
1201
|
}
|
1216
1202
|
},
|
1217
|
-
onFillData: (n, a, i) => i ===
|
1203
|
+
onFillData: (n, a, i) => i === se.COPY || i === se.ONLY_FORMAT || i === se.SERIES ? e(n, i) : t(),
|
1218
1204
|
onAfterFillData: () => {
|
1219
1205
|
}
|
1220
1206
|
};
|
1221
1207
|
this.disposeWithMe(this._autoFillService.addHook(o));
|
1222
1208
|
}
|
1223
1209
|
};
|
1224
|
-
|
1225
|
-
He(0,
|
1210
|
+
Qt = Ji([
|
1211
|
+
He(0, Pa),
|
1226
1212
|
He(1, b(at)),
|
1227
1213
|
He(2, b(Wt))
|
1228
|
-
],
|
1229
|
-
var
|
1230
|
-
for (var a = n > 1 ? void 0 : n ?
|
1214
|
+
], Qt);
|
1215
|
+
var Qi = Object.getOwnPropertyDescriptor, tr = (t, e, o, n) => {
|
1216
|
+
for (var a = n > 1 ? void 0 : n ? Qi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1231
1217
|
(r = t[i]) && (a = r(a) || a);
|
1232
1218
|
return a;
|
1233
1219
|
}, xe = (t, e) => (o, n) => e(o, n, t);
|
1234
|
-
let
|
1220
|
+
let te = class extends Vt {
|
1235
1221
|
constructor(e, o, n) {
|
1236
1222
|
super();
|
1237
1223
|
E(this, "_copyInfo");
|
@@ -1282,20 +1268,20 @@ let Jt = class extends Vt {
|
|
1282
1268
|
return { redos: [], undos: [] };
|
1283
1269
|
const { unitId: a, subUnitId: i } = this._copyInfo;
|
1284
1270
|
if (o.unitId !== a || i !== o.subUnitId) {
|
1285
|
-
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), s = new Ie(), l = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = sn([o.copyRange, e]), d = Pn(c, u, !0),
|
1271
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), s = new Ie(), l = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = sn([o.copyRange, e]), d = Pn(c, u, !0), C = /* @__PURE__ */ new Map();
|
1286
1272
|
d.forEach(({ startRange: g }) => {
|
1287
1273
|
var f;
|
1288
|
-
(f = this._copyInfo) == null || f.matrix.forValue((
|
1274
|
+
(f = this._copyInfo) == null || f.matrix.forValue((_, V, S) => {
|
1289
1275
|
const I = we.getPositionRange(
|
1290
1276
|
{
|
1291
|
-
startRow:
|
1292
|
-
endRow:
|
1277
|
+
startRow: _,
|
1278
|
+
endRow: _,
|
1293
1279
|
startColumn: V,
|
1294
1280
|
endColumn: V
|
1295
1281
|
},
|
1296
1282
|
g
|
1297
|
-
), v = `${i}-${
|
1298
|
-
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, v) && y &&
|
1283
|
+
), v = `${i}-${S}`, y = this._sheetDataValidationModel.getRuleById(a, i, S);
|
1284
|
+
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, v) && y && C.set(v, { ...y, uid: v });
|
1299
1285
|
const { row: P, col: U } = h(I.startRow, I.startColumn);
|
1300
1286
|
l.add(v), s.setValue(P, U, v);
|
1301
1287
|
});
|
@@ -1305,7 +1291,7 @@ let Jt = class extends Vt {
|
|
1305
1291
|
const { redoMutations: R, undoMutations: w } = an(
|
1306
1292
|
o.unitId,
|
1307
1293
|
o.subUnitId,
|
1308
|
-
r.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId),
|
1294
|
+
r.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), C.values()),
|
1309
1295
|
this._injector,
|
1310
1296
|
"patched",
|
1311
1297
|
!1
|
@@ -1318,21 +1304,21 @@ let Jt = class extends Vt {
|
|
1318
1304
|
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), s = new Ie(), l = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = sn([o.copyRange, e]);
|
1319
1305
|
Pn(c, u, !0).forEach(({ startRange: w }) => {
|
1320
1306
|
var g;
|
1321
|
-
(g = this._copyInfo) == null || g.matrix.forValue((f,
|
1322
|
-
const
|
1307
|
+
(g = this._copyInfo) == null || g.matrix.forValue((f, _, V) => {
|
1308
|
+
const S = we.getPositionRange(
|
1323
1309
|
{
|
1324
1310
|
startRow: f,
|
1325
1311
|
endRow: f,
|
1326
|
-
startColumn:
|
1327
|
-
endColumn:
|
1312
|
+
startColumn: _,
|
1313
|
+
endColumn: _
|
1328
1314
|
},
|
1329
1315
|
w
|
1330
|
-
), { row: I, col: v } = h(
|
1316
|
+
), { row: I, col: v } = h(S.startRow, S.startColumn);
|
1331
1317
|
s.setValue(I, v, V), l.add(V);
|
1332
1318
|
});
|
1333
1319
|
});
|
1334
|
-
const
|
1335
|
-
r.addRangeRules(
|
1320
|
+
const C = Array.from(l).map((w) => ({ id: w, ranges: Qe(s, (g) => g === w) }));
|
1321
|
+
r.addRangeRules(C);
|
1336
1322
|
const { redoMutations: p, undoMutations: R } = an(
|
1337
1323
|
a,
|
1338
1324
|
i,
|
@@ -1348,17 +1334,17 @@ let Jt = class extends Vt {
|
|
1348
1334
|
}
|
1349
1335
|
}
|
1350
1336
|
};
|
1351
|
-
|
1352
|
-
xe(0,
|
1337
|
+
te = tr([
|
1338
|
+
xe(0, ka),
|
1353
1339
|
xe(1, b(at)),
|
1354
1340
|
xe(2, b(Wt))
|
1355
|
-
],
|
1356
|
-
var
|
1357
|
-
for (var a = n > 1 ? void 0 : n ?
|
1341
|
+
], te);
|
1342
|
+
var er = Object.getOwnPropertyDescriptor, nr = (t, e, o, n) => {
|
1343
|
+
for (var a = n > 1 ? void 0 : n ? er(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1358
1344
|
(r = t[i]) && (a = r(a) || a);
|
1359
1345
|
return a;
|
1360
1346
|
}, je = (t, e) => (o, n) => e(o, n, t);
|
1361
|
-
let
|
1347
|
+
let ee = class extends Vt {
|
1362
1348
|
constructor(t, e, o) {
|
1363
1349
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionCheckController = o, this._commandExecutedListener();
|
1364
1350
|
}
|
@@ -1378,54 +1364,54 @@ let Qt = class extends Vt {
|
|
1378
1364
|
);
|
1379
1365
|
}
|
1380
1366
|
};
|
1381
|
-
|
1367
|
+
ee = nr([
|
1382
1368
|
je(0, b(Q)),
|
1383
1369
|
je(1, tt),
|
1384
1370
|
je(2, b(eo))
|
1385
|
-
],
|
1371
|
+
], ee);
|
1386
1372
|
const Lo = "data-validation-single", To = "sheet.menu.data-validation";
|
1387
|
-
function
|
1373
|
+
function or(t) {
|
1388
1374
|
return {
|
1389
1375
|
id: To,
|
1390
1376
|
type: Cn.SUBITEMS,
|
1391
1377
|
icon: Lo,
|
1392
1378
|
tooltip: "dataValidation.title",
|
1393
|
-
hidden$:
|
1394
|
-
disabled$:
|
1379
|
+
hidden$: Ba(t, X.UNIVER_SHEET),
|
1380
|
+
disabled$: Fa(t, { workbookTypes: [Ve], worksheetTypes: [on, Re], rangeTypes: [De] })
|
1395
1381
|
};
|
1396
1382
|
}
|
1397
|
-
function
|
1383
|
+
function ar(t) {
|
1398
1384
|
return {
|
1399
1385
|
id: Ht.id,
|
1400
1386
|
title: "dataValidation.panel.title",
|
1401
1387
|
type: Cn.BUTTON
|
1402
1388
|
};
|
1403
1389
|
}
|
1404
|
-
function
|
1390
|
+
function ir(t) {
|
1405
1391
|
return {
|
1406
1392
|
id: Ne.id,
|
1407
1393
|
title: "dataValidation.panel.add",
|
1408
1394
|
type: Cn.BUTTON
|
1409
1395
|
};
|
1410
1396
|
}
|
1411
|
-
const
|
1412
|
-
[
|
1397
|
+
const rr = {
|
1398
|
+
[$a.FORMULAS_INSERT]: {
|
1413
1399
|
[To]: {
|
1414
1400
|
order: 9,
|
1415
|
-
menuItemFactory:
|
1401
|
+
menuItemFactory: or,
|
1416
1402
|
[Ht.id]: {
|
1417
1403
|
order: 0,
|
1418
|
-
menuItemFactory:
|
1404
|
+
menuItemFactory: ar
|
1419
1405
|
},
|
1420
1406
|
[Ne.id]: {
|
1421
1407
|
order: 1,
|
1422
|
-
menuItemFactory:
|
1408
|
+
menuItemFactory: ir
|
1423
1409
|
}
|
1424
1410
|
}
|
1425
1411
|
}
|
1426
1412
|
};
|
1427
|
-
var
|
1428
|
-
for (var a = n > 1 ? void 0 : n ?
|
1413
|
+
var sr = Object.getOwnPropertyDescriptor, Po = (t, e, o, n) => {
|
1414
|
+
for (var a = n > 1 ? void 0 : n ? sr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1429
1415
|
(r = t[i]) && (a = r(a) || a);
|
1430
1416
|
return a;
|
1431
1417
|
}, Z = (t, e) => (o, n) => e(o, n, t);
|
@@ -1435,12 +1421,12 @@ const Ao = {
|
|
1435
1421
|
color: "#fe4b4b"
|
1436
1422
|
}
|
1437
1423
|
};
|
1438
|
-
let
|
1424
|
+
let ne = class extends gn {
|
1439
1425
|
constructor(t, e, o, n, a, i, r, s, l, c, u) {
|
1440
1426
|
super(), this._commandService = t, this._menuManagerService = e, this._renderManagerService = o, this._univerInstanceService = n, this._autoHeightController = a, this._dropdownManagerService = i, this._sheetDataValidationModel = r, this._dataValidatorRegistryService = s, this._sheetInterceptorService = l, this._dataValidationCacheService = c, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
1441
1427
|
}
|
1442
1428
|
_initMenu() {
|
1443
|
-
this._menuManagerService.mergeMenu(
|
1429
|
+
this._menuManagerService.mergeMenu(rr);
|
1444
1430
|
}
|
1445
1431
|
_initDropdown() {
|
1446
1432
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((t) => {
|
@@ -1496,19 +1482,19 @@ let te = class extends gn {
|
|
1496
1482
|
priority: oo.DATA_VALIDATION,
|
1497
1483
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1498
1484
|
handler: (t, e, o) => {
|
1499
|
-
var g, f,
|
1485
|
+
var g, f, _, V, S;
|
1500
1486
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: s, worksheet: l } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1501
1487
|
if (!c)
|
1502
1488
|
return o(t);
|
1503
1489
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1504
1490
|
if (!u)
|
1505
1491
|
return o(t);
|
1506
|
-
const h = (g = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? g :
|
1492
|
+
const h = (g = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? g : Kt.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), C = e.rawData;
|
1507
1493
|
let p;
|
1508
1494
|
const R = {
|
1509
1495
|
get value() {
|
1510
1496
|
var I;
|
1511
|
-
return p !== void 0 || (p = (I =
|
1497
|
+
return p !== void 0 || (p = (I = mt(C)) != null ? I : null), p;
|
1512
1498
|
}
|
1513
1499
|
}, w = {
|
1514
1500
|
get value() {
|
@@ -1520,7 +1506,7 @@ let te = class extends gn {
|
|
1520
1506
|
...t,
|
1521
1507
|
markers: {
|
1522
1508
|
...t == null ? void 0 : t.markers,
|
1523
|
-
...h ===
|
1509
|
+
...h === Kt.INVALID ? Ao : null
|
1524
1510
|
},
|
1525
1511
|
customRender: [
|
1526
1512
|
...(f = t == null ? void 0 : t.customRender) != null ? f : [],
|
@@ -1528,7 +1514,7 @@ let te = class extends gn {
|
|
1528
1514
|
],
|
1529
1515
|
fontRenderExtension: {
|
1530
1516
|
...t == null ? void 0 : t.fontRenderExtension,
|
1531
|
-
isSkip: ((
|
1517
|
+
isSkip: ((_ = t == null ? void 0 : t.fontRenderExtension) == null ? void 0 : _.isSkip) || ((V = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : V.call(d, u, R.value, e))
|
1532
1518
|
},
|
1533
1519
|
interceptorStyle: {
|
1534
1520
|
...t == null ? void 0 : t.interceptorStyle,
|
@@ -1575,7 +1561,7 @@ let te = class extends gn {
|
|
1575
1561
|
};
|
1576
1562
|
return (F = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoWidth) == null ? void 0 : F.call(A, y);
|
1577
1563
|
},
|
1578
|
-
coverable: ((
|
1564
|
+
coverable: ((S = t == null ? void 0 : t.coverable) != null ? S : !0) && !(u.type === K.LIST || u.type === K.LIST_MULTIPLE)
|
1579
1565
|
});
|
1580
1566
|
}
|
1581
1567
|
}
|
@@ -1602,11 +1588,11 @@ let te = class extends gn {
|
|
1602
1588
|
});
|
1603
1589
|
}
|
1604
1590
|
};
|
1605
|
-
|
1591
|
+
ne = Po([
|
1606
1592
|
Z(0, tt),
|
1607
|
-
Z(1,
|
1593
|
+
Z(1, Wa),
|
1608
1594
|
Z(2, yt),
|
1609
|
-
Z(3,
|
1595
|
+
Z(3, rt),
|
1610
1596
|
Z(4, b(po)),
|
1611
1597
|
Z(5, b(Dt)),
|
1612
1598
|
Z(6, b(at)),
|
@@ -1614,7 +1600,7 @@ te = Po([
|
|
1614
1600
|
Z(8, b(vn)),
|
1615
1601
|
Z(9, b(uo)),
|
1616
1602
|
Z(10, ta(ho))
|
1617
|
-
],
|
1603
|
+
], ne);
|
1618
1604
|
let $n = class extends gn {
|
1619
1605
|
constructor(t, e, o, n, a, i, r) {
|
1620
1606
|
super(), this._commandService = t, this._renderManagerService = e, this._autoHeightController = o, this._dataValidatorRegistryService = n, this._sheetInterceptorService = a, this._sheetDataValidationModel = i, this._dataValidationCacheService = r, this._initViewModelIntercept(), this._initAutoHeight();
|
@@ -1629,19 +1615,19 @@ let $n = class extends gn {
|
|
1629
1615
|
priority: oo.DATA_VALIDATION,
|
1630
1616
|
// eslint-disable-next-line complexity
|
1631
1617
|
handler: (t, e, o) => {
|
1632
|
-
var w, g, f,
|
1618
|
+
var w, g, f, _, V;
|
1633
1619
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: s, worksheet: l } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1634
1620
|
if (!c)
|
1635
1621
|
return o(t);
|
1636
1622
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1637
1623
|
if (!u)
|
1638
1624
|
return o(t);
|
1639
|
-
const h = (w = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? w :
|
1625
|
+
const h = (w = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? w : Kt.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), C = l.getCellRaw(n, a), p = mt(C), R = `${p != null ? p : ""}`;
|
1640
1626
|
return o({
|
1641
1627
|
...t,
|
1642
1628
|
markers: {
|
1643
1629
|
...t == null ? void 0 : t.markers,
|
1644
|
-
...h ===
|
1630
|
+
...h === Kt.INVALID ? Ao : null
|
1645
1631
|
},
|
1646
1632
|
customRender: [
|
1647
1633
|
...(g = t == null ? void 0 : t.customRender) != null ? g : [],
|
@@ -1649,26 +1635,26 @@ let $n = class extends gn {
|
|
1649
1635
|
],
|
1650
1636
|
fontRenderExtension: {
|
1651
1637
|
...t == null ? void 0 : t.fontRenderExtension,
|
1652
|
-
isSkip: ((f = t == null ? void 0 : t.fontRenderExtension) == null ? void 0 : f.isSkip) || ((
|
1638
|
+
isSkip: ((f = t == null ? void 0 : t.fontRenderExtension) == null ? void 0 : f.isSkip) || ((_ = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : _.call(d, u, p, e))
|
1653
1639
|
},
|
1654
1640
|
interceptorStyle: {
|
1655
1641
|
...t == null ? void 0 : t.interceptorStyle,
|
1656
1642
|
...d == null ? void 0 : d.getExtraStyle(u, R, {
|
1657
1643
|
get style() {
|
1658
|
-
const
|
1659
|
-
return (typeof (t == null ? void 0 : t.s) == "string" ?
|
1644
|
+
const S = s.getStyles();
|
1645
|
+
return (typeof (t == null ? void 0 : t.s) == "string" ? S.get(t == null ? void 0 : t.s) : t == null ? void 0 : t.s) || {};
|
1660
1646
|
}
|
1661
1647
|
}, n, a)
|
1662
1648
|
},
|
1663
1649
|
interceptorAutoHeight: () => {
|
1664
1650
|
var y, P, U, O, L, A;
|
1665
|
-
const
|
1666
|
-
if (!
|
1651
|
+
const S = (P = (y = this._renderManagerService.getRenderById(i)) == null ? void 0 : y.with(ye).getSkeletonParam(r)) == null ? void 0 : P.skeleton;
|
1652
|
+
if (!S)
|
1667
1653
|
return;
|
1668
|
-
const I =
|
1654
|
+
const I = S.worksheet.getMergedCell(n, a), v = {
|
1669
1655
|
data: t,
|
1670
|
-
style:
|
1671
|
-
primaryWithCoord:
|
1656
|
+
style: S.getStyles().getStyleByCell(t),
|
1657
|
+
primaryWithCoord: S.getCellWithCoordByIndex((U = I == null ? void 0 : I.startRow) != null ? U : n, (O = I == null ? void 0 : I.startColumn) != null ? O : a),
|
1672
1658
|
unitId: i,
|
1673
1659
|
subUnitId: r,
|
1674
1660
|
row: n,
|
@@ -1710,8 +1696,8 @@ $n = Po([
|
|
1710
1696
|
Z(5, b(at)),
|
1711
1697
|
Z(6, b(uo))
|
1712
1698
|
], $n);
|
1713
|
-
var
|
1714
|
-
for (var a = n > 1 ? void 0 : n ?
|
1699
|
+
var lr = Object.getOwnPropertyDescriptor, dr = (t, e, o, n) => {
|
1700
|
+
for (var a = n > 1 ? void 0 : n ? lr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1715
1701
|
(r = t[i]) && (a = r(a) || a);
|
1716
1702
|
return a;
|
1717
1703
|
}, Wn = (t, e) => (o, n) => e(o, n, t);
|
@@ -1735,21 +1721,21 @@ let be = class extends Vt {
|
|
1735
1721
|
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(ea(16)).subscribe(t));
|
1736
1722
|
}
|
1737
1723
|
};
|
1738
|
-
be =
|
1724
|
+
be = dr([
|
1739
1725
|
Wn(1, b(at)),
|
1740
1726
|
Wn(2, b(ye))
|
1741
1727
|
], be);
|
1742
|
-
const
|
1743
|
-
dataValidationFormula:
|
1744
|
-
dataValidationFormulaAnd:
|
1745
|
-
dataValidationFormulaListItem:
|
1746
|
-
dataValidationFormulaListItemIcon:
|
1747
|
-
dataValidationFormulaListItemDrag:
|
1748
|
-
dataValidationFormulaListAdd:
|
1749
|
-
dataValidationFormulaColorSelect:
|
1750
|
-
dataValidationFormulaColorSelectPanel:
|
1751
|
-
dataValidationFormulaColorItem:
|
1752
|
-
},
|
1728
|
+
const cr = "univer-data-validation-formula", ur = "univer-data-validation-formula-and", hr = "univer-data-validation-formula-list-item", pr = "univer-data-validation-formula-list-item-icon", mr = "univer-data-validation-formula-list-item-drag", gr = "univer-data-validation-formula-list-add", fr = "univer-data-validation-formula-color-select", vr = "univer-data-validation-formula-color-select-panel", _r = "univer-data-validation-formula-color-item", ot = {
|
1729
|
+
dataValidationFormula: cr,
|
1730
|
+
dataValidationFormulaAnd: ur,
|
1731
|
+
dataValidationFormulaListItem: hr,
|
1732
|
+
dataValidationFormulaListItemIcon: pr,
|
1733
|
+
dataValidationFormulaListItemDrag: mr,
|
1734
|
+
dataValidationFormulaListAdd: gr,
|
1735
|
+
dataValidationFormulaColorSelect: fr,
|
1736
|
+
dataValidationFormulaColorSelectPanel: vr,
|
1737
|
+
dataValidationFormulaColorItem: _r
|
1738
|
+
}, Sr = (t) => {
|
1753
1739
|
const { isTwoFormula: e = !1, value: o, onChange: n, showError: a, validResult: i } = t, r = T(Q), s = a ? i == null ? void 0 : i.formula1 : "", l = a ? i == null ? void 0 : i.formula2 : "";
|
1754
1740
|
return e ? /* @__PURE__ */ Y(Rt, { children: [
|
1755
1741
|
/* @__PURE__ */ m(q, { error: s, children: /* @__PURE__ */ m(
|
@@ -1793,7 +1779,7 @@ const dr = "univer-data-validation-formula", cr = "univer-data-validation-formul
|
|
1793
1779
|
}
|
1794
1780
|
) });
|
1795
1781
|
};
|
1796
|
-
function
|
1782
|
+
function Cr(t) {
|
1797
1783
|
const { value: e, onChange: o, showError: n, validResult: a } = t, i = T(Q), r = n ? a == null ? void 0 : a.formula1 : "", s = n ? a == null ? void 0 : a.formula2 : "", [l, c] = j(!((e == null ? void 0 : e.formula1) === void 0 && (e == null ? void 0 : e.formula2) === void 0));
|
1798
1784
|
return /* @__PURE__ */ Y(Rt, { children: [
|
1799
1785
|
/* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
@@ -1840,13 +1826,13 @@ function Sr(t) {
|
|
1840
1826
|
) }) : null
|
1841
1827
|
] });
|
1842
1828
|
}
|
1843
|
-
function
|
1829
|
+
function Ir(t) {
|
1844
1830
|
var h;
|
1845
|
-
const { unitId: e, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = t, s = i ? r == null ? void 0 : r.formula1 : void 0, l =
|
1831
|
+
const { unitId: e, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = t, s = i ? r == null ? void 0 : r.formula1 : void 0, l = Jt({}), [c, u] = j(!1);
|
1846
1832
|
return fo((d) => {
|
1847
1833
|
var p;
|
1848
|
-
const
|
1849
|
-
|
1834
|
+
const C = (p = l.current) == null ? void 0 : p.handleOutClick;
|
1835
|
+
C && C(d, () => u(!1));
|
1850
1836
|
}), /* @__PURE__ */ m(
|
1851
1837
|
So,
|
1852
1838
|
{
|
@@ -1855,10 +1841,10 @@ function Cr(t) {
|
|
1855
1841
|
subUnitId: o,
|
1856
1842
|
isFocus: c,
|
1857
1843
|
onChange: (d) => {
|
1858
|
-
const
|
1859
|
-
|
1844
|
+
const C = (d != null ? d : "").trim();
|
1845
|
+
C !== (n == null ? void 0 : n.formula1) && (a == null || a({
|
1860
1846
|
...n,
|
1861
|
-
formula1:
|
1847
|
+
formula1: C
|
1862
1848
|
}));
|
1863
1849
|
},
|
1864
1850
|
errorText: s,
|
@@ -1868,7 +1854,7 @@ function Cr(t) {
|
|
1868
1854
|
}
|
1869
1855
|
);
|
1870
1856
|
}
|
1871
|
-
const
|
1857
|
+
const wr = [
|
1872
1858
|
"#FFFFFF",
|
1873
1859
|
"#FEE7E7",
|
1874
1860
|
"#FEF0E6",
|
@@ -1893,7 +1879,7 @@ const Ir = [
|
|
1893
1879
|
"#3A60F7",
|
1894
1880
|
"#9E6DE3",
|
1895
1881
|
"#F248A6"
|
1896
|
-
],
|
1882
|
+
], Rr = (t) => {
|
1897
1883
|
const { value: e, onChange: o, disabled: n } = t, [a, i] = j(!1);
|
1898
1884
|
return /* @__PURE__ */ m(
|
1899
1885
|
en,
|
@@ -1913,7 +1899,7 @@ const Ir = [
|
|
1913
1899
|
style: { background: r.value, marginTop: 5 }
|
1914
1900
|
}
|
1915
1901
|
),
|
1916
|
-
dropdownRender: () => /* @__PURE__ */ m("div", { className: ot.dataValidationFormulaColorSelectPanel, children:
|
1902
|
+
dropdownRender: () => /* @__PURE__ */ m("div", { className: ot.dataValidationFormulaColorSelectPanel, children: wr.map(
|
1917
1903
|
(r) => /* @__PURE__ */ m(
|
1918
1904
|
"div",
|
1919
1905
|
{
|
@@ -1933,7 +1919,7 @@ const Ir = [
|
|
1933
1919
|
return /* @__PURE__ */ Y("div", { className: ot.dataValidationFormulaListItem, style: n, children: [
|
1934
1920
|
e.isRef ? null : /* @__PURE__ */ m("div", { className: sa(ot.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ m(yo, {}) }),
|
1935
1921
|
/* @__PURE__ */ m(
|
1936
|
-
|
1922
|
+
Rr,
|
1937
1923
|
{
|
1938
1924
|
value: e.color,
|
1939
1925
|
onChange: (r) => {
|
@@ -1954,21 +1940,21 @@ const Ir = [
|
|
1954
1940
|
e.isRef ? null : /* @__PURE__ */ m("div", { className: ot.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ m(Rn, { onClick: () => i(e.id) }) })
|
1955
1941
|
] });
|
1956
1942
|
};
|
1957
|
-
function
|
1943
|
+
function Dr(t) {
|
1958
1944
|
const { value: e, onChange: o = () => {
|
1959
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: s } = t, { formula1: l = "", formula2: c = "" } = e || {}, u =
|
1945
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: s } = t, { formula1: l = "", formula2: c = "" } = e || {}, u = Jt(null), [h, d] = j(() => kt(l) ? "1" : "0"), [C, p] = j(h === "1" ? l : "="), [R, w] = j(h === "1" ? l : "="), g = T(Q), f = T(bt), _ = T(ke), V = T(wa), [S, I] = j(() => c.split(",")), v = f.getValidatorItem(K.LIST), [y, P] = j([]), [U, O] = j(""), L = r ? i == null ? void 0 : i.formula1 : "", A = $t(() => _.ruleChange$.pipe(wn(16)), []), F = St(A), N = dn(o);
|
1960
1946
|
wt(() => {
|
1961
1947
|
(async () => {
|
1962
1948
|
await new Promise(($) => {
|
1963
1949
|
setTimeout(() => $(!0), 100);
|
1964
1950
|
});
|
1965
|
-
const D =
|
1951
|
+
const D = _.getRuleById(n, a, s), k = D == null ? void 0 : D.formula1;
|
1966
1952
|
if (kt(k) && v && D) {
|
1967
1953
|
const $ = await v.getListAsync(D, n, a);
|
1968
1954
|
P($);
|
1969
1955
|
}
|
1970
1956
|
})();
|
1971
|
-
}, [
|
1957
|
+
}, [_, F, v, s, a, n]), wt(() => {
|
1972
1958
|
kt(l) && l !== R && (p(l), w(R));
|
1973
1959
|
}, [R, l]);
|
1974
1960
|
const [B, x] = j(() => {
|
@@ -1991,7 +1977,7 @@ function Rr(t) {
|
|
1991
1977
|
id: `${k}`,
|
1992
1978
|
isRef: !0
|
1993
1979
|
})), [G, y]), et = (D, k, $) => {
|
1994
|
-
const W = [...
|
1980
|
+
const W = [...S];
|
1995
1981
|
W[+D] = $, I(W), N({
|
1996
1982
|
formula1: l,
|
1997
1983
|
formula2: W.join(",")
|
@@ -2025,8 +2011,8 @@ function Rr(t) {
|
|
2025
2011
|
formula1: io(k.map(($) => $.label)),
|
2026
2012
|
formula2: k.map(($) => $.color === Ft ? "" : $.color).join(",")
|
2027
2013
|
});
|
2028
|
-
}, [B, N, h, R,
|
2029
|
-
const
|
2014
|
+
}, [B, N, h, R, S]);
|
2015
|
+
const st = dn(async (D) => {
|
2030
2016
|
if (!kt(D)) {
|
2031
2017
|
N == null || N({
|
2032
2018
|
formula1: "",
|
@@ -2041,7 +2027,7 @@ function Rr(t) {
|
|
2041
2027
|
formula1: "",
|
2042
2028
|
formula2: c
|
2043
2029
|
}), p("="), O(g.t("dataValidation.validFail.formulaError")));
|
2044
|
-
}), it =
|
2030
|
+
}), it = Jt({}), [lt, M] = j(!1);
|
2045
2031
|
return fo((D) => {
|
2046
2032
|
var $;
|
2047
2033
|
const k = ($ = it.current) == null ? void 0 : $.handleOutClick;
|
@@ -2054,7 +2040,7 @@ function Rr(t) {
|
|
2054
2040
|
onChange: (D) => {
|
2055
2041
|
d(D), p(R), D === "1" && N({
|
2056
2042
|
formula1: R === "=" ? "" : R,
|
2057
|
-
formula2:
|
2043
|
+
formula2: S.join(",")
|
2058
2044
|
});
|
2059
2045
|
},
|
2060
2046
|
children: [
|
@@ -2067,13 +2053,13 @@ function Rr(t) {
|
|
2067
2053
|
/* @__PURE__ */ m(
|
2068
2054
|
So,
|
2069
2055
|
{
|
2070
|
-
initValue:
|
2056
|
+
initValue: C,
|
2071
2057
|
unitId: n,
|
2072
2058
|
subUnitId: a,
|
2073
|
-
isFocus:
|
2059
|
+
isFocus: lt,
|
2074
2060
|
onChange: (D = "") => {
|
2075
2061
|
const k = (D != null ? D : "").trim();
|
2076
|
-
w(k),
|
2062
|
+
w(k), st(k);
|
2077
2063
|
},
|
2078
2064
|
errorText: L || U || void 0,
|
2079
2065
|
onFocus: () => M(!0),
|
@@ -2112,35 +2098,35 @@ function Rr(t) {
|
|
2112
2098
|
] }) })
|
2113
2099
|
] });
|
2114
2100
|
}
|
2115
|
-
const ko = "data-validation.custom-formula-input", Ue = "data-validation.formula-input", Mn = "data-validation.list-formula-input", Fo = "data-validation.checkbox-formula-input",
|
2101
|
+
const ko = "data-validation.custom-formula-input", Ue = "data-validation.formula-input", Mn = "data-validation.list-formula-input", Fo = "data-validation.checkbox-formula-input", Vr = [
|
2116
2102
|
[
|
2117
2103
|
ko,
|
2118
|
-
|
2104
|
+
Ir
|
2119
2105
|
],
|
2120
2106
|
[
|
2121
2107
|
Ue,
|
2122
|
-
|
2108
|
+
Sr
|
2123
2109
|
],
|
2124
2110
|
[
|
2125
2111
|
Mn,
|
2126
|
-
|
2112
|
+
Dr
|
2127
2113
|
],
|
2128
2114
|
[
|
2129
2115
|
Fo,
|
2130
|
-
|
2116
|
+
Cr
|
2131
2117
|
]
|
2132
|
-
],
|
2118
|
+
], yr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2133
2119
|
function Oe(t) {
|
2134
2120
|
var a;
|
2135
2121
|
const { value: e, onChange: o } = t, n = T(Q);
|
2136
|
-
return /* @__PURE__ */ m(q, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ Y(fn, { value: `${(a = e.renderMode) != null ? a :
|
2137
|
-
/* @__PURE__ */ m(Nt, { value: `${
|
2138
|
-
/* @__PURE__ */ m(Nt, { value: `${
|
2139
|
-
/* @__PURE__ */ m(Nt, { value: `${
|
2122
|
+
return /* @__PURE__ */ m(q, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ Y(fn, { value: `${(a = e.renderMode) != null ? a : ct.CUSTOM}`, onChange: (i) => o({ ...e, renderMode: +i }), children: [
|
2123
|
+
/* @__PURE__ */ m(Nt, { value: `${ct.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2124
|
+
/* @__PURE__ */ m(Nt, { value: `${ct.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2125
|
+
/* @__PURE__ */ m(Nt, { value: `${ct.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2140
2126
|
] }) });
|
2141
2127
|
}
|
2142
|
-
Oe.componentKey =
|
2143
|
-
const
|
2128
|
+
Oe.componentKey = yr;
|
2129
|
+
const Mr = "DATE_SHOW_TIME_OPTION";
|
2144
2130
|
function Le(t) {
|
2145
2131
|
var a;
|
2146
2132
|
const { value: e, onChange: o } = t, n = T(Q);
|
@@ -2161,12 +2147,12 @@ function Le(t) {
|
|
2161
2147
|
}
|
2162
2148
|
) });
|
2163
2149
|
}
|
2164
|
-
Le.componentKey =
|
2165
|
-
var
|
2166
|
-
for (var a = n > 1 ? void 0 : n ?
|
2150
|
+
Le.componentKey = Mr;
|
2151
|
+
var Er = Object.getOwnPropertyDescriptor, br = (t, e, o, n) => {
|
2152
|
+
for (var a = n > 1 ? void 0 : n ? Er(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2167
2153
|
(r = t[i]) && (a = r(a) || a);
|
2168
2154
|
return a;
|
2169
|
-
},
|
2155
|
+
}, Xt = (t, e) => (o, n) => e(o, n, t);
|
2170
2156
|
const ge = 6;
|
2171
2157
|
let cn = class {
|
2172
2158
|
constructor(t, e, o, n, a, i) {
|
@@ -2177,10 +2163,10 @@ let cn = class {
|
|
2177
2163
|
const { vt: o, ht: n } = e || {}, a = t.endX - t.startX - ge * 2, i = t.endY - t.startY, r = ((c = e == null ? void 0 : e.fs) != null ? c : 10) * 1.6;
|
2178
2164
|
let s = 0, l = 0;
|
2179
2165
|
switch (o) {
|
2180
|
-
case
|
2166
|
+
case ht.TOP:
|
2181
2167
|
l = 0;
|
2182
2168
|
break;
|
2183
|
-
case
|
2169
|
+
case ht.BOTTOM:
|
2184
2170
|
l = 0 + (i - r);
|
2185
2171
|
break;
|
2186
2172
|
default:
|
@@ -2188,10 +2174,10 @@ let cn = class {
|
|
2188
2174
|
break;
|
2189
2175
|
}
|
2190
2176
|
switch (n) {
|
2191
|
-
case
|
2177
|
+
case Gt.LEFT:
|
2192
2178
|
s = ge;
|
2193
2179
|
break;
|
2194
|
-
case
|
2180
|
+
case Gt.RIGHT:
|
2195
2181
|
s = ge + (a - r);
|
2196
2182
|
break;
|
2197
2183
|
default:
|
@@ -2216,8 +2202,8 @@ let cn = class {
|
|
2216
2202
|
return ((o = e == null ? void 0 : e.fs) != null ? o : 10) * 1.6;
|
2217
2203
|
}
|
2218
2204
|
async _parseFormula(t, e, o) {
|
2219
|
-
var c, u, h, d,
|
2220
|
-
const { formula1: n =
|
2205
|
+
var c, u, h, d, C, p, R, w, g;
|
2206
|
+
const { formula1: n = Va, formula2: a = Da } = t, i = await this._formulaService.getRuleFormulaResult(e, o, t.uid), r = $e((h = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), s = $e((p = (C = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : C[0]) == null ? void 0 : p[0]), l = Ln(String(r)) && Ln(String(s));
|
2221
2207
|
return {
|
2222
2208
|
formula1: kt(n) ? $e((g = (w = (R = i == null ? void 0 : i[0]) == null ? void 0 : R.result) == null ? void 0 : w[0]) == null ? void 0 : g[0]) : n,
|
2223
2209
|
formula2: kt(a) ? s : a,
|
@@ -2226,17 +2212,17 @@ let cn = class {
|
|
2226
2212
|
}
|
2227
2213
|
drawWith(t, e) {
|
2228
2214
|
var L, A, F, N;
|
2229
|
-
const { style: o, primaryWithCoord: n, unitId: a, subUnitId: i, worksheet: r, row: s, col: l } = e, c = n.isMergedMainCell ? n.mergeInfo : n, u =
|
2215
|
+
const { style: o, primaryWithCoord: n, unitId: a, subUnitId: i, worksheet: r, row: s, col: l } = e, c = n.isMergedMainCell ? n.mergeInfo : n, u = mt(r.getCellRaw(s, l)), h = this._dataValidationModel.getRuleByLocation(a, i, s, l);
|
2230
2216
|
if (!h)
|
2231
2217
|
return;
|
2232
2218
|
const d = this._dataValidationModel.getValidator(h.type);
|
2233
2219
|
if (!d)
|
2234
2220
|
return;
|
2235
|
-
const
|
2221
|
+
const C = this._themeService.getCurrentTheme();
|
2236
2222
|
if (!((L = d.skipDefaultFontRender) != null && L.call(d, h, u, { unitId: a, subUnitId: i, row: s, column: l })))
|
2237
2223
|
return;
|
2238
|
-
const p = d.parseFormulaSync(h, a, i), { formula1: R } = p, w = this._calc(c, o), { a: g, d: f } = t.getTransform(),
|
2239
|
-
left:
|
2224
|
+
const p = d.parseFormulaSync(h, a, i), { formula1: R } = p, w = this._calc(c, o), { a: g, d: f } = t.getTransform(), _ = bn(w.left, g), V = bn(w.top, f), S = la.create().composeMatrix({
|
2225
|
+
left: _,
|
2240
2226
|
top: V,
|
2241
2227
|
scaleX: 1,
|
2242
2228
|
scaleY: 1,
|
@@ -2247,9 +2233,9 @@ let cn = class {
|
|
2247
2233
|
flipY: !1
|
2248
2234
|
}), I = c.endX - c.startX, v = c.endY - c.startY;
|
2249
2235
|
t.save(), t.beginPath(), t.rect(c.startX, c.startY, I, v), t.clip();
|
2250
|
-
const y =
|
2236
|
+
const y = S.getMatrix();
|
2251
2237
|
t.transform(y[0], y[1], y[2], y[3], y[4], y[5]);
|
2252
|
-
const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, U = String(u) === String(R), O =
|
2238
|
+
const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, U = String(u) === String(R), O = C.hyacinth500;
|
2253
2239
|
da.drawWith(t, {
|
2254
2240
|
checked: U,
|
2255
2241
|
width: P,
|
@@ -2265,13 +2251,13 @@ let cn = class {
|
|
2265
2251
|
var p;
|
2266
2252
|
if (e.button === 2)
|
2267
2253
|
return;
|
2268
|
-
const { primaryWithCoord: o, unitId: n, subUnitId: a, worksheet: i, row: r, col: s } = t, l =
|
2254
|
+
const { primaryWithCoord: o, unitId: n, subUnitId: a, worksheet: i, row: r, col: s } = t, l = mt(i.getCellRaw(r, s)), c = this._dataValidationModel.getRuleByLocation(n, a, r, s);
|
2269
2255
|
if (!c)
|
2270
2256
|
return;
|
2271
2257
|
const u = this._dataValidationModel.getValidator(c.type);
|
2272
2258
|
if (!u || !((p = u.skipDefaultFontRender) != null && p.call(u, c, l, { unitId: n, subUnitId: a, row: r, column: s })))
|
2273
2259
|
return;
|
2274
|
-
const { formula1: h, formula2: d } = await this._parseFormula(c, n, a),
|
2260
|
+
const { formula1: h, formula2: d } = await this._parseFormula(c, n, a), C = {
|
2275
2261
|
range: {
|
2276
2262
|
startColumn: o.actualColumn,
|
2277
2263
|
endColumn: o.actualColumn,
|
@@ -2279,37 +2265,37 @@ let cn = class {
|
|
2279
2265
|
endRow: o.actualRow
|
2280
2266
|
},
|
2281
2267
|
value: {
|
2282
|
-
v: String(l) ===
|
2268
|
+
v: String(l) === ya(String(h)) ? d : h,
|
2283
2269
|
p: null
|
2284
2270
|
}
|
2285
2271
|
};
|
2286
2272
|
this._commandService.executeCommand(
|
2287
2273
|
_n.id,
|
2288
|
-
|
2274
|
+
C
|
2289
2275
|
);
|
2290
2276
|
}
|
2291
2277
|
onPointerEnter(t, e) {
|
2292
2278
|
var o, n;
|
2293
|
-
(n = (o =
|
2279
|
+
(n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(qt.POINTER);
|
2294
2280
|
}
|
2295
2281
|
onPointerLeave(t, e) {
|
2296
2282
|
var o, n;
|
2297
|
-
(n = (o =
|
2283
|
+
(n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(qt.DEFAULT);
|
2298
2284
|
}
|
2299
2285
|
};
|
2300
|
-
cn =
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2286
|
+
cn = br([
|
2287
|
+
Xt(0, tt),
|
2288
|
+
Xt(1, rt),
|
2289
|
+
Xt(2, b(Ra)),
|
2290
|
+
Xt(3, b(zn)),
|
2291
|
+
Xt(4, b(yt)),
|
2292
|
+
Xt(5, b(at))
|
2307
2293
|
], cn);
|
2308
|
-
var
|
2309
|
-
for (var a = n > 1 ? void 0 : n ?
|
2294
|
+
var Or = Object.getOwnPropertyDescriptor, Lr = (t, e, o, n) => {
|
2295
|
+
for (var a = n > 1 ? void 0 : n ? Or(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2310
2296
|
(r = t[i]) && (a = r(a) || a);
|
2311
2297
|
return a;
|
2312
|
-
},
|
2298
|
+
}, Tr = (t, e) => (o, n) => e(o, n, t);
|
2313
2299
|
let vt = class {
|
2314
2300
|
constructor(t) {
|
2315
2301
|
E(this, "canvasRender", null);
|
@@ -2319,10 +2305,10 @@ let vt = class {
|
|
2319
2305
|
this.injector = t;
|
2320
2306
|
}
|
2321
2307
|
};
|
2322
|
-
vt =
|
2323
|
-
|
2308
|
+
vt = Lr([
|
2309
|
+
Tr(0, b(Wt))
|
2324
2310
|
], vt);
|
2325
|
-
class
|
2311
|
+
class Pr extends vt {
|
2326
2312
|
constructor() {
|
2327
2313
|
super(...arguments);
|
2328
2314
|
E(this, "id", K.CHECKBOX);
|
@@ -2330,48 +2316,48 @@ class Tr extends vt {
|
|
2330
2316
|
E(this, "formulaInput", Fo);
|
2331
2317
|
}
|
2332
2318
|
}
|
2333
|
-
class
|
2319
|
+
class Ar extends vt {
|
2334
2320
|
constructor() {
|
2335
2321
|
super(...arguments);
|
2336
2322
|
E(this, "id", K.CUSTOM);
|
2337
2323
|
E(this, "formulaInput", ko);
|
2338
2324
|
}
|
2339
2325
|
}
|
2340
|
-
const
|
2341
|
-
class
|
2326
|
+
const kr = "data-validation.formula-input";
|
2327
|
+
class Fr extends vt {
|
2342
2328
|
constructor() {
|
2343
2329
|
super(...arguments);
|
2344
2330
|
E(this, "id", K.DATE);
|
2345
|
-
E(this, "formulaInput",
|
2331
|
+
E(this, "formulaInput", kr);
|
2346
2332
|
E(this, "optionsInput", Le.componentKey);
|
2347
2333
|
E(this, "dropdown", Oo);
|
2348
2334
|
}
|
2349
2335
|
}
|
2350
|
-
class
|
2336
|
+
class Nr extends vt {
|
2351
2337
|
constructor() {
|
2352
2338
|
super(...arguments);
|
2353
2339
|
E(this, "id", K.DECIMAL);
|
2354
2340
|
E(this, "formulaInput", Ue);
|
2355
2341
|
}
|
2356
2342
|
}
|
2357
|
-
const No = 4,
|
2358
|
-
function
|
2343
|
+
const No = 4, Ur = 0, Ye = 4, Uo = 4, un = 6, Te = 6, At = 14;
|
2344
|
+
function Br(t, e) {
|
2359
2345
|
const o = ca.getTextSize(t, e), n = o.width + No * 2, { ba: a, bd: i } = o, r = a + i;
|
2360
2346
|
return {
|
2361
2347
|
width: n,
|
2362
|
-
height: r +
|
2348
|
+
height: r + Ur * 2,
|
2363
2349
|
ba: a
|
2364
2350
|
};
|
2365
2351
|
}
|
2366
2352
|
function Xe(t, e, o, n) {
|
2367
2353
|
const a = At + un * 2, i = o - a, r = n - Te * 2, s = t.map((d) => ({
|
2368
|
-
layout:
|
2354
|
+
layout: Br(d, e),
|
2369
2355
|
text: d
|
2370
2356
|
}));
|
2371
2357
|
let l;
|
2372
2358
|
const c = [];
|
2373
2359
|
s.forEach((d) => {
|
2374
|
-
const { layout:
|
2360
|
+
const { layout: C } = d, { width: p, height: R } = C;
|
2375
2361
|
!l || l.width + p + Ye > i ? (l = {
|
2376
2362
|
width: p,
|
2377
2363
|
height: R,
|
@@ -2385,8 +2371,8 @@ function Xe(t, e, o, n) {
|
|
2385
2371
|
}), l.width = l.width + p + Ye);
|
2386
2372
|
});
|
2387
2373
|
let u = 0, h = 0;
|
2388
|
-
return c.forEach((d,
|
2389
|
-
h = Math.max(h, d.width),
|
2374
|
+
return c.forEach((d, C) => {
|
2375
|
+
h = Math.max(h, d.width), C === c.length - 1 ? u += d.height : u += d.height + Uo;
|
2390
2376
|
}), {
|
2391
2377
|
lines: c,
|
2392
2378
|
totalHeight: u,
|
@@ -2396,24 +2382,24 @@ function Xe(t, e, o, n) {
|
|
2396
2382
|
calcAutoWidth: h + a
|
2397
2383
|
};
|
2398
2384
|
}
|
2399
|
-
const
|
2400
|
-
class
|
2385
|
+
const $r = 8;
|
2386
|
+
class Wr extends ua {
|
2401
2387
|
static drawWith(e, o) {
|
2402
2388
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: s, text: l } = a;
|
2403
2389
|
e.save(), Jn.drawWith(e, {
|
2404
2390
|
width: s.width,
|
2405
2391
|
height: s.height,
|
2406
|
-
radius:
|
2392
|
+
radius: $r,
|
2407
2393
|
fill: i || Ft
|
2408
2394
|
}), e.translateWithPrecision(No, s.ba), e.font = n, e.fillStyle = r, e.fillText(l, 0, 0), e.restore();
|
2409
2395
|
}
|
2410
2396
|
}
|
2411
|
-
var
|
2412
|
-
for (var a = n > 1 ? void 0 : n ?
|
2397
|
+
var Hr = Object.getOwnPropertyDescriptor, xr = (t, e, o, n) => {
|
2398
|
+
for (var a = n > 1 ? void 0 : n ? Hr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2413
2399
|
(r = t[i]) && (a = r(a) || a);
|
2414
2400
|
return a;
|
2415
2401
|
}, fe = (t, e) => (o, n) => e(o, n, t);
|
2416
|
-
const
|
2402
|
+
const jr = 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");
|
2417
2403
|
let hn = class {
|
2418
2404
|
constructor(t, e, o, n) {
|
2419
2405
|
E(this, "zIndex");
|
@@ -2431,58 +2417,58 @@ let hn = class {
|
|
2431
2417
|
const i = o - At + 4;
|
2432
2418
|
let r = 4;
|
2433
2419
|
switch (a) {
|
2434
|
-
case
|
2420
|
+
case ht.MIDDLE:
|
2435
2421
|
r = (n - At) / 2 + 4;
|
2436
2422
|
break;
|
2437
|
-
case
|
2423
|
+
case ht.BOTTOM:
|
2438
2424
|
r = n - At + 4;
|
2439
2425
|
break;
|
2440
2426
|
}
|
2441
|
-
t.save(), t.translateWithPrecision(e.startX + i, e.startY + r), t.fillStyle = "#565656", t.fill(
|
2427
|
+
t.save(), t.translateWithPrecision(e.startX + i, e.startY + r), t.fillStyle = "#565656", t.fill(jr), t.restore();
|
2442
2428
|
}
|
2443
2429
|
// eslint-disable-next-line max-lines-per-function
|
2444
2430
|
drawWith(t, e, o, n) {
|
2445
2431
|
var z, H;
|
2446
|
-
const { primaryWithCoord: a, row: i, col: r, style: s, data: l, subUnitId: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: d = 0, rightOffset:
|
2432
|
+
const { primaryWithCoord: a, row: i, col: r, style: s, data: l, subUnitId: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: d = 0, rightOffset: C = 0, topOffset: p = 0, downOffset: R = 0 } = h || {}, w = this._ensureMap(c), g = this._generateKey(i, r), f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, r);
|
2447
2433
|
if (!f)
|
2448
2434
|
return;
|
2449
|
-
const
|
2450
|
-
if (!
|
2435
|
+
const _ = this._dataValidationModel.getValidator(f.type);
|
2436
|
+
if (!_)
|
2451
2437
|
return;
|
2452
2438
|
const V = {
|
2453
2439
|
startX: u.startX + d,
|
2454
|
-
endX: u.endX -
|
2440
|
+
endX: u.endX - C,
|
2455
2441
|
startY: u.startY + p,
|
2456
2442
|
endY: u.endY - R
|
2457
|
-
},
|
2458
|
-
this._drawDownIcon(t, V,
|
2443
|
+
}, S = V.endX - V.startX, I = V.endY - V.startY, { cl: v } = s || {}, y = (z = typeof v == "object" ? v == null ? void 0 : v.rgb : v) != null ? z : "#000", P = Be(s != null ? s : void 0), { vt: U, ht: O } = s || {}, L = U != null ? U : ht.MIDDLE, A = (H = mt(l)) != null ? H : "", F = _.parseCellValue(A), N = _.getListWithColorMap(f), B = Xe(F, P, S, I);
|
2444
|
+
this._drawDownIcon(t, V, S, I, L), t.save(), t.translateWithPrecision(V.startX, V.startY), t.beginPath(), t.rect(0, 0, S - At, I), t.clip(), t.translateWithPrecision(un, Te);
|
2459
2445
|
let x = 0;
|
2460
2446
|
switch (L) {
|
2461
|
-
case
|
2447
|
+
case ht.MIDDLE:
|
2462
2448
|
x = (B.contentHeight - B.totalHeight) / 2;
|
2463
2449
|
break;
|
2464
|
-
case
|
2450
|
+
case ht.BOTTOM:
|
2465
2451
|
x = B.contentHeight - B.totalHeight;
|
2466
2452
|
break;
|
2467
2453
|
}
|
2468
2454
|
t.translateWithPrecision(0, x), B.lines.forEach((G, J) => {
|
2469
2455
|
t.save();
|
2470
|
-
const { width: et, height: nt, items:
|
2456
|
+
const { width: et, height: nt, items: st } = G;
|
2471
2457
|
let it = 0;
|
2472
2458
|
switch (O) {
|
2473
|
-
case
|
2459
|
+
case Gt.RIGHT:
|
2474
2460
|
it = B.contentWidth - et;
|
2475
2461
|
break;
|
2476
|
-
case
|
2462
|
+
case Gt.CENTER:
|
2477
2463
|
it = (B.contentWidth - et) / 2;
|
2478
2464
|
break;
|
2479
2465
|
}
|
2480
|
-
t.translate(it, J * (nt + Uo)),
|
2481
|
-
t.save(), t.translateWithPrecision(
|
2466
|
+
t.translate(it, J * (nt + Uo)), st.forEach((lt) => {
|
2467
|
+
t.save(), t.translateWithPrecision(lt.left, 0), Wr.drawWith(t, {
|
2482
2468
|
...P,
|
2483
|
-
info:
|
2469
|
+
info: lt,
|
2484
2470
|
color: y,
|
2485
|
-
fill: N[
|
2471
|
+
fill: N[lt.text]
|
2486
2472
|
}), t.restore();
|
2487
2473
|
}), t.restore();
|
2488
2474
|
}), t.restore(), w.set(g, {
|
@@ -2493,36 +2479,36 @@ let hn = class {
|
|
2493
2479
|
});
|
2494
2480
|
}
|
2495
2481
|
calcCellAutoHeight(t) {
|
2496
|
-
var
|
2482
|
+
var S;
|
2497
2483
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: l = 0, topOffset: c = 0, downOffset: u = 0 } = r || {}, h = e.isMergedMainCell ? e.mergeInfo : e, d = {
|
2498
2484
|
startX: h.startX + s,
|
2499
2485
|
endX: h.endX - l,
|
2500
2486
|
startY: h.startY + c,
|
2501
2487
|
endY: h.endY - u
|
2502
|
-
},
|
2503
|
-
if (!
|
2488
|
+
}, C = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2489
|
+
if (!C)
|
2504
2490
|
return;
|
2505
|
-
const p = this._dataValidationModel.getValidator(
|
2491
|
+
const p = this._dataValidationModel.getValidator(C.type);
|
2506
2492
|
if (!p)
|
2507
2493
|
return;
|
2508
|
-
const R = d.endX - d.startX, w = d.endY - d.startY, g = (
|
2509
|
-
return Xe(f,
|
2494
|
+
const R = d.endX - d.startX, w = d.endY - d.startY, g = (S = mt(n)) != null ? S : "", f = p.parseCellValue(g), _ = Be(o != null ? o : void 0);
|
2495
|
+
return Xe(f, _, R, w).cellAutoHeight;
|
2510
2496
|
}
|
2511
2497
|
calcCellAutoWidth(t) {
|
2512
|
-
var
|
2498
|
+
var S;
|
2513
2499
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: l = 0, topOffset: c = 0, downOffset: u = 0 } = r || {}, h = e.isMergedMainCell ? e.mergeInfo : e, d = {
|
2514
2500
|
startX: h.startX + s,
|
2515
2501
|
endX: h.endX - l,
|
2516
2502
|
startY: h.startY + c,
|
2517
2503
|
endY: h.endY - u
|
2518
|
-
},
|
2519
|
-
if (!
|
2504
|
+
}, C = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2505
|
+
if (!C)
|
2520
2506
|
return;
|
2521
|
-
const p = this._dataValidationModel.getValidator(
|
2507
|
+
const p = this._dataValidationModel.getValidator(C.type);
|
2522
2508
|
if (!p)
|
2523
2509
|
return;
|
2524
|
-
const R = d.endX - d.startX, w = d.endY - d.startY, g = (
|
2525
|
-
return Xe(f,
|
2510
|
+
const R = d.endX - d.startX, w = d.endY - d.startY, g = (S = mt(n)) != null ? S : "", f = p.parseCellValue(g), _ = Be(o != null ? o : void 0);
|
2511
|
+
return Xe(f, _, R, w).calcAutoWidth;
|
2526
2512
|
}
|
2527
2513
|
isHit(t, e) {
|
2528
2514
|
const { primaryWithCoord: o } = e, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = t;
|
@@ -2541,20 +2527,20 @@ let hn = class {
|
|
2541
2527
|
}
|
2542
2528
|
onPointerEnter(t, e) {
|
2543
2529
|
var o, n;
|
2544
|
-
return (n = (o =
|
2530
|
+
return (n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null ? void 0 : n.setCursor(qt.POINTER);
|
2545
2531
|
}
|
2546
2532
|
onPointerLeave(t, e) {
|
2547
2533
|
var o, n;
|
2548
|
-
return (n = (o =
|
2534
|
+
return (n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null ? void 0 : n.setCursor(qt.DEFAULT);
|
2549
2535
|
}
|
2550
2536
|
};
|
2551
|
-
hn =
|
2537
|
+
hn = xr([
|
2552
2538
|
fe(0, tt),
|
2553
|
-
fe(1,
|
2539
|
+
fe(1, rt),
|
2554
2540
|
fe(2, b(yt)),
|
2555
2541
|
fe(3, b(at))
|
2556
2542
|
], hn);
|
2557
|
-
class
|
2543
|
+
class Yr extends vt {
|
2558
2544
|
constructor() {
|
2559
2545
|
super(...arguments);
|
2560
2546
|
E(this, "id", K.LIST_MULTIPLE);
|
@@ -2562,13 +2548,13 @@ class jr extends vt {
|
|
2562
2548
|
E(this, "dropdown", yn);
|
2563
2549
|
}
|
2564
2550
|
}
|
2565
|
-
var
|
2566
|
-
for (var a = n > 1 ? void 0 : n ?
|
2551
|
+
var Xr = Object.getOwnPropertyDescriptor, zr = (t, e, o, n) => {
|
2552
|
+
for (var a = n > 1 ? void 0 : n ? Xr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2567
2553
|
(r = t[i]) && (a = r(a) || a);
|
2568
2554
|
return a;
|
2569
|
-
},
|
2570
|
-
const Pt = 4, ve = 4,
|
2571
|
-
function
|
2555
|
+
}, le = (t, e) => (o, n) => e(o, n, t);
|
2556
|
+
const Pt = 4, ve = 4, pt = 14, gt = 6, zt = 4, ze = 8, Kr = "#565656", xn = 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");
|
2557
|
+
function Gr(t, e) {
|
2572
2558
|
const o = t.length;
|
2573
2559
|
return {
|
2574
2560
|
id: "d",
|
@@ -2579,16 +2565,16 @@ function Kr(t, e) {
|
|
2579
2565
|
ts: {
|
2580
2566
|
fs: 11,
|
2581
2567
|
ff: void 0,
|
2582
|
-
it:
|
2583
|
-
bl:
|
2568
|
+
it: ie.FALSE,
|
2569
|
+
bl: ie.FALSE,
|
2584
2570
|
ul: {
|
2585
|
-
s:
|
2571
|
+
s: ie.FALSE
|
2586
2572
|
},
|
2587
2573
|
st: {
|
2588
|
-
s:
|
2574
|
+
s: ie.FALSE
|
2589
2575
|
},
|
2590
2576
|
ol: {
|
2591
|
-
s:
|
2577
|
+
s: ie.FALSE
|
2592
2578
|
},
|
2593
2579
|
cl: void 0,
|
2594
2580
|
...e,
|
@@ -2609,7 +2595,7 @@ function Kr(t, e) {
|
|
2609
2595
|
};
|
2610
2596
|
}
|
2611
2597
|
function Bo(t, e, o) {
|
2612
|
-
const n =
|
2598
|
+
const n = Gr(t, o), a = new na(n), i = new pa(a);
|
2613
2599
|
return {
|
2614
2600
|
documentSkeleton: ma.create(i, e),
|
2615
2601
|
docModel: a,
|
@@ -2634,25 +2620,25 @@ function _e(t, e, o) {
|
|
2634
2620
|
}
|
2635
2621
|
function jn(t, e, o, n, a, i, r = !0) {
|
2636
2622
|
let s = 0;
|
2637
|
-
const l = r ?
|
2623
|
+
const l = r ? zt : 0;
|
2638
2624
|
switch (a) {
|
2639
|
-
case
|
2625
|
+
case ht.BOTTOM:
|
2640
2626
|
s = e - n - l;
|
2641
2627
|
break;
|
2642
|
-
case
|
2628
|
+
case ht.MIDDLE:
|
2643
2629
|
s = (e - n) / 2;
|
2644
2630
|
break;
|
2645
2631
|
default:
|
2646
2632
|
s = l;
|
2647
2633
|
break;
|
2648
2634
|
}
|
2649
|
-
s = Math.max(
|
2635
|
+
s = Math.max(zt, s);
|
2650
2636
|
let c = 0;
|
2651
2637
|
switch (i) {
|
2652
|
-
case
|
2638
|
+
case Gt.CENTER:
|
2653
2639
|
c = (t - o) / 2;
|
2654
2640
|
break;
|
2655
|
-
case
|
2641
|
+
case Gt.RIGHT:
|
2656
2642
|
c = t - o;
|
2657
2643
|
break;
|
2658
2644
|
}
|
@@ -2675,17 +2661,17 @@ let pn = class {
|
|
2675
2661
|
return `${t}.${e}`;
|
2676
2662
|
}
|
2677
2663
|
_drawDownIcon(t, e, o, n, a, i, r) {
|
2678
|
-
const { t: s =
|
2664
|
+
const { t: s = dt.pd.t, b: l = dt.pd.b } = r, c = o - pt;
|
2679
2665
|
let u;
|
2680
2666
|
switch (i) {
|
2681
|
-
case
|
2667
|
+
case ht.MIDDLE:
|
2682
2668
|
u = (n - ve) / 2;
|
2683
2669
|
break;
|
2684
|
-
case
|
2685
|
-
u = n - l - a -
|
2670
|
+
case ht.BOTTOM:
|
2671
|
+
u = n - l - a - zt + (a / 2 - ve / 2);
|
2686
2672
|
break;
|
2687
2673
|
default:
|
2688
|
-
u = s +
|
2674
|
+
u = s + zt + (a / 2 - ve / 2);
|
2689
2675
|
break;
|
2690
2676
|
}
|
2691
2677
|
t.save(), t.translateWithPrecision(e.startX + c, e.startY + u), t.fillStyle = "#565656", t.fill(xn), t.restore();
|
@@ -2698,106 +2684,106 @@ let pn = class {
|
|
2698
2684
|
const h = this._dataValidationModel.getValidator(u.type);
|
2699
2685
|
if (!h)
|
2700
2686
|
return;
|
2701
|
-
const d = s == null ? void 0 : s.fontRenderExtension, { leftOffset:
|
2687
|
+
const d = s == null ? void 0 : s.fontRenderExtension, { leftOffset: C = 0, rightOffset: p = 0, topOffset: R = 0, downOffset: w = 0 } = d || {};
|
2702
2688
|
if (!u || !h || !h || h.id.indexOf(K.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
2703
2689
|
return;
|
2704
2690
|
const g = {
|
2705
|
-
startX: c.startX +
|
2691
|
+
startX: c.startX + C,
|
2706
2692
|
endX: c.endX - p,
|
2707
2693
|
startY: c.startY + R,
|
2708
2694
|
endY: c.endY - w
|
2709
|
-
}, f = g.endX - g.startX,
|
2695
|
+
}, f = g.endX - g.startX, _ = g.endY - g.startY, V = this._ensureMap(l), S = this._generateKey(a, i), I = h.getListWithColor(u), v = mt(s), y = `${v != null ? v : ""}`, P = I.find((F) => F.label === y);
|
2710
2696
|
let { tb: U, vt: O, ht: L, pd: A } = r || {};
|
2711
|
-
if (U = U != null ? U : It.WRAP, O = O != null ? O :
|
2712
|
-
const { l: F =
|
2697
|
+
if (U = U != null ? U : It.WRAP, O = O != null ? O : ht.BOTTOM, L = L != null ? L : dt.ht, A = A != null ? A : dt.pd, u.renderMode === ct.ARROW) {
|
2698
|
+
const { l: F = dt.pd.l, t: N = dt.pd.t, r: B = dt.pd.r, b: x = dt.pd.b } = A, z = f - F - B - pt - 4, { documentSkeleton: H, documents: G, docModel: J } = _e(y, this._localeService, r);
|
2713
2699
|
U === It.WRAP && J.updateDocumentDataPageSize(Math.max(z, 1)), H.calculate(), H.getActualSize();
|
2714
|
-
const et =
|
2715
|
-
this._drawDownIcon(t, g, f,
|
2716
|
-
left: g.endX + F + o.rowHeaderWidth -
|
2700
|
+
const et = re(H), { height: nt, width: st } = et, { paddingTop: it, paddingLeft: lt } = jn(z, _ - N - x, st, nt, O, L, !0);
|
2701
|
+
this._drawDownIcon(t, g, f, _, nt, O, A), t.save(), t.translateWithPrecision(g.startX + F, g.startY + N), t.beginPath(), t.rect(0, 0, f - F - B, _ - N - x), t.clip(), t.translateWithPrecision(0, it), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, z, nt), t.clip(), G.render(t), t.translateWithPrecision(lt, 0), t.restore(), t.restore(), V.set(S, {
|
2702
|
+
left: g.endX + F + o.rowHeaderWidth - pt,
|
2717
2703
|
top: g.startY + N + o.columnHeaderHeight,
|
2718
|
-
width:
|
2719
|
-
height:
|
2704
|
+
width: pt,
|
2705
|
+
height: _ - N - x
|
2720
2706
|
});
|
2721
2707
|
} else {
|
2722
|
-
t.save(), t.translateWithPrecision(g.startX, g.startY), t.beginPath(), t.rect(0, 0, f,
|
2723
|
-
const F = f - gt * 2 - Pt -
|
2708
|
+
t.save(), t.translateWithPrecision(g.startX, g.startY), t.beginPath(), t.rect(0, 0, f, _), t.clip();
|
2709
|
+
const F = f - gt * 2 - Pt - pt - 4, { documentSkeleton: N, documents: B, docModel: x } = _e(y, this._localeService, r);
|
2724
2710
|
U === It.WRAP && x.updateDocumentDataPageSize(Math.max(F, 1)), N.calculate();
|
2725
|
-
const z =
|
2711
|
+
const z = re(N), { height: H, width: G } = z, { paddingTop: J, paddingLeft: et } = jn(F, _, G, H, O, L);
|
2726
2712
|
t.translateWithPrecision(gt, J);
|
2727
|
-
const nt = Math.max(f - gt * 2, 1),
|
2713
|
+
const nt = Math.max(f - gt * 2, 1), st = H;
|
2728
2714
|
Jn.drawWith(t, {
|
2729
2715
|
width: nt,
|
2730
|
-
height:
|
2716
|
+
height: st,
|
2731
2717
|
fill: (P == null ? void 0 : P.color) || Ft,
|
2732
2718
|
radius: ze
|
2733
|
-
}), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, F, H), t.clip(), t.translateWithPrecision(et, 0), B.render(t), t.restore(), t.translateWithPrecision(F + Pt + 4, (H - ve) / 2), t.fillStyle =
|
2719
|
+
}), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, F, H), t.clip(), t.translateWithPrecision(et, 0), B.render(t), t.restore(), t.translateWithPrecision(F + Pt + 4, (H - ve) / 2), t.fillStyle = Kr, t.fill(xn), t.restore(), V.set(S, {
|
2734
2720
|
left: g.startX + gt + o.rowHeaderWidth,
|
2735
2721
|
top: g.startY + J + o.columnHeaderHeight,
|
2736
2722
|
width: nt,
|
2737
|
-
height:
|
2723
|
+
height: st
|
2738
2724
|
});
|
2739
2725
|
}
|
2740
2726
|
}
|
2741
2727
|
calcCellAutoHeight(t) {
|
2742
2728
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = e.isMergedMainCell ? e.mergeInfo : e, s = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = s || {}, d = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2743
|
-
if (!d || d.renderMode ===
|
2729
|
+
if (!d || d.renderMode === ct.TEXT)
|
2744
2730
|
return;
|
2745
|
-
const
|
2731
|
+
const C = {
|
2746
2732
|
startX: r.startX + l,
|
2747
2733
|
endX: r.endX - c,
|
2748
2734
|
startY: r.startY + u,
|
2749
2735
|
endY: r.endY - h
|
2750
|
-
}, p =
|
2736
|
+
}, p = C.endX - C.startX, R = mt(n), w = `${R != null ? R : ""}`;
|
2751
2737
|
let { tb: g, pd: f } = o || {};
|
2752
|
-
const { t:
|
2753
|
-
if (g = g != null ? g : It.WRAP, d.renderMode ===
|
2754
|
-
const
|
2755
|
-
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(
|
2756
|
-
const y =
|
2757
|
-
return P +
|
2738
|
+
const { t: _ = dt.pd.t, b: V = dt.pd.b } = f != null ? f : {};
|
2739
|
+
if (g = g != null ? g : It.WRAP, d.renderMode === ct.ARROW) {
|
2740
|
+
const S = p - pt, { documentSkeleton: I, docModel: v } = _e(w, this._localeService, o);
|
2741
|
+
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(S, 1)), I.calculate(), I.getActualSize();
|
2742
|
+
const y = re(I), { height: P } = y;
|
2743
|
+
return P + _ + V + zt * 2;
|
2758
2744
|
} else {
|
2759
|
-
const
|
2760
|
-
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(
|
2761
|
-
const y =
|
2745
|
+
const S = p - gt * 2 - Pt - pt, { documentSkeleton: I, docModel: v } = Bo(w, this._localeService, o);
|
2746
|
+
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(S, 1)), I.calculate();
|
2747
|
+
const y = re(I), {
|
2762
2748
|
height: P
|
2763
2749
|
} = y;
|
2764
|
-
return P +
|
2750
|
+
return P + zt * 2;
|
2765
2751
|
}
|
2766
2752
|
}
|
2767
2753
|
calcCellAutoWidth(t) {
|
2768
2754
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = e.isMergedMainCell ? e.mergeInfo : e, s = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = s || {}, d = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2769
|
-
if (!d || d.renderMode ===
|
2755
|
+
if (!d || d.renderMode === ct.TEXT)
|
2770
2756
|
return;
|
2771
|
-
const
|
2757
|
+
const C = {
|
2772
2758
|
startX: r.startX + l,
|
2773
2759
|
endX: r.endX - c,
|
2774
2760
|
startY: r.startY + u,
|
2775
2761
|
endY: r.endY - h
|
2776
|
-
}, p =
|
2762
|
+
}, p = C.endX - C.startX, R = mt(n), w = `${R != null ? R : ""}`;
|
2777
2763
|
let { tb: g, pd: f } = o || {};
|
2778
|
-
const { l:
|
2764
|
+
const { l: _ = dt.pd.l, r: V = dt.pd.r } = f != null ? f : {};
|
2779
2765
|
g = g != null ? g : It.WRAP;
|
2780
|
-
let
|
2766
|
+
let S = gt * 2 + pt;
|
2781
2767
|
switch (d.renderMode) {
|
2782
|
-
case
|
2783
|
-
|
2768
|
+
case ct.ARROW:
|
2769
|
+
S = pt + gt * 2 + V + _;
|
2784
2770
|
break;
|
2785
|
-
case
|
2786
|
-
|
2771
|
+
case ct.CUSTOM:
|
2772
|
+
S = pt + gt * 2 + Pt * 2 + V + _ + ze / 2 + 1;
|
2787
2773
|
break;
|
2788
2774
|
// default is CUSTOM
|
2789
2775
|
default:
|
2790
|
-
|
2776
|
+
S = pt + gt * 2 + Pt * 2 + V + _ + ze / 2 + 1;
|
2791
2777
|
}
|
2792
|
-
const I = p -
|
2793
|
-
return g === It.WRAP && y.updateDocumentDataPageSize(Math.max(I, 1)), v.calculate(), v.getActualSize(),
|
2778
|
+
const I = p - S, { documentSkeleton: v, docModel: y } = _e(w, this._localeService, o);
|
2779
|
+
return g === It.WRAP && y.updateDocumentDataPageSize(Math.max(I, 1)), v.calculate(), v.getActualSize(), re(v).width + S;
|
2794
2780
|
}
|
2795
2781
|
isHit(t, e) {
|
2796
2782
|
const { subUnitId: o, row: n, col: a } = e, r = this._ensureMap(o).get(this._generateKey(n, a)), s = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, n, a);
|
2797
|
-
if (!s || !r || s.renderMode ===
|
2783
|
+
if (!s || !r || s.renderMode === ct.TEXT)
|
2798
2784
|
return !1;
|
2799
|
-
const { top: l, left: c, width: u, height: h } = r, { x: d, y:
|
2800
|
-
return d >= c && d <= c + u &&
|
2785
|
+
const { top: l, left: c, width: u, height: h } = r, { x: d, y: C } = t;
|
2786
|
+
return d >= c && d <= c + u && C >= l && C <= l + h;
|
2801
2787
|
}
|
2802
2788
|
onPointerDown(t, e) {
|
2803
2789
|
if (e.button === 2)
|
@@ -2812,21 +2798,21 @@ let pn = class {
|
|
2812
2798
|
}
|
2813
2799
|
onPointerEnter(t, e) {
|
2814
2800
|
var o, n;
|
2815
|
-
(n = (o =
|
2801
|
+
(n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(qt.POINTER);
|
2816
2802
|
}
|
2817
2803
|
onPointerLeave(t, e) {
|
2818
2804
|
var o, n;
|
2819
|
-
(n = (o =
|
2805
|
+
(n = (o = Zt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(qt.DEFAULT);
|
2820
2806
|
}
|
2821
2807
|
};
|
2822
|
-
pn =
|
2823
|
-
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2827
|
-
|
2808
|
+
pn = zr([
|
2809
|
+
le(0, rt),
|
2810
|
+
le(1, b(Q)),
|
2811
|
+
le(2, tt),
|
2812
|
+
le(3, b(yt)),
|
2813
|
+
le(4, b(at))
|
2828
2814
|
], pn);
|
2829
|
-
class
|
2815
|
+
class Zr extends vt {
|
2830
2816
|
constructor() {
|
2831
2817
|
super(...arguments);
|
2832
2818
|
E(this, "id", K.LIST);
|
@@ -2836,39 +2822,39 @@ class Gr extends vt {
|
|
2836
2822
|
E(this, "formulaInput", Mn);
|
2837
2823
|
}
|
2838
2824
|
}
|
2839
|
-
class
|
2825
|
+
class qr extends vt {
|
2840
2826
|
constructor() {
|
2841
2827
|
super(...arguments);
|
2842
2828
|
E(this, "id", K.TEXT_LENGTH);
|
2843
2829
|
E(this, "formulaInput", Ue);
|
2844
2830
|
}
|
2845
2831
|
}
|
2846
|
-
class
|
2832
|
+
class Jr extends vt {
|
2847
2833
|
constructor() {
|
2848
2834
|
super(...arguments);
|
2849
2835
|
E(this, "id", K.WHOLE);
|
2850
2836
|
E(this, "formulaInput", Ue);
|
2851
2837
|
}
|
2852
2838
|
}
|
2853
|
-
var
|
2854
|
-
for (var a = n > 1 ? void 0 : n ?
|
2839
|
+
var Qr = Object.getOwnPropertyDescriptor, ts = (t, e, o, n) => {
|
2840
|
+
for (var a = n > 1 ? void 0 : n ? Qr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2855
2841
|
(r = t[i]) && (a = r(a) || a);
|
2856
2842
|
return a;
|
2857
2843
|
}, Ke = (t, e) => (o, n) => e(o, n, t);
|
2858
|
-
let
|
2844
|
+
let oe = class extends gn {
|
2859
2845
|
constructor(t, e, o) {
|
2860
2846
|
super(), this._injector = t, this._componentManger = e, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2861
2847
|
}
|
2862
2848
|
_initComponents() {
|
2863
2849
|
[
|
2864
2850
|
[Lo, wo],
|
2865
|
-
[Me,
|
2866
|
-
[Mo,
|
2867
|
-
[yn,
|
2868
|
-
[Oo,
|
2851
|
+
[Me, Ki],
|
2852
|
+
[Mo, gi],
|
2853
|
+
[yn, Ei],
|
2854
|
+
[Oo, ei],
|
2869
2855
|
[Oe.componentKey, Oe],
|
2870
2856
|
[Le.componentKey, Le],
|
2871
|
-
...
|
2857
|
+
...Vr
|
2872
2858
|
].forEach(([t, e]) => {
|
2873
2859
|
this.disposeWithMe(this._componentManger.register(
|
2874
2860
|
t,
|
@@ -2878,31 +2864,31 @@ let ee = class extends gn {
|
|
2878
2864
|
}
|
2879
2865
|
_registerValidatorViews() {
|
2880
2866
|
[
|
2881
|
-
|
2867
|
+
Nr,
|
2868
|
+
Jr,
|
2882
2869
|
qr,
|
2870
|
+
Fr,
|
2871
|
+
Pr,
|
2883
2872
|
Zr,
|
2884
|
-
|
2885
|
-
|
2886
|
-
Gr,
|
2887
|
-
jr,
|
2888
|
-
Pr
|
2873
|
+
Yr,
|
2874
|
+
Ar
|
2889
2875
|
].forEach((t) => {
|
2890
2876
|
const e = this._injector.createInstance(t), o = this._dataValidatorRegistryService.getValidatorItem(e.id);
|
2891
2877
|
o && (o.formulaInput = e.formulaInput, o.canvasRender = e.canvasRender, o.dropdown = e.dropdown, o.optionsInput = e.optionsInput);
|
2892
2878
|
});
|
2893
2879
|
}
|
2894
2880
|
};
|
2895
|
-
|
2881
|
+
oe = ts([
|
2896
2882
|
Ke(0, b(Wt)),
|
2897
2883
|
Ke(1, b(Ae)),
|
2898
2884
|
Ke(2, b(bt))
|
2899
|
-
],
|
2900
|
-
var
|
2901
|
-
for (var a = n > 1 ? void 0 : n ?
|
2885
|
+
], oe);
|
2886
|
+
var es = Object.getOwnPropertyDescriptor, ns = (t, e, o, n) => {
|
2887
|
+
for (var a = n > 1 ? void 0 : n ? es(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2902
2888
|
(r = t[i]) && (a = r(a) || a);
|
2903
2889
|
return a;
|
2904
2890
|
}, Ge = (t, e) => (o, n) => e(o, n, t);
|
2905
|
-
const
|
2891
|
+
const os = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2906
2892
|
var Se;
|
2907
2893
|
let Yn = (Se = class extends Zn {
|
2908
2894
|
constructor(t = Ee, e, o, n) {
|
@@ -2919,12 +2905,12 @@ let Yn = (Se = class extends Zn {
|
|
2919
2905
|
[ft],
|
2920
2906
|
[Dt],
|
2921
2907
|
[ue],
|
2922
|
-
[qt],
|
2923
|
-
[te],
|
2924
2908
|
[Qt],
|
2925
|
-
[
|
2909
|
+
[ne],
|
2910
|
+
[ee],
|
2911
|
+
[te],
|
2926
2912
|
[ce],
|
2927
|
-
[
|
2913
|
+
[oe]
|
2928
2914
|
].forEach((t) => {
|
2929
2915
|
this._injector.add(t);
|
2930
2916
|
}), [
|
@@ -2939,29 +2925,29 @@ let Yn = (Se = class extends Zn {
|
|
2939
2925
|
});
|
2940
2926
|
}
|
2941
2927
|
onReady() {
|
2942
|
-
this._injector.get(
|
2928
|
+
this._injector.get(te), this._injector.get(ee), this._injector.get(ce), this._injector.get(ue), this._injector.get(yt).registerRenderModule(
|
2943
2929
|
X.UNIVER_SHEET,
|
2944
2930
|
[be]
|
2945
2931
|
);
|
2946
2932
|
}
|
2947
2933
|
onRendered() {
|
2948
|
-
this._injector.get(
|
2934
|
+
this._injector.get(oe), this._injector.get(ne);
|
2949
2935
|
}
|
2950
2936
|
onSteady() {
|
2951
|
-
this._injector.get(
|
2937
|
+
this._injector.get(Qt);
|
2952
2938
|
}
|
2953
|
-
}, E(Se, "pluginName",
|
2954
|
-
Yn =
|
2939
|
+
}, E(Se, "pluginName", os), E(Se, "type", X.UNIVER_SHEET), Se);
|
2940
|
+
Yn = ns([
|
2955
2941
|
Ge(1, b(Wt)),
|
2956
2942
|
Ge(2, tt),
|
2957
2943
|
Ge(3, mn)
|
2958
2944
|
], Yn);
|
2959
|
-
var
|
2960
|
-
for (var a = n > 1 ? void 0 : n ?
|
2945
|
+
var as = Object.getOwnPropertyDescriptor, is = (t, e, o, n) => {
|
2946
|
+
for (var a = n > 1 ? void 0 : n ? as(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2961
2947
|
(r = t[i]) && (a = r(a) || a);
|
2962
2948
|
return a;
|
2963
2949
|
}, Ze = (t, e) => (o, n) => e(o, n, t);
|
2964
|
-
const
|
2950
|
+
const rs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2965
2951
|
var Ce;
|
2966
2952
|
let Xn = (Ce = class extends Zn {
|
2967
2953
|
constructor(t = Ee, e, o, n) {
|
@@ -2978,11 +2964,11 @@ let Xn = (Ce = class extends Zn {
|
|
2978
2964
|
[ft],
|
2979
2965
|
[Dt],
|
2980
2966
|
[ue],
|
2981
|
-
[qt],
|
2982
|
-
[te],
|
2983
2967
|
[Qt],
|
2984
|
-
[
|
2985
|
-
[ee]
|
2968
|
+
[ne],
|
2969
|
+
[ee],
|
2970
|
+
[te],
|
2971
|
+
[oe]
|
2986
2972
|
].forEach((t) => {
|
2987
2973
|
this._injector.add(t);
|
2988
2974
|
}), [
|
@@ -2997,19 +2983,19 @@ let Xn = (Ce = class extends Zn {
|
|
2997
2983
|
});
|
2998
2984
|
}
|
2999
2985
|
onReady() {
|
3000
|
-
this._injector.get(
|
2986
|
+
this._injector.get(te), this._injector.get(ee), this._injector.get(yt).registerRenderModule(
|
3001
2987
|
X.UNIVER_SHEET,
|
3002
2988
|
[be]
|
3003
2989
|
);
|
3004
2990
|
}
|
3005
2991
|
onRendered() {
|
3006
|
-
this._injector.get(
|
2992
|
+
this._injector.get(oe), this._injector.get(ne);
|
3007
2993
|
}
|
3008
2994
|
onSteady() {
|
3009
|
-
this._injector.get(
|
2995
|
+
this._injector.get(Qt);
|
3010
2996
|
}
|
3011
|
-
}, E(Ce, "pluginName",
|
3012
|
-
Xn =
|
2997
|
+
}, E(Ce, "pluginName", rs), E(Ce, "type", X.UNIVER_SHEET), Ce);
|
2998
|
+
Xn = is([
|
3013
2999
|
Ze(1, b(Wt)),
|
3014
3000
|
Ze(2, tt),
|
3015
3001
|
Ze(3, mn)
|