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