@univerjs/sheets-data-validation-ui 0.6.1-nightly.202502251606 → 0.6.2
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/LICENSE +176 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +748 -758
- package/lib/types/views/widgets/checkbox-widget.d.ts +3 -2
- package/lib/types/views/widgets/dropdown-multiple-widget.d.ts +5 -4
- package/lib/types/views/widgets/dropdown-widget.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +16 -17
package/lib/es/index.js
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
var Wo = Object.defineProperty;
|
2
2
|
var Ho = (t, e, o) => e in t ? Wo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
3
3
|
var E = (t, e, o) => Ho(t, typeof e != "symbol" ? e + "" : e, o);
|
4
|
-
import { jsxs as Y, jsx as
|
5
|
-
import { Inject as b, LocaleService as Q, Disposable as Vt, DataValidationErrorStyle as
|
6
|
-
import { Button as Bt, DatePanel as aa, Scrollbar as ia, FormLayout as q, RadioGroup as
|
7
|
-
import { DeviceInputEventType as
|
8
|
-
import { SheetInterceptorService as
|
9
|
-
import { SheetDataValidationModel as at, getCellValueOrigin as rt, getDataValidationCellValue as
|
10
|
-
import { getPatternType as
|
11
|
-
import { SetCellEditVisibleOperation as
|
12
|
-
import { IDialogService as
|
13
|
-
import
|
14
|
-
import { DataValidatorRegistryService as bt, DataValidationModel as
|
15
|
-
import { RichTextEditingMutation as
|
16
|
-
import { filter as
|
17
|
-
import { deserializeRangeWithSheet as
|
18
|
-
import { RangeSelector as
|
19
|
-
var
|
20
|
-
for (var a = n > 1 ? void 0 : n ?
|
4
|
+
import { jsxs as Y, jsx as m, Fragment as Rt } from "react/jsx-runtime";
|
5
|
+
import { Inject as b, LocaleService as Q, Disposable as Vt, DataValidationErrorStyle as le, ICommandService as tt, dayjs as qe, numfmt as Je, CellValueType as xo, UniverInstanceType as X, toDisposable as jo, IUniverInstanceService as st, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yo, DisposableCollection as Xo, CommandType as ne, BuildTextUtils as zo, DataValidationRenderMode as ut, DataValidationType as K, IConfigService as mn, debounce as Ko, UndoCommand as Go, RedoCommand as Zo, isUnitRangesEqual as qo, shallowEqual as En, ThemeService as zn, ColorKit as Jo, Injector as Wt, DataValidationStatus as de, ObjectMatrix as Ie, Range as Qo, Rectangle as we, queryObjectMatrix as Qe, Optional as ta, RxDisposable as gn, InterceptorEffectEnum as Kn, sequenceExecute as Gn, bufferDebounceTime as ea, isFormulaString as kt, Tools as tn, VerticalAlign as pt, HorizontalAlign as zt, DEFAULT_STYLES as ct, WrapStrategy as It, DocumentDataModel as na, BooleanNumber as oe, DEFAULT_EMPTY_DOCUMENT_VALUE as oa, Plugin as Zn, merge as qn } from "@univerjs/core";
|
6
|
+
import { Button as Bt, DatePanel as aa, Scrollbar as ia, FormLayout as q, RadioGroup as fn, Radio as Nt, Checkbox as Pe, Input as Ut, Select as en, DraggableList as ra, clsx as sa } from "@univerjs/design";
|
7
|
+
import { DeviceInputEventType as nn, IRenderManagerService as yt, fixLineWidthByScale as bn, Transform as la, CheckboxShape as da, getCurrentTypeOfRenderer as Kt, CURSOR_TYPE as Gt, FontCache as ca, Shape as ua, Rect as Jn, getFontStyleString as Be, getDocsSkeletonPageSize as ae, Documents as ha, DocumentViewModel as pa, DocumentSkeleton as ma } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as vn, AFTER_CELL_EDIT_ASYNC as ga, SetRangeValuesCommand as _n, SheetsSelectionsService as Qn, getSheetCommandTarget as to, SheetPermissionCheckController as eo, WorksheetEditPermission as Re, RangeProtectionPermissionEditPoint as De, WorkbookEditablePermission as Ve, checkRangesEditablePermission as fa, rangeToDiscreteRange as va, WorksheetSetCellStylePermission as on, INTERCEPTOR_POINT as no, InterceptCellContentPriority as oo } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as at, getCellValueOrigin as rt, getDataValidationCellValue as _a, deserializeListOptions as ao, serializeListOptions as io, UpdateSheetDataValidationRangeCommand as ro, UpdateSheetDataValidationSettingCommand as On, UpdateSheetDataValidationOptionsCommand as Sa, RemoveSheetDataValidationCommand as so, RemoveSheetAllDataValidationCommand as Ca, createDefaultNewRule as lo, AddSheetDataValidationCommand as Sn, DATA_VALIDATION_PLUGIN_NAME as co, getDataValidationDiffMutations as an, DataValidationCacheService as uo, DataValidationFormulaController as Ia, DataValidationFormulaService as wa, CHECKBOX_FORMULA_2 as Ra, CHECKBOX_FORMULA_1 as Da, getFormulaResult as $e, isLegalFormulaResult as Ln, transformCheckboxValue as Va } from "@univerjs/sheets-data-validation";
|
10
|
+
import { getPatternType as ya } from "@univerjs/sheets-numfmt";
|
11
|
+
import { SetCellEditVisibleOperation as rn, SheetCanvasPopManagerService as Ma, IEditorBridgeService as ho, IMarkSelectionService as Ea, HoverManagerService as ba, CellAlertManagerService as Oa, CellAlertType as La, IAutoFillService as Ta, APPLY_TYPE as ie, virtualizeDiscreteRanges as sn, getAutoFillRepeatRange as Pa, ISheetClipboardService as Aa, COPY_TYPE as Tn, PREDEFINED_HOOK_NAME as he, getRepeatRange as Pn, getCurrentRangeDisable$ as ka, AutoHeightController as po, SheetSkeletonManagerService as ye } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as Fa, useDependency as T, KeyCode as ln, ISidebarService as mo, useObservable as St, ComponentManager as Ae, IZenZoneService as go, RectPopup as Na, useEvent as dn, MenuItemType as Cn, getMenuHiddenObservable as Ua, RibbonStartGroup as Ba, IMenuManagerService as $a, useSidebarClick as fo } from "@univerjs/ui";
|
13
|
+
import An, { useState as j, forwardRef as Mt, useRef as Zt, createElement as Et, useMemo as $t, useEffect as wt } from "react";
|
14
|
+
import { DataValidatorRegistryService as bt, DataValidationModel as ke, DataValidatorRegistryScope as Wa, TWO_FORMULA_OPERATOR_COUNT as Ha, getRuleOptions as kn, getRuleSetting as Fn } from "@univerjs/data-validation";
|
15
|
+
import { RichTextEditingMutation as xa } from "@univerjs/docs";
|
16
|
+
import { filter as In, BehaviorSubject as Nn, distinctUntilChanged as ja, Subject as Ya, debounceTime as wn, of as Xa, bufferTime as vo } from "rxjs";
|
17
|
+
import { deserializeRangeWithSheet as za, serializeRange as _o } from "@univerjs/engine-formula";
|
18
|
+
import { RangeSelector as Ka, FormulaEditor as So } from "@univerjs/sheets-formula-ui";
|
19
|
+
var Ga = Object.getOwnPropertyDescriptor, Za = (t, e, o, n) => {
|
20
|
+
for (var a = n > 1 ? void 0 : n ? Ga(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
21
21
|
(r = t[i]) && (a = r(a) || a);
|
22
22
|
return a;
|
23
|
-
},
|
24
|
-
let
|
23
|
+
}, re = (t, e) => (o, n) => e(o, n, t);
|
24
|
+
let ce = class extends Vt {
|
25
25
|
constructor(t, e, o, n, a) {
|
26
26
|
super(), this._sheetInterceptorService = t, this._dataValidationModel = e, this._dataValidatorRegistryService = o, this._dialogService = n, this._localeService = a, this._initEditorBridgeInterceptor();
|
27
27
|
}
|
@@ -32,7 +32,7 @@ let le = class extends Vt {
|
|
32
32
|
handler: async (t, e, o) => {
|
33
33
|
var R;
|
34
34
|
const n = await t, { worksheet: a, row: i, col: r, unitId: s, subUnitId: l, workbook: c } = e, u = this._dataValidationModel.getRuleIdByLocation(s, l, i, r), h = u ? this._dataValidationModel.getRuleById(s, l, u) : void 0;
|
35
|
-
if (!h || h.errorStyle !==
|
35
|
+
if (!h || h.errorStyle !== le.STOP)
|
36
36
|
return o(Promise.resolve(n));
|
37
37
|
const d = await this._dataValidatorRegistryService.getValidatorItem(h.type);
|
38
38
|
if (!d || await d.validator(
|
@@ -61,7 +61,7 @@ let le = class extends Vt {
|
|
61
61
|
title: d.getRuleFinalError(h, { row: i, col: r, unitId: s, subUnitId: l })
|
62
62
|
},
|
63
63
|
footer: {
|
64
|
-
title:
|
64
|
+
title: An.createElement(
|
65
65
|
Bt,
|
66
66
|
{
|
67
67
|
type: "primary",
|
@@ -89,7 +89,7 @@ let le = class extends Vt {
|
|
89
89
|
title: t
|
90
90
|
},
|
91
91
|
footer: {
|
92
|
-
title:
|
92
|
+
title: An.createElement(
|
93
93
|
Bt,
|
94
94
|
{
|
95
95
|
type: "primary",
|
@@ -104,28 +104,28 @@ let le = class extends Vt {
|
|
104
104
|
});
|
105
105
|
}
|
106
106
|
};
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
],
|
114
|
-
const
|
115
|
-
dvDateDropdown:
|
116
|
-
dvDateDropdownBtns:
|
117
|
-
},
|
107
|
+
ce = Za([
|
108
|
+
re(0, b(vn)),
|
109
|
+
re(1, b(at)),
|
110
|
+
re(2, b(bt)),
|
111
|
+
re(3, Fa),
|
112
|
+
re(4, b(Q))
|
113
|
+
], ce);
|
114
|
+
const qa = "univer-dv-date-dropdown", Ja = "univer-dv-date-dropdown-btns", Un = {
|
115
|
+
dvDateDropdown: qa,
|
116
|
+
dvDateDropdownBtns: Ja
|
117
|
+
}, Qa = (t) => {
|
118
118
|
if (t == null || typeof t == "boolean")
|
119
119
|
return;
|
120
120
|
if (typeof t == "number" || !Number.isNaN(+t))
|
121
|
-
return
|
122
|
-
const e =
|
121
|
+
return qe(Je.format("yyyy-MM-dd HH:mm:ss", Number(t)));
|
122
|
+
const e = qe(t);
|
123
123
|
if (e.isValid())
|
124
124
|
return e;
|
125
125
|
};
|
126
|
-
function
|
126
|
+
function ti(t) {
|
127
127
|
var v;
|
128
|
-
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s, workbook: l } = e, c = T(tt), u = T(
|
128
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s, workbook: l } = e, c = T(tt), u = T(ce), h = n.getCell(a, i), d = rt(n.getCellRaw(a, i)), _ = Qa(d), [p, R] = j(_), w = p && p.isValid() ? p : qe(), g = T(Q), f = T(at), S = f.getRuleByLocation(r, s, a, i);
|
129
129
|
if (!S)
|
130
130
|
return null;
|
131
131
|
const V = f.getValidator(S.type);
|
@@ -135,8 +135,8 @@ function Qa(t) {
|
|
135
135
|
var F, N, B;
|
136
136
|
if (!w)
|
137
137
|
return;
|
138
|
-
const P = w.format(C ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (F =
|
139
|
-
S.errorStyle !==
|
138
|
+
const P = w.format(C ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (F = Je.parseDate(P)) == null ? void 0 : F.v, O = l.getStyles().getStyleByCell(h), L = (B = (N = O == null ? void 0 : O.n) == null ? void 0 : N.pattern) != null ? B : "", A = ya(L);
|
139
|
+
S.errorStyle !== le.STOP || await V.validator({
|
140
140
|
value: U,
|
141
141
|
unitId: r,
|
142
142
|
subUnitId: s,
|
@@ -146,12 +146,12 @@ function Qa(t) {
|
|
146
146
|
workbook: l,
|
147
147
|
interceptValue: P.replace("Z", "").replace("T", " "),
|
148
148
|
t: xo.NUMBER
|
149
|
-
}, S) ? (o(), await c.executeCommand(
|
149
|
+
}, S) ? (o(), await c.executeCommand(rn.id, {
|
150
150
|
visible: !1,
|
151
|
-
eventType:
|
151
|
+
eventType: nn.Keyboard,
|
152
152
|
unitId: r,
|
153
|
-
keycode:
|
154
|
-
}), await c.executeCommand(
|
153
|
+
keycode: ln.ESC
|
154
|
+
}), await c.executeCommand(_n.id, {
|
155
155
|
unitId: r,
|
156
156
|
subUnitId: s,
|
157
157
|
range: {
|
@@ -174,8 +174,8 @@ function Qa(t) {
|
|
174
174
|
}
|
175
175
|
})) : u.showReject(V.getRuleFinalError(S, { row: a, col: i, unitId: r, subUnitId: s }));
|
176
176
|
};
|
177
|
-
return /* @__PURE__ */ Y("div", { className:
|
178
|
-
/* @__PURE__ */
|
177
|
+
return /* @__PURE__ */ Y("div", { className: Un.dvDateDropdown, children: [
|
178
|
+
/* @__PURE__ */ m(
|
179
179
|
aa,
|
180
180
|
{
|
181
181
|
defaultValue: w,
|
@@ -187,21 +187,21 @@ function Qa(t) {
|
|
187
187
|
onPanelChange: (y) => {
|
188
188
|
R(y);
|
189
189
|
},
|
190
|
-
disabledDate: (y) => !
|
190
|
+
disabledDate: (y) => !Je.parseDate(y.format("YYYY-MM-DD"))
|
191
191
|
}
|
192
192
|
),
|
193
|
-
/* @__PURE__ */
|
193
|
+
/* @__PURE__ */ m("div", { className: Un.dvDateDropdownBtns, children: /* @__PURE__ */ m(Bt, { size: "small", type: "primary", onClick: I, disabled: !w.isValid(), children: g.t("dataValidation.alert.ok") }) })
|
194
194
|
] });
|
195
195
|
}
|
196
|
-
var
|
197
|
-
return
|
196
|
+
var ht = function() {
|
197
|
+
return ht = Object.assign || function(t) {
|
198
198
|
for (var e, o = 1, n = arguments.length; o < n; o++) {
|
199
199
|
e = arguments[o];
|
200
200
|
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
|
201
201
|
}
|
202
202
|
return t;
|
203
|
-
},
|
204
|
-
},
|
203
|
+
}, ht.apply(this, arguments);
|
204
|
+
}, ei = function(t, e) {
|
205
205
|
var o = {};
|
206
206
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
|
207
207
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
@@ -209,16 +209,16 @@ var ut = function() {
|
|
209
209
|
e.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[a]) && (o[n[a]] = t[n[a]]);
|
210
210
|
return o;
|
211
211
|
}, Ot = Mt(function(t, e) {
|
212
|
-
var o = t.icon, n = t.id, a = t.className, i = t.extend, r =
|
213
|
-
return
|
212
|
+
var o = t.icon, n = t.id, a = t.className, i = t.extend, r = ei(t, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(n, " ").concat(a || "").trim(), l = Zt("_".concat(ai()));
|
213
|
+
return Co(o, "".concat(n), { defIds: o.defIds, idSuffix: l.current }, ht({ ref: e, className: s }, r), i);
|
214
214
|
});
|
215
|
-
function
|
216
|
-
return Et(t.tag,
|
217
|
-
return
|
215
|
+
function Co(t, e, o, n, a) {
|
216
|
+
return Et(t.tag, ht(ht({ key: e }, ni(t, o, a)), n), (oi(t, o).children || []).map(function(i, r) {
|
217
|
+
return Co(i, "".concat(e, "-").concat(t.tag, "-").concat(r), o, void 0, a);
|
218
218
|
}));
|
219
219
|
}
|
220
|
-
function
|
221
|
-
var n =
|
220
|
+
function ni(t, e, o) {
|
221
|
+
var n = ht({}, t.attrs);
|
222
222
|
o != null && o.colorChannel1 && n.fill === "colorChannel1" && (n.fill = o.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(i) {
|
223
223
|
var r = i[0], s = i[1];
|
224
224
|
r === "mask" && typeof s == "string" && (n[r] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
@@ -229,92 +229,92 @@ function ei(t, e, o) {
|
|
229
229
|
typeof s == "string" && (n[r] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
230
230
|
})), n;
|
231
231
|
}
|
232
|
-
function
|
232
|
+
function oi(t, e) {
|
233
233
|
var o, n = e.defIds;
|
234
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((o = t.children) === null || o === void 0) && o.length) ?
|
235
|
-
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ?
|
234
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((o = t.children) === null || o === void 0) && o.length) ? ht(ht({}, t), { children: t.children.map(function(a) {
|
235
|
+
return typeof a.attrs.id == "string" && n && n.indexOf(a.attrs.id) > -1 ? ht(ht({}, a), { attrs: ht(ht({}, a.attrs), { id: a.attrs.id + e.idSuffix }) }) : a;
|
236
236
|
}) }) : t;
|
237
237
|
}
|
238
|
-
function
|
238
|
+
function ai() {
|
239
239
|
return Math.random().toString(36).substring(2, 8);
|
240
240
|
}
|
241
241
|
Ot.displayName = "UniverIcon";
|
242
|
-
var
|
242
|
+
var ii = { 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" } }] }, Io = Mt(function(t, e) {
|
243
243
|
return Et(Ot, Object.assign({}, t, {
|
244
244
|
id: "check-mark-single",
|
245
245
|
ref: e,
|
246
|
-
icon:
|
246
|
+
icon: ii
|
247
247
|
}));
|
248
248
|
});
|
249
|
-
|
250
|
-
var
|
249
|
+
Io.displayName = "CheckMarkSingle";
|
250
|
+
var ri = { 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" } }] }, wo = Mt(function(t, e) {
|
251
251
|
return Et(Ot, Object.assign({}, t, {
|
252
252
|
id: "data-validation-single",
|
253
253
|
ref: e,
|
254
|
-
icon:
|
254
|
+
icon: ri
|
255
255
|
}));
|
256
256
|
});
|
257
|
-
|
258
|
-
var
|
257
|
+
wo.displayName = "DataValidationSingle";
|
258
|
+
var si = { 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" } }] }, Rn = Mt(function(t, e) {
|
259
259
|
return Et(Ot, Object.assign({}, t, {
|
260
260
|
id: "delete-single",
|
261
261
|
ref: e,
|
262
|
-
icon:
|
262
|
+
icon: si
|
263
263
|
}));
|
264
264
|
});
|
265
|
-
|
266
|
-
var
|
265
|
+
Rn.displayName = "DeleteSingle";
|
266
|
+
var li = { 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" } }] }, Ro = Mt(function(t, e) {
|
267
267
|
return Et(Ot, Object.assign({}, t, {
|
268
268
|
id: "increase-single",
|
269
269
|
ref: e,
|
270
|
-
icon:
|
270
|
+
icon: li
|
271
271
|
}));
|
272
272
|
});
|
273
|
-
|
274
|
-
var
|
273
|
+
Ro.displayName = "IncreaseSingle";
|
274
|
+
var di = { 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" } }] }, Do = Mt(function(t, e) {
|
275
275
|
return Et(Ot, Object.assign({}, t, {
|
276
276
|
id: "more-down-single",
|
277
277
|
ref: e,
|
278
|
-
icon:
|
278
|
+
icon: di
|
279
279
|
}));
|
280
280
|
});
|
281
|
-
|
282
|
-
var
|
281
|
+
Do.displayName = "MoreDownSingle";
|
282
|
+
var ci = { 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" } }] }, Vo = Mt(function(t, e) {
|
283
283
|
return Et(Ot, Object.assign({}, t, {
|
284
284
|
id: "more-up-single",
|
285
285
|
ref: e,
|
286
|
-
icon:
|
286
|
+
icon: ci
|
287
287
|
}));
|
288
288
|
});
|
289
|
-
|
290
|
-
var
|
289
|
+
Vo.displayName = "MoreUpSingle";
|
290
|
+
var ui = { 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" } }] }] }, yo = Mt(function(t, e) {
|
291
291
|
return Et(Ot, Object.assign({}, t, {
|
292
292
|
id: "sequence-single",
|
293
293
|
ref: e,
|
294
|
-
icon:
|
294
|
+
icon: ui
|
295
295
|
}));
|
296
296
|
});
|
297
|
-
|
298
|
-
var
|
299
|
-
for (var a = n > 1 ? void 0 : n ?
|
297
|
+
yo.displayName = "SequenceSingle";
|
298
|
+
var hi = Object.getOwnPropertyDescriptor, pi = (t, e, o, n) => {
|
299
|
+
for (var a = n > 1 ? void 0 : n ? hi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
300
300
|
(r = t[i]) && (a = r(a) || a);
|
301
301
|
return a;
|
302
|
-
},
|
303
|
-
let
|
302
|
+
}, Bn = (t, e) => (o, n) => e(o, n, t);
|
303
|
+
let ft = class extends Vt {
|
304
304
|
constructor(e, o) {
|
305
305
|
super();
|
306
|
-
E(this, "_open$", new
|
307
|
-
E(this, "open$", this._open$.pipe(
|
306
|
+
E(this, "_open$", new Nn(!1));
|
307
|
+
E(this, "open$", this._open$.pipe(ja()));
|
308
308
|
E(this, "_activeRule");
|
309
|
-
E(this, "_activeRule$", new
|
309
|
+
E(this, "_activeRule$", new Nn(void 0));
|
310
310
|
E(this, "activeRule$", this._activeRule$.asObservable());
|
311
311
|
E(this, "_closeDisposable", null);
|
312
312
|
this._univerInstanceService = e, this._sidebarService = o, this.disposeWithMe(
|
313
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
|
313
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(In((n) => !n)).subscribe(() => {
|
314
314
|
this.close();
|
315
315
|
})
|
316
316
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
317
|
-
n.id ===
|
317
|
+
n.id === Me && (n.visible || setTimeout(() => {
|
318
318
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
319
319
|
}));
|
320
320
|
}));
|
@@ -345,16 +345,16 @@ let mt = class extends Vt {
|
|
345
345
|
this._activeRule = e, this._activeRule$.next(e);
|
346
346
|
}
|
347
347
|
};
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
],
|
352
|
-
function
|
353
|
-
const t = T(Dt), e = St(t.activeDropdown$, t.activeDropdown), o = T(
|
348
|
+
ft = pi([
|
349
|
+
Bn(0, st),
|
350
|
+
Bn(1, mo)
|
351
|
+
], ft);
|
352
|
+
function mi() {
|
353
|
+
const t = T(Dt), e = St(t.activeDropdown$, t.activeDropdown), o = T(Ae);
|
354
354
|
if (!e)
|
355
355
|
return null;
|
356
356
|
const { location: n, componentKey: a } = e, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
357
|
-
return i ? /* @__PURE__ */
|
357
|
+
return i ? /* @__PURE__ */ m(
|
358
358
|
i,
|
359
359
|
{
|
360
360
|
location: n,
|
@@ -365,8 +365,8 @@ function pi() {
|
|
365
365
|
r
|
366
366
|
) : null;
|
367
367
|
}
|
368
|
-
const
|
369
|
-
var gi = Object.getOwnPropertyDescriptor,
|
368
|
+
const Mo = "sheet.ui.dropdown";
|
369
|
+
var gi = Object.getOwnPropertyDescriptor, fi = (t, e, o, n) => {
|
370
370
|
for (var a = n > 1 ? void 0 : n ? gi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
371
371
|
(r = t[i]) && (a = r(a) || a);
|
372
372
|
return a;
|
@@ -375,7 +375,7 @@ let Dt = class extends Vt {
|
|
375
375
|
constructor(e, o, n, a, i, r, s) {
|
376
376
|
super();
|
377
377
|
E(this, "_activeDropdown");
|
378
|
-
E(this, "_activeDropdown$", new
|
378
|
+
E(this, "_activeDropdown$", new Ya());
|
379
379
|
E(this, "_currentPopup", null);
|
380
380
|
E(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
381
381
|
E(this, "_zenVisible", !1);
|
@@ -418,7 +418,7 @@ let Dt = class extends Vt {
|
|
418
418
|
a,
|
419
419
|
i,
|
420
420
|
{
|
421
|
-
componentKey:
|
421
|
+
componentKey: Mo,
|
422
422
|
onClickOutside: () => {
|
423
423
|
o && this.hideDropdown();
|
424
424
|
},
|
@@ -470,22 +470,22 @@ let Dt = class extends Vt {
|
|
470
470
|
});
|
471
471
|
}
|
472
472
|
};
|
473
|
-
Dt =
|
474
|
-
Lt(0, b(
|
475
|
-
Lt(1,
|
473
|
+
Dt = fi([
|
474
|
+
Lt(0, b(Ma)),
|
475
|
+
Lt(1, st),
|
476
476
|
Lt(2, b(bt)),
|
477
477
|
Lt(3, go),
|
478
478
|
Lt(4, yt),
|
479
479
|
Lt(5, b(at)),
|
480
|
-
Lt(6, b(
|
480
|
+
Lt(6, b(Qn))
|
481
481
|
], Dt);
|
482
|
-
const
|
482
|
+
const Me = "DataValidationPanel", Ht = {
|
483
483
|
id: "data-validation.operation.open-validation-panel",
|
484
|
-
type:
|
484
|
+
type: ne.OPERATION,
|
485
485
|
handler(t, e) {
|
486
486
|
if (!e)
|
487
487
|
return !1;
|
488
|
-
const { ruleId: o, isAdd: n } = e, a = t.get(
|
488
|
+
const { ruleId: o, isAdd: n } = e, a = t.get(ft), i = t.get(ke), r = t.get(st), s = t.get(mo), l = to(r);
|
489
489
|
if (!l) return !1;
|
490
490
|
const { unitId: c, subUnitId: u } = l, h = o ? i.getRuleById(c, u, o) : void 0;
|
491
491
|
a.open(), a.setActiveRule(h && {
|
@@ -494,29 +494,29 @@ const Ve = "DataValidationPanel", Ht = {
|
|
494
494
|
rule: h
|
495
495
|
});
|
496
496
|
const d = s.open({
|
497
|
-
id:
|
497
|
+
id: Me,
|
498
498
|
header: { title: n ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
499
|
-
children: { label:
|
499
|
+
children: { label: Me },
|
500
500
|
width: 312,
|
501
501
|
onClose: () => a.close()
|
502
502
|
});
|
503
503
|
return a.setCloseDisposable(d), !0;
|
504
504
|
}
|
505
|
-
},
|
505
|
+
}, Dn = {
|
506
506
|
id: "data-validation.operation.close-validation-panel",
|
507
|
-
type:
|
507
|
+
type: ne.OPERATION,
|
508
508
|
handler(t) {
|
509
|
-
return t.get(
|
509
|
+
return t.get(ft).close(), !0;
|
510
510
|
}
|
511
|
-
},
|
511
|
+
}, Eo = {
|
512
512
|
id: "data-validation.operation.toggle-validation-panel",
|
513
|
-
type:
|
513
|
+
type: ne.OPERATION,
|
514
514
|
handler(t) {
|
515
|
-
const e = t.get(tt), o = t.get(
|
516
|
-
return o.open(), o.isOpen ? e.executeCommand(
|
515
|
+
const e = t.get(tt), o = t.get(ft);
|
516
|
+
return o.open(), o.isOpen ? e.executeCommand(Dn.id) : e.executeCommand(Ht.id), !0;
|
517
517
|
}
|
518
|
-
},
|
519
|
-
type:
|
518
|
+
}, Fe = {
|
519
|
+
type: ne.OPERATION,
|
520
520
|
id: "sheet.operation.show-data-validation-dropdown",
|
521
521
|
handler(t, e) {
|
522
522
|
if (!e)
|
@@ -529,37 +529,37 @@ const Ve = "DataValidationPanel", Ht = {
|
|
529
529
|
r
|
530
530
|
), !0;
|
531
531
|
}
|
532
|
-
},
|
533
|
-
type:
|
532
|
+
}, bo = {
|
533
|
+
type: ne.OPERATION,
|
534
534
|
id: "sheet.operation.hide-data-validation-dropdown",
|
535
535
|
handler(t, e) {
|
536
536
|
return e ? (t.get(Dt).hideDropdown(), !0) : !1;
|
537
537
|
}
|
538
|
-
}, Ft = "#ECECEC",
|
539
|
-
dvListDropdown:
|
540
|
-
dvListDropdownTitle:
|
541
|
-
dvListDropdownList:
|
542
|
-
dvListDropdownListContainer:
|
543
|
-
dvListDropdownSelectedIcon:
|
544
|
-
dvListDropdownItemContainer:
|
545
|
-
dvListDropdownItem:
|
546
|
-
dvListDropdownSplit:
|
547
|
-
dvListDropdownEdit:
|
548
|
-
},
|
538
|
+
}, Ft = "#ECECEC", Vn = "sheets-data-validation-ui.config", Ee = {}, vi = "univer-dv-list-dropdown", _i = "univer-dv-list-dropdown-title", Si = "univer-dv-list-dropdown-list", Ci = "univer-dv-list-dropdown-list-container", Ii = "univer-dv-list-dropdown-selected-icon", wi = "univer-dv-list-dropdown-item-container", Ri = "univer-dv-list-dropdown-item", Di = "univer-dv-list-dropdown-split", Vi = "univer-dv-list-dropdown-edit", _t = {
|
539
|
+
dvListDropdown: vi,
|
540
|
+
dvListDropdownTitle: _i,
|
541
|
+
dvListDropdownList: Si,
|
542
|
+
dvListDropdownListContainer: Ci,
|
543
|
+
dvListDropdownSelectedIcon: Ii,
|
544
|
+
dvListDropdownItemContainer: wi,
|
545
|
+
dvListDropdownItem: Ri,
|
546
|
+
dvListDropdownSplit: Di,
|
547
|
+
dvListDropdownEdit: Vi
|
548
|
+
}, yi = (t) => {
|
549
549
|
var C, I;
|
550
|
-
const { value: e, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: s, filter: l, location: c } = t, u = T(Q), h = T(
|
550
|
+
const { value: e, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: s, filter: l, location: c } = t, u = T(Q), h = T(mn), d = l == null ? void 0 : l.toLowerCase(), { row: _, col: p, unitId: R, subUnitId: w } = c, g = a.filter((v) => d ? v.label.toLowerCase().includes(d) : !0), f = (I = (C = h.getConfig(Vn)) == null ? void 0 : C.showEditOnDropdown) != null ? I : !0, S = T(eo), V = $t(() => S.permissionCheckWithRanges(
|
551
551
|
{
|
552
|
-
workbookTypes: [
|
553
|
-
rangeTypes: [
|
554
|
-
worksheetTypes: [
|
552
|
+
workbookTypes: [Ve],
|
553
|
+
rangeTypes: [De],
|
554
|
+
worksheetTypes: [Re]
|
555
555
|
},
|
556
556
|
[{ startColumn: p, startRow: _, endColumn: p, endRow: _ }],
|
557
557
|
R,
|
558
558
|
w
|
559
559
|
), [S, p, _, R, w]);
|
560
560
|
return /* @__PURE__ */ Y("div", { className: _t.dvListDropdown, style: s, children: [
|
561
|
-
/* @__PURE__ */
|
562
|
-
/* @__PURE__ */
|
561
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownTitle, children: i }),
|
562
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownList, children: /* @__PURE__ */ m(ia, { children: /* @__PURE__ */ m("div", { className: _t.dvListDropdownListContainer, children: g.map((v, y) => {
|
563
563
|
const P = e.indexOf(v.value) > -1, U = () => {
|
564
564
|
let L;
|
565
565
|
P ? L = new Set(e.filter((F) => F !== v.value)) : L = new Set(n ? [...e, v.value] : [v.value]);
|
@@ -569,33 +569,33 @@ const Ve = "DataValidationPanel", Ht = {
|
|
569
569
|
}), o(A);
|
570
570
|
}, O = v.label.toLocaleLowerCase().indexOf(d);
|
571
571
|
return /* @__PURE__ */ Y("div", { className: _t.dvListDropdownItemContainer, onClick: U, children: [
|
572
|
-
/* @__PURE__ */
|
573
|
-
/* @__PURE__ */
|
574
|
-
/* @__PURE__ */
|
575
|
-
/* @__PURE__ */
|
572
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownItem, style: { background: v.color || Ft }, children: d && v.label.toLowerCase().includes(d) ? /* @__PURE__ */ Y(Rt, { children: [
|
573
|
+
/* @__PURE__ */ m("span", { children: v.label.substring(0, O) }),
|
574
|
+
/* @__PURE__ */ m("span", { style: { fontWeight: "bold" }, children: v.label.substring(O, O + d.length) }),
|
575
|
+
/* @__PURE__ */ m("span", { children: v.label.substring(O + d.length) })
|
576
576
|
] }) : v.label }),
|
577
|
-
/* @__PURE__ */
|
577
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownSelectedIcon, children: P ? /* @__PURE__ */ m(Io, {}) : null })
|
578
578
|
] }, y);
|
579
579
|
}) }) }, l) }),
|
580
580
|
f && V ? /* @__PURE__ */ Y(Rt, { children: [
|
581
|
-
/* @__PURE__ */
|
582
|
-
/* @__PURE__ */
|
581
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownSplit }),
|
582
|
+
/* @__PURE__ */ m("div", { className: _t.dvListDropdownEdit, children: /* @__PURE__ */ m("a", { onClick: r, children: u.t("dataValidation.list.edit") }) })
|
583
583
|
] }) : null
|
584
584
|
] });
|
585
585
|
};
|
586
|
-
function
|
586
|
+
function Mi(t) {
|
587
587
|
var N, B, x, z;
|
588
|
-
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s } = e, l = T(
|
589
|
-
St(
|
590
|
-
const S =
|
588
|
+
const { location: e, hideFn: o } = t, { worksheet: n, row: a, col: i, unitId: r, subUnitId: s } = e, l = T(ke), [c, u] = j(""), h = T(tt), d = T(Q), [_, p] = j(""), R = T(ho), w = T(st), g = $t(() => l.ruleChange$.pipe(wn(16)), []), f = T(at);
|
589
|
+
St(g);
|
590
|
+
const S = Na.useContext(), V = ((B = (N = S.current) == null ? void 0 : N.right) != null ? B : 0) - ((z = (x = S.current) == null ? void 0 : x.left) != null ? z : 0);
|
591
591
|
if (wt(() => {
|
592
592
|
const H = h.onCommandExecuted((G) => {
|
593
593
|
var J, et;
|
594
|
-
if (G.id ===
|
595
|
-
const nt = G.params, { unitId:
|
594
|
+
if (G.id === xa.id) {
|
595
|
+
const nt = G.params, { unitId: lt } = nt, it = w.getUnit(lt, X.UNIVER_DOC);
|
596
596
|
if (!it || !R.isVisible().visible) return;
|
597
|
-
const
|
598
|
-
u(
|
597
|
+
const dt = zo.transform.getPlainText((et = (J = it.getSnapshot().body) == null ? void 0 : J.dataStream) != null ? et : "");
|
598
|
+
u(dt);
|
599
599
|
}
|
600
600
|
});
|
601
601
|
return () => {
|
@@ -609,10 +609,10 @@ function yi(t) {
|
|
609
609
|
const I = f.getValidator(C.type);
|
610
610
|
if (!I)
|
611
611
|
return null;
|
612
|
-
const v = n.getCell(a, i), y = (C == null ? void 0 : C.renderMode) ===
|
612
|
+
const v = n.getCell(a, i), y = (C == null ? void 0 : C.renderMode) === ut.CUSTOM || (C == null ? void 0 : C.renderMode) === void 0;
|
613
613
|
if (!v || !C || !I || I.id.indexOf(K.LIST) !== 0)
|
614
614
|
return;
|
615
|
-
const P = C.type === K.LIST_MULTIPLE, U = I.getListWithColor(C, r, s), O = _ ||
|
615
|
+
const P = C.type === K.LIST_MULTIPLE, U = I.getListWithColor(C, r, s), O = _ || _a(n.getCellRaw(a, i)), L = ao(O), A = () => {
|
616
616
|
h.executeCommand(Ht.id, {
|
617
617
|
ruleId: C.uid
|
618
618
|
}), o();
|
@@ -621,15 +621,15 @@ function yi(t) {
|
|
621
621
|
value: H.label,
|
622
622
|
color: y || H.color ? H.color : "transparent"
|
623
623
|
}));
|
624
|
-
return /* @__PURE__ */
|
625
|
-
|
624
|
+
return /* @__PURE__ */ m(
|
625
|
+
yi,
|
626
626
|
{
|
627
627
|
style: { minWidth: V, maxWidth: Math.max(V, 200) },
|
628
628
|
title: P ? d.t("dataValidation.listMultiple.dropdown") : d.t("dataValidation.list.dropdown"),
|
629
629
|
value: L,
|
630
630
|
multiple: P,
|
631
631
|
onChange: async (H) => {
|
632
|
-
const G =
|
632
|
+
const G = io(H), J = {
|
633
633
|
unitId: r,
|
634
634
|
subUnitId: s,
|
635
635
|
range: {
|
@@ -645,17 +645,17 @@ function yi(t) {
|
|
645
645
|
si: null
|
646
646
|
}
|
647
647
|
};
|
648
|
-
R.isVisible() && h.executeCommand(
|
648
|
+
R.isVisible() && h.executeCommand(rn.id, {
|
649
649
|
visible: !1,
|
650
|
-
eventType:
|
650
|
+
eventType: nn.Keyboard,
|
651
651
|
unitId: r,
|
652
|
-
keycode:
|
653
|
-
}), p(G), P || o(), R.isVisible().visible && await h.executeCommand(
|
652
|
+
keycode: ln.ESC
|
653
|
+
}), p(G), P || o(), R.isVisible().visible && await h.executeCommand(rn.id, {
|
654
654
|
visible: !1,
|
655
|
-
eventType:
|
655
|
+
eventType: nn.Keyboard,
|
656
656
|
unitId: r,
|
657
|
-
keycode:
|
658
|
-
}), h.executeCommand(
|
657
|
+
keycode: ln.ESC
|
658
|
+
}), h.executeCommand(_n.id, J);
|
659
659
|
},
|
660
660
|
options: F,
|
661
661
|
onEdit: A,
|
@@ -664,43 +664,43 @@ function yi(t) {
|
|
664
664
|
}
|
665
665
|
);
|
666
666
|
}
|
667
|
-
const
|
668
|
-
dataValidationOptionsButton:
|
669
|
-
dataValidationOptionsButtonIcon:
|
667
|
+
const Ei = "univer-data-validation-options-button", bi = "univer-data-validation-options-button-icon", We = {
|
668
|
+
dataValidationOptionsButton: Ei,
|
669
|
+
dataValidationOptionsButtonIcon: bi
|
670
670
|
};
|
671
|
-
function
|
671
|
+
function Oi(t) {
|
672
672
|
var c;
|
673
|
-
const e = T(Q), o = T(
|
673
|
+
const e = T(Q), o = T(Ae), { value: n, onChange: a, extraComponent: i } = t, [r, s] = j(!1), l = i ? o.get(i) : null;
|
674
674
|
return /* @__PURE__ */ Y(Rt, { children: [
|
675
|
-
/* @__PURE__ */ Y("div", { className:
|
675
|
+
/* @__PURE__ */ Y("div", { className: We.dataValidationOptionsButton, onClick: () => s(!r), children: [
|
676
676
|
e.t("dataValidation.panel.options"),
|
677
|
-
r ? /* @__PURE__ */
|
677
|
+
r ? /* @__PURE__ */ m(Vo, { className: We.dataValidationOptionsButtonIcon }) : /* @__PURE__ */ m(Do, { className: We.dataValidationOptionsButtonIcon })
|
678
678
|
] }),
|
679
679
|
r && /* @__PURE__ */ Y(Rt, { children: [
|
680
|
-
l ? /* @__PURE__ */
|
681
|
-
/* @__PURE__ */
|
680
|
+
l ? /* @__PURE__ */ m(l, { value: n, onChange: a }) : null,
|
681
|
+
/* @__PURE__ */ m(
|
682
682
|
q,
|
683
683
|
{
|
684
684
|
label: e.t("dataValidation.panel.invalid"),
|
685
685
|
children: /* @__PURE__ */ Y(
|
686
|
-
|
686
|
+
fn,
|
687
687
|
{
|
688
|
-
value: `${(c = n.errorStyle) != null ? c :
|
688
|
+
value: `${(c = n.errorStyle) != null ? c : le.WARNING}`,
|
689
689
|
onChange: (u) => a({ ...n, errorStyle: +u }),
|
690
690
|
children: [
|
691
|
-
/* @__PURE__ */
|
692
|
-
/* @__PURE__ */
|
691
|
+
/* @__PURE__ */ m(Nt, { value: `${le.WARNING}`, children: e.t("dataValidation.panel.showWarning") }),
|
692
|
+
/* @__PURE__ */ m(Nt, { value: `${le.STOP}`, children: e.t("dataValidation.panel.rejectInput") })
|
693
693
|
]
|
694
694
|
}
|
695
695
|
)
|
696
696
|
}
|
697
697
|
),
|
698
|
-
/* @__PURE__ */
|
698
|
+
/* @__PURE__ */ m(
|
699
699
|
q,
|
700
700
|
{
|
701
701
|
label: e.t("dataValidation.panel.messageInfo"),
|
702
|
-
children: /* @__PURE__ */
|
703
|
-
|
702
|
+
children: /* @__PURE__ */ m(
|
703
|
+
Pe,
|
704
704
|
{
|
705
705
|
checked: n.showErrorMessage,
|
706
706
|
onChange: () => a({
|
@@ -712,29 +712,29 @@ function bi(t) {
|
|
712
712
|
)
|
713
713
|
}
|
714
714
|
),
|
715
|
-
n.showErrorMessage ? /* @__PURE__ */
|
715
|
+
n.showErrorMessage ? /* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(Ut, { value: n.error, onChange: (u) => a({ ...n, error: u }) }) }) : null
|
716
716
|
] })
|
717
717
|
] });
|
718
718
|
}
|
719
|
-
const
|
720
|
-
dataValidationDetail:
|
721
|
-
dataValidationDetailFormItem:
|
722
|
-
dataValidationDetailButtons:
|
723
|
-
dataValidationDetailButton:
|
724
|
-
},
|
719
|
+
const Li = "univer-data-validation-detail", Ti = "univer-data-validation-detail-form-item", Pi = "univer-data-validation-detail-buttons", Ai = "univer-data-validation-detail-button", xt = {
|
720
|
+
dataValidationDetail: Li,
|
721
|
+
dataValidationDetailFormItem: Ti,
|
722
|
+
dataValidationDetailButtons: Pi,
|
723
|
+
dataValidationDetailButton: Ai
|
724
|
+
}, ki = (t) => Ko(
|
725
725
|
async (e, o, n, a) => {
|
726
726
|
const i = await t.executeCommand(e, o, n);
|
727
727
|
a == null || a(i);
|
728
728
|
},
|
729
729
|
1e3
|
730
730
|
);
|
731
|
-
function
|
731
|
+
function Fi(t, e, o) {
|
732
732
|
var n, a, i, r;
|
733
733
|
return e ? ((a = (n = t.getUnit(e)) == null ? void 0 : n.getSheetBySheetName(o)) == null ? void 0 : a.getSheetId()) || "" : ((r = (i = t.getCurrentUnitForType(X.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetName(o)) == null ? void 0 : r.getSheetId()) || "";
|
734
734
|
}
|
735
|
-
function
|
736
|
-
var
|
737
|
-
const [t, e] = j(0), o = T(
|
735
|
+
function Ni() {
|
736
|
+
var dt;
|
737
|
+
const [t, e] = j(0), o = T(ft), n = St(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, s = r.uid, l = T(bt), c = T(st), u = T(Ae), h = T(tt), d = T(ke), _ = T(Q), [p, R] = j(r), w = l.getValidatorItem(p.type), [g, f] = j(!1), S = l.getValidatorsByScope(Wa.SHEET), [V, C] = j(() => p.ranges.map((M) => ({ unitId: "", sheetId: "", range: M }))), I = $t(() => ki(h), [h]), [v, y] = j(!1), [P, U] = j(!1), O = Zt(null), L = T(Qn);
|
738
738
|
if (wt(() => () => {
|
739
739
|
const M = L.getCurrentLastSelection();
|
740
740
|
M && L.setSelections([M]);
|
@@ -747,14 +747,14 @@ function Fi() {
|
|
747
747
|
});
|
748
748
|
}, [h, d, s, i, a]), !w)
|
749
749
|
return null;
|
750
|
-
const A = w.operators, F = w.operatorNames, N = p.operator ?
|
750
|
+
const A = w.operators, F = w.operatorNames, N = p.operator ? Ha.includes(p.operator) : !1, B = () => {
|
751
751
|
var M, D, k;
|
752
752
|
(D = (M = O.current) == null ? void 0 : M.editor) != null && D.isFocus() && x((k = O.current) == null ? void 0 : k.getValue()), !(!p.ranges.length || v) && (w.validatorFormula(p, a, i).success ? o.setActiveRule(null) : f(!0));
|
753
|
-
}, x =
|
754
|
-
const D = M.split(",").filter(Boolean).map(
|
753
|
+
}, x = dn((M) => {
|
754
|
+
const D = M.split(",").filter(Boolean).map(za).map((W) => {
|
755
755
|
const Ct = W.sheetName;
|
756
756
|
if (Ct) {
|
757
|
-
const $o =
|
757
|
+
const $o = Fi(c, W.unitId, Ct);
|
758
758
|
return { ...W, sheetId: $o };
|
759
759
|
}
|
760
760
|
return {
|
@@ -777,9 +777,9 @@ function Fi() {
|
|
777
777
|
ruleId: s,
|
778
778
|
ranges: k
|
779
779
|
};
|
780
|
-
I(
|
780
|
+
I(ro.id, $);
|
781
781
|
}), z = (M) => {
|
782
|
-
if (
|
782
|
+
if (En(M, Fn(p)))
|
783
783
|
return;
|
784
784
|
R({
|
785
785
|
...p,
|
@@ -792,12 +792,12 @@ function Fi() {
|
|
792
792
|
setting: M
|
793
793
|
};
|
794
794
|
I(
|
795
|
-
|
795
|
+
On.id,
|
796
796
|
D,
|
797
797
|
void 0
|
798
798
|
);
|
799
799
|
}, H = async () => {
|
800
|
-
await h.executeCommand(
|
800
|
+
await h.executeCommand(so.id, {
|
801
801
|
ruleId: s,
|
802
802
|
unitId: a,
|
803
803
|
subUnitId: i
|
@@ -822,18 +822,18 @@ function Fi() {
|
|
822
822
|
formula1: void 0,
|
823
823
|
formula2: void 0
|
824
824
|
};
|
825
|
-
R(W), h.executeCommand(
|
825
|
+
R(W), h.executeCommand(On.id, {
|
826
826
|
unitId: a,
|
827
827
|
subUnitId: i,
|
828
828
|
ruleId: p.uid,
|
829
|
-
setting:
|
829
|
+
setting: Fn(W)
|
830
830
|
});
|
831
|
-
}, et = u.get(w.formulaInput), nt = $t(() => V.map((M) =>
|
832
|
-
|
831
|
+
}, et = u.get(w.formulaInput), nt = $t(() => V.map((M) => _o(M.range)).join(","), []), lt = kn(p), it = (M) => {
|
832
|
+
En(M, kn(p)) || (R({
|
833
833
|
...p,
|
834
834
|
...M
|
835
835
|
}), I(
|
836
|
-
|
836
|
+
Sa.id,
|
837
837
|
{
|
838
838
|
unitId: a,
|
839
839
|
subUnitId: i,
|
@@ -843,13 +843,13 @@ function Fi() {
|
|
843
843
|
));
|
844
844
|
};
|
845
845
|
return /* @__PURE__ */ Y("div", { className: xt.dataValidationDetail, children: [
|
846
|
-
/* @__PURE__ */
|
846
|
+
/* @__PURE__ */ m(
|
847
847
|
q,
|
848
848
|
{
|
849
849
|
label: _.t("dataValidation.panel.range"),
|
850
850
|
error: !p.ranges.length || v ? _.t("dataValidation.panel.rangeError") : "",
|
851
|
-
children: /* @__PURE__ */
|
852
|
-
|
851
|
+
children: /* @__PURE__ */ m(
|
852
|
+
Ka,
|
853
853
|
{
|
854
854
|
selectorRef: O,
|
855
855
|
unitId: a,
|
@@ -868,8 +868,8 @@ function Fi() {
|
|
868
868
|
)
|
869
869
|
}
|
870
870
|
),
|
871
|
-
/* @__PURE__ */
|
872
|
-
|
871
|
+
/* @__PURE__ */ m(q, { label: _.t("dataValidation.panel.type"), children: /* @__PURE__ */ m(
|
872
|
+
en,
|
873
873
|
{
|
874
874
|
options: S == null ? void 0 : S.map((M) => ({
|
875
875
|
label: _.t(M.title),
|
@@ -880,8 +880,8 @@ function Fi() {
|
|
880
880
|
className: xt.dataValidationDetailFormItem
|
881
881
|
}
|
882
882
|
) }),
|
883
|
-
A != null && A.length ? /* @__PURE__ */
|
884
|
-
|
883
|
+
A != null && A.length ? /* @__PURE__ */ m(q, { label: _.t("dataValidation.panel.operator"), children: /* @__PURE__ */ m(
|
884
|
+
en,
|
885
885
|
{
|
886
886
|
options: A.map((M, D) => ({
|
887
887
|
value: `${M}`,
|
@@ -897,7 +897,7 @@ function Fi() {
|
|
897
897
|
className: xt.dataValidationDetailFormItem
|
898
898
|
}
|
899
899
|
) }) : null,
|
900
|
-
et ? /* @__PURE__ */
|
900
|
+
et ? /* @__PURE__ */ m(
|
901
901
|
et,
|
902
902
|
{
|
903
903
|
isTwoFormula: N,
|
@@ -911,7 +911,7 @@ function Fi() {
|
|
911
911
|
...M
|
912
912
|
});
|
913
913
|
},
|
914
|
-
showError:
|
914
|
+
showError: g,
|
915
915
|
validResult: w.validatorFormula(p, a, i),
|
916
916
|
unitId: a,
|
917
917
|
subUnitId: i,
|
@@ -919,10 +919,10 @@ function Fi() {
|
|
919
919
|
},
|
920
920
|
t + p.type
|
921
921
|
) : null,
|
922
|
-
/* @__PURE__ */
|
923
|
-
|
922
|
+
/* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
923
|
+
Pe,
|
924
924
|
{
|
925
|
-
checked: (
|
925
|
+
checked: (dt = p.allowBlank) != null ? dt : !0,
|
926
926
|
onChange: () => {
|
927
927
|
var M;
|
928
928
|
return z({
|
@@ -933,70 +933,70 @@ function Fi() {
|
|
933
933
|
children: _.t("dataValidation.panel.allowBlank")
|
934
934
|
}
|
935
935
|
) }),
|
936
|
-
/* @__PURE__ */
|
936
|
+
/* @__PURE__ */ m(Oi, { value: lt, onChange: it, extraComponent: w.optionsInput }),
|
937
937
|
/* @__PURE__ */ Y("div", { className: xt.dataValidationDetailButtons, children: [
|
938
|
-
/* @__PURE__ */
|
939
|
-
/* @__PURE__ */
|
938
|
+
/* @__PURE__ */ m(Bt, { className: xt.dataValidationDetailButton, onClick: H, children: _.t("dataValidation.panel.removeRule") }),
|
939
|
+
/* @__PURE__ */ m(Bt, { className: xt.dataValidationDetailButton, type: "primary", onClick: B, children: _.t("dataValidation.panel.done") })
|
940
940
|
] })
|
941
941
|
] });
|
942
942
|
}
|
943
|
-
const
|
944
|
-
dataValidationItemContainer:
|
945
|
-
dataValidationItemTitle:
|
946
|
-
dataValidationItemContent:
|
947
|
-
dataValidationItemIcon:
|
948
|
-
},
|
949
|
-
const { rule: e, onClick: o, unitId: n, subUnitId: a, disable: i } = t, r = T(bt), s = T(tt), l = T(
|
943
|
+
const Ui = "univer-data-validation-item-container", Bi = "univer-data-validation-item-title", $i = "univer-data-validation-item-content", Wi = "univer-data-validation-item-icon", pe = {
|
944
|
+
dataValidationItemContainer: Ui,
|
945
|
+
dataValidationItemTitle: Bi,
|
946
|
+
dataValidationItemContent: $i,
|
947
|
+
dataValidationItemIcon: Wi
|
948
|
+
}, Hi = (t) => {
|
949
|
+
const { rule: e, onClick: o, unitId: n, subUnitId: a, disable: i } = t, r = T(bt), s = T(tt), l = T(Ea), c = r.getValidatorItem(e.type), u = Zt(void 0), [h, d] = j(!1), _ = T(zn), p = St(_.currentTheme$), R = $t(() => {
|
950
950
|
var S;
|
951
|
-
const
|
951
|
+
const g = (S = p == null ? void 0 : p.loopColor2) != null ? S : "#49B811", f = new Jo(g).toRgb();
|
952
952
|
return {
|
953
953
|
fill: `rgba(${f.r}, ${f.g}, ${f.b}, 0.1)`,
|
954
|
-
stroke:
|
954
|
+
stroke: g
|
955
955
|
};
|
956
|
-
}, [p]), w = (
|
957
|
-
s.executeCommand(
|
956
|
+
}, [p]), w = (g) => {
|
957
|
+
s.executeCommand(so.id, {
|
958
958
|
ruleId: e.uid,
|
959
959
|
unitId: n,
|
960
960
|
subUnitId: a
|
961
|
-
}),
|
961
|
+
}), g.stopPropagation();
|
962
962
|
};
|
963
963
|
return wt(() => () => {
|
964
|
-
var
|
965
|
-
u.current && ((
|
964
|
+
var g;
|
965
|
+
u.current && ((g = u.current) == null || g.forEach((f) => {
|
966
966
|
f && l.removeShape(f);
|
967
967
|
}));
|
968
968
|
}, [l]), /* @__PURE__ */ Y(
|
969
969
|
"div",
|
970
970
|
{
|
971
|
-
className:
|
971
|
+
className: pe.dataValidationItemContainer,
|
972
972
|
onClick: o,
|
973
973
|
onMouseEnter: () => {
|
974
|
-
i || (d(!0), u.current = e.ranges.map((
|
975
|
-
range:
|
974
|
+
i || (d(!0), u.current = e.ranges.map((g) => l.addShape({
|
975
|
+
range: g,
|
976
976
|
style: R,
|
977
977
|
primary: null
|
978
978
|
})));
|
979
979
|
},
|
980
980
|
onMouseLeave: () => {
|
981
|
-
var
|
982
|
-
d(!1), (
|
981
|
+
var g;
|
982
|
+
d(!1), (g = u.current) == null || g.forEach((f) => {
|
983
983
|
f && l.removeShape(f);
|
984
984
|
}), u.current = void 0;
|
985
985
|
},
|
986
986
|
children: [
|
987
|
-
/* @__PURE__ */
|
988
|
-
/* @__PURE__ */
|
989
|
-
h ? /* @__PURE__ */
|
987
|
+
/* @__PURE__ */ m("div", { className: pe.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(e) }),
|
988
|
+
/* @__PURE__ */ m("div", { className: pe.dataValidationItemContent, children: e.ranges.map((g) => _o(g)).join(",") }),
|
989
|
+
h ? /* @__PURE__ */ m("div", { className: pe.dataValidationItemIcon, onClick: w, children: /* @__PURE__ */ m(Rn, {}) }) : null
|
990
990
|
]
|
991
991
|
}
|
992
992
|
);
|
993
|
-
},
|
994
|
-
dataValidationList:
|
995
|
-
dataValidationListButtons:
|
996
|
-
dataValidationListButton:
|
993
|
+
}, xi = "univer-data-validation-list", ji = "univer-data-validation-list-buttons", Yi = "univer-data-validation-list-button", me = {
|
994
|
+
dataValidationList: xi,
|
995
|
+
dataValidationListButtons: ji,
|
996
|
+
dataValidationListButton: Yi
|
997
997
|
};
|
998
|
-
function
|
999
|
-
const e = T(at), o = T(
|
998
|
+
function Xi(t) {
|
999
|
+
const e = T(at), o = T(st), n = T(tt), a = T(Wt), i = T(ft), r = T(Q), [s, l] = j([]), { workbook: c } = t, u = St(c.activeSheet$, void 0, !0), h = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
1000
1000
|
wt(() => {
|
1001
1001
|
l(e.getRules(h, d));
|
1002
1002
|
const f = e.ruleChange$.subscribe((S) => {
|
@@ -1007,30 +1007,30 @@ function Yi(t) {
|
|
1007
1007
|
};
|
1008
1008
|
}, [h, d, e]);
|
1009
1009
|
const _ = async () => {
|
1010
|
-
const f =
|
1010
|
+
const f = lo(a), S = {
|
1011
1011
|
unitId: h,
|
1012
1012
|
subUnitId: d,
|
1013
1013
|
rule: f
|
1014
1014
|
};
|
1015
|
-
await n.executeCommand(
|
1015
|
+
await n.executeCommand(Sn.id, S), i.setActiveRule({
|
1016
1016
|
unitId: h,
|
1017
1017
|
subUnitId: d,
|
1018
1018
|
rule: f
|
1019
1019
|
});
|
1020
1020
|
}, p = () => {
|
1021
|
-
n.executeCommand(
|
1021
|
+
n.executeCommand(Ca.id, {
|
1022
1022
|
unitId: h,
|
1023
1023
|
subUnitId: d
|
1024
1024
|
});
|
1025
1025
|
}, w = ((f) => {
|
1026
1026
|
const S = o.getCurrentUnitForType(X.UNIVER_SHEET), V = S.getActiveSheet(), C = S.getUnitId(), I = V.getSheetId();
|
1027
|
-
return f.map((y) =>
|
1028
|
-
})(s),
|
1029
|
-
return /* @__PURE__ */ Y("div", { className:
|
1027
|
+
return f.map((y) => fa(a, C, I, y.ranges) ? { ...y } : { ...y, disable: !0 });
|
1028
|
+
})(s), g = w == null ? void 0 : w.some((f) => f.disable);
|
1029
|
+
return /* @__PURE__ */ Y("div", { className: me.dataValidationList, children: [
|
1030
1030
|
w == null ? void 0 : w.map((f) => {
|
1031
1031
|
var S;
|
1032
|
-
return /* @__PURE__ */
|
1033
|
-
|
1032
|
+
return /* @__PURE__ */ m(
|
1033
|
+
Hi,
|
1034
1034
|
{
|
1035
1035
|
unitId: h,
|
1036
1036
|
subUnitId: d,
|
@@ -1047,47 +1047,47 @@ function Yi(t) {
|
|
1047
1047
|
f.uid
|
1048
1048
|
);
|
1049
1049
|
}),
|
1050
|
-
/* @__PURE__ */ Y("div", { className:
|
1051
|
-
s.length && !
|
1052
|
-
/* @__PURE__ */
|
1050
|
+
/* @__PURE__ */ Y("div", { className: me.dataValidationListButtons, children: [
|
1051
|
+
s.length && !g ? /* @__PURE__ */ m(Bt, { className: me.dataValidationListButton, onClick: p, children: r.t("dataValidation.panel.removeAll") }) : null,
|
1052
|
+
/* @__PURE__ */ m(Bt, { className: me.dataValidationListButton, type: "primary", onClick: _, children: r.t("dataValidation.panel.add") })
|
1053
1053
|
] })
|
1054
1054
|
] });
|
1055
1055
|
}
|
1056
|
-
const
|
1057
|
-
const t = T(
|
1056
|
+
const zi = () => {
|
1057
|
+
const t = T(ft), e = St(t.activeRule$, t.activeRule), o = T(st), n = St(
|
1058
1058
|
() => o.getCurrentTypeOfUnit$(X.UNIVER_SHEET),
|
1059
1059
|
void 0,
|
1060
1060
|
void 0,
|
1061
1061
|
[]
|
1062
1062
|
), a = St(() => {
|
1063
1063
|
var i;
|
1064
|
-
return (i = n == null ? void 0 : n.activeSheet$) != null ? i :
|
1064
|
+
return (i = n == null ? void 0 : n.activeSheet$) != null ? i : Xa(null);
|
1065
1065
|
}, void 0, void 0, []);
|
1066
|
-
return !n || !a ? null : e && e.subUnitId === a.getSheetId() ? /* @__PURE__ */
|
1067
|
-
},
|
1068
|
-
type:
|
1066
|
+
return !n || !a ? null : e && e.subUnitId === a.getSheetId() ? /* @__PURE__ */ m(Ni, {}, e.rule.uid) : /* @__PURE__ */ m(Xi, { workbook: n });
|
1067
|
+
}, yn = "data-validation.list.dropdown", Oo = "data-validation.date.dropdown", Ne = {
|
1068
|
+
type: ne.COMMAND,
|
1069
1069
|
id: "data-validation.command.addRuleAndOpen",
|
1070
1070
|
handler(t) {
|
1071
|
-
const e = t.get(
|
1071
|
+
const e = t.get(st), o = to(e);
|
1072
1072
|
if (!o) return !1;
|
1073
|
-
const { workbook: n, worksheet: a } = o, i =
|
1073
|
+
const { workbook: n, worksheet: a } = o, i = lo(t), r = t.get(tt), s = n.getUnitId(), l = a.getSheetId(), c = {
|
1074
1074
|
rule: i,
|
1075
1075
|
unitId: s,
|
1076
1076
|
subUnitId: l
|
1077
1077
|
};
|
1078
|
-
return r.syncExecuteCommand(
|
1078
|
+
return r.syncExecuteCommand(Sn.id, c) ? (r.syncExecuteCommand(Ht.id, {
|
1079
1079
|
ruleId: i.uid,
|
1080
1080
|
isAdd: !0
|
1081
1081
|
}), !0) : !1;
|
1082
1082
|
}
|
1083
1083
|
};
|
1084
|
-
var
|
1085
|
-
for (var a = n > 1 ? void 0 : n ?
|
1084
|
+
var Ki = Object.getOwnPropertyDescriptor, Gi = (t, e, o, n) => {
|
1085
|
+
for (var a = n > 1 ? void 0 : n ? Ki(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1086
1086
|
(r = t[i]) && (a = r(a) || a);
|
1087
1087
|
return a;
|
1088
1088
|
}, jt = (t, e) => (o, n) => e(o, n, t);
|
1089
1089
|
const Tt = "SHEET_DATA_VALIDATION_ALERT";
|
1090
|
-
let
|
1090
|
+
let ue = class extends Vt {
|
1091
1091
|
constructor(t, e, o, n, a, i) {
|
1092
1092
|
super(), this._hoverManagerService = t, this._cellAlertManagerService = e, this._univerInstanceService = o, this._localeService = n, this._zenZoneService = a, this._dataValidationModel = i, this._init();
|
1093
1093
|
}
|
@@ -1095,7 +1095,7 @@ let de = class extends Vt {
|
|
1095
1095
|
this._initCellAlertPopup(), this._initZenService();
|
1096
1096
|
}
|
1097
1097
|
_initCellAlertPopup() {
|
1098
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1098
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(wn(100)).subscribe((t) => {
|
1099
1099
|
var e;
|
1100
1100
|
if (t) {
|
1101
1101
|
const o = this._univerInstanceService.getUnit(t.location.unitId, X.UNIVER_SHEET), n = o.getSheetBySheetId(t.location.subUnitId);
|
@@ -1105,7 +1105,7 @@ let de = class extends Vt {
|
|
1105
1105
|
this._cellAlertManagerService.removeAlert(Tt);
|
1106
1106
|
return;
|
1107
1107
|
}
|
1108
|
-
if (this._dataValidationModel.validator(a, { ...t.location, workbook: o, worksheet: n }) ===
|
1108
|
+
if (this._dataValidationModel.validator(a, { ...t.location, workbook: o, worksheet: n }) === de.INVALID) {
|
1109
1109
|
const r = this._cellAlertManagerService.currentAlert.get(Tt), s = (e = r == null ? void 0 : r.alert) == null ? void 0 : e.location;
|
1110
1110
|
if (s && s.row === t.location.row && s.col === t.location.col && s.subUnitId === t.location.subUnitId && s.unitId === t.location.unitId) {
|
1111
1111
|
this._cellAlertManagerService.removeAlert(Tt);
|
@@ -1117,7 +1117,7 @@ let de = class extends Vt {
|
|
1117
1117
|
return;
|
1118
1118
|
}
|
1119
1119
|
this._cellAlertManagerService.showAlert({
|
1120
|
-
type:
|
1120
|
+
type: La.ERROR,
|
1121
1121
|
title: this._localeService.t("dataValidation.error.title"),
|
1122
1122
|
message: l == null ? void 0 : l.getRuleFinalError(a, t.location),
|
1123
1123
|
location: t.location,
|
@@ -1137,30 +1137,30 @@ let de = class extends Vt {
|
|
1137
1137
|
}));
|
1138
1138
|
}
|
1139
1139
|
};
|
1140
|
-
|
1141
|
-
jt(0, b(
|
1142
|
-
jt(1, b(
|
1143
|
-
jt(2,
|
1140
|
+
ue = Gi([
|
1141
|
+
jt(0, b(ba)),
|
1142
|
+
jt(1, b(Oa)),
|
1143
|
+
jt(2, st),
|
1144
1144
|
jt(3, b(Q)),
|
1145
1145
|
jt(4, go),
|
1146
1146
|
jt(5, b(at))
|
1147
|
-
],
|
1148
|
-
var
|
1149
|
-
for (var a = n > 1 ? void 0 : n ?
|
1147
|
+
], ue);
|
1148
|
+
var Zi = Object.getOwnPropertyDescriptor, qi = (t, e, o, n) => {
|
1149
|
+
for (var a = n > 1 ? void 0 : n ? Zi(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1150
1150
|
(r = t[i]) && (a = r(a) || a);
|
1151
1151
|
return a;
|
1152
|
-
},
|
1153
|
-
let
|
1152
|
+
}, He = (t, e) => (o, n) => e(o, n, t);
|
1153
|
+
let qt = class extends Vt {
|
1154
1154
|
constructor(t, e, o) {
|
1155
1155
|
super(), this._autoFillService = t, this._sheetDataValidationModel = e, this._injector = o, this._initAutoFill();
|
1156
1156
|
}
|
1157
1157
|
// eslint-disable-next-line max-lines-per-function
|
1158
1158
|
_initAutoFill() {
|
1159
1159
|
const t = () => ({ redos: [], undos: [] }), e = (n, a) => {
|
1160
|
-
const { source: i, target: r, unitId: s, subUnitId: l } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(s, l).clone(), u =
|
1160
|
+
const { source: i, target: r, unitId: s, subUnitId: l } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(s, l).clone(), u = sn([i, r]), [h, d] = u.ranges, { mapFunc: _ } = u, p = {
|
1161
1161
|
row: h.startRow,
|
1162
1162
|
col: h.startColumn
|
1163
|
-
}, R =
|
1163
|
+
}, R = Pa(h, d), w = new Ie(), g = /* @__PURE__ */ new Set();
|
1164
1164
|
R.forEach((I) => {
|
1165
1165
|
const v = I.repeatStartCell, y = I.relativeRange, P = {
|
1166
1166
|
startRow: p.row,
|
@@ -1174,7 +1174,7 @@ let Gt = class extends Vt {
|
|
1174
1174
|
endRow: v.row
|
1175
1175
|
};
|
1176
1176
|
Qo.foreach(y, (O, L) => {
|
1177
|
-
const A =
|
1177
|
+
const A = we.getPositionRange(
|
1178
1178
|
{
|
1179
1179
|
startRow: O,
|
1180
1180
|
startColumn: L,
|
@@ -1182,7 +1182,7 @@ let Gt = class extends Vt {
|
|
1182
1182
|
endRow: O
|
1183
1183
|
},
|
1184
1184
|
P
|
1185
|
-
), { row: F, col: N } = _(A.startRow, A.startColumn), B = this._sheetDataValidationModel.getRuleIdByLocation(s, l, F, N) || "", x =
|
1185
|
+
), { row: F, col: N } = _(A.startRow, A.startColumn), B = this._sheetDataValidationModel.getRuleIdByLocation(s, l, F, N) || "", x = we.getPositionRange(
|
1186
1186
|
{
|
1187
1187
|
startRow: O,
|
1188
1188
|
startColumn: L,
|
@@ -1191,47 +1191,47 @@ let Gt = class extends Vt {
|
|
1191
1191
|
},
|
1192
1192
|
U
|
1193
1193
|
), { row: z, col: H } = _(x.startRow, x.startColumn);
|
1194
|
-
w.setValue(z, H, B),
|
1194
|
+
w.setValue(z, H, B), g.add(B);
|
1195
1195
|
});
|
1196
1196
|
});
|
1197
|
-
const f = Array.from(
|
1197
|
+
const f = Array.from(g).map((I) => ({ id: I, ranges: Qe(w, (v) => v === I) }));
|
1198
1198
|
c.addRangeRules(f);
|
1199
|
-
const S = c.diff(this._sheetDataValidationModel.getRules(s, l)), { redoMutations: V, undoMutations: C } =
|
1199
|
+
const S = c.diff(this._sheetDataValidationModel.getRules(s, l)), { redoMutations: V, undoMutations: C } = an(s, l, S, this._injector, "patched", a === ie.ONLY_FORMAT);
|
1200
1200
|
return {
|
1201
1201
|
undos: C,
|
1202
1202
|
redos: V
|
1203
1203
|
};
|
1204
1204
|
}, o = {
|
1205
|
-
id:
|
1205
|
+
id: co,
|
1206
1206
|
onBeforeFillData: (n) => {
|
1207
1207
|
const { source: a, unitId: i, subUnitId: r } = n;
|
1208
1208
|
for (const s of a.rows)
|
1209
1209
|
for (const l of a.cols) {
|
1210
1210
|
const c = this._sheetDataValidationModel.getRuleByLocation(i, r, s, l);
|
1211
1211
|
if (c && c.type === K.CHECKBOX) {
|
1212
|
-
this._autoFillService.setDisableApplyType(
|
1212
|
+
this._autoFillService.setDisableApplyType(ie.SERIES, !0);
|
1213
1213
|
return;
|
1214
1214
|
}
|
1215
1215
|
}
|
1216
1216
|
},
|
1217
|
-
onFillData: (n, a, i) => i ===
|
1217
|
+
onFillData: (n, a, i) => i === ie.COPY || i === ie.ONLY_FORMAT || i === ie.SERIES ? e(n, i) : t(),
|
1218
1218
|
onAfterFillData: () => {
|
1219
1219
|
}
|
1220
1220
|
};
|
1221
1221
|
this.disposeWithMe(this._autoFillService.addHook(o));
|
1222
1222
|
}
|
1223
1223
|
};
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
],
|
1229
|
-
var
|
1230
|
-
for (var a = n > 1 ? void 0 : n ?
|
1224
|
+
qt = qi([
|
1225
|
+
He(0, Ta),
|
1226
|
+
He(1, b(at)),
|
1227
|
+
He(2, b(Wt))
|
1228
|
+
], qt);
|
1229
|
+
var Ji = Object.getOwnPropertyDescriptor, Qi = (t, e, o, n) => {
|
1230
|
+
for (var a = n > 1 ? void 0 : n ? Ji(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1231
1231
|
(r = t[i]) && (a = r(a) || a);
|
1232
1232
|
return a;
|
1233
|
-
},
|
1234
|
-
let
|
1233
|
+
}, xe = (t, e) => (o, n) => e(o, n, t);
|
1234
|
+
let Jt = class extends Vt {
|
1235
1235
|
constructor(e, o, n) {
|
1236
1236
|
super();
|
1237
1237
|
E(this, "_copyInfo");
|
@@ -1239,22 +1239,22 @@ let Zt = class extends Vt {
|
|
1239
1239
|
}
|
1240
1240
|
_initCopyPaste() {
|
1241
1241
|
this._sheetClipboardService.addClipboardHook({
|
1242
|
-
id:
|
1242
|
+
id: co,
|
1243
1243
|
onBeforeCopy: (e, o, n) => this._collect(e, o, n),
|
1244
1244
|
onPasteCells: (e, o, n, a) => {
|
1245
|
-
const { copyType: i =
|
1245
|
+
const { copyType: i = Tn.COPY, pasteType: r } = a, { range: s } = e || {}, { range: l, unitId: c, subUnitId: u } = o;
|
1246
1246
|
return this._generateMutations(l, { copyType: i, pasteType: r, copyRange: s, unitId: c, subUnitId: u });
|
1247
1247
|
}
|
1248
1248
|
});
|
1249
1249
|
}
|
1250
1250
|
_collect(e, o, n) {
|
1251
|
-
const a = new
|
1251
|
+
const a = new Ie();
|
1252
1252
|
this._copyInfo = {
|
1253
1253
|
unitId: e,
|
1254
1254
|
subUnitId: o,
|
1255
1255
|
matrix: a
|
1256
1256
|
};
|
1257
|
-
const i = this._injector.invoke((l) =>
|
1257
|
+
const i = this._injector.invoke((l) => va(n, l, e, o));
|
1258
1258
|
if (!i)
|
1259
1259
|
return;
|
1260
1260
|
const { rows: r, cols: s } = i;
|
@@ -1269,40 +1269,40 @@ let Zt = class extends Vt {
|
|
1269
1269
|
_generateMutations(e, o) {
|
1270
1270
|
if (!this._copyInfo)
|
1271
1271
|
return { redos: [], undos: [] };
|
1272
|
-
if (o.copyType ===
|
1272
|
+
if (o.copyType === Tn.CUT)
|
1273
1273
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1274
1274
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !o.copyRange)
|
1275
1275
|
return { redos: [], undos: [] };
|
1276
1276
|
if ([
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1277
|
+
he.SPECIAL_PASTE_COL_WIDTH,
|
1278
|
+
he.SPECIAL_PASTE_VALUE,
|
1279
|
+
he.SPECIAL_PASTE_FORMAT,
|
1280
|
+
he.SPECIAL_PASTE_FORMULA
|
1281
1281
|
].includes(o.pasteType))
|
1282
1282
|
return { redos: [], undos: [] };
|
1283
1283
|
const { unitId: a, subUnitId: i } = this._copyInfo;
|
1284
1284
|
if (o.unitId !== a || i !== o.subUnitId) {
|
1285
|
-
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), s = new
|
1286
|
-
d.forEach(({ startRange:
|
1285
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), s = new Ie(), l = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = sn([o.copyRange, e]), d = Pn(c, u, !0), _ = /* @__PURE__ */ new Map();
|
1286
|
+
d.forEach(({ startRange: g }) => {
|
1287
1287
|
var f;
|
1288
1288
|
(f = this._copyInfo) == null || f.matrix.forValue((S, V, C) => {
|
1289
|
-
const I =
|
1289
|
+
const I = we.getPositionRange(
|
1290
1290
|
{
|
1291
1291
|
startRow: S,
|
1292
1292
|
endRow: S,
|
1293
1293
|
startColumn: V,
|
1294
1294
|
endColumn: V
|
1295
1295
|
},
|
1296
|
-
|
1296
|
+
g
|
1297
1297
|
), v = `${i}-${C}`, y = this._sheetDataValidationModel.getRuleById(a, i, C);
|
1298
1298
|
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, v) && y && _.set(v, { ...y, uid: v });
|
1299
1299
|
const { row: P, col: U } = h(I.startRow, I.startColumn);
|
1300
1300
|
l.add(v), s.setValue(P, U, v);
|
1301
1301
|
});
|
1302
1302
|
});
|
1303
|
-
const p = Array.from(l).map((
|
1303
|
+
const p = Array.from(l).map((g) => ({ id: g, ranges: Qe(s, (f) => f === g) }));
|
1304
1304
|
r.addRangeRules(p);
|
1305
|
-
const { redoMutations: R, undoMutations: w } =
|
1305
|
+
const { redoMutations: R, undoMutations: w } = an(
|
1306
1306
|
o.unitId,
|
1307
1307
|
o.subUnitId,
|
1308
1308
|
r.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), _.values()),
|
@@ -1315,11 +1315,11 @@ let Zt = class extends Vt {
|
|
1315
1315
|
undos: w
|
1316
1316
|
};
|
1317
1317
|
} else {
|
1318
|
-
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), s = new
|
1319
|
-
|
1320
|
-
var
|
1321
|
-
(
|
1322
|
-
const C =
|
1318
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), s = new Ie(), l = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = sn([o.copyRange, e]);
|
1319
|
+
Pn(c, u, !0).forEach(({ startRange: w }) => {
|
1320
|
+
var g;
|
1321
|
+
(g = this._copyInfo) == null || g.matrix.forValue((f, S, V) => {
|
1322
|
+
const C = we.getPositionRange(
|
1323
1323
|
{
|
1324
1324
|
startRow: f,
|
1325
1325
|
endRow: f,
|
@@ -1331,9 +1331,9 @@ let Zt = class extends Vt {
|
|
1331
1331
|
s.setValue(I, v, V), l.add(V);
|
1332
1332
|
});
|
1333
1333
|
});
|
1334
|
-
const _ = Array.from(l).map((w) => ({ id: w, ranges:
|
1334
|
+
const _ = Array.from(l).map((w) => ({ id: w, ranges: Qe(s, (g) => g === w) }));
|
1335
1335
|
r.addRangeRules(_);
|
1336
|
-
const { redoMutations: p, undoMutations: R } =
|
1336
|
+
const { redoMutations: p, undoMutations: R } = an(
|
1337
1337
|
a,
|
1338
1338
|
i,
|
1339
1339
|
r.diff(this._sheetDataValidationModel.getRules(a, i)),
|
@@ -1348,99 +1348,99 @@ let Zt = class extends Vt {
|
|
1348
1348
|
}
|
1349
1349
|
}
|
1350
1350
|
};
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
],
|
1356
|
-
var
|
1357
|
-
for (var a = n > 1 ? void 0 : n ?
|
1351
|
+
Jt = Qi([
|
1352
|
+
xe(0, Aa),
|
1353
|
+
xe(1, b(at)),
|
1354
|
+
xe(2, b(Wt))
|
1355
|
+
], Jt);
|
1356
|
+
var tr = Object.getOwnPropertyDescriptor, er = (t, e, o, n) => {
|
1357
|
+
for (var a = n > 1 ? void 0 : n ? tr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1358
1358
|
(r = t[i]) && (a = r(a) || a);
|
1359
1359
|
return a;
|
1360
|
-
},
|
1361
|
-
let
|
1360
|
+
}, je = (t, e) => (o, n) => e(o, n, t);
|
1361
|
+
let Qt = class extends Vt {
|
1362
1362
|
constructor(t, e, o) {
|
1363
1363
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionCheckController = o, this._commandExecutedListener();
|
1364
1364
|
}
|
1365
1365
|
_commandExecutedListener() {
|
1366
1366
|
this.disposeWithMe(
|
1367
1367
|
this._commandService.beforeCommandExecuted((t) => {
|
1368
|
-
t.id ===
|
1369
|
-
workbookTypes: [
|
1370
|
-
rangeTypes: [
|
1371
|
-
worksheetTypes: [
|
1372
|
-
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), t.id ===
|
1373
|
-
workbookTypes: [
|
1374
|
-
rangeTypes: [
|
1375
|
-
worksheetTypes: [
|
1368
|
+
t.id === Sn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1369
|
+
workbookTypes: [Ve],
|
1370
|
+
rangeTypes: [De],
|
1371
|
+
worksheetTypes: [Re, on]
|
1372
|
+
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), t.id === ro.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1373
|
+
workbookTypes: [Ve],
|
1374
|
+
rangeTypes: [De],
|
1375
|
+
worksheetTypes: [Re, on]
|
1376
1376
|
}, t.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
1377
1377
|
})
|
1378
1378
|
);
|
1379
1379
|
}
|
1380
1380
|
};
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
],
|
1386
|
-
const
|
1387
|
-
function
|
1381
|
+
Qt = er([
|
1382
|
+
je(0, b(Q)),
|
1383
|
+
je(1, tt),
|
1384
|
+
je(2, b(eo))
|
1385
|
+
], Qt);
|
1386
|
+
const Lo = "data-validation-single", To = "sheet.menu.data-validation";
|
1387
|
+
function nr(t) {
|
1388
1388
|
return {
|
1389
|
-
id:
|
1390
|
-
type:
|
1391
|
-
icon:
|
1389
|
+
id: To,
|
1390
|
+
type: Cn.SUBITEMS,
|
1391
|
+
icon: Lo,
|
1392
1392
|
tooltip: "dataValidation.title",
|
1393
|
-
hidden$:
|
1394
|
-
disabled$:
|
1393
|
+
hidden$: Ua(t, X.UNIVER_SHEET),
|
1394
|
+
disabled$: ka(t, { workbookTypes: [Ve], worksheetTypes: [on, Re], rangeTypes: [De] })
|
1395
1395
|
};
|
1396
1396
|
}
|
1397
|
-
function
|
1397
|
+
function or(t) {
|
1398
1398
|
return {
|
1399
1399
|
id: Ht.id,
|
1400
1400
|
title: "dataValidation.panel.title",
|
1401
|
-
type:
|
1401
|
+
type: Cn.BUTTON
|
1402
1402
|
};
|
1403
1403
|
}
|
1404
|
-
function
|
1404
|
+
function ar(t) {
|
1405
1405
|
return {
|
1406
|
-
id:
|
1406
|
+
id: Ne.id,
|
1407
1407
|
title: "dataValidation.panel.add",
|
1408
|
-
type:
|
1408
|
+
type: Cn.BUTTON
|
1409
1409
|
};
|
1410
1410
|
}
|
1411
|
-
const
|
1412
|
-
[
|
1413
|
-
[
|
1411
|
+
const ir = {
|
1412
|
+
[Ba.FORMULAS_INSERT]: {
|
1413
|
+
[To]: {
|
1414
1414
|
order: 9,
|
1415
|
-
menuItemFactory:
|
1415
|
+
menuItemFactory: nr,
|
1416
1416
|
[Ht.id]: {
|
1417
1417
|
order: 0,
|
1418
|
-
menuItemFactory:
|
1418
|
+
menuItemFactory: or
|
1419
1419
|
},
|
1420
|
-
[
|
1420
|
+
[Ne.id]: {
|
1421
1421
|
order: 1,
|
1422
|
-
menuItemFactory:
|
1422
|
+
menuItemFactory: ar
|
1423
1423
|
}
|
1424
1424
|
}
|
1425
1425
|
}
|
1426
1426
|
};
|
1427
|
-
var
|
1428
|
-
for (var a = n > 1 ? void 0 : n ?
|
1427
|
+
var rr = Object.getOwnPropertyDescriptor, Po = (t, e, o, n) => {
|
1428
|
+
for (var a = n > 1 ? void 0 : n ? rr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1429
1429
|
(r = t[i]) && (a = r(a) || a);
|
1430
1430
|
return a;
|
1431
1431
|
}, Z = (t, e) => (o, n) => e(o, n, t);
|
1432
|
-
const
|
1432
|
+
const Ao = {
|
1433
1433
|
tr: {
|
1434
1434
|
size: 6,
|
1435
1435
|
color: "#fe4b4b"
|
1436
1436
|
}
|
1437
1437
|
};
|
1438
|
-
let
|
1438
|
+
let te = class extends gn {
|
1439
1439
|
constructor(t, e, o, n, a, i, r, s, l, c, u) {
|
1440
1440
|
super(), this._commandService = t, this._menuManagerService = e, this._renderManagerService = o, this._univerInstanceService = n, this._autoHeightController = a, this._dropdownManagerService = i, this._sheetDataValidationModel = r, this._dataValidatorRegistryService = s, this._sheetInterceptorService = l, this._dataValidationCacheService = c, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
1441
1441
|
}
|
1442
1442
|
_initMenu() {
|
1443
|
-
this._menuManagerService.mergeMenu(
|
1443
|
+
this._menuManagerService.mergeMenu(ir);
|
1444
1444
|
}
|
1445
1445
|
_initDropdown() {
|
1446
1446
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((t) => {
|
@@ -1489,21 +1489,21 @@ let Jt = class extends gn {
|
|
1489
1489
|
_initViewModelIntercept() {
|
1490
1490
|
this.disposeWithMe(
|
1491
1491
|
this._sheetInterceptorService.intercept(
|
1492
|
-
|
1492
|
+
no.CELL_CONTENT,
|
1493
1493
|
{
|
1494
|
-
effect:
|
1494
|
+
effect: Kn.Style,
|
1495
1495
|
// must be after numfmt
|
1496
|
-
priority:
|
1496
|
+
priority: oo.DATA_VALIDATION,
|
1497
1497
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1498
1498
|
handler: (t, e, o) => {
|
1499
|
-
var
|
1499
|
+
var g, f, S, V, C;
|
1500
1500
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: s, worksheet: l } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1501
1501
|
if (!c)
|
1502
1502
|
return o(t);
|
1503
1503
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1504
1504
|
if (!u)
|
1505
1505
|
return o(t);
|
1506
|
-
const h = (
|
1506
|
+
const h = (g = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? g : de.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), _ = e.rawData;
|
1507
1507
|
let p;
|
1508
1508
|
const R = {
|
1509
1509
|
get value() {
|
@@ -1520,7 +1520,7 @@ let Jt = class extends gn {
|
|
1520
1520
|
...t,
|
1521
1521
|
markers: {
|
1522
1522
|
...t == null ? void 0 : t.markers,
|
1523
|
-
...h ===
|
1523
|
+
...h === de.INVALID ? Ao : null
|
1524
1524
|
},
|
1525
1525
|
customRender: [
|
1526
1526
|
...(f = t == null ? void 0 : t.customRender) != null ? f : [],
|
@@ -1541,7 +1541,7 @@ let Jt = class extends gn {
|
|
1541
1541
|
},
|
1542
1542
|
interceptorAutoHeight: () => {
|
1543
1543
|
var P, U, O, L, A, F;
|
1544
|
-
const I = (U = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(
|
1544
|
+
const I = (U = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(ye).getSkeletonParam(r)) == null ? void 0 : U.skeleton;
|
1545
1545
|
if (!I)
|
1546
1546
|
return;
|
1547
1547
|
const v = I.worksheet.getMergedCell(n, a), y = {
|
@@ -1559,7 +1559,7 @@ let Jt = class extends gn {
|
|
1559
1559
|
},
|
1560
1560
|
interceptorAutoWidth: () => {
|
1561
1561
|
var P, U, O, L, A, F;
|
1562
|
-
const I = (U = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(
|
1562
|
+
const I = (U = (P = this._renderManagerService.getRenderById(i)) == null ? void 0 : P.with(ye).getSkeletonParam(r)) == null ? void 0 : U.skeleton;
|
1563
1563
|
if (!I)
|
1564
1564
|
return;
|
1565
1565
|
const v = I.worksheet.getMergedCell(n, a), y = {
|
@@ -1586,8 +1586,8 @@ let Jt = class extends gn {
|
|
1586
1586
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1587
1587
|
// patched data-validation change don't need to re-calc row height
|
1588
1588
|
// re-calc of row height will be triggered precisely by the origin command
|
1589
|
-
|
1590
|
-
|
1589
|
+
In((t) => t.source === "command"),
|
1590
|
+
vo(100)
|
1591
1591
|
).subscribe((t) => {
|
1592
1592
|
if (t.length === 0)
|
1593
1593
|
return;
|
@@ -1597,54 +1597,54 @@ let Jt = class extends gn {
|
|
1597
1597
|
(o.rule.type === K.LIST_MULTIPLE || o.rule.type === K.LIST) && (n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
1598
1598
|
}), e.length) {
|
1599
1599
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
1600
|
-
|
1600
|
+
Gn(o.redos, this._commandService);
|
1601
1601
|
}
|
1602
1602
|
});
|
1603
1603
|
}
|
1604
1604
|
};
|
1605
|
-
|
1605
|
+
te = Po([
|
1606
1606
|
Z(0, tt),
|
1607
|
-
Z(1,
|
1607
|
+
Z(1, $a),
|
1608
1608
|
Z(2, yt),
|
1609
|
-
Z(3,
|
1610
|
-
Z(4, b(
|
1609
|
+
Z(3, st),
|
1610
|
+
Z(4, b(po)),
|
1611
1611
|
Z(5, b(Dt)),
|
1612
1612
|
Z(6, b(at)),
|
1613
1613
|
Z(7, b(bt)),
|
1614
|
-
Z(8, b(
|
1615
|
-
Z(9, b(
|
1616
|
-
Z(10, ta(
|
1617
|
-
],
|
1618
|
-
let
|
1614
|
+
Z(8, b(vn)),
|
1615
|
+
Z(9, b(uo)),
|
1616
|
+
Z(10, ta(ho))
|
1617
|
+
], te);
|
1618
|
+
let $n = class extends gn {
|
1619
1619
|
constructor(t, e, o, n, a, i, r) {
|
1620
1620
|
super(), this._commandService = t, this._renderManagerService = e, this._autoHeightController = o, this._dataValidatorRegistryService = n, this._sheetInterceptorService = a, this._sheetDataValidationModel = i, this._dataValidationCacheService = r, this._initViewModelIntercept(), this._initAutoHeight();
|
1621
1621
|
}
|
1622
1622
|
_initViewModelIntercept() {
|
1623
1623
|
this.disposeWithMe(
|
1624
1624
|
this._sheetInterceptorService.intercept(
|
1625
|
-
|
1625
|
+
no.CELL_CONTENT,
|
1626
1626
|
{
|
1627
|
-
effect:
|
1627
|
+
effect: Kn.Style,
|
1628
1628
|
// must be after numfmt
|
1629
|
-
priority:
|
1629
|
+
priority: oo.DATA_VALIDATION,
|
1630
1630
|
// eslint-disable-next-line complexity
|
1631
1631
|
handler: (t, e, o) => {
|
1632
|
-
var w,
|
1632
|
+
var w, g, f, S, V;
|
1633
1633
|
const { row: n, col: a, unitId: i, subUnitId: r, workbook: s, worksheet: l } = e, c = this._sheetDataValidationModel.getRuleIdByLocation(i, r, n, a);
|
1634
1634
|
if (!c)
|
1635
1635
|
return o(t);
|
1636
1636
|
const u = this._sheetDataValidationModel.getRuleById(i, r, c);
|
1637
1637
|
if (!u)
|
1638
1638
|
return o(t);
|
1639
|
-
const h = (w = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? w :
|
1639
|
+
const h = (w = this._dataValidationCacheService.getValue(i, r, n, a)) != null ? w : de.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), _ = l.getCellRaw(n, a), p = rt(_), R = `${p != null ? p : ""}`;
|
1640
1640
|
return o({
|
1641
1641
|
...t,
|
1642
1642
|
markers: {
|
1643
1643
|
...t == null ? void 0 : t.markers,
|
1644
|
-
...h ===
|
1644
|
+
...h === de.INVALID ? Ao : null
|
1645
1645
|
},
|
1646
1646
|
customRender: [
|
1647
|
-
...(
|
1647
|
+
...(g = t == null ? void 0 : t.customRender) != null ? g : [],
|
1648
1648
|
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1649
1649
|
],
|
1650
1650
|
fontRenderExtension: {
|
@@ -1662,7 +1662,7 @@ let Bn = class extends gn {
|
|
1662
1662
|
},
|
1663
1663
|
interceptorAutoHeight: () => {
|
1664
1664
|
var y, P, U, O, L, A;
|
1665
|
-
const C = (P = (y = this._renderManagerService.getRenderById(i)) == null ? void 0 : y.with(
|
1665
|
+
const C = (P = (y = this._renderManagerService.getRenderById(i)) == null ? void 0 : y.with(ye).getSkeletonParam(r)) == null ? void 0 : P.skeleton;
|
1666
1666
|
if (!C)
|
1667
1667
|
return;
|
1668
1668
|
const I = C.worksheet.getMergedCell(n, a), v = {
|
@@ -1687,8 +1687,8 @@ let Bn = class extends gn {
|
|
1687
1687
|
}
|
1688
1688
|
_initAutoHeight() {
|
1689
1689
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1690
|
-
|
1691
|
-
|
1690
|
+
In((t) => t.source === "command"),
|
1691
|
+
vo(16)
|
1692
1692
|
).subscribe((t) => {
|
1693
1693
|
const e = [];
|
1694
1694
|
if (t.forEach((o) => {
|
@@ -1696,26 +1696,26 @@ let Bn = class extends gn {
|
|
1696
1696
|
(n = o.rule) != null && n.ranges && e.push(...o.rule.ranges);
|
1697
1697
|
}), e.length) {
|
1698
1698
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(e);
|
1699
|
-
|
1699
|
+
Gn(o.redos, this._commandService);
|
1700
1700
|
}
|
1701
1701
|
});
|
1702
1702
|
}
|
1703
1703
|
};
|
1704
|
-
|
1704
|
+
$n = Po([
|
1705
1705
|
Z(0, tt),
|
1706
1706
|
Z(1, yt),
|
1707
|
-
Z(2, b(
|
1707
|
+
Z(2, b(po)),
|
1708
1708
|
Z(3, b(bt)),
|
1709
|
-
Z(4, b(
|
1709
|
+
Z(4, b(vn)),
|
1710
1710
|
Z(5, b(at)),
|
1711
|
-
Z(6, b(
|
1712
|
-
],
|
1713
|
-
var
|
1714
|
-
for (var a = n > 1 ? void 0 : n ?
|
1711
|
+
Z(6, b(uo))
|
1712
|
+
], $n);
|
1713
|
+
var sr = Object.getOwnPropertyDescriptor, lr = (t, e, o, n) => {
|
1714
|
+
for (var a = n > 1 ? void 0 : n ? sr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
1715
1715
|
(r = t[i]) && (a = r(a) || a);
|
1716
1716
|
return a;
|
1717
|
-
},
|
1718
|
-
let
|
1717
|
+
}, Wn = (t, e) => (o, n) => e(o, n, t);
|
1718
|
+
let be = class extends Vt {
|
1719
1719
|
constructor(t, e, o) {
|
1720
1720
|
super(), this._context = t, this._sheetDataValidationModel = e, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
1721
1721
|
}
|
@@ -1735,24 +1735,24 @@ let Me = class extends Vt {
|
|
1735
1735
|
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(ea(16)).subscribe(t));
|
1736
1736
|
}
|
1737
1737
|
};
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
],
|
1742
|
-
const
|
1743
|
-
dataValidationFormula:
|
1744
|
-
dataValidationFormulaAnd:
|
1745
|
-
dataValidationFormulaListItem:
|
1746
|
-
dataValidationFormulaListItemIcon:
|
1747
|
-
dataValidationFormulaListItemDrag:
|
1748
|
-
dataValidationFormulaListAdd:
|
1738
|
+
be = lr([
|
1739
|
+
Wn(1, b(at)),
|
1740
|
+
Wn(2, b(ye))
|
1741
|
+
], be);
|
1742
|
+
const dr = "univer-data-validation-formula", cr = "univer-data-validation-formula-and", ur = "univer-data-validation-formula-list-item", hr = "univer-data-validation-formula-list-item-icon", pr = "univer-data-validation-formula-list-item-drag", mr = "univer-data-validation-formula-list-add", gr = "univer-data-validation-formula-color-select", fr = "univer-data-validation-formula-color-select-panel", vr = "univer-data-validation-formula-color-item", ot = {
|
1743
|
+
dataValidationFormula: dr,
|
1744
|
+
dataValidationFormulaAnd: cr,
|
1745
|
+
dataValidationFormulaListItem: ur,
|
1746
|
+
dataValidationFormulaListItemIcon: hr,
|
1747
|
+
dataValidationFormulaListItemDrag: pr,
|
1748
|
+
dataValidationFormulaListAdd: mr,
|
1749
1749
|
dataValidationFormulaColorSelect: gr,
|
1750
|
-
dataValidationFormulaColorSelectPanel:
|
1751
|
-
dataValidationFormulaColorItem:
|
1752
|
-
},
|
1750
|
+
dataValidationFormulaColorSelectPanel: fr,
|
1751
|
+
dataValidationFormulaColorItem: vr
|
1752
|
+
}, _r = (t) => {
|
1753
1753
|
const { isTwoFormula: e = !1, value: o, onChange: n, showError: a, validResult: i } = t, r = T(Q), s = a ? i == null ? void 0 : i.formula1 : "", l = a ? i == null ? void 0 : i.formula2 : "";
|
1754
1754
|
return e ? /* @__PURE__ */ Y(Rt, { children: [
|
1755
|
-
/* @__PURE__ */
|
1755
|
+
/* @__PURE__ */ m(q, { error: s, children: /* @__PURE__ */ m(
|
1756
1756
|
Ut,
|
1757
1757
|
{
|
1758
1758
|
className: ot.dataValidationFormula,
|
@@ -1766,8 +1766,8 @@ const lr = "univer-data-validation-formula", dr = "univer-data-validation-formul
|
|
1766
1766
|
}
|
1767
1767
|
}
|
1768
1768
|
) }),
|
1769
|
-
/* @__PURE__ */
|
1770
|
-
/* @__PURE__ */
|
1769
|
+
/* @__PURE__ */ m("div", { className: ot.dataValidationFormulaAnd, children: r.t("dataValidation.panel.formulaAnd") }),
|
1770
|
+
/* @__PURE__ */ m(q, { error: l, children: /* @__PURE__ */ m(
|
1771
1771
|
Ut,
|
1772
1772
|
{
|
1773
1773
|
className: ot.dataValidationFormula,
|
@@ -1781,7 +1781,7 @@ const lr = "univer-data-validation-formula", dr = "univer-data-validation-formul
|
|
1781
1781
|
}
|
1782
1782
|
}
|
1783
1783
|
) })
|
1784
|
-
] }) : /* @__PURE__ */
|
1784
|
+
] }) : /* @__PURE__ */ m(q, { error: s, children: /* @__PURE__ */ m(
|
1785
1785
|
Ut,
|
1786
1786
|
{
|
1787
1787
|
className: ot.dataValidationFormula,
|
@@ -1793,11 +1793,11 @@ const lr = "univer-data-validation-formula", dr = "univer-data-validation-formul
|
|
1793
1793
|
}
|
1794
1794
|
) });
|
1795
1795
|
};
|
1796
|
-
function
|
1796
|
+
function Sr(t) {
|
1797
1797
|
const { value: e, onChange: o, showError: n, validResult: a } = t, i = T(Q), r = n ? a == null ? void 0 : a.formula1 : "", s = n ? a == null ? void 0 : a.formula2 : "", [l, c] = j(!((e == null ? void 0 : e.formula1) === void 0 && (e == null ? void 0 : e.formula2) === void 0));
|
1798
1798
|
return /* @__PURE__ */ Y(Rt, { children: [
|
1799
|
-
/* @__PURE__ */
|
1800
|
-
|
1799
|
+
/* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
1800
|
+
Pe,
|
1801
1801
|
{
|
1802
1802
|
checked: l,
|
1803
1803
|
onChange: (u) => {
|
@@ -1810,7 +1810,7 @@ function _r(t) {
|
|
1810
1810
|
children: i.t("dataValidation.checkbox.tips")
|
1811
1811
|
}
|
1812
1812
|
) }),
|
1813
|
-
l ? /* @__PURE__ */
|
1813
|
+
l ? /* @__PURE__ */ m(q, { label: i.t("dataValidation.checkbox.checked"), error: r, children: /* @__PURE__ */ m(
|
1814
1814
|
Ut,
|
1815
1815
|
{
|
1816
1816
|
className: ot.dataValidationFormula,
|
@@ -1824,7 +1824,7 @@ function _r(t) {
|
|
1824
1824
|
}
|
1825
1825
|
}
|
1826
1826
|
) }) : null,
|
1827
|
-
l ? /* @__PURE__ */
|
1827
|
+
l ? /* @__PURE__ */ m(q, { label: i.t("dataValidation.checkbox.unchecked"), error: s, children: /* @__PURE__ */ m(
|
1828
1828
|
Ut,
|
1829
1829
|
{
|
1830
1830
|
className: ot.dataValidationFormula,
|
@@ -1840,15 +1840,15 @@ function _r(t) {
|
|
1840
1840
|
) }) : null
|
1841
1841
|
] });
|
1842
1842
|
}
|
1843
|
-
function
|
1843
|
+
function Cr(t) {
|
1844
1844
|
var h;
|
1845
|
-
const { unitId: e, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = t, s = i ? r == null ? void 0 : r.formula1 : void 0, l =
|
1846
|
-
return
|
1845
|
+
const { unitId: e, subUnitId: o, value: n, onChange: a, showError: i, validResult: r } = t, s = i ? r == null ? void 0 : r.formula1 : void 0, l = Zt({}), [c, u] = j(!1);
|
1846
|
+
return fo((d) => {
|
1847
1847
|
var p;
|
1848
1848
|
const _ = (p = l.current) == null ? void 0 : p.handleOutClick;
|
1849
1849
|
_ && _(d, () => u(!1));
|
1850
|
-
}), /* @__PURE__ */
|
1851
|
-
|
1850
|
+
}), /* @__PURE__ */ m(
|
1851
|
+
So,
|
1852
1852
|
{
|
1853
1853
|
initValue: (h = n == null ? void 0 : n.formula1) != null ? h : "=",
|
1854
1854
|
unitId: e,
|
@@ -1868,19 +1868,6 @@ function Sr(t) {
|
|
1868
1868
|
}
|
1869
1869
|
);
|
1870
1870
|
}
|
1871
|
-
function Ao(t) {
|
1872
|
-
var e, o, n = "";
|
1873
|
-
if (typeof t == "string" || typeof t == "number") n += t;
|
1874
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
1875
|
-
var a = t.length;
|
1876
|
-
for (e = 0; e < a; e++) t[e] && (o = Ao(t[e])) && (n && (n += " "), n += o);
|
1877
|
-
} else for (o in t) t[o] && (n && (n += " "), n += o);
|
1878
|
-
return n;
|
1879
|
-
}
|
1880
|
-
function Cr() {
|
1881
|
-
for (var t, e, o = 0, n = "", a = arguments.length; o < a; o++) (t = arguments[o]) && (e = Ao(t)) && (n && (n += " "), n += e);
|
1882
|
-
return n;
|
1883
|
-
}
|
1884
1871
|
const Ir = [
|
1885
1872
|
"#FFFFFF",
|
1886
1873
|
"#FEE7E7",
|
@@ -1908,8 +1895,8 @@ const Ir = [
|
|
1908
1895
|
"#F248A6"
|
1909
1896
|
], wr = (t) => {
|
1910
1897
|
const { value: e, onChange: o, disabled: n } = t, [a, i] = j(!1);
|
1911
|
-
return /* @__PURE__ */
|
1912
|
-
|
1898
|
+
return /* @__PURE__ */ m(
|
1899
|
+
en,
|
1913
1900
|
{
|
1914
1901
|
disabled: n,
|
1915
1902
|
open: a,
|
@@ -1919,15 +1906,15 @@ const Ir = [
|
|
1919
1906
|
className: ot.dataValidationFormulaColorSelect,
|
1920
1907
|
value: e,
|
1921
1908
|
onChange: o,
|
1922
|
-
labelRender: (r) => /* @__PURE__ */
|
1909
|
+
labelRender: (r) => /* @__PURE__ */ m(
|
1923
1910
|
"div",
|
1924
1911
|
{
|
1925
1912
|
className: ot.dataValidationFormulaColorItem,
|
1926
1913
|
style: { background: r.value, marginTop: 5 }
|
1927
1914
|
}
|
1928
1915
|
),
|
1929
|
-
dropdownRender: () => /* @__PURE__ */
|
1930
|
-
(r) => /* @__PURE__ */
|
1916
|
+
dropdownRender: () => /* @__PURE__ */ m("div", { className: ot.dataValidationFormulaColorSelectPanel, children: Ir.map(
|
1917
|
+
(r) => /* @__PURE__ */ m(
|
1931
1918
|
"div",
|
1932
1919
|
{
|
1933
1920
|
onClick: () => {
|
@@ -1941,11 +1928,11 @@ const Ir = [
|
|
1941
1928
|
) })
|
1942
1929
|
}
|
1943
1930
|
);
|
1944
|
-
},
|
1931
|
+
}, Hn = (t) => {
|
1945
1932
|
const { item: e, commonProps: o, style: n } = t, { onItemChange: a, onItemDelete: i } = o;
|
1946
1933
|
return /* @__PURE__ */ Y("div", { className: ot.dataValidationFormulaListItem, style: n, children: [
|
1947
|
-
e.isRef ? null : /* @__PURE__ */
|
1948
|
-
/* @__PURE__ */
|
1934
|
+
e.isRef ? null : /* @__PURE__ */ m("div", { className: sa(ot.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ m(yo, {}) }),
|
1935
|
+
/* @__PURE__ */ m(
|
1949
1936
|
wr,
|
1950
1937
|
{
|
1951
1938
|
value: e.color,
|
@@ -1954,7 +1941,7 @@ const Ir = [
|
|
1954
1941
|
}
|
1955
1942
|
}
|
1956
1943
|
),
|
1957
|
-
/* @__PURE__ */
|
1944
|
+
/* @__PURE__ */ m(
|
1958
1945
|
Ut,
|
1959
1946
|
{
|
1960
1947
|
disabled: e.isRef,
|
@@ -1964,12 +1951,12 @@ const Ir = [
|
|
1964
1951
|
}
|
1965
1952
|
}
|
1966
1953
|
),
|
1967
|
-
e.isRef ? null : /* @__PURE__ */
|
1954
|
+
e.isRef ? null : /* @__PURE__ */ m("div", { className: ot.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ m(Rn, { onClick: () => i(e.id) }) })
|
1968
1955
|
] });
|
1969
1956
|
};
|
1970
1957
|
function Rr(t) {
|
1971
1958
|
const { value: e, onChange: o = () => {
|
1972
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: s } = t, { formula1: l = "", formula2: c = "" } = e || {}, u =
|
1959
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: s } = t, { formula1: l = "", formula2: c = "" } = e || {}, u = Zt(null), [h, d] = j(() => kt(l) ? "1" : "0"), [_, p] = j(h === "1" ? l : "="), [R, w] = j(h === "1" ? l : "="), g = T(Q), f = T(bt), S = T(ke), V = T(Ia), [C, I] = j(() => c.split(",")), v = f.getValidatorItem(K.LIST), [y, P] = j([]), [U, O] = j(""), L = r ? i == null ? void 0 : i.formula1 : "", A = $t(() => S.ruleChange$.pipe(wn(16)), []), F = St(A), N = dn(o);
|
1973
1960
|
wt(() => {
|
1974
1961
|
(async () => {
|
1975
1962
|
await new Promise(($) => {
|
@@ -1985,12 +1972,12 @@ function Rr(t) {
|
|
1985
1972
|
kt(l) && l !== R && (p(l), w(R));
|
1986
1973
|
}, [R, l]);
|
1987
1974
|
const [B, x] = j(() => {
|
1988
|
-
const D = h !== "1" ?
|
1975
|
+
const D = h !== "1" ? ao(l) : [], k = c.split(",");
|
1989
1976
|
return D.map(($, W) => ({
|
1990
1977
|
label: $,
|
1991
1978
|
color: k[W] || Ft,
|
1992
1979
|
isRef: !1,
|
1993
|
-
id:
|
1980
|
+
id: tn.generateRandomId(4)
|
1994
1981
|
}));
|
1995
1982
|
}), z = (D, k, $) => {
|
1996
1983
|
const W = B.find((Ct) => Ct.id === D);
|
@@ -2016,7 +2003,7 @@ function Rr(t) {
|
|
2016
2003
|
label: "",
|
2017
2004
|
color: Ft,
|
2018
2005
|
isRef: !1,
|
2019
|
-
id:
|
2006
|
+
id: tn.generateRandomId(4)
|
2020
2007
|
}
|
2021
2008
|
]);
|
2022
2009
|
};
|
@@ -2035,11 +2022,11 @@ function Rr(t) {
|
|
2035
2022
|
}));
|
2036
2023
|
});
|
2037
2024
|
}), N({
|
2038
|
-
formula1:
|
2025
|
+
formula1: io(k.map(($) => $.label)),
|
2039
2026
|
formula2: k.map(($) => $.color === Ft ? "" : $.color).join(",")
|
2040
2027
|
});
|
2041
2028
|
}, [B, N, h, R, C]);
|
2042
|
-
const
|
2029
|
+
const lt = dn(async (D) => {
|
2043
2030
|
if (!kt(D)) {
|
2044
2031
|
N == null || N({
|
2045
2032
|
formula1: "",
|
@@ -2053,15 +2040,15 @@ function Rr(t) {
|
|
2053
2040
|
}), O("")) : (N == null || N({
|
2054
2041
|
formula1: "",
|
2055
2042
|
formula2: c
|
2056
|
-
}), p("="), O(
|
2057
|
-
}), it =
|
2058
|
-
return
|
2043
|
+
}), p("="), O(g.t("dataValidation.validFail.formulaError")));
|
2044
|
+
}), it = Zt({}), [dt, M] = j(!1);
|
2045
|
+
return fo((D) => {
|
2059
2046
|
var $;
|
2060
2047
|
const k = ($ = it.current) == null ? void 0 : $.handleOutClick;
|
2061
2048
|
k && k(D, () => M(!1));
|
2062
2049
|
}), /* @__PURE__ */ Y(Rt, { children: [
|
2063
|
-
/* @__PURE__ */
|
2064
|
-
|
2050
|
+
/* @__PURE__ */ m(q, { label: g.t("dataValidation.list.options"), children: /* @__PURE__ */ Y(
|
2051
|
+
fn,
|
2065
2052
|
{
|
2066
2053
|
value: h,
|
2067
2054
|
onChange: (D) => {
|
@@ -2071,22 +2058,22 @@ function Rr(t) {
|
|
2071
2058
|
});
|
2072
2059
|
},
|
2073
2060
|
children: [
|
2074
|
-
/* @__PURE__ */
|
2075
|
-
/* @__PURE__ */
|
2061
|
+
/* @__PURE__ */ m(Nt, { value: "0", children: g.t("dataValidation.list.customOptions") }),
|
2062
|
+
/* @__PURE__ */ m(Nt, { value: "1", children: g.t("dataValidation.list.refOptions") })
|
2076
2063
|
]
|
2077
2064
|
}
|
2078
2065
|
) }),
|
2079
2066
|
h === "1" ? /* @__PURE__ */ Y(Rt, { children: [
|
2080
|
-
/* @__PURE__ */
|
2081
|
-
|
2067
|
+
/* @__PURE__ */ m(
|
2068
|
+
So,
|
2082
2069
|
{
|
2083
2070
|
initValue: _,
|
2084
2071
|
unitId: n,
|
2085
2072
|
subUnitId: a,
|
2086
|
-
isFocus:
|
2073
|
+
isFocus: dt,
|
2087
2074
|
onChange: (D = "") => {
|
2088
2075
|
const k = (D != null ? D : "").trim();
|
2089
|
-
w(k),
|
2076
|
+
w(k), lt(k);
|
2090
2077
|
},
|
2091
2078
|
errorText: L || U || void 0,
|
2092
2079
|
onFocus: () => M(!0),
|
@@ -2094,9 +2081,9 @@ function Rr(t) {
|
|
2094
2081
|
isSupportAcrossSheet: !0
|
2095
2082
|
}
|
2096
2083
|
),
|
2097
|
-
/* @__PURE__ */
|
2098
|
-
] }) : /* @__PURE__ */
|
2099
|
-
/* @__PURE__ */
|
2084
|
+
/* @__PURE__ */ m("div", { ref: u, style: { marginTop: "12px" }, children: J.map((D) => /* @__PURE__ */ m(Hn, { item: D, commonProps: { onItemChange: et }, style: { marginBottom: 12 } }, D.id)) })
|
2085
|
+
] }) : /* @__PURE__ */ m(q, { error: L, children: /* @__PURE__ */ Y("div", { ref: u, style: { marginTop: "-12px" }, children: [
|
2086
|
+
/* @__PURE__ */ m(
|
2100
2087
|
ra,
|
2101
2088
|
{
|
2102
2089
|
list: B,
|
@@ -2104,8 +2091,8 @@ function Rr(t) {
|
|
2104
2091
|
rowHeight: 32,
|
2105
2092
|
margin: [0, 12],
|
2106
2093
|
draggableHandle: ".draggableHandle",
|
2107
|
-
itemRender: (D) => /* @__PURE__ */
|
2108
|
-
|
2094
|
+
itemRender: (D) => /* @__PURE__ */ m(
|
2095
|
+
Hn,
|
2109
2096
|
{
|
2110
2097
|
item: D,
|
2111
2098
|
commonProps: {
|
@@ -2119,46 +2106,46 @@ function Rr(t) {
|
|
2119
2106
|
}
|
2120
2107
|
),
|
2121
2108
|
/* @__PURE__ */ Y("a", { className: ot.dataValidationFormulaListAdd, onClick: nt, children: [
|
2122
|
-
/* @__PURE__ */
|
2123
|
-
|
2109
|
+
/* @__PURE__ */ m(Ro, {}),
|
2110
|
+
g.t("dataValidation.list.add")
|
2124
2111
|
] })
|
2125
2112
|
] }) })
|
2126
2113
|
] });
|
2127
2114
|
}
|
2128
|
-
const ko = "data-validation.custom-formula-input",
|
2115
|
+
const ko = "data-validation.custom-formula-input", Ue = "data-validation.formula-input", Mn = "data-validation.list-formula-input", Fo = "data-validation.checkbox-formula-input", Dr = [
|
2129
2116
|
[
|
2130
2117
|
ko,
|
2131
|
-
|
2118
|
+
Cr
|
2132
2119
|
],
|
2133
2120
|
[
|
2134
|
-
|
2135
|
-
|
2121
|
+
Ue,
|
2122
|
+
_r
|
2136
2123
|
],
|
2137
2124
|
[
|
2138
|
-
|
2125
|
+
Mn,
|
2139
2126
|
Rr
|
2140
2127
|
],
|
2141
2128
|
[
|
2142
2129
|
Fo,
|
2143
|
-
|
2130
|
+
Sr
|
2144
2131
|
]
|
2145
2132
|
], Vr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2146
|
-
function
|
2133
|
+
function Oe(t) {
|
2147
2134
|
var a;
|
2148
2135
|
const { value: e, onChange: o } = t, n = T(Q);
|
2149
|
-
return /* @__PURE__ */
|
2150
|
-
/* @__PURE__ */
|
2151
|
-
/* @__PURE__ */
|
2152
|
-
/* @__PURE__ */
|
2136
|
+
return /* @__PURE__ */ m(q, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ Y(fn, { value: `${(a = e.renderMode) != null ? a : ut.CUSTOM}`, onChange: (i) => o({ ...e, renderMode: +i }), children: [
|
2137
|
+
/* @__PURE__ */ m(Nt, { value: `${ut.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2138
|
+
/* @__PURE__ */ m(Nt, { value: `${ut.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2139
|
+
/* @__PURE__ */ m(Nt, { value: `${ut.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2153
2140
|
] }) });
|
2154
2141
|
}
|
2155
|
-
|
2142
|
+
Oe.componentKey = Vr;
|
2156
2143
|
const yr = "DATE_SHOW_TIME_OPTION";
|
2157
|
-
function
|
2144
|
+
function Le(t) {
|
2158
2145
|
var a;
|
2159
2146
|
const { value: e, onChange: o } = t, n = T(Q);
|
2160
|
-
return /* @__PURE__ */
|
2161
|
-
|
2147
|
+
return /* @__PURE__ */ m(q, { children: /* @__PURE__ */ m(
|
2148
|
+
Pe,
|
2162
2149
|
{
|
2163
2150
|
checked: (a = e.bizInfo) == null ? void 0 : a.showTime,
|
2164
2151
|
onChange: (i) => {
|
@@ -2174,26 +2161,26 @@ function be(t) {
|
|
2174
2161
|
}
|
2175
2162
|
) });
|
2176
2163
|
}
|
2177
|
-
|
2164
|
+
Le.componentKey = yr;
|
2178
2165
|
var Mr = Object.getOwnPropertyDescriptor, Er = (t, e, o, n) => {
|
2179
2166
|
for (var a = n > 1 ? void 0 : n ? Mr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2180
2167
|
(r = t[i]) && (a = r(a) || a);
|
2181
2168
|
return a;
|
2182
|
-
},
|
2183
|
-
const
|
2184
|
-
let
|
2185
|
-
constructor(t, e, o, n, a) {
|
2186
|
-
this._commandService = t, this.
|
2169
|
+
}, Yt = (t, e) => (o, n) => e(o, n, t);
|
2170
|
+
const ge = 6;
|
2171
|
+
let cn = class {
|
2172
|
+
constructor(t, e, o, n, a, i) {
|
2173
|
+
this._commandService = t, this._univerInstanceService = e, this._formulaService = o, this._themeService = n, this._renderManagerService = a, this._dataValidationModel = i;
|
2187
2174
|
}
|
2188
2175
|
_calc(t, e) {
|
2189
2176
|
var c, u, h;
|
2190
|
-
const { vt: o, ht: n } = e || {}, a = t.endX - t.startX -
|
2177
|
+
const { vt: o, ht: n } = e || {}, a = t.endX - t.startX - ge * 2, i = t.endY - t.startY, r = ((c = e == null ? void 0 : e.fs) != null ? c : 10) * 1.6;
|
2191
2178
|
let s = 0, l = 0;
|
2192
2179
|
switch (o) {
|
2193
|
-
case
|
2180
|
+
case pt.TOP:
|
2194
2181
|
l = 0;
|
2195
2182
|
break;
|
2196
|
-
case
|
2183
|
+
case pt.BOTTOM:
|
2197
2184
|
l = 0 + (i - r);
|
2198
2185
|
break;
|
2199
2186
|
default:
|
@@ -2201,14 +2188,14 @@ let dn = class {
|
|
2201
2188
|
break;
|
2202
2189
|
}
|
2203
2190
|
switch (n) {
|
2204
|
-
case
|
2205
|
-
s =
|
2191
|
+
case zt.LEFT:
|
2192
|
+
s = ge;
|
2206
2193
|
break;
|
2207
|
-
case
|
2208
|
-
s =
|
2194
|
+
case zt.RIGHT:
|
2195
|
+
s = ge + (a - r);
|
2209
2196
|
break;
|
2210
2197
|
default:
|
2211
|
-
s =
|
2198
|
+
s = ge + (a - r) / 2;
|
2212
2199
|
break;
|
2213
2200
|
}
|
2214
2201
|
return {
|
@@ -2229,10 +2216,10 @@ let dn = class {
|
|
2229
2216
|
return ((o = e == null ? void 0 : e.fs) != null ? o : 10) * 1.6;
|
2230
2217
|
}
|
2231
2218
|
async _parseFormula(t, e, o) {
|
2232
|
-
var c, u, h, d, _, p, R, w,
|
2233
|
-
const { formula1: n =
|
2219
|
+
var c, u, h, d, _, p, R, w, g;
|
2220
|
+
const { formula1: n = Da, formula2: a = Ra } = t, i = await this._formulaService.getRuleFormulaResult(e, o, t.uid), r = $e((h = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), s = $e((p = (_ = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : _[0]) == null ? void 0 : p[0]), l = Ln(String(r)) && Ln(String(s));
|
2234
2221
|
return {
|
2235
|
-
formula1: kt(n) ?
|
2222
|
+
formula1: kt(n) ? $e((g = (w = (R = i == null ? void 0 : i[0]) == null ? void 0 : R.result) == null ? void 0 : w[0]) == null ? void 0 : g[0]) : n,
|
2236
2223
|
formula2: kt(a) ? s : a,
|
2237
2224
|
isFormulaValid: l
|
2238
2225
|
};
|
@@ -2248,7 +2235,7 @@ let dn = class {
|
|
2248
2235
|
const _ = this._themeService.getCurrentTheme();
|
2249
2236
|
if (!((L = d.skipDefaultFontRender) != null && L.call(d, h, u, { unitId: a, subUnitId: i, row: s, column: l })))
|
2250
2237
|
return;
|
2251
|
-
const p = d.parseFormulaSync(h, a, i), { formula1: R } = p, w = this._calc(c, o), { a:
|
2238
|
+
const p = d.parseFormulaSync(h, a, i), { formula1: R } = p, w = this._calc(c, o), { a: g, d: f } = t.getTransform(), S = bn(w.left, g), V = bn(w.top, f), C = la.create().composeMatrix({
|
2252
2239
|
left: S,
|
2253
2240
|
top: V,
|
2254
2241
|
scaleX: 1,
|
@@ -2263,7 +2250,7 @@ let dn = class {
|
|
2263
2250
|
const y = C.getMatrix();
|
2264
2251
|
t.transform(y[0], y[1], y[2], y[3], y[4], y[5]);
|
2265
2252
|
const P = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, U = String(u) === String(R), O = _.hyacinth500;
|
2266
|
-
|
2253
|
+
da.drawWith(t, {
|
2267
2254
|
checked: U,
|
2268
2255
|
width: P,
|
2269
2256
|
height: P,
|
@@ -2292,57 +2279,58 @@ let dn = class {
|
|
2292
2279
|
endRow: o.actualRow
|
2293
2280
|
},
|
2294
2281
|
value: {
|
2295
|
-
v: String(l) ===
|
2282
|
+
v: String(l) === Va(String(h)) ? d : h,
|
2296
2283
|
p: null
|
2297
2284
|
}
|
2298
2285
|
};
|
2299
2286
|
this._commandService.executeCommand(
|
2300
|
-
|
2287
|
+
_n.id,
|
2301
2288
|
_
|
2302
2289
|
);
|
2303
2290
|
}
|
2304
2291
|
onPointerEnter(t, e) {
|
2305
2292
|
var o, n;
|
2306
|
-
(n = (o =
|
2293
|
+
(n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Gt.POINTER);
|
2307
2294
|
}
|
2308
2295
|
onPointerLeave(t, e) {
|
2309
2296
|
var o, n;
|
2310
|
-
(n = (o =
|
2297
|
+
(n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Gt.DEFAULT);
|
2311
2298
|
}
|
2312
2299
|
};
|
2313
|
-
|
2314
|
-
|
2315
|
-
|
2316
|
-
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2300
|
+
cn = Er([
|
2301
|
+
Yt(0, tt),
|
2302
|
+
Yt(1, st),
|
2303
|
+
Yt(2, b(wa)),
|
2304
|
+
Yt(3, b(zn)),
|
2305
|
+
Yt(4, b(yt)),
|
2306
|
+
Yt(5, b(at))
|
2307
|
+
], cn);
|
2320
2308
|
var br = Object.getOwnPropertyDescriptor, Or = (t, e, o, n) => {
|
2321
2309
|
for (var a = n > 1 ? void 0 : n ? br(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2322
2310
|
(r = t[i]) && (a = r(a) || a);
|
2323
2311
|
return a;
|
2324
2312
|
}, Lr = (t, e) => (o, n) => e(o, n, t);
|
2325
|
-
let
|
2313
|
+
let vt = class {
|
2326
2314
|
constructor(t) {
|
2327
2315
|
E(this, "canvasRender", null);
|
2328
2316
|
E(this, "dropdown");
|
2329
2317
|
E(this, "optionsInput");
|
2330
|
-
E(this, "formulaInput",
|
2318
|
+
E(this, "formulaInput", Mn);
|
2331
2319
|
this.injector = t;
|
2332
2320
|
}
|
2333
2321
|
};
|
2334
|
-
|
2322
|
+
vt = Or([
|
2335
2323
|
Lr(0, b(Wt))
|
2336
|
-
],
|
2337
|
-
class Tr extends
|
2324
|
+
], vt);
|
2325
|
+
class Tr extends vt {
|
2338
2326
|
constructor() {
|
2339
2327
|
super(...arguments);
|
2340
2328
|
E(this, "id", K.CHECKBOX);
|
2341
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2329
|
+
E(this, "canvasRender", this.injector.createInstance(cn));
|
2342
2330
|
E(this, "formulaInput", Fo);
|
2343
2331
|
}
|
2344
2332
|
}
|
2345
|
-
class Pr extends
|
2333
|
+
class Pr extends vt {
|
2346
2334
|
constructor() {
|
2347
2335
|
super(...arguments);
|
2348
2336
|
E(this, "id", K.CUSTOM);
|
@@ -2350,33 +2338,33 @@ class Pr extends ft {
|
|
2350
2338
|
}
|
2351
2339
|
}
|
2352
2340
|
const Ar = "data-validation.formula-input";
|
2353
|
-
class kr extends
|
2341
|
+
class kr extends vt {
|
2354
2342
|
constructor() {
|
2355
2343
|
super(...arguments);
|
2356
2344
|
E(this, "id", K.DATE);
|
2357
2345
|
E(this, "formulaInput", Ar);
|
2358
|
-
E(this, "optionsInput",
|
2359
|
-
E(this, "dropdown",
|
2346
|
+
E(this, "optionsInput", Le.componentKey);
|
2347
|
+
E(this, "dropdown", Oo);
|
2360
2348
|
}
|
2361
2349
|
}
|
2362
|
-
class Fr extends
|
2350
|
+
class Fr extends vt {
|
2363
2351
|
constructor() {
|
2364
2352
|
super(...arguments);
|
2365
2353
|
E(this, "id", K.DECIMAL);
|
2366
|
-
E(this, "formulaInput",
|
2354
|
+
E(this, "formulaInput", Ue);
|
2367
2355
|
}
|
2368
2356
|
}
|
2369
|
-
const No = 4, Nr = 0,
|
2357
|
+
const No = 4, Nr = 0, Ye = 4, Uo = 4, un = 6, Te = 6, At = 14;
|
2370
2358
|
function Ur(t, e) {
|
2371
|
-
const o =
|
2359
|
+
const o = ca.getTextSize(t, e), n = o.width + No * 2, { ba: a, bd: i } = o, r = a + i;
|
2372
2360
|
return {
|
2373
2361
|
width: n,
|
2374
2362
|
height: r + Nr * 2,
|
2375
2363
|
ba: a
|
2376
2364
|
};
|
2377
2365
|
}
|
2378
|
-
function
|
2379
|
-
const a = At +
|
2366
|
+
function Xe(t, e, o, n) {
|
2367
|
+
const a = At + un * 2, i = o - a, r = n - Te * 2, s = t.map((d) => ({
|
2380
2368
|
layout: Ur(d, e),
|
2381
2369
|
text: d
|
2382
2370
|
}));
|
@@ -2384,7 +2372,7 @@ function je(t, e, o, n) {
|
|
2384
2372
|
const c = [];
|
2385
2373
|
s.forEach((d) => {
|
2386
2374
|
const { layout: _ } = d, { width: p, height: R } = _;
|
2387
|
-
!l || l.width + p +
|
2375
|
+
!l || l.width + p + Ye > i ? (l = {
|
2388
2376
|
width: p,
|
2389
2377
|
height: R,
|
2390
2378
|
items: [{
|
@@ -2393,8 +2381,8 @@ function je(t, e, o, n) {
|
|
2393
2381
|
}]
|
2394
2382
|
}, c.push(l)) : (l.items.push({
|
2395
2383
|
...d,
|
2396
|
-
left: l.width +
|
2397
|
-
}), l.width = l.width + p +
|
2384
|
+
left: l.width + Ye
|
2385
|
+
}), l.width = l.width + p + Ye);
|
2398
2386
|
});
|
2399
2387
|
let u = 0, h = 0;
|
2400
2388
|
return c.forEach((d, _) => {
|
@@ -2404,15 +2392,15 @@ function je(t, e, o, n) {
|
|
2404
2392
|
totalHeight: u,
|
2405
2393
|
contentWidth: i,
|
2406
2394
|
contentHeight: r,
|
2407
|
-
cellAutoHeight: u +
|
2395
|
+
cellAutoHeight: u + Te * 2,
|
2408
2396
|
calcAutoWidth: h + a
|
2409
2397
|
};
|
2410
2398
|
}
|
2411
2399
|
const Br = 8;
|
2412
|
-
class $r extends
|
2400
|
+
class $r extends ua {
|
2413
2401
|
static drawWith(e, o) {
|
2414
2402
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: s, text: l } = a;
|
2415
|
-
e.save(),
|
2403
|
+
e.save(), Jn.drawWith(e, {
|
2416
2404
|
width: s.width,
|
2417
2405
|
height: s.height,
|
2418
2406
|
radius: Br,
|
@@ -2424,13 +2412,13 @@ var Wr = Object.getOwnPropertyDescriptor, Hr = (t, e, o, n) => {
|
|
2424
2412
|
for (var a = n > 1 ? void 0 : n ? Wr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2425
2413
|
(r = t[i]) && (a = r(a) || a);
|
2426
2414
|
return a;
|
2427
|
-
},
|
2415
|
+
}, fe = (t, e) => (o, n) => e(o, n, t);
|
2428
2416
|
const xr = 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");
|
2429
|
-
let
|
2430
|
-
constructor(t, e, o) {
|
2417
|
+
let hn = class {
|
2418
|
+
constructor(t, e, o, n) {
|
2431
2419
|
E(this, "zIndex");
|
2432
2420
|
E(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2433
|
-
this._commandService = t, this.
|
2421
|
+
this._commandService = t, this._univerInstanceService = e, this._renderManagerService = o, this._dataValidationModel = n;
|
2434
2422
|
}
|
2435
2423
|
_ensureMap(t) {
|
2436
2424
|
let e = this._dropdownInfoMap.get(t);
|
@@ -2443,10 +2431,10 @@ let un = class {
|
|
2443
2431
|
const i = o - At + 4;
|
2444
2432
|
let r = 4;
|
2445
2433
|
switch (a) {
|
2446
|
-
case
|
2434
|
+
case pt.MIDDLE:
|
2447
2435
|
r = (n - At) / 2 + 4;
|
2448
2436
|
break;
|
2449
|
-
case
|
2437
|
+
case pt.BOTTOM:
|
2450
2438
|
r = n - At + 4;
|
2451
2439
|
break;
|
2452
2440
|
}
|
@@ -2455,7 +2443,7 @@ let un = class {
|
|
2455
2443
|
// eslint-disable-next-line max-lines-per-function
|
2456
2444
|
drawWith(t, e, o, n) {
|
2457
2445
|
var z, H;
|
2458
|
-
const { primaryWithCoord: a, row: i, col: r, style: s, data: l, subUnitId: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: d = 0, rightOffset: _ = 0, topOffset: p = 0, downOffset: R = 0 } = h || {}, w = this._ensureMap(c),
|
2446
|
+
const { primaryWithCoord: a, row: i, col: r, style: s, data: l, subUnitId: c } = e, u = a.isMergedMainCell ? a.mergeInfo : a, h = l == null ? void 0 : l.fontRenderExtension, { leftOffset: d = 0, rightOffset: _ = 0, topOffset: p = 0, downOffset: R = 0 } = h || {}, w = this._ensureMap(c), g = this._generateKey(i, r), f = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, r);
|
2459
2447
|
if (!f)
|
2460
2448
|
return;
|
2461
2449
|
const S = this._dataValidationModel.getValidator(f.type);
|
@@ -2466,42 +2454,42 @@ let un = class {
|
|
2466
2454
|
endX: u.endX - _,
|
2467
2455
|
startY: u.startY + p,
|
2468
2456
|
endY: u.endY - R
|
2469
|
-
}, C = V.endX - V.startX, I = V.endY - V.startY, { cl: v } = s || {}, y = (z = typeof v == "object" ? v == null ? void 0 : v.rgb : v) != null ? z : "#000", P =
|
2470
|
-
this._drawDownIcon(t, V, C, I, L), t.save(), t.translateWithPrecision(V.startX, V.startY), t.beginPath(), t.rect(0, 0, C - At, I), t.clip(), t.translateWithPrecision(
|
2457
|
+
}, C = V.endX - V.startX, I = V.endY - V.startY, { cl: v } = s || {}, y = (z = typeof v == "object" ? v == null ? void 0 : v.rgb : v) != null ? z : "#000", P = Be(s != null ? s : void 0), { vt: U, ht: O } = s || {}, L = U != null ? U : pt.MIDDLE, A = (H = rt(l)) != null ? H : "", F = S.parseCellValue(A), N = S.getListWithColorMap(f), B = Xe(F, P, C, I);
|
2458
|
+
this._drawDownIcon(t, V, C, I, L), t.save(), t.translateWithPrecision(V.startX, V.startY), t.beginPath(), t.rect(0, 0, C - At, I), t.clip(), t.translateWithPrecision(un, Te);
|
2471
2459
|
let x = 0;
|
2472
2460
|
switch (L) {
|
2473
|
-
case
|
2461
|
+
case pt.MIDDLE:
|
2474
2462
|
x = (B.contentHeight - B.totalHeight) / 2;
|
2475
2463
|
break;
|
2476
|
-
case
|
2464
|
+
case pt.BOTTOM:
|
2477
2465
|
x = B.contentHeight - B.totalHeight;
|
2478
2466
|
break;
|
2479
2467
|
}
|
2480
2468
|
t.translateWithPrecision(0, x), B.lines.forEach((G, J) => {
|
2481
2469
|
t.save();
|
2482
|
-
const { width: et, height: nt, items:
|
2470
|
+
const { width: et, height: nt, items: lt } = G;
|
2483
2471
|
let it = 0;
|
2484
2472
|
switch (O) {
|
2485
|
-
case
|
2473
|
+
case zt.RIGHT:
|
2486
2474
|
it = B.contentWidth - et;
|
2487
2475
|
break;
|
2488
|
-
case
|
2476
|
+
case zt.CENTER:
|
2489
2477
|
it = (B.contentWidth - et) / 2;
|
2490
2478
|
break;
|
2491
2479
|
}
|
2492
|
-
t.translate(it, J * (nt + Uo)),
|
2493
|
-
t.save(), t.translateWithPrecision(
|
2480
|
+
t.translate(it, J * (nt + Uo)), lt.forEach((dt) => {
|
2481
|
+
t.save(), t.translateWithPrecision(dt.left, 0), $r.drawWith(t, {
|
2494
2482
|
...P,
|
2495
|
-
info:
|
2483
|
+
info: dt,
|
2496
2484
|
color: y,
|
2497
|
-
fill: N[
|
2485
|
+
fill: N[dt.text]
|
2498
2486
|
}), t.restore();
|
2499
2487
|
}), t.restore();
|
2500
|
-
}), t.restore(), w.set(
|
2488
|
+
}), t.restore(), w.set(g, {
|
2501
2489
|
left: V.startX,
|
2502
2490
|
top: V.startY,
|
2503
|
-
width: B.contentWidth +
|
2504
|
-
height: B.contentHeight +
|
2491
|
+
width: B.contentWidth + un + At,
|
2492
|
+
height: B.contentHeight + Te * 2
|
2505
2493
|
});
|
2506
2494
|
}
|
2507
2495
|
calcCellAutoHeight(t) {
|
@@ -2517,8 +2505,8 @@ let un = class {
|
|
2517
2505
|
const p = this._dataValidationModel.getValidator(_.type);
|
2518
2506
|
if (!p)
|
2519
2507
|
return;
|
2520
|
-
const R = d.endX - d.startX, w = d.endY - d.startY,
|
2521
|
-
return
|
2508
|
+
const R = d.endX - d.startX, w = d.endY - d.startY, g = (C = rt(n)) != null ? C : "", f = p.parseCellValue(g), S = Be(o != null ? o : void 0);
|
2509
|
+
return Xe(f, S, R, w).cellAutoHeight;
|
2522
2510
|
}
|
2523
2511
|
calcCellAutoWidth(t) {
|
2524
2512
|
var C;
|
@@ -2533,8 +2521,8 @@ let un = class {
|
|
2533
2521
|
const p = this._dataValidationModel.getValidator(_.type);
|
2534
2522
|
if (!p)
|
2535
2523
|
return;
|
2536
|
-
const R = d.endX - d.startX, w = d.endY - d.startY,
|
2537
|
-
return
|
2524
|
+
const R = d.endX - d.startX, w = d.endY - d.startY, g = (C = rt(n)) != null ? C : "", f = p.parseCellValue(g), S = Be(o != null ? o : void 0);
|
2525
|
+
return Xe(f, S, R, w).calcAutoWidth;
|
2538
2526
|
}
|
2539
2527
|
isHit(t, e) {
|
2540
2528
|
const { primaryWithCoord: o } = e, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = t;
|
@@ -2549,36 +2537,37 @@ let un = class {
|
|
2549
2537
|
row: a,
|
2550
2538
|
column: i
|
2551
2539
|
};
|
2552
|
-
this._commandService.executeCommand(
|
2540
|
+
this._commandService.executeCommand(Fe.id, r);
|
2553
2541
|
}
|
2554
2542
|
onPointerEnter(t, e) {
|
2555
2543
|
var o, n;
|
2556
|
-
(n = (o =
|
2544
|
+
return (n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null ? void 0 : n.setCursor(Gt.POINTER);
|
2557
2545
|
}
|
2558
2546
|
onPointerLeave(t, e) {
|
2559
2547
|
var o, n;
|
2560
|
-
(n = (o =
|
2548
|
+
return (n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null ? void 0 : n.setCursor(Gt.DEFAULT);
|
2561
2549
|
}
|
2562
2550
|
};
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2551
|
+
hn = Hr([
|
2552
|
+
fe(0, tt),
|
2553
|
+
fe(1, st),
|
2554
|
+
fe(2, b(yt)),
|
2555
|
+
fe(3, b(at))
|
2556
|
+
], hn);
|
2557
|
+
class jr extends vt {
|
2569
2558
|
constructor() {
|
2570
2559
|
super(...arguments);
|
2571
2560
|
E(this, "id", K.LIST_MULTIPLE);
|
2572
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2573
|
-
E(this, "dropdown",
|
2561
|
+
E(this, "canvasRender", this.injector.createInstance(hn));
|
2562
|
+
E(this, "dropdown", yn);
|
2574
2563
|
}
|
2575
2564
|
}
|
2576
2565
|
var Yr = Object.getOwnPropertyDescriptor, Xr = (t, e, o, n) => {
|
2577
2566
|
for (var a = n > 1 ? void 0 : n ? Yr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2578
2567
|
(r = t[i]) && (a = r(a) || a);
|
2579
2568
|
return a;
|
2580
|
-
},
|
2581
|
-
const Pt = 4,
|
2569
|
+
}, se = (t, e) => (o, n) => e(o, n, t);
|
2570
|
+
const Pt = 4, ve = 4, mt = 14, gt = 6, Xt = 4, ze = 8, zr = "#565656", xn = 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");
|
2582
2571
|
function Kr(t, e) {
|
2583
2572
|
const o = t.length;
|
2584
2573
|
return {
|
@@ -2590,16 +2579,16 @@ function Kr(t, e) {
|
|
2590
2579
|
ts: {
|
2591
2580
|
fs: 11,
|
2592
2581
|
ff: void 0,
|
2593
|
-
it:
|
2594
|
-
bl:
|
2582
|
+
it: oe.FALSE,
|
2583
|
+
bl: oe.FALSE,
|
2595
2584
|
ul: {
|
2596
|
-
s:
|
2585
|
+
s: oe.FALSE
|
2597
2586
|
},
|
2598
2587
|
st: {
|
2599
|
-
s:
|
2588
|
+
s: oe.FALSE
|
2600
2589
|
},
|
2601
2590
|
ol: {
|
2602
|
-
s:
|
2591
|
+
s: oe.FALSE
|
2603
2592
|
},
|
2604
2593
|
cl: void 0,
|
2605
2594
|
...e,
|
@@ -2620,21 +2609,21 @@ function Kr(t, e) {
|
|
2620
2609
|
};
|
2621
2610
|
}
|
2622
2611
|
function Bo(t, e, o) {
|
2623
|
-
const n = Kr(t, o), a = new na(n), i = new
|
2612
|
+
const n = Kr(t, o), a = new na(n), i = new pa(a);
|
2624
2613
|
return {
|
2625
|
-
documentSkeleton:
|
2614
|
+
documentSkeleton: ma.create(i, e),
|
2626
2615
|
docModel: a,
|
2627
2616
|
docViewModel: i
|
2628
2617
|
};
|
2629
2618
|
}
|
2630
|
-
function
|
2619
|
+
function _e(t, e, o) {
|
2631
2620
|
const {
|
2632
2621
|
documentSkeleton: n,
|
2633
2622
|
docModel: a,
|
2634
2623
|
docViewModel: i
|
2635
2624
|
} = Bo(t, e, o);
|
2636
2625
|
return {
|
2637
|
-
documents: new
|
2626
|
+
documents: new ha(`DOCUMENTS_${tn.generateRandomId()}`, n, {
|
2638
2627
|
pageMarginLeft: 0,
|
2639
2628
|
pageMarginTop: 0
|
2640
2629
|
}),
|
@@ -2643,27 +2632,27 @@ function fe(t, e, o) {
|
|
2643
2632
|
docViewModel: i
|
2644
2633
|
};
|
2645
2634
|
}
|
2646
|
-
function
|
2635
|
+
function jn(t, e, o, n, a, i, r = !0) {
|
2647
2636
|
let s = 0;
|
2648
|
-
const l = r ?
|
2637
|
+
const l = r ? Xt : 0;
|
2649
2638
|
switch (a) {
|
2650
|
-
case
|
2639
|
+
case pt.BOTTOM:
|
2651
2640
|
s = e - n - l;
|
2652
2641
|
break;
|
2653
|
-
case
|
2642
|
+
case pt.MIDDLE:
|
2654
2643
|
s = (e - n) / 2;
|
2655
2644
|
break;
|
2656
2645
|
default:
|
2657
2646
|
s = l;
|
2658
2647
|
break;
|
2659
2648
|
}
|
2660
|
-
s = Math.max(
|
2649
|
+
s = Math.max(Xt, s);
|
2661
2650
|
let c = 0;
|
2662
2651
|
switch (i) {
|
2663
|
-
case
|
2652
|
+
case zt.CENTER:
|
2664
2653
|
c = (t - o) / 2;
|
2665
2654
|
break;
|
2666
|
-
case
|
2655
|
+
case zt.RIGHT:
|
2667
2656
|
c = t - o;
|
2668
2657
|
break;
|
2669
2658
|
}
|
@@ -2672,11 +2661,11 @@ function xn(t, e, o, n, a, i, r = !0) {
|
|
2672
2661
|
paddingTop: s
|
2673
2662
|
};
|
2674
2663
|
}
|
2675
|
-
let
|
2676
|
-
constructor(t, e, o, n) {
|
2664
|
+
let pn = class {
|
2665
|
+
constructor(t, e, o, n, a) {
|
2677
2666
|
E(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2678
2667
|
E(this, "zIndex");
|
2679
|
-
this.
|
2668
|
+
this._univerInstanceService = t, this._localeService = e, this._commandService = o, this._renderManagerService = n, this._dataValidationModel = a;
|
2680
2669
|
}
|
2681
2670
|
_ensureMap(t) {
|
2682
2671
|
let e = this._dropdownInfoMap.get(t);
|
@@ -2686,20 +2675,20 @@ let hn = class {
|
|
2686
2675
|
return `${t}.${e}`;
|
2687
2676
|
}
|
2688
2677
|
_drawDownIcon(t, e, o, n, a, i, r) {
|
2689
|
-
const { t: s =
|
2678
|
+
const { t: s = ct.pd.t, b: l = ct.pd.b } = r, c = o - mt;
|
2690
2679
|
let u;
|
2691
2680
|
switch (i) {
|
2692
|
-
case
|
2693
|
-
u = (n -
|
2681
|
+
case pt.MIDDLE:
|
2682
|
+
u = (n - ve) / 2;
|
2694
2683
|
break;
|
2695
|
-
case
|
2696
|
-
u = n - l - a -
|
2684
|
+
case pt.BOTTOM:
|
2685
|
+
u = n - l - a - Xt + (a / 2 - ve / 2);
|
2697
2686
|
break;
|
2698
2687
|
default:
|
2699
|
-
u = s +
|
2688
|
+
u = s + Xt + (a / 2 - ve / 2);
|
2700
2689
|
break;
|
2701
2690
|
}
|
2702
|
-
t.save(), t.translateWithPrecision(e.startX + c, e.startY + u), t.fillStyle = "#565656", t.fill(
|
2691
|
+
t.save(), t.translateWithPrecision(e.startX + c, e.startY + u), t.fillStyle = "#565656", t.fill(xn), t.restore();
|
2703
2692
|
}
|
2704
2693
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2705
2694
|
drawWith(t, e, o) {
|
@@ -2712,46 +2701,46 @@ let hn = class {
|
|
2712
2701
|
const d = s == null ? void 0 : s.fontRenderExtension, { leftOffset: _ = 0, rightOffset: p = 0, topOffset: R = 0, downOffset: w = 0 } = d || {};
|
2713
2702
|
if (!u || !h || !h || h.id.indexOf(K.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
2714
2703
|
return;
|
2715
|
-
const
|
2704
|
+
const g = {
|
2716
2705
|
startX: c.startX + _,
|
2717
2706
|
endX: c.endX - p,
|
2718
2707
|
startY: c.startY + R,
|
2719
2708
|
endY: c.endY - w
|
2720
|
-
}, f =
|
2709
|
+
}, f = g.endX - g.startX, S = g.endY - g.startY, V = this._ensureMap(l), C = this._generateKey(a, i), I = h.getListWithColor(u), v = rt(s), y = `${v != null ? v : ""}`, P = I.find((F) => F.label === y);
|
2721
2710
|
let { tb: U, vt: O, ht: L, pd: A } = r || {};
|
2722
|
-
if (U = U != null ? U : It.WRAP, O = O != null ? O :
|
2723
|
-
const { l: F =
|
2711
|
+
if (U = U != null ? U : It.WRAP, O = O != null ? O : pt.BOTTOM, L = L != null ? L : ct.ht, A = A != null ? A : ct.pd, u.renderMode === ut.ARROW) {
|
2712
|
+
const { l: F = ct.pd.l, t: N = ct.pd.t, r: B = ct.pd.r, b: x = ct.pd.b } = A, z = f - F - B - mt - 4, { documentSkeleton: H, documents: G, docModel: J } = _e(y, this._localeService, r);
|
2724
2713
|
U === It.WRAP && J.updateDocumentDataPageSize(Math.max(z, 1)), H.calculate(), H.getActualSize();
|
2725
|
-
const et =
|
2726
|
-
this._drawDownIcon(t,
|
2727
|
-
left:
|
2728
|
-
top:
|
2729
|
-
width:
|
2714
|
+
const et = ae(H), { height: nt, width: lt } = et, { paddingTop: it, paddingLeft: dt } = jn(z, S - N - x, lt, nt, O, L, !0);
|
2715
|
+
this._drawDownIcon(t, g, f, S, nt, O, A), t.save(), t.translateWithPrecision(g.startX + F, g.startY + N), t.beginPath(), t.rect(0, 0, f - F - B, S - N - x), t.clip(), t.translateWithPrecision(0, it), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, z, nt), t.clip(), G.render(t), t.translateWithPrecision(dt, 0), t.restore(), t.restore(), V.set(C, {
|
2716
|
+
left: g.endX + F + o.rowHeaderWidth - mt,
|
2717
|
+
top: g.startY + N + o.columnHeaderHeight,
|
2718
|
+
width: mt,
|
2730
2719
|
height: S - N - x
|
2731
2720
|
});
|
2732
2721
|
} else {
|
2733
|
-
t.save(), t.translateWithPrecision(
|
2734
|
-
const F = f - gt * 2 - Pt -
|
2722
|
+
t.save(), t.translateWithPrecision(g.startX, g.startY), t.beginPath(), t.rect(0, 0, f, S), t.clip();
|
2723
|
+
const F = f - gt * 2 - Pt - mt - 4, { documentSkeleton: N, documents: B, docModel: x } = _e(y, this._localeService, r);
|
2735
2724
|
U === It.WRAP && x.updateDocumentDataPageSize(Math.max(F, 1)), N.calculate();
|
2736
|
-
const z =
|
2725
|
+
const z = ae(N), { height: H, width: G } = z, { paddingTop: J, paddingLeft: et } = jn(F, S, G, H, O, L);
|
2737
2726
|
t.translateWithPrecision(gt, J);
|
2738
|
-
const nt = Math.max(f - gt * 2, 1),
|
2739
|
-
|
2727
|
+
const nt = Math.max(f - gt * 2, 1), lt = H;
|
2728
|
+
Jn.drawWith(t, {
|
2740
2729
|
width: nt,
|
2741
|
-
height:
|
2730
|
+
height: lt,
|
2742
2731
|
fill: (P == null ? void 0 : P.color) || Ft,
|
2743
|
-
radius:
|
2744
|
-
}), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, F, H), t.clip(), t.translateWithPrecision(et, 0), B.render(t), t.restore(), t.translateWithPrecision(F + Pt + 4, (H -
|
2745
|
-
left:
|
2746
|
-
top:
|
2732
|
+
radius: ze
|
2733
|
+
}), t.save(), t.translateWithPrecision(Pt, 0), t.beginPath(), t.rect(0, 0, F, H), t.clip(), t.translateWithPrecision(et, 0), B.render(t), t.restore(), t.translateWithPrecision(F + Pt + 4, (H - ve) / 2), t.fillStyle = zr, t.fill(xn), t.restore(), V.set(C, {
|
2734
|
+
left: g.startX + gt + o.rowHeaderWidth,
|
2735
|
+
top: g.startY + J + o.columnHeaderHeight,
|
2747
2736
|
width: nt,
|
2748
|
-
height:
|
2737
|
+
height: lt
|
2749
2738
|
});
|
2750
2739
|
}
|
2751
2740
|
}
|
2752
2741
|
calcCellAutoHeight(t) {
|
2753
2742
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = e.isMergedMainCell ? e.mergeInfo : e, s = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = s || {}, d = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2754
|
-
if (!d || d.renderMode ===
|
2743
|
+
if (!d || d.renderMode === ut.TEXT)
|
2755
2744
|
return;
|
2756
2745
|
const _ = {
|
2757
2746
|
startX: r.startX + l,
|
@@ -2759,25 +2748,25 @@ let hn = class {
|
|
2759
2748
|
startY: r.startY + u,
|
2760
2749
|
endY: r.endY - h
|
2761
2750
|
}, p = _.endX - _.startX, R = rt(n), w = `${R != null ? R : ""}`;
|
2762
|
-
let { tb:
|
2763
|
-
const { t: S =
|
2764
|
-
if (
|
2765
|
-
const C = p -
|
2766
|
-
|
2767
|
-
const y =
|
2768
|
-
return P + S + V +
|
2751
|
+
let { tb: g, pd: f } = o || {};
|
2752
|
+
const { t: S = ct.pd.t, b: V = ct.pd.b } = f != null ? f : {};
|
2753
|
+
if (g = g != null ? g : It.WRAP, d.renderMode === ut.ARROW) {
|
2754
|
+
const C = p - mt, { documentSkeleton: I, docModel: v } = _e(w, this._localeService, o);
|
2755
|
+
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(C, 1)), I.calculate(), I.getActualSize();
|
2756
|
+
const y = ae(I), { height: P } = y;
|
2757
|
+
return P + S + V + Xt * 2;
|
2769
2758
|
} else {
|
2770
|
-
const C = p - gt * 2 - Pt -
|
2771
|
-
|
2772
|
-
const y =
|
2759
|
+
const C = p - gt * 2 - Pt - mt, { documentSkeleton: I, docModel: v } = Bo(w, this._localeService, o);
|
2760
|
+
g === It.WRAP && v.updateDocumentDataPageSize(Math.max(C, 1)), I.calculate();
|
2761
|
+
const y = ae(I), {
|
2773
2762
|
height: P
|
2774
2763
|
} = y;
|
2775
|
-
return P +
|
2764
|
+
return P + Xt * 2;
|
2776
2765
|
}
|
2777
2766
|
}
|
2778
2767
|
calcCellAutoWidth(t) {
|
2779
2768
|
const { primaryWithCoord: e, style: o, data: n, row: a, col: i } = t, r = e.isMergedMainCell ? e.mergeInfo : e, s = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = s || {}, d = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, a, i);
|
2780
|
-
if (!d || d.renderMode ===
|
2769
|
+
if (!d || d.renderMode === ut.TEXT)
|
2781
2770
|
return;
|
2782
2771
|
const _ = {
|
2783
2772
|
startX: r.startX + l,
|
@@ -2785,27 +2774,27 @@ let hn = class {
|
|
2785
2774
|
startY: r.startY + u,
|
2786
2775
|
endY: r.endY - h
|
2787
2776
|
}, p = _.endX - _.startX, R = rt(n), w = `${R != null ? R : ""}`;
|
2788
|
-
let { tb:
|
2789
|
-
const { l: S =
|
2790
|
-
|
2791
|
-
let C = gt * 2 +
|
2777
|
+
let { tb: g, pd: f } = o || {};
|
2778
|
+
const { l: S = ct.pd.l, r: V = ct.pd.r } = f != null ? f : {};
|
2779
|
+
g = g != null ? g : It.WRAP;
|
2780
|
+
let C = gt * 2 + mt;
|
2792
2781
|
switch (d.renderMode) {
|
2793
|
-
case
|
2794
|
-
C =
|
2782
|
+
case ut.ARROW:
|
2783
|
+
C = mt + gt * 2 + V + S;
|
2795
2784
|
break;
|
2796
|
-
case
|
2797
|
-
C =
|
2785
|
+
case ut.CUSTOM:
|
2786
|
+
C = mt + gt * 2 + Pt * 2 + V + S + ze / 2 + 1;
|
2798
2787
|
break;
|
2799
2788
|
// default is CUSTOM
|
2800
2789
|
default:
|
2801
|
-
C =
|
2790
|
+
C = mt + gt * 2 + Pt * 2 + V + S + ze / 2 + 1;
|
2802
2791
|
}
|
2803
|
-
const I = p - C, { documentSkeleton: v, docModel: y } =
|
2804
|
-
return
|
2792
|
+
const I = p - C, { documentSkeleton: v, docModel: y } = _e(w, this._localeService, o);
|
2793
|
+
return g === It.WRAP && y.updateDocumentDataPageSize(Math.max(I, 1)), v.calculate(), v.getActualSize(), ae(v).width + C;
|
2805
2794
|
}
|
2806
2795
|
isHit(t, e) {
|
2807
2796
|
const { subUnitId: o, row: n, col: a } = e, r = this._ensureMap(o).get(this._generateKey(n, a)), s = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, n, a);
|
2808
|
-
if (!s || !r || s.renderMode ===
|
2797
|
+
if (!s || !r || s.renderMode === ut.TEXT)
|
2809
2798
|
return !1;
|
2810
2799
|
const { top: l, left: c, width: u, height: h } = r, { x: d, y: _ } = t;
|
2811
2800
|
return d >= c && d <= c + u && _ >= l && _ <= l + h;
|
@@ -2819,65 +2808,66 @@ let hn = class {
|
|
2819
2808
|
row: a,
|
2820
2809
|
column: i
|
2821
2810
|
};
|
2822
|
-
this._commandService.executeCommand(
|
2811
|
+
this._commandService.executeCommand(Fe.id, r);
|
2823
2812
|
}
|
2824
2813
|
onPointerEnter(t, e) {
|
2825
2814
|
var o, n;
|
2826
|
-
(n = (o =
|
2815
|
+
(n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Gt.POINTER);
|
2827
2816
|
}
|
2828
2817
|
onPointerLeave(t, e) {
|
2829
2818
|
var o, n;
|
2830
|
-
(n = (o =
|
2819
|
+
(n = (o = Kt(X.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Gt.DEFAULT);
|
2831
2820
|
}
|
2832
2821
|
};
|
2833
|
-
|
2834
|
-
|
2835
|
-
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2822
|
+
pn = Xr([
|
2823
|
+
se(0, st),
|
2824
|
+
se(1, b(Q)),
|
2825
|
+
se(2, tt),
|
2826
|
+
se(3, b(yt)),
|
2827
|
+
se(4, b(at))
|
2828
|
+
], pn);
|
2829
|
+
class Gr extends vt {
|
2840
2830
|
constructor() {
|
2841
2831
|
super(...arguments);
|
2842
2832
|
E(this, "id", K.LIST);
|
2843
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2844
|
-
E(this, "dropdown",
|
2845
|
-
E(this, "optionsInput",
|
2846
|
-
E(this, "formulaInput",
|
2833
|
+
E(this, "canvasRender", this.injector.createInstance(pn));
|
2834
|
+
E(this, "dropdown", yn);
|
2835
|
+
E(this, "optionsInput", Oe.componentKey);
|
2836
|
+
E(this, "formulaInput", Mn);
|
2847
2837
|
}
|
2848
2838
|
}
|
2849
|
-
class Zr extends
|
2839
|
+
class Zr extends vt {
|
2850
2840
|
constructor() {
|
2851
2841
|
super(...arguments);
|
2852
2842
|
E(this, "id", K.TEXT_LENGTH);
|
2853
|
-
E(this, "formulaInput",
|
2843
|
+
E(this, "formulaInput", Ue);
|
2854
2844
|
}
|
2855
2845
|
}
|
2856
|
-
class qr extends
|
2846
|
+
class qr extends vt {
|
2857
2847
|
constructor() {
|
2858
2848
|
super(...arguments);
|
2859
2849
|
E(this, "id", K.WHOLE);
|
2860
|
-
E(this, "formulaInput",
|
2850
|
+
E(this, "formulaInput", Ue);
|
2861
2851
|
}
|
2862
2852
|
}
|
2863
2853
|
var Jr = Object.getOwnPropertyDescriptor, Qr = (t, e, o, n) => {
|
2864
2854
|
for (var a = n > 1 ? void 0 : n ? Jr(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2865
2855
|
(r = t[i]) && (a = r(a) || a);
|
2866
2856
|
return a;
|
2867
|
-
},
|
2868
|
-
let
|
2857
|
+
}, Ke = (t, e) => (o, n) => e(o, n, t);
|
2858
|
+
let ee = class extends gn {
|
2869
2859
|
constructor(t, e, o) {
|
2870
2860
|
super(), this._injector = t, this._componentManger = e, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2871
2861
|
}
|
2872
2862
|
_initComponents() {
|
2873
2863
|
[
|
2874
|
-
[
|
2875
|
-
[
|
2876
|
-
[
|
2877
|
-
[
|
2878
|
-
[
|
2879
|
-
[
|
2880
|
-
[
|
2864
|
+
[Lo, wo],
|
2865
|
+
[Me, zi],
|
2866
|
+
[Mo, mi],
|
2867
|
+
[yn, Mi],
|
2868
|
+
[Oo, ti],
|
2869
|
+
[Oe.componentKey, Oe],
|
2870
|
+
[Le.componentKey, Le],
|
2881
2871
|
...Dr
|
2882
2872
|
].forEach(([t, e]) => {
|
2883
2873
|
this.disposeWithMe(this._componentManger.register(
|
@@ -2902,131 +2892,131 @@ let Qt = class extends gn {
|
|
2902
2892
|
});
|
2903
2893
|
}
|
2904
2894
|
};
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2909
|
-
],
|
2895
|
+
ee = Qr([
|
2896
|
+
Ke(0, b(Wt)),
|
2897
|
+
Ke(1, b(Ae)),
|
2898
|
+
Ke(2, b(bt))
|
2899
|
+
], ee);
|
2910
2900
|
var ts = Object.getOwnPropertyDescriptor, es = (t, e, o, n) => {
|
2911
2901
|
for (var a = n > 1 ? void 0 : n ? ts(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2912
2902
|
(r = t[i]) && (a = r(a) || a);
|
2913
2903
|
return a;
|
2914
|
-
},
|
2904
|
+
}, Ge = (t, e) => (o, n) => e(o, n, t);
|
2915
2905
|
const ns = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2916
|
-
var
|
2917
|
-
let
|
2918
|
-
constructor(t =
|
2906
|
+
var Se;
|
2907
|
+
let Yn = (Se = class extends Zn {
|
2908
|
+
constructor(t = Ee, e, o, n) {
|
2919
2909
|
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
2920
|
-
const { menu: a, ...i } =
|
2910
|
+
const { menu: a, ...i } = qn(
|
2921
2911
|
{},
|
2922
|
-
|
2912
|
+
Ee,
|
2923
2913
|
this._config
|
2924
2914
|
);
|
2925
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
2915
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
2926
2916
|
}
|
2927
2917
|
onStarting() {
|
2928
2918
|
[
|
2929
|
-
[
|
2919
|
+
[ft],
|
2930
2920
|
[Dt],
|
2931
|
-
[
|
2932
|
-
[Gt],
|
2933
|
-
[Jt],
|
2921
|
+
[ue],
|
2934
2922
|
[qt],
|
2935
|
-
[
|
2936
|
-
[
|
2937
|
-
[
|
2923
|
+
[te],
|
2924
|
+
[Qt],
|
2925
|
+
[Jt],
|
2926
|
+
[ce],
|
2927
|
+
[ee]
|
2938
2928
|
].forEach((t) => {
|
2939
2929
|
this._injector.add(t);
|
2940
2930
|
}), [
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
2931
|
+
Ne,
|
2932
|
+
Fe,
|
2933
|
+
bo,
|
2934
|
+
Dn,
|
2945
2935
|
Ht,
|
2946
|
-
|
2936
|
+
Eo
|
2947
2937
|
].forEach((t) => {
|
2948
2938
|
this._commandService.registerCommand(t);
|
2949
2939
|
});
|
2950
2940
|
}
|
2951
2941
|
onReady() {
|
2952
|
-
this._injector.get(
|
2942
|
+
this._injector.get(Jt), this._injector.get(Qt), this._injector.get(ce), this._injector.get(ue), this._injector.get(yt).registerRenderModule(
|
2953
2943
|
X.UNIVER_SHEET,
|
2954
|
-
[
|
2944
|
+
[be]
|
2955
2945
|
);
|
2956
2946
|
}
|
2957
2947
|
onRendered() {
|
2958
|
-
this._injector.get(
|
2948
|
+
this._injector.get(ee), this._injector.get(te);
|
2959
2949
|
}
|
2960
2950
|
onSteady() {
|
2961
|
-
this._injector.get(
|
2962
|
-
}
|
2963
|
-
}, E(
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
|
2968
|
-
],
|
2951
|
+
this._injector.get(qt);
|
2952
|
+
}
|
2953
|
+
}, E(Se, "pluginName", ns), E(Se, "type", X.UNIVER_SHEET), Se);
|
2954
|
+
Yn = es([
|
2955
|
+
Ge(1, b(Wt)),
|
2956
|
+
Ge(2, tt),
|
2957
|
+
Ge(3, mn)
|
2958
|
+
], Yn);
|
2969
2959
|
var os = Object.getOwnPropertyDescriptor, as = (t, e, o, n) => {
|
2970
2960
|
for (var a = n > 1 ? void 0 : n ? os(e, o) : e, i = t.length - 1, r; i >= 0; i--)
|
2971
2961
|
(r = t[i]) && (a = r(a) || a);
|
2972
2962
|
return a;
|
2973
|
-
},
|
2963
|
+
}, Ze = (t, e) => (o, n) => e(o, n, t);
|
2974
2964
|
const is = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2975
|
-
var
|
2976
|
-
let
|
2977
|
-
constructor(t =
|
2965
|
+
var Ce;
|
2966
|
+
let Xn = (Ce = class extends Zn {
|
2967
|
+
constructor(t = Ee, e, o, n) {
|
2978
2968
|
super(), this._config = t, this._injector = e, this._commandService = o, this._configService = n;
|
2979
|
-
const { menu: a, ...i } =
|
2969
|
+
const { menu: a, ...i } = qn(
|
2980
2970
|
{},
|
2981
|
-
|
2971
|
+
Ee,
|
2982
2972
|
this._config
|
2983
2973
|
);
|
2984
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
2974
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
2985
2975
|
}
|
2986
2976
|
onStarting() {
|
2987
2977
|
[
|
2988
|
-
[
|
2978
|
+
[ft],
|
2989
2979
|
[Dt],
|
2990
|
-
[
|
2991
|
-
[Gt],
|
2992
|
-
[Jt],
|
2980
|
+
[ue],
|
2993
2981
|
[qt],
|
2994
|
-
[
|
2995
|
-
[Qt]
|
2982
|
+
[te],
|
2983
|
+
[Qt],
|
2984
|
+
[Jt],
|
2985
|
+
[ee]
|
2996
2986
|
].forEach((t) => {
|
2997
2987
|
this._injector.add(t);
|
2998
2988
|
}), [
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
2989
|
+
Ne,
|
2990
|
+
Fe,
|
2991
|
+
bo,
|
2992
|
+
Dn,
|
3003
2993
|
Ht,
|
3004
|
-
|
2994
|
+
Eo
|
3005
2995
|
].forEach((t) => {
|
3006
2996
|
this._commandService.registerCommand(t);
|
3007
2997
|
});
|
3008
2998
|
}
|
3009
2999
|
onReady() {
|
3010
|
-
this._injector.get(
|
3000
|
+
this._injector.get(Jt), this._injector.get(Qt), this._injector.get(yt).registerRenderModule(
|
3011
3001
|
X.UNIVER_SHEET,
|
3012
|
-
[
|
3002
|
+
[be]
|
3013
3003
|
);
|
3014
3004
|
}
|
3015
3005
|
onRendered() {
|
3016
|
-
this._injector.get(
|
3006
|
+
this._injector.get(ee), this._injector.get(te);
|
3017
3007
|
}
|
3018
3008
|
onSteady() {
|
3019
|
-
this._injector.get(
|
3020
|
-
}
|
3021
|
-
}, E(
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
],
|
3009
|
+
this._injector.get(qt);
|
3010
|
+
}
|
3011
|
+
}, E(Ce, "pluginName", is), E(Ce, "type", X.UNIVER_SHEET), Ce);
|
3012
|
+
Xn = as([
|
3013
|
+
Ze(1, b(Wt)),
|
3014
|
+
Ze(2, tt),
|
3015
|
+
Ze(3, mn)
|
3016
|
+
], Xn);
|
3027
3017
|
export {
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3018
|
+
Oo as DATE_DROPDOWN_KEY,
|
3019
|
+
yn as LIST_DROPDOWN_KEY,
|
3020
|
+
Xn as UniverSheetsDataValidationMobileUIPlugin,
|
3021
|
+
Yn as UniverSheetsDataValidationUIPlugin
|
3032
3022
|
};
|