@univerjs/sheets-data-validation-ui 0.5.0 → 0.5.1
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 +1036 -1034
- package/lib/es/locale/fr-FR.js +176 -0
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/controllers/dv-auto-fill.controller.d.ts +2 -2
- package/lib/types/index.d.ts +1 -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 +21 -19
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, CheckboxShape 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] =
|
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
|
-
},
|
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
|
-
onChange:
|
882
|
-
onFocus: () =>
|
883
|
-
isFocus:
|
884
|
-
actions:
|
885
|
-
onVerify: (
|
887
|
+
onChange: H,
|
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,139 +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
|
-
super(), this._autoFillService = e, this.
|
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:
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
), { row: k, col: X } = m(Y.startRow, Y.startColumn);
|
1207
|
-
v.setValue(k, X, W), w.add(W);
|
1208
|
-
}
|
1201
|
+
L
|
1202
|
+
), { row: x, col: j } = f(A.startRow, A.startColumn), F = this._sheetDataValidationModel.getRuleIdByLocation(l, s, x, j) || "", H = St.getPositionRange(
|
1203
|
+
{
|
1204
|
+
startRow: T,
|
1205
|
+
startColumn: E,
|
1206
|
+
endColumn: E,
|
1207
|
+
endRow: T
|
1208
|
+
},
|
1209
|
+
U
|
1210
|
+
), { row: X, col: k } = f(H.startRow, H.startColumn);
|
1211
|
+
w.setValue(X, k, F), S.add(F);
|
1209
1212
|
});
|
1210
1213
|
});
|
1211
|
-
const
|
1212
|
-
|
1213
|
-
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);
|
1214
1217
|
return {
|
1215
1218
|
undos: C,
|
1216
|
-
redos:
|
1219
|
+
redos: V
|
1217
1220
|
};
|
1218
|
-
}, o =
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
const u = this._dataValidationModel.getRuleByLocation(r, l, s, c);
|
1227
|
-
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) {
|
1228
1229
|
this._autoFillService.setDisableApplyType(et.SERIES, !0);
|
1229
1230
|
return;
|
1230
1231
|
}
|
1231
1232
|
}
|
1232
1233
|
},
|
1233
|
-
onFillData: (a, i
|
1234
|
+
onFillData: (n, a, i) => i === et.COPY || i === et.ONLY_FORMAT || i === et.SERIES ? t(n, i) : e(),
|
1234
1235
|
onAfterFillData: () => {
|
1235
1236
|
}
|
1236
1237
|
};
|
1237
|
-
this.disposeWithMe(this._autoFillService.addHook(
|
1238
|
+
this.disposeWithMe(this._autoFillService.addHook(o));
|
1238
1239
|
}
|
1239
1240
|
};
|
1240
|
-
Xe =
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1241
|
+
Xe = or([
|
1242
|
+
Nt(0, Oa),
|
1243
|
+
Nt(1, b(oe)),
|
1244
|
+
Nt(2, b(Fe))
|
1244
1245
|
], Xe);
|
1245
|
-
var
|
1246
|
-
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--)
|
1247
1248
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1248
|
-
return n && a &&
|
1249
|
-
},
|
1249
|
+
return n && a && ar(t, o, a), a;
|
1250
|
+
}, Ut = (e, t) => (o, n) => t(o, n, e);
|
1250
1251
|
let ze = class extends De {
|
1251
1252
|
constructor(t, o, n) {
|
1252
1253
|
super();
|
@@ -1255,22 +1256,22 @@ let ze = class extends De {
|
|
1255
1256
|
}
|
1256
1257
|
_initCopyPaste() {
|
1257
1258
|
this._sheetClipboardService.addClipboardHook({
|
1258
|
-
id:
|
1259
|
+
id: io,
|
1259
1260
|
onBeforeCopy: (t, o, n) => this._collect(t, o, n),
|
1260
1261
|
onPasteCells: (t, o, n, a) => {
|
1261
|
-
const { copyType: i =
|
1262
|
+
const { copyType: i = On.COPY, pasteType: r } = a, { range: l } = t || {}, { range: s, unitId: c, subUnitId: u } = o;
|
1262
1263
|
return this._generateMutations(s, { copyType: i, pasteType: r, copyRange: l, unitId: c, subUnitId: u });
|
1263
1264
|
}
|
1264
1265
|
});
|
1265
1266
|
}
|
1266
1267
|
_collect(t, o, n) {
|
1267
|
-
const a = new
|
1268
|
+
const a = new _t();
|
1268
1269
|
this._copyInfo = {
|
1269
1270
|
unitId: t,
|
1270
1271
|
subUnitId: o,
|
1271
1272
|
matrix: a
|
1272
1273
|
};
|
1273
|
-
const i = this._injector.invoke((s) =>
|
1274
|
+
const i = this._injector.invoke((s) => La(n, s, t, o));
|
1274
1275
|
if (!i)
|
1275
1276
|
return;
|
1276
1277
|
const { rows: r, cols: l } = i;
|
@@ -1285,42 +1286,42 @@ let ze = class extends De {
|
|
1285
1286
|
_generateMutations(t, o) {
|
1286
1287
|
if (!this._copyInfo)
|
1287
1288
|
return { redos: [], undos: [] };
|
1288
|
-
if (o.copyType ===
|
1289
|
+
if (o.copyType === On.CUT)
|
1289
1290
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1290
1291
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
|
1291
1292
|
return { redos: [], undos: [] };
|
1292
1293
|
if ([
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1294
|
+
lt.SPECIAL_PASTE_COL_WIDTH,
|
1295
|
+
lt.SPECIAL_PASTE_VALUE,
|
1296
|
+
lt.SPECIAL_PASTE_FORMAT,
|
1297
|
+
lt.SPECIAL_PASTE_FORMULA
|
1297
1298
|
].includes(
|
1298
1299
|
o.pasteType
|
1299
1300
|
))
|
1300
1301
|
return { redos: [], undos: [] };
|
1301
1302
|
const { unitId: n, subUnitId: a } = this._copyInfo;
|
1302
1303
|
if (o.unitId !== n || a !== o.subUnitId) {
|
1303
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), r = new
|
1304
|
-
p.forEach(({ startRange:
|
1305
|
-
var
|
1306
|
-
(
|
1307
|
-
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(
|
1308
1309
|
{
|
1309
|
-
startRow:
|
1310
|
-
endRow:
|
1310
|
+
startRow: R,
|
1311
|
+
endRow: R,
|
1311
1312
|
startColumn: I,
|
1312
1313
|
endColumn: I
|
1313
1314
|
},
|
1314
|
-
|
1315
|
-
),
|
1316
|
-
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId,
|
1317
|
-
const { row:
|
1318
|
-
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);
|
1319
1320
|
});
|
1320
1321
|
});
|
1321
|
-
const
|
1322
|
-
i.addRangeRules(
|
1323
|
-
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(
|
1324
1325
|
o.unitId,
|
1325
1326
|
o.subUnitId,
|
1326
1327
|
i.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), d.values()),
|
@@ -1330,28 +1331,28 @@ let ze = class extends De {
|
|
1330
1331
|
);
|
1331
1332
|
return {
|
1332
1333
|
redos: m,
|
1333
|
-
undos:
|
1334
|
+
undos: _
|
1334
1335
|
};
|
1335
1336
|
} else {
|
1336
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n, a).clone(), r = new
|
1337
|
-
|
1338
|
-
var
|
1339
|
-
(
|
1340
|
-
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(
|
1341
1342
|
{
|
1342
|
-
startRow:
|
1343
|
-
endRow:
|
1344
|
-
startColumn:
|
1345
|
-
endColumn:
|
1343
|
+
startRow: S,
|
1344
|
+
endRow: S,
|
1345
|
+
startColumn: R,
|
1346
|
+
endColumn: R
|
1346
1347
|
},
|
1347
|
-
|
1348
|
-
), { row:
|
1349
|
-
r.setValue(
|
1348
|
+
_
|
1349
|
+
), { row: C, col: g } = u(V.startRow, V.startColumn);
|
1350
|
+
r.setValue(C, g, I), l.add(I);
|
1350
1351
|
});
|
1351
1352
|
});
|
1352
|
-
const d = Array.from(l).map((
|
1353
|
+
const d = Array.from(l).map((_) => ({ id: _, ranges: qt(r, (w) => w === _) }));
|
1353
1354
|
i.addRangeRules(d);
|
1354
|
-
const { redoMutations:
|
1355
|
+
const { redoMutations: f, undoMutations: m } = nn(
|
1355
1356
|
n,
|
1356
1357
|
a,
|
1357
1358
|
i.diff(this._sheetDataValidationModel.getRules(n, a)),
|
@@ -1360,22 +1361,22 @@ let ze = class extends De {
|
|
1360
1361
|
!1
|
1361
1362
|
);
|
1362
1363
|
return {
|
1363
|
-
redos:
|
1364
|
+
redos: f,
|
1364
1365
|
undos: m
|
1365
1366
|
};
|
1366
1367
|
}
|
1367
1368
|
}
|
1368
1369
|
};
|
1369
|
-
ze =
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1370
|
+
ze = rr([
|
1371
|
+
Ut(0, Ta),
|
1372
|
+
Ut(1, b(oe)),
|
1373
|
+
Ut(2, b(Fe))
|
1373
1374
|
], ze);
|
1374
|
-
var
|
1375
|
-
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--)
|
1376
1377
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1377
|
-
return n && a &&
|
1378
|
-
},
|
1378
|
+
return n && a && sr(t, o, a), a;
|
1379
|
+
}, Bt = (e, t) => (o, n) => t(o, n, e);
|
1379
1380
|
let Ke = class extends De {
|
1380
1381
|
constructor(e, t, o) {
|
1381
1382
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionInterceptorBaseController = o, this._commandExecutedListener();
|
@@ -1383,82 +1384,82 @@ let Ke = class extends De {
|
|
1383
1384
|
_commandExecutedListener() {
|
1384
1385
|
this.disposeWithMe(
|
1385
1386
|
this._commandService.beforeCommandExecuted((e) => {
|
1386
|
-
e.id ===
|
1387
|
-
workbookTypes: [
|
1388
|
-
rangeTypes: [
|
1389
|
-
worksheetTypes: [
|
1390
|
-
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), e.id ===
|
1391
|
-
workbookTypes: [
|
1392
|
-
rangeTypes: [
|
1393
|
-
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]
|
1394
1395
|
}, e.params.ranges) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")));
|
1395
1396
|
})
|
1396
1397
|
);
|
1397
1398
|
}
|
1398
1399
|
};
|
1399
|
-
Ke =
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1400
|
+
Ke = dr([
|
1401
|
+
Bt(0, b(J)),
|
1402
|
+
Bt(1, Q),
|
1403
|
+
Bt(2, b(co))
|
1403
1404
|
], Ke);
|
1404
|
-
const
|
1405
|
-
function
|
1405
|
+
const Oo = "data-validation-single", Po = "sheet.menu.data-validation";
|
1406
|
+
function cr(e) {
|
1406
1407
|
return {
|
1407
|
-
id:
|
1408
|
-
type:
|
1409
|
-
icon:
|
1408
|
+
id: Po,
|
1409
|
+
type: vn.SUBITEMS,
|
1410
|
+
icon: Oo,
|
1410
1411
|
tooltip: "dataValidation.title",
|
1411
|
-
hidden$:
|
1412
|
-
disabled$:
|
1412
|
+
hidden$: Fa(e, Y.UNIVER_SHEET),
|
1413
|
+
disabled$: Aa(e, { workbookTypes: [Ct], worksheetTypes: [tn, wt], rangeTypes: [It] })
|
1413
1414
|
};
|
1414
1415
|
}
|
1415
|
-
function
|
1416
|
+
function ur(e) {
|
1416
1417
|
return {
|
1417
1418
|
id: Ue.id,
|
1418
1419
|
title: "dataValidation.panel.title",
|
1419
|
-
type:
|
1420
|
+
type: vn.BUTTON
|
1420
1421
|
};
|
1421
1422
|
}
|
1422
|
-
function
|
1423
|
+
function hr(e) {
|
1423
1424
|
return {
|
1424
1425
|
id: Lt.id,
|
1425
1426
|
title: "dataValidation.panel.add",
|
1426
|
-
type:
|
1427
|
+
type: vn.BUTTON
|
1427
1428
|
};
|
1428
1429
|
}
|
1429
|
-
const
|
1430
|
-
[
|
1431
|
-
[
|
1430
|
+
const pr = {
|
1431
|
+
[Na.FORMULAS_INSERT]: {
|
1432
|
+
[Po]: {
|
1432
1433
|
order: 9,
|
1433
|
-
menuItemFactory:
|
1434
|
+
menuItemFactory: cr,
|
1434
1435
|
[Ue.id]: {
|
1435
1436
|
order: 0,
|
1436
|
-
menuItemFactory:
|
1437
|
+
menuItemFactory: ur
|
1437
1438
|
},
|
1438
1439
|
[Lt.id]: {
|
1439
1440
|
order: 1,
|
1440
|
-
menuItemFactory:
|
1441
|
+
menuItemFactory: hr
|
1441
1442
|
}
|
1442
1443
|
}
|
1443
1444
|
}
|
1444
1445
|
};
|
1445
|
-
var
|
1446
|
-
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--)
|
1447
1448
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1448
|
-
return n && a &&
|
1449
|
+
return n && a && mr(t, o, a), a;
|
1449
1450
|
}, K = (e, t) => (o, n) => t(o, n, e);
|
1450
|
-
const
|
1451
|
+
const To = {
|
1451
1452
|
tr: {
|
1452
1453
|
size: 6,
|
1453
1454
|
color: "#fe4b4b"
|
1454
1455
|
}
|
1455
1456
|
};
|
1456
|
-
let Ge = class extends
|
1457
|
+
let Ge = class extends un {
|
1457
1458
|
constructor(e, t, o, n, a, i, r, l, s, c, u) {
|
1458
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();
|
1459
1460
|
}
|
1460
1461
|
_initMenu() {
|
1461
|
-
this._menuManagerService.mergeMenu(
|
1462
|
+
this._menuManagerService.mergeMenu(pr);
|
1462
1463
|
}
|
1463
1464
|
_initDropdown() {
|
1464
1465
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
|
@@ -1507,65 +1508,65 @@ let Ge = class extends cn {
|
|
1507
1508
|
_initViewModelIntercept() {
|
1508
1509
|
this.disposeWithMe(
|
1509
1510
|
this._sheetInterceptorService.intercept(
|
1510
|
-
|
1511
|
+
Jn.CELL_CONTENT,
|
1511
1512
|
{
|
1512
|
-
effect:
|
1513
|
+
effect: Xn.Style,
|
1513
1514
|
// must be after numfmt
|
1514
|
-
priority:
|
1515
|
+
priority: Qn.DATA_VALIDATION,
|
1515
1516
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1516
1517
|
handler: (e, t, o) => {
|
1517
|
-
var
|
1518
|
+
var S, R, I, V, C;
|
1518
1519
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1519
1520
|
if (!c)
|
1520
1521
|
return o(e);
|
1521
1522
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1522
1523
|
if (!u)
|
1523
1524
|
return o(e);
|
1524
|
-
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;
|
1525
1526
|
let m;
|
1526
|
-
const
|
1527
|
+
const _ = {
|
1527
1528
|
get value() {
|
1528
|
-
var
|
1529
|
-
return m !== void 0 || (m = (
|
1529
|
+
var g;
|
1530
|
+
return m !== void 0 || (m = (g = ie(f)) != null ? g : null), m;
|
1530
1531
|
}
|
1531
|
-
},
|
1532
|
+
}, w = {
|
1532
1533
|
get value() {
|
1533
|
-
var
|
1534
|
-
return `${(
|
1534
|
+
var g;
|
1535
|
+
return `${(g = _.value) != null ? g : ""}`;
|
1535
1536
|
}
|
1536
1537
|
};
|
1537
1538
|
return o({
|
1538
1539
|
...e,
|
1539
1540
|
markers: {
|
1540
1541
|
...e == null ? void 0 : e.markers,
|
1541
|
-
...p ===
|
1542
|
+
...p === it.INVALID ? To : null
|
1542
1543
|
},
|
1543
1544
|
customRender: [
|
1544
|
-
...(
|
1545
|
+
...(R = e == null ? void 0 : e.customRender) != null ? R : [],
|
1545
1546
|
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1546
1547
|
],
|
1547
1548
|
fontRenderExtension: {
|
1548
1549
|
...e == null ? void 0 : e.fontRenderExtension,
|
1549
|
-
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))
|
1550
1551
|
},
|
1551
1552
|
interceptorStyle: {
|
1552
1553
|
...e == null ? void 0 : e.interceptorStyle,
|
1553
|
-
...d == null ? void 0 : d.getExtraStyle(u,
|
1554
|
+
...d == null ? void 0 : d.getExtraStyle(u, w.value, {
|
1554
1555
|
get style() {
|
1555
|
-
const
|
1556
|
-
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) || {};
|
1557
1558
|
}
|
1558
1559
|
}, n, a)
|
1559
1560
|
},
|
1560
1561
|
interceptorAutoHeight: () => {
|
1561
|
-
var
|
1562
|
-
const
|
1563
|
-
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)
|
1564
1565
|
return;
|
1565
|
-
const
|
1566
|
+
const v = g.worksheet.getMergedCell(n, a), y = {
|
1566
1567
|
data: e,
|
1567
|
-
style:
|
1568
|
-
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),
|
1569
1570
|
unitId: i,
|
1570
1571
|
subUnitId: r,
|
1571
1572
|
row: n,
|
@@ -1573,17 +1574,17 @@ let Ge = class extends cn {
|
|
1573
1574
|
workbook: l,
|
1574
1575
|
worksheet: s
|
1575
1576
|
};
|
1576
|
-
return (x = (
|
1577
|
+
return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : x.call(A, y);
|
1577
1578
|
},
|
1578
1579
|
interceptorAutoWidth: () => {
|
1579
|
-
var
|
1580
|
-
const
|
1581
|
-
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)
|
1582
1583
|
return;
|
1583
|
-
const
|
1584
|
+
const v = g.worksheet.getMergedCell(n, a), y = {
|
1584
1585
|
data: e,
|
1585
|
-
style:
|
1586
|
-
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),
|
1587
1588
|
unitId: i,
|
1588
1589
|
subUnitId: r,
|
1589
1590
|
row: n,
|
@@ -1591,9 +1592,9 @@ let Ge = class extends cn {
|
|
1591
1592
|
workbook: l,
|
1592
1593
|
worksheet: s
|
1593
1594
|
};
|
1594
|
-
return (x = (
|
1595
|
+
return (x = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoWidth) == null ? void 0 : x.call(A, y);
|
1595
1596
|
},
|
1596
|
-
coverable: ((
|
1597
|
+
coverable: ((C = e == null ? void 0 : e.coverable) != null ? C : !0) && !(u.type === Z.LIST || u.type === Z.LIST_MULTIPLE)
|
1597
1598
|
});
|
1598
1599
|
}
|
1599
1600
|
}
|
@@ -1604,8 +1605,8 @@ let Ge = class extends cn {
|
|
1604
1605
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1605
1606
|
// patched data-validation change don't need to re-calc row height
|
1606
1607
|
// re-calc of row height will be triggered precisely by the origin command
|
1607
|
-
|
1608
|
-
|
1608
|
+
_n((e) => e.source === "command"),
|
1609
|
+
fo(16)
|
1609
1610
|
).subscribe((e) => {
|
1610
1611
|
const t = [];
|
1611
1612
|
if (e.forEach((o) => {
|
@@ -1613,78 +1614,78 @@ let Ge = class extends cn {
|
|
1613
1614
|
(n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1614
1615
|
}), t.length) {
|
1615
1616
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1616
|
-
|
1617
|
+
zn(o.redos, this._commandService);
|
1617
1618
|
}
|
1618
1619
|
});
|
1619
1620
|
}
|
1620
1621
|
};
|
1621
|
-
Ge =
|
1622
|
+
Ge = Lo([
|
1622
1623
|
K(0, Q),
|
1623
|
-
K(1,
|
1624
|
+
K(1, Ua),
|
1624
1625
|
K(2, Ve),
|
1625
1626
|
K(3, ge),
|
1626
|
-
K(4, b(
|
1627
|
+
K(4, b(uo)),
|
1627
1628
|
K(5, b(Ie)),
|
1628
1629
|
K(6, b(oe)),
|
1629
1630
|
K(7, b(ye)),
|
1630
|
-
K(8, b(
|
1631
|
-
K(9, b(
|
1632
|
-
K(10,
|
1631
|
+
K(8, b(pn)),
|
1632
|
+
K(9, b(ro)),
|
1633
|
+
K(10, Qo(lo))
|
1633
1634
|
], Ge);
|
1634
|
-
let
|
1635
|
+
let Un = class extends un {
|
1635
1636
|
constructor(e, t, o, n, a, i, r) {
|
1636
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();
|
1637
1638
|
}
|
1638
1639
|
_initViewModelIntercept() {
|
1639
1640
|
this.disposeWithMe(
|
1640
1641
|
this._sheetInterceptorService.intercept(
|
1641
|
-
|
1642
|
+
Jn.CELL_CONTENT,
|
1642
1643
|
{
|
1643
|
-
effect:
|
1644
|
+
effect: Xn.Style,
|
1644
1645
|
// must be after numfmt
|
1645
|
-
priority:
|
1646
|
+
priority: Qn.DATA_VALIDATION,
|
1646
1647
|
// eslint-disable-next-line complexity
|
1647
1648
|
handler: (e, t, o) => {
|
1648
|
-
var
|
1649
|
+
var w, S, R, I, V;
|
1649
1650
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1650
1651
|
if (!c)
|
1651
1652
|
return o(e);
|
1652
1653
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1653
1654
|
if (!u)
|
1654
1655
|
return o(e);
|
1655
|
-
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 : ""}`;
|
1656
1657
|
return o({
|
1657
1658
|
...e,
|
1658
1659
|
markers: {
|
1659
1660
|
...e == null ? void 0 : e.markers,
|
1660
|
-
...p ===
|
1661
|
+
...p === it.INVALID ? To : null
|
1661
1662
|
},
|
1662
1663
|
customRender: [
|
1663
|
-
...(
|
1664
|
+
...(S = e == null ? void 0 : e.customRender) != null ? S : [],
|
1664
1665
|
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1665
1666
|
],
|
1666
1667
|
fontRenderExtension: {
|
1667
1668
|
...e == null ? void 0 : e.fontRenderExtension,
|
1668
|
-
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))
|
1669
1670
|
},
|
1670
1671
|
interceptorStyle: {
|
1671
1672
|
...e == null ? void 0 : e.interceptorStyle,
|
1672
|
-
...d == null ? void 0 : d.getExtraStyle(u,
|
1673
|
+
...d == null ? void 0 : d.getExtraStyle(u, _, {
|
1673
1674
|
get style() {
|
1674
|
-
const
|
1675
|
-
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) || {};
|
1676
1677
|
}
|
1677
1678
|
}, n, a)
|
1678
1679
|
},
|
1679
1680
|
interceptorAutoHeight: () => {
|
1680
|
-
var
|
1681
|
-
const
|
1682
|
-
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)
|
1683
1684
|
return;
|
1684
|
-
const
|
1685
|
+
const g = C.worksheet.getMergedCell(n, a), v = {
|
1685
1686
|
data: e,
|
1686
|
-
style:
|
1687
|
-
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),
|
1688
1689
|
unitId: i,
|
1689
1690
|
subUnitId: r,
|
1690
1691
|
row: n,
|
@@ -1692,9 +1693,9 @@ let jn = class extends cn {
|
|
1692
1693
|
workbook: l,
|
1693
1694
|
worksheet: s
|
1694
1695
|
};
|
1695
|
-
return (
|
1696
|
+
return (A = (E = d == null ? void 0 : d.canvasRender) == null ? void 0 : E.calcCellAutoHeight) == null ? void 0 : A.call(E, v);
|
1696
1697
|
},
|
1697
|
-
coverable: ((
|
1698
|
+
coverable: ((V = e == null ? void 0 : e.coverable) != null ? V : !0) && !(u.type === Z.LIST || u.type === Z.LIST_MULTIPLE)
|
1698
1699
|
});
|
1699
1700
|
}
|
1700
1701
|
}
|
@@ -1703,8 +1704,8 @@ let jn = class extends cn {
|
|
1703
1704
|
}
|
1704
1705
|
_initAutoHeight() {
|
1705
1706
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1706
|
-
|
1707
|
-
|
1707
|
+
_n((e) => e.source === "command"),
|
1708
|
+
fo(16)
|
1708
1709
|
).subscribe((e) => {
|
1709
1710
|
const t = [];
|
1710
1711
|
if (e.forEach((o) => {
|
@@ -1712,26 +1713,26 @@ let jn = class extends cn {
|
|
1712
1713
|
(n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1713
1714
|
}), t.length) {
|
1714
1715
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1715
|
-
|
1716
|
+
zn(o.redos, this._commandService);
|
1716
1717
|
}
|
1717
1718
|
});
|
1718
1719
|
}
|
1719
1720
|
};
|
1720
|
-
|
1721
|
+
Un = Lo([
|
1721
1722
|
K(0, Q),
|
1722
1723
|
K(1, Ve),
|
1723
|
-
K(2, b(
|
1724
|
+
K(2, b(uo)),
|
1724
1725
|
K(3, b(ye)),
|
1725
|
-
K(4, b(
|
1726
|
+
K(4, b(pn)),
|
1726
1727
|
K(5, b(oe)),
|
1727
|
-
K(6, b(
|
1728
|
-
],
|
1729
|
-
var
|
1730
|
-
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--)
|
1731
1732
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1732
|
-
return n && a &&
|
1733
|
-
},
|
1734
|
-
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 {
|
1735
1736
|
constructor(e, t, o) {
|
1736
1737
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
1737
1738
|
}
|
@@ -1748,25 +1749,25 @@ let Rt = class extends De {
|
|
1748
1749
|
(i = this._sheetSkeletonManagerService.getWorksheetSkeleton(a)) == null || i.skeleton.makeDirty(!0);
|
1749
1750
|
}), (n = this._context.mainComponent) == null || n.makeForceDirty();
|
1750
1751
|
};
|
1751
|
-
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(
|
1752
|
+
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(ea(16)).subscribe(e));
|
1752
1753
|
}
|
1753
1754
|
};
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
],
|
1758
|
-
const
|
1759
|
-
dataValidationFormula:
|
1760
|
-
dataValidationFormulaAnd:
|
1761
|
-
dataValidationFormulaListItem:
|
1762
|
-
dataValidationFormulaListItemIcon:
|
1763
|
-
dataValidationFormulaListItemDrag:
|
1764
|
-
dataValidationFormulaListAdd:
|
1765
|
-
dataValidationFormulaColorSelect:
|
1766
|
-
dataValidationFormulaColorSelectPanel:
|
1767
|
-
dataValidationFormulaColorItem:
|
1768
|
-
},
|
1769
|
-
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 : "";
|
1770
1771
|
return t ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
1771
1772
|
/* @__PURE__ */ h.jsx(G, { error: l, children: /* @__PURE__ */ h.jsx(
|
1772
1773
|
xe,
|
@@ -1809,11 +1810,11 @@ const wr = "univer-data-validation-formula", Rr = "univer-data-validation-formul
|
|
1809
1810
|
}
|
1810
1811
|
) });
|
1811
1812
|
};
|
1812
|
-
function
|
1813
|
-
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));
|
1814
1815
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
1815
1816
|
/* @__PURE__ */ h.jsx(G, { children: /* @__PURE__ */ h.jsx(
|
1816
|
-
|
1817
|
+
bt,
|
1817
1818
|
{
|
1818
1819
|
checked: s,
|
1819
1820
|
onChange: (u) => {
|
@@ -1856,25 +1857,25 @@ function Lr(e) {
|
|
1856
1857
|
) }) : null
|
1857
1858
|
] });
|
1858
1859
|
}
|
1859
|
-
function
|
1860
|
+
function Or(e) {
|
1860
1861
|
var p;
|
1861
|
-
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] =
|
1862
|
-
return
|
1862
|
+
const { unitId: t, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = e, l = i ? r == null ? void 0 : r.formula1 : void 0, s = We({}), [c, u] = W(!1);
|
1863
|
+
return gn((d) => {
|
1863
1864
|
var m;
|
1864
|
-
const
|
1865
|
-
|
1865
|
+
const f = (m = s.current) == null ? void 0 : m.handleOutClick;
|
1866
|
+
f && f(d, () => u(!1));
|
1866
1867
|
}), /* @__PURE__ */ h.jsx(
|
1867
|
-
|
1868
|
+
vo,
|
1868
1869
|
{
|
1869
1870
|
initValue: (p = n == null ? void 0 : n.formula1) != null ? p : "",
|
1870
1871
|
unitId: t,
|
1871
1872
|
subUnitId: o,
|
1872
1873
|
isFocus: c,
|
1873
1874
|
onChange: (d) => {
|
1874
|
-
const
|
1875
|
-
|
1875
|
+
const f = (d != null ? d : "").trim();
|
1876
|
+
f !== (n == null ? void 0 : n.formula1) && (a == null || a({
|
1876
1877
|
...n,
|
1877
|
-
formula1:
|
1878
|
+
formula1: f
|
1878
1879
|
}));
|
1879
1880
|
},
|
1880
1881
|
errorText: l,
|
@@ -1884,20 +1885,20 @@ function Tr(e) {
|
|
1884
1885
|
}
|
1885
1886
|
);
|
1886
1887
|
}
|
1887
|
-
function
|
1888
|
+
function Ao(e) {
|
1888
1889
|
var t, o, n = "";
|
1889
1890
|
if (typeof e == "string" || typeof e == "number") n += e;
|
1890
1891
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
1891
1892
|
var a = e.length;
|
1892
|
-
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);
|
1893
1894
|
} else for (o in e) e[o] && (n && (n += " "), n += o);
|
1894
1895
|
return n;
|
1895
1896
|
}
|
1896
|
-
function
|
1897
|
-
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);
|
1898
1899
|
return n;
|
1899
1900
|
}
|
1900
|
-
const
|
1901
|
+
const Lr = [
|
1901
1902
|
"#FFFFFF",
|
1902
1903
|
"#FEE7E7",
|
1903
1904
|
"#FEF0E6",
|
@@ -1922,10 +1923,10 @@ const xr = [
|
|
1922
1923
|
"#3A60F7",
|
1923
1924
|
"#9E6DE3",
|
1924
1925
|
"#F248A6"
|
1925
|
-
],
|
1926
|
-
const { value: t, onChange: o, disabled: n } = e, [a, i] =
|
1926
|
+
], Tr = (e) => {
|
1927
|
+
const { value: t, onChange: o, disabled: n } = e, [a, i] = W(!1);
|
1927
1928
|
return /* @__PURE__ */ h.jsx(
|
1928
|
-
|
1929
|
+
Qt,
|
1929
1930
|
{
|
1930
1931
|
disabled: n,
|
1931
1932
|
open: a,
|
@@ -1942,7 +1943,7 @@ const xr = [
|
|
1942
1943
|
style: { background: r.value, marginTop: 5 }
|
1943
1944
|
}
|
1944
1945
|
),
|
1945
|
-
dropdownRender: () => /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaColorSelectPanel, children:
|
1946
|
+
dropdownRender: () => /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaColorSelectPanel, children: Lr.map(
|
1946
1947
|
(r) => /* @__PURE__ */ h.jsx(
|
1947
1948
|
"div",
|
1948
1949
|
{
|
@@ -1957,12 +1958,12 @@ const xr = [
|
|
1957
1958
|
) })
|
1958
1959
|
}
|
1959
1960
|
);
|
1960
|
-
},
|
1961
|
+
}, $n = (e) => {
|
1961
1962
|
const { item: t, commonProps: o, style: n } = e, { onItemChange: a, onItemDelete: i } = o;
|
1962
1963
|
return /* @__PURE__ */ h.jsxs("div", { className: ne.dataValidationFormulaListItem, style: n, children: [
|
1963
|
-
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, {}) }),
|
1964
1965
|
/* @__PURE__ */ h.jsx(
|
1965
|
-
|
1966
|
+
Tr,
|
1966
1967
|
{
|
1967
1968
|
value: t.color,
|
1968
1969
|
onChange: (r) => {
|
@@ -1980,81 +1981,81 @@ const xr = [
|
|
1980
1981
|
}
|
1981
1982
|
}
|
1982
1983
|
),
|
1983
|
-
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) }) })
|
1984
1985
|
] });
|
1985
1986
|
};
|
1986
|
-
function
|
1987
|
+
function Ar(e) {
|
1987
1988
|
const { value: t, onChange: o = () => {
|
1988
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = We(null), [p, d] =
|
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);
|
1989
1990
|
Ce(() => {
|
1990
1991
|
(async () => {
|
1991
1992
|
await new Promise((B) => {
|
1992
1993
|
setTimeout(() => B(!0), 100);
|
1993
1994
|
});
|
1994
|
-
const D = I.getRuleById(n, a, l),
|
1995
|
-
if (Pe(
|
1996
|
-
const B = await
|
1997
|
-
|
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);
|
1998
1999
|
}
|
1999
2000
|
})();
|
2000
|
-
}, [I, x,
|
2001
|
-
Pe(s) && s !==
|
2002
|
-
}, [
|
2003
|
-
const [
|
2004
|
-
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(",");
|
2005
2006
|
return D.map((B, $) => ({
|
2006
2007
|
label: B,
|
2007
|
-
color:
|
2008
|
+
color: N[$] || Le,
|
2008
2009
|
isRef: !1,
|
2009
|
-
id:
|
2010
|
+
id: Jt.generateRandomId(4)
|
2010
2011
|
}));
|
2011
|
-
}),
|
2012
|
-
const $ =
|
2013
|
-
$ && ($.label =
|
2012
|
+
}), X = (D, N, B) => {
|
2013
|
+
const $ = F.find((_e) => _e.id === D);
|
2014
|
+
$ && ($.label = N, $.color = B, H([...F]));
|
2014
2015
|
}, k = (D) => {
|
2015
|
-
const
|
2016
|
-
|
2017
|
-
},
|
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) => ({
|
2018
2019
|
label: D,
|
2019
|
-
color:
|
2020
|
-
id: `${
|
2020
|
+
color: z[N] || Le,
|
2021
|
+
id: `${N}`,
|
2021
2022
|
isRef: !0
|
2022
|
-
})), [
|
2023
|
-
const $ = [...
|
2024
|
-
$[+D] = B,
|
2023
|
+
})), [z, y]), ee = (D, N, B) => {
|
2024
|
+
const $ = [...C];
|
2025
|
+
$[+D] = B, g($), j({
|
2025
2026
|
formula1: s,
|
2026
2027
|
formula2: $.join(",")
|
2027
2028
|
});
|
2028
2029
|
}, te = () => {
|
2029
|
-
|
2030
|
-
...
|
2030
|
+
H([
|
2031
|
+
...F,
|
2031
2032
|
{
|
2032
2033
|
label: "",
|
2033
2034
|
color: Le,
|
2034
2035
|
isRef: !1,
|
2035
|
-
id:
|
2036
|
+
id: Jt.generateRandomId(4)
|
2036
2037
|
}
|
2037
2038
|
]);
|
2038
2039
|
};
|
2039
2040
|
Ce(() => {
|
2040
2041
|
if (p === "1")
|
2041
2042
|
return;
|
2042
|
-
const D = /* @__PURE__ */ new Set(),
|
2043
|
-
|
2043
|
+
const D = /* @__PURE__ */ new Set(), N = [];
|
2044
|
+
F.map((B) => ({
|
2044
2045
|
labelList: B.label.split(","),
|
2045
2046
|
item: B
|
2046
2047
|
})).forEach(({ item: B, labelList: $ }) => {
|
2047
2048
|
$.forEach((_e) => {
|
2048
|
-
D.has(_e) || (D.add(_e),
|
2049
|
+
D.has(_e) || (D.add(_e), N.push({
|
2049
2050
|
label: _e,
|
2050
2051
|
color: B.color
|
2051
2052
|
}));
|
2052
2053
|
});
|
2053
2054
|
}), j({
|
2054
|
-
formula1:
|
2055
|
-
formula2:
|
2055
|
+
formula1: to(N.map((B) => B.label)),
|
2056
|
+
formula2: N.map((B) => B.color === Le ? "" : B.color).join(",")
|
2056
2057
|
});
|
2057
|
-
}, [
|
2058
|
+
}, [F, j, p, _, C]);
|
2058
2059
|
const re = Te(
|
2059
2060
|
() => async (D) => {
|
2060
2061
|
if (!Pe(D)) {
|
@@ -2064,71 +2065,71 @@ function Fr(e) {
|
|
2064
2065
|
});
|
2065
2066
|
return;
|
2066
2067
|
}
|
2067
|
-
|
2068
|
+
V.getFormulaRefCheck(D) ? (j == null || j({
|
2068
2069
|
formula1: Pe(D) ? D : "",
|
2069
2070
|
formula2: c
|
2070
|
-
}),
|
2071
|
+
}), T("")) : (j == null || j({
|
2071
2072
|
formula1: "",
|
2072
2073
|
formula2: c
|
2073
|
-
}), m("="),
|
2074
|
+
}), m("="), T(S.t("dataValidation.validFail.formulaError")));
|
2074
2075
|
},
|
2075
2076
|
[c, j]
|
2076
|
-
), ae = We({}), [se,
|
2077
|
-
return
|
2077
|
+
), ae = We({}), [se, O] = W(!1);
|
2078
|
+
return gn((D) => {
|
2078
2079
|
var B;
|
2079
|
-
const
|
2080
|
-
|
2080
|
+
const N = (B = ae.current) == null ? void 0 : B.handleOutClick;
|
2081
|
+
N && N(D, () => O(!1));
|
2081
2082
|
}), /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
2082
|
-
/* @__PURE__ */ h.jsx(G, { label:
|
2083
|
-
|
2083
|
+
/* @__PURE__ */ h.jsx(G, { label: S.t("dataValidation.list.options"), children: /* @__PURE__ */ h.jsxs(
|
2084
|
+
hn,
|
2084
2085
|
{
|
2085
2086
|
value: p,
|
2086
2087
|
onChange: (D) => {
|
2087
|
-
d(D), m(
|
2088
|
-
formula1:
|
2089
|
-
formula2:
|
2088
|
+
d(D), m(_), D === "1" && j({
|
2089
|
+
formula1: _ === "=" ? "" : _,
|
2090
|
+
formula2: C.join(",")
|
2090
2091
|
});
|
2091
2092
|
},
|
2092
2093
|
children: [
|
2093
|
-
/* @__PURE__ */ h.jsx(Ae, { value: "0", children:
|
2094
|
-
/* @__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") })
|
2095
2096
|
]
|
2096
2097
|
}
|
2097
2098
|
) }),
|
2098
2099
|
p === "1" ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
2099
2100
|
/* @__PURE__ */ h.jsx(
|
2100
|
-
|
2101
|
+
vo,
|
2101
2102
|
{
|
2102
|
-
initValue:
|
2103
|
+
initValue: f,
|
2103
2104
|
unitId: n,
|
2104
2105
|
subUnitId: a,
|
2105
2106
|
isFocus: se,
|
2106
2107
|
onChange: (D = "") => {
|
2107
|
-
const
|
2108
|
-
|
2108
|
+
const N = (D != null ? D : "").trim();
|
2109
|
+
w(N), re(N);
|
2109
2110
|
},
|
2110
|
-
errorText: E ||
|
2111
|
-
onFocus: () =>
|
2111
|
+
errorText: E || U || void 0,
|
2112
|
+
onFocus: () => O(!0),
|
2112
2113
|
actions: ae.current,
|
2113
2114
|
isSupportAcrossSheet: !0
|
2114
2115
|
}
|
2115
2116
|
),
|
2116
|
-
/* @__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)) })
|
2117
2118
|
] }) : /* @__PURE__ */ h.jsx(G, { error: E, children: /* @__PURE__ */ h.jsxs("div", { ref: u, style: { marginTop: "-12px" }, children: [
|
2118
2119
|
/* @__PURE__ */ h.jsx(
|
2119
|
-
|
2120
|
+
ra,
|
2120
2121
|
{
|
2121
|
-
list:
|
2122
|
-
onListChange:
|
2122
|
+
list: F,
|
2123
|
+
onListChange: H,
|
2123
2124
|
rowHeight: 32,
|
2124
2125
|
margin: [0, 12],
|
2125
2126
|
draggableHandle: ".draggableHandle",
|
2126
2127
|
itemRender: (D) => /* @__PURE__ */ h.jsx(
|
2127
|
-
|
2128
|
+
$n,
|
2128
2129
|
{
|
2129
2130
|
item: D,
|
2130
2131
|
commonProps: {
|
2131
|
-
onItemChange:
|
2132
|
+
onItemChange: X,
|
2132
2133
|
onItemDelete: k
|
2133
2134
|
}
|
2134
2135
|
},
|
@@ -2138,46 +2139,46 @@ function Fr(e) {
|
|
2138
2139
|
}
|
2139
2140
|
),
|
2140
2141
|
/* @__PURE__ */ h.jsxs("a", { className: ne.dataValidationFormulaListAdd, onClick: te, children: [
|
2141
|
-
/* @__PURE__ */ h.jsx(
|
2142
|
-
|
2142
|
+
/* @__PURE__ */ h.jsx(Io, {}),
|
2143
|
+
S.t("dataValidation.list.add")
|
2143
2144
|
] })
|
2144
2145
|
] }) })
|
2145
2146
|
] });
|
2146
2147
|
}
|
2147
|
-
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 = [
|
2148
2149
|
[
|
2149
|
-
|
2150
|
-
|
2150
|
+
xo,
|
2151
|
+
Or
|
2151
2152
|
],
|
2152
2153
|
[
|
2153
2154
|
Tt,
|
2154
|
-
|
2155
|
+
br
|
2155
2156
|
],
|
2156
2157
|
[
|
2157
|
-
|
2158
|
-
|
2158
|
+
Vn,
|
2159
|
+
Ar
|
2159
2160
|
],
|
2160
2161
|
[
|
2161
|
-
|
2162
|
-
|
2162
|
+
jo,
|
2163
|
+
Er
|
2163
2164
|
]
|
2164
|
-
],
|
2165
|
-
function
|
2165
|
+
], jr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2166
|
+
function Vt(e) {
|
2166
2167
|
var a;
|
2167
|
-
const { value: t, onChange: o } = e, n =
|
2168
|
-
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: [
|
2169
2170
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2170
2171
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2171
2172
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2172
2173
|
] }) });
|
2173
2174
|
}
|
2174
|
-
|
2175
|
-
const
|
2176
|
-
function
|
2175
|
+
Vt.componentKey = jr;
|
2176
|
+
const Fr = "DATE_SHOW_TIME_OPTION";
|
2177
|
+
function yt(e) {
|
2177
2178
|
var a;
|
2178
|
-
const { value: t, onChange: o } = e, n =
|
2179
|
+
const { value: t, onChange: o } = e, n = P(J);
|
2179
2180
|
return /* @__PURE__ */ h.jsx(G, { children: /* @__PURE__ */ h.jsx(
|
2180
|
-
|
2181
|
+
bt,
|
2181
2182
|
{
|
2182
2183
|
checked: (a = t.bizInfo) == null ? void 0 : a.showTime,
|
2183
2184
|
onChange: (i) => {
|
@@ -2193,20 +2194,20 @@ function Vt(e) {
|
|
2193
2194
|
}
|
2194
2195
|
) });
|
2195
2196
|
}
|
2196
|
-
|
2197
|
-
var
|
2198
|
-
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--)
|
2199
2200
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2200
|
-
return n && a &&
|
2201
|
-
},
|
2202
|
-
const
|
2203
|
-
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 {
|
2204
2205
|
constructor(e, t, o, n, a) {
|
2205
2206
|
this._commandService = e, this._formulaService = t, this._themeService = o, this._renderManagerService = n, this._dataValidationModel = a;
|
2206
2207
|
}
|
2207
2208
|
_calc(e, t) {
|
2208
2209
|
var c, u, p;
|
2209
|
-
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;
|
2210
2211
|
let l = 0, s = 0;
|
2211
2212
|
switch (o) {
|
2212
2213
|
case ue.TOP:
|
@@ -2221,13 +2222,13 @@ let an = class {
|
|
2221
2222
|
}
|
2222
2223
|
switch (n) {
|
2223
2224
|
case He.LEFT:
|
2224
|
-
l =
|
2225
|
+
l = ht;
|
2225
2226
|
break;
|
2226
2227
|
case He.RIGHT:
|
2227
|
-
l =
|
2228
|
+
l = ht + (a - r);
|
2228
2229
|
break;
|
2229
2230
|
default:
|
2230
|
-
l =
|
2231
|
+
l = ht + (a - r) / 2;
|
2231
2232
|
break;
|
2232
2233
|
}
|
2233
2234
|
return {
|
@@ -2248,28 +2249,28 @@ let an = class {
|
|
2248
2249
|
return ((o = t == null ? void 0 : t.fs) != null ? o : 10) * 1.6;
|
2249
2250
|
}
|
2250
2251
|
async _parseFormula(e, t, o) {
|
2251
|
-
var c, u, p, d,
|
2252
|
-
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));
|
2253
2254
|
return {
|
2254
|
-
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,
|
2255
2256
|
formula2: Pe(a) ? l : a,
|
2256
2257
|
isFormulaValid: s
|
2257
2258
|
};
|
2258
2259
|
}
|
2259
2260
|
drawWith(e, t) {
|
2260
|
-
var E,
|
2261
|
+
var E, A, x, j;
|
2261
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);
|
2262
2263
|
if (!p)
|
2263
2264
|
return;
|
2264
2265
|
const d = this._dataValidationModel.getValidator(p.type);
|
2265
2266
|
if (!d)
|
2266
2267
|
return;
|
2267
|
-
const
|
2268
|
+
const f = this._themeService.getCurrentTheme();
|
2268
2269
|
if (!((E = d.skipDefaultFontRender) != null && E.call(d, p, u, { unitId: a, subUnitId: i, row: l, column: s })))
|
2269
2270
|
return;
|
2270
|
-
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({
|
2271
2272
|
left: I,
|
2272
|
-
top:
|
2273
|
+
top: V,
|
2273
2274
|
scaleX: 1,
|
2274
2275
|
scaleY: 1,
|
2275
2276
|
angle: 0,
|
@@ -2277,16 +2278,16 @@ let an = class {
|
|
2277
2278
|
skewY: 0,
|
2278
2279
|
flipX: !1,
|
2279
2280
|
flipY: !1
|
2280
|
-
}),
|
2281
|
-
e.save(), e.beginPath(), e.rect(c.startX, c.startY,
|
2282
|
-
const
|
2283
|
-
e.transform(
|
2284
|
-
const
|
2285
|
-
|
2286
|
-
checked:
|
2287
|
-
width:
|
2288
|
-
height:
|
2289
|
-
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
|
2290
2291
|
}), e.restore();
|
2291
2292
|
}
|
2292
2293
|
isHit(e, t) {
|
@@ -2303,7 +2304,7 @@ let an = class {
|
|
2303
2304
|
const u = this._dataValidationModel.getValidator(c.type);
|
2304
2305
|
if (!u || !((m = u.skipDefaultFontRender) != null && m.call(u, c, s, { unitId: n, subUnitId: a, row: r, column: l })))
|
2305
2306
|
return;
|
2306
|
-
const { formula1: p, formula2: d } = await this._parseFormula(c, n, a),
|
2307
|
+
const { formula1: p, formula2: d } = await this._parseFormula(c, n, a), f = {
|
2307
2308
|
range: {
|
2308
2309
|
startColumn: o.actualColumn,
|
2309
2310
|
endColumn: o.actualColumn,
|
@@ -2311,141 +2312,141 @@ let an = class {
|
|
2311
2312
|
endRow: o.actualRow
|
2312
2313
|
},
|
2313
2314
|
value: {
|
2314
|
-
v: String(s) ===
|
2315
|
+
v: String(s) === Ia(String(p)) ? d : p,
|
2315
2316
|
p: null
|
2316
2317
|
}
|
2317
2318
|
};
|
2318
2319
|
this._commandService.executeCommand(
|
2319
|
-
|
2320
|
-
|
2320
|
+
mn.id,
|
2321
|
+
f
|
2321
2322
|
);
|
2322
2323
|
}
|
2323
2324
|
onPointerEnter(e, t) {
|
2324
2325
|
var o, n;
|
2325
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2326
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.POINTER);
|
2326
2327
|
}
|
2327
2328
|
onPointerLeave(e, t) {
|
2328
2329
|
var o, n;
|
2329
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2330
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2330
2331
|
}
|
2331
2332
|
};
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
],
|
2339
|
-
var
|
2340
|
-
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--)
|
2341
2342
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2342
|
-
return n && a &&
|
2343
|
-
},
|
2343
|
+
return n && a && $r(t, o, a), a;
|
2344
|
+
}, Hr = (e, t) => (o, n) => t(o, n, e);
|
2344
2345
|
let fe = class {
|
2345
2346
|
constructor(e) {
|
2346
2347
|
M(this, "canvasRender", null);
|
2347
2348
|
M(this, "dropdown");
|
2348
2349
|
M(this, "optionsInput");
|
2349
|
-
M(this, "formulaInput",
|
2350
|
+
M(this, "formulaInput", Vn);
|
2350
2351
|
this.injector = e;
|
2351
2352
|
}
|
2352
2353
|
};
|
2353
|
-
fe =
|
2354
|
-
|
2354
|
+
fe = Wr([
|
2355
|
+
Hr(0, b(Fe))
|
2355
2356
|
], fe);
|
2356
|
-
class
|
2357
|
+
class Yr extends fe {
|
2357
2358
|
constructor() {
|
2358
2359
|
super(...arguments);
|
2359
2360
|
M(this, "id", Z.CHECKBOX);
|
2360
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2361
|
-
M(this, "formulaInput",
|
2361
|
+
M(this, "canvasRender", this.injector.createInstance(rn));
|
2362
|
+
M(this, "formulaInput", jo);
|
2362
2363
|
}
|
2363
2364
|
}
|
2364
|
-
class
|
2365
|
+
class Xr extends fe {
|
2365
2366
|
constructor() {
|
2366
2367
|
super(...arguments);
|
2367
2368
|
M(this, "id", Z.CUSTOM);
|
2368
|
-
M(this, "formulaInput",
|
2369
|
+
M(this, "formulaInput", xo);
|
2369
2370
|
}
|
2370
2371
|
}
|
2371
|
-
const
|
2372
|
-
class
|
2372
|
+
const zr = "data-validation.formula-input";
|
2373
|
+
class Kr extends fe {
|
2373
2374
|
constructor() {
|
2374
2375
|
super(...arguments);
|
2375
2376
|
M(this, "id", Z.DATE);
|
2376
|
-
M(this, "formulaInput",
|
2377
|
-
M(this, "optionsInput",
|
2378
|
-
M(this, "dropdown",
|
2377
|
+
M(this, "formulaInput", zr);
|
2378
|
+
M(this, "optionsInput", yt.componentKey);
|
2379
|
+
M(this, "dropdown", Eo);
|
2379
2380
|
}
|
2380
2381
|
}
|
2381
|
-
class
|
2382
|
+
class Gr extends fe {
|
2382
2383
|
constructor() {
|
2383
2384
|
super(...arguments);
|
2384
2385
|
M(this, "id", Z.DECIMAL);
|
2385
2386
|
M(this, "formulaInput", Tt);
|
2386
2387
|
}
|
2387
2388
|
}
|
2388
|
-
const
|
2389
|
-
function
|
2390
|
-
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;
|
2391
2392
|
return {
|
2392
2393
|
width: n,
|
2393
|
-
height: r +
|
2394
|
+
height: r + Zr * 2,
|
2394
2395
|
ba: a
|
2395
2396
|
};
|
2396
2397
|
}
|
2397
|
-
function
|
2398
|
-
const a = Oe +
|
2399
|
-
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),
|
2400
2401
|
text: d
|
2401
2402
|
}));
|
2402
2403
|
let s;
|
2403
2404
|
const c = [];
|
2404
2405
|
l.forEach((d) => {
|
2405
|
-
const { layout:
|
2406
|
-
!s || s.width + m +
|
2406
|
+
const { layout: f } = d, { width: m, height: _ } = f;
|
2407
|
+
!s || s.width + m + $t > i ? (s = {
|
2407
2408
|
width: m,
|
2408
|
-
height:
|
2409
|
+
height: _,
|
2409
2410
|
items: [{
|
2410
2411
|
...d,
|
2411
2412
|
left: 0
|
2412
2413
|
}]
|
2413
2414
|
}, c.push(s)) : (s.items.push({
|
2414
2415
|
...d,
|
2415
|
-
left: s.width +
|
2416
|
-
}), s.width = s.width + m +
|
2416
|
+
left: s.width + $t
|
2417
|
+
}), s.width = s.width + m + $t);
|
2417
2418
|
});
|
2418
2419
|
let u = 0, p = 0;
|
2419
|
-
return c.forEach((d,
|
2420
|
-
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;
|
2421
2422
|
}), {
|
2422
2423
|
lines: c,
|
2423
2424
|
totalHeight: u,
|
2424
2425
|
contentWidth: i,
|
2425
2426
|
contentHeight: r,
|
2426
|
-
cellAutoHeight: u +
|
2427
|
+
cellAutoHeight: u + Mt * 2,
|
2427
2428
|
calcAutoWidth: p + a
|
2428
2429
|
};
|
2429
2430
|
}
|
2430
|
-
const
|
2431
|
-
class
|
2431
|
+
const Jr = 8;
|
2432
|
+
class Qr extends ca {
|
2432
2433
|
static drawWith(t, o) {
|
2433
2434
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
|
2434
|
-
t.save(),
|
2435
|
+
t.save(), Gn.drawWith(t, {
|
2435
2436
|
width: l.width,
|
2436
2437
|
height: l.height,
|
2437
|
-
radius:
|
2438
|
+
radius: Jr,
|
2438
2439
|
fill: i || Le
|
2439
|
-
}), t.translateWithPrecision(
|
2440
|
+
}), t.translateWithPrecision(Fo, l.ba), t.font = n, t.fillStyle = r, t.fillText(s, 0, 0), t.restore();
|
2440
2441
|
}
|
2441
2442
|
}
|
2442
|
-
var
|
2443
|
-
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--)
|
2444
2445
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2445
|
-
return n && a &&
|
2446
|
-
},
|
2447
|
-
const
|
2448
|
-
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 {
|
2449
2450
|
constructor(e, t, o) {
|
2450
2451
|
M(this, "zIndex");
|
2451
2452
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2469,91 +2470,91 @@ let sn = class {
|
|
2469
2470
|
r = n - Oe + 4;
|
2470
2471
|
break;
|
2471
2472
|
}
|
2472
|
-
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();
|
2473
2474
|
}
|
2474
2475
|
// eslint-disable-next-line max-lines-per-function
|
2475
2476
|
drawWith(e, t, o, n) {
|
2476
|
-
var
|
2477
|
-
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:
|
2478
|
-
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)
|
2479
2480
|
return;
|
2480
|
-
const I = this._dataValidationModel.getValidator(
|
2481
|
+
const I = this._dataValidationModel.getValidator(R.type);
|
2481
2482
|
if (!I)
|
2482
2483
|
return;
|
2483
|
-
const
|
2484
|
+
const V = {
|
2484
2485
|
startX: u.startX + d,
|
2485
|
-
endX: u.endX -
|
2486
|
+
endX: u.endX - f,
|
2486
2487
|
startY: u.startY + m,
|
2487
|
-
endY: u.endY -
|
2488
|
-
},
|
2489
|
-
this._drawDownIcon(e,
|
2490
|
-
let
|
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);
|
2491
|
+
let H = 0;
|
2491
2492
|
switch (E) {
|
2492
2493
|
case ue.MIDDLE:
|
2493
|
-
|
2494
|
+
H = (F.contentHeight - F.totalHeight) / 2;
|
2494
2495
|
break;
|
2495
2496
|
case ue.BOTTOM:
|
2496
|
-
|
2497
|
+
H = F.contentHeight - F.totalHeight;
|
2497
2498
|
break;
|
2498
2499
|
}
|
2499
|
-
e.translateWithPrecision(0,
|
2500
|
+
e.translateWithPrecision(0, H), F.lines.forEach((z, q) => {
|
2500
2501
|
e.save();
|
2501
|
-
const { width: ee, height: te, items: re } =
|
2502
|
+
const { width: ee, height: te, items: re } = z;
|
2502
2503
|
let ae = 0;
|
2503
|
-
switch (
|
2504
|
+
switch (T) {
|
2504
2505
|
case He.RIGHT:
|
2505
|
-
ae =
|
2506
|
+
ae = F.contentWidth - ee;
|
2506
2507
|
break;
|
2507
2508
|
case He.CENTER:
|
2508
|
-
ae = (
|
2509
|
+
ae = (F.contentWidth - ee) / 2;
|
2509
2510
|
break;
|
2510
2511
|
}
|
2511
|
-
e.translate(ae, q * (te +
|
2512
|
-
e.save(), e.translateWithPrecision(se.left, 0),
|
2513
|
-
...
|
2512
|
+
e.translate(ae, q * (te + No)), re.forEach((se) => {
|
2513
|
+
e.save(), e.translateWithPrecision(se.left, 0), Qr.drawWith(e, {
|
2514
|
+
...L,
|
2514
2515
|
info: se,
|
2515
|
-
color:
|
2516
|
+
color: y,
|
2516
2517
|
fill: j[se.text]
|
2517
2518
|
}), e.restore();
|
2518
2519
|
}), e.restore();
|
2519
|
-
}), e.restore(),
|
2520
|
-
left:
|
2521
|
-
top:
|
2522
|
-
width:
|
2523
|
-
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
|
2524
2525
|
});
|
2525
2526
|
}
|
2526
2527
|
calcCellAutoHeight(e) {
|
2527
|
-
var
|
2528
|
+
var C;
|
2528
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 = {
|
2529
2530
|
startX: p.startX + l,
|
2530
2531
|
endX: p.endX - s,
|
2531
2532
|
startY: p.startY + c,
|
2532
2533
|
endY: p.endY - u
|
2533
|
-
},
|
2534
|
-
if (!
|
2534
|
+
}, f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2535
|
+
if (!f)
|
2535
2536
|
return;
|
2536
|
-
const m = this._dataValidationModel.getValidator(
|
2537
|
+
const m = this._dataValidationModel.getValidator(f.type);
|
2537
2538
|
if (!m)
|
2538
2539
|
return;
|
2539
|
-
const
|
2540
|
-
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;
|
2541
2542
|
}
|
2542
2543
|
calcCellAutoWidth(e) {
|
2543
|
-
var
|
2544
|
+
var C;
|
2544
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 = {
|
2545
2546
|
startX: p.startX + l,
|
2546
2547
|
endX: p.endX - s,
|
2547
2548
|
startY: p.startY + c,
|
2548
2549
|
endY: p.endY - u
|
2549
|
-
},
|
2550
|
-
if (!
|
2550
|
+
}, f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, a, i);
|
2551
|
+
if (!f)
|
2551
2552
|
return;
|
2552
|
-
const m = this._dataValidationModel.getValidator(
|
2553
|
+
const m = this._dataValidationModel.getValidator(f.type);
|
2553
2554
|
if (!m)
|
2554
2555
|
return;
|
2555
|
-
const
|
2556
|
-
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;
|
2557
2558
|
}
|
2558
2559
|
isHit(e, t) {
|
2559
2560
|
const { primaryWithCoord: o } = t, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = e;
|
@@ -2572,38 +2573,38 @@ let sn = class {
|
|
2572
2573
|
}
|
2573
2574
|
onPointerEnter(e, t) {
|
2574
2575
|
var o, n;
|
2575
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2576
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.POINTER);
|
2576
2577
|
}
|
2577
2578
|
onPointerLeave(e, t) {
|
2578
2579
|
var o, n;
|
2579
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2580
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2580
2581
|
}
|
2581
2582
|
};
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
],
|
2587
|
-
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 {
|
2588
2589
|
constructor() {
|
2589
2590
|
super(...arguments);
|
2590
2591
|
M(this, "id", Z.LIST_MULTIPLE);
|
2591
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2592
|
-
M(this, "dropdown",
|
2592
|
+
M(this, "canvasRender", this.injector.createInstance(ln));
|
2593
|
+
M(this, "dropdown", Dn);
|
2593
2594
|
}
|
2594
2595
|
}
|
2595
|
-
var
|
2596
|
-
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--)
|
2597
2598
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2598
|
-
return n && a &&
|
2599
|
-
},
|
2600
|
-
const Ee = 4,
|
2601
|
-
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) {
|
2602
2603
|
const o = e.length;
|
2603
2604
|
return {
|
2604
2605
|
id: "d",
|
2605
2606
|
body: {
|
2606
|
-
dataStream: `${e}${
|
2607
|
+
dataStream: `${e}${oa}`,
|
2607
2608
|
textRuns: [
|
2608
2609
|
{
|
2609
2610
|
ts: {
|
@@ -2638,22 +2639,22 @@ function hs(e, t) {
|
|
2638
2639
|
}
|
2639
2640
|
};
|
2640
2641
|
}
|
2641
|
-
function
|
2642
|
-
const n =
|
2642
|
+
function Uo(e, t, o) {
|
2643
|
+
const n = ds(e, o), a = new na(n), i = new ua(a);
|
2643
2644
|
return {
|
2644
|
-
documentSkeleton:
|
2645
|
+
documentSkeleton: ha.create(i, t),
|
2645
2646
|
docModel: a,
|
2646
2647
|
docViewModel: i
|
2647
2648
|
};
|
2648
2649
|
}
|
2649
|
-
function
|
2650
|
+
function ft(e, t, o) {
|
2650
2651
|
const {
|
2651
2652
|
documentSkeleton: n,
|
2652
2653
|
docModel: a,
|
2653
2654
|
docViewModel: i
|
2654
|
-
} =
|
2655
|
+
} = Uo(e, t, o);
|
2655
2656
|
return {
|
2656
|
-
documents: new
|
2657
|
+
documents: new pa(`DOCUMENTS_${Jt.generateRandomId()}`, n, {
|
2657
2658
|
pageMarginLeft: 0,
|
2658
2659
|
pageMarginTop: 0
|
2659
2660
|
}),
|
@@ -2662,7 +2663,7 @@ function mt(e, t, o) {
|
|
2662
2663
|
docViewModel: i
|
2663
2664
|
};
|
2664
2665
|
}
|
2665
|
-
function
|
2666
|
+
function Wn(e, t, o, n, a, i, r = !0) {
|
2666
2667
|
let l = 0;
|
2667
2668
|
const s = r ? ke : 0;
|
2668
2669
|
switch (a) {
|
@@ -2691,7 +2692,7 @@ function Bn(e, t, o, n, a, i, r = !0) {
|
|
2691
2692
|
paddingTop: l
|
2692
2693
|
};
|
2693
2694
|
}
|
2694
|
-
let
|
2695
|
+
let dn = class {
|
2695
2696
|
constructor(e, t, o, n) {
|
2696
2697
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2697
2698
|
M(this, "zIndex");
|
@@ -2709,16 +2710,16 @@ let ln = class {
|
|
2709
2710
|
let u;
|
2710
2711
|
switch (i) {
|
2711
2712
|
case ue.MIDDLE:
|
2712
|
-
u = (n -
|
2713
|
+
u = (n - mt) / 2;
|
2713
2714
|
break;
|
2714
2715
|
case ue.BOTTOM:
|
2715
|
-
u = n - s - a - ke + (a / 2 -
|
2716
|
+
u = n - s - a - ke + (a / 2 - mt / 2);
|
2716
2717
|
break;
|
2717
2718
|
default:
|
2718
|
-
u = l + ke + (a / 2 -
|
2719
|
+
u = l + ke + (a / 2 - mt / 2);
|
2719
2720
|
break;
|
2720
2721
|
}
|
2721
|
-
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();
|
2722
2723
|
}
|
2723
2724
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2724
2725
|
drawWith(e, t, o) {
|
@@ -2728,41 +2729,41 @@ let ln = class {
|
|
2728
2729
|
const p = this._dataValidationModel.getValidator(u.type);
|
2729
2730
|
if (!p)
|
2730
2731
|
return;
|
2731
|
-
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 || {};
|
2732
2733
|
if (!u || !p || !p || p.id.indexOf(Z.LIST) !== 0 || !p.skipDefaultFontRender(u))
|
2733
2734
|
return;
|
2734
|
-
const
|
2735
|
-
startX: c.startX +
|
2735
|
+
const S = {
|
2736
|
+
startX: c.startX + f,
|
2736
2737
|
endX: c.endX - m,
|
2737
|
-
startY: c.startY +
|
2738
|
-
endY: c.endY -
|
2739
|
-
},
|
2740
|
-
let { tb:
|
2741
|
-
if (
|
2742
|
-
const { l: x = le.pd.l, t: j = le.pd.t, r:
|
2743
|
-
|
2744
|
-
const ee = Qe(k), { height: te, width: re } = ee, { paddingTop: ae, paddingLeft: se } =
|
2745
|
-
this._drawDownIcon(e,
|
2746
|
-
left:
|
2747
|
-
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,
|
2748
2749
|
width: he,
|
2749
|
-
height: I - j -
|
2750
|
+
height: I - j - H
|
2750
2751
|
});
|
2751
2752
|
} else {
|
2752
|
-
e.save(), e.translateWithPrecision(
|
2753
|
-
const x =
|
2754
|
-
|
2755
|
-
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);
|
2756
2757
|
e.translateWithPrecision(pe, q);
|
2757
|
-
const te = Math.max(
|
2758
|
-
|
2758
|
+
const te = Math.max(R - pe * 2, 1), re = k;
|
2759
|
+
Gn.drawWith(e, {
|
2759
2760
|
width: te,
|
2760
2761
|
height: re,
|
2761
|
-
fill: (
|
2762
|
-
radius:
|
2763
|
-
}), e.save(), e.translateWithPrecision(Ee, 0), e.beginPath(), e.rect(0, 0, x, k), e.clip(), e.translateWithPrecision(ee, 0),
|
2764
|
-
left:
|
2765
|
-
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,
|
2766
2767
|
width: te,
|
2767
2768
|
height: re
|
2768
2769
|
});
|
@@ -2772,61 +2773,62 @@ let ln = class {
|
|
2772
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);
|
2773
2774
|
if (!d || d.renderMode === de.TEXT)
|
2774
2775
|
return;
|
2775
|
-
const
|
2776
|
+
const f = {
|
2776
2777
|
startX: r.startX + s,
|
2777
2778
|
endX: r.endX - c,
|
2778
2779
|
startY: r.startY + u,
|
2779
2780
|
endY: r.endY - p
|
2780
|
-
}, m =
|
2781
|
-
let { tb:
|
2782
|
-
const { t: I = le.pd.t, b:
|
2783
|
-
if (
|
2784
|
-
const
|
2785
|
-
|
2786
|
-
const
|
2787
|
-
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;
|
2788
2789
|
} else {
|
2789
|
-
const
|
2790
|
-
|
2791
|
-
const
|
2792
|
-
height:
|
2793
|
-
} =
|
2794
|
-
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;
|
2795
2796
|
}
|
2796
2797
|
}
|
2797
2798
|
calcCellAutoWidth(e) {
|
2798
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);
|
2799
2800
|
if (!d || d.renderMode === de.TEXT)
|
2800
2801
|
return;
|
2801
|
-
const
|
2802
|
+
const f = {
|
2802
2803
|
startX: r.startX + s,
|
2803
2804
|
endX: r.endX - c,
|
2804
2805
|
startY: r.startY + u,
|
2805
2806
|
endY: r.endY - p
|
2806
|
-
}, m =
|
2807
|
-
let { tb:
|
2808
|
-
const { l: I = le.pd.l, r:
|
2809
|
-
|
2810
|
-
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;
|
2811
2812
|
switch (d.renderMode) {
|
2812
2813
|
case de.ARROW:
|
2813
|
-
|
2814
|
+
C = he + pe * 2 + V + I;
|
2814
2815
|
break;
|
2815
2816
|
case de.CUSTOM:
|
2816
|
-
|
2817
|
+
C = he + pe * 2 + Ee * 2 + V + I + Ht / 2 + 1;
|
2817
2818
|
break;
|
2819
|
+
// default is CUSTOM
|
2818
2820
|
default:
|
2819
|
-
|
2821
|
+
C = he + pe * 2 + Ee * 2 + V + I + Ht / 2 + 1;
|
2820
2822
|
}
|
2821
|
-
const
|
2822
|
-
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;
|
2823
2825
|
}
|
2824
2826
|
isHit(e, t) {
|
2825
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);
|
2826
2828
|
if (!l || !r || l.renderMode === de.TEXT)
|
2827
2829
|
return !1;
|
2828
|
-
const { top: s, left: c, width: u, height: p } = r, { x: d, y:
|
2829
|
-
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;
|
2830
2832
|
}
|
2831
2833
|
onPointerDown(e, t) {
|
2832
2834
|
if (t.button === 2)
|
@@ -2841,62 +2843,62 @@ let ln = class {
|
|
2841
2843
|
}
|
2842
2844
|
onPointerEnter(e, t) {
|
2843
2845
|
var o, n;
|
2844
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2846
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.POINTER);
|
2845
2847
|
}
|
2846
2848
|
onPointerLeave(e, t) {
|
2847
2849
|
var o, n;
|
2848
|
-
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(
|
2850
|
+
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2849
2851
|
}
|
2850
2852
|
};
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
],
|
2857
|
-
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 {
|
2858
2860
|
constructor() {
|
2859
2861
|
super(...arguments);
|
2860
2862
|
M(this, "id", Z.LIST);
|
2861
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2862
|
-
M(this, "dropdown",
|
2863
|
-
M(this, "optionsInput",
|
2864
|
-
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);
|
2865
2867
|
}
|
2866
2868
|
}
|
2867
|
-
class
|
2869
|
+
class us extends fe {
|
2868
2870
|
constructor() {
|
2869
2871
|
super(...arguments);
|
2870
2872
|
M(this, "id", Z.TEXT_LENGTH);
|
2871
2873
|
M(this, "formulaInput", Tt);
|
2872
2874
|
}
|
2873
2875
|
}
|
2874
|
-
class
|
2876
|
+
class hs extends fe {
|
2875
2877
|
constructor() {
|
2876
2878
|
super(...arguments);
|
2877
2879
|
M(this, "id", Z.WHOLE);
|
2878
2880
|
M(this, "formulaInput", Tt);
|
2879
2881
|
}
|
2880
2882
|
}
|
2881
|
-
var
|
2882
|
-
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--)
|
2883
2885
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2884
|
-
return n && a &&
|
2885
|
-
},
|
2886
|
-
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 {
|
2887
2889
|
constructor(e, t, o) {
|
2888
2890
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2889
2891
|
}
|
2890
2892
|
_initComponents() {
|
2891
2893
|
[
|
2892
|
-
[
|
2893
|
-
[
|
2894
|
-
[
|
2895
|
-
[
|
2896
|
-
[
|
2897
|
-
[Dt.componentKey, Dt],
|
2894
|
+
[Oo, Co],
|
2895
|
+
[In, qi],
|
2896
|
+
[Vo, gi],
|
2897
|
+
[Dn, Oi],
|
2898
|
+
[Eo, ti],
|
2898
2899
|
[Vt.componentKey, Vt],
|
2899
|
-
|
2900
|
+
[yt.componentKey, yt],
|
2901
|
+
...xr
|
2900
2902
|
].forEach(([e, t]) => {
|
2901
2903
|
this.disposeWithMe(this._componentManger.register(
|
2902
2904
|
e,
|
@@ -2906,66 +2908,66 @@ let Ze = class extends cn {
|
|
2906
2908
|
}
|
2907
2909
|
_registerValidatorViews() {
|
2908
2910
|
[
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
2912
|
-
qr,
|
2911
|
+
Gr,
|
2912
|
+
hs,
|
2913
|
+
us,
|
2913
2914
|
Kr,
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2915
|
+
Yr,
|
2916
|
+
cs,
|
2917
|
+
as,
|
2918
|
+
Xr
|
2917
2919
|
].forEach((e) => {
|
2918
2920
|
const t = this._injector.createInstance(e), o = this._dataValidatorRegistryService.getValidatorItem(t.id);
|
2919
2921
|
o && (o.formulaInput = t.formulaInput, o.canvasRender = t.canvasRender, o.dropdown = t.dropdown, o.optionsInput = t.optionsInput);
|
2920
2922
|
});
|
2921
2923
|
}
|
2922
2924
|
};
|
2923
|
-
Ze =
|
2924
|
-
|
2925
|
-
|
2926
|
-
|
2925
|
+
Ze = fs([
|
2926
|
+
Yt(0, b(Fe)),
|
2927
|
+
Yt(1, b(Et)),
|
2928
|
+
Yt(2, b(ye))
|
2927
2929
|
], Ze);
|
2928
|
-
var
|
2929
|
-
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--)
|
2930
2932
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2931
|
-
return n && a &&
|
2932
|
-
},
|
2933
|
-
const
|
2934
|
-
var
|
2935
|
-
let
|
2936
|
-
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) {
|
2937
2939
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
2938
2940
|
const { menu: a, ...i } = this._config;
|
2939
|
-
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);
|
2940
2942
|
}
|
2941
2943
|
onStarting() {
|
2942
2944
|
[
|
2943
2945
|
[me],
|
2944
2946
|
[Ie],
|
2945
|
-
[
|
2947
|
+
[st],
|
2946
2948
|
[Xe],
|
2947
2949
|
[Ge],
|
2948
2950
|
[Ke],
|
2949
2951
|
[ze],
|
2950
|
-
[
|
2952
|
+
[rt],
|
2951
2953
|
[Ze]
|
2952
2954
|
].forEach((e) => {
|
2953
2955
|
this._injector.add(e);
|
2954
2956
|
}), [
|
2955
2957
|
Lt,
|
2956
2958
|
Pt,
|
2957
|
-
|
2958
|
-
|
2959
|
+
Mo,
|
2960
|
+
wn,
|
2959
2961
|
Ue,
|
2960
|
-
|
2962
|
+
yo
|
2961
2963
|
].forEach((e) => {
|
2962
2964
|
this._commandService.registerCommand(e);
|
2963
2965
|
});
|
2964
2966
|
}
|
2965
2967
|
onReady() {
|
2966
|
-
this._injector.get(ze), this._injector.get(Ke), this._injector.get(
|
2967
|
-
|
2968
|
-
[
|
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]
|
2969
2971
|
);
|
2970
2972
|
}
|
2971
2973
|
onRendered() {
|
@@ -2974,30 +2976,30 @@ let $n = (ft = class extends Yn {
|
|
2974
2976
|
onSteady() {
|
2975
2977
|
this._injector.get(Xe);
|
2976
2978
|
}
|
2977
|
-
}, M(
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
],
|
2983
|
-
var
|
2984
|
-
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--)
|
2985
2987
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2986
|
-
return n && a &&
|
2987
|
-
},
|
2988
|
-
const
|
2989
|
-
var
|
2990
|
-
let
|
2991
|
-
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) {
|
2992
2994
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
2993
2995
|
const { menu: a, ...i } = this._config;
|
2994
|
-
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);
|
2995
2997
|
}
|
2996
2998
|
onStarting() {
|
2997
2999
|
[
|
2998
3000
|
[me],
|
2999
3001
|
[Ie],
|
3000
|
-
[
|
3002
|
+
[st],
|
3001
3003
|
[Xe],
|
3002
3004
|
[Ge],
|
3003
3005
|
[Ke],
|
@@ -3008,18 +3010,18 @@ let kn = (gt = class extends Yn {
|
|
3008
3010
|
}), [
|
3009
3011
|
Lt,
|
3010
3012
|
Pt,
|
3011
|
-
|
3012
|
-
|
3013
|
+
Mo,
|
3014
|
+
wn,
|
3013
3015
|
Ue,
|
3014
|
-
|
3016
|
+
yo
|
3015
3017
|
].forEach((e) => {
|
3016
3018
|
this._commandService.registerCommand(e);
|
3017
3019
|
});
|
3018
3020
|
}
|
3019
3021
|
onReady() {
|
3020
3022
|
this._injector.get(ze), this._injector.get(Ke), this._injector.get(Ve).registerRenderModule(
|
3021
|
-
|
3022
|
-
[
|
3023
|
+
Y.UNIVER_SHEET,
|
3024
|
+
[Dt]
|
3023
3025
|
);
|
3024
3026
|
}
|
3025
3027
|
onRendered() {
|
@@ -3028,15 +3030,15 @@ let kn = (gt = class extends Yn {
|
|
3028
3030
|
onSteady() {
|
3029
3031
|
this._injector.get(Xe);
|
3030
3032
|
}
|
3031
|
-
}, M(
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
],
|
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);
|
3037
3039
|
export {
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3040
|
+
Eo as DATE_DROPDOWN_KEY,
|
3041
|
+
Dn as LIST_DROPDOWN_KEY,
|
3042
|
+
Yn as UniverSheetsDataValidationMobileUIPlugin,
|
3043
|
+
Hn as UniverSheetsDataValidationUIPlugin
|
3042
3044
|
};
|