@univerjs/sheets-data-validation-ui 0.5.0-nightly.202411121606 → 0.5.0-nightly.202411131606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +1367 -1342
- package/lib/types/views/widgets/checkbox-widget.d.ts +5 -2
- package/lib/types/views/widgets/dropdown-multiple-widget.d.ts +5 -2
- package/lib/types/views/widgets/dropdown-widget.d.ts +5 -4
- package/lib/umd/index.js +2 -2
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import
|
5
|
-
import { Inject as Y, LocaleService as
|
6
|
-
import { Button as
|
7
|
-
import { DeviceInputEventType as
|
8
|
-
import { SheetInterceptorService as
|
9
|
-
import { SheetDataValidationModel as
|
10
|
-
import { getPatternType as
|
11
|
-
import { SetCellEditVisibleOperation as
|
12
|
-
import { IDialogService as
|
13
|
-
import { DataValidatorRegistryService as
|
14
|
-
import { RichTextEditingMutation as
|
15
|
-
import { filter as
|
16
|
-
import { deserializeRangeWithSheet as
|
17
|
-
import { RangeSelector as
|
18
|
-
var
|
19
|
-
function
|
1
|
+
var Wo = Object.defineProperty;
|
2
|
+
var Yo = (t, e, o) => e in t ? Wo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
3
|
+
var k = (t, e, o) => Yo(t, typeof e != "symbol" ? e + "" : e, o);
|
4
|
+
import Ke, { useState as q, forwardRef as wt, useRef as Ht, createElement as It, useMemo as $t, useEffect as St } from "react";
|
5
|
+
import { Inject as Y, LocaleService as ot, Disposable as Dt, DataValidationErrorStyle as oe, useDependency as W, ICommandService as at, numfmt as Ge, CellValueType as Xo, UniverInstanceType as Q, toDisposable as zo, IUniverInstanceService as gt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ko, DisposableCollection as Go, CommandType as qt, BuildTextUtils as Zo, DataValidationRenderMode as dt, DataValidationType as nt, IConfigService as dn, UndoCommand as qo, RedoCommand as Jo, isUnitRangesEqual as Qo, debounce as ta, shallowEqual as yn, Injector as jt, DataValidationStatus as ae, ObjectMatrix as ve, Range as ea, Rectangle as _e, queryObjectMatrix as Ze, Optional as na, RxDisposable as cn, InterceptorEffectEnum as Wn, sequenceExecute as Yn, bufferDebounceTime as oa, isFormulaString as Tt, Tools as qe, ThemeService as aa, VerticalAlign as ut, HorizontalAlign as Wt, DEFAULT_STYLES as lt, WrapStrategy as _t, DocumentDataModel as ia, DEFAULT_EMPTY_DOCUMENT_VALUE as ra, BooleanNumber as Jt, Plugin as Xn } from "@univerjs/core";
|
6
|
+
import { Button as At, DatePanel as sa, Scrollbar as la, FormLayout as et, RadioGroup as un, Radio as Lt, Checkbox as be, Input as xt, Select as Je, DraggableList as da } from "@univerjs/design";
|
7
|
+
import { DeviceInputEventType as Qe, IRenderManagerService as Rt, fixLineWidthByScale as Vn, Transform as ca, Checkbox as ua, CURSOR_TYPE as Yt, FontCache as ha, Shape as fa, Rect as zn, getFontStyleString as xe, getDocsSkeletonPageSize as Qt, DocumentViewModel as pa, DocumentSkeleton as ma, Documents as ga } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as hn, AFTER_CELL_EDIT_ASYNC as va, SetRangeValuesCommand as fn, SheetsSelectionsService as Kn, getSheetCommandTarget as Gn, WorkbookEditablePermission as Se, RangeProtectionPermissionEditPoint as Ce, WorksheetEditPermission as we, checkRangesEditablePermission as _a, WorksheetSetCellStylePermission as tn, INTERCEPTOR_POINT as Zn, InterceptCellContentPriority as qn } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as yt, getCellValueOrigin as st, getDataValidationCellValue as Sa, deserializeListOptions as Jn, serializeListOptions as Qn, UpdateSheetDataValidationRangeCommand as to, UpdateSheetDataValidationSettingCommand as Mn, RemoveSheetDataValidationCommand as eo, UpdateSheetDataValidationOptionsCommand as Ca, createDefaultNewRule as no, AddSheetDataValidationCommand as pn, RemoveSheetAllDataValidationCommand as wa, DATA_VALIDATION_PLUGIN_NAME as oo, getDataValidationDiffMutations as en, DataValidationCacheService as ao, DataValidationFormulaController as Ia, DataValidationFormulaService as Da, getFormulaResult as Ae, isLegalFormulaResult as bn, transformCheckboxValue as Ra, CHECKBOX_FORMULA_1 as ya, CHECKBOX_FORMULA_2 as Va } from "@univerjs/sheets-data-validation";
|
10
|
+
import { getPatternType as Ma } from "@univerjs/sheets-numfmt";
|
11
|
+
import { SetCellEditVisibleOperation as io, SheetCanvasPopManagerService as ba, IEditorBridgeService as ro, SheetPermissionInterceptorBaseController as so, IMarkSelectionService as Ea, HoverManagerService as Oa, CellAlertManagerService as Ta, CellAlertType as Pa, IAutoFillService as $a, APPLY_TYPE as te, virtualizeDiscreteRanges as nn, getAutoFillRepeatRange as La, COPY_TYPE as En, rangeToDiscreteRange as xa, PREDEFINED_HOOK_NAME as se, getRepeatRange as On, ISheetClipboardService as Aa, getCurrentRangeDisable$ as ja, AutoHeightController as lo, SheetSkeletonManagerService as Ie } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as Fa, KeyCode as on, ISidebarService as co, useObservable as Ft, ComponentManager as Ee, IZenZoneService as uo, RectPopup as Na, useEvent as ho, useSidebarClick as mn, MenuItemType as gn, getMenuHiddenObservable as Ua, RibbonStartGroup as ka, IMenuManagerService as Ba } from "@univerjs/ui";
|
13
|
+
import { DataValidatorRegistryService as Vt, DataValidationModel as Oe, DataValidatorRegistryScope as Ha, TWO_FORMULA_OPERATOR_COUNT as Wa, getRuleOptions as Tn, getRuleSetting as Pn } from "@univerjs/data-validation";
|
14
|
+
import { RichTextEditingMutation as Ya } from "@univerjs/docs";
|
15
|
+
import { filter as vn, BehaviorSubject as $n, distinctUntilChanged as Xa, Subject as za, debounceTime as _n, bufferTime as fo } from "rxjs";
|
16
|
+
import { deserializeRangeWithSheet as Ka, serializeRange as po } from "@univerjs/engine-formula";
|
17
|
+
import { RangeSelector as Ga, FormulaEditor as mo } from "@univerjs/sheets-formula-ui";
|
18
|
+
var go = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
19
|
+
function vo(t) {
|
20
20
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
21
21
|
}
|
22
|
-
var
|
22
|
+
var _o = { exports: {} }, Te = {};
|
23
23
|
/**
|
24
24
|
* @license React
|
25
25
|
* react-jsx-runtime.production.min.js
|
@@ -29,24 +29,24 @@ var ma = { exports: {} }, Oe = {};
|
|
29
29
|
* This source code is licensed under the MIT license found in the
|
30
30
|
* LICENSE file in the root directory of this source tree.
|
31
31
|
*/
|
32
|
-
var
|
33
|
-
function
|
34
|
-
var n,
|
35
|
-
|
36
|
-
for (n in e)
|
37
|
-
if (t && t.defaultProps) for (n in e = t.defaultProps, e)
|
38
|
-
return { $$typeof:
|
32
|
+
var Za = Ke, qa = Symbol.for("react.element"), Ja = Symbol.for("react.fragment"), Qa = Object.prototype.hasOwnProperty, ti = Za.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, ei = { key: !0, ref: !0, __self: !0, __source: !0 };
|
33
|
+
function So(t, e, o) {
|
34
|
+
var n, a = {}, i = null, r = null;
|
35
|
+
o !== void 0 && (i = "" + o), e.key !== void 0 && (i = "" + e.key), e.ref !== void 0 && (r = e.ref);
|
36
|
+
for (n in e) Qa.call(e, n) && !ei.hasOwnProperty(n) && (a[n] = e[n]);
|
37
|
+
if (t && t.defaultProps) for (n in e = t.defaultProps, e) a[n] === void 0 && (a[n] = e[n]);
|
38
|
+
return { $$typeof: qa, type: t, key: i, ref: r, props: a, _owner: ti.current };
|
39
39
|
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
var p =
|
40
|
+
Te.Fragment = Ja;
|
41
|
+
Te.jsx = So;
|
42
|
+
Te.jsxs = So;
|
43
|
+
_o.exports = Te;
|
44
|
+
var p = _o.exports, Co = { exports: {} };
|
45
45
|
(function(t, e) {
|
46
|
-
(function(
|
46
|
+
(function(o, n) {
|
47
47
|
t.exports = n();
|
48
|
-
})(
|
49
|
-
var
|
48
|
+
})(go, function() {
|
49
|
+
var o = 1e3, n = 6e4, a = 36e5, i = "millisecond", r = "second", l = "minute", s = "hour", c = "day", u = "week", h = "month", d = "quarter", C = "year", m = "date", f = "Invalid Date", D = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, V = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(w) {
|
50
50
|
var v = ["th", "st", "nd", "rd"], g = w % 100;
|
51
51
|
return "[" + w + (v[(g - 20) % 10] || v[g] || v[0]) + "]";
|
52
52
|
} }, S = function(w, v, g) {
|
@@ -57,55 +57,55 @@ var p = ma.exports, va = { exports: {} };
|
|
57
57
|
return (v <= 0 ? "+" : "-") + S(I, 2, "0") + ":" + S(_, 2, "0");
|
58
58
|
}, m: function w(v, g) {
|
59
59
|
if (v.date() < g.date()) return -w(g, v);
|
60
|
-
var I = 12 * (g.year() - v.year()) + (g.month() - v.month()), _ = v.clone().add(I, h),
|
61
|
-
return +(-(I + (g - _) / (
|
60
|
+
var I = 12 * (g.year() - v.year()) + (g.month() - v.month()), _ = v.clone().add(I, h), $ = g - _ < 0, b = v.clone().add(I + ($ ? -1 : 1), h);
|
61
|
+
return +(-(I + (g - _) / ($ ? _ - b : b - _)) || 0);
|
62
62
|
}, a: function(w) {
|
63
63
|
return w < 0 ? Math.ceil(w) || 0 : Math.floor(w);
|
64
64
|
}, p: function(w) {
|
65
65
|
return { M: h, y: C, w: u, d: c, D: m, h: s, m: l, s: r, ms: i, Q: d }[w] || String(w || "").toLowerCase().replace(/s$/, "");
|
66
66
|
}, u: function(w) {
|
67
67
|
return w === void 0;
|
68
|
-
} },
|
69
|
-
|
68
|
+
} }, O = "en", T = {};
|
69
|
+
T[O] = V;
|
70
70
|
var R = "$isDayjsObject", P = function(w) {
|
71
|
-
return w instanceof
|
71
|
+
return w instanceof N || !(!w || !w[R]);
|
72
72
|
}, j = function w(v, g, I) {
|
73
73
|
var _;
|
74
|
-
if (!v) return
|
74
|
+
if (!v) return O;
|
75
75
|
if (typeof v == "string") {
|
76
|
-
var
|
77
|
-
$
|
76
|
+
var $ = v.toLowerCase();
|
77
|
+
T[$] && (_ = $), g && (T[$] = g, _ = $);
|
78
78
|
var b = v.split("-");
|
79
79
|
if (!_ && b.length > 1) return w(b[0]);
|
80
80
|
} else {
|
81
|
-
var
|
82
|
-
|
81
|
+
var U = v.name;
|
82
|
+
T[U] = v, _ = U;
|
83
83
|
}
|
84
|
-
return !I && _ && (
|
84
|
+
return !I && _ && (O = _), _ || !I && O;
|
85
85
|
}, A = function(w, v) {
|
86
86
|
if (P(w)) return w.clone();
|
87
87
|
var g = typeof v == "object" ? v : {};
|
88
|
-
return g.date = w, g.args = arguments, new
|
88
|
+
return g.date = w, g.args = arguments, new N(g);
|
89
89
|
}, M = x;
|
90
90
|
M.l = j, M.i = P, M.w = function(w, v) {
|
91
91
|
return A(w, { locale: v.$L, utc: v.$u, x: v.$x, $offset: v.$offset });
|
92
92
|
};
|
93
|
-
var
|
93
|
+
var N = function() {
|
94
94
|
function w(g) {
|
95
95
|
this.$L = j(g.locale, null, !0), this.parse(g), this.$x = this.$x || g.x || {}, this[R] = !0;
|
96
96
|
}
|
97
97
|
var v = w.prototype;
|
98
98
|
return v.parse = function(g) {
|
99
99
|
this.$d = function(I) {
|
100
|
-
var _ = I.date,
|
100
|
+
var _ = I.date, $ = I.utc;
|
101
101
|
if (_ === null) return /* @__PURE__ */ new Date(NaN);
|
102
102
|
if (M.u(_)) return /* @__PURE__ */ new Date();
|
103
103
|
if (_ instanceof Date) return new Date(_);
|
104
104
|
if (typeof _ == "string" && !/Z$/i.test(_)) {
|
105
105
|
var b = _.match(D);
|
106
106
|
if (b) {
|
107
|
-
var
|
108
|
-
return
|
107
|
+
var U = b[2] - 1 || 0, X = (b[7] || "0").substring(0, 3);
|
108
|
+
return $ ? new Date(Date.UTC(b[1], U, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, X)) : new Date(b[1], U, b[3] || 1, b[4] || 0, b[5] || 0, b[6] || 0, X);
|
109
109
|
}
|
110
110
|
}
|
111
111
|
return new Date(_);
|
@@ -131,20 +131,20 @@ var p = ma.exports, va = { exports: {} };
|
|
131
131
|
}, v.valueOf = function() {
|
132
132
|
return this.$d.getTime();
|
133
133
|
}, v.startOf = function(g, I) {
|
134
|
-
var _ = this,
|
135
|
-
var z = M.w(_.$u ? Date.UTC(_.$y,
|
136
|
-
return
|
137
|
-
}, X = function(
|
138
|
-
return M.w(_.toDate()[
|
134
|
+
var _ = this, $ = !!M.u(I) || I, b = M.p(g), U = function(H, F) {
|
135
|
+
var z = M.w(_.$u ? Date.UTC(_.$y, F, H) : new Date(_.$y, F, H), _);
|
136
|
+
return $ ? z : z.endOf(c);
|
137
|
+
}, X = function(H, F) {
|
138
|
+
return M.w(_.toDate()[H].apply(_.toDate("s"), ($ ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(F)), _);
|
139
139
|
}, K = this.$W, G = this.$M, Z = this.$D, J = "set" + (this.$u ? "UTC" : "");
|
140
140
|
switch (b) {
|
141
141
|
case C:
|
142
|
-
return
|
142
|
+
return $ ? U(1, 0) : U(31, 11);
|
143
143
|
case h:
|
144
|
-
return
|
144
|
+
return $ ? U(1, G) : U(0, G + 1);
|
145
145
|
case u:
|
146
|
-
var
|
147
|
-
return
|
146
|
+
var L = this.$locale().weekStart || 0, E = (K < L ? K + 7 : K) - L;
|
147
|
+
return U($ ? Z - E : Z + (6 - E), G);
|
148
148
|
case c:
|
149
149
|
case m:
|
150
150
|
return X(J + "Hours", 0);
|
@@ -160,45 +160,45 @@ var p = ma.exports, va = { exports: {} };
|
|
160
160
|
}, v.endOf = function(g) {
|
161
161
|
return this.startOf(g, !1);
|
162
162
|
}, v.$set = function(g, I) {
|
163
|
-
var _,
|
164
|
-
if (
|
163
|
+
var _, $ = M.p(g), b = "set" + (this.$u ? "UTC" : ""), U = (_ = {}, _[c] = b + "Date", _[m] = b + "Date", _[h] = b + "Month", _[C] = b + "FullYear", _[s] = b + "Hours", _[l] = b + "Minutes", _[r] = b + "Seconds", _[i] = b + "Milliseconds", _)[$], X = $ === c ? this.$D + (I - this.$W) : I;
|
164
|
+
if ($ === h || $ === C) {
|
165
165
|
var K = this.clone().set(m, 1);
|
166
|
-
K.$d[
|
167
|
-
} else
|
166
|
+
K.$d[U](X), K.init(), this.$d = K.set(m, Math.min(this.$D, K.daysInMonth())).$d;
|
167
|
+
} else U && this.$d[U](X);
|
168
168
|
return this.init(), this;
|
169
169
|
}, v.set = function(g, I) {
|
170
170
|
return this.clone().$set(g, I);
|
171
171
|
}, v.get = function(g) {
|
172
172
|
return this[M.p(g)]();
|
173
173
|
}, v.add = function(g, I) {
|
174
|
-
var _,
|
174
|
+
var _, $ = this;
|
175
175
|
g = Number(g);
|
176
|
-
var b = M.p(I),
|
177
|
-
var Z = A(
|
178
|
-
return M.w(Z.date(Z.date() + Math.round(G * g)),
|
176
|
+
var b = M.p(I), U = function(G) {
|
177
|
+
var Z = A($);
|
178
|
+
return M.w(Z.date(Z.date() + Math.round(G * g)), $);
|
179
179
|
};
|
180
180
|
if (b === h) return this.set(h, this.$M + g);
|
181
181
|
if (b === C) return this.set(C, this.$y + g);
|
182
|
-
if (b === c) return
|
183
|
-
if (b === u) return
|
184
|
-
var X = (_ = {}, _[l] = n, _[s] =
|
182
|
+
if (b === c) return U(1);
|
183
|
+
if (b === u) return U(7);
|
184
|
+
var X = (_ = {}, _[l] = n, _[s] = a, _[r] = o, _)[b] || 1, K = this.$d.getTime() + g * X;
|
185
185
|
return M.w(K, this);
|
186
186
|
}, v.subtract = function(g, I) {
|
187
187
|
return this.add(-1 * g, I);
|
188
188
|
}, v.format = function(g) {
|
189
189
|
var I = this, _ = this.$locale();
|
190
190
|
if (!this.isValid()) return _.invalidDate || f;
|
191
|
-
var
|
192
|
-
return
|
193
|
-
},
|
194
|
-
return M.s(
|
195
|
-
},
|
196
|
-
var
|
197
|
-
return
|
191
|
+
var $ = g || "YYYY-MM-DDTHH:mm:ssZ", b = M.z(this), U = this.$H, X = this.$m, K = this.$M, G = _.weekdays, Z = _.months, J = _.meridiem, L = function(F, z, it, Ut) {
|
192
|
+
return F && (F[z] || F(I, $)) || it[z].slice(0, Ut);
|
193
|
+
}, E = function(F) {
|
194
|
+
return M.s(U % 12 || 12, F, "0");
|
195
|
+
}, H = J || function(F, z, it) {
|
196
|
+
var Ut = F < 12 ? "AM" : "PM";
|
197
|
+
return it ? Ut.toLowerCase() : Ut;
|
198
198
|
};
|
199
|
-
return
|
200
|
-
return z || function(
|
201
|
-
switch (
|
199
|
+
return $.replace(y, function(F, z) {
|
200
|
+
return z || function(it) {
|
201
|
+
switch (it) {
|
202
202
|
case "YY":
|
203
203
|
return String(I.$y).slice(-2);
|
204
204
|
case "YYYY":
|
@@ -208,9 +208,9 @@ var p = ma.exports, va = { exports: {} };
|
|
208
208
|
case "MM":
|
209
209
|
return M.s(K + 1, 2, "0");
|
210
210
|
case "MMM":
|
211
|
-
return
|
211
|
+
return L(_.monthsShort, K, Z, 3);
|
212
212
|
case "MMMM":
|
213
|
-
return
|
213
|
+
return L(Z, K);
|
214
214
|
case "D":
|
215
215
|
return I.$D;
|
216
216
|
case "DD":
|
@@ -218,23 +218,23 @@ var p = ma.exports, va = { exports: {} };
|
|
218
218
|
case "d":
|
219
219
|
return String(I.$W);
|
220
220
|
case "dd":
|
221
|
-
return
|
221
|
+
return L(_.weekdaysMin, I.$W, G, 2);
|
222
222
|
case "ddd":
|
223
|
-
return
|
223
|
+
return L(_.weekdaysShort, I.$W, G, 3);
|
224
224
|
case "dddd":
|
225
225
|
return G[I.$W];
|
226
226
|
case "H":
|
227
|
-
return String(
|
227
|
+
return String(U);
|
228
228
|
case "HH":
|
229
|
-
return M.s(
|
229
|
+
return M.s(U, 2, "0");
|
230
230
|
case "h":
|
231
|
-
return
|
231
|
+
return E(1);
|
232
232
|
case "hh":
|
233
|
-
return
|
233
|
+
return E(2);
|
234
234
|
case "a":
|
235
|
-
return
|
235
|
+
return H(U, X, !0);
|
236
236
|
case "A":
|
237
|
-
return
|
237
|
+
return H(U, X, !1);
|
238
238
|
case "m":
|
239
239
|
return String(X);
|
240
240
|
case "mm":
|
@@ -249,51 +249,51 @@ var p = ma.exports, va = { exports: {} };
|
|
249
249
|
return b;
|
250
250
|
}
|
251
251
|
return null;
|
252
|
-
}(
|
252
|
+
}(F) || b.replace(":", "");
|
253
253
|
});
|
254
254
|
}, v.utcOffset = function() {
|
255
255
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
256
256
|
}, v.diff = function(g, I, _) {
|
257
|
-
var
|
257
|
+
var $, b = this, U = M.p(I), X = A(g), K = (X.utcOffset() - this.utcOffset()) * n, G = this - X, Z = function() {
|
258
258
|
return M.m(b, X);
|
259
259
|
};
|
260
|
-
switch (
|
260
|
+
switch (U) {
|
261
261
|
case C:
|
262
|
-
|
262
|
+
$ = Z() / 12;
|
263
263
|
break;
|
264
264
|
case h:
|
265
|
-
|
265
|
+
$ = Z();
|
266
266
|
break;
|
267
267
|
case d:
|
268
|
-
|
268
|
+
$ = Z() / 3;
|
269
269
|
break;
|
270
270
|
case u:
|
271
|
-
|
271
|
+
$ = (G - K) / 6048e5;
|
272
272
|
break;
|
273
273
|
case c:
|
274
|
-
|
274
|
+
$ = (G - K) / 864e5;
|
275
275
|
break;
|
276
276
|
case s:
|
277
|
-
|
277
|
+
$ = G / a;
|
278
278
|
break;
|
279
279
|
case l:
|
280
|
-
|
280
|
+
$ = G / n;
|
281
281
|
break;
|
282
282
|
case r:
|
283
|
-
|
283
|
+
$ = G / o;
|
284
284
|
break;
|
285
285
|
default:
|
286
|
-
|
286
|
+
$ = G;
|
287
287
|
}
|
288
|
-
return _ ?
|
288
|
+
return _ ? $ : M.a($);
|
289
289
|
}, v.daysInMonth = function() {
|
290
290
|
return this.endOf(h).$D;
|
291
291
|
}, v.$locale = function() {
|
292
|
-
return
|
292
|
+
return T[this.$L];
|
293
293
|
}, v.locale = function(g, I) {
|
294
294
|
if (!g) return this.$L;
|
295
|
-
var _ = this.clone(),
|
296
|
-
return
|
295
|
+
var _ = this.clone(), $ = j(g, I, !0);
|
296
|
+
return $ && (_.$L = $), _;
|
297
297
|
}, v.clone = function() {
|
298
298
|
return M.w(this.$d, this);
|
299
299
|
}, v.toDate = function() {
|
@@ -305,26 +305,26 @@ var p = ma.exports, va = { exports: {} };
|
|
305
305
|
}, v.toString = function() {
|
306
306
|
return this.$d.toUTCString();
|
307
307
|
}, w;
|
308
|
-
}(), B =
|
308
|
+
}(), B = N.prototype;
|
309
309
|
return A.prototype = B, [["$ms", i], ["$s", r], ["$m", l], ["$H", s], ["$W", c], ["$M", h], ["$y", C], ["$D", m]].forEach(function(w) {
|
310
310
|
B[w[1]] = function(v) {
|
311
311
|
return this.$g(v, w[0], w[1]);
|
312
312
|
};
|
313
313
|
}), A.extend = function(w, v) {
|
314
|
-
return w.$i || (w(v,
|
314
|
+
return w.$i || (w(v, N, A), w.$i = !0), A;
|
315
315
|
}, A.locale = j, A.isDayjs = P, A.unix = function(w) {
|
316
316
|
return A(1e3 * w);
|
317
|
-
}, A.en =
|
317
|
+
}, A.en = T[O], A.Ls = T, A.p = {}, A;
|
318
318
|
});
|
319
|
-
})(
|
320
|
-
var
|
321
|
-
const
|
322
|
-
var
|
319
|
+
})(Co);
|
320
|
+
var ni = Co.exports;
|
321
|
+
const De = /* @__PURE__ */ vo(ni);
|
322
|
+
var wo = { exports: {} };
|
323
323
|
(function(t, e) {
|
324
|
-
(function(
|
324
|
+
(function(o, n) {
|
325
325
|
t.exports = n();
|
326
|
-
})(
|
327
|
-
var
|
326
|
+
})(go, function() {
|
327
|
+
var o = "minute", n = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g;
|
328
328
|
return function(i, r, l) {
|
329
329
|
var s = r.prototype;
|
330
330
|
l.utc = function(f) {
|
@@ -332,7 +332,7 @@ var _a = { exports: {} };
|
|
332
332
|
return new r(D);
|
333
333
|
}, s.utc = function(f) {
|
334
334
|
var D = l(this.toDate(), { locale: this.$L, utc: !0 });
|
335
|
-
return f ? D.add(this.utcOffset(),
|
335
|
+
return f ? D.add(this.utcOffset(), o) : D;
|
336
336
|
}, s.local = function() {
|
337
337
|
return l(this.toDate(), { locale: this.$L, utc: !1 });
|
338
338
|
};
|
@@ -351,18 +351,18 @@ var _a = { exports: {} };
|
|
351
351
|
s.utcOffset = function(f, D) {
|
352
352
|
var y = this.$utils().u;
|
353
353
|
if (y(f)) return this.$u ? 0 : y(this.$offset) ? h.call(this) : this.$offset;
|
354
|
-
if (typeof f == "string" && (f = function(
|
355
|
-
|
356
|
-
var
|
357
|
-
if (
|
358
|
-
var R = ("" +
|
354
|
+
if (typeof f == "string" && (f = function(O) {
|
355
|
+
O === void 0 && (O = "");
|
356
|
+
var T = O.match(n);
|
357
|
+
if (!T) return null;
|
358
|
+
var R = ("" + T[0]).match(a) || ["-", 0, 0], P = R[0], j = 60 * +R[1] + +R[2];
|
359
359
|
return j === 0 ? 0 : P === "+" ? j : -j;
|
360
360
|
}(f), f === null)) return this;
|
361
361
|
var V = Math.abs(f) <= 16 ? 60 * f : f, S = this;
|
362
362
|
if (D) return S.$offset = V, S.$u = f === 0, S;
|
363
363
|
if (f !== 0) {
|
364
364
|
var x = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
365
|
-
(S = this.local().add(V + x,
|
365
|
+
(S = this.local().add(V + x, o)).$offset = V, S.$x.$localOffset = x;
|
366
366
|
} else S = this.utc();
|
367
367
|
return S;
|
368
368
|
};
|
@@ -392,27 +392,27 @@ var _a = { exports: {} };
|
|
392
392
|
};
|
393
393
|
};
|
394
394
|
});
|
395
|
-
})(
|
396
|
-
var
|
397
|
-
const
|
398
|
-
var
|
399
|
-
for (var
|
400
|
-
(r = t[i]) && (
|
401
|
-
return n &&
|
402
|
-
},
|
403
|
-
let
|
404
|
-
constructor(t, e,
|
405
|
-
super(), this._sheetInterceptorService = t, this._dataValidationModel = e, this._dataValidatorRegistryService =
|
395
|
+
})(wo);
|
396
|
+
var oi = wo.exports;
|
397
|
+
const ai = /* @__PURE__ */ vo(oi);
|
398
|
+
var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, si = (t, e, o, n) => {
|
399
|
+
for (var a = n > 1 ? void 0 : n ? ri(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
400
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
401
|
+
return n && a && ii(e, o, a), a;
|
402
|
+
}, ee = (t, e) => (o, n) => e(o, n, t);
|
403
|
+
let ie = class extends Dt {
|
404
|
+
constructor(t, e, o, n, a) {
|
405
|
+
super(), this._sheetInterceptorService = t, this._dataValidationModel = e, this._dataValidatorRegistryService = o, this._dialogService = n, this._localeService = a, this._initEditorBridgeInterceptor();
|
406
406
|
}
|
407
407
|
_initEditorBridgeInterceptor() {
|
408
408
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
409
|
-
|
409
|
+
va,
|
410
410
|
{
|
411
|
-
handler: async (t, e,
|
411
|
+
handler: async (t, e, o) => {
|
412
412
|
var f;
|
413
|
-
const n = await t, { worksheet:
|
414
|
-
if (!h || h.errorStyle !==
|
415
|
-
return
|
413
|
+
const n = await t, { worksheet: a, row: i, col: r, unitId: l, subUnitId: s, workbook: c } = e, u = this._dataValidationModel.getRuleIdByLocation(l, s, i, r), h = u ? this._dataValidationModel.getRuleById(l, s, u) : void 0;
|
414
|
+
if (!h || h.errorStyle !== oe.STOP)
|
415
|
+
return o(Promise.resolve(n));
|
416
416
|
const d = await this._dataValidatorRegistryService.getValidatorItem(h.type);
|
417
417
|
if (!d || await d.validator(
|
418
418
|
{
|
@@ -422,14 +422,14 @@ let ae = class extends Dt {
|
|
422
422
|
column: r,
|
423
423
|
unitId: l,
|
424
424
|
subUnitId: s,
|
425
|
-
worksheet:
|
425
|
+
worksheet: a,
|
426
426
|
workbook: c,
|
427
427
|
t: n == null ? void 0 : n.t
|
428
428
|
},
|
429
429
|
h
|
430
430
|
))
|
431
|
-
return
|
432
|
-
const m =
|
431
|
+
return o(Promise.resolve(n));
|
432
|
+
const m = a.getCellRaw(i, r);
|
433
433
|
return this._dialogService.open({
|
434
434
|
width: 368,
|
435
435
|
title: {
|
@@ -437,11 +437,11 @@ let ae = class extends Dt {
|
|
437
437
|
},
|
438
438
|
id: "reject-input-dialog",
|
439
439
|
children: {
|
440
|
-
title: d.getRuleFinalError(h)
|
440
|
+
title: d.getRuleFinalError(h, { row: i, col: r, unitId: l, subUnitId: s })
|
441
441
|
},
|
442
442
|
footer: {
|
443
|
-
title:
|
444
|
-
|
443
|
+
title: Ke.createElement(
|
444
|
+
At,
|
445
445
|
{
|
446
446
|
type: "primary",
|
447
447
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
@@ -452,7 +452,7 @@ let ae = class extends Dt {
|
|
452
452
|
onClose: () => {
|
453
453
|
this._dialogService.close("reject-input-dialog");
|
454
454
|
}
|
455
|
-
}),
|
455
|
+
}), o(Promise.resolve(m));
|
456
456
|
}
|
457
457
|
}
|
458
458
|
);
|
@@ -468,8 +468,8 @@ let ae = class extends Dt {
|
|
468
468
|
title: t
|
469
469
|
},
|
470
470
|
footer: {
|
471
|
-
title:
|
472
|
-
|
471
|
+
title: Ke.createElement(
|
472
|
+
At,
|
473
473
|
{
|
474
474
|
type: "primary",
|
475
475
|
onClick: () => this._dialogService.close("reject-input-dialog")
|
@@ -483,60 +483,60 @@ let ae = class extends Dt {
|
|
483
483
|
});
|
484
484
|
}
|
485
485
|
};
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
],
|
493
|
-
const
|
494
|
-
dvDateDropdown:
|
495
|
-
dvDateDropdownBtns:
|
486
|
+
ie = si([
|
487
|
+
ee(0, Y(hn)),
|
488
|
+
ee(1, Y(yt)),
|
489
|
+
ee(2, Y(Vt)),
|
490
|
+
ee(3, Fa),
|
491
|
+
ee(4, Y(ot))
|
492
|
+
], ie);
|
493
|
+
const li = "univer-dv-date-dropdown", di = "univer-dv-date-dropdown-btns", Ln = {
|
494
|
+
dvDateDropdown: li,
|
495
|
+
dvDateDropdownBtns: di
|
496
496
|
};
|
497
|
-
|
498
|
-
const
|
497
|
+
De.extend(ai);
|
498
|
+
const ci = (t) => {
|
499
499
|
if (t == null || typeof t == "boolean")
|
500
500
|
return;
|
501
501
|
if (typeof t == "number" || !Number.isNaN(+t))
|
502
|
-
return
|
503
|
-
const e =
|
502
|
+
return De(Ge.format("yyyy-MM-dd HH:mm:ss", Number(t)));
|
503
|
+
const e = De(t);
|
504
504
|
if (e.isValid())
|
505
505
|
return e;
|
506
506
|
};
|
507
|
-
function
|
508
|
-
var
|
509
|
-
const { location: e, hideFn:
|
507
|
+
function ui(t) {
|
508
|
+
var T, R, P;
|
509
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = e, c = W(at), u = W(ie), h = n.getCell(a, i), d = (T = h == null ? void 0 : h.dataValidation) == null ? void 0 : T.rule, C = (R = h == null ? void 0 : h.dataValidation) == null ? void 0 : R.validator, m = st(n.getCellRaw(a, i)), f = ci(m), [D, y] = q(f), V = !!((P = d == null ? void 0 : d.bizInfo) != null && P.showTime), S = D && D.isValid() ? D : De(), x = W(ot);
|
510
510
|
if (!h || !d || !C)
|
511
511
|
return;
|
512
|
-
const
|
512
|
+
const O = async () => {
|
513
513
|
var v, g, I;
|
514
514
|
if (!S)
|
515
515
|
return;
|
516
|
-
const A = S.format(V ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), M = (v =
|
517
|
-
d.errorStyle !==
|
516
|
+
const A = S.format(V ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), M = (v = Ge.parseDate(A)) == null ? void 0 : v.v, N = s.getStyles().getStyleByCell(h), B = (I = (g = N == null ? void 0 : N.n) == null ? void 0 : g.pattern) != null ? I : "", w = Ma(B);
|
517
|
+
d.errorStyle !== oe.STOP || await C.validator({
|
518
518
|
value: M,
|
519
519
|
unitId: r,
|
520
520
|
subUnitId: l,
|
521
|
-
row:
|
521
|
+
row: a,
|
522
522
|
column: i,
|
523
523
|
worksheet: n,
|
524
524
|
workbook: s,
|
525
525
|
interceptValue: A.replace("Z", "").replace("T", " "),
|
526
|
-
t:
|
527
|
-
}, d) ? (
|
526
|
+
t: Xo.NUMBER
|
527
|
+
}, d) ? (o(), await c.executeCommand(io.id, {
|
528
528
|
visible: !1,
|
529
|
-
eventType:
|
529
|
+
eventType: Qe.Keyboard,
|
530
530
|
unitId: r,
|
531
|
-
keycode:
|
532
|
-
}), await c.executeCommand(
|
531
|
+
keycode: on.ESC
|
532
|
+
}), await c.executeCommand(fn.id, {
|
533
533
|
unitId: r,
|
534
534
|
subUnitId: l,
|
535
535
|
range: {
|
536
536
|
startColumn: i,
|
537
537
|
endColumn: i,
|
538
|
-
startRow:
|
539
|
-
endRow:
|
538
|
+
startRow: a,
|
539
|
+
endRow: a
|
540
540
|
},
|
541
541
|
value: {
|
542
542
|
v: M,
|
@@ -550,11 +550,11 @@ function di(t) {
|
|
550
550
|
}
|
551
551
|
}
|
552
552
|
}
|
553
|
-
})) : u.showReject(C.getRuleFinalError(d));
|
553
|
+
})) : u.showReject(C.getRuleFinalError(d, { row: a, col: i, unitId: r, subUnitId: l }));
|
554
554
|
};
|
555
|
-
return /* @__PURE__ */ p.jsxs("div", { className:
|
555
|
+
return /* @__PURE__ */ p.jsxs("div", { className: Ln.dvDateDropdown, children: [
|
556
556
|
/* @__PURE__ */ p.jsx(
|
557
|
-
|
557
|
+
sa,
|
558
558
|
{
|
559
559
|
defaultValue: S,
|
560
560
|
pickerValue: S,
|
@@ -565,131 +565,131 @@ function di(t) {
|
|
565
565
|
onPanelChange: (j) => {
|
566
566
|
y(j);
|
567
567
|
},
|
568
|
-
disabledDate: (j) => !
|
568
|
+
disabledDate: (j) => !Ge.parseDate(j.format("YYYY-MM-DD"))
|
569
569
|
}
|
570
570
|
),
|
571
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
571
|
+
/* @__PURE__ */ p.jsx("div", { className: Ln.dvDateDropdownBtns, children: /* @__PURE__ */ p.jsx(At, { size: "small", type: "primary", onClick: O, disabled: !S.isValid(), children: x.t("dataValidation.alert.ok") }) })
|
572
572
|
] });
|
573
573
|
}
|
574
574
|
var ct = function() {
|
575
575
|
return ct = Object.assign || function(t) {
|
576
|
-
for (var e,
|
577
|
-
e = arguments[
|
578
|
-
for (var
|
576
|
+
for (var e, o = 1, n = arguments.length; o < n; o++) {
|
577
|
+
e = arguments[o];
|
578
|
+
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
|
579
579
|
}
|
580
580
|
return t;
|
581
581
|
}, ct.apply(this, arguments);
|
582
|
-
},
|
583
|
-
var
|
584
|
-
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (
|
582
|
+
}, hi = function(t, e) {
|
583
|
+
var o = {};
|
584
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
|
585
585
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
586
|
-
for (var
|
587
|
-
e.indexOf(n[
|
588
|
-
return
|
589
|
-
},
|
590
|
-
var
|
591
|
-
return
|
586
|
+
for (var a = 0, n = Object.getOwnPropertySymbols(t); a < n.length; a++)
|
587
|
+
e.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[a]) && (o[n[a]] = t[n[a]]);
|
588
|
+
return o;
|
589
|
+
}, Mt = wt(function(t, e) {
|
590
|
+
var o = t.icon, n = t.id, a = t.className, i = t.extend, r = hi(t, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), s = Ht("_".concat(mi()));
|
591
|
+
return Io(o, "".concat(n), { defIds: o.defIds, idSuffix: s.current }, ct({ ref: e, className: l }, r), i);
|
592
592
|
});
|
593
|
-
function
|
594
|
-
return It(t.tag, ct(ct({ key: e },
|
595
|
-
return
|
593
|
+
function Io(t, e, o, n, a) {
|
594
|
+
return It(t.tag, ct(ct({ key: e }, fi(t, o, a)), n), (pi(t, o).children || []).map(function(i, r) {
|
595
|
+
return Io(i, "".concat(e, "-").concat(t.tag, "-").concat(r), o, void 0, a);
|
596
596
|
}));
|
597
597
|
}
|
598
|
-
function
|
598
|
+
function fi(t, e, o) {
|
599
599
|
var n = ct({}, t.attrs);
|
600
|
-
|
601
|
-
var
|
602
|
-
return !
|
600
|
+
o != null && o.colorChannel1 && n.fill === "colorChannel1" && (n.fill = o.colorChannel1);
|
601
|
+
var a = e.defIds;
|
602
|
+
return !a || a.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(i) {
|
603
603
|
var r = i[0], l = i[1];
|
604
604
|
typeof l == "string" && (n[r] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
605
605
|
})), n;
|
606
606
|
}
|
607
|
-
function
|
608
|
-
var
|
609
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((
|
610
|
-
return typeof
|
607
|
+
function pi(t, e) {
|
608
|
+
var o, n = e.defIds;
|
609
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((o = t.children) === null || o === void 0) && o.length) ? ct(ct({}, t), { children: t.children.map(function(a) {
|
610
|
+
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ct(ct({}, a), { attrs: ct(ct({}, a.attrs), { id: a.attrs.id + e.idSuffix }) }) : a;
|
611
611
|
}) }) : t;
|
612
612
|
}
|
613
|
-
function
|
613
|
+
function mi() {
|
614
614
|
return Math.random().toString(36).substring(2, 8);
|
615
615
|
}
|
616
|
-
|
617
|
-
var
|
618
|
-
return It(
|
616
|
+
Mt.displayName = "UniverIcon";
|
617
|
+
var gi = { 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" } }] }, Do = wt(function(t, e) {
|
618
|
+
return It(Mt, Object.assign({}, t, {
|
619
619
|
id: "check-mark-single",
|
620
620
|
ref: e,
|
621
|
-
icon:
|
621
|
+
icon: gi
|
622
622
|
}));
|
623
623
|
});
|
624
|
-
|
625
|
-
var
|
626
|
-
return It(
|
624
|
+
Do.displayName = "CheckMarkSingle";
|
625
|
+
var vi = { 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" } }] }, Ro = wt(function(t, e) {
|
626
|
+
return It(Mt, Object.assign({}, t, {
|
627
627
|
id: "data-validation-single",
|
628
628
|
ref: e,
|
629
|
-
icon:
|
629
|
+
icon: vi
|
630
630
|
}));
|
631
631
|
});
|
632
|
-
|
633
|
-
var
|
634
|
-
return It(
|
632
|
+
Ro.displayName = "DataValidationSingle";
|
633
|
+
var _i = { 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" } }] }, Sn = wt(function(t, e) {
|
634
|
+
return It(Mt, Object.assign({}, t, {
|
635
635
|
id: "delete-single",
|
636
636
|
ref: e,
|
637
|
-
icon:
|
637
|
+
icon: _i
|
638
638
|
}));
|
639
639
|
});
|
640
|
-
|
641
|
-
var
|
642
|
-
return It(
|
640
|
+
Sn.displayName = "DeleteSingle";
|
641
|
+
var Si = { 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" } }] }, yo = wt(function(t, e) {
|
642
|
+
return It(Mt, Object.assign({}, t, {
|
643
643
|
id: "increase-single",
|
644
644
|
ref: e,
|
645
|
-
icon:
|
645
|
+
icon: Si
|
646
646
|
}));
|
647
647
|
});
|
648
|
-
|
649
|
-
var
|
650
|
-
return It(
|
648
|
+
yo.displayName = "IncreaseSingle";
|
649
|
+
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" } }] }, Vo = wt(function(t, e) {
|
650
|
+
return It(Mt, Object.assign({}, t, {
|
651
651
|
id: "more-down-single",
|
652
652
|
ref: e,
|
653
|
-
icon:
|
653
|
+
icon: Ci
|
654
654
|
}));
|
655
655
|
});
|
656
|
-
|
657
|
-
var
|
658
|
-
return It(
|
656
|
+
Vo.displayName = "MoreDownSingle";
|
657
|
+
var wi = { 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" } }] }, Mo = wt(function(t, e) {
|
658
|
+
return It(Mt, Object.assign({}, t, {
|
659
659
|
id: "more-up-single",
|
660
660
|
ref: e,
|
661
|
-
icon:
|
661
|
+
icon: wi
|
662
662
|
}));
|
663
663
|
});
|
664
|
-
|
665
|
-
var
|
666
|
-
return It(
|
664
|
+
Mo.displayName = "MoreUpSingle";
|
665
|
+
var Ii = { 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" } }] }] }, bo = wt(function(t, e) {
|
666
|
+
return It(Mt, Object.assign({}, t, {
|
667
667
|
id: "sequence-single",
|
668
668
|
ref: e,
|
669
|
-
icon:
|
669
|
+
icon: Ii
|
670
670
|
}));
|
671
671
|
});
|
672
|
-
|
673
|
-
var
|
674
|
-
for (var
|
675
|
-
(r = t[i]) && (
|
676
|
-
return n &&
|
677
|
-
},
|
672
|
+
bo.displayName = "SequenceSingle";
|
673
|
+
var Di = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, yi = (t, e, o, n) => {
|
674
|
+
for (var a = n > 1 ? void 0 : n ? Ri(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
675
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
676
|
+
return n && a && Di(e, o, a), a;
|
677
|
+
}, xn = (t, e) => (o, n) => e(o, n, t);
|
678
678
|
let pt = class extends Dt {
|
679
|
-
constructor(e,
|
679
|
+
constructor(e, o) {
|
680
680
|
super();
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
this._univerInstanceService = e, this._sidebarService =
|
688
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
681
|
+
k(this, "_open$", new $n(!1));
|
682
|
+
k(this, "open$", this._open$.pipe(Xa()));
|
683
|
+
k(this, "_activeRule");
|
684
|
+
k(this, "_activeRule$", new $n(void 0));
|
685
|
+
k(this, "activeRule$", this._activeRule$.asObservable());
|
686
|
+
k(this, "_closeDisposable", null);
|
687
|
+
this._univerInstanceService = e, this._sidebarService = o, this.disposeWithMe(
|
688
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Q.UNIVER_SHEET).pipe(vn((n) => !n)).subscribe(() => {
|
689
689
|
this.close();
|
690
690
|
})
|
691
691
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
692
|
-
n.id ===
|
692
|
+
n.id === Cn && (n.visible || setTimeout(() => {
|
693
693
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
694
694
|
}));
|
695
695
|
}));
|
@@ -712,7 +712,7 @@ let pt = class extends Dt {
|
|
712
712
|
this._open$.next(!1), (e = this._closeDisposable) == null || e.dispose();
|
713
713
|
}
|
714
714
|
setCloseDisposable(e) {
|
715
|
-
this._closeDisposable =
|
715
|
+
this._closeDisposable = zo(() => {
|
716
716
|
e.dispose(), this._closeDisposable = null;
|
717
717
|
});
|
718
718
|
}
|
@@ -720,15 +720,15 @@ let pt = class extends Dt {
|
|
720
720
|
this._activeRule = e, this._activeRule$.next(e);
|
721
721
|
}
|
722
722
|
};
|
723
|
-
pt =
|
724
|
-
|
725
|
-
|
723
|
+
pt = yi([
|
724
|
+
xn(0, gt),
|
725
|
+
xn(1, co)
|
726
726
|
], pt);
|
727
|
-
function
|
728
|
-
const t =
|
727
|
+
function Vi() {
|
728
|
+
const t = W(Ct), e = Ft(t.activeDropdown$, t.activeDropdown), o = W(Ee);
|
729
729
|
if (!e)
|
730
730
|
return null;
|
731
|
-
const { location: n, componentKey:
|
731
|
+
const { location: n, componentKey: a } = e, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
732
732
|
if (!i)
|
733
733
|
return null;
|
734
734
|
const l = () => {
|
@@ -743,21 +743,21 @@ function Ri() {
|
|
743
743
|
r
|
744
744
|
);
|
745
745
|
}
|
746
|
-
const
|
747
|
-
var
|
748
|
-
for (var
|
749
|
-
(r = t[i]) && (
|
750
|
-
return n &&
|
751
|
-
},
|
746
|
+
const Eo = "sheet.ui.dropdown";
|
747
|
+
var Mi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ei = (t, e, o, n) => {
|
748
|
+
for (var a = n > 1 ? void 0 : n ? bi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
749
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
750
|
+
return n && a && Mi(e, o, a), a;
|
751
|
+
}, bt = (t, e) => (o, n) => e(o, n, t);
|
752
752
|
let Ct = class extends Dt {
|
753
|
-
constructor(e,
|
753
|
+
constructor(e, o, n, a, i, r, l) {
|
754
754
|
super();
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
this._canvasPopupManagerService = e, this._univerInstanceService =
|
755
|
+
k(this, "_activeDropdown");
|
756
|
+
k(this, "_activeDropdown$", new za());
|
757
|
+
k(this, "_currentPopup", null);
|
758
|
+
k(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
759
|
+
k(this, "_zenVisible", !1);
|
760
|
+
this._canvasPopupManagerService = e, this._univerInstanceService = o, this._dataValidatorRegistryService = n, this._zenZoneService = a, this._renderManagerService = i, this._dataValidationModel = r, this._sheetsSelectionsService = l, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
|
761
761
|
this._activeDropdown$.complete();
|
762
762
|
});
|
763
763
|
}
|
@@ -769,14 +769,14 @@ let Ct = class extends Dt {
|
|
769
769
|
this._zenVisible = e, e && this.hideDropdown();
|
770
770
|
}));
|
771
771
|
}
|
772
|
-
_getDropdownByCell(e,
|
773
|
-
const i = e ? this._univerInstanceService.getUnit(e,
|
772
|
+
_getDropdownByCell(e, o, n, a) {
|
773
|
+
const i = e ? this._univerInstanceService.getUnit(e, Q.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(Q.UNIVER_SHEET);
|
774
774
|
if (!i)
|
775
775
|
return;
|
776
|
-
const r =
|
776
|
+
const r = o ? i.getSheetBySheetId(o) : i.getActiveSheet();
|
777
777
|
if (!r)
|
778
778
|
return;
|
779
|
-
const l = this._dataValidationModel.getRuleByLocation(i.getUnitId(), r.getSheetId(), n,
|
779
|
+
const l = this._dataValidationModel.getRuleByLocation(i.getUnitId(), r.getSheetId(), n, a);
|
780
780
|
if (!l)
|
781
781
|
return;
|
782
782
|
const s = this._dataValidatorRegistryService.getValidatorItem(l.type);
|
@@ -784,21 +784,21 @@ let Ct = class extends Dt {
|
|
784
784
|
}
|
785
785
|
_initSelectionChange() {
|
786
786
|
this.disposeWithMe(this._sheetsSelectionsService.selectionMoveEnd$.subscribe((e) => {
|
787
|
-
e && e.every((
|
787
|
+
e && e.every((o) => !(o.primary && this._getDropdownByCell(o.primary.unitId, o.primary.sheetId, o.primary.actualRow, o.primary.actualColumn))) && this.hideDropdown();
|
788
788
|
}));
|
789
789
|
}
|
790
|
-
showDropdown(e,
|
791
|
-
const { location: n } = e, { row:
|
790
|
+
showDropdown(e, o = !0) {
|
791
|
+
const { location: n } = e, { row: a, col: i, unitId: r, subUnitId: l } = n;
|
792
792
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
793
793
|
return;
|
794
794
|
this._activeDropdown = e, this._activeDropdown$.next(this._activeDropdown);
|
795
|
-
const s = this._renderManagerService.getRenderById(
|
796
|
-
|
795
|
+
const s = this._renderManagerService.getRenderById(Ko), c = this._canvasPopupManagerService.attachPopupToCell(
|
796
|
+
a,
|
797
797
|
i,
|
798
798
|
{
|
799
|
-
componentKey:
|
799
|
+
componentKey: Eo,
|
800
800
|
onClickOutside: () => {
|
801
|
-
|
801
|
+
o && this.hideDropdown();
|
802
802
|
},
|
803
803
|
offset: [0, 3],
|
804
804
|
excludeOutside: [s == null ? void 0 : s.engine.getCanvasElement()].filter(Boolean)
|
@@ -808,7 +808,7 @@ let Ct = class extends Dt {
|
|
808
808
|
);
|
809
809
|
if (!c)
|
810
810
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
811
|
-
const u = new
|
811
|
+
const u = new Go();
|
812
812
|
u.add(c), u.add({
|
813
813
|
dispose: () => {
|
814
814
|
var h, d;
|
@@ -819,14 +819,14 @@ let Ct = class extends Dt {
|
|
819
819
|
hideDropdown() {
|
820
820
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
821
821
|
}
|
822
|
-
showDataValidationDropdown(e,
|
823
|
-
const r = this._univerInstanceService.getUnit(e,
|
822
|
+
showDataValidationDropdown(e, o, n, a, i) {
|
823
|
+
const r = this._univerInstanceService.getUnit(e, Q.UNIVER_SHEET);
|
824
824
|
if (!r)
|
825
825
|
return;
|
826
|
-
const l = r.getSheetBySheetId(
|
826
|
+
const l = r.getSheetBySheetId(o);
|
827
827
|
if (!l)
|
828
828
|
return;
|
829
|
-
const s = this._dataValidationModel.getRuleByLocation(r.getUnitId(), l.getSheetId(), n,
|
829
|
+
const s = this._dataValidationModel.getRuleByLocation(r.getUnitId(), l.getSheetId(), n, a);
|
830
830
|
if (!s)
|
831
831
|
return;
|
832
832
|
const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
|
@@ -839,96 +839,96 @@ let Ct = class extends Dt {
|
|
839
839
|
workbook: r,
|
840
840
|
worksheet: l,
|
841
841
|
row: n,
|
842
|
-
col:
|
842
|
+
col: a,
|
843
843
|
unitId: e,
|
844
|
-
subUnitId:
|
844
|
+
subUnitId: o
|
845
845
|
},
|
846
846
|
componentKey: c.dropdown,
|
847
847
|
onHide: i
|
848
848
|
});
|
849
849
|
}
|
850
850
|
};
|
851
|
-
Ct =
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
851
|
+
Ct = Ei([
|
852
|
+
bt(0, Y(ba)),
|
853
|
+
bt(1, gt),
|
854
|
+
bt(2, Y(Vt)),
|
855
|
+
bt(3, uo),
|
856
|
+
bt(4, Rt),
|
857
|
+
bt(5, Y(yt)),
|
858
|
+
bt(6, Y(Kn))
|
859
859
|
], Ct);
|
860
|
-
const
|
860
|
+
const Cn = "DataValidationPanel", Nt = {
|
861
861
|
id: "data-validation.operation.open-validation-panel",
|
862
|
-
type:
|
862
|
+
type: qt.OPERATION,
|
863
863
|
handler(t, e) {
|
864
864
|
if (!e)
|
865
865
|
return !1;
|
866
|
-
const { ruleId:
|
866
|
+
const { ruleId: o, isAdd: n } = e, a = t.get(pt), i = t.get(Oe), r = t.get(gt), l = t.get(co), s = Gn(r);
|
867
867
|
if (!s) return !1;
|
868
|
-
const { unitId: c, subUnitId: u } = s, h =
|
869
|
-
|
868
|
+
const { unitId: c, subUnitId: u } = s, h = o ? i.getRuleById(c, u, o) : void 0;
|
869
|
+
a.open(), a.setActiveRule(h && {
|
870
870
|
unitId: c,
|
871
871
|
subUnitId: u,
|
872
872
|
rule: h
|
873
873
|
});
|
874
874
|
const d = l.open({
|
875
875
|
header: { title: n ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
876
|
-
children: { label:
|
876
|
+
children: { label: Cn },
|
877
877
|
width: 312,
|
878
|
-
onClose: () =>
|
878
|
+
onClose: () => a.close()
|
879
879
|
});
|
880
|
-
return
|
880
|
+
return a.setCloseDisposable(d), !0;
|
881
881
|
}
|
882
|
-
},
|
882
|
+
}, wn = {
|
883
883
|
id: "data-validation.operation.close-validation-panel",
|
884
|
-
type:
|
884
|
+
type: qt.OPERATION,
|
885
885
|
handler(t) {
|
886
886
|
return t.get(pt).close(), !0;
|
887
887
|
}
|
888
|
-
},
|
888
|
+
}, Oo = {
|
889
889
|
id: "data-validation.operation.toggle-validation-panel",
|
890
|
-
type:
|
890
|
+
type: qt.OPERATION,
|
891
891
|
handler(t) {
|
892
|
-
const e = t.get(at),
|
893
|
-
return
|
892
|
+
const e = t.get(at), o = t.get(pt);
|
893
|
+
return o.open(), o.isOpen ? e.executeCommand(wn.id) : e.executeCommand(Nt.id), !0;
|
894
894
|
}
|
895
|
-
},
|
896
|
-
type:
|
895
|
+
}, Pe = {
|
896
|
+
type: qt.OPERATION,
|
897
897
|
id: "sheet.operation.show-data-validation-dropdown",
|
898
898
|
handler(t, e) {
|
899
899
|
if (!e)
|
900
900
|
return !1;
|
901
|
-
const
|
902
|
-
return s && s.unitId === n && s.subUnitId ===
|
901
|
+
const o = t.get(Ct), { unitId: n, subUnitId: a, row: i, column: r } = e, l = o.activeDropdown, s = l == null ? void 0 : l.location;
|
902
|
+
return s && s.unitId === n && s.subUnitId === a && s.row === i && s.col === r || o.showDataValidationDropdown(
|
903
903
|
n,
|
904
|
-
|
904
|
+
a,
|
905
905
|
i,
|
906
906
|
r
|
907
907
|
), !0;
|
908
908
|
}
|
909
|
-
},
|
910
|
-
type:
|
909
|
+
}, To = {
|
910
|
+
type: qt.OPERATION,
|
911
911
|
id: "sheet.operation.hide-data-validation-dropdown",
|
912
912
|
handler(t, e) {
|
913
913
|
return e ? (t.get(Ct).hideDropdown(), !0) : !1;
|
914
914
|
}
|
915
|
-
},
|
916
|
-
dvListDropdown:
|
917
|
-
dvListDropdownTitle:
|
918
|
-
dvListDropdownList:
|
915
|
+
}, Pt = "#ECECEC", In = "sheets-data-validation-ui.config", Po = {}, Oi = "univer-dv-list-dropdown", Ti = "univer-dv-list-dropdown-title", Pi = "univer-dv-list-dropdown-list", $i = "univer-dv-list-dropdown-list-container", Li = "univer-dv-list-dropdown-selected-icon", xi = "univer-dv-list-dropdown-item-container", Ai = "univer-dv-list-dropdown-item", ji = "univer-dv-list-dropdown-split", Fi = "univer-dv-list-dropdown-edit", vt = {
|
916
|
+
dvListDropdown: Oi,
|
917
|
+
dvListDropdownTitle: Ti,
|
918
|
+
dvListDropdownList: Pi,
|
919
919
|
dvListDropdownListContainer: $i,
|
920
|
-
dvListDropdownSelectedIcon:
|
921
|
-
dvListDropdownItemContainer:
|
922
|
-
dvListDropdownItem:
|
923
|
-
dvListDropdownSplit:
|
924
|
-
dvListDropdownEdit:
|
925
|
-
},
|
926
|
-
var
|
927
|
-
const { value: e, onChange:
|
920
|
+
dvListDropdownSelectedIcon: Li,
|
921
|
+
dvListDropdownItemContainer: xi,
|
922
|
+
dvListDropdownItem: Ai,
|
923
|
+
dvListDropdownSplit: ji,
|
924
|
+
dvListDropdownEdit: Fi
|
925
|
+
}, Ni = (t) => {
|
926
|
+
var O, T;
|
927
|
+
const { value: e, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = t, u = W(ot), h = W(dn), d = s == null ? void 0 : s.toLowerCase(), { row: C, col: m, unitId: f, subUnitId: D } = c, y = a.filter((R) => d ? R.label.toLowerCase().includes(d) : !0), V = (T = (O = h.getConfig(In)) == null ? void 0 : O.showEditOnDropdown) != null ? T : !0, S = W(so), x = $t(() => S.permissionCheckWithRanges(
|
928
928
|
{
|
929
|
-
workbookTypes: [
|
930
|
-
rangeTypes: [
|
931
|
-
worksheetTypes: [
|
929
|
+
workbookTypes: [Se],
|
930
|
+
rangeTypes: [Ce],
|
931
|
+
worksheetTypes: [we]
|
932
932
|
},
|
933
933
|
[{ startColumn: m, startRow: C, endColumn: m, endRow: C }],
|
934
934
|
f,
|
@@ -936,22 +936,22 @@ const _n = "DataValidationPanel", Ft = {
|
|
936
936
|
), [S, m, C, f, D]);
|
937
937
|
return /* @__PURE__ */ p.jsxs("div", { className: vt.dvListDropdown, style: l, children: [
|
938
938
|
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownTitle, children: i }),
|
939
|
-
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownList, children: /* @__PURE__ */ p.jsx(
|
939
|
+
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownList, children: /* @__PURE__ */ p.jsx(la, { children: /* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownListContainer, children: y.map((R, P) => {
|
940
940
|
const j = e.indexOf(R.value) > -1, A = () => {
|
941
|
-
let
|
942
|
-
j ?
|
941
|
+
let N;
|
942
|
+
j ? N = new Set(e.filter((w) => w !== R.value)) : N = new Set(n ? [...e, R.value] : [R.value]);
|
943
943
|
const B = [];
|
944
|
-
|
945
|
-
|
946
|
-
}),
|
944
|
+
a.forEach((w) => {
|
945
|
+
N.has(w.value) && B.push(w.value);
|
946
|
+
}), o(B);
|
947
947
|
}, M = R.label.toLocaleLowerCase().indexOf(d);
|
948
948
|
return /* @__PURE__ */ p.jsxs("div", { className: vt.dvListDropdownItemContainer, onClick: A, children: [
|
949
|
-
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownItem, style: { background: R.color ||
|
949
|
+
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownItem, style: { background: R.color || Pt }, children: d && R.label.toLowerCase().includes(d) ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
950
950
|
/* @__PURE__ */ p.jsx("span", { children: R.label.substring(0, M) }),
|
951
951
|
/* @__PURE__ */ p.jsx("span", { style: { fontWeight: "bold" }, children: R.label.substring(M, M + d.length) }),
|
952
952
|
/* @__PURE__ */ p.jsx("span", { children: R.label.substring(M + d.length) })
|
953
953
|
] }) : R.label }),
|
954
|
-
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownSelectedIcon, children: j ? /* @__PURE__ */ p.jsx(
|
954
|
+
/* @__PURE__ */ p.jsx("div", { className: vt.dvListDropdownSelectedIcon, children: j ? /* @__PURE__ */ p.jsx(Do, {}) : null })
|
955
955
|
] }, P);
|
956
956
|
}) }) }, s) }),
|
957
957
|
V && x ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
@@ -960,20 +960,20 @@ const _n = "DataValidationPanel", Ft = {
|
|
960
960
|
] }) : null
|
961
961
|
] });
|
962
962
|
};
|
963
|
-
function
|
964
|
-
var w, v, g, I, _,
|
965
|
-
const { location: e, hideFn:
|
966
|
-
|
967
|
-
const V =
|
963
|
+
function Ui(t) {
|
964
|
+
var w, v, g, I, _, $;
|
965
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = e, s = W(Oe), [c, u] = q(""), h = W(at), d = W(ot), [C, m] = q(""), f = W(ro), D = W(gt), y = $t(() => s.ruleChange$.pipe(_n(16)), []);
|
966
|
+
Ft(y);
|
967
|
+
const V = Na.useContext(), S = ((v = (w = V.current) == null ? void 0 : w.right) != null ? v : 0) - ((I = (g = V.current) == null ? void 0 : g.left) != null ? I : 0);
|
968
968
|
if (St(() => {
|
969
|
-
const b = h.onCommandExecuted((
|
969
|
+
const b = h.onCommandExecuted((U) => {
|
970
970
|
var X, K;
|
971
|
-
if (
|
972
|
-
const G =
|
971
|
+
if (U.id === Ya.id) {
|
972
|
+
const G = U.params, { unitId: Z } = G, J = D.getUnit(Z, Q.UNIVER_DOC);
|
973
973
|
if (!J)
|
974
974
|
return;
|
975
|
-
const
|
976
|
-
u(
|
975
|
+
const L = Zo.transform.getPlainText((K = (X = J.getSnapshot().body) == null ? void 0 : X.dataStream) != null ? K : "");
|
976
|
+
u(L);
|
977
977
|
}
|
978
978
|
});
|
979
979
|
return () => {
|
@@ -981,37 +981,37 @@ function Fi(t) {
|
|
981
981
|
};
|
982
982
|
}, [h, D]), !n)
|
983
983
|
return null;
|
984
|
-
const x = n.getCell(
|
985
|
-
if (!x || !
|
984
|
+
const x = n.getCell(a, i), O = (_ = x == null ? void 0 : x.dataValidation) == null ? void 0 : _.rule, T = ($ = x == null ? void 0 : x.dataValidation) == null ? void 0 : $.validator, R = (O == null ? void 0 : O.renderMode) === dt.CUSTOM || (O == null ? void 0 : O.renderMode) === void 0;
|
985
|
+
if (!x || !O || !T || T.id.indexOf(nt.LIST) !== 0)
|
986
986
|
return;
|
987
|
-
const P =
|
988
|
-
h.executeCommand(
|
989
|
-
ruleId:
|
990
|
-
}),
|
987
|
+
const P = O.type === nt.LIST_MULTIPLE, j = T.getListWithColor(O, r, l), A = C || Sa(n.getCellRaw(a, i)), M = Jn(A), N = () => {
|
988
|
+
h.executeCommand(Nt.id, {
|
989
|
+
ruleId: O.uid
|
990
|
+
}), o();
|
991
991
|
}, B = j.map((b) => ({
|
992
992
|
label: b.label,
|
993
993
|
value: b.label,
|
994
994
|
color: R || b.color ? b.color : "transparent"
|
995
995
|
}));
|
996
996
|
return /* @__PURE__ */ p.jsx(
|
997
|
-
|
997
|
+
Ni,
|
998
998
|
{
|
999
999
|
style: { minWidth: S, maxWidth: Math.max(S, 200) },
|
1000
1000
|
title: P ? d.t("dataValidation.listMultiple.dropdown") : d.t("dataValidation.list.dropdown"),
|
1001
1001
|
value: M,
|
1002
1002
|
multiple: P,
|
1003
1003
|
onChange: async (b) => {
|
1004
|
-
const
|
1004
|
+
const U = Qn(b), X = {
|
1005
1005
|
unitId: r,
|
1006
1006
|
subUnitId: l,
|
1007
1007
|
range: {
|
1008
1008
|
startColumn: i,
|
1009
1009
|
endColumn: i,
|
1010
|
-
startRow:
|
1011
|
-
endRow:
|
1010
|
+
startRow: a,
|
1011
|
+
endRow: a
|
1012
1012
|
},
|
1013
1013
|
value: {
|
1014
|
-
v:
|
1014
|
+
v: U,
|
1015
1015
|
p: null,
|
1016
1016
|
f: null,
|
1017
1017
|
si: null
|
@@ -1019,63 +1019,63 @@ function Fi(t) {
|
|
1019
1019
|
};
|
1020
1020
|
f.isVisible() && f.changeVisible({
|
1021
1021
|
visible: !1,
|
1022
|
-
keycode:
|
1023
|
-
eventType:
|
1022
|
+
keycode: on.ESC,
|
1023
|
+
eventType: Qe.Keyboard,
|
1024
1024
|
unitId: r
|
1025
|
-
}), m(
|
1025
|
+
}), m(U), P || o(), f.isVisible().visible && await h.executeCommand(io.id, {
|
1026
1026
|
visible: !1,
|
1027
|
-
eventType:
|
1027
|
+
eventType: Qe.Keyboard,
|
1028
1028
|
unitId: r,
|
1029
|
-
keycode:
|
1030
|
-
}), h.executeCommand(
|
1029
|
+
keycode: on.ESC
|
1030
|
+
}), h.executeCommand(fn.id, X);
|
1031
1031
|
},
|
1032
1032
|
options: B,
|
1033
|
-
onEdit:
|
1033
|
+
onEdit: N,
|
1034
1034
|
filter: c,
|
1035
1035
|
location: e
|
1036
1036
|
}
|
1037
1037
|
);
|
1038
1038
|
}
|
1039
|
-
const
|
1040
|
-
dataValidationOptionsButton:
|
1041
|
-
dataValidationOptionsButtonIcon:
|
1039
|
+
const ki = "univer-data-validation-options-button", Bi = "univer-data-validation-options-button-icon", je = {
|
1040
|
+
dataValidationOptionsButton: ki,
|
1041
|
+
dataValidationOptionsButtonIcon: Bi
|
1042
1042
|
};
|
1043
|
-
function
|
1043
|
+
function Hi(t) {
|
1044
1044
|
var c;
|
1045
|
-
const e =
|
1045
|
+
const e = W(ot), o = W(Ee), { value: n, onChange: a, extraComponent: i } = t, [r, l] = q(!1), s = i ? o.get(i) : null;
|
1046
1046
|
return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
1047
|
-
/* @__PURE__ */ p.jsxs("div", { className:
|
1047
|
+
/* @__PURE__ */ p.jsxs("div", { className: je.dataValidationOptionsButton, onClick: () => l(!r), children: [
|
1048
1048
|
e.t("dataValidation.panel.options"),
|
1049
|
-
r ? /* @__PURE__ */ p.jsx(
|
1049
|
+
r ? /* @__PURE__ */ p.jsx(Mo, { className: je.dataValidationOptionsButtonIcon }) : /* @__PURE__ */ p.jsx(Vo, { className: je.dataValidationOptionsButtonIcon })
|
1050
1050
|
] }),
|
1051
1051
|
r && /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
1052
|
-
s ? /* @__PURE__ */ p.jsx(s, { value: n, onChange:
|
1052
|
+
s ? /* @__PURE__ */ p.jsx(s, { value: n, onChange: a }) : null,
|
1053
1053
|
/* @__PURE__ */ p.jsx(
|
1054
|
-
|
1054
|
+
et,
|
1055
1055
|
{
|
1056
1056
|
label: e.t("dataValidation.panel.invalid"),
|
1057
1057
|
children: /* @__PURE__ */ p.jsxs(
|
1058
|
-
|
1058
|
+
un,
|
1059
1059
|
{
|
1060
|
-
value: `${(c = n.errorStyle) != null ? c :
|
1061
|
-
onChange: (u) =>
|
1060
|
+
value: `${(c = n.errorStyle) != null ? c : oe.WARNING}`,
|
1061
|
+
onChange: (u) => a({ ...n, errorStyle: +u }),
|
1062
1062
|
children: [
|
1063
|
-
/* @__PURE__ */ p.jsx(Lt, { value: `${
|
1064
|
-
/* @__PURE__ */ p.jsx(Lt, { value: `${
|
1063
|
+
/* @__PURE__ */ p.jsx(Lt, { value: `${oe.WARNING}`, children: e.t("dataValidation.panel.showWarning") }),
|
1064
|
+
/* @__PURE__ */ p.jsx(Lt, { value: `${oe.STOP}`, children: e.t("dataValidation.panel.rejectInput") })
|
1065
1065
|
]
|
1066
1066
|
}
|
1067
1067
|
)
|
1068
1068
|
}
|
1069
1069
|
),
|
1070
1070
|
/* @__PURE__ */ p.jsx(
|
1071
|
-
|
1071
|
+
et,
|
1072
1072
|
{
|
1073
1073
|
label: e.t("dataValidation.panel.messageInfo"),
|
1074
1074
|
children: /* @__PURE__ */ p.jsx(
|
1075
|
-
|
1075
|
+
be,
|
1076
1076
|
{
|
1077
1077
|
checked: n.showErrorMessage,
|
1078
|
-
onChange: () =>
|
1078
|
+
onChange: () => a({
|
1079
1079
|
...n,
|
1080
1080
|
showErrorMessage: !n.showErrorMessage
|
1081
1081
|
}),
|
@@ -1084,187 +1084,187 @@ function ki(t) {
|
|
1084
1084
|
)
|
1085
1085
|
}
|
1086
1086
|
),
|
1087
|
-
n.showErrorMessage ? /* @__PURE__ */ p.jsx(
|
1087
|
+
n.showErrorMessage ? /* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(xt, { value: n.error, onChange: (u) => a({ ...n, error: u }) }) }) : null
|
1088
1088
|
] })
|
1089
1089
|
] });
|
1090
1090
|
}
|
1091
|
-
const
|
1092
|
-
dataValidationDetail:
|
1093
|
-
dataValidationDetailFormItem:
|
1094
|
-
dataValidationDetailButtons:
|
1095
|
-
dataValidationDetailButton:
|
1096
|
-
},
|
1097
|
-
async (e,
|
1098
|
-
const i = await t.executeCommand(e,
|
1099
|
-
|
1091
|
+
const Wi = "univer-data-validation-detail", Yi = "univer-data-validation-detail-form-item", Xi = "univer-data-validation-detail-buttons", zi = "univer-data-validation-detail-button", kt = {
|
1092
|
+
dataValidationDetail: Wi,
|
1093
|
+
dataValidationDetailFormItem: Yi,
|
1094
|
+
dataValidationDetailButtons: Xi,
|
1095
|
+
dataValidationDetailButton: zi
|
1096
|
+
}, Ki = (t) => ta(
|
1097
|
+
async (e, o, n, a) => {
|
1098
|
+
const i = await t.executeCommand(e, o, n);
|
1099
|
+
a == null || a(i);
|
1100
1100
|
},
|
1101
1101
|
1e3
|
1102
1102
|
);
|
1103
|
-
function
|
1104
|
-
var n,
|
1105
|
-
return e ? ((
|
1103
|
+
function Gi(t, e, o) {
|
1104
|
+
var n, a, i, r;
|
1105
|
+
return e ? ((a = (n = t.getUnit(e)) == null ? void 0 : n.getSheetBySheetName(o)) == null ? void 0 : a.getSheetId()) || "" : ((r = (i = t.getCurrentUnitForType(Q.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(o)) == null ? void 0 : r.getSheetId()) || "";
|
1106
1106
|
}
|
1107
|
-
function
|
1107
|
+
function Zi() {
|
1108
1108
|
var J;
|
1109
|
-
const [t, e] = q(0),
|
1109
|
+
const [t, e] = q(0), o = W(pt), n = Ft(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = W(Vt), c = W(gt), u = W(Ee), h = W(at), d = W(Oe), C = W(ot), [m, f] = q(r), D = s.getValidatorItem(m.type), [y, V] = q(!1), S = s.getValidatorsByScope(Ha.SHEET), [x, O] = q(() => m.ranges.map((L) => ({ unitId: "", sheetId: "", range: L }))), T = $t(() => Ki(h), [h]), [R, P] = q(!1), j = Ht({}), [A, M] = q(!1), N = W(Kn);
|
1110
1110
|
if (St(() => () => {
|
1111
|
-
const
|
1112
|
-
|
1113
|
-
}, [
|
1114
|
-
h.onCommandExecuted((
|
1115
|
-
(
|
1116
|
-
const
|
1117
|
-
e((
|
1111
|
+
const L = N.getCurrentLastSelection();
|
1112
|
+
L && N.setSelections([L]);
|
1113
|
+
}, [N]), St(() => {
|
1114
|
+
h.onCommandExecuted((L) => {
|
1115
|
+
(L.id === qo.id || L.id === Jo.id) && setTimeout(() => {
|
1116
|
+
const E = d.getRuleById(a, i, l);
|
1117
|
+
e((H) => H + 1), E && (f(E), O(E.ranges.map((H) => ({ unitId: "", sheetId: "", range: H }))));
|
1118
1118
|
}, 20);
|
1119
1119
|
});
|
1120
|
-
}, [h, d, l, i,
|
1120
|
+
}, [h, d, l, i, a]), !D)
|
1121
1121
|
return null;
|
1122
|
-
const B = D.operators, w = D.operatorNames, v = m.operator ?
|
1123
|
-
!m.ranges.length || R || (D.validatorFormula(m,
|
1124
|
-
}, I =
|
1125
|
-
const
|
1126
|
-
const
|
1127
|
-
if (
|
1128
|
-
const
|
1129
|
-
return { ...z, sheetId:
|
1122
|
+
const B = D.operators, w = D.operatorNames, v = m.operator ? Wa.includes(m.operator) : !1, g = () => {
|
1123
|
+
!m.ranges.length || R || (D.validatorFormula(m, a, i).success ? o.setActiveRule(null) : V(!0));
|
1124
|
+
}, I = ho((L) => {
|
1125
|
+
const E = L.split(",").map(Ka).map((z) => {
|
1126
|
+
const it = z.sheetName;
|
1127
|
+
if (it) {
|
1128
|
+
const Ut = Gi(c, z.unitId, it);
|
1129
|
+
return { ...z, sheetId: Ut };
|
1130
1130
|
}
|
1131
1131
|
return {
|
1132
1132
|
...z,
|
1133
1133
|
sheetId: ""
|
1134
1134
|
};
|
1135
1135
|
});
|
1136
|
-
if (
|
1136
|
+
if (Qo(E, x))
|
1137
1137
|
return;
|
1138
|
-
E
|
1139
|
-
const
|
1138
|
+
O(E);
|
1139
|
+
const H = E.filter((z) => (!z.unitId || z.unitId === a) && (!z.sheetId || z.sheetId === i)).map((z) => z.range);
|
1140
1140
|
if (f({
|
1141
1141
|
...m,
|
1142
|
-
ranges:
|
1143
|
-
}),
|
1142
|
+
ranges: H
|
1143
|
+
}), H.length === 0)
|
1144
1144
|
return;
|
1145
|
-
const
|
1146
|
-
unitId:
|
1145
|
+
const F = {
|
1146
|
+
unitId: a,
|
1147
1147
|
subUnitId: i,
|
1148
1148
|
ruleId: l,
|
1149
|
-
ranges:
|
1149
|
+
ranges: H
|
1150
1150
|
};
|
1151
|
-
|
1152
|
-
}), _ = (
|
1153
|
-
if (
|
1151
|
+
T(to.id, F);
|
1152
|
+
}), _ = (L) => {
|
1153
|
+
if (yn(L, Pn(m)))
|
1154
1154
|
return;
|
1155
1155
|
f({
|
1156
1156
|
...m,
|
1157
|
-
...
|
1157
|
+
...L
|
1158
1158
|
});
|
1159
|
-
const
|
1160
|
-
unitId:
|
1159
|
+
const E = {
|
1160
|
+
unitId: a,
|
1161
1161
|
subUnitId: i,
|
1162
1162
|
ruleId: l,
|
1163
|
-
setting:
|
1163
|
+
setting: L
|
1164
1164
|
};
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1165
|
+
T(
|
1166
|
+
Mn.id,
|
1167
|
+
E,
|
1168
1168
|
void 0
|
1169
1169
|
);
|
1170
|
-
},
|
1171
|
-
await h.executeCommand(
|
1170
|
+
}, $ = async () => {
|
1171
|
+
await h.executeCommand(eo.id, {
|
1172
1172
|
ruleId: l,
|
1173
|
-
unitId:
|
1173
|
+
unitId: a,
|
1174
1174
|
subUnitId: i
|
1175
|
-
}),
|
1175
|
+
}), o.setActiveRule(null);
|
1176
1176
|
}, b = {
|
1177
1177
|
type: m.type,
|
1178
1178
|
operator: m.operator,
|
1179
1179
|
formula1: m.formula1,
|
1180
1180
|
formula2: m.formula2,
|
1181
1181
|
allowBlank: m.allowBlank
|
1182
|
-
},
|
1183
|
-
const
|
1184
|
-
if (!
|
1182
|
+
}, U = (L) => {
|
1183
|
+
const E = s.getValidatorItem(L);
|
1184
|
+
if (!E)
|
1185
1185
|
return;
|
1186
|
-
const
|
1187
|
-
...
|
1188
|
-
type:
|
1186
|
+
const H = E.operators, F = d.getRuleById(a, i, l), z = L === (F == null ? void 0 : F.type) || L.includes("list") && (F != null && F.type.includes("list")) ? {
|
1187
|
+
...F,
|
1188
|
+
type: L
|
1189
1189
|
} : {
|
1190
1190
|
...m,
|
1191
|
-
type:
|
1192
|
-
operator:
|
1191
|
+
type: L,
|
1192
|
+
operator: H[0],
|
1193
1193
|
formula1: void 0,
|
1194
1194
|
formula2: void 0
|
1195
1195
|
};
|
1196
|
-
f(z), h.executeCommand(
|
1197
|
-
unitId:
|
1196
|
+
f(z), h.executeCommand(Mn.id, {
|
1197
|
+
unitId: a,
|
1198
1198
|
subUnitId: i,
|
1199
1199
|
ruleId: m.uid,
|
1200
|
-
setting:
|
1200
|
+
setting: Pn(z)
|
1201
1201
|
});
|
1202
|
-
}, X = u.get(D.formulaInput), K =
|
1203
|
-
|
1202
|
+
}, X = u.get(D.formulaInput), K = $t(() => x.map((L) => po(L.range)).join(","), []), G = Tn(m), Z = (L) => {
|
1203
|
+
yn(L, Tn(m)) || (f({
|
1204
1204
|
...m,
|
1205
|
-
...
|
1206
|
-
}),
|
1207
|
-
|
1205
|
+
...L
|
1206
|
+
}), T(
|
1207
|
+
Ca.id,
|
1208
1208
|
{
|
1209
|
-
unitId:
|
1209
|
+
unitId: a,
|
1210
1210
|
subUnitId: i,
|
1211
1211
|
ruleId: l,
|
1212
|
-
options:
|
1212
|
+
options: L
|
1213
1213
|
}
|
1214
1214
|
));
|
1215
1215
|
};
|
1216
|
-
return
|
1217
|
-
var
|
1218
|
-
const
|
1219
|
-
|
1220
|
-
}), /* @__PURE__ */ p.jsxs("div", { className:
|
1216
|
+
return mn((L) => {
|
1217
|
+
var H;
|
1218
|
+
const E = (H = j.current) == null ? void 0 : H.handleOutClick;
|
1219
|
+
E && E(L, () => M(!1));
|
1220
|
+
}), /* @__PURE__ */ p.jsxs("div", { className: kt.dataValidationDetail, children: [
|
1221
1221
|
/* @__PURE__ */ p.jsx(
|
1222
|
-
|
1222
|
+
et,
|
1223
1223
|
{
|
1224
1224
|
label: C.t("dataValidation.panel.range"),
|
1225
1225
|
error: !m.ranges.length || R ? C.t("dataValidation.panel.rangeError") : "",
|
1226
1226
|
children: /* @__PURE__ */ p.jsx(
|
1227
|
-
|
1227
|
+
Ga,
|
1228
1228
|
{
|
1229
|
-
unitId:
|
1229
|
+
unitId: a,
|
1230
1230
|
subUnitId: i,
|
1231
1231
|
initValue: K,
|
1232
1232
|
onChange: I,
|
1233
1233
|
onFocus: () => M(!0),
|
1234
1234
|
isFocus: A,
|
1235
1235
|
actions: j.current,
|
1236
|
-
onVerify: (
|
1236
|
+
onVerify: (L) => P(!L)
|
1237
1237
|
}
|
1238
1238
|
)
|
1239
1239
|
}
|
1240
1240
|
),
|
1241
|
-
/* @__PURE__ */ p.jsx(
|
1242
|
-
|
1241
|
+
/* @__PURE__ */ p.jsx(et, { label: C.t("dataValidation.panel.type"), children: /* @__PURE__ */ p.jsx(
|
1242
|
+
Je,
|
1243
1243
|
{
|
1244
|
-
options: S == null ? void 0 : S.map((
|
1245
|
-
label: C.t(
|
1246
|
-
value:
|
1244
|
+
options: S == null ? void 0 : S.map((L) => ({
|
1245
|
+
label: C.t(L.title),
|
1246
|
+
value: L.id
|
1247
1247
|
})),
|
1248
1248
|
value: m.type,
|
1249
|
-
onChange:
|
1250
|
-
className:
|
1249
|
+
onChange: U,
|
1250
|
+
className: kt.dataValidationDetailFormItem
|
1251
1251
|
}
|
1252
1252
|
) }),
|
1253
|
-
B != null && B.length ? /* @__PURE__ */ p.jsx(
|
1254
|
-
|
1253
|
+
B != null && B.length ? /* @__PURE__ */ p.jsx(et, { label: C.t("dataValidation.panel.operator"), children: /* @__PURE__ */ p.jsx(
|
1254
|
+
Je,
|
1255
1255
|
{
|
1256
|
-
options: B.map((
|
1257
|
-
value: `${
|
1258
|
-
label: w[
|
1256
|
+
options: B.map((L, E) => ({
|
1257
|
+
value: `${L}`,
|
1258
|
+
label: w[E]
|
1259
1259
|
})),
|
1260
1260
|
value: `${m.operator}`,
|
1261
|
-
onChange: (
|
1261
|
+
onChange: (L) => {
|
1262
1262
|
_({
|
1263
1263
|
...b,
|
1264
|
-
operator:
|
1264
|
+
operator: L
|
1265
1265
|
});
|
1266
1266
|
},
|
1267
|
-
className:
|
1267
|
+
className: kt.dataValidationDetailFormItem
|
1268
1268
|
}
|
1269
1269
|
) }) : null,
|
1270
1270
|
X ? /* @__PURE__ */ p.jsx(
|
@@ -1275,52 +1275,52 @@ function Ki() {
|
|
1275
1275
|
formula1: m.formula1,
|
1276
1276
|
formula2: m.formula2
|
1277
1277
|
},
|
1278
|
-
onChange: (
|
1278
|
+
onChange: (L) => {
|
1279
1279
|
_({
|
1280
1280
|
...b,
|
1281
|
-
...
|
1281
|
+
...L
|
1282
1282
|
});
|
1283
1283
|
},
|
1284
1284
|
showError: y,
|
1285
|
-
validResult: D.validatorFormula(m,
|
1286
|
-
unitId:
|
1285
|
+
validResult: D.validatorFormula(m, a, i),
|
1286
|
+
unitId: a,
|
1287
1287
|
subUnitId: i,
|
1288
1288
|
ruleId: l
|
1289
1289
|
},
|
1290
1290
|
t + m.type
|
1291
1291
|
) : null,
|
1292
|
-
/* @__PURE__ */ p.jsx(
|
1293
|
-
|
1292
|
+
/* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(
|
1293
|
+
be,
|
1294
1294
|
{
|
1295
1295
|
checked: (J = m.allowBlank) != null ? J : !0,
|
1296
1296
|
onChange: () => {
|
1297
|
-
var
|
1297
|
+
var L;
|
1298
1298
|
return _({
|
1299
1299
|
...b,
|
1300
|
-
allowBlank: !((
|
1300
|
+
allowBlank: !((L = m.allowBlank) == null || L)
|
1301
1301
|
});
|
1302
1302
|
},
|
1303
1303
|
children: C.t("dataValidation.panel.allowBlank")
|
1304
1304
|
}
|
1305
1305
|
) }),
|
1306
|
-
/* @__PURE__ */ p.jsx(
|
1307
|
-
/* @__PURE__ */ p.jsxs("div", { className:
|
1308
|
-
/* @__PURE__ */ p.jsx(
|
1309
|
-
/* @__PURE__ */ p.jsx(
|
1306
|
+
/* @__PURE__ */ p.jsx(Hi, { value: G, onChange: Z, extraComponent: D.optionsInput }),
|
1307
|
+
/* @__PURE__ */ p.jsxs("div", { className: kt.dataValidationDetailButtons, children: [
|
1308
|
+
/* @__PURE__ */ p.jsx(At, { className: kt.dataValidationDetailButton, onClick: $, children: C.t("dataValidation.panel.removeRule") }),
|
1309
|
+
/* @__PURE__ */ p.jsx(At, { className: kt.dataValidationDetailButton, type: "primary", onClick: g, children: C.t("dataValidation.panel.done") })
|
1310
1310
|
] })
|
1311
1311
|
] });
|
1312
1312
|
}
|
1313
|
-
const
|
1314
|
-
dataValidationItemContainer:
|
1315
|
-
dataValidationItemTitle:
|
1316
|
-
dataValidationItemContent:
|
1317
|
-
dataValidationItemIcon:
|
1318
|
-
},
|
1319
|
-
const { rule: e, onClick:
|
1320
|
-
l.executeCommand(
|
1313
|
+
const qi = "univer-data-validation-item-container", Ji = "univer-data-validation-item-title", Qi = "univer-data-validation-item-content", tr = "univer-data-validation-item-icon", le = {
|
1314
|
+
dataValidationItemContainer: qi,
|
1315
|
+
dataValidationItemTitle: Ji,
|
1316
|
+
dataValidationItemContent: Qi,
|
1317
|
+
dataValidationItemIcon: tr
|
1318
|
+
}, er = (t) => {
|
1319
|
+
const { rule: e, onClick: o, unitId: n, subUnitId: a, disable: i } = t, r = W(Vt), l = W(at), s = W(Ea), c = r.getValidatorItem(e.type), u = Ht(), [h, d] = q(!1), C = (m) => {
|
1320
|
+
l.executeCommand(eo.id, {
|
1321
1321
|
ruleId: e.uid,
|
1322
1322
|
unitId: n,
|
1323
|
-
subUnitId:
|
1323
|
+
subUnitId: a
|
1324
1324
|
}), m.stopPropagation();
|
1325
1325
|
};
|
1326
1326
|
return St(() => () => {
|
@@ -1331,8 +1331,8 @@ const Gi = "univer-data-validation-item-container", Zi = "univer-data-validation
|
|
1331
1331
|
}, [s]), /* @__PURE__ */ p.jsxs(
|
1332
1332
|
"div",
|
1333
1333
|
{
|
1334
|
-
className:
|
1335
|
-
onClick:
|
1334
|
+
className: le.dataValidationItemContainer,
|
1335
|
+
onClick: o,
|
1336
1336
|
onMouseEnter: () => {
|
1337
1337
|
i || (d(!0), u.current = e.ranges.map((m) => s.addShape({
|
1338
1338
|
range: m,
|
@@ -1353,28 +1353,28 @@ const Gi = "univer-data-validation-item-container", Zi = "univer-data-validation
|
|
1353
1353
|
}), u.current = void 0;
|
1354
1354
|
},
|
1355
1355
|
children: [
|
1356
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
1357
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
1358
|
-
h ? /* @__PURE__ */ p.jsx("div", { className:
|
1356
|
+
/* @__PURE__ */ p.jsx("div", { className: le.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(e) }),
|
1357
|
+
/* @__PURE__ */ p.jsx("div", { className: le.dataValidationItemContent, children: e.ranges.map((m) => po(m)).join(",") }),
|
1358
|
+
h ? /* @__PURE__ */ p.jsx("div", { className: le.dataValidationItemIcon, onClick: C, children: /* @__PURE__ */ p.jsx(Sn, {}) }) : null
|
1359
1359
|
]
|
1360
1360
|
}
|
1361
1361
|
);
|
1362
|
-
},
|
1363
|
-
dataValidationList:
|
1364
|
-
dataValidationListButtons:
|
1365
|
-
dataValidationListButton:
|
1362
|
+
}, nr = "univer-data-validation-list", or = "univer-data-validation-list-buttons", ar = "univer-data-validation-list-button", de = {
|
1363
|
+
dataValidationList: nr,
|
1364
|
+
dataValidationListButtons: or,
|
1365
|
+
dataValidationListButton: ar
|
1366
1366
|
};
|
1367
|
-
function
|
1368
|
-
const t =
|
1369
|
-
() => t.getCurrentTypeOfUnit$(
|
1367
|
+
function ir() {
|
1368
|
+
const t = W(gt), e = Ft(
|
1369
|
+
() => t.getCurrentTypeOfUnit$(Q.UNIVER_SHEET),
|
1370
1370
|
void 0,
|
1371
1371
|
void 0,
|
1372
1372
|
[]
|
1373
1373
|
);
|
1374
|
-
return e ? /* @__PURE__ */ p.jsx(
|
1374
|
+
return e ? /* @__PURE__ */ p.jsx(rr, { workbook: e }) : null;
|
1375
1375
|
}
|
1376
|
-
function
|
1377
|
-
const e =
|
1376
|
+
function rr(t) {
|
1377
|
+
const e = W(yt), o = W(gt), n = W(at), a = W(jt), i = W(pt), r = W(ot), [l, s] = q([]), { workbook: c } = t, u = Ft(c.activeSheet$, void 0, !0), h = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
1378
1378
|
St(() => {
|
1379
1379
|
s(e.getRules(h, d));
|
1380
1380
|
const V = e.ruleChange$.subscribe((S) => {
|
@@ -1385,30 +1385,30 @@ function or(t) {
|
|
1385
1385
|
};
|
1386
1386
|
}, [h, d, e]);
|
1387
1387
|
const C = async () => {
|
1388
|
-
const V =
|
1388
|
+
const V = no(a), S = {
|
1389
1389
|
unitId: h,
|
1390
1390
|
subUnitId: d,
|
1391
1391
|
rule: V
|
1392
1392
|
};
|
1393
|
-
await n.executeCommand(
|
1393
|
+
await n.executeCommand(pn.id, S), i.setActiveRule({
|
1394
1394
|
unitId: h,
|
1395
1395
|
subUnitId: d,
|
1396
1396
|
rule: V
|
1397
1397
|
});
|
1398
1398
|
}, m = () => {
|
1399
|
-
n.executeCommand(
|
1399
|
+
n.executeCommand(wa.id, {
|
1400
1400
|
unitId: h,
|
1401
1401
|
subUnitId: d
|
1402
1402
|
});
|
1403
1403
|
}, D = ((V) => {
|
1404
|
-
const S =
|
1405
|
-
return V.map((P) =>
|
1404
|
+
const S = o.getCurrentUnitForType(Q.UNIVER_SHEET), x = S.getActiveSheet(), O = S.getUnitId(), T = x.getSheetId();
|
1405
|
+
return V.map((P) => _a(a, O, T, P.ranges) ? { ...P } : { ...P, disable: !0 });
|
1406
1406
|
})(l), y = D == null ? void 0 : D.some((V) => V.disable);
|
1407
|
-
return /* @__PURE__ */ p.jsxs("div", { className:
|
1407
|
+
return /* @__PURE__ */ p.jsxs("div", { className: de.dataValidationList, children: [
|
1408
1408
|
D == null ? void 0 : D.map((V) => {
|
1409
1409
|
var S;
|
1410
1410
|
return /* @__PURE__ */ p.jsx(
|
1411
|
-
|
1411
|
+
er,
|
1412
1412
|
{
|
1413
1413
|
unitId: h,
|
1414
1414
|
subUnitId: d,
|
@@ -1425,103 +1425,103 @@ function or(t) {
|
|
1425
1425
|
V.uid
|
1426
1426
|
);
|
1427
1427
|
}),
|
1428
|
-
/* @__PURE__ */ p.jsxs("div", { className:
|
1429
|
-
l.length && !y ? /* @__PURE__ */ p.jsx(
|
1430
|
-
/* @__PURE__ */ p.jsx(
|
1428
|
+
/* @__PURE__ */ p.jsxs("div", { className: de.dataValidationListButtons, children: [
|
1429
|
+
l.length && !y ? /* @__PURE__ */ p.jsx(At, { className: de.dataValidationListButton, onClick: m, children: r.t("dataValidation.panel.removeAll") }) : null,
|
1430
|
+
/* @__PURE__ */ p.jsx(At, { className: de.dataValidationListButton, type: "primary", onClick: C, children: r.t("dataValidation.panel.add") })
|
1431
1431
|
] })
|
1432
1432
|
] });
|
1433
1433
|
}
|
1434
|
-
const
|
1435
|
-
const t =
|
1436
|
-
return e ? /* @__PURE__ */ p.jsx(
|
1437
|
-
},
|
1438
|
-
type:
|
1434
|
+
const sr = () => {
|
1435
|
+
const t = W(pt), e = Ft(t.activeRule$, t.activeRule);
|
1436
|
+
return e ? /* @__PURE__ */ p.jsx(Zi, {}, e.rule.uid) : /* @__PURE__ */ p.jsx(ir, {});
|
1437
|
+
}, Dn = "data-validation.list.dropdown", $o = "data-validation.date.dropdown", $e = {
|
1438
|
+
type: qt.COMMAND,
|
1439
1439
|
id: "data-validation.command.addRuleAndOpen",
|
1440
1440
|
handler(t) {
|
1441
|
-
const e = t.get(gt),
|
1442
|
-
if (!
|
1443
|
-
const { workbook: n, worksheet:
|
1441
|
+
const e = t.get(gt), o = Gn(e);
|
1442
|
+
if (!o) return !1;
|
1443
|
+
const { workbook: n, worksheet: a } = o, i = no(t), r = t.get(at), l = n.getUnitId(), s = a.getSheetId(), c = {
|
1444
1444
|
rule: i,
|
1445
1445
|
unitId: l,
|
1446
1446
|
subUnitId: s
|
1447
1447
|
};
|
1448
|
-
return r.syncExecuteCommand(
|
1448
|
+
return r.syncExecuteCommand(pn.id, c) ? (r.syncExecuteCommand(Nt.id, {
|
1449
1449
|
ruleId: i.uid,
|
1450
1450
|
isAdd: !0
|
1451
1451
|
}), !0) : !1;
|
1452
1452
|
}
|
1453
1453
|
};
|
1454
|
-
var
|
1455
|
-
for (var
|
1456
|
-
(r = t[i]) && (
|
1457
|
-
return n &&
|
1458
|
-
},
|
1459
|
-
const
|
1460
|
-
let
|
1461
|
-
constructor(t, e,
|
1462
|
-
super(), this._hoverManagerService = t, this._cellAlertManagerService = e, this._univerInstanceService =
|
1454
|
+
var lr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, cr = (t, e, o, n) => {
|
1455
|
+
for (var a = n > 1 ? void 0 : n ? dr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1456
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1457
|
+
return n && a && lr(e, o, a), a;
|
1458
|
+
}, ne = (t, e) => (o, n) => e(o, n, t);
|
1459
|
+
const ce = "SHEET_DATA_VALIDATION_ALERT";
|
1460
|
+
let re = class extends Dt {
|
1461
|
+
constructor(t, e, o, n, a) {
|
1462
|
+
super(), this._hoverManagerService = t, this._cellAlertManagerService = e, this._univerInstanceService = o, this._localeService = n, this._zenZoneService = a, this._init();
|
1463
1463
|
}
|
1464
1464
|
_init() {
|
1465
1465
|
this._initCellAlertPopup(), this._initZenService();
|
1466
1466
|
}
|
1467
1467
|
_initCellAlertPopup() {
|
1468
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1469
|
-
var e,
|
1468
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(_n(100)).subscribe((t) => {
|
1469
|
+
var e, o;
|
1470
1470
|
if (t) {
|
1471
|
-
const
|
1472
|
-
if (!
|
1473
|
-
const i =
|
1474
|
-
if (((e = i == null ? void 0 : i.dataValidation) == null ? void 0 : e.validStatus) ===
|
1475
|
-
const r = this._cellAlertManagerService.currentAlert.get(
|
1471
|
+
const a = this._univerInstanceService.getCurrentUnitForType(Q.UNIVER_SHEET).getActiveSheet();
|
1472
|
+
if (!a) return;
|
1473
|
+
const i = a.getCell(t.location.row, t.location.col);
|
1474
|
+
if (((e = i == null ? void 0 : i.dataValidation) == null ? void 0 : e.validStatus) === ae.INVALID) {
|
1475
|
+
const r = this._cellAlertManagerService.currentAlert.get(ce), l = (o = r == null ? void 0 : r.alert) == null ? void 0 : o.location;
|
1476
1476
|
if (l && l.row === t.location.row && l.col === t.location.col && l.subUnitId === t.location.subUnitId && l.unitId === t.location.unitId)
|
1477
1477
|
return;
|
1478
1478
|
const s = i.dataValidation.validator, c = i.dataValidation.rule;
|
1479
1479
|
if (!s)
|
1480
1480
|
return;
|
1481
1481
|
this._cellAlertManagerService.showAlert({
|
1482
|
-
type:
|
1482
|
+
type: Pa.ERROR,
|
1483
1483
|
title: this._localeService.t("dataValidation.error.title"),
|
1484
|
-
message: s == null ? void 0 : s.getRuleFinalError(c),
|
1484
|
+
message: s == null ? void 0 : s.getRuleFinalError(c, t.location),
|
1485
1485
|
location: t.location,
|
1486
1486
|
width: 200,
|
1487
1487
|
height: 74,
|
1488
|
-
key:
|
1488
|
+
key: ce
|
1489
1489
|
});
|
1490
1490
|
return;
|
1491
1491
|
}
|
1492
1492
|
}
|
1493
|
-
this._cellAlertManagerService.removeAlert(
|
1493
|
+
this._cellAlertManagerService.removeAlert(ce);
|
1494
1494
|
}));
|
1495
1495
|
}
|
1496
1496
|
_initZenService() {
|
1497
1497
|
this.disposeWithMe(this._zenZoneService.visible$.subscribe((t) => {
|
1498
|
-
t && this._cellAlertManagerService.removeAlert(
|
1498
|
+
t && this._cellAlertManagerService.removeAlert(ce);
|
1499
1499
|
}));
|
1500
1500
|
}
|
1501
1501
|
};
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
],
|
1509
|
-
var
|
1510
|
-
for (var
|
1511
|
-
(r = t[i]) && (
|
1512
|
-
return n &&
|
1513
|
-
},
|
1514
|
-
let
|
1515
|
-
constructor(t, e,
|
1516
|
-
super(), this._autoFillService = t, this._dataValidationModel = e, this._injector =
|
1502
|
+
re = cr([
|
1503
|
+
ne(0, Y(Oa)),
|
1504
|
+
ne(1, Y(Ta)),
|
1505
|
+
ne(2, gt),
|
1506
|
+
ne(3, Y(ot)),
|
1507
|
+
ne(4, uo)
|
1508
|
+
], re);
|
1509
|
+
var ur = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, fr = (t, e, o, n) => {
|
1510
|
+
for (var a = n > 1 ? void 0 : n ? hr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1511
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1512
|
+
return n && a && ur(e, o, a), a;
|
1513
|
+
}, Fe = (t, e) => (o, n) => e(o, n, t);
|
1514
|
+
let Xt = class extends Dt {
|
1515
|
+
constructor(t, e, o) {
|
1516
|
+
super(), this._autoFillService = t, this._dataValidationModel = e, this._injector = o, this._initAutoFill();
|
1517
1517
|
}
|
1518
1518
|
// eslint-disable-next-line max-lines-per-function
|
1519
1519
|
_initAutoFill() {
|
1520
|
-
const t = () => ({ redos: [], undos: [] }), e = (
|
1521
|
-
const { source: r, target: l, unitId: s, subUnitId: c } =
|
1520
|
+
const t = () => ({ redos: [], undos: [] }), e = (a, i) => {
|
1521
|
+
const { source: r, target: l, unitId: s, subUnitId: c } = a, u = this._dataValidationModel.getRuleObjectMatrix(s, c).clone(), h = nn([r, l]), [d, C] = h.ranges, { mapFunc: m } = h, f = {
|
1522
1522
|
row: d.startRow,
|
1523
1523
|
col: d.startColumn
|
1524
|
-
}, D =
|
1524
|
+
}, D = La(d, C), y = new ve(), V = /* @__PURE__ */ new Set();
|
1525
1525
|
D.forEach((R) => {
|
1526
1526
|
const P = R.repeatStartCell, j = R.relativeRange, A = {
|
1527
1527
|
startRow: f.row,
|
@@ -1534,127 +1534,127 @@ let Ht = class extends Dt {
|
|
1534
1534
|
endColumn: P.col,
|
1535
1535
|
endRow: P.row
|
1536
1536
|
};
|
1537
|
-
|
1538
|
-
const w =
|
1537
|
+
ea.foreach(j, (N, B) => {
|
1538
|
+
const w = _e.getPositionRange(
|
1539
1539
|
{
|
1540
|
-
startRow:
|
1540
|
+
startRow: N,
|
1541
1541
|
startColumn: B,
|
1542
1542
|
endColumn: B,
|
1543
|
-
endRow:
|
1543
|
+
endRow: N
|
1544
1544
|
},
|
1545
1545
|
A
|
1546
1546
|
), { row: v, col: g } = m(w.startRow, w.startColumn), I = this._dataValidationModel.getRuleIdByLocation(s, c, v, g);
|
1547
1547
|
if (I) {
|
1548
|
-
const _ =
|
1548
|
+
const _ = _e.getPositionRange(
|
1549
1549
|
{
|
1550
|
-
startRow:
|
1550
|
+
startRow: N,
|
1551
1551
|
startColumn: B,
|
1552
1552
|
endColumn: B,
|
1553
|
-
endRow:
|
1553
|
+
endRow: N
|
1554
1554
|
},
|
1555
1555
|
M
|
1556
|
-
), { row:
|
1557
|
-
y.setValue(
|
1556
|
+
), { row: $, col: b } = m(_.startRow, _.startColumn);
|
1557
|
+
y.setValue($, b, I), V.add(I);
|
1558
1558
|
}
|
1559
1559
|
});
|
1560
1560
|
});
|
1561
|
-
const S = Array.from(V).map((R) => ({ id: R, ranges:
|
1561
|
+
const S = Array.from(V).map((R) => ({ id: R, ranges: Ze(y, (P) => P === R) }));
|
1562
1562
|
u.addRangeRules(S);
|
1563
|
-
const x = u.diff(this._dataValidationModel.getRules(s, c)), { redoMutations:
|
1563
|
+
const x = u.diff(this._dataValidationModel.getRules(s, c)), { redoMutations: O, undoMutations: T } = en(s, c, x, this._injector, "patched", i === te.ONLY_FORMAT);
|
1564
1564
|
return {
|
1565
|
-
undos:
|
1566
|
-
redos:
|
1565
|
+
undos: T,
|
1566
|
+
redos: O
|
1567
1567
|
};
|
1568
|
-
},
|
1569
|
-
|
1568
|
+
}, o = [
|
1569
|
+
nt.CHECKBOX
|
1570
1570
|
], n = {
|
1571
|
-
id:
|
1572
|
-
onBeforeFillData: (
|
1573
|
-
const { source: i, unitId: r, subUnitId: l } =
|
1571
|
+
id: oo,
|
1572
|
+
onBeforeFillData: (a) => {
|
1573
|
+
const { source: i, unitId: r, subUnitId: l } = a;
|
1574
1574
|
for (const s of i.rows)
|
1575
1575
|
for (const c of i.cols) {
|
1576
1576
|
const u = this._dataValidationModel.getRuleByLocation(r, l, s, c);
|
1577
|
-
if (u &&
|
1578
|
-
this._autoFillService.setDisableApplyType(
|
1577
|
+
if (u && o.indexOf(u.type) > -1) {
|
1578
|
+
this._autoFillService.setDisableApplyType(te.SERIES, !0);
|
1579
1579
|
return;
|
1580
1580
|
}
|
1581
1581
|
}
|
1582
1582
|
},
|
1583
|
-
onFillData: (
|
1583
|
+
onFillData: (a, i, r) => r === te.COPY || r === te.ONLY_FORMAT || r === te.SERIES ? e(a, r) : t(),
|
1584
1584
|
onAfterFillData: () => {
|
1585
1585
|
}
|
1586
1586
|
};
|
1587
1587
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
1588
1588
|
}
|
1589
1589
|
};
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
],
|
1595
|
-
var
|
1596
|
-
for (var
|
1597
|
-
(r = t[i]) && (
|
1598
|
-
return n &&
|
1599
|
-
},
|
1600
|
-
let
|
1601
|
-
constructor(e,
|
1590
|
+
Xt = fr([
|
1591
|
+
Fe(0, $a),
|
1592
|
+
Fe(1, Y(yt)),
|
1593
|
+
Fe(2, Y(jt))
|
1594
|
+
], Xt);
|
1595
|
+
var pr = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, gr = (t, e, o, n) => {
|
1596
|
+
for (var a = n > 1 ? void 0 : n ? mr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1597
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1598
|
+
return n && a && pr(e, o, a), a;
|
1599
|
+
}, Ne = (t, e) => (o, n) => e(o, n, t);
|
1600
|
+
let zt = class extends Dt {
|
1601
|
+
constructor(e, o, n) {
|
1602
1602
|
super();
|
1603
|
-
|
1604
|
-
this._sheetClipboardService = e, this._sheetDataValidationModel =
|
1603
|
+
k(this, "_copyInfo");
|
1604
|
+
this._sheetClipboardService = e, this._sheetDataValidationModel = o, this._injector = n, this._initCopyPaste();
|
1605
1605
|
}
|
1606
1606
|
_initCopyPaste() {
|
1607
1607
|
this._sheetClipboardService.addClipboardHook({
|
1608
|
-
id:
|
1609
|
-
onBeforeCopy: (e,
|
1610
|
-
onPasteCells: (e,
|
1611
|
-
const { copyType: i =
|
1608
|
+
id: oo,
|
1609
|
+
onBeforeCopy: (e, o, n) => this._collect(e, o, n),
|
1610
|
+
onPasteCells: (e, o, n, a) => {
|
1611
|
+
const { copyType: i = En.COPY, pasteType: r } = a, { range: l } = e || {}, { range: s, unitId: c, subUnitId: u } = o;
|
1612
1612
|
return this._generateMutations(s, { copyType: i, pasteType: r, copyRange: l, unitId: c, subUnitId: u });
|
1613
1613
|
}
|
1614
1614
|
});
|
1615
1615
|
}
|
1616
|
-
_collect(e,
|
1617
|
-
const
|
1616
|
+
_collect(e, o, n) {
|
1617
|
+
const a = new ve();
|
1618
1618
|
this._copyInfo = {
|
1619
1619
|
unitId: e,
|
1620
|
-
subUnitId:
|
1621
|
-
matrix:
|
1620
|
+
subUnitId: o,
|
1621
|
+
matrix: a
|
1622
1622
|
};
|
1623
|
-
const i = this._injector.invoke((s) =>
|
1623
|
+
const i = this._injector.invoke((s) => xa(n, s, e, o));
|
1624
1624
|
if (!i)
|
1625
1625
|
return;
|
1626
1626
|
const { rows: r, cols: l } = i;
|
1627
1627
|
r.forEach((s, c) => {
|
1628
1628
|
l.forEach((u, h) => {
|
1629
|
-
const d = this._sheetDataValidationModel.getRuleIdByLocation(e,
|
1630
|
-
|
1629
|
+
const d = this._sheetDataValidationModel.getRuleIdByLocation(e, o, s, u);
|
1630
|
+
a.setValue(c, h, d != null ? d : "");
|
1631
1631
|
});
|
1632
1632
|
});
|
1633
1633
|
}
|
1634
1634
|
// eslint-disable-next-line max-lines-per-function
|
1635
|
-
_generateMutations(e,
|
1635
|
+
_generateMutations(e, o) {
|
1636
1636
|
if (!this._copyInfo)
|
1637
1637
|
return { redos: [], undos: [] };
|
1638
|
-
if (
|
1638
|
+
if (o.copyType === En.CUT)
|
1639
1639
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1640
|
-
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !
|
1640
|
+
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
|
1641
1641
|
return { redos: [], undos: [] };
|
1642
1642
|
if ([
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1643
|
+
se.SPECIAL_PASTE_COL_WIDTH,
|
1644
|
+
se.SPECIAL_PASTE_VALUE,
|
1645
|
+
se.SPECIAL_PASTE_FORMAT,
|
1646
|
+
se.SPECIAL_PASTE_FORMULA
|
1647
1647
|
].includes(
|
1648
|
-
|
1648
|
+
o.pasteType
|
1649
1649
|
))
|
1650
1650
|
return { redos: [], undos: [] };
|
1651
|
-
const { unitId: n, subUnitId:
|
1652
|
-
if (
|
1653
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(
|
1651
|
+
const { unitId: n, subUnitId: a } = this._copyInfo;
|
1652
|
+
if (o.unitId !== n || a !== o.subUnitId) {
|
1653
|
+
const i = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), r = new ve(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } = nn([o.copyRange, e]), h = On(s, c, !0), d = /* @__PURE__ */ new Map();
|
1654
1654
|
h.forEach(({ startRange: D }) => {
|
1655
1655
|
var y;
|
1656
1656
|
(y = this._copyInfo) == null || y.matrix.forValue((V, S, x) => {
|
1657
|
-
const
|
1657
|
+
const O = _e.getPositionRange(
|
1658
1658
|
{
|
1659
1659
|
startRow: V,
|
1660
1660
|
endRow: V,
|
@@ -1662,18 +1662,18 @@ let Yt = class extends Dt {
|
|
1662
1662
|
endColumn: S
|
1663
1663
|
},
|
1664
1664
|
D
|
1665
|
-
),
|
1666
|
-
!this._sheetDataValidationModel.getRuleById(
|
1667
|
-
const { row: P, col: j } = u(
|
1668
|
-
l.add(
|
1665
|
+
), T = `${a}-${x}`, R = this._sheetDataValidationModel.getRuleById(n, a, x);
|
1666
|
+
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, T) && R && d.set(T, { ...R, uid: T });
|
1667
|
+
const { row: P, col: j } = u(O.startRow, O.startColumn);
|
1668
|
+
l.add(T), r.setValue(P, j, T);
|
1669
1669
|
});
|
1670
1670
|
});
|
1671
|
-
const C = Array.from(l).map((D) => ({ id: D, ranges:
|
1671
|
+
const C = Array.from(l).map((D) => ({ id: D, ranges: Ze(r, (y) => y === D) }));
|
1672
1672
|
i.addRangeRules(C);
|
1673
|
-
const { redoMutations: m, undoMutations: f } =
|
1674
|
-
|
1675
|
-
|
1676
|
-
i.diffWithAddition(this._sheetDataValidationModel.getRules(
|
1673
|
+
const { redoMutations: m, undoMutations: f } = en(
|
1674
|
+
o.unitId,
|
1675
|
+
o.subUnitId,
|
1676
|
+
i.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), d.values()),
|
1677
1677
|
this._injector,
|
1678
1678
|
"patched",
|
1679
1679
|
!1
|
@@ -1683,11 +1683,11 @@ let Yt = class extends Dt {
|
|
1683
1683
|
undos: f
|
1684
1684
|
};
|
1685
1685
|
} else {
|
1686
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n,
|
1687
|
-
|
1686
|
+
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n, a).clone(), r = new ve(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } = nn([o.copyRange, e]);
|
1687
|
+
On(s, c, !0).forEach(({ startRange: f }) => {
|
1688
1688
|
var D;
|
1689
1689
|
(D = this._copyInfo) == null || D.matrix.forValue((y, V, S) => {
|
1690
|
-
const x =
|
1690
|
+
const x = _e.getPositionRange(
|
1691
1691
|
{
|
1692
1692
|
startRow: y,
|
1693
1693
|
endRow: y,
|
@@ -1695,16 +1695,16 @@ let Yt = class extends Dt {
|
|
1695
1695
|
endColumn: V
|
1696
1696
|
},
|
1697
1697
|
f
|
1698
|
-
), { row:
|
1699
|
-
r.setValue(
|
1698
|
+
), { row: O, col: T } = u(x.startRow, x.startColumn);
|
1699
|
+
r.setValue(O, T, S), l.add(S);
|
1700
1700
|
});
|
1701
1701
|
});
|
1702
|
-
const d = Array.from(l).map((f) => ({ id: f, ranges:
|
1702
|
+
const d = Array.from(l).map((f) => ({ id: f, ranges: Ze(r, (D) => D === f) }));
|
1703
1703
|
i.addRangeRules(d);
|
1704
|
-
const { redoMutations: C, undoMutations: m } =
|
1704
|
+
const { redoMutations: C, undoMutations: m } = en(
|
1705
1705
|
n,
|
1706
|
-
|
1707
|
-
i.diff(this._sheetDataValidationModel.getRules(n,
|
1706
|
+
a,
|
1707
|
+
i.diff(this._sheetDataValidationModel.getRules(n, a)),
|
1708
1708
|
this._injector,
|
1709
1709
|
"patched",
|
1710
1710
|
!1
|
@@ -1716,113 +1716,113 @@ let Yt = class extends Dt {
|
|
1716
1716
|
}
|
1717
1717
|
}
|
1718
1718
|
};
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
],
|
1724
|
-
var
|
1725
|
-
for (var
|
1726
|
-
(r = t[i]) && (
|
1727
|
-
return n &&
|
1728
|
-
},
|
1729
|
-
let
|
1730
|
-
constructor(t, e,
|
1731
|
-
super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController =
|
1719
|
+
zt = gr([
|
1720
|
+
Ne(0, Aa),
|
1721
|
+
Ne(1, Y(yt)),
|
1722
|
+
Ne(2, Y(jt))
|
1723
|
+
], zt);
|
1724
|
+
var vr = Object.defineProperty, _r = Object.getOwnPropertyDescriptor, Sr = (t, e, o, n) => {
|
1725
|
+
for (var a = n > 1 ? void 0 : n ? _r(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1726
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1727
|
+
return n && a && vr(e, o, a), a;
|
1728
|
+
}, Ue = (t, e) => (o, n) => e(o, n, t);
|
1729
|
+
let Kt = class extends Dt {
|
1730
|
+
constructor(t, e, o) {
|
1731
|
+
super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController = o, this._commandExecutedListener();
|
1732
1732
|
}
|
1733
1733
|
_commandExecutedListener() {
|
1734
1734
|
this.disposeWithMe(
|
1735
1735
|
this._commandService.beforeCommandExecuted((t) => {
|
1736
|
-
t.id ===
|
1737
|
-
workbookTypes: [
|
1738
|
-
rangeTypes: [
|
1739
|
-
worksheetTypes: [
|
1740
|
-
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), t.id ===
|
1741
|
-
workbookTypes: [
|
1742
|
-
rangeTypes: [
|
1743
|
-
worksheetTypes: [
|
1736
|
+
t.id === pn.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
1737
|
+
workbookTypes: [Se],
|
1738
|
+
rangeTypes: [Ce],
|
1739
|
+
worksheetTypes: [we, tn]
|
1740
|
+
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), t.id === to.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
1741
|
+
workbookTypes: [Se],
|
1742
|
+
rangeTypes: [Ce],
|
1743
|
+
worksheetTypes: [we, tn]
|
1744
1744
|
}, t.params.ranges) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")));
|
1745
1745
|
})
|
1746
1746
|
);
|
1747
1747
|
}
|
1748
1748
|
};
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
],
|
1754
|
-
const
|
1755
|
-
function
|
1749
|
+
Kt = Sr([
|
1750
|
+
Ue(0, Y(ot)),
|
1751
|
+
Ue(1, at),
|
1752
|
+
Ue(2, Y(so))
|
1753
|
+
], Kt);
|
1754
|
+
const Lo = "data-validation-single", xo = "sheet.menu.data-validation";
|
1755
|
+
function Cr(t) {
|
1756
1756
|
return {
|
1757
|
-
id:
|
1758
|
-
type:
|
1759
|
-
icon:
|
1757
|
+
id: xo,
|
1758
|
+
type: gn.SUBITEMS,
|
1759
|
+
icon: Lo,
|
1760
1760
|
tooltip: "dataValidation.title",
|
1761
|
-
hidden$:
|
1762
|
-
disabled$:
|
1761
|
+
hidden$: Ua(t, Q.UNIVER_SHEET),
|
1762
|
+
disabled$: ja(t, { workbookTypes: [Se], worksheetTypes: [tn, we], rangeTypes: [Ce] })
|
1763
1763
|
};
|
1764
1764
|
}
|
1765
|
-
function
|
1765
|
+
function wr(t) {
|
1766
1766
|
return {
|
1767
|
-
id:
|
1767
|
+
id: Nt.id,
|
1768
1768
|
title: "dataValidation.panel.title",
|
1769
|
-
type:
|
1769
|
+
type: gn.BUTTON
|
1770
1770
|
};
|
1771
1771
|
}
|
1772
|
-
function
|
1772
|
+
function Ir(t) {
|
1773
1773
|
return {
|
1774
1774
|
id: $e.id,
|
1775
1775
|
title: "dataValidation.panel.add",
|
1776
|
-
type:
|
1776
|
+
type: gn.BUTTON
|
1777
1777
|
};
|
1778
1778
|
}
|
1779
|
-
const
|
1780
|
-
[
|
1781
|
-
[
|
1779
|
+
const Dr = {
|
1780
|
+
[ka.FORMULAS_INSERT]: {
|
1781
|
+
[xo]: {
|
1782
1782
|
order: 9,
|
1783
|
-
menuItemFactory:
|
1784
|
-
[
|
1783
|
+
menuItemFactory: Cr,
|
1784
|
+
[Nt.id]: {
|
1785
1785
|
order: 0,
|
1786
|
-
menuItemFactory:
|
1786
|
+
menuItemFactory: wr
|
1787
1787
|
},
|
1788
1788
|
[$e.id]: {
|
1789
1789
|
order: 1,
|
1790
|
-
menuItemFactory:
|
1790
|
+
menuItemFactory: Ir
|
1791
1791
|
}
|
1792
1792
|
}
|
1793
1793
|
}
|
1794
1794
|
};
|
1795
|
-
var
|
1796
|
-
for (var
|
1797
|
-
(r = t[i]) && (
|
1798
|
-
return n &&
|
1799
|
-
},
|
1800
|
-
const
|
1795
|
+
var Rr = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, Ao = (t, e, o, n) => {
|
1796
|
+
for (var a = n > 1 ? void 0 : n ? yr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1797
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1798
|
+
return n && a && Rr(e, o, a), a;
|
1799
|
+
}, tt = (t, e) => (o, n) => e(o, n, t);
|
1800
|
+
const jo = {
|
1801
1801
|
tr: {
|
1802
1802
|
size: 6,
|
1803
1803
|
color: "#fe4b4b"
|
1804
1804
|
}
|
1805
1805
|
};
|
1806
|
-
let
|
1807
|
-
constructor(t, e,
|
1808
|
-
super(), this._commandService = t, this._menuManagerService = e, this._renderManagerService =
|
1806
|
+
let Gt = class extends cn {
|
1807
|
+
constructor(t, e, o, n, a, i, r, l, s, c, u) {
|
1808
|
+
super(), this._commandService = t, this._menuManagerService = e, this._renderManagerService = o, this._univerInstanceService = n, this._autoHeightController = a, this._dropdownManagerService = i, this._sheetDataValidationModel = r, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = c, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
1809
1809
|
}
|
1810
1810
|
_initMenu() {
|
1811
|
-
this._menuManagerService.mergeMenu(
|
1811
|
+
this._menuManagerService.mergeMenu(Dr);
|
1812
1812
|
}
|
1813
1813
|
_initDropdown() {
|
1814
1814
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((t) => {
|
1815
|
-
var
|
1815
|
+
var o;
|
1816
1816
|
if (!t.visible) {
|
1817
|
-
((
|
1817
|
+
((o = this._dropdownManagerService.activeDropdown) == null ? void 0 : o.trigger) === "editor-bridge" && this._dropdownManagerService.hideDropdown();
|
1818
1818
|
return;
|
1819
1819
|
}
|
1820
1820
|
const e = this._editorBridgeService.getEditCellState();
|
1821
1821
|
if (e) {
|
1822
|
-
const { unitId: n, sheetId:
|
1822
|
+
const { unitId: n, sheetId: a, row: i, column: r } = e, l = this._univerInstanceService.getUniverSheetInstance(n);
|
1823
1823
|
if (!l)
|
1824
1824
|
return;
|
1825
|
-
const s = this._sheetDataValidationModel.getRuleByLocation(n,
|
1825
|
+
const s = this._sheetDataValidationModel.getRuleByLocation(n, a, i, r);
|
1826
1826
|
if (!s)
|
1827
1827
|
return;
|
1828
1828
|
const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
|
@@ -1831,13 +1831,13 @@ let zt = class extends ln {
|
|
1831
1831
|
const u = l.getActiveSheet();
|
1832
1832
|
if (!u) return;
|
1833
1833
|
const h = this._dropdownManagerService.activeDropdown, d = h == null ? void 0 : h.location;
|
1834
|
-
if (d && d.unitId === n && d.subUnitId ===
|
1834
|
+
if (d && d.unitId === n && d.subUnitId === a && d.row === i && d.col === r)
|
1835
1835
|
return;
|
1836
1836
|
this._dropdownManagerService.showDropdown(
|
1837
1837
|
{
|
1838
1838
|
location: {
|
1839
1839
|
unitId: n,
|
1840
|
-
subUnitId:
|
1840
|
+
subUnitId: a,
|
1841
1841
|
row: i,
|
1842
1842
|
col: r,
|
1843
1843
|
workbook: l,
|
@@ -1857,21 +1857,21 @@ let zt = class extends ln {
|
|
1857
1857
|
_initViewModelIntercept() {
|
1858
1858
|
this.disposeWithMe(
|
1859
1859
|
this._sheetInterceptorService.intercept(
|
1860
|
-
|
1860
|
+
Zn.CELL_CONTENT,
|
1861
1861
|
{
|
1862
|
-
effect:
|
1862
|
+
effect: Wn.Style,
|
1863
1863
|
// must be after numfmt
|
1864
|
-
priority:
|
1864
|
+
priority: qn.DATA_VALIDATION,
|
1865
1865
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1866
|
-
handler: (t, e,
|
1867
|
-
var y, V, S, x,
|
1868
|
-
const { row: n, col:
|
1866
|
+
handler: (t, e, o) => {
|
1867
|
+
var y, V, S, x, O, T;
|
1868
|
+
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1869
1869
|
if (!c)
|
1870
|
-
return
|
1870
|
+
return o(t);
|
1871
1871
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1872
1872
|
if (!u)
|
1873
|
-
return
|
1874
|
-
const h = (V = (y = this._dataValidationCacheService.getValue(i, r, n,
|
1873
|
+
return o(t);
|
1874
|
+
const h = (V = (y = this._dataValidationCacheService.getValue(i, r, n, a)) == null ? void 0 : y.status) != null ? V : ae.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), C = e.rawData;
|
1875
1875
|
let m;
|
1876
1876
|
const f = {
|
1877
1877
|
get value() {
|
@@ -1884,7 +1884,7 @@ let zt = class extends ln {
|
|
1884
1884
|
return `${(R = f.value) != null ? R : ""}`;
|
1885
1885
|
}
|
1886
1886
|
};
|
1887
|
-
return
|
1887
|
+
return o({
|
1888
1888
|
...t,
|
1889
1889
|
dataValidation: {
|
1890
1890
|
ruleId: c,
|
@@ -1894,7 +1894,7 @@ let zt = class extends ln {
|
|
1894
1894
|
},
|
1895
1895
|
markers: {
|
1896
1896
|
...t == null ? void 0 : t.markers,
|
1897
|
-
...h ===
|
1897
|
+
...h === ae.INVALID ? jo : null
|
1898
1898
|
},
|
1899
1899
|
customRender: [
|
1900
1900
|
...(S = t == null ? void 0 : t.customRender) != null ? S : [],
|
@@ -1902,7 +1902,7 @@ let zt = class extends ln {
|
|
1902
1902
|
],
|
1903
1903
|
fontRenderExtension: {
|
1904
1904
|
...t == null ? void 0 : t.fontRenderExtension,
|
1905
|
-
isSkip: ((x = t == null ? void 0 : t.fontRenderExtension) == null ? void 0 : x.isSkip) || ((
|
1905
|
+
isSkip: ((x = t == null ? void 0 : t.fontRenderExtension) == null ? void 0 : x.isSkip) || ((O = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : O.call(d, u, f.value, e))
|
1906
1906
|
},
|
1907
1907
|
interceptorStyle: {
|
1908
1908
|
...t == null ? void 0 : t.interceptorStyle,
|
@@ -1911,14 +1911,14 @@ let zt = class extends ln {
|
|
1911
1911
|
const R = l.getStyles();
|
1912
1912
|
return (typeof (t == null ? void 0 : t.s) == "string" ? R.get(t == null ? void 0 : t.s) : t == null ? void 0 : t.s) || {};
|
1913
1913
|
}
|
1914
|
-
}, n,
|
1914
|
+
}, n, a)
|
1915
1915
|
},
|
1916
1916
|
interceptorAutoHeight: () => {
|
1917
|
-
var A, M,
|
1918
|
-
const R = (M = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(
|
1917
|
+
var A, M, N, B, w, v;
|
1918
|
+
const R = (M = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(Ie).getWorksheetSkeleton(r)) == null ? void 0 : M.skeleton;
|
1919
1919
|
if (!R)
|
1920
1920
|
return;
|
1921
|
-
const P = R.worksheet.getMergedCell(n,
|
1921
|
+
const P = R.worksheet.getMergedCell(n, a), j = {
|
1922
1922
|
data: {
|
1923
1923
|
...t,
|
1924
1924
|
dataValidation: {
|
@@ -1929,22 +1929,22 @@ let zt = class extends ln {
|
|
1929
1929
|
}
|
1930
1930
|
},
|
1931
1931
|
style: R.getsStyles().getStyleByCell(t),
|
1932
|
-
primaryWithCoord: R.getCellByIndex((
|
1932
|
+
primaryWithCoord: R.getCellByIndex((N = P == null ? void 0 : P.startRow) != null ? N : n, (B = P == null ? void 0 : P.startColumn) != null ? B : a),
|
1933
1933
|
unitId: i,
|
1934
1934
|
subUnitId: r,
|
1935
1935
|
row: n,
|
1936
|
-
col:
|
1936
|
+
col: a,
|
1937
1937
|
workbook: l,
|
1938
1938
|
worksheet: s
|
1939
1939
|
};
|
1940
1940
|
return (v = (w = d == null ? void 0 : d.canvasRender) == null ? void 0 : w.calcCellAutoHeight) == null ? void 0 : v.call(w, j);
|
1941
1941
|
},
|
1942
1942
|
interceptorAutoWidth: () => {
|
1943
|
-
var A, M,
|
1944
|
-
const R = (M = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(
|
1943
|
+
var A, M, N, B, w, v;
|
1944
|
+
const R = (M = (A = this._renderManagerService.getRenderById(i)) == null ? void 0 : A.with(Ie).getWorksheetSkeleton(r)) == null ? void 0 : M.skeleton;
|
1945
1945
|
if (!R)
|
1946
1946
|
return;
|
1947
|
-
const P = R.worksheet.getMergedCell(n,
|
1947
|
+
const P = R.worksheet.getMergedCell(n, a), j = {
|
1948
1948
|
data: {
|
1949
1949
|
...t,
|
1950
1950
|
dataValidation: {
|
@@ -1955,17 +1955,17 @@ let zt = class extends ln {
|
|
1955
1955
|
}
|
1956
1956
|
},
|
1957
1957
|
style: R.getsStyles().getStyleByCell(t),
|
1958
|
-
primaryWithCoord: R.getCellByIndex((
|
1958
|
+
primaryWithCoord: R.getCellByIndex((N = P == null ? void 0 : P.startRow) != null ? N : n, (B = P == null ? void 0 : P.startColumn) != null ? B : a),
|
1959
1959
|
unitId: i,
|
1960
1960
|
subUnitId: r,
|
1961
1961
|
row: n,
|
1962
|
-
col:
|
1962
|
+
col: a,
|
1963
1963
|
workbook: l,
|
1964
1964
|
worksheet: s
|
1965
1965
|
};
|
1966
1966
|
return (v = (w = d == null ? void 0 : d.canvasRender) == null ? void 0 : w.calcCellAutoWidth) == null ? void 0 : v.call(w, j);
|
1967
1967
|
},
|
1968
|
-
coverable: ((
|
1968
|
+
coverable: ((T = t == null ? void 0 : t.coverable) != null ? T : !0) && !(u.type === nt.LIST || u.type === nt.LIST_MULTIPLE)
|
1969
1969
|
});
|
1970
1970
|
}
|
1971
1971
|
}
|
@@ -1976,57 +1976,57 @@ let zt = class extends ln {
|
|
1976
1976
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1977
1977
|
// patched data-validation change don't need to re-calc row height
|
1978
1978
|
// re-calc of row height will be triggered precisely by the origin command
|
1979
|
-
|
1980
|
-
|
1979
|
+
vn((t) => t.source === "command"),
|
1980
|
+
fo(16)
|
1981
1981
|
).subscribe((t) => {
|
1982
1982
|
const e = [];
|
1983
|
-
if (t.forEach((
|
1983
|
+
if (t.forEach((o) => {
|
1984
1984
|
var n;
|
1985
|
-
(n =
|
1985
|
+
(n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
1986
1986
|
}), e.length) {
|
1987
|
-
const
|
1988
|
-
|
1987
|
+
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
1988
|
+
Yn(o.redos, this._commandService);
|
1989
1989
|
}
|
1990
1990
|
});
|
1991
1991
|
}
|
1992
1992
|
};
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
],
|
2006
|
-
let
|
2007
|
-
constructor(t, e,
|
2008
|
-
super(), this._commandService = t, this._renderManagerService = e, this._autoHeightController =
|
1993
|
+
Gt = Ao([
|
1994
|
+
tt(0, at),
|
1995
|
+
tt(1, Ba),
|
1996
|
+
tt(2, Rt),
|
1997
|
+
tt(3, gt),
|
1998
|
+
tt(4, Y(lo)),
|
1999
|
+
tt(5, Y(Ct)),
|
2000
|
+
tt(6, Y(yt)),
|
2001
|
+
tt(7, Y(Vt)),
|
2002
|
+
tt(8, Y(hn)),
|
2003
|
+
tt(9, Y(ao)),
|
2004
|
+
tt(10, na(ro))
|
2005
|
+
], Gt);
|
2006
|
+
let An = class extends cn {
|
2007
|
+
constructor(t, e, o, n, a, i, r) {
|
2008
|
+
super(), this._commandService = t, this._renderManagerService = e, this._autoHeightController = o, this._dataValidatorRegistryService = n, this._sheetInterceptorService = a, this._sheetDataValidationModel = i, this._dataValidationCacheService = r, this._initViewModelIntercept(), this._initAutoHeight();
|
2009
2009
|
}
|
2010
2010
|
// eslint-disable-next-line max-lines-per-function
|
2011
2011
|
_initViewModelIntercept() {
|
2012
2012
|
this.disposeWithMe(
|
2013
2013
|
this._sheetInterceptorService.intercept(
|
2014
|
-
|
2014
|
+
Zn.CELL_CONTENT,
|
2015
2015
|
{
|
2016
|
-
effect:
|
2016
|
+
effect: Wn.Style,
|
2017
2017
|
// must be after numfmt
|
2018
|
-
priority:
|
2018
|
+
priority: qn.DATA_VALIDATION,
|
2019
2019
|
// eslint-disable-next-line complexity
|
2020
|
-
handler: (t, e,
|
2021
|
-
var D, y, V, S, x,
|
2022
|
-
const { row: n, col:
|
2020
|
+
handler: (t, e, o) => {
|
2021
|
+
var D, y, V, S, x, O;
|
2022
|
+
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
2023
2023
|
if (!c)
|
2024
|
-
return
|
2024
|
+
return o(t);
|
2025
2025
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
2026
2026
|
if (!u)
|
2027
|
-
return
|
2028
|
-
const h = (y = (D = this._dataValidationCacheService.getValue(i, r, n,
|
2029
|
-
return
|
2027
|
+
return o(t);
|
2028
|
+
const h = (y = (D = this._dataValidationCacheService.getValue(i, r, n, a)) == null ? void 0 : D.status) != null ? y : ae.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), C = s.getCellRaw(n, a), m = st(C), f = `${m != null ? m : ""}`;
|
2029
|
+
return o({
|
2030
2030
|
...t,
|
2031
2031
|
dataValidation: {
|
2032
2032
|
ruleId: c,
|
@@ -2036,7 +2036,7 @@ let Tn = class extends ln {
|
|
2036
2036
|
},
|
2037
2037
|
markers: {
|
2038
2038
|
...t == null ? void 0 : t.markers,
|
2039
|
-
...h ===
|
2039
|
+
...h === ae.INVALID ? jo : null
|
2040
2040
|
},
|
2041
2041
|
customRender: [
|
2042
2042
|
...(V = t == null ? void 0 : t.customRender) != null ? V : [],
|
@@ -2050,17 +2050,17 @@ let Tn = class extends ln {
|
|
2050
2050
|
...t == null ? void 0 : t.interceptorStyle,
|
2051
2051
|
...d == null ? void 0 : d.getExtraStyle(u, f, {
|
2052
2052
|
get style() {
|
2053
|
-
const
|
2054
|
-
return (typeof (t == null ? void 0 : t.s) == "string" ?
|
2053
|
+
const T = l.getStyles();
|
2054
|
+
return (typeof (t == null ? void 0 : t.s) == "string" ? T.get(t == null ? void 0 : t.s) : t == null ? void 0 : t.s) || {};
|
2055
2055
|
}
|
2056
|
-
}, n,
|
2056
|
+
}, n, a)
|
2057
2057
|
},
|
2058
2058
|
interceptorAutoHeight: () => {
|
2059
|
-
var j, A, M,
|
2060
|
-
const
|
2061
|
-
if (
|
2059
|
+
var j, A, M, N, B, w;
|
2060
|
+
const T = (A = (j = this._renderManagerService.getRenderById(i)) == null ? void 0 : j.with(Ie).getWorksheetSkeleton(r)) == null ? void 0 : A.skeleton;
|
2061
|
+
if (!T)
|
2062
2062
|
return;
|
2063
|
-
const R =
|
2063
|
+
const R = T.worksheet.getMergedCell(n, a), P = {
|
2064
2064
|
data: {
|
2065
2065
|
...t,
|
2066
2066
|
dataValidation: {
|
@@ -2070,18 +2070,18 @@ let Tn = class extends ln {
|
|
2070
2070
|
validator: d
|
2071
2071
|
}
|
2072
2072
|
},
|
2073
|
-
style:
|
2074
|
-
primaryWithCoord:
|
2073
|
+
style: T.getsStyles().getStyleByCell(t),
|
2074
|
+
primaryWithCoord: T.getCellByIndex((M = R == null ? void 0 : R.startRow) != null ? M : n, (N = R == null ? void 0 : R.startColumn) != null ? N : a),
|
2075
2075
|
unitId: i,
|
2076
2076
|
subUnitId: r,
|
2077
2077
|
row: n,
|
2078
|
-
col:
|
2078
|
+
col: a,
|
2079
2079
|
workbook: l,
|
2080
2080
|
worksheet: s
|
2081
2081
|
};
|
2082
2082
|
return (w = (B = d == null ? void 0 : d.canvasRender) == null ? void 0 : B.calcCellAutoHeight) == null ? void 0 : w.call(B, P);
|
2083
2083
|
},
|
2084
|
-
coverable: ((
|
2084
|
+
coverable: ((O = t == null ? void 0 : t.coverable) != null ? O : !0) && !(u.type === nt.LIST || u.type === nt.LIST_MULTIPLE)
|
2085
2085
|
});
|
2086
2086
|
}
|
2087
2087
|
}
|
@@ -2090,121 +2090,121 @@ let Tn = class extends ln {
|
|
2090
2090
|
}
|
2091
2091
|
_initAutoHeight() {
|
2092
2092
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
2093
|
-
|
2094
|
-
|
2093
|
+
vn((t) => t.source === "command"),
|
2094
|
+
fo(16)
|
2095
2095
|
).subscribe((t) => {
|
2096
2096
|
const e = [];
|
2097
|
-
if (t.forEach((
|
2097
|
+
if (t.forEach((o) => {
|
2098
2098
|
var n;
|
2099
|
-
(n =
|
2099
|
+
(n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
2100
2100
|
}), e.length) {
|
2101
|
-
const
|
2102
|
-
|
2101
|
+
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
2102
|
+
Yn(o.redos, this._commandService);
|
2103
2103
|
}
|
2104
2104
|
});
|
2105
2105
|
}
|
2106
2106
|
};
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
],
|
2116
|
-
var
|
2117
|
-
for (var
|
2118
|
-
(r = t[i]) && (
|
2119
|
-
return n &&
|
2120
|
-
},
|
2121
|
-
let
|
2122
|
-
constructor(t, e,
|
2123
|
-
super(), this._context = t, this._sheetDataValidationModel = e, this._sheetSkeletonManagerService =
|
2107
|
+
An = Ao([
|
2108
|
+
tt(0, at),
|
2109
|
+
tt(1, Rt),
|
2110
|
+
tt(2, Y(lo)),
|
2111
|
+
tt(3, Y(Vt)),
|
2112
|
+
tt(4, Y(hn)),
|
2113
|
+
tt(5, Y(yt)),
|
2114
|
+
tt(6, Y(ao))
|
2115
|
+
], An);
|
2116
|
+
var Vr = Object.defineProperty, Mr = Object.getOwnPropertyDescriptor, br = (t, e, o, n) => {
|
2117
|
+
for (var a = n > 1 ? void 0 : n ? Mr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2118
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2119
|
+
return n && a && Vr(e, o, a), a;
|
2120
|
+
}, jn = (t, e) => (o, n) => e(o, n, t);
|
2121
|
+
let Re = class extends Dt {
|
2122
|
+
constructor(t, e, o) {
|
2123
|
+
super(), this._context = t, this._sheetDataValidationModel = e, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
2124
2124
|
}
|
2125
2125
|
_initSkeletonChange() {
|
2126
2126
|
const t = (e) => {
|
2127
2127
|
var n;
|
2128
2128
|
if (!e.length)
|
2129
2129
|
return;
|
2130
|
-
const
|
2131
|
-
e.forEach((
|
2132
|
-
|
2133
|
-
}),
|
2130
|
+
const o = /* @__PURE__ */ new Set();
|
2131
|
+
e.forEach((a) => {
|
2132
|
+
o.add(a.subUnitId);
|
2133
|
+
}), o.forEach((a) => {
|
2134
2134
|
var i;
|
2135
|
-
(i = this._sheetSkeletonManagerService.getWorksheetSkeleton(
|
2135
|
+
(i = this._sheetSkeletonManagerService.getWorksheetSkeleton(a)) == null || i.skeleton.makeDirty(!0);
|
2136
2136
|
}), (n = this._context.mainComponent) == null || n.makeForceDirty();
|
2137
2137
|
};
|
2138
|
-
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(
|
2138
|
+
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(oa(16)).subscribe(t));
|
2139
2139
|
}
|
2140
2140
|
};
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
],
|
2145
|
-
const
|
2146
|
-
dataValidationFormula:
|
2147
|
-
dataValidationFormulaAnd:
|
2148
|
-
dataValidationFormulaListItem:
|
2149
|
-
dataValidationFormulaListItemIcon:
|
2141
|
+
Re = br([
|
2142
|
+
jn(1, Y(yt)),
|
2143
|
+
jn(2, Y(Ie))
|
2144
|
+
], Re);
|
2145
|
+
const Er = "univer-data-validation-formula", Or = "univer-data-validation-formula-and", Tr = "univer-data-validation-formula-list-item", Pr = "univer-data-validation-formula-list-item-icon", $r = "univer-data-validation-formula-list-item-drag", Lr = "univer-data-validation-formula-list-add", xr = "univer-data-validation-formula-color-select", Ar = "univer-data-validation-formula-color-select-panel", jr = "univer-data-validation-formula-color-item", rt = {
|
2146
|
+
dataValidationFormula: Er,
|
2147
|
+
dataValidationFormulaAnd: Or,
|
2148
|
+
dataValidationFormulaListItem: Tr,
|
2149
|
+
dataValidationFormulaListItemIcon: Pr,
|
2150
2150
|
dataValidationFormulaListItemDrag: $r,
|
2151
|
-
dataValidationFormulaListAdd:
|
2152
|
-
dataValidationFormulaColorSelect:
|
2153
|
-
dataValidationFormulaColorSelectPanel:
|
2154
|
-
dataValidationFormulaColorItem:
|
2155
|
-
},
|
2156
|
-
const { isTwoFormula: e = !1, value:
|
2151
|
+
dataValidationFormulaListAdd: Lr,
|
2152
|
+
dataValidationFormulaColorSelect: xr,
|
2153
|
+
dataValidationFormulaColorSelectPanel: Ar,
|
2154
|
+
dataValidationFormulaColorItem: jr
|
2155
|
+
}, Fr = (t) => {
|
2156
|
+
const { isTwoFormula: e = !1, value: o, onChange: n, showError: a, validResult: i } = t, r = W(ot), l = a ? i == null ? void 0 : i.formula1 : "", s = a ? i == null ? void 0 : i.formula2 : "";
|
2157
2157
|
return e ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2158
|
-
/* @__PURE__ */ p.jsx(
|
2159
|
-
|
2158
|
+
/* @__PURE__ */ p.jsx(et, { error: l, children: /* @__PURE__ */ p.jsx(
|
2159
|
+
xt,
|
2160
2160
|
{
|
2161
|
-
className:
|
2161
|
+
className: rt.dataValidationFormula,
|
2162
2162
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2163
|
-
value:
|
2163
|
+
value: o == null ? void 0 : o.formula1,
|
2164
2164
|
onChange: (c) => {
|
2165
2165
|
n == null || n({
|
2166
|
-
...
|
2166
|
+
...o,
|
2167
2167
|
formula1: c
|
2168
2168
|
});
|
2169
2169
|
}
|
2170
2170
|
}
|
2171
2171
|
) }),
|
2172
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
2173
|
-
/* @__PURE__ */ p.jsx(
|
2174
|
-
|
2172
|
+
/* @__PURE__ */ p.jsx("div", { className: rt.dataValidationFormulaAnd, children: r.t("dataValidation.panel.formulaAnd") }),
|
2173
|
+
/* @__PURE__ */ p.jsx(et, { error: s, children: /* @__PURE__ */ p.jsx(
|
2174
|
+
xt,
|
2175
2175
|
{
|
2176
|
-
className:
|
2176
|
+
className: rt.dataValidationFormula,
|
2177
2177
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2178
|
-
value:
|
2178
|
+
value: o == null ? void 0 : o.formula2,
|
2179
2179
|
onChange: (c) => {
|
2180
2180
|
n == null || n({
|
2181
|
-
...
|
2181
|
+
...o,
|
2182
2182
|
formula2: c
|
2183
2183
|
});
|
2184
2184
|
}
|
2185
2185
|
}
|
2186
2186
|
) })
|
2187
|
-
] }) : /* @__PURE__ */ p.jsx(
|
2188
|
-
|
2187
|
+
] }) : /* @__PURE__ */ p.jsx(et, { error: l, children: /* @__PURE__ */ p.jsx(
|
2188
|
+
xt,
|
2189
2189
|
{
|
2190
|
-
className:
|
2190
|
+
className: rt.dataValidationFormula,
|
2191
2191
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2192
|
-
value:
|
2192
|
+
value: o == null ? void 0 : o.formula1,
|
2193
2193
|
onChange: (c) => {
|
2194
2194
|
n == null || n({ formula1: c });
|
2195
2195
|
}
|
2196
2196
|
}
|
2197
2197
|
) });
|
2198
2198
|
};
|
2199
|
-
function
|
2200
|
-
const { value: e, onChange:
|
2199
|
+
function Nr(t) {
|
2200
|
+
const { value: e, onChange: o, showError: n, validResult: a } = t, i = W(ot), r = n ? a == null ? void 0 : a.formula1 : "", l = n ? a == null ? void 0 : a.formula2 : "", [s, c] = q(!((e == null ? void 0 : e.formula1) === void 0 && (e == null ? void 0 : e.formula2) === void 0));
|
2201
2201
|
return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2202
|
-
/* @__PURE__ */ p.jsx(
|
2203
|
-
|
2202
|
+
/* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(
|
2203
|
+
be,
|
2204
2204
|
{
|
2205
2205
|
checked: s,
|
2206
2206
|
onChange: (u) => {
|
2207
|
-
u ? c(!0) : (c(!1),
|
2207
|
+
u ? c(!0) : (c(!1), o == null || o({
|
2208
2208
|
...e,
|
2209
2209
|
formula1: void 0,
|
2210
2210
|
formula2: void 0
|
@@ -2213,28 +2213,28 @@ function jr(t) {
|
|
2213
2213
|
children: i.t("dataValidation.checkbox.tips")
|
2214
2214
|
}
|
2215
2215
|
) }),
|
2216
|
-
s ? /* @__PURE__ */ p.jsx(
|
2217
|
-
|
2216
|
+
s ? /* @__PURE__ */ p.jsx(et, { label: i.t("dataValidation.checkbox.checked"), error: r, children: /* @__PURE__ */ p.jsx(
|
2217
|
+
xt,
|
2218
2218
|
{
|
2219
|
-
className:
|
2219
|
+
className: rt.dataValidationFormula,
|
2220
2220
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
2221
2221
|
value: e == null ? void 0 : e.formula1,
|
2222
2222
|
onChange: (u) => {
|
2223
|
-
|
2223
|
+
o == null || o({
|
2224
2224
|
...e,
|
2225
2225
|
formula1: u || void 0
|
2226
2226
|
});
|
2227
2227
|
}
|
2228
2228
|
}
|
2229
2229
|
) }) : null,
|
2230
|
-
s ? /* @__PURE__ */ p.jsx(
|
2231
|
-
|
2230
|
+
s ? /* @__PURE__ */ p.jsx(et, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ p.jsx(
|
2231
|
+
xt,
|
2232
2232
|
{
|
2233
|
-
className:
|
2233
|
+
className: rt.dataValidationFormula,
|
2234
2234
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
2235
2235
|
value: e == null ? void 0 : e.formula2,
|
2236
2236
|
onChange: (u) => {
|
2237
|
-
|
2237
|
+
o == null || o({
|
2238
2238
|
...e,
|
2239
2239
|
formula2: u || void 0
|
2240
2240
|
});
|
@@ -2243,23 +2243,23 @@ function jr(t) {
|
|
2243
2243
|
) }) : null
|
2244
2244
|
] });
|
2245
2245
|
}
|
2246
|
-
function
|
2246
|
+
function Ur(t) {
|
2247
2247
|
var h;
|
2248
|
-
const { unitId: e, subUnitId:
|
2249
|
-
return
|
2248
|
+
const { unitId: e, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = t, l = i ? r == null ? void 0 : r.formula1 : void 0, s = Ht({}), [c, u] = q(!1);
|
2249
|
+
return mn((d) => {
|
2250
2250
|
var m;
|
2251
2251
|
const C = (m = s.current) == null ? void 0 : m.handleOutClick;
|
2252
2252
|
C && C(d, () => u(!1));
|
2253
2253
|
}), /* @__PURE__ */ p.jsx(
|
2254
|
-
|
2254
|
+
mo,
|
2255
2255
|
{
|
2256
2256
|
initValue: (h = n == null ? void 0 : n.formula1) != null ? h : "",
|
2257
2257
|
unitId: e,
|
2258
|
-
subUnitId:
|
2258
|
+
subUnitId: o,
|
2259
2259
|
isFocus: c,
|
2260
2260
|
onChange: (d) => {
|
2261
2261
|
const C = (d != null ? d : "").trim();
|
2262
|
-
C !== (n == null ? void 0 : n.formula1) && (
|
2262
|
+
C !== (n == null ? void 0 : n.formula1) && (a == null || a({
|
2263
2263
|
...n,
|
2264
2264
|
formula1: C
|
2265
2265
|
}));
|
@@ -2270,20 +2270,20 @@ function Fr(t) {
|
|
2270
2270
|
}
|
2271
2271
|
);
|
2272
2272
|
}
|
2273
|
-
function
|
2274
|
-
var e,
|
2273
|
+
function Fo(t) {
|
2274
|
+
var e, o, n = "";
|
2275
2275
|
if (typeof t == "string" || typeof t == "number") n += t;
|
2276
2276
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
2277
|
-
var
|
2278
|
-
for (e = 0; e <
|
2279
|
-
} else for (
|
2277
|
+
var a = t.length;
|
2278
|
+
for (e = 0; e < a; e++) t[e] && (o = Fo(t[e])) && (n && (n += " "), n += o);
|
2279
|
+
} else for (o in t) t[o] && (n && (n += " "), n += o);
|
2280
2280
|
return n;
|
2281
2281
|
}
|
2282
|
-
function
|
2283
|
-
for (var t, e,
|
2282
|
+
function kr() {
|
2283
|
+
for (var t, e, o = 0, n = "", a = arguments.length; o < a; o++) (t = arguments[o]) && (e = Fo(t)) && (n && (n += " "), n += e);
|
2284
2284
|
return n;
|
2285
2285
|
}
|
2286
|
-
const
|
2286
|
+
const Br = [
|
2287
2287
|
"#FFFFFF",
|
2288
2288
|
"#FEE7E7",
|
2289
2289
|
"#FEF0E6",
|
@@ -2308,34 +2308,34 @@ const Ur = [
|
|
2308
2308
|
"#3A60F7",
|
2309
2309
|
"#9E6DE3",
|
2310
2310
|
"#F248A6"
|
2311
|
-
],
|
2312
|
-
const { value: e, onChange:
|
2311
|
+
], Hr = (t) => {
|
2312
|
+
const { value: e, onChange: o, disabled: n } = t, [a, i] = q(!1);
|
2313
2313
|
return /* @__PURE__ */ p.jsx(
|
2314
|
-
|
2314
|
+
Je,
|
2315
2315
|
{
|
2316
2316
|
disabled: n,
|
2317
|
-
open:
|
2317
|
+
open: a,
|
2318
2318
|
onDropdownVisibleChange: i,
|
2319
2319
|
dropdownStyle: { width: 112 },
|
2320
2320
|
style: { width: 96, cursor: "pointer" },
|
2321
|
-
className:
|
2321
|
+
className: rt.dataValidationFormulaColorSelect,
|
2322
2322
|
value: e,
|
2323
|
-
onChange:
|
2323
|
+
onChange: o,
|
2324
2324
|
labelRender: (r) => /* @__PURE__ */ p.jsx(
|
2325
2325
|
"div",
|
2326
2326
|
{
|
2327
|
-
className:
|
2327
|
+
className: rt.dataValidationFormulaColorItem,
|
2328
2328
|
style: { background: r.value, marginTop: 5 }
|
2329
2329
|
}
|
2330
2330
|
),
|
2331
|
-
dropdownRender: () => /* @__PURE__ */ p.jsx("div", { className:
|
2331
|
+
dropdownRender: () => /* @__PURE__ */ p.jsx("div", { className: rt.dataValidationFormulaColorSelectPanel, children: Br.map(
|
2332
2332
|
(r) => /* @__PURE__ */ p.jsx(
|
2333
2333
|
"div",
|
2334
2334
|
{
|
2335
2335
|
onClick: () => {
|
2336
|
-
|
2336
|
+
o(r), i(!1);
|
2337
2337
|
},
|
2338
|
-
className:
|
2338
|
+
className: rt.dataValidationFormulaColorItem,
|
2339
2339
|
style: { background: r }
|
2340
2340
|
},
|
2341
2341
|
r
|
@@ -2343,71 +2343,71 @@ const Ur = [
|
|
2343
2343
|
) })
|
2344
2344
|
}
|
2345
2345
|
);
|
2346
|
-
},
|
2347
|
-
const { item: e, commonProps:
|
2348
|
-
return /* @__PURE__ */ p.jsxs("div", { className:
|
2349
|
-
e.isRef ? null : /* @__PURE__ */ p.jsx("div", { className:
|
2346
|
+
}, Fn = (t) => {
|
2347
|
+
const { item: e, commonProps: o, style: n } = t, { onItemChange: a, onItemDelete: i } = o;
|
2348
|
+
return /* @__PURE__ */ p.jsxs("div", { className: rt.dataValidationFormulaListItem, style: n, children: [
|
2349
|
+
e.isRef ? null : /* @__PURE__ */ p.jsx("div", { className: kr(rt.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ p.jsx(bo, {}) }),
|
2350
2350
|
/* @__PURE__ */ p.jsx(
|
2351
|
-
|
2351
|
+
Hr,
|
2352
2352
|
{
|
2353
2353
|
value: e.color,
|
2354
2354
|
onChange: (r) => {
|
2355
|
-
|
2355
|
+
a(e.id, e.label, r);
|
2356
2356
|
}
|
2357
2357
|
}
|
2358
2358
|
),
|
2359
2359
|
/* @__PURE__ */ p.jsx(
|
2360
|
-
|
2360
|
+
xt,
|
2361
2361
|
{
|
2362
2362
|
disabled: e.isRef,
|
2363
2363
|
value: e.label,
|
2364
2364
|
onChange: (r) => {
|
2365
|
-
|
2365
|
+
a(e.id, r, e.color);
|
2366
2366
|
}
|
2367
2367
|
}
|
2368
2368
|
),
|
2369
|
-
e.isRef ? null : /* @__PURE__ */ p.jsx("div", { className:
|
2369
|
+
e.isRef ? null : /* @__PURE__ */ p.jsx("div", { className: rt.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ p.jsx(Sn, { onClick: () => i(e.id) }) })
|
2370
2370
|
] });
|
2371
2371
|
};
|
2372
|
-
function
|
2373
|
-
const { value: e, onChange:
|
2374
|
-
}, unitId: n, subUnitId:
|
2372
|
+
function Wr(t) {
|
2373
|
+
const { value: e, onChange: o = () => {
|
2374
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = t, { formula1: s = "", formula2: c = "" } = e || {}, u = Ht(null), [h, d] = q(() => Tt(s) ? "1" : "0"), [C, m] = q(h === "1" ? s : "="), [f, D] = q(h === "1" ? s : "="), y = W(ot), V = W(Vt), S = W(Oe), x = W(Ia), [O, T] = q(() => c.split(",")), R = V.getValidatorItem(nt.LIST), [P, j] = q([]), [A, M] = q(""), N = r ? i == null ? void 0 : i.formula1 : "", B = $t(() => S.ruleChange$.pipe(_n(16)), []), w = Ft(B), v = ho(o);
|
2375
2375
|
St(() => {
|
2376
2376
|
(async () => {
|
2377
|
-
await new Promise((
|
2378
|
-
setTimeout(() =>
|
2377
|
+
await new Promise((F) => {
|
2378
|
+
setTimeout(() => F(!0), 100);
|
2379
2379
|
});
|
2380
|
-
const
|
2381
|
-
if (
|
2382
|
-
const
|
2383
|
-
j(
|
2380
|
+
const E = S.getRuleById(n, a, l), H = E == null ? void 0 : E.formula1;
|
2381
|
+
if (Tt(H) && R && E) {
|
2382
|
+
const F = await R.getListAsync(E, n, a);
|
2383
|
+
j(F);
|
2384
2384
|
}
|
2385
2385
|
})();
|
2386
|
-
}, [S, w, R, l,
|
2387
|
-
|
2386
|
+
}, [S, w, R, l, a, n]), St(() => {
|
2387
|
+
Tt(s) && s !== f && (m(s), D(f));
|
2388
2388
|
}, [f, s]);
|
2389
2389
|
const [g, I] = q(() => {
|
2390
|
-
const
|
2391
|
-
return
|
2392
|
-
label:
|
2393
|
-
color:
|
2390
|
+
const E = h !== "1" ? Jn(s) : [], H = c.split(",");
|
2391
|
+
return E.map((F, z) => ({
|
2392
|
+
label: F,
|
2393
|
+
color: H[z] || Pt,
|
2394
2394
|
isRef: !1,
|
2395
|
-
id:
|
2395
|
+
id: qe.generateRandomId(4)
|
2396
2396
|
}));
|
2397
|
-
}), _ = (
|
2398
|
-
const z = g.find((
|
2399
|
-
z && (z.label =
|
2400
|
-
},
|
2401
|
-
const
|
2402
|
-
|
2403
|
-
}, b = c.split(","),
|
2404
|
-
label:
|
2405
|
-
color: b[
|
2406
|
-
id: `${
|
2397
|
+
}), _ = (E, H, F) => {
|
2398
|
+
const z = g.find((it) => it.id === E);
|
2399
|
+
z && (z.label = H, z.color = F, I([...g]));
|
2400
|
+
}, $ = (E) => {
|
2401
|
+
const H = g.findIndex((F) => F.id === E);
|
2402
|
+
H !== -1 && (g.splice(H, 1), I([...g]));
|
2403
|
+
}, b = c.split(","), U = $t(() => P.map((E, H) => ({
|
2404
|
+
label: E,
|
2405
|
+
color: b[H] || Pt,
|
2406
|
+
id: `${H}`,
|
2407
2407
|
isRef: !0
|
2408
|
-
})), [b, P]), X = (
|
2409
|
-
const z = [...
|
2410
|
-
z[+
|
2408
|
+
})), [b, P]), X = (E, H, F) => {
|
2409
|
+
const z = [...O];
|
2410
|
+
z[+E] = F, T(z), v({
|
2411
2411
|
formula1: s,
|
2412
2412
|
formula2: z.join(",")
|
2413
2413
|
});
|
@@ -2416,42 +2416,42 @@ function Br(t) {
|
|
2416
2416
|
...g,
|
2417
2417
|
{
|
2418
2418
|
label: "",
|
2419
|
-
color:
|
2419
|
+
color: Pt,
|
2420
2420
|
isRef: !1,
|
2421
|
-
id:
|
2421
|
+
id: qe.generateRandomId(4)
|
2422
2422
|
}
|
2423
2423
|
]);
|
2424
2424
|
};
|
2425
2425
|
St(() => {
|
2426
2426
|
if (h === "1")
|
2427
2427
|
return;
|
2428
|
-
const
|
2429
|
-
g.map((
|
2430
|
-
labelList:
|
2431
|
-
item:
|
2432
|
-
})).forEach(({ item:
|
2433
|
-
z.forEach((
|
2434
|
-
|
2435
|
-
label:
|
2436
|
-
color:
|
2428
|
+
const E = /* @__PURE__ */ new Set(), H = [];
|
2429
|
+
g.map((F) => ({
|
2430
|
+
labelList: F.label.split(","),
|
2431
|
+
item: F
|
2432
|
+
})).forEach(({ item: F, labelList: z }) => {
|
2433
|
+
z.forEach((it) => {
|
2434
|
+
E.has(it) || (E.add(it), H.push({
|
2435
|
+
label: it,
|
2436
|
+
color: F.color
|
2437
2437
|
}));
|
2438
2438
|
});
|
2439
2439
|
}), v({
|
2440
|
-
formula1:
|
2441
|
-
formula2:
|
2440
|
+
formula1: Qn(H.map((F) => F.label)),
|
2441
|
+
formula2: H.map((F) => F.color === Pt ? "" : F.color).join(",")
|
2442
2442
|
});
|
2443
|
-
}, [g, v, h, f,
|
2444
|
-
const G =
|
2445
|
-
() => async (
|
2446
|
-
if (!
|
2443
|
+
}, [g, v, h, f, O]);
|
2444
|
+
const G = $t(
|
2445
|
+
() => async (E) => {
|
2446
|
+
if (!Tt(E)) {
|
2447
2447
|
v == null || v({
|
2448
2448
|
formula1: "",
|
2449
2449
|
formula2: c
|
2450
2450
|
});
|
2451
2451
|
return;
|
2452
2452
|
}
|
2453
|
-
x.getFormulaRefCheck(
|
2454
|
-
formula1:
|
2453
|
+
x.getFormulaRefCheck(E) ? (v == null || v({
|
2454
|
+
formula1: Tt(E) ? E : "",
|
2455
2455
|
formula2: c
|
2456
2456
|
}), M("")) : (v == null || v({
|
2457
2457
|
formula1: "",
|
@@ -2459,20 +2459,20 @@ function Br(t) {
|
|
2459
2459
|
}), m("="), M(y.t("dataValidation.validFail.formulaError")));
|
2460
2460
|
},
|
2461
2461
|
[c, v]
|
2462
|
-
), Z =
|
2463
|
-
return
|
2464
|
-
var
|
2465
|
-
const
|
2466
|
-
|
2462
|
+
), Z = Ht({}), [J, L] = q(!1);
|
2463
|
+
return mn((E) => {
|
2464
|
+
var F;
|
2465
|
+
const H = (F = Z.current) == null ? void 0 : F.handleOutClick;
|
2466
|
+
H && H(E, () => L(!1));
|
2467
2467
|
}), /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2468
|
-
/* @__PURE__ */ p.jsx(
|
2469
|
-
|
2468
|
+
/* @__PURE__ */ p.jsx(et, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ p.jsxs(
|
2469
|
+
un,
|
2470
2470
|
{
|
2471
2471
|
value: h,
|
2472
|
-
onChange: (
|
2473
|
-
d(
|
2472
|
+
onChange: (E) => {
|
2473
|
+
d(E), m(f), E === "1" && v({
|
2474
2474
|
formula1: f === "=" ? "" : f,
|
2475
|
-
formula2:
|
2475
|
+
formula2: O.join(",")
|
2476
2476
|
});
|
2477
2477
|
},
|
2478
2478
|
children: [
|
@@ -2483,90 +2483,90 @@ function Br(t) {
|
|
2483
2483
|
) }),
|
2484
2484
|
h === "1" ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2485
2485
|
/* @__PURE__ */ p.jsx(
|
2486
|
-
|
2486
|
+
mo,
|
2487
2487
|
{
|
2488
2488
|
initValue: C,
|
2489
2489
|
unitId: n,
|
2490
|
-
subUnitId:
|
2490
|
+
subUnitId: a,
|
2491
2491
|
isFocus: J,
|
2492
|
-
onChange: (
|
2493
|
-
const
|
2494
|
-
D(
|
2492
|
+
onChange: (E = "") => {
|
2493
|
+
const H = (E != null ? E : "").trim();
|
2494
|
+
D(H), G(H);
|
2495
2495
|
},
|
2496
|
-
errorText:
|
2497
|
-
onFocus: () =>
|
2496
|
+
errorText: N || A || void 0,
|
2497
|
+
onFocus: () => L(!0),
|
2498
2498
|
actions: Z.current
|
2499
2499
|
}
|
2500
2500
|
),
|
2501
|
-
/* @__PURE__ */ p.jsx("div", { ref: u, style: { marginTop: "12px" }, children:
|
2502
|
-
] }) : /* @__PURE__ */ p.jsx(
|
2501
|
+
/* @__PURE__ */ p.jsx("div", { ref: u, style: { marginTop: "12px" }, children: U.map((E) => /* @__PURE__ */ p.jsx(Fn, { item: E, commonProps: { onItemChange: X }, style: { marginBottom: 12 } }, E.id)) })
|
2502
|
+
] }) : /* @__PURE__ */ p.jsx(et, { error: N, children: /* @__PURE__ */ p.jsxs("div", { ref: u, style: { marginTop: "-12px" }, children: [
|
2503
2503
|
/* @__PURE__ */ p.jsx(
|
2504
|
-
|
2504
|
+
da,
|
2505
2505
|
{
|
2506
2506
|
list: g,
|
2507
2507
|
onListChange: I,
|
2508
2508
|
rowHeight: 32,
|
2509
2509
|
margin: [0, 12],
|
2510
2510
|
draggableHandle: ".draggableHandle",
|
2511
|
-
itemRender: (
|
2512
|
-
|
2511
|
+
itemRender: (E) => /* @__PURE__ */ p.jsx(
|
2512
|
+
Fn,
|
2513
2513
|
{
|
2514
|
-
item:
|
2514
|
+
item: E,
|
2515
2515
|
commonProps: {
|
2516
2516
|
onItemChange: _,
|
2517
|
-
onItemDelete:
|
2517
|
+
onItemDelete: $
|
2518
2518
|
}
|
2519
2519
|
},
|
2520
|
-
|
2520
|
+
E.id
|
2521
2521
|
),
|
2522
2522
|
idKey: "id"
|
2523
2523
|
}
|
2524
2524
|
),
|
2525
|
-
/* @__PURE__ */ p.jsxs("a", { className:
|
2526
|
-
/* @__PURE__ */ p.jsx(
|
2525
|
+
/* @__PURE__ */ p.jsxs("a", { className: rt.dataValidationFormulaListAdd, onClick: K, children: [
|
2526
|
+
/* @__PURE__ */ p.jsx(yo, {}),
|
2527
2527
|
y.t("dataValidation.list.add")
|
2528
2528
|
] })
|
2529
2529
|
] }) })
|
2530
2530
|
] });
|
2531
2531
|
}
|
2532
|
-
const
|
2532
|
+
const No = "data-validation.custom-formula-input", Le = "data-validation.formula-input", Rn = "data-validation.list-formula-input", Uo = "data-validation.checkbox-formula-input", Yr = [
|
2533
2533
|
[
|
2534
|
-
|
2535
|
-
|
2534
|
+
No,
|
2535
|
+
Ur
|
2536
2536
|
],
|
2537
2537
|
[
|
2538
|
-
|
2539
|
-
|
2538
|
+
Le,
|
2539
|
+
Fr
|
2540
2540
|
],
|
2541
2541
|
[
|
2542
|
-
|
2543
|
-
|
2542
|
+
Rn,
|
2543
|
+
Wr
|
2544
2544
|
],
|
2545
2545
|
[
|
2546
|
-
|
2547
|
-
|
2546
|
+
Uo,
|
2547
|
+
Nr
|
2548
2548
|
]
|
2549
|
-
],
|
2550
|
-
function
|
2551
|
-
var
|
2552
|
-
const { value: e, onChange:
|
2553
|
-
return /* @__PURE__ */ p.jsx(
|
2549
|
+
], Xr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2550
|
+
function ye(t) {
|
2551
|
+
var a;
|
2552
|
+
const { value: e, onChange: o } = t, n = W(ot);
|
2553
|
+
return /* @__PURE__ */ p.jsx(et, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ p.jsxs(un, { value: `${(a = e.renderMode) != null ? a : dt.CUSTOM}`, onChange: (i) => o({ ...e, renderMode: +i }), children: [
|
2554
2554
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2555
2555
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2556
2556
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2557
2557
|
] }) });
|
2558
2558
|
}
|
2559
|
-
|
2560
|
-
const
|
2561
|
-
function
|
2562
|
-
var
|
2563
|
-
const { value: e, onChange:
|
2564
|
-
return /* @__PURE__ */ p.jsx(
|
2565
|
-
|
2559
|
+
ye.componentKey = Xr;
|
2560
|
+
const zr = "DATE_SHOW_TIME_OPTION";
|
2561
|
+
function Ve(t) {
|
2562
|
+
var a;
|
2563
|
+
const { value: e, onChange: o } = t, n = W(ot);
|
2564
|
+
return /* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(
|
2565
|
+
be,
|
2566
2566
|
{
|
2567
|
-
checked: (
|
2567
|
+
checked: (a = e.bizInfo) == null ? void 0 : a.showTime,
|
2568
2568
|
onChange: (i) => {
|
2569
|
-
|
2569
|
+
o({
|
2570
2570
|
...e,
|
2571
2571
|
bizInfo: {
|
2572
2572
|
...e.bizInfo,
|
@@ -2578,22 +2578,22 @@ function Re(t) {
|
|
2578
2578
|
}
|
2579
2579
|
) });
|
2580
2580
|
}
|
2581
|
-
|
2582
|
-
var
|
2583
|
-
for (var
|
2584
|
-
(r = t[i]) && (
|
2585
|
-
return n &&
|
2586
|
-
},
|
2587
|
-
const
|
2588
|
-
let
|
2589
|
-
constructor(t, e,
|
2590
|
-
this._commandService = t, this._formulaService = e, this._themeService =
|
2581
|
+
Ve.componentKey = zr;
|
2582
|
+
var Kr = Object.defineProperty, Gr = Object.getOwnPropertyDescriptor, Zr = (t, e, o, n) => {
|
2583
|
+
for (var a = n > 1 ? void 0 : n ? Gr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2584
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2585
|
+
return n && a && Kr(e, o, a), a;
|
2586
|
+
}, ue = (t, e) => (o, n) => e(o, n, t);
|
2587
|
+
const he = 6;
|
2588
|
+
let an = class {
|
2589
|
+
constructor(t, e, o, n) {
|
2590
|
+
this._commandService = t, this._formulaService = e, this._themeService = o, this._renderManagerService = n;
|
2591
2591
|
}
|
2592
2592
|
_calc(t, e) {
|
2593
2593
|
var c, u, h;
|
2594
|
-
const { vt:
|
2594
|
+
const { vt: o, ht: n } = e || {}, a = t.endX - t.startX - he * 2, i = t.endY - t.startY, r = ((c = e == null ? void 0 : e.fs) != null ? c : 10) * 1.6;
|
2595
2595
|
let l = 0, s = 0;
|
2596
|
-
switch (
|
2596
|
+
switch (o) {
|
2597
2597
|
case ut.TOP:
|
2598
2598
|
s = 0;
|
2599
2599
|
break;
|
@@ -2606,13 +2606,13 @@ let nn = class {
|
|
2606
2606
|
}
|
2607
2607
|
switch (n) {
|
2608
2608
|
case Wt.LEFT:
|
2609
|
-
l =
|
2609
|
+
l = he;
|
2610
2610
|
break;
|
2611
2611
|
case Wt.RIGHT:
|
2612
|
-
l =
|
2612
|
+
l = he + (a - r);
|
2613
2613
|
break;
|
2614
2614
|
default:
|
2615
|
-
l =
|
2615
|
+
l = he + (a - r) / 2;
|
2616
2616
|
break;
|
2617
2617
|
}
|
2618
2618
|
return {
|
@@ -2623,35 +2623,35 @@ let nn = class {
|
|
2623
2623
|
};
|
2624
2624
|
}
|
2625
2625
|
calcCellAutoHeight(t) {
|
2626
|
-
var
|
2626
|
+
var o;
|
2627
2627
|
const { style: e } = t;
|
2628
|
-
return ((
|
2628
|
+
return ((o = e == null ? void 0 : e.fs) != null ? o : 10) * 1.6;
|
2629
2629
|
}
|
2630
2630
|
calcCellAutoWidth(t) {
|
2631
|
-
var
|
2631
|
+
var o;
|
2632
2632
|
const { style: e } = t;
|
2633
|
-
return ((
|
2633
|
+
return ((o = e == null ? void 0 : e.fs) != null ? o : 10) * 1.6;
|
2634
2634
|
}
|
2635
|
-
async _parseFormula(t, e,
|
2635
|
+
async _parseFormula(t, e, o) {
|
2636
2636
|
var c, u, h, d, C, m, f, D, y;
|
2637
|
-
const { formula1: n =
|
2637
|
+
const { formula1: n = ya, formula2: a = Va } = t, i = await this._formulaService.getRuleFormulaResult(e, o, t.uid), r = Ae((h = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Ae((m = (C = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : C[0]) == null ? void 0 : m[0]), s = bn(String(r)) && bn(String(l));
|
2638
2638
|
return {
|
2639
|
-
formula1:
|
2640
|
-
formula2:
|
2639
|
+
formula1: Tt(n) ? Ae((y = (D = (f = i == null ? void 0 : i[0]) == null ? void 0 : f.result) == null ? void 0 : D[0]) == null ? void 0 : y[0]) : n,
|
2640
|
+
formula2: Tt(a) ? l : a,
|
2641
2641
|
isFormulaValid: s
|
2642
2642
|
};
|
2643
2643
|
}
|
2644
2644
|
drawWith(t, e) {
|
2645
2645
|
var B, w, v, g, I, _;
|
2646
|
-
const { style:
|
2646
|
+
const { style: o, data: n, primaryWithCoord: a, unitId: i, subUnitId: r, worksheet: l, row: s, col: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = st(l.getCellRaw(s, c)), d = (B = n.dataValidation) == null ? void 0 : B.rule, C = (w = n.dataValidation) == null ? void 0 : w.validator;
|
2647
2647
|
if (!d || !C)
|
2648
2648
|
return;
|
2649
2649
|
const m = this._themeService.getCurrentTheme();
|
2650
2650
|
if (!((v = C.skipDefaultFontRender) != null && v.call(C, d, h, { unitId: i, subUnitId: r, row: s, column: c })))
|
2651
2651
|
return;
|
2652
|
-
const f = C.parseFormulaSync(d, i, r), { formula1: D } = f, y = this._calc(u,
|
2652
|
+
const f = C.parseFormulaSync(d, i, r), { formula1: D } = f, y = this._calc(u, o), { a: V, d: S } = t.getTransform(), x = Vn(y.left, V), O = Vn(y.top, S), T = ca.create().composeMatrix({
|
2653
2653
|
left: x,
|
2654
|
-
top:
|
2654
|
+
top: O,
|
2655
2655
|
scaleX: 1,
|
2656
2656
|
scaleY: 1,
|
2657
2657
|
angle: 0,
|
@@ -2661,118 +2661,127 @@ let nn = class {
|
|
2661
2661
|
flipY: !1
|
2662
2662
|
}), R = u.endX - u.startX, P = u.endY - u.startY;
|
2663
2663
|
t.save(), t.beginPath(), t.rect(u.startX, u.startY, R, P), t.clip();
|
2664
|
-
const j =
|
2664
|
+
const j = T.getMatrix();
|
2665
2665
|
t.transform(j[0], j[1], j[2], j[3], j[4], j[5]);
|
2666
|
-
const A = ((g =
|
2667
|
-
|
2666
|
+
const A = ((g = o == null ? void 0 : o.fs) != null ? g : 10) * 1.6, M = String(h) === String(D), N = m.hyacinth500;
|
2667
|
+
ua.drawWith(t, {
|
2668
2668
|
checked: M,
|
2669
2669
|
width: A,
|
2670
2670
|
height: A,
|
2671
|
-
fill: (_ = (I =
|
2671
|
+
fill: (_ = (I = o == null ? void 0 : o.cl) == null ? void 0 : I.rgb) != null ? _ : N
|
2672
2672
|
}), t.restore();
|
2673
2673
|
}
|
2674
2674
|
isHit(t, e) {
|
2675
|
-
const
|
2676
|
-
return s <= l && s >= r && c <= i && c >=
|
2675
|
+
const o = e.primaryWithCoord.isMergedMainCell ? e.primaryWithCoord.mergeInfo : e.primaryWithCoord, n = this._calc(o, e.style), a = n.top, i = n.top + n.height, r = n.left, l = n.left + n.width, { x: s, y: c } = t;
|
2676
|
+
return s <= l && s >= r && c <= i && c >= a;
|
2677
2677
|
}
|
2678
2678
|
async onPointerDown(t, e) {
|
2679
2679
|
var f, D, y;
|
2680
2680
|
if (e.button === 2)
|
2681
2681
|
return;
|
2682
|
-
const { primaryWithCoord:
|
2683
|
-
if (!u || !h || !((y = h.skipDefaultFontRender) != null && y.call(h, u, c, { unitId: n, subUnitId:
|
2682
|
+
const { primaryWithCoord: o, unitId: n, subUnitId: a, data: i, worksheet: r, row: l, col: s } = t, c = st(r.getCellRaw(l, s)), u = (f = i.dataValidation) == null ? void 0 : f.rule, h = (D = i.dataValidation) == null ? void 0 : D.validator;
|
2683
|
+
if (!u || !h || !((y = h.skipDefaultFontRender) != null && y.call(h, u, c, { unitId: n, subUnitId: a, row: l, column: s })))
|
2684
2684
|
return;
|
2685
|
-
const { formula1: d, formula2: C } = await this._parseFormula(u, n,
|
2685
|
+
const { formula1: d, formula2: C } = await this._parseFormula(u, n, a), m = {
|
2686
2686
|
range: {
|
2687
|
-
startColumn:
|
2688
|
-
endColumn:
|
2689
|
-
startRow:
|
2690
|
-
endRow:
|
2687
|
+
startColumn: o.actualColumn,
|
2688
|
+
endColumn: o.actualColumn,
|
2689
|
+
startRow: o.actualRow,
|
2690
|
+
endRow: o.actualRow
|
2691
2691
|
},
|
2692
2692
|
value: {
|
2693
|
-
v: String(c) ===
|
2693
|
+
v: String(c) === Ra(String(d)) ? C : d,
|
2694
2694
|
p: null
|
2695
2695
|
}
|
2696
2696
|
};
|
2697
2697
|
this._commandService.executeCommand(
|
2698
|
-
|
2698
|
+
fn.id,
|
2699
2699
|
m
|
2700
2700
|
);
|
2701
2701
|
}
|
2702
|
+
onPointerEnter(t, e) {
|
2703
|
+
var o, n;
|
2704
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.POINTER);
|
2705
|
+
}
|
2706
|
+
onPointerLeave(t, e) {
|
2707
|
+
var o, n;
|
2708
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.DEFAULT);
|
2709
|
+
}
|
2702
2710
|
};
|
2703
|
-
|
2704
|
-
|
2705
|
-
|
2706
|
-
|
2707
|
-
|
2708
|
-
|
2709
|
-
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2711
|
+
an = Zr([
|
2712
|
+
ue(0, at),
|
2713
|
+
ue(1, Y(Da)),
|
2714
|
+
ue(2, Y(aa)),
|
2715
|
+
ue(3, Y(Rt))
|
2716
|
+
], an);
|
2717
|
+
var qr = Object.defineProperty, Jr = Object.getOwnPropertyDescriptor, Qr = (t, e, o, n) => {
|
2718
|
+
for (var a = n > 1 ? void 0 : n ? Jr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2719
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2720
|
+
return n && a && qr(e, o, a), a;
|
2721
|
+
}, ts = (t, e) => (o, n) => e(o, n, t);
|
2713
2722
|
let mt = class {
|
2714
2723
|
constructor(t) {
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2724
|
+
k(this, "canvasRender", null);
|
2725
|
+
k(this, "dropdown");
|
2726
|
+
k(this, "optionsInput");
|
2727
|
+
k(this, "formulaInput", Rn);
|
2719
2728
|
this.injector = t;
|
2720
2729
|
}
|
2721
2730
|
};
|
2722
|
-
mt =
|
2723
|
-
|
2731
|
+
mt = Qr([
|
2732
|
+
ts(0, Y(jt))
|
2724
2733
|
], mt);
|
2725
|
-
class
|
2734
|
+
class es extends mt {
|
2726
2735
|
constructor() {
|
2727
2736
|
super(...arguments);
|
2728
|
-
|
2729
|
-
|
2730
|
-
|
2737
|
+
k(this, "id", nt.CHECKBOX);
|
2738
|
+
k(this, "canvasRender", this.injector.createInstance(an));
|
2739
|
+
k(this, "formulaInput", Uo);
|
2731
2740
|
}
|
2732
2741
|
}
|
2733
|
-
class
|
2742
|
+
class ns extends mt {
|
2734
2743
|
constructor() {
|
2735
2744
|
super(...arguments);
|
2736
|
-
|
2737
|
-
|
2745
|
+
k(this, "id", nt.CUSTOM);
|
2746
|
+
k(this, "formulaInput", No);
|
2738
2747
|
}
|
2739
2748
|
}
|
2740
|
-
const
|
2741
|
-
class
|
2749
|
+
const os = "data-validation.formula-input";
|
2750
|
+
class as extends mt {
|
2742
2751
|
constructor() {
|
2743
2752
|
super(...arguments);
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
|
2753
|
+
k(this, "id", nt.DATE);
|
2754
|
+
k(this, "formulaInput", os);
|
2755
|
+
k(this, "optionsInput", Ve.componentKey);
|
2756
|
+
k(this, "dropdown", $o);
|
2748
2757
|
}
|
2749
2758
|
}
|
2750
|
-
class
|
2759
|
+
class is extends mt {
|
2751
2760
|
constructor() {
|
2752
2761
|
super(...arguments);
|
2753
|
-
|
2754
|
-
|
2762
|
+
k(this, "id", nt.DECIMAL);
|
2763
|
+
k(this, "formulaInput", Le);
|
2755
2764
|
}
|
2756
2765
|
}
|
2757
|
-
const
|
2758
|
-
function
|
2759
|
-
const
|
2766
|
+
const ko = 4, rs = 0, ke = 4, Bo = 4, rn = 6, Me = 6, Ot = 14;
|
2767
|
+
function ss(t, e) {
|
2768
|
+
const o = ha.getTextSize(t, e), n = o.width + ko * 2, { ba: a, bd: i } = o, r = a + i;
|
2760
2769
|
return {
|
2761
2770
|
width: n,
|
2762
|
-
height: r +
|
2763
|
-
ba:
|
2771
|
+
height: r + rs * 2,
|
2772
|
+
ba: a
|
2764
2773
|
};
|
2765
2774
|
}
|
2766
|
-
function
|
2767
|
-
const
|
2768
|
-
layout:
|
2775
|
+
function Be(t, e, o, n) {
|
2776
|
+
const a = Ot + rn * 2, i = o - a, r = n - Me * 2, l = t.map((d) => ({
|
2777
|
+
layout: ss(d, e),
|
2769
2778
|
text: d
|
2770
2779
|
}));
|
2771
2780
|
let s;
|
2772
2781
|
const c = [];
|
2773
2782
|
l.forEach((d) => {
|
2774
2783
|
const { layout: C } = d, { width: m, height: f } = C;
|
2775
|
-
!s || s.width + m +
|
2784
|
+
!s || s.width + m + ke > i ? (s = {
|
2776
2785
|
width: m,
|
2777
2786
|
height: f,
|
2778
2787
|
items: [{
|
@@ -2781,44 +2790,44 @@ function ke(t, e, a, n) {
|
|
2781
2790
|
}]
|
2782
2791
|
}, c.push(s)) : (s.items.push({
|
2783
2792
|
...d,
|
2784
|
-
left: s.width +
|
2785
|
-
}), s.width = s.width + m +
|
2793
|
+
left: s.width + ke
|
2794
|
+
}), s.width = s.width + m + ke);
|
2786
2795
|
});
|
2787
2796
|
let u = 0, h = 0;
|
2788
2797
|
return c.forEach((d, C) => {
|
2789
|
-
h = Math.max(h, d.width), C === c.length - 1 ? u += d.height : u += d.height +
|
2798
|
+
h = Math.max(h, d.width), C === c.length - 1 ? u += d.height : u += d.height + Bo;
|
2790
2799
|
}), {
|
2791
2800
|
lines: c,
|
2792
2801
|
totalHeight: u,
|
2793
2802
|
contentWidth: i,
|
2794
2803
|
contentHeight: r,
|
2795
|
-
cellAutoHeight: u +
|
2796
|
-
calcAutoWidth: h +
|
2804
|
+
cellAutoHeight: u + Me * 2,
|
2805
|
+
calcAutoWidth: h + a
|
2797
2806
|
};
|
2798
2807
|
}
|
2799
|
-
const
|
2800
|
-
class
|
2801
|
-
static drawWith(e,
|
2802
|
-
const { fontString: n, info:
|
2803
|
-
e.save(),
|
2808
|
+
const ls = 8;
|
2809
|
+
class ds extends fa {
|
2810
|
+
static drawWith(e, o) {
|
2811
|
+
const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
|
2812
|
+
e.save(), zn.drawWith(e, {
|
2804
2813
|
width: l.width,
|
2805
2814
|
height: l.height,
|
2806
|
-
radius:
|
2807
|
-
fill: i ||
|
2808
|
-
}), e.translateWithPrecision(
|
2815
|
+
radius: ls,
|
2816
|
+
fill: i || Pt
|
2817
|
+
}), e.translateWithPrecision(ko, l.ba), e.font = n, e.fillStyle = r, e.fillText(s, 0, 0), e.restore();
|
2809
2818
|
}
|
2810
2819
|
}
|
2811
|
-
var
|
2812
|
-
for (var
|
2813
|
-
(r = t[i]) && (
|
2814
|
-
return n &&
|
2815
|
-
},
|
2816
|
-
const
|
2817
|
-
let
|
2818
|
-
constructor(t) {
|
2819
|
-
|
2820
|
-
|
2821
|
-
this._commandService = t;
|
2820
|
+
var cs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, hs = (t, e, o, n) => {
|
2821
|
+
for (var a = n > 1 ? void 0 : n ? us(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2822
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2823
|
+
return n && a && cs(e, o, a), a;
|
2824
|
+
}, Nn = (t, e) => (o, n) => e(o, n, t);
|
2825
|
+
const fs = 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");
|
2826
|
+
let sn = class {
|
2827
|
+
constructor(t, e) {
|
2828
|
+
k(this, "zIndex");
|
2829
|
+
k(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2830
|
+
this._commandService = t, this._renderManagerService = e;
|
2822
2831
|
}
|
2823
2832
|
_ensureMap(t) {
|
2824
2833
|
let e = this._dropdownInfoMap.get(t);
|
@@ -2827,10 +2836,10 @@ let on = class {
|
|
2827
2836
|
_generateKey(t, e) {
|
2828
2837
|
return `${t}.${e}`;
|
2829
2838
|
}
|
2830
|
-
_drawDownIcon(t, e,
|
2831
|
-
const i =
|
2839
|
+
_drawDownIcon(t, e, o, n, a) {
|
2840
|
+
const i = o - Ot + 4;
|
2832
2841
|
let r = 4;
|
2833
|
-
switch (
|
2842
|
+
switch (a) {
|
2834
2843
|
case ut.MIDDLE:
|
2835
2844
|
r = (n - Ot) / 2 + 4;
|
2836
2845
|
break;
|
@@ -2838,12 +2847,12 @@ let on = class {
|
|
2838
2847
|
r = n - Ot + 4;
|
2839
2848
|
break;
|
2840
2849
|
}
|
2841
|
-
t.save(), t.translateWithPrecision(e.startX + i, e.startY + r), t.fillStyle = "#565656", t.fill(
|
2850
|
+
t.save(), t.translateWithPrecision(e.startX + i, e.startY + r), t.fillStyle = "#565656", t.fill(fs), t.restore();
|
2842
2851
|
}
|
2843
2852
|
// eslint-disable-next-line max-lines-per-function
|
2844
|
-
drawWith(t, e,
|
2845
|
-
var b,
|
2846
|
-
const { primaryWithCoord:
|
2853
|
+
drawWith(t, e, o, n) {
|
2854
|
+
var b, U;
|
2855
|
+
const { primaryWithCoord: a, row: i, col: r, style: l, data: s, subUnitId: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = s.fontRenderExtension, { leftOffset: d = 0, rightOffset: C = 0, topOffset: m = 0, downOffset: f = 0 } = h || {}, D = s.dataValidation, y = this._ensureMap(c), V = this._generateKey(i, r);
|
2847
2856
|
if (!D)
|
2848
2857
|
return;
|
2849
2858
|
const S = {
|
@@ -2851,47 +2860,47 @@ let on = class {
|
|
2851
2860
|
endX: u.endX - C,
|
2852
2861
|
startY: u.startY + m,
|
2853
2862
|
endY: u.endY - f
|
2854
|
-
}, x = S.endX - S.startX,
|
2855
|
-
this._drawDownIcon(t, S, x,
|
2856
|
-
let
|
2863
|
+
}, x = S.endX - S.startX, O = S.endY - S.startY, { cl: T } = l || {}, R = (b = typeof T == "object" ? T == null ? void 0 : T.rgb : T) != null ? b : "#000", P = xe(l != null ? l : void 0), { rule: j, validator: A } = D, M = A, { vt: N, ht: B } = l || {}, w = N != null ? N : ut.MIDDLE, v = (U = st(s)) != null ? U : "", g = M.parseCellValue(v), I = M.getListWithColorMap(j), _ = Be(g, P, x, O);
|
2864
|
+
this._drawDownIcon(t, S, x, O, w), t.save(), t.translateWithPrecision(S.startX, S.startY), t.beginPath(), t.rect(0, 0, x - Ot, O), t.clip(), t.translateWithPrecision(rn, Me);
|
2865
|
+
let $ = 0;
|
2857
2866
|
switch (w) {
|
2858
2867
|
case ut.MIDDLE:
|
2859
|
-
|
2868
|
+
$ = (_.contentHeight - _.totalHeight) / 2;
|
2860
2869
|
break;
|
2861
2870
|
case ut.BOTTOM:
|
2862
|
-
|
2871
|
+
$ = _.contentHeight - _.totalHeight;
|
2863
2872
|
break;
|
2864
2873
|
}
|
2865
|
-
t.translateWithPrecision(0,
|
2874
|
+
t.translateWithPrecision(0, $), _.lines.forEach((X, K) => {
|
2866
2875
|
t.save();
|
2867
2876
|
const { width: G, height: Z, items: J } = X;
|
2868
|
-
let
|
2877
|
+
let L = 0;
|
2869
2878
|
switch (B) {
|
2870
2879
|
case Wt.RIGHT:
|
2871
|
-
|
2880
|
+
L = _.contentWidth - G;
|
2872
2881
|
break;
|
2873
2882
|
case Wt.CENTER:
|
2874
|
-
|
2883
|
+
L = (_.contentWidth - G) / 2;
|
2875
2884
|
break;
|
2876
2885
|
}
|
2877
|
-
t.translate(
|
2878
|
-
t.save(), t.translateWithPrecision(
|
2886
|
+
t.translate(L, K * (Z + Bo)), J.forEach((E) => {
|
2887
|
+
t.save(), t.translateWithPrecision(E.left, 0), ds.drawWith(t, {
|
2879
2888
|
...P,
|
2880
|
-
info:
|
2889
|
+
info: E,
|
2881
2890
|
color: R,
|
2882
|
-
fill: I[
|
2891
|
+
fill: I[E.text]
|
2883
2892
|
}), t.restore();
|
2884
2893
|
}), t.restore();
|
2885
2894
|
}), t.restore(), y.set(V, {
|
2886
2895
|
left: S.startX,
|
2887
2896
|
top: S.startY,
|
2888
|
-
width: _.contentWidth +
|
2889
|
-
height: _.contentHeight +
|
2897
|
+
width: _.contentWidth + rn + Ot,
|
2898
|
+
height: _.contentHeight + Me * 2
|
2890
2899
|
});
|
2891
2900
|
}
|
2892
2901
|
calcCellAutoHeight(t) {
|
2893
2902
|
var x;
|
2894
|
-
const { primaryWithCoord: e, style:
|
2903
|
+
const { primaryWithCoord: e, style: o, data: n } = t, a = n.fontRenderExtension, { leftOffset: i = 0, rightOffset: r = 0, topOffset: l = 0, downOffset: s = 0 } = a || {}, c = e.isMergedMainCell ? e.mergeInfo : e, u = {
|
2895
2904
|
startX: c.startX + i,
|
2896
2905
|
endX: c.endX - r,
|
2897
2906
|
startY: c.startY + l,
|
@@ -2899,12 +2908,12 @@ let on = class {
|
|
2899
2908
|
}, h = n.dataValidation;
|
2900
2909
|
if (!h)
|
2901
2910
|
return;
|
2902
|
-
const d = u.endX - u.startX, C = u.endY - u.startY, m = (x = st(n)) != null ? x : "", { validator: f } = h, y = f.parseCellValue(m), V =
|
2903
|
-
return
|
2911
|
+
const d = u.endX - u.startX, C = u.endY - u.startY, m = (x = st(n)) != null ? x : "", { validator: f } = h, y = f.parseCellValue(m), V = xe(o != null ? o : void 0);
|
2912
|
+
return Be(y, V, d, C).cellAutoHeight;
|
2904
2913
|
}
|
2905
2914
|
calcCellAutoWidth(t) {
|
2906
2915
|
var x;
|
2907
|
-
const { primaryWithCoord: e, style:
|
2916
|
+
const { primaryWithCoord: e, style: o, data: n } = t, a = n.fontRenderExtension, { leftOffset: i = 0, rightOffset: r = 0, topOffset: l = 0, downOffset: s = 0 } = a || {}, c = e.isMergedMainCell ? e.mergeInfo : e, u = {
|
2908
2917
|
startX: c.startX + i,
|
2909
2918
|
endX: c.endX - r,
|
2910
2919
|
startY: c.startY + l,
|
@@ -2912,63 +2921,72 @@ let on = class {
|
|
2912
2921
|
}, h = n.dataValidation;
|
2913
2922
|
if (!h)
|
2914
2923
|
return;
|
2915
|
-
const d = u.endX - u.startX, C = u.endY - u.startY, m = (x = st(n)) != null ? x : "", { validator: f } = h, y = f.parseCellValue(m), V =
|
2916
|
-
return
|
2924
|
+
const d = u.endX - u.startX, C = u.endY - u.startY, m = (x = st(n)) != null ? x : "", { validator: f } = h, y = f.parseCellValue(m), V = xe(o != null ? o : void 0);
|
2925
|
+
return Be(y, V, d, C).calcAutoWidth;
|
2917
2926
|
}
|
2918
2927
|
isHit(t, e) {
|
2919
|
-
const { primaryWithCoord:
|
2920
|
-
return i >=
|
2928
|
+
const { primaryWithCoord: o } = e, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = t;
|
2929
|
+
return i >= a - Ot && i <= a;
|
2921
2930
|
}
|
2922
2931
|
onPointerDown(t, e) {
|
2923
2932
|
if (e.button === 2)
|
2924
2933
|
return;
|
2925
|
-
const { unitId:
|
2926
|
-
unitId:
|
2934
|
+
const { unitId: o, subUnitId: n, row: a, col: i } = t, r = {
|
2935
|
+
unitId: o,
|
2927
2936
|
subUnitId: n,
|
2928
|
-
row:
|
2937
|
+
row: a,
|
2929
2938
|
column: i
|
2930
2939
|
};
|
2931
|
-
this._commandService.executeCommand(
|
2940
|
+
this._commandService.executeCommand(Pe.id, r);
|
2941
|
+
}
|
2942
|
+
onPointerEnter(t, e) {
|
2943
|
+
var o, n;
|
2944
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.POINTER);
|
2945
|
+
}
|
2946
|
+
onPointerLeave(t, e) {
|
2947
|
+
var o, n;
|
2948
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.DEFAULT);
|
2932
2949
|
}
|
2933
2950
|
};
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2951
|
+
sn = hs([
|
2952
|
+
Nn(0, at),
|
2953
|
+
Nn(1, Y(Rt))
|
2954
|
+
], sn);
|
2955
|
+
class ps extends mt {
|
2938
2956
|
constructor() {
|
2939
2957
|
super(...arguments);
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2958
|
+
k(this, "id", nt.LIST_MULTIPLE);
|
2959
|
+
k(this, "canvasRender", this.injector.createInstance(sn));
|
2960
|
+
k(this, "dropdown", Dn);
|
2943
2961
|
}
|
2944
2962
|
}
|
2945
|
-
var
|
2946
|
-
for (var
|
2947
|
-
(r = t[i]) && (
|
2948
|
-
return n &&
|
2949
|
-
},
|
2950
|
-
const
|
2951
|
-
function
|
2952
|
-
const
|
2963
|
+
var ms = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, vs = (t, e, o, n) => {
|
2964
|
+
for (var a = n > 1 ? void 0 : n ? gs(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2965
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2966
|
+
return n && a && ms(e, o, a), a;
|
2967
|
+
}, He = (t, e) => (o, n) => e(o, n, t);
|
2968
|
+
const Et = 4, fe = 4, ht = 14, ft = 6, Bt = 4, We = 8, _s = "#565656", Un = 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");
|
2969
|
+
function Ss(t, e) {
|
2970
|
+
const o = t.length;
|
2953
2971
|
return {
|
2954
2972
|
id: "d",
|
2955
2973
|
body: {
|
2956
|
-
dataStream: `${t}${
|
2974
|
+
dataStream: `${t}${ra}`,
|
2957
2975
|
textRuns: [
|
2958
2976
|
{
|
2959
2977
|
ts: {
|
2960
2978
|
fs: 11,
|
2961
2979
|
ff: void 0,
|
2962
|
-
it:
|
2963
|
-
bl:
|
2980
|
+
it: Jt.FALSE,
|
2981
|
+
bl: Jt.FALSE,
|
2964
2982
|
ul: {
|
2965
|
-
s:
|
2983
|
+
s: Jt.FALSE
|
2966
2984
|
},
|
2967
2985
|
st: {
|
2968
|
-
s:
|
2986
|
+
s: Jt.FALSE
|
2969
2987
|
},
|
2970
2988
|
ol: {
|
2971
|
-
s:
|
2989
|
+
s: Jt.FALSE
|
2972
2990
|
},
|
2973
2991
|
cl: void 0,
|
2974
2992
|
...e,
|
@@ -2976,7 +2994,7 @@ function _s(t, e) {
|
|
2976
2994
|
bd: void 0
|
2977
2995
|
},
|
2978
2996
|
st: 0,
|
2979
|
-
ed:
|
2997
|
+
ed: o
|
2980
2998
|
}
|
2981
2999
|
]
|
2982
3000
|
},
|
@@ -2988,34 +3006,34 @@ function _s(t, e) {
|
|
2988
3006
|
}
|
2989
3007
|
};
|
2990
3008
|
}
|
2991
|
-
function
|
2992
|
-
const n =
|
3009
|
+
function Ho(t, e, o) {
|
3010
|
+
const n = Ss(t, o), a = new ia(n), i = new pa(a);
|
2993
3011
|
return {
|
2994
|
-
documentSkeleton:
|
2995
|
-
docModel:
|
3012
|
+
documentSkeleton: ma.create(i, e),
|
3013
|
+
docModel: a,
|
2996
3014
|
docViewModel: i
|
2997
3015
|
};
|
2998
3016
|
}
|
2999
|
-
function
|
3017
|
+
function pe(t, e, o) {
|
3000
3018
|
const {
|
3001
3019
|
documentSkeleton: n,
|
3002
|
-
docModel:
|
3020
|
+
docModel: a,
|
3003
3021
|
docViewModel: i
|
3004
|
-
} =
|
3022
|
+
} = Ho(t, e, o);
|
3005
3023
|
return {
|
3006
|
-
documents: new
|
3024
|
+
documents: new ga(`DOCUMENTS_${qe.generateRandomId()}`, n, {
|
3007
3025
|
pageMarginLeft: 0,
|
3008
3026
|
pageMarginTop: 0
|
3009
3027
|
}),
|
3010
3028
|
documentSkeleton: n,
|
3011
|
-
docModel:
|
3029
|
+
docModel: a,
|
3012
3030
|
docViewModel: i
|
3013
3031
|
};
|
3014
3032
|
}
|
3015
|
-
function
|
3033
|
+
function kn(t, e, o, n, a, i, r = !0) {
|
3016
3034
|
let l = 0;
|
3017
|
-
const s = r ?
|
3018
|
-
switch (
|
3035
|
+
const s = r ? Bt : 0;
|
3036
|
+
switch (a) {
|
3019
3037
|
case ut.BOTTOM:
|
3020
3038
|
l = e - n - s;
|
3021
3039
|
break;
|
@@ -3026,14 +3044,14 @@ function Nn(t, e, a, n, o, i, r = !0) {
|
|
3026
3044
|
l = s;
|
3027
3045
|
break;
|
3028
3046
|
}
|
3029
|
-
l = Math.max(
|
3047
|
+
l = Math.max(Bt, l);
|
3030
3048
|
let c = 0;
|
3031
3049
|
switch (i) {
|
3032
3050
|
case Wt.CENTER:
|
3033
|
-
c = (t -
|
3051
|
+
c = (t - o) / 2;
|
3034
3052
|
break;
|
3035
3053
|
case Wt.RIGHT:
|
3036
|
-
c = t -
|
3054
|
+
c = t - o;
|
3037
3055
|
break;
|
3038
3056
|
}
|
3039
3057
|
return c = Math.max(ft, c), {
|
@@ -3041,13 +3059,11 @@ function Nn(t, e, a, n, o, i, r = !0) {
|
|
3041
3059
|
paddingTop: l
|
3042
3060
|
};
|
3043
3061
|
}
|
3044
|
-
let
|
3045
|
-
constructor(t, e) {
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
F(this, "onPointerLeave");
|
3050
|
-
this._localeService = t, this._commandService = e;
|
3062
|
+
let ln = class {
|
3063
|
+
constructor(t, e, o) {
|
3064
|
+
k(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
3065
|
+
k(this, "zIndex");
|
3066
|
+
this._localeService = t, this._commandService = e, this._renderManagerService = o;
|
3051
3067
|
}
|
3052
3068
|
_ensureMap(t) {
|
3053
3069
|
let e = this._dropdownInfoMap.get(t);
|
@@ -3056,60 +3072,60 @@ let rn = class {
|
|
3056
3072
|
_generateKey(t, e) {
|
3057
3073
|
return `${t}.${e}`;
|
3058
3074
|
}
|
3059
|
-
_drawDownIcon(t, e,
|
3060
|
-
const { t: l = lt.pd.t, b: s = lt.pd.b } = r, c =
|
3075
|
+
_drawDownIcon(t, e, o, n, a, i, r) {
|
3076
|
+
const { t: l = lt.pd.t, b: s = lt.pd.b } = r, c = o - ht;
|
3061
3077
|
let u;
|
3062
3078
|
switch (i) {
|
3063
3079
|
case ut.MIDDLE:
|
3064
|
-
u = (n -
|
3080
|
+
u = (n - fe) / 2;
|
3065
3081
|
break;
|
3066
3082
|
case ut.BOTTOM:
|
3067
|
-
u = n - s -
|
3083
|
+
u = n - s - a - Bt + (a / 2 - fe / 2);
|
3068
3084
|
break;
|
3069
3085
|
default:
|
3070
|
-
u = l +
|
3086
|
+
u = l + Bt + (a / 2 - fe / 2);
|
3071
3087
|
break;
|
3072
3088
|
}
|
3073
|
-
t.save(), t.translateWithPrecision(e.startX + c, e.startY + u), t.fillStyle = "#565656", t.fill(
|
3089
|
+
t.save(), t.translateWithPrecision(e.startX + c, e.startY + u), t.fillStyle = "#565656", t.fill(Un), t.restore();
|
3074
3090
|
}
|
3075
3091
|
// eslint-disable-next-line max-lines-per-function, complexity
|
3076
|
-
drawWith(t, e,
|
3092
|
+
drawWith(t, e, o) {
|
3077
3093
|
var w, v;
|
3078
|
-
const { primaryWithCoord: n, row:
|
3079
|
-
if (!u || !h || !h || h.id.indexOf(
|
3094
|
+
const { primaryWithCoord: n, row: a, col: i, style: r, data: l, subUnitId: s } = e, c = n.isMergedMainCell ? n.mergeInfo : n, u = (w = l.dataValidation) == null ? void 0 : w.rule, h = (v = l.dataValidation) == null ? void 0 : v.validator, d = l.fontRenderExtension, { leftOffset: C = 0, rightOffset: m = 0, topOffset: f = 0, downOffset: D = 0 } = d || {};
|
3095
|
+
if (!u || !h || !h || h.id.indexOf(nt.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
3080
3096
|
return;
|
3081
3097
|
const y = {
|
3082
3098
|
startX: c.startX + C,
|
3083
3099
|
endX: c.endX - m,
|
3084
3100
|
startY: c.startY + f,
|
3085
3101
|
endY: c.endY - D
|
3086
|
-
}, V = y.endX - y.startX, S = y.endY - y.startY, x = this._ensureMap(s),
|
3087
|
-
let { tb: A, vt: M, ht:
|
3088
|
-
if (A = A != null ? A : _t.WRAP, M = M != null ? M : ut.BOTTOM,
|
3089
|
-
const { l: g = lt.pd.l, t: I = lt.pd.t, r: _ = lt.pd.r, b:
|
3090
|
-
A === _t.WRAP && K.updateDocumentDataPageSize(Math.max(b, 1)),
|
3091
|
-
const G =
|
3092
|
-
this._drawDownIcon(t, y, V, S, Z, M, B), t.save(), t.translateWithPrecision(y.startX + g, y.startY + I), t.beginPath(), t.rect(0, 0, V - g - _, S - I -
|
3093
|
-
left: y.endX + g +
|
3094
|
-
top: y.startY + I +
|
3102
|
+
}, V = y.endX - y.startX, S = y.endY - y.startY, x = this._ensureMap(s), O = this._generateKey(a, i), T = h.getListWithColor(u), R = st(l), P = `${R != null ? R : ""}`, j = T.find((g) => g.label === P);
|
3103
|
+
let { tb: A, vt: M, ht: N, pd: B } = r || {};
|
3104
|
+
if (A = A != null ? A : _t.WRAP, M = M != null ? M : ut.BOTTOM, N = N != null ? N : lt.ht, B = B != null ? B : lt.pd, u.renderMode === dt.ARROW) {
|
3105
|
+
const { l: g = lt.pd.l, t: I = lt.pd.t, r: _ = lt.pd.r, b: $ = lt.pd.b } = B, b = V - g - _ - ht - 4, { documentSkeleton: U, documents: X, docModel: K } = pe(P, this._localeService, r);
|
3106
|
+
A === _t.WRAP && K.updateDocumentDataPageSize(Math.max(b, 1)), U.calculate(), U.getActualSize();
|
3107
|
+
const G = Qt(U), { height: Z, width: J } = G, { paddingTop: L, paddingLeft: E } = kn(b, S - I - $, J, Z, M, N, !0);
|
3108
|
+
this._drawDownIcon(t, y, V, S, Z, M, B), t.save(), t.translateWithPrecision(y.startX + g, y.startY + I), t.beginPath(), t.rect(0, 0, V - g - _, S - I - $), t.clip(), t.translateWithPrecision(0, L), t.save(), t.translateWithPrecision(Et, 0), t.beginPath(), t.rect(0, 0, b, Z), t.clip(), X.render(t), t.translateWithPrecision(E, 0), t.restore(), t.restore(), x.set(O, {
|
3109
|
+
left: y.endX + g + o.rowHeaderWidth - ht,
|
3110
|
+
top: y.startY + I + o.columnHeaderHeight,
|
3095
3111
|
width: ht,
|
3096
|
-
height: S - I -
|
3112
|
+
height: S - I - $
|
3097
3113
|
});
|
3098
3114
|
} else {
|
3099
3115
|
t.save(), t.translateWithPrecision(y.startX, y.startY), t.beginPath(), t.rect(0, 0, V, S), t.clip();
|
3100
|
-
const g = V - ft * 2 -
|
3101
|
-
A === _t.WRAP &&
|
3102
|
-
const b =
|
3116
|
+
const g = V - ft * 2 - Et - ht - 4, { documentSkeleton: I, documents: _, docModel: $ } = pe(P, this._localeService, r);
|
3117
|
+
A === _t.WRAP && $.updateDocumentDataPageSize(Math.max(g, 1)), I.calculate();
|
3118
|
+
const b = Qt(I), { height: U, width: X } = b, { paddingTop: K, paddingLeft: G } = kn(g, S, X, U, M, N);
|
3103
3119
|
t.translateWithPrecision(ft, K);
|
3104
|
-
const Z = Math.max(V - ft * 2, 1), J =
|
3105
|
-
|
3120
|
+
const Z = Math.max(V - ft * 2, 1), J = U;
|
3121
|
+
zn.drawWith(t, {
|
3106
3122
|
width: Z,
|
3107
3123
|
height: J,
|
3108
|
-
fill: (j == null ? void 0 : j.color) ||
|
3109
|
-
radius:
|
3110
|
-
}), t.save(), t.translateWithPrecision(
|
3111
|
-
left: y.startX + ft +
|
3112
|
-
top: y.startY + K +
|
3124
|
+
fill: (j == null ? void 0 : j.color) || Pt,
|
3125
|
+
radius: We
|
3126
|
+
}), t.save(), t.translateWithPrecision(Et, 0), t.beginPath(), t.rect(0, 0, g, U), t.clip(), t.translateWithPrecision(G, 0), _.render(t), t.restore(), t.translateWithPrecision(g + Et + 4, (U - fe) / 2), t.fillStyle = _s, t.fill(Un), t.restore(), x.set(O, {
|
3127
|
+
left: y.startX + ft + o.rowHeaderWidth,
|
3128
|
+
top: y.startY + K + o.columnHeaderHeight,
|
3113
3129
|
width: Z,
|
3114
3130
|
height: J
|
3115
3131
|
});
|
@@ -3117,42 +3133,42 @@ let rn = class {
|
|
3117
3133
|
}
|
3118
3134
|
calcCellAutoHeight(t) {
|
3119
3135
|
var S;
|
3120
|
-
const { primaryWithCoord: e, style:
|
3136
|
+
const { primaryWithCoord: e, style: o, data: n } = t, a = e.isMergedMainCell ? e.mergeInfo : e, i = n.fontRenderExtension, { leftOffset: r = 0, rightOffset: l = 0, topOffset: s = 0, downOffset: c = 0 } = i || {}, u = (S = n.dataValidation) == null ? void 0 : S.rule;
|
3121
3137
|
if (!u || u.renderMode === dt.TEXT)
|
3122
3138
|
return;
|
3123
3139
|
const h = {
|
3124
|
-
startX:
|
3125
|
-
endX:
|
3126
|
-
startY:
|
3127
|
-
endY:
|
3140
|
+
startX: a.startX + r,
|
3141
|
+
endX: a.endX - l,
|
3142
|
+
startY: a.startY + s,
|
3143
|
+
endY: a.endY - c
|
3128
3144
|
}, d = h.endX - h.startX, C = st(n), m = `${C != null ? C : ""}`;
|
3129
|
-
let { tb: f, pd: D } =
|
3145
|
+
let { tb: f, pd: D } = o || {};
|
3130
3146
|
const { t: y = lt.pd.t, b: V = lt.pd.b } = D != null ? D : {};
|
3131
3147
|
if (f = f != null ? f : _t.WRAP, u.renderMode === dt.ARROW) {
|
3132
|
-
const x = d - ht, { documentSkeleton:
|
3133
|
-
f === _t.WRAP &&
|
3134
|
-
const R =
|
3135
|
-
return P + y + V +
|
3148
|
+
const x = d - ht, { documentSkeleton: O, docModel: T } = pe(m, this._localeService, o);
|
3149
|
+
f === _t.WRAP && T.updateDocumentDataPageSize(Math.max(x, 1)), O.calculate(), O.getActualSize();
|
3150
|
+
const R = Qt(O), { height: P } = R;
|
3151
|
+
return P + y + V + Bt * 2;
|
3136
3152
|
} else {
|
3137
|
-
const x = d - ft * 2 -
|
3138
|
-
f === _t.WRAP &&
|
3139
|
-
const R =
|
3153
|
+
const x = d - ft * 2 - Et - ht, { documentSkeleton: O, docModel: T } = Ho(m, this._localeService, o);
|
3154
|
+
f === _t.WRAP && T.updateDocumentDataPageSize(Math.max(x, 1)), O.calculate();
|
3155
|
+
const R = Qt(O), {
|
3140
3156
|
height: P
|
3141
3157
|
} = R;
|
3142
|
-
return P +
|
3158
|
+
return P + Bt * 2;
|
3143
3159
|
}
|
3144
3160
|
}
|
3145
3161
|
calcCellAutoWidth(t) {
|
3146
3162
|
var P;
|
3147
|
-
const { primaryWithCoord: e, style:
|
3163
|
+
const { primaryWithCoord: e, style: o, data: n } = t, a = e.isMergedMainCell ? e.mergeInfo : e, i = n.fontRenderExtension, { leftOffset: r = 0, rightOffset: l = 0, topOffset: s = 0, downOffset: c = 0 } = i || {}, u = (P = n.dataValidation) == null ? void 0 : P.rule;
|
3148
3164
|
if (!u || u.renderMode === dt.TEXT) return;
|
3149
3165
|
const h = {
|
3150
|
-
startX:
|
3151
|
-
endX:
|
3152
|
-
startY:
|
3153
|
-
endY:
|
3166
|
+
startX: a.startX + r,
|
3167
|
+
endX: a.endX - l,
|
3168
|
+
startY: a.startY + s,
|
3169
|
+
endY: a.endY - c
|
3154
3170
|
}, d = h.endX - h.startX, C = st(n), m = `${C != null ? C : ""}`;
|
3155
|
-
let { tb: f, pd: D } =
|
3171
|
+
let { tb: f, pd: D } = o || {};
|
3156
3172
|
const { l: y = lt.pd.l, r: V = lt.pd.r } = D != null ? D : {};
|
3157
3173
|
f = f != null ? f : _t.WRAP;
|
3158
3174
|
let S = ft * 2 + ht;
|
@@ -3161,16 +3177,16 @@ let rn = class {
|
|
3161
3177
|
S = ht + ft * 2 + V + y;
|
3162
3178
|
break;
|
3163
3179
|
case dt.CUSTOM:
|
3164
|
-
S = ht + ft * 2 +
|
3180
|
+
S = ht + ft * 2 + Et * 2 + V + y + We / 2 + 1;
|
3165
3181
|
break;
|
3166
3182
|
default:
|
3167
|
-
S = ht + ft * 2 +
|
3183
|
+
S = ht + ft * 2 + Et * 2 + V + y + We / 2 + 1;
|
3168
3184
|
}
|
3169
|
-
const x = d - S, { documentSkeleton:
|
3170
|
-
return f === _t.WRAP &&
|
3185
|
+
const x = d - S, { documentSkeleton: O, docModel: T } = pe(m, this._localeService, o);
|
3186
|
+
return f === _t.WRAP && T.updateDocumentDataPageSize(Math.max(x, 1)), O.calculate(), O.getActualSize(), Qt(O).width + S;
|
3171
3187
|
}
|
3172
3188
|
isHit(t, e) {
|
3173
|
-
const { data:
|
3189
|
+
const { data: o, subUnitId: n, row: a, col: i } = e, l = this._ensureMap(n).get(this._generateKey(a, i)), s = o.dataValidation;
|
3174
3190
|
if (!s || !l || s.rule.renderMode === dt.TEXT)
|
3175
3191
|
return !1;
|
3176
3192
|
const { top: c, left: u, width: h, height: d } = l, { x: C, y: m } = t;
|
@@ -3179,62 +3195,71 @@ let rn = class {
|
|
3179
3195
|
onPointerDown(t, e) {
|
3180
3196
|
if (e.button === 2)
|
3181
3197
|
return;
|
3182
|
-
const { unitId:
|
3183
|
-
unitId:
|
3198
|
+
const { unitId: o, subUnitId: n, row: a, col: i } = t, r = {
|
3199
|
+
unitId: o,
|
3184
3200
|
subUnitId: n,
|
3185
|
-
row:
|
3201
|
+
row: a,
|
3186
3202
|
column: i
|
3187
3203
|
};
|
3188
|
-
this._commandService.executeCommand(
|
3204
|
+
this._commandService.executeCommand(Pe.id, r);
|
3205
|
+
}
|
3206
|
+
onPointerEnter(t, e) {
|
3207
|
+
var o, n;
|
3208
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.POINTER);
|
3209
|
+
}
|
3210
|
+
onPointerLeave(t, e) {
|
3211
|
+
var o, n;
|
3212
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Q.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Yt.DEFAULT);
|
3189
3213
|
}
|
3190
3214
|
};
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3215
|
+
ln = vs([
|
3216
|
+
He(0, Y(ot)),
|
3217
|
+
He(1, at),
|
3218
|
+
He(2, Y(Rt))
|
3219
|
+
], ln);
|
3220
|
+
class Cs extends mt {
|
3196
3221
|
constructor() {
|
3197
3222
|
super(...arguments);
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3223
|
+
k(this, "id", nt.LIST);
|
3224
|
+
k(this, "canvasRender", this.injector.createInstance(ln));
|
3225
|
+
k(this, "dropdown", Dn);
|
3226
|
+
k(this, "optionsInput", ye.componentKey);
|
3227
|
+
k(this, "formulaInput", Rn);
|
3203
3228
|
}
|
3204
3229
|
}
|
3205
|
-
class
|
3230
|
+
class ws extends mt {
|
3206
3231
|
constructor() {
|
3207
3232
|
super(...arguments);
|
3208
|
-
|
3209
|
-
|
3233
|
+
k(this, "id", nt.TEXT_LENGTH);
|
3234
|
+
k(this, "formulaInput", Le);
|
3210
3235
|
}
|
3211
3236
|
}
|
3212
|
-
class
|
3237
|
+
class Is extends mt {
|
3213
3238
|
constructor() {
|
3214
3239
|
super(...arguments);
|
3215
|
-
|
3216
|
-
|
3240
|
+
k(this, "id", nt.WHOLE);
|
3241
|
+
k(this, "formulaInput", Le);
|
3217
3242
|
}
|
3218
3243
|
}
|
3219
|
-
var
|
3220
|
-
for (var
|
3221
|
-
(r = t[i]) && (
|
3222
|
-
return n &&
|
3223
|
-
},
|
3224
|
-
let
|
3225
|
-
constructor(t, e,
|
3226
|
-
super(), this._injector = t, this._componentManger = e, this._dataValidatorRegistryService =
|
3244
|
+
var Ds = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, ys = (t, e, o, n) => {
|
3245
|
+
for (var a = n > 1 ? void 0 : n ? Rs(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
3246
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3247
|
+
return n && a && Ds(e, o, a), a;
|
3248
|
+
}, Ye = (t, e) => (o, n) => e(o, n, t);
|
3249
|
+
let Zt = class extends cn {
|
3250
|
+
constructor(t, e, o) {
|
3251
|
+
super(), this._injector = t, this._componentManger = e, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
3227
3252
|
}
|
3228
3253
|
_initComponents() {
|
3229
3254
|
[
|
3230
|
-
[
|
3231
|
-
[
|
3232
|
-
[
|
3233
|
-
[
|
3234
|
-
[
|
3235
|
-
[
|
3236
|
-
[
|
3237
|
-
...
|
3255
|
+
[Lo, Ro],
|
3256
|
+
[Cn, sr],
|
3257
|
+
[Eo, Vi],
|
3258
|
+
[Dn, Ui],
|
3259
|
+
[$o, ui],
|
3260
|
+
[ye.componentKey, ye],
|
3261
|
+
[Ve.componentKey, Ve],
|
3262
|
+
...Yr
|
3238
3263
|
].forEach(([t, e]) => {
|
3239
3264
|
this.disposeWithMe(this._componentManger.register(
|
3240
3265
|
t,
|
@@ -3244,137 +3269,137 @@ let Kt = class extends ln {
|
|
3244
3269
|
}
|
3245
3270
|
_registerValidatorViews() {
|
3246
3271
|
[
|
3247
|
-
|
3272
|
+
is,
|
3273
|
+
Is,
|
3248
3274
|
ws,
|
3275
|
+
as,
|
3276
|
+
es,
|
3249
3277
|
Cs,
|
3250
|
-
|
3251
|
-
|
3252
|
-
Ss,
|
3253
|
-
fs,
|
3254
|
-
ts
|
3278
|
+
ps,
|
3279
|
+
ns
|
3255
3280
|
].forEach((t) => {
|
3256
|
-
const e = this._injector.createInstance(t),
|
3257
|
-
|
3281
|
+
const e = this._injector.createInstance(t), o = this._dataValidatorRegistryService.getValidatorItem(e.id);
|
3282
|
+
o && (o.formulaInput = e.formulaInput, o.canvasRender = e.canvasRender, o.dropdown = e.dropdown, o.optionsInput = e.optionsInput);
|
3258
3283
|
});
|
3259
3284
|
}
|
3260
3285
|
};
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
|
3265
|
-
],
|
3266
|
-
var
|
3267
|
-
for (var
|
3268
|
-
(r = t[i]) && (
|
3269
|
-
return n &&
|
3270
|
-
},
|
3271
|
-
const
|
3272
|
-
var
|
3273
|
-
let
|
3274
|
-
constructor(t =
|
3275
|
-
super(), this._config = t, this._injector = e, this._commandService =
|
3276
|
-
const { menu:
|
3277
|
-
|
3286
|
+
Zt = ys([
|
3287
|
+
Ye(0, Y(jt)),
|
3288
|
+
Ye(1, Y(Ee)),
|
3289
|
+
Ye(2, Y(Vt))
|
3290
|
+
], Zt);
|
3291
|
+
var Vs = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, bs = (t, e, o, n) => {
|
3292
|
+
for (var a = n > 1 ? void 0 : n ? Ms(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
3293
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3294
|
+
return n && a && Vs(e, o, a), a;
|
3295
|
+
}, Xe = (t, e) => (o, n) => e(o, n, t);
|
3296
|
+
const Es = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
3297
|
+
var me;
|
3298
|
+
let Bn = (me = class extends Xn {
|
3299
|
+
constructor(t = Po, e, o, n) {
|
3300
|
+
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
3301
|
+
const { menu: a, ...i } = this._config;
|
3302
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(In, i);
|
3278
3303
|
}
|
3279
3304
|
onStarting() {
|
3280
3305
|
[
|
3281
3306
|
[pt],
|
3282
3307
|
[Ct],
|
3283
|
-
[
|
3284
|
-
[Ht],
|
3285
|
-
[zt],
|
3308
|
+
[re],
|
3286
3309
|
[Xt],
|
3287
|
-
[
|
3288
|
-
[
|
3289
|
-
[
|
3310
|
+
[Gt],
|
3311
|
+
[Kt],
|
3312
|
+
[zt],
|
3313
|
+
[ie],
|
3314
|
+
[Zt]
|
3290
3315
|
].forEach((t) => {
|
3291
3316
|
this._injector.add(t);
|
3292
3317
|
}), [
|
3293
3318
|
$e,
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
|
3298
|
-
|
3319
|
+
Pe,
|
3320
|
+
To,
|
3321
|
+
wn,
|
3322
|
+
Nt,
|
3323
|
+
Oo
|
3299
3324
|
].forEach((t) => {
|
3300
3325
|
this._commandService.registerCommand(t);
|
3301
3326
|
});
|
3302
3327
|
}
|
3303
3328
|
onReady() {
|
3304
|
-
this._injector.get(
|
3305
|
-
|
3306
|
-
[
|
3329
|
+
this._injector.get(zt), this._injector.get(Kt), this._injector.get(ie), this._injector.get(re), this._injector.get(Rt).registerRenderModule(
|
3330
|
+
Q.UNIVER_SHEET,
|
3331
|
+
[Re]
|
3307
3332
|
);
|
3308
3333
|
}
|
3309
3334
|
onRendered() {
|
3310
|
-
this._injector.get(
|
3335
|
+
this._injector.get(Zt), this._injector.get(Gt);
|
3311
3336
|
}
|
3312
3337
|
onSteady() {
|
3313
|
-
this._injector.get(
|
3314
|
-
}
|
3315
|
-
},
|
3316
|
-
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
],
|
3321
|
-
var Os = Object.defineProperty,
|
3322
|
-
for (var
|
3323
|
-
(r = t[i]) && (
|
3324
|
-
return n &&
|
3325
|
-
},
|
3326
|
-
const
|
3327
|
-
var
|
3328
|
-
let
|
3329
|
-
constructor(t =
|
3330
|
-
super(), this._config = t, this._injector = e, this._commandService =
|
3331
|
-
const { menu:
|
3332
|
-
|
3338
|
+
this._injector.get(Xt);
|
3339
|
+
}
|
3340
|
+
}, k(me, "pluginName", Es), k(me, "type", Q.UNIVER_SHEET), me);
|
3341
|
+
Bn = bs([
|
3342
|
+
Xe(1, Y(jt)),
|
3343
|
+
Xe(2, at),
|
3344
|
+
Xe(3, dn)
|
3345
|
+
], Bn);
|
3346
|
+
var Os = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, Ps = (t, e, o, n) => {
|
3347
|
+
for (var a = n > 1 ? void 0 : n ? Ts(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
3348
|
+
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3349
|
+
return n && a && Os(e, o, a), a;
|
3350
|
+
}, ze = (t, e) => (o, n) => e(o, n, t);
|
3351
|
+
const $s = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
3352
|
+
var ge;
|
3353
|
+
let Hn = (ge = class extends Xn {
|
3354
|
+
constructor(t = Po, e, o, n) {
|
3355
|
+
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
3356
|
+
const { menu: a, ...i } = this._config;
|
3357
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(In, i);
|
3333
3358
|
}
|
3334
3359
|
onStarting() {
|
3335
3360
|
[
|
3336
3361
|
[pt],
|
3337
3362
|
[Ct],
|
3338
|
-
[
|
3339
|
-
[Ht],
|
3340
|
-
[zt],
|
3363
|
+
[re],
|
3341
3364
|
[Xt],
|
3342
|
-
[
|
3343
|
-
[Kt]
|
3365
|
+
[Gt],
|
3366
|
+
[Kt],
|
3367
|
+
[zt],
|
3368
|
+
[Zt]
|
3344
3369
|
].forEach((t) => {
|
3345
3370
|
this._injector.add(t);
|
3346
3371
|
}), [
|
3347
3372
|
$e,
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3373
|
+
Pe,
|
3374
|
+
To,
|
3375
|
+
wn,
|
3376
|
+
Nt,
|
3377
|
+
Oo
|
3353
3378
|
].forEach((t) => {
|
3354
3379
|
this._commandService.registerCommand(t);
|
3355
3380
|
});
|
3356
3381
|
}
|
3357
3382
|
onReady() {
|
3358
|
-
this._injector.get(
|
3359
|
-
|
3360
|
-
[
|
3383
|
+
this._injector.get(zt), this._injector.get(Kt), this._injector.get(Rt).registerRenderModule(
|
3384
|
+
Q.UNIVER_SHEET,
|
3385
|
+
[Re]
|
3361
3386
|
);
|
3362
3387
|
}
|
3363
3388
|
onRendered() {
|
3364
|
-
this._injector.get(
|
3389
|
+
this._injector.get(Zt), this._injector.get(Gt);
|
3365
3390
|
}
|
3366
3391
|
onSteady() {
|
3367
|
-
this._injector.get(
|
3368
|
-
}
|
3369
|
-
},
|
3370
|
-
|
3371
|
-
|
3372
|
-
|
3373
|
-
|
3374
|
-
],
|
3392
|
+
this._injector.get(Xt);
|
3393
|
+
}
|
3394
|
+
}, k(ge, "pluginName", $s), k(ge, "type", Q.UNIVER_SHEET), ge);
|
3395
|
+
Hn = Ps([
|
3396
|
+
ze(1, Y(jt)),
|
3397
|
+
ze(2, at),
|
3398
|
+
ze(3, dn)
|
3399
|
+
], Hn);
|
3375
3400
|
export {
|
3376
|
-
|
3377
|
-
|
3378
|
-
|
3379
|
-
|
3401
|
+
$o as DATE_DROPDOWN_KEY,
|
3402
|
+
Dn as LIST_DROPDOWN_KEY,
|
3403
|
+
Hn as UniverSheetsDataValidationMobileUIPlugin,
|
3404
|
+
Bn as UniverSheetsDataValidationUIPlugin
|
3380
3405
|
};
|