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