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