@univerjs/sheets-data-validation-ui 0.5.0-nightly.202411120616 → 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 +1092 -1075
- 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,23 +29,23 @@ var go = { 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
|
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
34
|
var n, a = {}, i = null, r = null;
|
35
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)
|
36
|
+
for (n in e) Qa.call(e, n) && !ei.hasOwnProperty(n) && (a[n] = e[n]);
|
37
37
|
if (t && t.defaultProps) for (n in e = t.defaultProps, e) a[n] === void 0 && (a[n] = e[n]);
|
38
|
-
return { $$typeof:
|
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
46
|
(function(o, n) {
|
47
47
|
t.exports = n();
|
48
|
-
})(
|
48
|
+
})(go, function() {
|
49
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]) + "]";
|
@@ -57,55 +57,55 @@ var p = go.exports, _o = { 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 = go.exports, _o = { 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,27 +160,27 @@ var p = go.exports, _o = { 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
|
182
|
+
if (b === c) return U(1);
|
183
|
+
if (b === u) return U(7);
|
184
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) {
|
@@ -188,17 +188,17 @@ var p = go.exports, _o = { exports: {} };
|
|
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 = go.exports, _o = { 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 = go.exports, _o = { 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 = go.exports, _o = { 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,25 +305,25 @@ var p = go.exports, _o = { 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
324
|
(function(o, n) {
|
325
325
|
t.exports = n();
|
326
|
-
})(
|
326
|
+
})(go, function() {
|
327
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;
|
@@ -351,11 +351,11 @@ var So = { 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;
|
@@ -392,26 +392,26 @@ var So = { exports: {} };
|
|
392
392
|
};
|
393
393
|
};
|
394
394
|
});
|
395
|
-
})(
|
396
|
-
var
|
397
|
-
const
|
398
|
-
var
|
399
|
-
for (var a = n > 1 ? void 0 : n ?
|
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
400
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
401
|
-
return n && a &&
|
402
|
-
},
|
403
|
-
let
|
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
404
|
constructor(t, e, o, n, a) {
|
405
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
411
|
handler: async (t, e, o) => {
|
412
412
|
var f;
|
413
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 !==
|
414
|
+
if (!h || h.errorStyle !== oe.STOP)
|
415
415
|
return o(Promise.resolve(n));
|
416
416
|
const d = await this._dataValidatorRegistryService.getValidatorItem(h.type);
|
417
417
|
if (!d || await d.validator(
|
@@ -437,11 +437,11 @@ let oe = 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")
|
@@ -468,8 +468,8 @@ let oe = 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,38 +483,38 @@ let oe = 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: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = e, c =
|
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,
|
@@ -523,13 +523,13 @@ function di(t) {
|
|
523
523
|
worksheet: n,
|
524
524
|
workbook: s,
|
525
525
|
interceptValue: A.replace("Z", "").replace("T", " "),
|
526
|
-
t:
|
527
|
-
}, d) ? (o(), await c.executeCommand(
|
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: {
|
@@ -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,10 +565,10 @@ 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() {
|
@@ -579,23 +579,23 @@ var ct = function() {
|
|
579
579
|
}
|
580
580
|
return t;
|
581
581
|
}, ct.apply(this, arguments);
|
582
|
-
},
|
582
|
+
}, hi = function(t, e) {
|
583
583
|
var o = {};
|
584
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
586
|
for (var a = 0, n = Object.getOwnPropertySymbols(t); a < n.length; a++)
|
587
587
|
e.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[a]) && (o[n[a]] = t[n[a]]);
|
588
588
|
return o;
|
589
|
-
},
|
590
|
-
var o = t.icon, n = t.id, a = t.className, i = t.extend, r =
|
591
|
-
return
|
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
600
|
o != null && o.colorChannel1 && n.fill === "colorChannel1" && (n.fill = o.colorChannel1);
|
601
601
|
var a = e.defIds;
|
@@ -604,92 +604,92 @@ function ui(t, e, o) {
|
|
604
604
|
typeof l == "string" && (n[r] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
605
605
|
})), n;
|
606
606
|
}
|
607
|
-
function
|
607
|
+
function pi(t, e) {
|
608
608
|
var o, n = e.defIds;
|
609
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
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 a = n > 1 ? void 0 : n ?
|
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
675
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
676
|
-
return n && a &&
|
677
|
-
},
|
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
679
|
constructor(e, o) {
|
680
680
|
super();
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
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
687
|
this._univerInstanceService = e, this._sidebarService = o, this.disposeWithMe(
|
688
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
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,12 +720,12 @@ 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
731
|
const { location: n, componentKey: a } = e, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
@@ -743,20 +743,20 @@ function Ri() {
|
|
743
743
|
r
|
744
744
|
);
|
745
745
|
}
|
746
|
-
const
|
747
|
-
var
|
748
|
-
for (var a = n > 1 ? void 0 : n ?
|
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
749
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
750
|
-
return n && a &&
|
751
|
-
},
|
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
753
|
constructor(e, o, n, a, i, r, l) {
|
754
754
|
super();
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
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
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
|
});
|
@@ -770,7 +770,7 @@ let Ct = class extends Dt {
|
|
770
770
|
}));
|
771
771
|
}
|
772
772
|
_getDropdownByCell(e, o, n, a) {
|
773
|
-
const i = e ? this._univerInstanceService.getUnit(e,
|
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
776
|
const r = o ? i.getSheetBySheetId(o) : i.getActiveSheet();
|
@@ -792,11 +792,11 @@ let Ct = class extends Dt {
|
|
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(
|
795
|
+
const s = this._renderManagerService.getRenderById(Ko), c = this._canvasPopupManagerService.attachPopupToCell(
|
796
796
|
a,
|
797
797
|
i,
|
798
798
|
{
|
799
|
-
componentKey:
|
799
|
+
componentKey: Eo,
|
800
800
|
onClickOutside: () => {
|
801
801
|
o && this.hideDropdown();
|
802
802
|
},
|
@@ -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;
|
@@ -820,7 +820,7 @@ let Ct = class extends Dt {
|
|
820
820
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
821
821
|
}
|
822
822
|
showDataValidationDropdown(e, o, n, a, i) {
|
823
|
-
const r = this._univerInstanceService.getUnit(e,
|
823
|
+
const r = this._univerInstanceService.getUnit(e, Q.UNIVER_SHEET);
|
824
824
|
if (!r)
|
825
825
|
return;
|
826
826
|
const l = r.getSheetBySheetId(o);
|
@@ -848,22 +848,22 @@ let Ct = class extends Dt {
|
|
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: o, isAdd: n } = e, a = t.get(pt), i = t.get(
|
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
868
|
const { unitId: c, subUnitId: u } = s, h = o ? i.getRuleById(c, u, o) : void 0;
|
869
869
|
a.open(), a.setActiveRule(h && {
|
@@ -873,27 +873,27 @@ const _n = "DataValidationPanel", Ft = {
|
|
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
878
|
onClose: () => a.close()
|
879
879
|
});
|
880
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(
|
893
|
-
return o.open(), o.isOpen ? e.executeCommand(
|
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)
|
@@ -906,29 +906,29 @@ const _n = "DataValidationPanel", Ft = {
|
|
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: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = t, u =
|
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
944
|
a.forEach((w) => {
|
945
|
-
|
945
|
+
N.has(w.value) && B.push(w.value);
|
946
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: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = e, s =
|
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,12 +981,12 @@ function Fi(t) {
|
|
981
981
|
};
|
982
982
|
}, [h, D]), !n)
|
983
983
|
return null;
|
984
|
-
const x = n.getCell(a, i),
|
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:
|
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
990
|
}), o();
|
991
991
|
}, B = j.map((b) => ({
|
992
992
|
label: b.label,
|
@@ -994,14 +994,14 @@ function Fi(t) {
|
|
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: {
|
@@ -1011,7 +1011,7 @@ function Fi(t) {
|
|
1011
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,60 +1019,60 @@ 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
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 :
|
1060
|
+
value: `${(c = n.errorStyle) != null ? c : oe.WARNING}`,
|
1061
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
1078
|
onChange: () => a({
|
@@ -1084,91 +1084,91 @@ 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
|
-
},
|
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
1097
|
async (e, o, n, a) => {
|
1098
1098
|
const i = await t.executeCommand(e, o, n);
|
1099
1099
|
a == null || a(i);
|
1100
1100
|
},
|
1101
1101
|
1e3
|
1102
1102
|
);
|
1103
|
-
function
|
1103
|
+
function Gi(t, e, o) {
|
1104
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(
|
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), o =
|
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
1120
|
}, [h, d, l, i, a]), !D)
|
1121
1121
|
return null;
|
1122
|
-
const B = D.operators, w = D.operatorNames, v = m.operator ?
|
1122
|
+
const B = D.operators, w = D.operatorNames, v = m.operator ? Wa.includes(m.operator) : !1, g = () => {
|
1123
1123
|
!m.ranges.length || R || (D.validatorFormula(m, a, i).success ? o.setActiveRule(null) : V(!0));
|
1124
|
-
}, I =
|
1125
|
-
const
|
1126
|
-
const
|
1127
|
-
if (
|
1128
|
-
const
|
1129
|
-
return { ...z, sheetId:
|
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
|
1145
|
+
const F = {
|
1146
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
|
1159
|
+
const E = {
|
1160
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
1173
|
unitId: a,
|
1174
1174
|
subUnitId: i
|
@@ -1179,52 +1179,52 @@ function Ki() {
|
|
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(
|
1196
|
+
f(z), h.executeCommand(Mn.id, {
|
1197
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
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
1229
|
unitId: a,
|
1230
1230
|
subUnitId: i,
|
@@ -1233,38 +1233,38 @@ function Ki() {
|
|
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,10 +1275,10 @@ 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,
|
@@ -1289,35 +1289,35 @@ function Ki() {
|
|
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: o, unitId: n, subUnitId: a, disable: i } = t, r =
|
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
1323
|
subUnitId: a
|
@@ -1331,7 +1331,7 @@ const Gi = "univer-data-validation-item-container", Zi = "univer-data-validation
|
|
1331
1331
|
}, [s]), /* @__PURE__ */ p.jsxs(
|
1332
1332
|
"div",
|
1333
1333
|
{
|
1334
|
-
className:
|
1334
|
+
className: le.dataValidationItemContainer,
|
1335
1335
|
onClick: o,
|
1336
1336
|
onMouseEnter: () => {
|
1337
1337
|
i || (d(!0), u.current = e.ranges.map((m) => s.addShape({
|
@@ -1343,16 +1343,7 @@ const Gi = "univer-data-validation-item-container", Zi = "univer-data-validation
|
|
1343
1343
|
stroke: "#49B811",
|
1344
1344
|
widgets: {}
|
1345
1345
|
},
|
1346
|
-
primary:
|
1347
|
-
startColumn: m.startColumn,
|
1348
|
-
endColumn: m.endColumn,
|
1349
|
-
startRow: m.startRow,
|
1350
|
-
endRow: m.endRow,
|
1351
|
-
actualRow: m.startRow,
|
1352
|
-
actualColumn: m.startColumn,
|
1353
|
-
isMerged: !1,
|
1354
|
-
isMergedMainCell: !1
|
1355
|
-
}
|
1346
|
+
primary: null
|
1356
1347
|
})));
|
1357
1348
|
},
|
1358
1349
|
onMouseLeave: () => {
|
@@ -1362,28 +1353,28 @@ const Gi = "univer-data-validation-item-container", Zi = "univer-data-validation
|
|
1362
1353
|
}), u.current = void 0;
|
1363
1354
|
},
|
1364
1355
|
children: [
|
1365
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
1366
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
1367
|
-
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
|
1368
1359
|
]
|
1369
1360
|
}
|
1370
1361
|
);
|
1371
|
-
},
|
1372
|
-
dataValidationList:
|
1373
|
-
dataValidationListButtons:
|
1374
|
-
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
|
1375
1366
|
};
|
1376
|
-
function
|
1377
|
-
const t =
|
1378
|
-
() => t.getCurrentTypeOfUnit$(
|
1367
|
+
function ir() {
|
1368
|
+
const t = W(gt), e = Ft(
|
1369
|
+
() => t.getCurrentTypeOfUnit$(Q.UNIVER_SHEET),
|
1379
1370
|
void 0,
|
1380
1371
|
void 0,
|
1381
1372
|
[]
|
1382
1373
|
);
|
1383
|
-
return e ? /* @__PURE__ */ p.jsx(
|
1374
|
+
return e ? /* @__PURE__ */ p.jsx(rr, { workbook: e }) : null;
|
1384
1375
|
}
|
1385
|
-
function
|
1386
|
-
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();
|
1387
1378
|
St(() => {
|
1388
1379
|
s(e.getRules(h, d));
|
1389
1380
|
const V = e.ruleChange$.subscribe((S) => {
|
@@ -1394,30 +1385,30 @@ function ar(t) {
|
|
1394
1385
|
};
|
1395
1386
|
}, [h, d, e]);
|
1396
1387
|
const C = async () => {
|
1397
|
-
const V =
|
1388
|
+
const V = no(a), S = {
|
1398
1389
|
unitId: h,
|
1399
1390
|
subUnitId: d,
|
1400
1391
|
rule: V
|
1401
1392
|
};
|
1402
|
-
await n.executeCommand(
|
1393
|
+
await n.executeCommand(pn.id, S), i.setActiveRule({
|
1403
1394
|
unitId: h,
|
1404
1395
|
subUnitId: d,
|
1405
1396
|
rule: V
|
1406
1397
|
});
|
1407
1398
|
}, m = () => {
|
1408
|
-
n.executeCommand(
|
1399
|
+
n.executeCommand(wa.id, {
|
1409
1400
|
unitId: h,
|
1410
1401
|
subUnitId: d
|
1411
1402
|
});
|
1412
1403
|
}, D = ((V) => {
|
1413
|
-
const S = o.getCurrentUnitForType(
|
1414
|
-
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 });
|
1415
1406
|
})(l), y = D == null ? void 0 : D.some((V) => V.disable);
|
1416
|
-
return /* @__PURE__ */ p.jsxs("div", { className:
|
1407
|
+
return /* @__PURE__ */ p.jsxs("div", { className: de.dataValidationList, children: [
|
1417
1408
|
D == null ? void 0 : D.map((V) => {
|
1418
1409
|
var S;
|
1419
1410
|
return /* @__PURE__ */ p.jsx(
|
1420
|
-
|
1411
|
+
er,
|
1421
1412
|
{
|
1422
1413
|
unitId: h,
|
1423
1414
|
subUnitId: d,
|
@@ -1434,39 +1425,39 @@ function ar(t) {
|
|
1434
1425
|
V.uid
|
1435
1426
|
);
|
1436
1427
|
}),
|
1437
|
-
/* @__PURE__ */ p.jsxs("div", { className:
|
1438
|
-
l.length && !y ? /* @__PURE__ */ p.jsx(
|
1439
|
-
/* @__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") })
|
1440
1431
|
] })
|
1441
1432
|
] });
|
1442
1433
|
}
|
1443
|
-
const
|
1444
|
-
const t =
|
1445
|
-
return e ? /* @__PURE__ */ p.jsx(
|
1446
|
-
},
|
1447
|
-
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,
|
1448
1439
|
id: "data-validation.command.addRuleAndOpen",
|
1449
1440
|
handler(t) {
|
1450
|
-
const e = t.get(gt), o =
|
1441
|
+
const e = t.get(gt), o = Gn(e);
|
1451
1442
|
if (!o) return !1;
|
1452
|
-
const { workbook: n, worksheet: a } = o, i =
|
1443
|
+
const { workbook: n, worksheet: a } = o, i = no(t), r = t.get(at), l = n.getUnitId(), s = a.getSheetId(), c = {
|
1453
1444
|
rule: i,
|
1454
1445
|
unitId: l,
|
1455
1446
|
subUnitId: s
|
1456
1447
|
};
|
1457
|
-
return r.syncExecuteCommand(
|
1448
|
+
return r.syncExecuteCommand(pn.id, c) ? (r.syncExecuteCommand(Nt.id, {
|
1458
1449
|
ruleId: i.uid,
|
1459
1450
|
isAdd: !0
|
1460
1451
|
}), !0) : !1;
|
1461
1452
|
}
|
1462
1453
|
};
|
1463
|
-
var
|
1464
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
1465
1456
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1466
|
-
return n && a &&
|
1467
|
-
},
|
1468
|
-
const
|
1469
|
-
let
|
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 {
|
1470
1461
|
constructor(t, e, o, n, a) {
|
1471
1462
|
super(), this._hoverManagerService = t, this._cellAlertManagerService = e, this._univerInstanceService = o, this._localeService = n, this._zenZoneService = a, this._init();
|
1472
1463
|
}
|
@@ -1474,63 +1465,63 @@ let ae = class extends Dt {
|
|
1474
1465
|
this._initCellAlertPopup(), this._initZenService();
|
1475
1466
|
}
|
1476
1467
|
_initCellAlertPopup() {
|
1477
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1468
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(_n(100)).subscribe((t) => {
|
1478
1469
|
var e, o;
|
1479
1470
|
if (t) {
|
1480
|
-
const a = this._univerInstanceService.getCurrentUnitForType(
|
1471
|
+
const a = this._univerInstanceService.getCurrentUnitForType(Q.UNIVER_SHEET).getActiveSheet();
|
1481
1472
|
if (!a) return;
|
1482
1473
|
const i = a.getCell(t.location.row, t.location.col);
|
1483
|
-
if (((e = i == null ? void 0 : i.dataValidation) == null ? void 0 : e.validStatus) ===
|
1484
|
-
const r = this._cellAlertManagerService.currentAlert.get(
|
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;
|
1485
1476
|
if (l && l.row === t.location.row && l.col === t.location.col && l.subUnitId === t.location.subUnitId && l.unitId === t.location.unitId)
|
1486
1477
|
return;
|
1487
1478
|
const s = i.dataValidation.validator, c = i.dataValidation.rule;
|
1488
1479
|
if (!s)
|
1489
1480
|
return;
|
1490
1481
|
this._cellAlertManagerService.showAlert({
|
1491
|
-
type:
|
1482
|
+
type: Pa.ERROR,
|
1492
1483
|
title: this._localeService.t("dataValidation.error.title"),
|
1493
|
-
message: s == null ? void 0 : s.getRuleFinalError(c),
|
1484
|
+
message: s == null ? void 0 : s.getRuleFinalError(c, t.location),
|
1494
1485
|
location: t.location,
|
1495
1486
|
width: 200,
|
1496
1487
|
height: 74,
|
1497
|
-
key:
|
1488
|
+
key: ce
|
1498
1489
|
});
|
1499
1490
|
return;
|
1500
1491
|
}
|
1501
1492
|
}
|
1502
|
-
this._cellAlertManagerService.removeAlert(
|
1493
|
+
this._cellAlertManagerService.removeAlert(ce);
|
1503
1494
|
}));
|
1504
1495
|
}
|
1505
1496
|
_initZenService() {
|
1506
1497
|
this.disposeWithMe(this._zenZoneService.visible$.subscribe((t) => {
|
1507
|
-
t && this._cellAlertManagerService.removeAlert(
|
1498
|
+
t && this._cellAlertManagerService.removeAlert(ce);
|
1508
1499
|
}));
|
1509
1500
|
}
|
1510
1501
|
};
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
],
|
1518
|
-
var
|
1519
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
1520
1511
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1521
|
-
return n && a &&
|
1522
|
-
},
|
1523
|
-
let
|
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 {
|
1524
1515
|
constructor(t, e, o) {
|
1525
1516
|
super(), this._autoFillService = t, this._dataValidationModel = e, this._injector = o, this._initAutoFill();
|
1526
1517
|
}
|
1527
1518
|
// eslint-disable-next-line max-lines-per-function
|
1528
1519
|
_initAutoFill() {
|
1529
1520
|
const t = () => ({ redos: [], undos: [] }), e = (a, i) => {
|
1530
|
-
const { source: r, target: l, unitId: s, subUnitId: c } = a, u = this._dataValidationModel.getRuleObjectMatrix(s, c).clone(), h =
|
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 = {
|
1531
1522
|
row: d.startRow,
|
1532
1523
|
col: d.startColumn
|
1533
|
-
}, D =
|
1524
|
+
}, D = La(d, C), y = new ve(), V = /* @__PURE__ */ new Set();
|
1534
1525
|
D.forEach((R) => {
|
1535
1526
|
const P = R.repeatStartCell, j = R.relativeRange, A = {
|
1536
1527
|
startRow: f.row,
|
@@ -1543,93 +1534,93 @@ let Ht = class extends Dt {
|
|
1543
1534
|
endColumn: P.col,
|
1544
1535
|
endRow: P.row
|
1545
1536
|
};
|
1546
|
-
|
1547
|
-
const w =
|
1537
|
+
ea.foreach(j, (N, B) => {
|
1538
|
+
const w = _e.getPositionRange(
|
1548
1539
|
{
|
1549
|
-
startRow:
|
1540
|
+
startRow: N,
|
1550
1541
|
startColumn: B,
|
1551
1542
|
endColumn: B,
|
1552
|
-
endRow:
|
1543
|
+
endRow: N
|
1553
1544
|
},
|
1554
1545
|
A
|
1555
1546
|
), { row: v, col: g } = m(w.startRow, w.startColumn), I = this._dataValidationModel.getRuleIdByLocation(s, c, v, g);
|
1556
1547
|
if (I) {
|
1557
|
-
const _ =
|
1548
|
+
const _ = _e.getPositionRange(
|
1558
1549
|
{
|
1559
|
-
startRow:
|
1550
|
+
startRow: N,
|
1560
1551
|
startColumn: B,
|
1561
1552
|
endColumn: B,
|
1562
|
-
endRow:
|
1553
|
+
endRow: N
|
1563
1554
|
},
|
1564
1555
|
M
|
1565
|
-
), { row:
|
1566
|
-
y.setValue(
|
1556
|
+
), { row: $, col: b } = m(_.startRow, _.startColumn);
|
1557
|
+
y.setValue($, b, I), V.add(I);
|
1567
1558
|
}
|
1568
1559
|
});
|
1569
1560
|
});
|
1570
|
-
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) }));
|
1571
1562
|
u.addRangeRules(S);
|
1572
|
-
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);
|
1573
1564
|
return {
|
1574
|
-
undos:
|
1575
|
-
redos:
|
1565
|
+
undos: T,
|
1566
|
+
redos: O
|
1576
1567
|
};
|
1577
1568
|
}, o = [
|
1578
|
-
|
1569
|
+
nt.CHECKBOX
|
1579
1570
|
], n = {
|
1580
|
-
id:
|
1571
|
+
id: oo,
|
1581
1572
|
onBeforeFillData: (a) => {
|
1582
1573
|
const { source: i, unitId: r, subUnitId: l } = a;
|
1583
1574
|
for (const s of i.rows)
|
1584
1575
|
for (const c of i.cols) {
|
1585
1576
|
const u = this._dataValidationModel.getRuleByLocation(r, l, s, c);
|
1586
1577
|
if (u && o.indexOf(u.type) > -1) {
|
1587
|
-
this._autoFillService.setDisableApplyType(
|
1578
|
+
this._autoFillService.setDisableApplyType(te.SERIES, !0);
|
1588
1579
|
return;
|
1589
1580
|
}
|
1590
1581
|
}
|
1591
1582
|
},
|
1592
|
-
onFillData: (a, i, r) => r ===
|
1583
|
+
onFillData: (a, i, r) => r === te.COPY || r === te.ONLY_FORMAT || r === te.SERIES ? e(a, r) : t(),
|
1593
1584
|
onAfterFillData: () => {
|
1594
1585
|
}
|
1595
1586
|
};
|
1596
1587
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
1597
1588
|
}
|
1598
1589
|
};
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
],
|
1604
|
-
var
|
1605
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
1606
1597
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1607
|
-
return n && a &&
|
1608
|
-
},
|
1609
|
-
let
|
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 {
|
1610
1601
|
constructor(e, o, n) {
|
1611
1602
|
super();
|
1612
|
-
|
1603
|
+
k(this, "_copyInfo");
|
1613
1604
|
this._sheetClipboardService = e, this._sheetDataValidationModel = o, this._injector = n, this._initCopyPaste();
|
1614
1605
|
}
|
1615
1606
|
_initCopyPaste() {
|
1616
1607
|
this._sheetClipboardService.addClipboardHook({
|
1617
|
-
id:
|
1608
|
+
id: oo,
|
1618
1609
|
onBeforeCopy: (e, o, n) => this._collect(e, o, n),
|
1619
1610
|
onPasteCells: (e, o, n, a) => {
|
1620
|
-
const { copyType: i =
|
1611
|
+
const { copyType: i = En.COPY, pasteType: r } = a, { range: l } = e || {}, { range: s, unitId: c, subUnitId: u } = o;
|
1621
1612
|
return this._generateMutations(s, { copyType: i, pasteType: r, copyRange: l, unitId: c, subUnitId: u });
|
1622
1613
|
}
|
1623
1614
|
});
|
1624
1615
|
}
|
1625
1616
|
_collect(e, o, n) {
|
1626
|
-
const a = new
|
1617
|
+
const a = new ve();
|
1627
1618
|
this._copyInfo = {
|
1628
1619
|
unitId: e,
|
1629
1620
|
subUnitId: o,
|
1630
1621
|
matrix: a
|
1631
1622
|
};
|
1632
|
-
const i = this._injector.invoke((s) =>
|
1623
|
+
const i = this._injector.invoke((s) => xa(n, s, e, o));
|
1633
1624
|
if (!i)
|
1634
1625
|
return;
|
1635
1626
|
const { rows: r, cols: l } = i;
|
@@ -1644,26 +1635,26 @@ let Yt = class extends Dt {
|
|
1644
1635
|
_generateMutations(e, o) {
|
1645
1636
|
if (!this._copyInfo)
|
1646
1637
|
return { redos: [], undos: [] };
|
1647
|
-
if (o.copyType ===
|
1638
|
+
if (o.copyType === En.CUT)
|
1648
1639
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1649
1640
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
|
1650
1641
|
return { redos: [], undos: [] };
|
1651
1642
|
if ([
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1643
|
+
se.SPECIAL_PASTE_COL_WIDTH,
|
1644
|
+
se.SPECIAL_PASTE_VALUE,
|
1645
|
+
se.SPECIAL_PASTE_FORMAT,
|
1646
|
+
se.SPECIAL_PASTE_FORMULA
|
1656
1647
|
].includes(
|
1657
1648
|
o.pasteType
|
1658
1649
|
))
|
1659
1650
|
return { redos: [], undos: [] };
|
1660
1651
|
const { unitId: n, subUnitId: a } = this._copyInfo;
|
1661
1652
|
if (o.unitId !== n || a !== o.subUnitId) {
|
1662
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), r = new
|
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();
|
1663
1654
|
h.forEach(({ startRange: D }) => {
|
1664
1655
|
var y;
|
1665
1656
|
(y = this._copyInfo) == null || y.matrix.forValue((V, S, x) => {
|
1666
|
-
const
|
1657
|
+
const O = _e.getPositionRange(
|
1667
1658
|
{
|
1668
1659
|
startRow: V,
|
1669
1660
|
endRow: V,
|
@@ -1671,15 +1662,15 @@ let Yt = class extends Dt {
|
|
1671
1662
|
endColumn: S
|
1672
1663
|
},
|
1673
1664
|
D
|
1674
|
-
),
|
1675
|
-
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId,
|
1676
|
-
const { row: P, col: j } = u(
|
1677
|
-
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);
|
1678
1669
|
});
|
1679
1670
|
});
|
1680
|
-
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) }));
|
1681
1672
|
i.addRangeRules(C);
|
1682
|
-
const { redoMutations: m, undoMutations: f } =
|
1673
|
+
const { redoMutations: m, undoMutations: f } = en(
|
1683
1674
|
o.unitId,
|
1684
1675
|
o.subUnitId,
|
1685
1676
|
i.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), d.values()),
|
@@ -1692,11 +1683,11 @@ let Yt = class extends Dt {
|
|
1692
1683
|
undos: f
|
1693
1684
|
};
|
1694
1685
|
} else {
|
1695
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n, a).clone(), r = new
|
1696
|
-
|
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 }) => {
|
1697
1688
|
var D;
|
1698
1689
|
(D = this._copyInfo) == null || D.matrix.forValue((y, V, S) => {
|
1699
|
-
const x =
|
1690
|
+
const x = _e.getPositionRange(
|
1700
1691
|
{
|
1701
1692
|
startRow: y,
|
1702
1693
|
endRow: y,
|
@@ -1704,13 +1695,13 @@ let Yt = class extends Dt {
|
|
1704
1695
|
endColumn: V
|
1705
1696
|
},
|
1706
1697
|
f
|
1707
|
-
), { row:
|
1708
|
-
r.setValue(
|
1698
|
+
), { row: O, col: T } = u(x.startRow, x.startColumn);
|
1699
|
+
r.setValue(O, T, S), l.add(S);
|
1709
1700
|
});
|
1710
1701
|
});
|
1711
|
-
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) }));
|
1712
1703
|
i.addRangeRules(d);
|
1713
|
-
const { redoMutations: C, undoMutations: m } =
|
1704
|
+
const { redoMutations: C, undoMutations: m } = en(
|
1714
1705
|
n,
|
1715
1706
|
a,
|
1716
1707
|
i.diff(this._sheetDataValidationModel.getRules(n, a)),
|
@@ -1725,99 +1716,99 @@ let Yt = class extends Dt {
|
|
1725
1716
|
}
|
1726
1717
|
}
|
1727
1718
|
};
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
],
|
1733
|
-
var
|
1734
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
1735
1726
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1736
|
-
return n && a &&
|
1737
|
-
},
|
1738
|
-
let
|
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 {
|
1739
1730
|
constructor(t, e, o) {
|
1740
1731
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController = o, this._commandExecutedListener();
|
1741
1732
|
}
|
1742
1733
|
_commandExecutedListener() {
|
1743
1734
|
this.disposeWithMe(
|
1744
1735
|
this._commandService.beforeCommandExecuted((t) => {
|
1745
|
-
t.id ===
|
1746
|
-
workbookTypes: [
|
1747
|
-
rangeTypes: [
|
1748
|
-
worksheetTypes: [
|
1749
|
-
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), t.id ===
|
1750
|
-
workbookTypes: [
|
1751
|
-
rangeTypes: [
|
1752
|
-
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]
|
1753
1744
|
}, t.params.ranges) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")));
|
1754
1745
|
})
|
1755
1746
|
);
|
1756
1747
|
}
|
1757
1748
|
};
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
],
|
1763
|
-
const
|
1764
|
-
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) {
|
1765
1756
|
return {
|
1766
|
-
id:
|
1767
|
-
type:
|
1768
|
-
icon:
|
1757
|
+
id: xo,
|
1758
|
+
type: gn.SUBITEMS,
|
1759
|
+
icon: Lo,
|
1769
1760
|
tooltip: "dataValidation.title",
|
1770
|
-
hidden$:
|
1771
|
-
disabled$:
|
1761
|
+
hidden$: Ua(t, Q.UNIVER_SHEET),
|
1762
|
+
disabled$: ja(t, { workbookTypes: [Se], worksheetTypes: [tn, we], rangeTypes: [Ce] })
|
1772
1763
|
};
|
1773
1764
|
}
|
1774
|
-
function
|
1765
|
+
function wr(t) {
|
1775
1766
|
return {
|
1776
|
-
id:
|
1767
|
+
id: Nt.id,
|
1777
1768
|
title: "dataValidation.panel.title",
|
1778
|
-
type:
|
1769
|
+
type: gn.BUTTON
|
1779
1770
|
};
|
1780
1771
|
}
|
1781
|
-
function
|
1772
|
+
function Ir(t) {
|
1782
1773
|
return {
|
1783
1774
|
id: $e.id,
|
1784
1775
|
title: "dataValidation.panel.add",
|
1785
|
-
type:
|
1776
|
+
type: gn.BUTTON
|
1786
1777
|
};
|
1787
1778
|
}
|
1788
|
-
const
|
1789
|
-
[
|
1790
|
-
[
|
1779
|
+
const Dr = {
|
1780
|
+
[ka.FORMULAS_INSERT]: {
|
1781
|
+
[xo]: {
|
1791
1782
|
order: 9,
|
1792
|
-
menuItemFactory:
|
1793
|
-
[
|
1783
|
+
menuItemFactory: Cr,
|
1784
|
+
[Nt.id]: {
|
1794
1785
|
order: 0,
|
1795
|
-
menuItemFactory:
|
1786
|
+
menuItemFactory: wr
|
1796
1787
|
},
|
1797
1788
|
[$e.id]: {
|
1798
1789
|
order: 1,
|
1799
|
-
menuItemFactory:
|
1790
|
+
menuItemFactory: Ir
|
1800
1791
|
}
|
1801
1792
|
}
|
1802
1793
|
}
|
1803
1794
|
};
|
1804
|
-
var
|
1805
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
1806
1797
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
1807
|
-
return n && a &&
|
1808
|
-
},
|
1809
|
-
const
|
1798
|
+
return n && a && Rr(e, o, a), a;
|
1799
|
+
}, tt = (t, e) => (o, n) => e(o, n, t);
|
1800
|
+
const jo = {
|
1810
1801
|
tr: {
|
1811
1802
|
size: 6,
|
1812
1803
|
color: "#fe4b4b"
|
1813
1804
|
}
|
1814
1805
|
};
|
1815
|
-
let
|
1806
|
+
let Gt = class extends cn {
|
1816
1807
|
constructor(t, e, o, n, a, i, r, l, s, c, u) {
|
1817
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();
|
1818
1809
|
}
|
1819
1810
|
_initMenu() {
|
1820
|
-
this._menuManagerService.mergeMenu(
|
1811
|
+
this._menuManagerService.mergeMenu(Dr);
|
1821
1812
|
}
|
1822
1813
|
_initDropdown() {
|
1823
1814
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((t) => {
|
@@ -1866,21 +1857,21 @@ let zt = class extends ln {
|
|
1866
1857
|
_initViewModelIntercept() {
|
1867
1858
|
this.disposeWithMe(
|
1868
1859
|
this._sheetInterceptorService.intercept(
|
1869
|
-
|
1860
|
+
Zn.CELL_CONTENT,
|
1870
1861
|
{
|
1871
|
-
effect:
|
1862
|
+
effect: Wn.Style,
|
1872
1863
|
// must be after numfmt
|
1873
|
-
priority:
|
1864
|
+
priority: qn.DATA_VALIDATION,
|
1874
1865
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1875
1866
|
handler: (t, e, o) => {
|
1876
|
-
var y, V, S, x,
|
1867
|
+
var y, V, S, x, O, T;
|
1877
1868
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1878
1869
|
if (!c)
|
1879
1870
|
return o(t);
|
1880
1871
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1881
1872
|
if (!u)
|
1882
1873
|
return o(t);
|
1883
|
-
const h = (V = (y = this._dataValidationCacheService.getValue(i, r, n, a)) == null ? void 0 : y.status) != null ? V :
|
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;
|
1884
1875
|
let m;
|
1885
1876
|
const f = {
|
1886
1877
|
get value() {
|
@@ -1903,7 +1894,7 @@ let zt = class extends ln {
|
|
1903
1894
|
},
|
1904
1895
|
markers: {
|
1905
1896
|
...t == null ? void 0 : t.markers,
|
1906
|
-
...h ===
|
1897
|
+
...h === ae.INVALID ? jo : null
|
1907
1898
|
},
|
1908
1899
|
customRender: [
|
1909
1900
|
...(S = t == null ? void 0 : t.customRender) != null ? S : [],
|
@@ -1911,7 +1902,7 @@ let zt = class extends ln {
|
|
1911
1902
|
],
|
1912
1903
|
fontRenderExtension: {
|
1913
1904
|
...t == null ? void 0 : t.fontRenderExtension,
|
1914
|
-
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))
|
1915
1906
|
},
|
1916
1907
|
interceptorStyle: {
|
1917
1908
|
...t == null ? void 0 : t.interceptorStyle,
|
@@ -1923,8 +1914,8 @@ let zt = class extends ln {
|
|
1923
1914
|
}, n, a)
|
1924
1915
|
},
|
1925
1916
|
interceptorAutoHeight: () => {
|
1926
|
-
var A, M,
|
1927
|
-
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;
|
1928
1919
|
if (!R)
|
1929
1920
|
return;
|
1930
1921
|
const P = R.worksheet.getMergedCell(n, a), j = {
|
@@ -1938,7 +1929,7 @@ let zt = class extends ln {
|
|
1938
1929
|
}
|
1939
1930
|
},
|
1940
1931
|
style: R.getsStyles().getStyleByCell(t),
|
1941
|
-
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),
|
1942
1933
|
unitId: i,
|
1943
1934
|
subUnitId: r,
|
1944
1935
|
row: n,
|
@@ -1949,8 +1940,8 @@ let zt = class extends ln {
|
|
1949
1940
|
return (v = (w = d == null ? void 0 : d.canvasRender) == null ? void 0 : w.calcCellAutoHeight) == null ? void 0 : v.call(w, j);
|
1950
1941
|
},
|
1951
1942
|
interceptorAutoWidth: () => {
|
1952
|
-
var A, M,
|
1953
|
-
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;
|
1954
1945
|
if (!R)
|
1955
1946
|
return;
|
1956
1947
|
const P = R.worksheet.getMergedCell(n, a), j = {
|
@@ -1964,7 +1955,7 @@ let zt = class extends ln {
|
|
1964
1955
|
}
|
1965
1956
|
},
|
1966
1957
|
style: R.getsStyles().getStyleByCell(t),
|
1967
|
-
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),
|
1968
1959
|
unitId: i,
|
1969
1960
|
subUnitId: r,
|
1970
1961
|
row: n,
|
@@ -1974,7 +1965,7 @@ let zt = class extends ln {
|
|
1974
1965
|
};
|
1975
1966
|
return (v = (w = d == null ? void 0 : d.canvasRender) == null ? void 0 : w.calcCellAutoWidth) == null ? void 0 : v.call(w, j);
|
1976
1967
|
},
|
1977
|
-
coverable: ((
|
1968
|
+
coverable: ((T = t == null ? void 0 : t.coverable) != null ? T : !0) && !(u.type === nt.LIST || u.type === nt.LIST_MULTIPLE)
|
1978
1969
|
});
|
1979
1970
|
}
|
1980
1971
|
}
|
@@ -1985,8 +1976,8 @@ let zt = class extends ln {
|
|
1985
1976
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1986
1977
|
// patched data-validation change don't need to re-calc row height
|
1987
1978
|
// re-calc of row height will be triggered precisely by the origin command
|
1988
|
-
|
1989
|
-
|
1979
|
+
vn((t) => t.source === "command"),
|
1980
|
+
fo(16)
|
1990
1981
|
).subscribe((t) => {
|
1991
1982
|
const e = [];
|
1992
1983
|
if (t.forEach((o) => {
|
@@ -1994,25 +1985,25 @@ let zt = class extends ln {
|
|
1994
1985
|
(n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
1995
1986
|
}), e.length) {
|
1996
1987
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
1997
|
-
|
1988
|
+
Yn(o.redos, this._commandService);
|
1998
1989
|
}
|
1999
1990
|
});
|
2000
1991
|
}
|
2001
1992
|
};
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
],
|
2015
|
-
let
|
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 {
|
2016
2007
|
constructor(t, e, o, n, a, i, r) {
|
2017
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();
|
2018
2009
|
}
|
@@ -2020,21 +2011,21 @@ let Tn = class extends ln {
|
|
2020
2011
|
_initViewModelIntercept() {
|
2021
2012
|
this.disposeWithMe(
|
2022
2013
|
this._sheetInterceptorService.intercept(
|
2023
|
-
|
2014
|
+
Zn.CELL_CONTENT,
|
2024
2015
|
{
|
2025
|
-
effect:
|
2016
|
+
effect: Wn.Style,
|
2026
2017
|
// must be after numfmt
|
2027
|
-
priority:
|
2018
|
+
priority: qn.DATA_VALIDATION,
|
2028
2019
|
// eslint-disable-next-line complexity
|
2029
2020
|
handler: (t, e, o) => {
|
2030
|
-
var D, y, V, S, x,
|
2021
|
+
var D, y, V, S, x, O;
|
2031
2022
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
2032
2023
|
if (!c)
|
2033
2024
|
return o(t);
|
2034
2025
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
2035
2026
|
if (!u)
|
2036
2027
|
return o(t);
|
2037
|
-
const h = (y = (D = this._dataValidationCacheService.getValue(i, r, n, a)) == null ? void 0 : D.status) != null ? y :
|
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 : ""}`;
|
2038
2029
|
return o({
|
2039
2030
|
...t,
|
2040
2031
|
dataValidation: {
|
@@ -2045,7 +2036,7 @@ let Tn = class extends ln {
|
|
2045
2036
|
},
|
2046
2037
|
markers: {
|
2047
2038
|
...t == null ? void 0 : t.markers,
|
2048
|
-
...h ===
|
2039
|
+
...h === ae.INVALID ? jo : null
|
2049
2040
|
},
|
2050
2041
|
customRender: [
|
2051
2042
|
...(V = t == null ? void 0 : t.customRender) != null ? V : [],
|
@@ -2059,17 +2050,17 @@ let Tn = class extends ln {
|
|
2059
2050
|
...t == null ? void 0 : t.interceptorStyle,
|
2060
2051
|
...d == null ? void 0 : d.getExtraStyle(u, f, {
|
2061
2052
|
get style() {
|
2062
|
-
const
|
2063
|
-
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) || {};
|
2064
2055
|
}
|
2065
2056
|
}, n, a)
|
2066
2057
|
},
|
2067
2058
|
interceptorAutoHeight: () => {
|
2068
|
-
var j, A, M,
|
2069
|
-
const
|
2070
|
-
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)
|
2071
2062
|
return;
|
2072
|
-
const R =
|
2063
|
+
const R = T.worksheet.getMergedCell(n, a), P = {
|
2073
2064
|
data: {
|
2074
2065
|
...t,
|
2075
2066
|
dataValidation: {
|
@@ -2079,8 +2070,8 @@ let Tn = class extends ln {
|
|
2079
2070
|
validator: d
|
2080
2071
|
}
|
2081
2072
|
},
|
2082
|
-
style:
|
2083
|
-
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),
|
2084
2075
|
unitId: i,
|
2085
2076
|
subUnitId: r,
|
2086
2077
|
row: n,
|
@@ -2090,7 +2081,7 @@ let Tn = class extends ln {
|
|
2090
2081
|
};
|
2091
2082
|
return (w = (B = d == null ? void 0 : d.canvasRender) == null ? void 0 : B.calcCellAutoHeight) == null ? void 0 : w.call(B, P);
|
2092
2083
|
},
|
2093
|
-
coverable: ((
|
2084
|
+
coverable: ((O = t == null ? void 0 : t.coverable) != null ? O : !0) && !(u.type === nt.LIST || u.type === nt.LIST_MULTIPLE)
|
2094
2085
|
});
|
2095
2086
|
}
|
2096
2087
|
}
|
@@ -2099,8 +2090,8 @@ let Tn = class extends ln {
|
|
2099
2090
|
}
|
2100
2091
|
_initAutoHeight() {
|
2101
2092
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
2102
|
-
|
2103
|
-
|
2093
|
+
vn((t) => t.source === "command"),
|
2094
|
+
fo(16)
|
2104
2095
|
).subscribe((t) => {
|
2105
2096
|
const e = [];
|
2106
2097
|
if (t.forEach((o) => {
|
@@ -2108,26 +2099,26 @@ let Tn = class extends ln {
|
|
2108
2099
|
(n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
2109
2100
|
}), e.length) {
|
2110
2101
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
2111
|
-
|
2102
|
+
Yn(o.redos, this._commandService);
|
2112
2103
|
}
|
2113
2104
|
});
|
2114
2105
|
}
|
2115
2106
|
};
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
],
|
2125
|
-
var
|
2126
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
2127
2118
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2128
|
-
return n && a &&
|
2129
|
-
},
|
2130
|
-
let
|
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 {
|
2131
2122
|
constructor(t, e, o) {
|
2132
2123
|
super(), this._context = t, this._sheetDataValidationModel = e, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
2133
2124
|
}
|
@@ -2144,30 +2135,30 @@ let Ie = class extends Dt {
|
|
2144
2135
|
(i = this._sheetSkeletonManagerService.getWorksheetSkeleton(a)) == null || i.skeleton.makeDirty(!0);
|
2145
2136
|
}), (n = this._context.mainComponent) == null || n.makeForceDirty();
|
2146
2137
|
};
|
2147
|
-
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(
|
2138
|
+
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(oa(16)).subscribe(t));
|
2148
2139
|
}
|
2149
2140
|
};
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
],
|
2154
|
-
const
|
2155
|
-
dataValidationFormula:
|
2156
|
-
dataValidationFormulaAnd:
|
2157
|
-
dataValidationFormulaListItem:
|
2158
|
-
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,
|
2159
2150
|
dataValidationFormulaListItemDrag: $r,
|
2160
|
-
dataValidationFormulaListAdd:
|
2161
|
-
dataValidationFormulaColorSelect:
|
2162
|
-
dataValidationFormulaColorSelectPanel:
|
2163
|
-
dataValidationFormulaColorItem:
|
2164
|
-
},
|
2165
|
-
const { isTwoFormula: e = !1, value: o, onChange: n, showError: a, validResult: i } = t, r =
|
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 : "";
|
2166
2157
|
return e ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2167
|
-
/* @__PURE__ */ p.jsx(
|
2168
|
-
|
2158
|
+
/* @__PURE__ */ p.jsx(et, { error: l, children: /* @__PURE__ */ p.jsx(
|
2159
|
+
xt,
|
2169
2160
|
{
|
2170
|
-
className:
|
2161
|
+
className: rt.dataValidationFormula,
|
2171
2162
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2172
2163
|
value: o == null ? void 0 : o.formula1,
|
2173
2164
|
onChange: (c) => {
|
@@ -2178,11 +2169,11 @@ const Mr = "univer-data-validation-formula", br = "univer-data-validation-formul
|
|
2178
2169
|
}
|
2179
2170
|
}
|
2180
2171
|
) }),
|
2181
|
-
/* @__PURE__ */ p.jsx("div", { className:
|
2182
|
-
/* @__PURE__ */ p.jsx(
|
2183
|
-
|
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,
|
2184
2175
|
{
|
2185
|
-
className:
|
2176
|
+
className: rt.dataValidationFormula,
|
2186
2177
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2187
2178
|
value: o == null ? void 0 : o.formula2,
|
2188
2179
|
onChange: (c) => {
|
@@ -2193,10 +2184,10 @@ const Mr = "univer-data-validation-formula", br = "univer-data-validation-formul
|
|
2193
2184
|
}
|
2194
2185
|
}
|
2195
2186
|
) })
|
2196
|
-
] }) : /* @__PURE__ */ p.jsx(
|
2197
|
-
|
2187
|
+
] }) : /* @__PURE__ */ p.jsx(et, { error: l, children: /* @__PURE__ */ p.jsx(
|
2188
|
+
xt,
|
2198
2189
|
{
|
2199
|
-
className:
|
2190
|
+
className: rt.dataValidationFormula,
|
2200
2191
|
placeholder: r.t("dataValidation.panel.formulaPlaceholder"),
|
2201
2192
|
value: o == null ? void 0 : o.formula1,
|
2202
2193
|
onChange: (c) => {
|
@@ -2205,11 +2196,11 @@ const Mr = "univer-data-validation-formula", br = "univer-data-validation-formul
|
|
2205
2196
|
}
|
2206
2197
|
) });
|
2207
2198
|
};
|
2208
|
-
function
|
2209
|
-
const { value: e, onChange: o, showError: n, validResult: a } = t, i =
|
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));
|
2210
2201
|
return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2211
|
-
/* @__PURE__ */ p.jsx(
|
2212
|
-
|
2202
|
+
/* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(
|
2203
|
+
be,
|
2213
2204
|
{
|
2214
2205
|
checked: s,
|
2215
2206
|
onChange: (u) => {
|
@@ -2222,10 +2213,10 @@ function jr(t) {
|
|
2222
2213
|
children: i.t("dataValidation.checkbox.tips")
|
2223
2214
|
}
|
2224
2215
|
) }),
|
2225
|
-
s ? /* @__PURE__ */ p.jsx(
|
2226
|
-
|
2216
|
+
s ? /* @__PURE__ */ p.jsx(et, { label: i.t("dataValidation.checkbox.checked"), error: r, children: /* @__PURE__ */ p.jsx(
|
2217
|
+
xt,
|
2227
2218
|
{
|
2228
|
-
className:
|
2219
|
+
className: rt.dataValidationFormula,
|
2229
2220
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
2230
2221
|
value: e == null ? void 0 : e.formula1,
|
2231
2222
|
onChange: (u) => {
|
@@ -2236,10 +2227,10 @@ function jr(t) {
|
|
2236
2227
|
}
|
2237
2228
|
}
|
2238
2229
|
) }) : null,
|
2239
|
-
s ? /* @__PURE__ */ p.jsx(
|
2240
|
-
|
2230
|
+
s ? /* @__PURE__ */ p.jsx(et, { label: i.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ p.jsx(
|
2231
|
+
xt,
|
2241
2232
|
{
|
2242
|
-
className:
|
2233
|
+
className: rt.dataValidationFormula,
|
2243
2234
|
placeholder: i.t("dataValidation.panel.valuePlaceholder"),
|
2244
2235
|
value: e == null ? void 0 : e.formula2,
|
2245
2236
|
onChange: (u) => {
|
@@ -2252,15 +2243,15 @@ function jr(t) {
|
|
2252
2243
|
) }) : null
|
2253
2244
|
] });
|
2254
2245
|
}
|
2255
|
-
function
|
2246
|
+
function Ur(t) {
|
2256
2247
|
var h;
|
2257
|
-
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 =
|
2258
|
-
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) => {
|
2259
2250
|
var m;
|
2260
2251
|
const C = (m = s.current) == null ? void 0 : m.handleOutClick;
|
2261
2252
|
C && C(d, () => u(!1));
|
2262
2253
|
}), /* @__PURE__ */ p.jsx(
|
2263
|
-
|
2254
|
+
mo,
|
2264
2255
|
{
|
2265
2256
|
initValue: (h = n == null ? void 0 : n.formula1) != null ? h : "",
|
2266
2257
|
unitId: e,
|
@@ -2279,20 +2270,20 @@ function Fr(t) {
|
|
2279
2270
|
}
|
2280
2271
|
);
|
2281
2272
|
}
|
2282
|
-
function
|
2273
|
+
function Fo(t) {
|
2283
2274
|
var e, o, n = "";
|
2284
2275
|
if (typeof t == "string" || typeof t == "number") n += t;
|
2285
2276
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
2286
2277
|
var a = t.length;
|
2287
|
-
for (e = 0; e < a; e++) t[e] && (o =
|
2278
|
+
for (e = 0; e < a; e++) t[e] && (o = Fo(t[e])) && (n && (n += " "), n += o);
|
2288
2279
|
} else for (o in t) t[o] && (n && (n += " "), n += o);
|
2289
2280
|
return n;
|
2290
2281
|
}
|
2291
|
-
function
|
2292
|
-
for (var t, e, o = 0, n = "", a = arguments.length; o < a; o++) (t = arguments[o]) && (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);
|
2293
2284
|
return n;
|
2294
2285
|
}
|
2295
|
-
const
|
2286
|
+
const Br = [
|
2296
2287
|
"#FFFFFF",
|
2297
2288
|
"#FEE7E7",
|
2298
2289
|
"#FEF0E6",
|
@@ -2317,33 +2308,34 @@ const Ur = [
|
|
2317
2308
|
"#3A60F7",
|
2318
2309
|
"#9E6DE3",
|
2319
2310
|
"#F248A6"
|
2320
|
-
],
|
2311
|
+
], Hr = (t) => {
|
2321
2312
|
const { value: e, onChange: o, disabled: n } = t, [a, i] = q(!1);
|
2322
2313
|
return /* @__PURE__ */ p.jsx(
|
2323
|
-
|
2314
|
+
Je,
|
2324
2315
|
{
|
2325
2316
|
disabled: n,
|
2326
2317
|
open: a,
|
2327
2318
|
onDropdownVisibleChange: i,
|
2328
2319
|
dropdownStyle: { width: 112 },
|
2329
|
-
|
2320
|
+
style: { width: 96, cursor: "pointer" },
|
2321
|
+
className: rt.dataValidationFormulaColorSelect,
|
2330
2322
|
value: e,
|
2331
2323
|
onChange: o,
|
2332
2324
|
labelRender: (r) => /* @__PURE__ */ p.jsx(
|
2333
2325
|
"div",
|
2334
2326
|
{
|
2335
|
-
className:
|
2327
|
+
className: rt.dataValidationFormulaColorItem,
|
2336
2328
|
style: { background: r.value, marginTop: 5 }
|
2337
2329
|
}
|
2338
2330
|
),
|
2339
|
-
dropdownRender: () => /* @__PURE__ */ p.jsx("div", { className:
|
2331
|
+
dropdownRender: () => /* @__PURE__ */ p.jsx("div", { className: rt.dataValidationFormulaColorSelectPanel, children: Br.map(
|
2340
2332
|
(r) => /* @__PURE__ */ p.jsx(
|
2341
2333
|
"div",
|
2342
2334
|
{
|
2343
2335
|
onClick: () => {
|
2344
2336
|
o(r), i(!1);
|
2345
2337
|
},
|
2346
|
-
className:
|
2338
|
+
className: rt.dataValidationFormulaColorItem,
|
2347
2339
|
style: { background: r }
|
2348
2340
|
},
|
2349
2341
|
r
|
@@ -2351,12 +2343,12 @@ const Ur = [
|
|
2351
2343
|
) })
|
2352
2344
|
}
|
2353
2345
|
);
|
2354
|
-
},
|
2346
|
+
}, Fn = (t) => {
|
2355
2347
|
const { item: e, commonProps: o, style: n } = t, { onItemChange: a, onItemDelete: i } = o;
|
2356
|
-
return /* @__PURE__ */ p.jsxs("div", { className:
|
2357
|
-
e.isRef ? null : /* @__PURE__ */ p.jsx("div", { className:
|
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, {}) }),
|
2358
2350
|
/* @__PURE__ */ p.jsx(
|
2359
|
-
|
2351
|
+
Hr,
|
2360
2352
|
{
|
2361
2353
|
value: e.color,
|
2362
2354
|
onChange: (r) => {
|
@@ -2365,7 +2357,7 @@ const Ur = [
|
|
2365
2357
|
}
|
2366
2358
|
),
|
2367
2359
|
/* @__PURE__ */ p.jsx(
|
2368
|
-
|
2360
|
+
xt,
|
2369
2361
|
{
|
2370
2362
|
disabled: e.isRef,
|
2371
2363
|
value: e.label,
|
@@ -2374,48 +2366,48 @@ const Ur = [
|
|
2374
2366
|
}
|
2375
2367
|
}
|
2376
2368
|
),
|
2377
|
-
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) }) })
|
2378
2370
|
] });
|
2379
2371
|
};
|
2380
|
-
function
|
2372
|
+
function Wr(t) {
|
2381
2373
|
const { value: e, onChange: o = () => {
|
2382
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = t, { formula1: s = "", formula2: c = "" } = e || {}, u =
|
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);
|
2383
2375
|
St(() => {
|
2384
2376
|
(async () => {
|
2385
|
-
await new Promise((
|
2386
|
-
setTimeout(() =>
|
2377
|
+
await new Promise((F) => {
|
2378
|
+
setTimeout(() => F(!0), 100);
|
2387
2379
|
});
|
2388
|
-
const
|
2389
|
-
if (
|
2390
|
-
const
|
2391
|
-
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);
|
2392
2384
|
}
|
2393
2385
|
})();
|
2394
2386
|
}, [S, w, R, l, a, n]), St(() => {
|
2395
|
-
|
2387
|
+
Tt(s) && s !== f && (m(s), D(f));
|
2396
2388
|
}, [f, s]);
|
2397
2389
|
const [g, I] = q(() => {
|
2398
|
-
const
|
2399
|
-
return
|
2400
|
-
label:
|
2401
|
-
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,
|
2402
2394
|
isRef: !1,
|
2403
|
-
id:
|
2395
|
+
id: qe.generateRandomId(4)
|
2404
2396
|
}));
|
2405
|
-
}), _ = (
|
2406
|
-
const z = g.find((
|
2407
|
-
z && (z.label =
|
2408
|
-
},
|
2409
|
-
const
|
2410
|
-
|
2411
|
-
}, b = c.split(","),
|
2412
|
-
label:
|
2413
|
-
color: b[
|
2414
|
-
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}`,
|
2415
2407
|
isRef: !0
|
2416
|
-
})), [b, P]), X = (
|
2417
|
-
const z = [...
|
2418
|
-
z[+
|
2408
|
+
})), [b, P]), X = (E, H, F) => {
|
2409
|
+
const z = [...O];
|
2410
|
+
z[+E] = F, T(z), v({
|
2419
2411
|
formula1: s,
|
2420
2412
|
formula2: z.join(",")
|
2421
2413
|
});
|
@@ -2424,42 +2416,42 @@ function Br(t) {
|
|
2424
2416
|
...g,
|
2425
2417
|
{
|
2426
2418
|
label: "",
|
2427
|
-
color:
|
2419
|
+
color: Pt,
|
2428
2420
|
isRef: !1,
|
2429
|
-
id:
|
2421
|
+
id: qe.generateRandomId(4)
|
2430
2422
|
}
|
2431
2423
|
]);
|
2432
2424
|
};
|
2433
2425
|
St(() => {
|
2434
2426
|
if (h === "1")
|
2435
2427
|
return;
|
2436
|
-
const
|
2437
|
-
g.map((
|
2438
|
-
labelList:
|
2439
|
-
item:
|
2440
|
-
})).forEach(({ item:
|
2441
|
-
z.forEach((
|
2442
|
-
|
2443
|
-
label:
|
2444
|
-
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
|
2445
2437
|
}));
|
2446
2438
|
});
|
2447
2439
|
}), v({
|
2448
|
-
formula1:
|
2449
|
-
formula2:
|
2440
|
+
formula1: Qn(H.map((F) => F.label)),
|
2441
|
+
formula2: H.map((F) => F.color === Pt ? "" : F.color).join(",")
|
2450
2442
|
});
|
2451
|
-
}, [g, v, h, f,
|
2452
|
-
const G =
|
2453
|
-
() => async (
|
2454
|
-
if (!
|
2443
|
+
}, [g, v, h, f, O]);
|
2444
|
+
const G = $t(
|
2445
|
+
() => async (E) => {
|
2446
|
+
if (!Tt(E)) {
|
2455
2447
|
v == null || v({
|
2456
2448
|
formula1: "",
|
2457
2449
|
formula2: c
|
2458
2450
|
});
|
2459
2451
|
return;
|
2460
2452
|
}
|
2461
|
-
x.getFormulaRefCheck(
|
2462
|
-
formula1:
|
2453
|
+
x.getFormulaRefCheck(E) ? (v == null || v({
|
2454
|
+
formula1: Tt(E) ? E : "",
|
2463
2455
|
formula2: c
|
2464
2456
|
}), M("")) : (v == null || v({
|
2465
2457
|
formula1: "",
|
@@ -2467,20 +2459,20 @@ function Br(t) {
|
|
2467
2459
|
}), m("="), M(y.t("dataValidation.validFail.formulaError")));
|
2468
2460
|
},
|
2469
2461
|
[c, v]
|
2470
|
-
), Z =
|
2471
|
-
return
|
2472
|
-
var
|
2473
|
-
const
|
2474
|
-
|
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));
|
2475
2467
|
}), /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2476
|
-
/* @__PURE__ */ p.jsx(
|
2477
|
-
|
2468
|
+
/* @__PURE__ */ p.jsx(et, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ p.jsxs(
|
2469
|
+
un,
|
2478
2470
|
{
|
2479
2471
|
value: h,
|
2480
|
-
onChange: (
|
2481
|
-
d(
|
2472
|
+
onChange: (E) => {
|
2473
|
+
d(E), m(f), E === "1" && v({
|
2482
2474
|
formula1: f === "=" ? "" : f,
|
2483
|
-
formula2:
|
2475
|
+
formula2: O.join(",")
|
2484
2476
|
});
|
2485
2477
|
},
|
2486
2478
|
children: [
|
@@ -2491,86 +2483,86 @@ function Br(t) {
|
|
2491
2483
|
) }),
|
2492
2484
|
h === "1" ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
2493
2485
|
/* @__PURE__ */ p.jsx(
|
2494
|
-
|
2486
|
+
mo,
|
2495
2487
|
{
|
2496
2488
|
initValue: C,
|
2497
2489
|
unitId: n,
|
2498
2490
|
subUnitId: a,
|
2499
2491
|
isFocus: J,
|
2500
|
-
onChange: (
|
2501
|
-
const
|
2502
|
-
D(
|
2492
|
+
onChange: (E = "") => {
|
2493
|
+
const H = (E != null ? E : "").trim();
|
2494
|
+
D(H), G(H);
|
2503
2495
|
},
|
2504
|
-
errorText:
|
2505
|
-
onFocus: () =>
|
2496
|
+
errorText: N || A || void 0,
|
2497
|
+
onFocus: () => L(!0),
|
2506
2498
|
actions: Z.current
|
2507
2499
|
}
|
2508
2500
|
),
|
2509
|
-
/* @__PURE__ */ p.jsx("div", { ref: u, style: { marginTop: "12px" }, children:
|
2510
|
-
] }) : /* @__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: [
|
2511
2503
|
/* @__PURE__ */ p.jsx(
|
2512
|
-
|
2504
|
+
da,
|
2513
2505
|
{
|
2514
2506
|
list: g,
|
2515
2507
|
onListChange: I,
|
2516
2508
|
rowHeight: 32,
|
2517
2509
|
margin: [0, 12],
|
2518
2510
|
draggableHandle: ".draggableHandle",
|
2519
|
-
itemRender: (
|
2520
|
-
|
2511
|
+
itemRender: (E) => /* @__PURE__ */ p.jsx(
|
2512
|
+
Fn,
|
2521
2513
|
{
|
2522
|
-
item:
|
2514
|
+
item: E,
|
2523
2515
|
commonProps: {
|
2524
2516
|
onItemChange: _,
|
2525
|
-
onItemDelete:
|
2517
|
+
onItemDelete: $
|
2526
2518
|
}
|
2527
2519
|
},
|
2528
|
-
|
2520
|
+
E.id
|
2529
2521
|
),
|
2530
2522
|
idKey: "id"
|
2531
2523
|
}
|
2532
2524
|
),
|
2533
|
-
/* @__PURE__ */ p.jsxs("a", { className:
|
2534
|
-
/* @__PURE__ */ p.jsx(
|
2525
|
+
/* @__PURE__ */ p.jsxs("a", { className: rt.dataValidationFormulaListAdd, onClick: K, children: [
|
2526
|
+
/* @__PURE__ */ p.jsx(yo, {}),
|
2535
2527
|
y.t("dataValidation.list.add")
|
2536
2528
|
] })
|
2537
2529
|
] }) })
|
2538
2530
|
] });
|
2539
2531
|
}
|
2540
|
-
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 = [
|
2541
2533
|
[
|
2542
|
-
|
2543
|
-
|
2534
|
+
No,
|
2535
|
+
Ur
|
2544
2536
|
],
|
2545
2537
|
[
|
2546
|
-
|
2547
|
-
|
2538
|
+
Le,
|
2539
|
+
Fr
|
2548
2540
|
],
|
2549
2541
|
[
|
2550
|
-
|
2551
|
-
|
2542
|
+
Rn,
|
2543
|
+
Wr
|
2552
2544
|
],
|
2553
2545
|
[
|
2554
|
-
|
2555
|
-
|
2546
|
+
Uo,
|
2547
|
+
Nr
|
2556
2548
|
]
|
2557
|
-
],
|
2558
|
-
function
|
2549
|
+
], Xr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2550
|
+
function ye(t) {
|
2559
2551
|
var a;
|
2560
|
-
const { value: e, onChange: o } = t, n =
|
2561
|
-
return /* @__PURE__ */ p.jsx(
|
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: [
|
2562
2554
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2563
2555
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2564
2556
|
/* @__PURE__ */ p.jsx(Lt, { value: `${dt.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2565
2557
|
] }) });
|
2566
2558
|
}
|
2567
|
-
|
2568
|
-
const
|
2569
|
-
function
|
2559
|
+
ye.componentKey = Xr;
|
2560
|
+
const zr = "DATE_SHOW_TIME_OPTION";
|
2561
|
+
function Ve(t) {
|
2570
2562
|
var a;
|
2571
|
-
const { value: e, onChange: o } = t, n =
|
2572
|
-
return /* @__PURE__ */ p.jsx(
|
2573
|
-
|
2563
|
+
const { value: e, onChange: o } = t, n = W(ot);
|
2564
|
+
return /* @__PURE__ */ p.jsx(et, { children: /* @__PURE__ */ p.jsx(
|
2565
|
+
be,
|
2574
2566
|
{
|
2575
2567
|
checked: (a = e.bizInfo) == null ? void 0 : a.showTime,
|
2576
2568
|
onChange: (i) => {
|
@@ -2586,20 +2578,20 @@ function Re(t) {
|
|
2586
2578
|
}
|
2587
2579
|
) });
|
2588
2580
|
}
|
2589
|
-
|
2590
|
-
var
|
2591
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
2592
2584
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2593
|
-
return n && a &&
|
2594
|
-
},
|
2595
|
-
const
|
2596
|
-
let
|
2597
|
-
constructor(t, e, o) {
|
2598
|
-
this._commandService = t, this._formulaService = e, this._themeService = o;
|
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;
|
2599
2591
|
}
|
2600
2592
|
_calc(t, e) {
|
2601
2593
|
var c, u, h;
|
2602
|
-
const { vt: o, ht: n } = e || {}, a = t.endX - t.startX -
|
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;
|
2603
2595
|
let l = 0, s = 0;
|
2604
2596
|
switch (o) {
|
2605
2597
|
case ut.TOP:
|
@@ -2614,13 +2606,13 @@ let nn = class {
|
|
2614
2606
|
}
|
2615
2607
|
switch (n) {
|
2616
2608
|
case Wt.LEFT:
|
2617
|
-
l =
|
2609
|
+
l = he;
|
2618
2610
|
break;
|
2619
2611
|
case Wt.RIGHT:
|
2620
|
-
l =
|
2612
|
+
l = he + (a - r);
|
2621
2613
|
break;
|
2622
2614
|
default:
|
2623
|
-
l =
|
2615
|
+
l = he + (a - r) / 2;
|
2624
2616
|
break;
|
2625
2617
|
}
|
2626
2618
|
return {
|
@@ -2642,10 +2634,10 @@ let nn = class {
|
|
2642
2634
|
}
|
2643
2635
|
async _parseFormula(t, e, o) {
|
2644
2636
|
var c, u, h, d, C, m, f, D, y;
|
2645
|
-
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));
|
2646
2638
|
return {
|
2647
|
-
formula1:
|
2648
|
-
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,
|
2649
2641
|
isFormulaValid: s
|
2650
2642
|
};
|
2651
2643
|
}
|
@@ -2657,9 +2649,9 @@ let nn = class {
|
|
2657
2649
|
const m = this._themeService.getCurrentTheme();
|
2658
2650
|
if (!((v = C.skipDefaultFontRender) != null && v.call(C, d, h, { unitId: i, subUnitId: r, row: s, column: c })))
|
2659
2651
|
return;
|
2660
|
-
const f = C.parseFormulaSync(d, i, r), { formula1: D } = f, y = this._calc(u, o), { a: V, d: S } = t.getTransform(), x =
|
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({
|
2661
2653
|
left: x,
|
2662
|
-
top:
|
2654
|
+
top: O,
|
2663
2655
|
scaleX: 1,
|
2664
2656
|
scaleY: 1,
|
2665
2657
|
angle: 0,
|
@@ -2669,14 +2661,14 @@ let nn = class {
|
|
2669
2661
|
flipY: !1
|
2670
2662
|
}), R = u.endX - u.startX, P = u.endY - u.startY;
|
2671
2663
|
t.save(), t.beginPath(), t.rect(u.startX, u.startY, R, P), t.clip();
|
2672
|
-
const j =
|
2664
|
+
const j = T.getMatrix();
|
2673
2665
|
t.transform(j[0], j[1], j[2], j[3], j[4], j[5]);
|
2674
|
-
const A = ((g = o == null ? void 0 : o.fs) != null ? g : 10) * 1.6, M = String(h) === String(D),
|
2675
|
-
|
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, {
|
2676
2668
|
checked: M,
|
2677
2669
|
width: A,
|
2678
2670
|
height: A,
|
2679
|
-
fill: (_ = (I = o == null ? void 0 : o.cl) == null ? void 0 : I.rgb) != null ? _ :
|
2671
|
+
fill: (_ = (I = o == null ? void 0 : o.cl) == null ? void 0 : I.rgb) != null ? _ : N
|
2680
2672
|
}), t.restore();
|
2681
2673
|
}
|
2682
2674
|
isHit(t, e) {
|
@@ -2698,89 +2690,98 @@ let nn = class {
|
|
2698
2690
|
endRow: o.actualRow
|
2699
2691
|
},
|
2700
2692
|
value: {
|
2701
|
-
v: String(c) ===
|
2693
|
+
v: String(c) === Ra(String(d)) ? C : d,
|
2702
2694
|
p: null
|
2703
2695
|
}
|
2704
2696
|
};
|
2705
2697
|
this._commandService.executeCommand(
|
2706
|
-
|
2698
|
+
fn.id,
|
2707
2699
|
m
|
2708
2700
|
);
|
2709
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
|
+
}
|
2710
2710
|
};
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
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--)
|
2718
2719
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2719
|
-
return n && a &&
|
2720
|
-
},
|
2720
|
+
return n && a && qr(e, o, a), a;
|
2721
|
+
}, ts = (t, e) => (o, n) => e(o, n, t);
|
2721
2722
|
let mt = class {
|
2722
2723
|
constructor(t) {
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2724
|
+
k(this, "canvasRender", null);
|
2725
|
+
k(this, "dropdown");
|
2726
|
+
k(this, "optionsInput");
|
2727
|
+
k(this, "formulaInput", Rn);
|
2727
2728
|
this.injector = t;
|
2728
2729
|
}
|
2729
2730
|
};
|
2730
|
-
mt =
|
2731
|
-
|
2731
|
+
mt = Qr([
|
2732
|
+
ts(0, Y(jt))
|
2732
2733
|
], mt);
|
2733
|
-
class
|
2734
|
+
class es extends mt {
|
2734
2735
|
constructor() {
|
2735
2736
|
super(...arguments);
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2737
|
+
k(this, "id", nt.CHECKBOX);
|
2738
|
+
k(this, "canvasRender", this.injector.createInstance(an));
|
2739
|
+
k(this, "formulaInput", Uo);
|
2739
2740
|
}
|
2740
2741
|
}
|
2741
|
-
class
|
2742
|
+
class ns extends mt {
|
2742
2743
|
constructor() {
|
2743
2744
|
super(...arguments);
|
2744
|
-
|
2745
|
-
|
2745
|
+
k(this, "id", nt.CUSTOM);
|
2746
|
+
k(this, "formulaInput", No);
|
2746
2747
|
}
|
2747
2748
|
}
|
2748
|
-
const
|
2749
|
-
class
|
2749
|
+
const os = "data-validation.formula-input";
|
2750
|
+
class as extends mt {
|
2750
2751
|
constructor() {
|
2751
2752
|
super(...arguments);
|
2752
|
-
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2753
|
+
k(this, "id", nt.DATE);
|
2754
|
+
k(this, "formulaInput", os);
|
2755
|
+
k(this, "optionsInput", Ve.componentKey);
|
2756
|
+
k(this, "dropdown", $o);
|
2756
2757
|
}
|
2757
2758
|
}
|
2758
|
-
class
|
2759
|
+
class is extends mt {
|
2759
2760
|
constructor() {
|
2760
2761
|
super(...arguments);
|
2761
|
-
|
2762
|
-
|
2762
|
+
k(this, "id", nt.DECIMAL);
|
2763
|
+
k(this, "formulaInput", Le);
|
2763
2764
|
}
|
2764
2765
|
}
|
2765
|
-
const
|
2766
|
-
function
|
2767
|
-
const o =
|
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;
|
2768
2769
|
return {
|
2769
2770
|
width: n,
|
2770
|
-
height: r +
|
2771
|
+
height: r + rs * 2,
|
2771
2772
|
ba: a
|
2772
2773
|
};
|
2773
2774
|
}
|
2774
|
-
function
|
2775
|
-
const a = Ot +
|
2776
|
-
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),
|
2777
2778
|
text: d
|
2778
2779
|
}));
|
2779
2780
|
let s;
|
2780
2781
|
const c = [];
|
2781
2782
|
l.forEach((d) => {
|
2782
2783
|
const { layout: C } = d, { width: m, height: f } = C;
|
2783
|
-
!s || s.width + m +
|
2784
|
+
!s || s.width + m + ke > i ? (s = {
|
2784
2785
|
width: m,
|
2785
2786
|
height: f,
|
2786
2787
|
items: [{
|
@@ -2789,44 +2790,44 @@ function ke(t, e, o, n) {
|
|
2789
2790
|
}]
|
2790
2791
|
}, c.push(s)) : (s.items.push({
|
2791
2792
|
...d,
|
2792
|
-
left: s.width +
|
2793
|
-
}), s.width = s.width + m +
|
2793
|
+
left: s.width + ke
|
2794
|
+
}), s.width = s.width + m + ke);
|
2794
2795
|
});
|
2795
2796
|
let u = 0, h = 0;
|
2796
2797
|
return c.forEach((d, C) => {
|
2797
|
-
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;
|
2798
2799
|
}), {
|
2799
2800
|
lines: c,
|
2800
2801
|
totalHeight: u,
|
2801
2802
|
contentWidth: i,
|
2802
2803
|
contentHeight: r,
|
2803
|
-
cellAutoHeight: u +
|
2804
|
+
cellAutoHeight: u + Me * 2,
|
2804
2805
|
calcAutoWidth: h + a
|
2805
2806
|
};
|
2806
2807
|
}
|
2807
|
-
const
|
2808
|
-
class
|
2808
|
+
const ls = 8;
|
2809
|
+
class ds extends fa {
|
2809
2810
|
static drawWith(e, o) {
|
2810
2811
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
|
2811
|
-
e.save(),
|
2812
|
+
e.save(), zn.drawWith(e, {
|
2812
2813
|
width: l.width,
|
2813
2814
|
height: l.height,
|
2814
|
-
radius:
|
2815
|
-
fill: i ||
|
2816
|
-
}), 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();
|
2817
2818
|
}
|
2818
2819
|
}
|
2819
|
-
var
|
2820
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
2821
2822
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2822
|
-
return n && a &&
|
2823
|
-
},
|
2824
|
-
const
|
2825
|
-
let
|
2826
|
-
constructor(t) {
|
2827
|
-
|
2828
|
-
|
2829
|
-
this._commandService = t;
|
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;
|
2830
2831
|
}
|
2831
2832
|
_ensureMap(t) {
|
2832
2833
|
let e = this._dropdownInfoMap.get(t);
|
@@ -2846,11 +2847,11 @@ let an = class {
|
|
2846
2847
|
r = n - Ot + 4;
|
2847
2848
|
break;
|
2848
2849
|
}
|
2849
|
-
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();
|
2850
2851
|
}
|
2851
2852
|
// eslint-disable-next-line max-lines-per-function
|
2852
2853
|
drawWith(t, e, o, n) {
|
2853
|
-
var b,
|
2854
|
+
var b, U;
|
2854
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);
|
2855
2856
|
if (!D)
|
2856
2857
|
return;
|
@@ -2859,42 +2860,42 @@ let an = class {
|
|
2859
2860
|
endX: u.endX - C,
|
2860
2861
|
startY: u.startY + m,
|
2861
2862
|
endY: u.endY - f
|
2862
|
-
}, x = S.endX - S.startX,
|
2863
|
-
this._drawDownIcon(t, S, x,
|
2864
|
-
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;
|
2865
2866
|
switch (w) {
|
2866
2867
|
case ut.MIDDLE:
|
2867
|
-
|
2868
|
+
$ = (_.contentHeight - _.totalHeight) / 2;
|
2868
2869
|
break;
|
2869
2870
|
case ut.BOTTOM:
|
2870
|
-
|
2871
|
+
$ = _.contentHeight - _.totalHeight;
|
2871
2872
|
break;
|
2872
2873
|
}
|
2873
|
-
t.translateWithPrecision(0,
|
2874
|
+
t.translateWithPrecision(0, $), _.lines.forEach((X, K) => {
|
2874
2875
|
t.save();
|
2875
2876
|
const { width: G, height: Z, items: J } = X;
|
2876
|
-
let
|
2877
|
+
let L = 0;
|
2877
2878
|
switch (B) {
|
2878
2879
|
case Wt.RIGHT:
|
2879
|
-
|
2880
|
+
L = _.contentWidth - G;
|
2880
2881
|
break;
|
2881
2882
|
case Wt.CENTER:
|
2882
|
-
|
2883
|
+
L = (_.contentWidth - G) / 2;
|
2883
2884
|
break;
|
2884
2885
|
}
|
2885
|
-
t.translate(
|
2886
|
-
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, {
|
2887
2888
|
...P,
|
2888
|
-
info:
|
2889
|
+
info: E,
|
2889
2890
|
color: R,
|
2890
|
-
fill: I[
|
2891
|
+
fill: I[E.text]
|
2891
2892
|
}), t.restore();
|
2892
2893
|
}), t.restore();
|
2893
2894
|
}), t.restore(), y.set(V, {
|
2894
2895
|
left: S.startX,
|
2895
2896
|
top: S.startY,
|
2896
|
-
width: _.contentWidth +
|
2897
|
-
height: _.contentHeight +
|
2897
|
+
width: _.contentWidth + rn + Ot,
|
2898
|
+
height: _.contentHeight + Me * 2
|
2898
2899
|
});
|
2899
2900
|
}
|
2900
2901
|
calcCellAutoHeight(t) {
|
@@ -2907,8 +2908,8 @@ let an = class {
|
|
2907
2908
|
}, h = n.dataValidation;
|
2908
2909
|
if (!h)
|
2909
2910
|
return;
|
2910
|
-
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 =
|
2911
|
-
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;
|
2912
2913
|
}
|
2913
2914
|
calcCellAutoWidth(t) {
|
2914
2915
|
var x;
|
@@ -2920,8 +2921,8 @@ let an = class {
|
|
2920
2921
|
}, h = n.dataValidation;
|
2921
2922
|
if (!h)
|
2922
2923
|
return;
|
2923
|
-
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 =
|
2924
|
-
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;
|
2925
2926
|
}
|
2926
2927
|
isHit(t, e) {
|
2927
2928
|
const { primaryWithCoord: o } = e, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = t;
|
@@ -2936,47 +2937,56 @@ let an = class {
|
|
2936
2937
|
row: a,
|
2937
2938
|
column: i
|
2938
2939
|
};
|
2939
|
-
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);
|
2940
2949
|
}
|
2941
2950
|
};
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2945
|
-
|
2951
|
+
sn = hs([
|
2952
|
+
Nn(0, at),
|
2953
|
+
Nn(1, Y(Rt))
|
2954
|
+
], sn);
|
2955
|
+
class ps extends mt {
|
2946
2956
|
constructor() {
|
2947
2957
|
super(...arguments);
|
2948
|
-
|
2949
|
-
|
2950
|
-
|
2958
|
+
k(this, "id", nt.LIST_MULTIPLE);
|
2959
|
+
k(this, "canvasRender", this.injector.createInstance(sn));
|
2960
|
+
k(this, "dropdown", Dn);
|
2951
2961
|
}
|
2952
2962
|
}
|
2953
|
-
var
|
2954
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
2955
2965
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
2956
|
-
return n && a &&
|
2957
|
-
},
|
2958
|
-
const
|
2959
|
-
function
|
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) {
|
2960
2970
|
const o = t.length;
|
2961
2971
|
return {
|
2962
2972
|
id: "d",
|
2963
2973
|
body: {
|
2964
|
-
dataStream: `${t}${
|
2974
|
+
dataStream: `${t}${ra}`,
|
2965
2975
|
textRuns: [
|
2966
2976
|
{
|
2967
2977
|
ts: {
|
2968
2978
|
fs: 11,
|
2969
2979
|
ff: void 0,
|
2970
|
-
it:
|
2971
|
-
bl:
|
2980
|
+
it: Jt.FALSE,
|
2981
|
+
bl: Jt.FALSE,
|
2972
2982
|
ul: {
|
2973
|
-
s:
|
2983
|
+
s: Jt.FALSE
|
2974
2984
|
},
|
2975
2985
|
st: {
|
2976
|
-
s:
|
2986
|
+
s: Jt.FALSE
|
2977
2987
|
},
|
2978
2988
|
ol: {
|
2979
|
-
s:
|
2989
|
+
s: Jt.FALSE
|
2980
2990
|
},
|
2981
2991
|
cl: void 0,
|
2982
2992
|
...e,
|
@@ -2996,22 +3006,22 @@ function _s(t, e) {
|
|
2996
3006
|
}
|
2997
3007
|
};
|
2998
3008
|
}
|
2999
|
-
function
|
3000
|
-
const n =
|
3009
|
+
function Ho(t, e, o) {
|
3010
|
+
const n = Ss(t, o), a = new ia(n), i = new pa(a);
|
3001
3011
|
return {
|
3002
|
-
documentSkeleton:
|
3012
|
+
documentSkeleton: ma.create(i, e),
|
3003
3013
|
docModel: a,
|
3004
3014
|
docViewModel: i
|
3005
3015
|
};
|
3006
3016
|
}
|
3007
|
-
function
|
3017
|
+
function pe(t, e, o) {
|
3008
3018
|
const {
|
3009
3019
|
documentSkeleton: n,
|
3010
3020
|
docModel: a,
|
3011
3021
|
docViewModel: i
|
3012
|
-
} =
|
3022
|
+
} = Ho(t, e, o);
|
3013
3023
|
return {
|
3014
|
-
documents: new
|
3024
|
+
documents: new ga(`DOCUMENTS_${qe.generateRandomId()}`, n, {
|
3015
3025
|
pageMarginLeft: 0,
|
3016
3026
|
pageMarginTop: 0
|
3017
3027
|
}),
|
@@ -3020,9 +3030,9 @@ function he(t, e, o) {
|
|
3020
3030
|
docViewModel: i
|
3021
3031
|
};
|
3022
3032
|
}
|
3023
|
-
function
|
3033
|
+
function kn(t, e, o, n, a, i, r = !0) {
|
3024
3034
|
let l = 0;
|
3025
|
-
const s = r ?
|
3035
|
+
const s = r ? Bt : 0;
|
3026
3036
|
switch (a) {
|
3027
3037
|
case ut.BOTTOM:
|
3028
3038
|
l = e - n - s;
|
@@ -3034,7 +3044,7 @@ function Nn(t, e, o, n, a, i, r = !0) {
|
|
3034
3044
|
l = s;
|
3035
3045
|
break;
|
3036
3046
|
}
|
3037
|
-
l = Math.max(
|
3047
|
+
l = Math.max(Bt, l);
|
3038
3048
|
let c = 0;
|
3039
3049
|
switch (i) {
|
3040
3050
|
case Wt.CENTER:
|
@@ -3049,13 +3059,11 @@ function Nn(t, e, o, n, a, i, r = !0) {
|
|
3049
3059
|
paddingTop: l
|
3050
3060
|
};
|
3051
3061
|
}
|
3052
|
-
let
|
3053
|
-
constructor(t, e) {
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
F(this, "onPointerLeave");
|
3058
|
-
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;
|
3059
3067
|
}
|
3060
3068
|
_ensureMap(t) {
|
3061
3069
|
let e = this._dropdownInfoMap.get(t);
|
@@ -3069,53 +3077,53 @@ let rn = class {
|
|
3069
3077
|
let u;
|
3070
3078
|
switch (i) {
|
3071
3079
|
case ut.MIDDLE:
|
3072
|
-
u = (n -
|
3080
|
+
u = (n - fe) / 2;
|
3073
3081
|
break;
|
3074
3082
|
case ut.BOTTOM:
|
3075
|
-
u = n - s - a -
|
3083
|
+
u = n - s - a - Bt + (a / 2 - fe / 2);
|
3076
3084
|
break;
|
3077
3085
|
default:
|
3078
|
-
u = l +
|
3086
|
+
u = l + Bt + (a / 2 - fe / 2);
|
3079
3087
|
break;
|
3080
3088
|
}
|
3081
|
-
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();
|
3082
3090
|
}
|
3083
3091
|
// eslint-disable-next-line max-lines-per-function, complexity
|
3084
3092
|
drawWith(t, e, o) {
|
3085
3093
|
var w, v;
|
3086
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 || {};
|
3087
|
-
if (!u || !h || !h || h.id.indexOf(
|
3095
|
+
if (!u || !h || !h || h.id.indexOf(nt.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
3088
3096
|
return;
|
3089
3097
|
const y = {
|
3090
3098
|
startX: c.startX + C,
|
3091
3099
|
endX: c.endX - m,
|
3092
3100
|
startY: c.startY + f,
|
3093
3101
|
endY: c.endY - D
|
3094
|
-
}, V = y.endX - y.startX, S = y.endY - y.startY, x = this._ensureMap(s),
|
3095
|
-
let { tb: A, vt: M, ht:
|
3096
|
-
if (A = A != null ? A : _t.WRAP, M = M != null ? M : ut.BOTTOM,
|
3097
|
-
const { l: g = lt.pd.l, t: I = lt.pd.t, r: _ = lt.pd.r, b:
|
3098
|
-
A === _t.WRAP && K.updateDocumentDataPageSize(Math.max(b, 1)),
|
3099
|
-
const G =
|
3100
|
-
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 -
|
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, {
|
3101
3109
|
left: y.endX + g + o.rowHeaderWidth - ht,
|
3102
3110
|
top: y.startY + I + o.columnHeaderHeight,
|
3103
3111
|
width: ht,
|
3104
|
-
height: S - I -
|
3112
|
+
height: S - I - $
|
3105
3113
|
});
|
3106
3114
|
} else {
|
3107
3115
|
t.save(), t.translateWithPrecision(y.startX, y.startY), t.beginPath(), t.rect(0, 0, V, S), t.clip();
|
3108
|
-
const g = V - ft * 2 -
|
3109
|
-
A === _t.WRAP &&
|
3110
|
-
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);
|
3111
3119
|
t.translateWithPrecision(ft, K);
|
3112
|
-
const Z = Math.max(V - ft * 2, 1), J =
|
3113
|
-
|
3120
|
+
const Z = Math.max(V - ft * 2, 1), J = U;
|
3121
|
+
zn.drawWith(t, {
|
3114
3122
|
width: Z,
|
3115
3123
|
height: J,
|
3116
|
-
fill: (j == null ? void 0 : j.color) ||
|
3117
|
-
radius:
|
3118
|
-
}), t.save(), t.translateWithPrecision(
|
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, {
|
3119
3127
|
left: y.startX + ft + o.rowHeaderWidth,
|
3120
3128
|
top: y.startY + K + o.columnHeaderHeight,
|
3121
3129
|
width: Z,
|
@@ -3137,17 +3145,17 @@ let rn = class {
|
|
3137
3145
|
let { tb: f, pd: D } = o || {};
|
3138
3146
|
const { t: y = lt.pd.t, b: V = lt.pd.b } = D != null ? D : {};
|
3139
3147
|
if (f = f != null ? f : _t.WRAP, u.renderMode === dt.ARROW) {
|
3140
|
-
const x = d - ht, { documentSkeleton:
|
3141
|
-
f === _t.WRAP &&
|
3142
|
-
const R =
|
3143
|
-
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;
|
3144
3152
|
} else {
|
3145
|
-
const x = d - ft * 2 -
|
3146
|
-
f === _t.WRAP &&
|
3147
|
-
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), {
|
3148
3156
|
height: P
|
3149
3157
|
} = R;
|
3150
|
-
return P +
|
3158
|
+
return P + Bt * 2;
|
3151
3159
|
}
|
3152
3160
|
}
|
3153
3161
|
calcCellAutoWidth(t) {
|
@@ -3169,13 +3177,13 @@ let rn = class {
|
|
3169
3177
|
S = ht + ft * 2 + V + y;
|
3170
3178
|
break;
|
3171
3179
|
case dt.CUSTOM:
|
3172
|
-
S = ht + ft * 2 +
|
3180
|
+
S = ht + ft * 2 + Et * 2 + V + y + We / 2 + 1;
|
3173
3181
|
break;
|
3174
3182
|
default:
|
3175
|
-
S = ht + ft * 2 +
|
3183
|
+
S = ht + ft * 2 + Et * 2 + V + y + We / 2 + 1;
|
3176
3184
|
}
|
3177
|
-
const x = d - S, { documentSkeleton:
|
3178
|
-
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;
|
3179
3187
|
}
|
3180
3188
|
isHit(t, e) {
|
3181
3189
|
const { data: o, subUnitId: n, row: a, col: i } = e, l = this._ensureMap(n).get(this._generateKey(a, i)), s = o.dataValidation;
|
@@ -3193,56 +3201,65 @@ let rn = class {
|
|
3193
3201
|
row: a,
|
3194
3202
|
column: i
|
3195
3203
|
};
|
3196
|
-
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);
|
3197
3213
|
}
|
3198
3214
|
};
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3215
|
+
ln = vs([
|
3216
|
+
He(0, Y(ot)),
|
3217
|
+
He(1, at),
|
3218
|
+
He(2, Y(Rt))
|
3219
|
+
], ln);
|
3220
|
+
class Cs extends mt {
|
3204
3221
|
constructor() {
|
3205
3222
|
super(...arguments);
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
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);
|
3211
3228
|
}
|
3212
3229
|
}
|
3213
|
-
class
|
3230
|
+
class ws extends mt {
|
3214
3231
|
constructor() {
|
3215
3232
|
super(...arguments);
|
3216
|
-
|
3217
|
-
|
3233
|
+
k(this, "id", nt.TEXT_LENGTH);
|
3234
|
+
k(this, "formulaInput", Le);
|
3218
3235
|
}
|
3219
3236
|
}
|
3220
|
-
class
|
3237
|
+
class Is extends mt {
|
3221
3238
|
constructor() {
|
3222
3239
|
super(...arguments);
|
3223
|
-
|
3224
|
-
|
3240
|
+
k(this, "id", nt.WHOLE);
|
3241
|
+
k(this, "formulaInput", Le);
|
3225
3242
|
}
|
3226
3243
|
}
|
3227
|
-
var
|
3228
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
3229
3246
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3230
|
-
return n && a &&
|
3231
|
-
},
|
3232
|
-
let
|
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 {
|
3233
3250
|
constructor(t, e, o) {
|
3234
3251
|
super(), this._injector = t, this._componentManger = e, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
3235
3252
|
}
|
3236
3253
|
_initComponents() {
|
3237
3254
|
[
|
3238
|
-
[
|
3239
|
-
[
|
3240
|
-
[
|
3241
|
-
[
|
3242
|
-
[$o,
|
3243
|
-
[
|
3244
|
-
[
|
3245
|
-
...
|
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
|
3246
3263
|
].forEach(([t, e]) => {
|
3247
3264
|
this.disposeWithMe(this._componentManger.register(
|
3248
3265
|
t,
|
@@ -3252,137 +3269,137 @@ let Kt = class extends ln {
|
|
3252
3269
|
}
|
3253
3270
|
_registerValidatorViews() {
|
3254
3271
|
[
|
3255
|
-
|
3272
|
+
is,
|
3273
|
+
Is,
|
3256
3274
|
ws,
|
3275
|
+
as,
|
3276
|
+
es,
|
3257
3277
|
Cs,
|
3258
|
-
|
3259
|
-
|
3260
|
-
Ss,
|
3261
|
-
fs,
|
3262
|
-
ts
|
3278
|
+
ps,
|
3279
|
+
ns
|
3263
3280
|
].forEach((t) => {
|
3264
3281
|
const e = this._injector.createInstance(t), o = this._dataValidatorRegistryService.getValidatorItem(e.id);
|
3265
3282
|
o && (o.formulaInput = e.formulaInput, o.canvasRender = e.canvasRender, o.dropdown = e.dropdown, o.optionsInput = e.optionsInput);
|
3266
3283
|
});
|
3267
3284
|
}
|
3268
3285
|
};
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
],
|
3274
|
-
var
|
3275
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
3276
3293
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3277
|
-
return n && a &&
|
3278
|
-
},
|
3279
|
-
const
|
3280
|
-
var
|
3281
|
-
let
|
3282
|
-
constructor(t =
|
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) {
|
3283
3300
|
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
3284
3301
|
const { menu: a, ...i } = this._config;
|
3285
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
3302
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(In, i);
|
3286
3303
|
}
|
3287
3304
|
onStarting() {
|
3288
3305
|
[
|
3289
3306
|
[pt],
|
3290
3307
|
[Ct],
|
3291
|
-
[
|
3292
|
-
[Ht],
|
3293
|
-
[zt],
|
3308
|
+
[re],
|
3294
3309
|
[Xt],
|
3295
|
-
[
|
3296
|
-
[
|
3297
|
-
[
|
3310
|
+
[Gt],
|
3311
|
+
[Kt],
|
3312
|
+
[zt],
|
3313
|
+
[ie],
|
3314
|
+
[Zt]
|
3298
3315
|
].forEach((t) => {
|
3299
3316
|
this._injector.add(t);
|
3300
3317
|
}), [
|
3301
3318
|
$e,
|
3302
|
-
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3319
|
+
Pe,
|
3320
|
+
To,
|
3321
|
+
wn,
|
3322
|
+
Nt,
|
3323
|
+
Oo
|
3307
3324
|
].forEach((t) => {
|
3308
3325
|
this._commandService.registerCommand(t);
|
3309
3326
|
});
|
3310
3327
|
}
|
3311
3328
|
onReady() {
|
3312
|
-
this._injector.get(
|
3313
|
-
|
3314
|
-
[
|
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]
|
3315
3332
|
);
|
3316
3333
|
}
|
3317
3334
|
onRendered() {
|
3318
|
-
this._injector.get(
|
3335
|
+
this._injector.get(Zt), this._injector.get(Gt);
|
3319
3336
|
}
|
3320
3337
|
onSteady() {
|
3321
|
-
this._injector.get(
|
3322
|
-
}
|
3323
|
-
},
|
3324
|
-
|
3325
|
-
|
3326
|
-
|
3327
|
-
|
3328
|
-
],
|
3329
|
-
var Os = Object.defineProperty,
|
3330
|
-
for (var a = n > 1 ? void 0 : n ?
|
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--)
|
3331
3348
|
(r = t[i]) && (a = (n ? r(e, o, a) : r(a)) || a);
|
3332
3349
|
return n && a && Os(e, o, a), a;
|
3333
|
-
},
|
3334
|
-
const
|
3335
|
-
var
|
3336
|
-
let
|
3337
|
-
constructor(t =
|
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) {
|
3338
3355
|
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
3339
3356
|
const { menu: a, ...i } = this._config;
|
3340
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
3357
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(In, i);
|
3341
3358
|
}
|
3342
3359
|
onStarting() {
|
3343
3360
|
[
|
3344
3361
|
[pt],
|
3345
3362
|
[Ct],
|
3346
|
-
[
|
3347
|
-
[Ht],
|
3348
|
-
[zt],
|
3363
|
+
[re],
|
3349
3364
|
[Xt],
|
3350
|
-
[
|
3351
|
-
[Kt]
|
3365
|
+
[Gt],
|
3366
|
+
[Kt],
|
3367
|
+
[zt],
|
3368
|
+
[Zt]
|
3352
3369
|
].forEach((t) => {
|
3353
3370
|
this._injector.add(t);
|
3354
3371
|
}), [
|
3355
3372
|
$e,
|
3356
|
-
|
3357
|
-
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3373
|
+
Pe,
|
3374
|
+
To,
|
3375
|
+
wn,
|
3376
|
+
Nt,
|
3377
|
+
Oo
|
3361
3378
|
].forEach((t) => {
|
3362
3379
|
this._commandService.registerCommand(t);
|
3363
3380
|
});
|
3364
3381
|
}
|
3365
3382
|
onReady() {
|
3366
|
-
this._injector.get(
|
3367
|
-
|
3368
|
-
[
|
3383
|
+
this._injector.get(zt), this._injector.get(Kt), this._injector.get(Rt).registerRenderModule(
|
3384
|
+
Q.UNIVER_SHEET,
|
3385
|
+
[Re]
|
3369
3386
|
);
|
3370
3387
|
}
|
3371
3388
|
onRendered() {
|
3372
|
-
this._injector.get(
|
3389
|
+
this._injector.get(Zt), this._injector.get(Gt);
|
3373
3390
|
}
|
3374
3391
|
onSteady() {
|
3375
|
-
this._injector.get(
|
3376
|
-
}
|
3377
|
-
},
|
3378
|
-
|
3379
|
-
|
3380
|
-
|
3381
|
-
|
3382
|
-
],
|
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);
|
3383
3400
|
export {
|
3384
3401
|
$o as DATE_DROPDOWN_KEY,
|
3385
|
-
|
3386
|
-
|
3387
|
-
|
3402
|
+
Dn as LIST_DROPDOWN_KEY,
|
3403
|
+
Hn as UniverSheetsDataValidationMobileUIPlugin,
|
3404
|
+
Bn as UniverSheetsDataValidationUIPlugin
|
3388
3405
|
};
|