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