@univerjs/sheets-data-validation-ui 0.7.0-nightly.202505071607 → 0.7.0-nightly.202505101606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +26 -35
- package/lib/es/index.js +802 -813
- package/lib/index.css +1 -1
- package/lib/index.js +802 -813
- package/lib/umd/index.js +25 -34
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
@@ -1,73 +1,73 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var E = (e, t, r) =>
|
4
|
-
import { LocaleService as se, isFormulaString as De, DataValidationType as G, Tools as
|
5
|
-
import { DataValidationFormulaController as
|
6
|
-
import { jsxs as W, Fragment as
|
7
|
-
import { FormLayout as
|
8
|
-
import { useDependency as U, useSidebarClick as
|
9
|
-
import
|
10
|
-
import { FormulaEditor as
|
11
|
-
import { DataValidatorRegistryService as ye, DataValidationModel as
|
12
|
-
import { debounceTime as
|
13
|
-
import { DeviceInputEventType as
|
14
|
-
import { SheetInterceptorService as
|
15
|
-
import { getPatternType as
|
16
|
-
import { ISheetCellDropdownManagerService as
|
17
|
-
import { deserializeRangeWithSheet as
|
18
|
-
const
|
1
|
+
var Lr = Object.defineProperty;
|
2
|
+
var kr = (e, t, r) => t in e ? Lr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
3
|
+
var E = (e, t, r) => kr(e, typeof t != "symbol" ? t + "" : t, r);
|
4
|
+
import { LocaleService as se, isFormulaString as De, DataValidationType as G, Tools as Zt, Inject as b, Injector as we, Disposable as Re, UniverInstanceType as Y, toDisposable as Nr, IUniverInstanceService as le, DataValidationErrorStyle as lt, DataValidationStatus as je, ICommandService as J, IConfigService as dn, DataValidationRenderMode as ie, DisposableCollection as Ur, dayjs as Mn, numfmt as Yn, CellValueType as Fr, CommandType as nt, ObjectMatrix as Rt, Range as xr, Rectangle as yt, queryObjectMatrix as qt, Optional as $r, RxDisposable as un, InterceptorEffectEnum as Xn, sequenceExecute as zn, bufferDebounceTime as Br, debounce as Hr, UndoCommand as Wr, RedoCommand as jr, isUnitRangesEqual as Yr, shallowEqual as bn, ThemeService as Kn, ColorKit as Xr, VerticalAlign as ae, HorizontalAlign as Ye, DEFAULT_STYLES as re, WrapStrategy as Ie, DocumentDataModel as zr, BooleanNumber as rt, DEFAULT_EMPTY_DOCUMENT_VALUE as Kr, Plugin as Gn, merge as Zn } from "@univerjs/core";
|
5
|
+
import { DataValidationFormulaController as Gr, deserializeListOptions as Zr, serializeListOptions as qn, CUSTOM_FORMULA_INPUT_NAME as Jn, BASE_FORMULA_INPUT_NAME as At, LIST_FORMULA_INPUT_NAME as hn, CHECKBOX_FORMULA_INPUT_NAME as Qn, SheetDataValidationModel as ee, SheetsDataValidationValidatorService as qr, getDataValidationCellValue as Ut, getCellValueOrigin as Q, createDefaultNewRule as er, AddSheetDataValidationCommand as gn, DATA_VALIDATION_PLUGIN_NAME as tr, getDataValidationDiffMutations as Jt, UpdateSheetDataValidationRangeCommand as nr, DataValidationCacheService as rr, UpdateSheetDataValidationSettingCommand as En, UpdateSheetDataValidationOptionsCommand as Jr, RemoveSheetDataValidationCommand as ir, RemoveSheetAllDataValidationCommand as Qr, DataValidationFormulaService as ei, CHECKBOX_FORMULA_2 as ti, CHECKBOX_FORMULA_1 as ni, getFormulaResult as Ft, isLegalFormulaResult as Dn, transformCheckboxValue as ri } from "@univerjs/sheets-data-validation";
|
6
|
+
import { jsxs as W, Fragment as ct, jsx as _ } from "react/jsx-runtime";
|
7
|
+
import { FormLayout as j, Input as Ve, Checkbox as Lt, clsx as Xe, borderClassName as Mt, RadioGroup as pn, Radio as Oe, DraggableList as ii, Dropdown as oi, Button as ze, Select as Vn } from "@univerjs/design";
|
8
|
+
import { useDependency as U, useSidebarClick as or, useObservable as Te, useEvent as Qt, ISidebarService as ar, IDialogService as ai, IZenZoneService as sr, KeyCode as gt, MenuItemType as vn, getMenuHiddenObservable as si, RibbonStartGroup as li, IMenuManagerService as ci, ComponentManager as mn } from "@univerjs/ui";
|
9
|
+
import On, { useState as H, useRef as ht, forwardRef as Le, createElement as ke, useMemo as dt, useEffect as Pe } from "react";
|
10
|
+
import { FormulaEditor as lr, RangeSelector as di } from "@univerjs/sheets-formula-ui";
|
11
|
+
import { DataValidatorRegistryService as ye, DataValidationModel as fn, DataValidatorDropdownType as ge, DataValidatorRegistryScope as ui, TWO_FORMULA_OPERATOR_COUNT as hi, getRuleOptions as Tn, getRuleSetting as Pn } from "@univerjs/data-validation";
|
12
|
+
import { debounceTime as cr, filter as _n, BehaviorSubject as An, distinctUntilChanged as gi, Subject as pi, bufferTime as dr, of as vi } from "rxjs";
|
13
|
+
import { DeviceInputEventType as pt, IRenderManagerService as Ne, fixLineWidthByScale as Ln, Transform as mi, CheckboxShape as fi, getCurrentTypeOfRenderer as Ke, CURSOR_TYPE as Ge, FontCache as _i, Shape as Si, Rect as ur, getFontStyleString as xt, getDocsSkeletonPageSize as it, Documents as Ci, DocumentViewModel as Ii, DocumentSkeleton as wi } from "@univerjs/engine-render";
|
14
|
+
import { SheetInterceptorService as Sn, VALIDATE_CELL as Ri, SheetsSelectionsService as hr, SetRangeValuesCommand as st, getSheetCommandTarget as gr, rangeToDiscreteRange as yi, SheetPermissionCheckController as Mi, WorksheetEditPermission as en, WorksheetSetCellStylePermission as tn, RangeProtectionPermissionEditPoint as nn, WorkbookEditablePermission as rn, INTERCEPTOR_POINT as pr, InterceptCellContentPriority as vr, checkRangesEditablePermission as bi } from "@univerjs/sheets";
|
15
|
+
import { getPatternType as Ei } from "@univerjs/sheets-numfmt";
|
16
|
+
import { ISheetCellDropdownManagerService as Di, IEditorBridgeService as mr, SetCellEditVisibleOperation as vt, HoverManagerService as Vi, CellAlertManagerService as Oi, CellAlertType as Ti, IAutoFillService as Pi, APPLY_TYPE as ot, virtualizeDiscreteRanges as on, getAutoFillRepeatRange as Ai, ISheetClipboardService as Li, COPY_TYPE as kn, PREDEFINED_HOOK_NAME as mt, getRepeatRange as Nn, getCurrentRangeDisable$ as ki, AutoHeightController as fr, SheetSkeletonManagerService as bt, IMarkSelectionService as Ni } from "@univerjs/sheets-ui";
|
17
|
+
import { deserializeRangeWithSheet as Ui, serializeRange as _r } from "@univerjs/engine-formula";
|
18
|
+
const Fi = (e) => {
|
19
19
|
const { isTwoFormula: t = !1, value: r, onChange: n, showError: i, validResult: o } = e, a = U(se), l = i ? o == null ? void 0 : o.formula1 : "", s = i ? o == null ? void 0 : o.formula2 : "";
|
20
|
-
return t ? /* @__PURE__ */ W(
|
21
|
-
/* @__PURE__ */ _(
|
20
|
+
return t ? /* @__PURE__ */ W(ct, { children: [
|
21
|
+
/* @__PURE__ */ _(j, { error: l, children: /* @__PURE__ */ _(
|
22
22
|
Ve,
|
23
23
|
{
|
24
24
|
className: "univer-w-full",
|
25
25
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
26
26
|
value: r == null ? void 0 : r.formula1,
|
27
|
-
onChange: (
|
27
|
+
onChange: (c) => {
|
28
28
|
n == null || n({
|
29
29
|
...r,
|
30
|
-
formula1:
|
30
|
+
formula1: c
|
31
31
|
});
|
32
32
|
}
|
33
33
|
}
|
34
34
|
) }),
|
35
35
|
/* @__PURE__ */ _("div", { className: "-univer-mt-2 univer-mb-1 univer-text-sm univer-text-gray-400", children: a.t("dataValidation.panel.formulaAnd") }),
|
36
|
-
/* @__PURE__ */ _(
|
36
|
+
/* @__PURE__ */ _(j, { error: s, children: /* @__PURE__ */ _(
|
37
37
|
Ve,
|
38
38
|
{
|
39
39
|
className: "univer-w-full",
|
40
40
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
41
41
|
value: r == null ? void 0 : r.formula2,
|
42
|
-
onChange: (
|
42
|
+
onChange: (c) => {
|
43
43
|
n == null || n({
|
44
44
|
...r,
|
45
|
-
formula2:
|
45
|
+
formula2: c
|
46
46
|
});
|
47
47
|
}
|
48
48
|
}
|
49
49
|
) })
|
50
|
-
] }) : /* @__PURE__ */ _(
|
50
|
+
] }) : /* @__PURE__ */ _(j, { error: l, children: /* @__PURE__ */ _(
|
51
51
|
Ve,
|
52
52
|
{
|
53
53
|
className: "univer-w-full",
|
54
54
|
placeholder: a.t("dataValidation.panel.formulaPlaceholder"),
|
55
55
|
value: r == null ? void 0 : r.formula1,
|
56
|
-
onChange: (
|
57
|
-
n == null || n({ formula1:
|
56
|
+
onChange: (c) => {
|
57
|
+
n == null || n({ formula1: c });
|
58
58
|
}
|
59
59
|
}
|
60
60
|
) });
|
61
61
|
};
|
62
|
-
function
|
63
|
-
const { value: t, onChange: r, showError: n, validResult: i } = e, o = U(se), a = n ? i == null ? void 0 : i.formula1 : "", l = n ? i == null ? void 0 : i.formula2 : "", [s,
|
64
|
-
return /* @__PURE__ */ W(
|
65
|
-
/* @__PURE__ */ _(
|
66
|
-
|
62
|
+
function xi(e) {
|
63
|
+
const { value: t, onChange: r, showError: n, validResult: i } = e, o = U(se), a = n ? i == null ? void 0 : i.formula1 : "", l = n ? i == null ? void 0 : i.formula2 : "", [s, c] = H(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
64
|
+
return /* @__PURE__ */ W(ct, { children: [
|
65
|
+
/* @__PURE__ */ _(j, { children: /* @__PURE__ */ _(
|
66
|
+
Lt,
|
67
67
|
{
|
68
68
|
checked: s,
|
69
69
|
onChange: (u) => {
|
70
|
-
u ?
|
70
|
+
u ? c(!0) : (c(!1), r == null || r({
|
71
71
|
...t,
|
72
72
|
formula1: void 0,
|
73
73
|
formula2: void 0
|
@@ -76,7 +76,7 @@ function Fi(e) {
|
|
76
76
|
children: o.t("dataValidation.checkbox.tips")
|
77
77
|
}
|
78
78
|
) }),
|
79
|
-
s ? /* @__PURE__ */ _(
|
79
|
+
s ? /* @__PURE__ */ _(j, { label: o.t("dataValidation.checkbox.checked"), error: a, children: /* @__PURE__ */ _(
|
80
80
|
Ve,
|
81
81
|
{
|
82
82
|
className: "univer-w-full",
|
@@ -90,7 +90,7 @@ function Fi(e) {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
) }) : null,
|
93
|
-
s ? /* @__PURE__ */ _(
|
93
|
+
s ? /* @__PURE__ */ _(j, { label: o.t("dataValidation.checkbox.unchecked"), error: l, children: /* @__PURE__ */ _(
|
94
94
|
Ve,
|
95
95
|
{
|
96
96
|
className: "univer-w-full",
|
@@ -106,33 +106,31 @@ function Fi(e) {
|
|
106
106
|
) }) : null
|
107
107
|
] });
|
108
108
|
}
|
109
|
-
function
|
109
|
+
function $i(e) {
|
110
110
|
var h;
|
111
|
-
const { unitId: t, subUnitId: r, value: n, onChange: i, showError: o, validResult: a } = e, l = o ? a == null ? void 0 : a.formula1 : void 0, s =
|
112
|
-
return
|
111
|
+
const { unitId: t, subUnitId: r, value: n, onChange: i, showError: o, validResult: a } = e, l = o ? a == null ? void 0 : a.formula1 : void 0, s = ht(null), [c, u] = H(!1);
|
112
|
+
return or((d) => {
|
113
113
|
var g;
|
114
|
-
((g = s.current) == null ? void 0 : g.isClickOutSide(
|
115
|
-
}), /* @__PURE__ */ _(
|
116
|
-
|
114
|
+
((g = s.current) == null ? void 0 : g.isClickOutSide(d)) && u(!1);
|
115
|
+
}), /* @__PURE__ */ _(j, { error: l, children: /* @__PURE__ */ _(
|
116
|
+
lr,
|
117
117
|
{
|
118
118
|
ref: s,
|
119
|
-
className: `
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
`,
|
119
|
+
className: Xe(`
|
120
|
+
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg
|
121
|
+
univer-bg-white univer-pt-2 univer-transition-colors
|
122
|
+
[&>div:first-child]:univer-px-2.5
|
123
|
+
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
124
|
+
dark:univer-bg-gray-700 dark:univer-text-white
|
125
|
+
hover:univer-border-primary-600
|
126
|
+
`, Mt),
|
128
127
|
initValue: (h = n == null ? void 0 : n.formula1) != null ? h : "=",
|
129
128
|
unitId: t,
|
130
129
|
subUnitId: r,
|
131
|
-
isFocus:
|
132
|
-
errorText: l,
|
130
|
+
isFocus: c,
|
133
131
|
isSupportAcrossSheet: !0,
|
134
|
-
onChange: (
|
135
|
-
const m = (
|
132
|
+
onChange: (d) => {
|
133
|
+
const m = (d != null ? d : "").trim();
|
136
134
|
m !== (n == null ? void 0 : n.formula1) && (i == null || i({
|
137
135
|
...n,
|
138
136
|
formula1: m
|
@@ -140,7 +138,7 @@ function xi(e) {
|
|
140
138
|
},
|
141
139
|
onFocus: () => u(!0)
|
142
140
|
}
|
143
|
-
);
|
141
|
+
) });
|
144
142
|
}
|
145
143
|
var oe = function() {
|
146
144
|
return oe = Object.assign || function(e) {
|
@@ -150,7 +148,7 @@ var oe = function() {
|
|
150
148
|
}
|
151
149
|
return e;
|
152
150
|
}, oe.apply(this, arguments);
|
153
|
-
},
|
151
|
+
}, Bi = function(e, t) {
|
154
152
|
var r = {};
|
155
153
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
156
154
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
@@ -158,15 +156,15 @@ var oe = function() {
|
|
158
156
|
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
|
159
157
|
return r;
|
160
158
|
}, Ue = Le(function(e, t) {
|
161
|
-
var r = e.icon, n = e.id, i = e.className, o = e.extend, a =
|
162
|
-
return
|
159
|
+
var r = e.icon, n = e.id, i = e.className, o = e.extend, a = Bi(e, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), s = ht("_".concat(ji()));
|
160
|
+
return Sr(r, "".concat(n), { defIds: r.defIds, idSuffix: s.current }, oe({ ref: t, className: l }, a), o);
|
163
161
|
});
|
164
|
-
function
|
165
|
-
return ke(e.tag, oe(oe({ key: t },
|
166
|
-
return
|
162
|
+
function Sr(e, t, r, n, i) {
|
163
|
+
return ke(e.tag, oe(oe({ key: t }, Hi(e, r, i)), n), (Wi(e, r).children || []).map(function(o, a) {
|
164
|
+
return Sr(o, "".concat(t, "-").concat(e.tag, "-").concat(a), r, void 0, i);
|
167
165
|
}));
|
168
166
|
}
|
169
|
-
function
|
167
|
+
function Hi(e, t, r) {
|
170
168
|
var n = oe({}, e.attrs);
|
171
169
|
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(o) {
|
172
170
|
var a = o[0], l = o[1];
|
@@ -178,65 +176,65 @@ function Bi(e, t, r) {
|
|
178
176
|
typeof l == "string" && (n[a] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
179
177
|
})), n;
|
180
178
|
}
|
181
|
-
function
|
179
|
+
function Wi(e, t) {
|
182
180
|
var r, n = t.defIds;
|
183
181
|
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? oe(oe({}, e), { children: e.children.map(function(i) {
|
184
182
|
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? oe(oe({}, i), { attrs: oe(oe({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
|
185
183
|
}) }) : e;
|
186
184
|
}
|
187
|
-
function
|
185
|
+
function ji() {
|
188
186
|
return Math.random().toString(36).substring(2, 8);
|
189
187
|
}
|
190
188
|
Ue.displayName = "UniverIcon";
|
191
|
-
var
|
189
|
+
var Yi = { 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" } }] }, Cr = Le(function(e, t) {
|
192
190
|
return ke(Ue, Object.assign({}, e, {
|
193
191
|
id: "data-validation-single",
|
194
192
|
ref: t,
|
195
|
-
icon:
|
193
|
+
icon: Yi
|
196
194
|
}));
|
197
195
|
});
|
198
|
-
|
199
|
-
var
|
196
|
+
Cr.displayName = "DataValidationSingle";
|
197
|
+
var Xi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Cn = Le(function(e, t) {
|
200
198
|
return ke(Ue, Object.assign({}, e, {
|
201
199
|
id: "delete-single",
|
202
200
|
ref: t,
|
203
|
-
icon:
|
201
|
+
icon: Xi
|
204
202
|
}));
|
205
203
|
});
|
206
|
-
|
207
|
-
var
|
204
|
+
Cn.displayName = "DeleteSingle";
|
205
|
+
var zi = { 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" } }] }, Ir = Le(function(e, t) {
|
208
206
|
return ke(Ue, Object.assign({}, e, {
|
209
207
|
id: "increase-single",
|
210
208
|
ref: t,
|
211
|
-
icon:
|
209
|
+
icon: zi
|
212
210
|
}));
|
213
211
|
});
|
214
|
-
|
215
|
-
var
|
212
|
+
Ir.displayName = "IncreaseSingle";
|
213
|
+
var Ki = { 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" } }] }, In = Le(function(e, t) {
|
216
214
|
return ke(Ue, Object.assign({}, e, {
|
217
215
|
id: "more-down-single",
|
218
216
|
ref: t,
|
219
|
-
icon:
|
217
|
+
icon: Ki
|
220
218
|
}));
|
221
219
|
});
|
222
|
-
|
223
|
-
var
|
220
|
+
In.displayName = "MoreDownSingle";
|
221
|
+
var Gi = { 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" } }] }, wr = Le(function(e, t) {
|
224
222
|
return ke(Ue, Object.assign({}, e, {
|
225
223
|
id: "more-up-single",
|
226
224
|
ref: t,
|
227
|
-
icon:
|
225
|
+
icon: Gi
|
228
226
|
}));
|
229
227
|
});
|
230
|
-
|
231
|
-
var
|
228
|
+
wr.displayName = "MoreUpSingle";
|
229
|
+
var Zi = { 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" } }] }] }, Rr = Le(function(e, t) {
|
232
230
|
return ke(Ue, Object.assign({}, e, {
|
233
231
|
id: "sequence-single",
|
234
232
|
ref: t,
|
235
|
-
icon:
|
233
|
+
icon: Zi
|
236
234
|
}));
|
237
235
|
});
|
238
|
-
|
239
|
-
const He = "#ECECEC",
|
236
|
+
Rr.displayName = "SequenceSingle";
|
237
|
+
const He = "#ECECEC", qi = [
|
240
238
|
"#FFFFFF",
|
241
239
|
"#FEE7E7",
|
242
240
|
"#FEF0E6",
|
@@ -261,10 +259,10 @@ const He = "#ECECEC", Zi = [
|
|
261
259
|
"#3A60F7",
|
262
260
|
"#9E6DE3",
|
263
261
|
"#F248A6"
|
264
|
-
],
|
262
|
+
], Ji = (e) => {
|
265
263
|
const { value: t, onChange: r, disabled: n } = e, [i, o] = H(!1);
|
266
264
|
return /* @__PURE__ */ _(
|
267
|
-
|
265
|
+
oi,
|
268
266
|
{
|
269
267
|
align: "start",
|
270
268
|
disabled: n,
|
@@ -277,14 +275,11 @@ const He = "#ECECEC", Zi = [
|
|
277
275
|
univer-box-border univer-grid univer-w-fit univer-grid-cols-6 univer-flex-wrap univer-gap-2
|
278
276
|
univer-p-1.5
|
279
277
|
`,
|
280
|
-
children:
|
278
|
+
children: qi.map(
|
281
279
|
(a) => /* @__PURE__ */ _(
|
282
280
|
"div",
|
283
281
|
{
|
284
|
-
className:
|
285
|
-
univer-box-border univer-size-4 univer-cursor-pointer univer-rounded univer-border
|
286
|
-
univer-border-solid univer-border-gray-200
|
287
|
-
`,
|
282
|
+
className: Xe("univer-box-border univer-size-4 univer-cursor-pointer univer-rounded", Mt),
|
288
283
|
style: { background: a },
|
289
284
|
onClick: () => {
|
290
285
|
r(a), o(!1);
|
@@ -298,36 +293,33 @@ const He = "#ECECEC", Zi = [
|
|
298
293
|
children: /* @__PURE__ */ W(
|
299
294
|
"div",
|
300
295
|
{
|
301
|
-
className: `
|
296
|
+
className: Xe(`
|
302
297
|
univer-box-border univer-inline-flex univer-h-8 univer-w-16 univer-cursor-pointer univer-items-center
|
303
|
-
univer-justify-between univer-gap-2 univer-rounded-lg univer-
|
304
|
-
univer-
|
305
|
-
dark:univer-
|
298
|
+
univer-justify-between univer-gap-2 univer-rounded-lg univer-bg-white univer-px-2.5
|
299
|
+
univer-transition-colors univer-duration-200
|
300
|
+
dark:univer-bg-gray-700 dark:univer-text-white
|
306
301
|
hover:univer-border-primary-600
|
307
|
-
`,
|
302
|
+
`, Mt),
|
308
303
|
children: [
|
309
304
|
/* @__PURE__ */ _(
|
310
305
|
"div",
|
311
306
|
{
|
312
|
-
className:
|
313
|
-
univer-box-border univer-h-4 univer-w-4 univer-rounded univer-border univer-border-gray-200
|
314
|
-
univer-text-base
|
315
|
-
`,
|
307
|
+
className: "univer-box-border univer-h-4 univer-w-4 univer-rounded univer-text-base",
|
316
308
|
style: { background: t }
|
317
309
|
}
|
318
310
|
),
|
319
|
-
/* @__PURE__ */ _(
|
311
|
+
/* @__PURE__ */ _(In, {})
|
320
312
|
]
|
321
313
|
}
|
322
314
|
)
|
323
315
|
}
|
324
316
|
);
|
325
|
-
},
|
317
|
+
}, Un = (e) => {
|
326
318
|
const { item: t, commonProps: r, style: n } = e, { onItemChange: i, onItemDelete: o } = r;
|
327
319
|
return /* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-gap-2", style: n, children: [
|
328
|
-
t.isRef ? null : /* @__PURE__ */ _("div", { className:
|
320
|
+
t.isRef ? null : /* @__PURE__ */ _("div", { className: Xe("univer-cursor-move", "draggableHandle"), children: /* @__PURE__ */ _(Rr, {}) }),
|
329
321
|
/* @__PURE__ */ _(
|
330
|
-
|
322
|
+
Ji,
|
331
323
|
{
|
332
324
|
value: t.color,
|
333
325
|
onChange: (a) => {
|
@@ -352,14 +344,14 @@ const He = "#ECECEC", Zi = [
|
|
352
344
|
univer-ml-1 univer-cursor-pointer univer-rounded univer-text-base
|
353
345
|
hover:univer-bg-gray-200
|
354
346
|
`,
|
355
|
-
children: /* @__PURE__ */ _(
|
347
|
+
children: /* @__PURE__ */ _(Cn, { onClick: () => o(t.id) })
|
356
348
|
}
|
357
349
|
)
|
358
350
|
] });
|
359
351
|
};
|
360
|
-
function
|
352
|
+
function Qi(e) {
|
361
353
|
const { value: t, onChange: r = () => {
|
362
|
-
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2:
|
354
|
+
}, unitId: n, subUnitId: i, validResult: o, showError: a, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, [u, h] = H(() => De(s) ? "1" : "0"), [d, m] = H(u === "1" ? s : "="), [g, M] = H(u === "1" ? s : "="), y = U(se), p = U(ye), S = U(fn), v = U(Gr), [C, w] = H(() => c.split(",")), I = p.getValidatorItem(G.LIST), [R, T] = H([]), [N, D] = H(""), P = a ? o == null ? void 0 : o.formula1 : "", A = dt(() => S.ruleChange$.pipe(cr(16)), []), L = Te(A), V = Qt(r);
|
363
355
|
Pe(() => {
|
364
356
|
(async () => {
|
365
357
|
await new Promise((f) => {
|
@@ -372,41 +364,41 @@ function Ji(e) {
|
|
372
364
|
}
|
373
365
|
})();
|
374
366
|
}, [S, L, I, l, i, n]), Pe(() => {
|
375
|
-
De(s) && s !== g && (m(s),
|
367
|
+
De(s) && s !== g && (m(s), M(g));
|
376
368
|
}, [g, s]);
|
377
369
|
const [F, x] = H(() => {
|
378
|
-
const O = u !== "1" ?
|
370
|
+
const O = u !== "1" ? Zr(s) : [], B = c.split(",");
|
379
371
|
return O.map((f, k) => ({
|
380
372
|
label: f,
|
381
373
|
color: B[k] || He,
|
382
374
|
isRef: !1,
|
383
|
-
id:
|
375
|
+
id: Zt.generateRandomId(4)
|
384
376
|
}));
|
385
|
-
}),
|
377
|
+
}), X = (O, B, f) => {
|
386
378
|
const k = F.find(($) => $.id === O);
|
387
379
|
k && (k.label = B, k.color = f, x([...F]));
|
388
380
|
}, Z = (O) => {
|
389
381
|
const B = F.findIndex((f) => f.id === O);
|
390
382
|
B !== -1 && (F.splice(B, 1), x([...F]));
|
391
|
-
},
|
383
|
+
}, z = c.split(","), te = dt(() => R.map((O, B) => ({
|
392
384
|
label: O,
|
393
|
-
color:
|
385
|
+
color: z[B] || He,
|
394
386
|
id: `${B}`,
|
395
387
|
isRef: !0
|
396
|
-
})), [
|
388
|
+
})), [z, R]), pe = (O, B, f) => {
|
397
389
|
const k = [...C];
|
398
390
|
k[+O] = f, w(k), V({
|
399
391
|
formula1: s,
|
400
392
|
formula2: k.join(",")
|
401
393
|
});
|
402
|
-
},
|
394
|
+
}, ce = () => {
|
403
395
|
x([
|
404
396
|
...F,
|
405
397
|
{
|
406
398
|
label: "",
|
407
399
|
color: He,
|
408
400
|
isRef: !1,
|
409
|
-
id:
|
401
|
+
id: Zt.generateRandomId(4)
|
410
402
|
}
|
411
403
|
]);
|
412
404
|
};
|
@@ -425,32 +417,32 @@ function Ji(e) {
|
|
425
417
|
}));
|
426
418
|
});
|
427
419
|
}), V({
|
428
|
-
formula1:
|
420
|
+
formula1: qn(B.map((f) => f.label)),
|
429
421
|
formula2: B.map((f) => f.color === He ? "" : f.color).join(",")
|
430
422
|
});
|
431
423
|
}, [F, V, u, g, C]);
|
432
|
-
const ne =
|
424
|
+
const ne = Qt(async (O) => {
|
433
425
|
if (!De(O)) {
|
434
426
|
V == null || V({
|
435
427
|
formula1: "",
|
436
|
-
formula2:
|
428
|
+
formula2: c
|
437
429
|
});
|
438
430
|
return;
|
439
431
|
}
|
440
432
|
v.getFormulaRefCheck(O) ? (V == null || V({
|
441
433
|
formula1: De(O) ? O : "",
|
442
|
-
formula2:
|
434
|
+
formula2: c
|
443
435
|
}), D("")) : (V == null || V({
|
444
436
|
formula1: "",
|
445
|
-
formula2:
|
437
|
+
formula2: c
|
446
438
|
}), m("="), D(y.t("dataValidation.validFail.formulaError")));
|
447
|
-
}),
|
448
|
-
return
|
439
|
+
}), de = ht(null), [Se, ve] = H(!1);
|
440
|
+
return or((O) => {
|
449
441
|
var f;
|
450
|
-
((f =
|
451
|
-
}), /* @__PURE__ */ W(
|
452
|
-
/* @__PURE__ */ _(
|
453
|
-
|
442
|
+
((f = de.current) == null ? void 0 : f.isClickOutSide(O)) && ve(!1);
|
443
|
+
}), /* @__PURE__ */ W(ct, { children: [
|
444
|
+
/* @__PURE__ */ _(j, { label: y.t("dataValidation.list.options"), children: /* @__PURE__ */ W(
|
445
|
+
pn,
|
454
446
|
{
|
455
447
|
value: u,
|
456
448
|
onChange: (O) => {
|
@@ -465,35 +457,33 @@ function Ji(e) {
|
|
465
457
|
]
|
466
458
|
}
|
467
459
|
) }),
|
468
|
-
u === "1" ? /* @__PURE__ */ W(
|
460
|
+
u === "1" ? /* @__PURE__ */ W(j, { error: P || N || void 0, children: [
|
469
461
|
/* @__PURE__ */ _(
|
470
|
-
|
462
|
+
lr,
|
471
463
|
{
|
472
|
-
ref:
|
473
|
-
className: `
|
464
|
+
ref: de,
|
465
|
+
className: Xe(`
|
474
466
|
univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center
|
475
|
-
univer-rounded-lg univer-
|
476
|
-
univer-pt-2 univer-transition-colors
|
467
|
+
univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors
|
477
468
|
[&>div:first-child]:univer-px-2.5
|
478
469
|
[&>div]:univer-h-5 [&>div]:univer-ring-transparent
|
479
|
-
dark:univer-
|
470
|
+
dark:univer-bg-gray-700 dark:univer-text-white
|
480
471
|
hover:univer-border-primary-600
|
481
|
-
`,
|
482
|
-
initValue:
|
472
|
+
`, Mt),
|
473
|
+
initValue: d,
|
483
474
|
unitId: n,
|
484
475
|
subUnitId: i,
|
485
476
|
isFocus: Se,
|
486
|
-
errorText: P || N || void 0,
|
487
477
|
isSupportAcrossSheet: !0,
|
488
478
|
onFocus: () => ve(!0),
|
489
479
|
onChange: (O = "") => {
|
490
480
|
const B = (O != null ? O : "").trim();
|
491
|
-
|
481
|
+
M(B), ne(B);
|
492
482
|
}
|
493
483
|
}
|
494
484
|
),
|
495
485
|
te.length > 0 && /* @__PURE__ */ _("div", { style: { marginTop: "12px" }, children: te.map((O) => /* @__PURE__ */ _(
|
496
|
-
|
486
|
+
Un,
|
497
487
|
{
|
498
488
|
item: O,
|
499
489
|
commonProps: { onItemChange: pe },
|
@@ -501,9 +491,9 @@ function Ji(e) {
|
|
501
491
|
},
|
502
492
|
O.id
|
503
493
|
)) })
|
504
|
-
] }) : /* @__PURE__ */ _(
|
494
|
+
] }) : /* @__PURE__ */ _(j, { error: P, children: /* @__PURE__ */ W("div", { style: { marginTop: "-12px" }, children: [
|
505
495
|
/* @__PURE__ */ _(
|
506
|
-
|
496
|
+
ii,
|
507
497
|
{
|
508
498
|
list: F,
|
509
499
|
onListChange: x,
|
@@ -511,11 +501,11 @@ function Ji(e) {
|
|
511
501
|
margin: [0, 12],
|
512
502
|
draggableHandle: ".draggableHandle",
|
513
503
|
itemRender: (O) => /* @__PURE__ */ _(
|
514
|
-
|
504
|
+
Un,
|
515
505
|
{
|
516
506
|
item: O,
|
517
507
|
commonProps: {
|
518
|
-
onItemChange:
|
508
|
+
onItemChange: X,
|
519
509
|
onItemDelete: Z
|
520
510
|
}
|
521
511
|
},
|
@@ -532,9 +522,9 @@ function Ji(e) {
|
|
532
522
|
univer-rounded univer-p-1 univer-px-2 univer-text-sm univer-text-primary
|
533
523
|
hover:univer-bg-primary-600/5
|
534
524
|
`,
|
535
|
-
onClick:
|
525
|
+
onClick: ce,
|
536
526
|
children: [
|
537
|
-
/* @__PURE__ */ _(
|
527
|
+
/* @__PURE__ */ _(Ir, { className: "univer-mr-1" }),
|
538
528
|
y.t("dataValidation.list.add")
|
539
529
|
]
|
540
530
|
}
|
@@ -542,61 +532,61 @@ function Ji(e) {
|
|
542
532
|
] }) })
|
543
533
|
] });
|
544
534
|
}
|
545
|
-
const
|
535
|
+
const eo = [
|
546
536
|
[
|
547
|
-
|
548
|
-
|
537
|
+
Jn,
|
538
|
+
$i
|
549
539
|
],
|
550
540
|
[
|
551
|
-
|
552
|
-
|
541
|
+
At,
|
542
|
+
Fi
|
553
543
|
],
|
554
544
|
[
|
555
|
-
|
556
|
-
|
545
|
+
hn,
|
546
|
+
Qi
|
557
547
|
],
|
558
548
|
[
|
559
|
-
|
560
|
-
|
549
|
+
Qn,
|
550
|
+
xi
|
561
551
|
]
|
562
552
|
];
|
563
|
-
var
|
564
|
-
for (var i = n > 1 ? void 0 : n ?
|
553
|
+
var to = Object.getOwnPropertyDescriptor, no = (e, t, r, n) => {
|
554
|
+
for (var i = n > 1 ? void 0 : n ? to(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
565
555
|
(a = e[o]) && (i = a(i) || i);
|
566
556
|
return i;
|
567
|
-
},
|
557
|
+
}, ro = (e, t) => (r, n) => t(r, n, e);
|
568
558
|
let fe = class {
|
569
559
|
constructor(e) {
|
570
560
|
E(this, "canvasRender", null);
|
571
561
|
E(this, "dropdownType");
|
572
562
|
E(this, "optionsInput");
|
573
|
-
E(this, "formulaInput",
|
563
|
+
E(this, "formulaInput", hn);
|
574
564
|
this.injector = e;
|
575
565
|
}
|
576
566
|
};
|
577
|
-
fe =
|
578
|
-
|
567
|
+
fe = no([
|
568
|
+
ro(0, b(we))
|
579
569
|
], fe);
|
580
|
-
var
|
581
|
-
for (var i = n > 1 ? void 0 : n ?
|
570
|
+
var io = Object.getOwnPropertyDescriptor, oo = (e, t, r, n) => {
|
571
|
+
for (var i = n > 1 ? void 0 : n ? io(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
582
572
|
(a = e[o]) && (i = a(i) || i);
|
583
573
|
return i;
|
584
|
-
},
|
574
|
+
}, Fn = (e, t) => (r, n) => t(r, n, e);
|
585
575
|
let _e = class extends Re {
|
586
576
|
constructor(t, r) {
|
587
577
|
super();
|
588
|
-
E(this, "_open$", new
|
589
|
-
E(this, "open$", this._open$.pipe(
|
578
|
+
E(this, "_open$", new An(!1));
|
579
|
+
E(this, "open$", this._open$.pipe(gi()));
|
590
580
|
E(this, "_activeRule");
|
591
|
-
E(this, "_activeRule$", new
|
581
|
+
E(this, "_activeRule$", new An(void 0));
|
592
582
|
E(this, "activeRule$", this._activeRule$.asObservable());
|
593
583
|
E(this, "_closeDisposable", null);
|
594
584
|
this._univerInstanceService = t, this._sidebarService = r, this.disposeWithMe(
|
595
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
585
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(_n((n) => !n)).subscribe(() => {
|
596
586
|
this.close();
|
597
587
|
})
|
598
588
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
599
|
-
n.id ===
|
589
|
+
n.id === Dt && (n.visible || setTimeout(() => {
|
600
590
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
601
591
|
}));
|
602
592
|
}));
|
@@ -619,7 +609,7 @@ let _e = class extends Re {
|
|
619
609
|
this._open$.next(!1), (t = this._closeDisposable) == null || t.dispose();
|
620
610
|
}
|
621
611
|
setCloseDisposable(t) {
|
622
|
-
this._closeDisposable =
|
612
|
+
this._closeDisposable = Nr(() => {
|
623
613
|
t.dispose(), this._closeDisposable = null;
|
624
614
|
});
|
625
615
|
}
|
@@ -627,13 +617,13 @@ let _e = class extends Re {
|
|
627
617
|
this._activeRule = t, this._activeRule$.next(t);
|
628
618
|
}
|
629
619
|
};
|
630
|
-
_e =
|
631
|
-
|
632
|
-
|
620
|
+
_e = oo([
|
621
|
+
Fn(0, le),
|
622
|
+
Fn(1, ar)
|
633
623
|
], _e);
|
634
|
-
const
|
635
|
-
var
|
636
|
-
for (var i = n > 1 ? void 0 : n ?
|
624
|
+
const wn = "sheets-data-validation-ui.config", Et = {};
|
625
|
+
var ao = Object.getOwnPropertyDescriptor, so = (e, t, r, n) => {
|
626
|
+
for (var i = n > 1 ? void 0 : n ? ao(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
637
627
|
(a = e[o]) && (i = a(i) || i);
|
638
628
|
return i;
|
639
629
|
}, xe = (e, t) => (r, n) => t(r, n, e);
|
@@ -643,15 +633,15 @@ let Ze = class extends Re {
|
|
643
633
|
}
|
644
634
|
_initEditorBridgeInterceptor() {
|
645
635
|
this._sheetInterceptorService.writeCellInterceptor.intercept(
|
646
|
-
|
636
|
+
Ri,
|
647
637
|
{
|
648
638
|
handler: async (e, t, r) => {
|
649
|
-
const n = await e, { row: i, col: o, unitId: a, subUnitId: l } = t, s = this._dataValidationModel.getRuleIdByLocation(a, l, i, o),
|
639
|
+
const n = await e, { row: i, col: o, unitId: a, subUnitId: l } = t, s = this._dataValidationModel.getRuleIdByLocation(a, l, i, o), c = s ? this._dataValidationModel.getRuleById(a, l, s) : void 0;
|
650
640
|
if (n === !1)
|
651
641
|
return r(Promise.resolve(!1));
|
652
|
-
if (!
|
642
|
+
if (!c || c.errorStyle !== lt.STOP)
|
653
643
|
return r(Promise.resolve(!0));
|
654
|
-
const u = this._dataValidatorRegistryService.getValidatorItem(
|
644
|
+
const u = this._dataValidatorRegistryService.getValidatorItem(c.type);
|
655
645
|
return !u || await this._sheetsDataValidationValidatorService.validatorCell(a, l, i, o) === je.VALID ? r(Promise.resolve(!0)) : (this._dialogService.open({
|
656
646
|
width: 368,
|
657
647
|
title: {
|
@@ -659,10 +649,10 @@ let Ze = class extends Re {
|
|
659
649
|
},
|
660
650
|
id: "reject-input-dialog",
|
661
651
|
children: {
|
662
|
-
title: u.getRuleFinalError(
|
652
|
+
title: u.getRuleFinalError(c, { row: i, col: o, unitId: a, subUnitId: l })
|
663
653
|
},
|
664
654
|
footer: {
|
665
|
-
title:
|
655
|
+
title: On.createElement(
|
666
656
|
ze,
|
667
657
|
{
|
668
658
|
variant: "primary",
|
@@ -690,7 +680,7 @@ let Ze = class extends Re {
|
|
690
680
|
title: e
|
691
681
|
},
|
692
682
|
footer: {
|
693
|
-
title:
|
683
|
+
title: On.createElement(
|
694
684
|
ze,
|
695
685
|
{
|
696
686
|
variant: "primary",
|
@@ -705,30 +695,30 @@ let Ze = class extends Re {
|
|
705
695
|
});
|
706
696
|
}
|
707
697
|
};
|
708
|
-
Ze =
|
709
|
-
xe(0,
|
710
|
-
xe(1,
|
711
|
-
xe(2,
|
712
|
-
xe(3,
|
713
|
-
xe(4,
|
714
|
-
xe(5,
|
698
|
+
Ze = so([
|
699
|
+
xe(0, b(Sn)),
|
700
|
+
xe(1, b(ee)),
|
701
|
+
xe(2, b(ye)),
|
702
|
+
xe(3, ai),
|
703
|
+
xe(4, b(se)),
|
704
|
+
xe(5, b(qr))
|
715
705
|
], Ze);
|
716
|
-
var
|
717
|
-
for (var i = n > 1 ? void 0 : n ?
|
706
|
+
var lo = Object.getOwnPropertyDescriptor, co = (e, t, r, n) => {
|
707
|
+
for (var i = n > 1 ? void 0 : n ? lo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
718
708
|
(a = e[o]) && (i = a(i) || i);
|
719
709
|
return i;
|
720
710
|
}, ue = (e, t) => (r, n) => t(r, n, e);
|
721
|
-
const
|
711
|
+
const $t = (e) => {
|
722
712
|
if (e == null || typeof e == "boolean")
|
723
713
|
return;
|
724
714
|
if (typeof e == "number" || !Number.isNaN(+e))
|
725
|
-
return
|
726
|
-
const t =
|
715
|
+
return Mn(Yn.format("yyyy-MM-dd HH:mm:ss", Number(e)));
|
716
|
+
const t = Mn(e);
|
727
717
|
if (t.isValid())
|
728
718
|
return t;
|
729
719
|
};
|
730
|
-
function
|
731
|
-
const r =
|
720
|
+
function uo(e, t) {
|
721
|
+
const r = Ei(t);
|
732
722
|
if (e === r)
|
733
723
|
return t;
|
734
724
|
switch (e) {
|
@@ -741,14 +731,14 @@ function co(e, t) {
|
|
741
731
|
}
|
742
732
|
}
|
743
733
|
let Ae = class extends Re {
|
744
|
-
constructor(t, r, n, i, o, a, l, s,
|
734
|
+
constructor(t, r, n, i, o, a, l, s, c, u, h) {
|
745
735
|
super();
|
746
736
|
E(this, "_activeDropdown");
|
747
|
-
E(this, "_activeDropdown$", new
|
737
|
+
E(this, "_activeDropdown$", new pi());
|
748
738
|
E(this, "_currentPopup", null);
|
749
739
|
E(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
750
740
|
E(this, "_zenVisible", !1);
|
751
|
-
this._univerInstanceService = t, this._dataValidatorRegistryService = r, this._zenZoneService = n, this._dataValidationModel = i, this._sheetsSelectionsService = o, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService =
|
741
|
+
this._univerInstanceService = t, this._dataValidatorRegistryService = r, this._zenZoneService = n, this._dataValidationModel = i, this._sheetsSelectionsService = o, this._cellDropdownManagerService = a, this._sheetDataValidationModel = l, this._commandService = s, this._editorBridgeService = c, this._injector = u, this._configService = h, this._init(), this._initSelectionChange(), this.disposeWithMe(() => {
|
752
742
|
this._activeDropdown$.complete();
|
753
743
|
});
|
754
744
|
}
|
@@ -761,7 +751,7 @@ let Ae = class extends Re {
|
|
761
751
|
}));
|
762
752
|
}
|
763
753
|
_getDropdownByCell(t, r, n, i) {
|
764
|
-
const o = t ? this._univerInstanceService.getUnit(t,
|
754
|
+
const o = t ? this._univerInstanceService.getUnit(t, Y.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(Y.UNIVER_SHEET);
|
765
755
|
if (!o)
|
766
756
|
return;
|
767
757
|
const a = r ? o.getSheetBySheetId(r) : o.getActiveSheet();
|
@@ -780,24 +770,24 @@ let Ae = class extends Re {
|
|
780
770
|
}
|
781
771
|
// eslint-disable-next-line max-lines-per-function, complexity
|
782
772
|
showDropdown(t) {
|
783
|
-
var
|
773
|
+
var M, y, p, S;
|
784
774
|
const { location: r } = t, { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = r;
|
785
775
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
786
776
|
return;
|
787
777
|
this._activeDropdown = t, this._activeDropdown$.next(this._activeDropdown);
|
788
|
-
const
|
789
|
-
if (!
|
778
|
+
const c = this._sheetDataValidationModel.getRuleByLocation(o, a, n, i);
|
779
|
+
if (!c)
|
790
780
|
return;
|
791
|
-
const u = this._dataValidatorRegistryService.getValidatorItem(
|
781
|
+
const u = this._dataValidatorRegistryService.getValidatorItem(c.type);
|
792
782
|
if (!(u != null && u.dropdownType))
|
793
783
|
return;
|
794
784
|
let h;
|
795
|
-
const
|
785
|
+
const d = async (v, C) => {
|
796
786
|
var A, L, V;
|
797
787
|
if (!v)
|
798
788
|
return !0;
|
799
|
-
const w = v, I = s.getCell(n, i), R = w.format(C === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), T = (A =
|
800
|
-
return
|
789
|
+
const w = v, I = s.getCell(n, i), R = w.format(C === "date" ? "YYYY-MM-DD 00:00:00" : "YYYY-MM-DD HH:mm:ss"), T = (A = Yn.parseDate(R)) == null ? void 0 : A.v, N = C === "time" ? T % 1 : T, D = l.getStyles().getStyleByCell(I), P = (V = (L = D == null ? void 0 : D.n) == null ? void 0 : L.pattern) != null ? V : "";
|
790
|
+
return c.errorStyle !== lt.STOP || await u.validator({
|
801
791
|
value: N,
|
802
792
|
unitId: o,
|
803
793
|
subUnitId: a,
|
@@ -806,12 +796,12 @@ let Ae = class extends Re {
|
|
806
796
|
worksheet: s,
|
807
797
|
workbook: l,
|
808
798
|
interceptValue: R.replace("Z", "").replace("T", " "),
|
809
|
-
t:
|
810
|
-
},
|
799
|
+
t: Fr.NUMBER
|
800
|
+
}, c) ? (await this._commandService.executeCommand(vt.id, {
|
811
801
|
visible: !1,
|
812
|
-
eventType:
|
802
|
+
eventType: pt.Keyboard,
|
813
803
|
unitId: o,
|
814
|
-
keycode:
|
804
|
+
keycode: gt.ESC
|
815
805
|
}), await this._commandService.executeCommand(st.id, {
|
816
806
|
unitId: o,
|
817
807
|
subUnitId: a,
|
@@ -829,22 +819,22 @@ let Ae = class extends Re {
|
|
829
819
|
si: null,
|
830
820
|
s: {
|
831
821
|
n: {
|
832
|
-
pattern:
|
822
|
+
pattern: uo(C, P)
|
833
823
|
}
|
834
824
|
}
|
835
825
|
}
|
836
|
-
}), !0) : (this._injector.has(Ze) && this._injector.get(Ze).showReject(u.getRuleFinalError(
|
826
|
+
}), !0) : (this._injector.has(Ze) && this._injector.get(Ze).showReject(u.getRuleFinalError(c, { row: n, col: i, unitId: o, subUnitId: a })), !1);
|
837
827
|
};
|
838
828
|
let m;
|
839
829
|
switch (u.dropdownType) {
|
840
830
|
case ge.DATE: {
|
841
|
-
const v = Q(s.getCellRaw(n, i)), C =
|
831
|
+
const v = Q(s.getCellRaw(n, i)), C = $t(v), w = !!((M = c.bizInfo) != null && M.showTime);
|
842
832
|
m = {
|
843
833
|
location: r,
|
844
834
|
type: "datepicker",
|
845
835
|
props: {
|
846
836
|
showTime: w,
|
847
|
-
onChange: (I) =>
|
837
|
+
onChange: (I) => d(I, w ? "datetime" : "date"),
|
848
838
|
defaultValue: C,
|
849
839
|
patternType: "date"
|
850
840
|
}
|
@@ -852,12 +842,12 @@ let Ae = class extends Re {
|
|
852
842
|
break;
|
853
843
|
}
|
854
844
|
case ge.TIME: {
|
855
|
-
const v = Q(s.getCellRaw(n, i)), C =
|
845
|
+
const v = Q(s.getCellRaw(n, i)), C = $t(v);
|
856
846
|
m = {
|
857
847
|
location: r,
|
858
848
|
type: "datepicker",
|
859
849
|
props: {
|
860
|
-
onChange: (w) =>
|
850
|
+
onChange: (w) => d(w, "time"),
|
861
851
|
defaultValue: C,
|
862
852
|
patternType: "time"
|
863
853
|
}
|
@@ -865,12 +855,12 @@ let Ae = class extends Re {
|
|
865
855
|
break;
|
866
856
|
}
|
867
857
|
case ge.DATETIME: {
|
868
|
-
const v = Q(s.getCellRaw(n, i)), C =
|
858
|
+
const v = Q(s.getCellRaw(n, i)), C = $t(v);
|
869
859
|
m = {
|
870
860
|
location: r,
|
871
861
|
type: "datepicker",
|
872
862
|
props: {
|
873
|
-
onChange: (w) =>
|
863
|
+
onChange: (w) => d(w, "datetime"),
|
874
864
|
defaultValue: C,
|
875
865
|
patternType: "datetime"
|
876
866
|
}
|
@@ -880,7 +870,7 @@ let Ae = class extends Re {
|
|
880
870
|
case ge.LIST:
|
881
871
|
case ge.MULTIPLE_LIST: {
|
882
872
|
const v = u.dropdownType === ge.MULTIPLE_LIST, C = async (D) => {
|
883
|
-
const P =
|
873
|
+
const P = qn(D), A = {
|
884
874
|
unitId: o,
|
885
875
|
subUnitId: a,
|
886
876
|
range: {
|
@@ -896,15 +886,15 @@ let Ae = class extends Re {
|
|
896
886
|
si: null
|
897
887
|
}
|
898
888
|
};
|
899
|
-
return this._editorBridgeService.isVisible().visible && await this._commandService.executeCommand(
|
889
|
+
return this._editorBridgeService.isVisible().visible && await this._commandService.executeCommand(vt.id, {
|
900
890
|
visible: !1,
|
901
|
-
eventType:
|
891
|
+
eventType: pt.Keyboard,
|
902
892
|
unitId: o,
|
903
|
-
keycode:
|
893
|
+
keycode: gt.ESC
|
904
894
|
}), this._commandService.executeCommand(st.id, A), !v;
|
905
|
-
}, w = (
|
895
|
+
}, w = (c == null ? void 0 : c.renderMode) === ie.CUSTOM || (c == null ? void 0 : c.renderMode) === void 0, I = u.getListWithColor(c, o, a), R = Ut(s.getCellRaw(n, i)), T = () => {
|
906
896
|
this._commandService.executeCommand(Fe.id, {
|
907
|
-
ruleId:
|
897
|
+
ruleId: c.uid
|
908
898
|
}), h == null || h.dispose();
|
909
899
|
}, N = I.map((D) => ({
|
910
900
|
label: D.label,
|
@@ -920,7 +910,7 @@ let Ae = class extends Re {
|
|
920
910
|
onEdit: T,
|
921
911
|
defaultValue: R,
|
922
912
|
multiple: v,
|
923
|
-
showEdit: (p = (y = this._configService.getConfig(
|
913
|
+
showEdit: (p = (y = this._configService.getConfig(wn)) == null ? void 0 : y.showEditOnDropdown) != null ? p : !0
|
924
914
|
}
|
925
915
|
};
|
926
916
|
break;
|
@@ -946,15 +936,15 @@ let Ae = class extends Re {
|
|
946
936
|
si: null
|
947
937
|
}
|
948
938
|
};
|
949
|
-
return this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(
|
939
|
+
return this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(vt.id, {
|
950
940
|
visible: !1,
|
951
|
-
eventType:
|
941
|
+
eventType: pt.Keyboard,
|
952
942
|
unitId: o,
|
953
|
-
keycode:
|
943
|
+
keycode: gt.ESC
|
954
944
|
}), this._commandService.syncExecuteCommand(st.id, w), !0;
|
955
945
|
},
|
956
|
-
defaultValue:
|
957
|
-
options: JSON.parse((S =
|
946
|
+
defaultValue: Ut(s.getCellRaw(n, i)).split("/"),
|
947
|
+
options: JSON.parse((S = c.formula1) != null ? S : "[]")
|
958
948
|
},
|
959
949
|
location: r
|
960
950
|
};
|
@@ -981,14 +971,14 @@ let Ae = class extends Re {
|
|
981
971
|
si: null
|
982
972
|
}
|
983
973
|
};
|
984
|
-
return this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(
|
974
|
+
return this._editorBridgeService.isVisible().visible && this._commandService.syncExecuteCommand(vt.id, {
|
985
975
|
visible: !1,
|
986
|
-
eventType:
|
976
|
+
eventType: pt.Keyboard,
|
987
977
|
unitId: o,
|
988
|
-
keycode:
|
978
|
+
keycode: gt.ESC
|
989
979
|
}), this._commandService.syncExecuteCommand(st.id, w), !0;
|
990
980
|
},
|
991
|
-
defaultValue:
|
981
|
+
defaultValue: Ut(s.getCellRaw(n, i))
|
992
982
|
},
|
993
983
|
location: r
|
994
984
|
};
|
@@ -999,7 +989,7 @@ let Ae = class extends Re {
|
|
999
989
|
}
|
1000
990
|
if (h = this._cellDropdownManagerService.showDropdown(m), !h)
|
1001
991
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
1002
|
-
const g = new
|
992
|
+
const g = new Ur();
|
1003
993
|
g.add(h), g.add({
|
1004
994
|
dispose: () => {
|
1005
995
|
var v, C;
|
@@ -1011,7 +1001,7 @@ let Ae = class extends Re {
|
|
1011
1001
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
1012
1002
|
}
|
1013
1003
|
showDataValidationDropdown(t, r, n, i, o) {
|
1014
|
-
const a = this._univerInstanceService.getUnit(t,
|
1004
|
+
const a = this._univerInstanceService.getUnit(t, Y.UNIVER_SHEET);
|
1015
1005
|
if (!a)
|
1016
1006
|
return;
|
1017
1007
|
const l = a.getSheetBySheetId(r);
|
@@ -1020,8 +1010,8 @@ let Ae = class extends Re {
|
|
1020
1010
|
const s = this._dataValidationModel.getRuleByLocation(a.getUnitId(), l.getSheetId(), n, i);
|
1021
1011
|
if (!s)
|
1022
1012
|
return;
|
1023
|
-
const
|
1024
|
-
if (!
|
1013
|
+
const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
|
1014
|
+
if (!c || !c.dropdownType) {
|
1025
1015
|
this.hideDropdown();
|
1026
1016
|
return;
|
1027
1017
|
}
|
@@ -1038,56 +1028,56 @@ let Ae = class extends Re {
|
|
1038
1028
|
});
|
1039
1029
|
}
|
1040
1030
|
};
|
1041
|
-
Ae =
|
1031
|
+
Ae = co([
|
1042
1032
|
ue(0, le),
|
1043
|
-
ue(1,
|
1044
|
-
ue(2,
|
1045
|
-
ue(3,
|
1046
|
-
ue(4,
|
1047
|
-
ue(5,
|
1048
|
-
ue(6,
|
1033
|
+
ue(1, b(ye)),
|
1034
|
+
ue(2, sr),
|
1035
|
+
ue(3, b(ee)),
|
1036
|
+
ue(4, b(hr)),
|
1037
|
+
ue(5, b(Di)),
|
1038
|
+
ue(6, b(ee)),
|
1049
1039
|
ue(7, J),
|
1050
|
-
ue(8,
|
1051
|
-
ue(9,
|
1052
|
-
ue(10,
|
1040
|
+
ue(8, mr),
|
1041
|
+
ue(9, b(we)),
|
1042
|
+
ue(10, dn)
|
1053
1043
|
], Ae);
|
1054
|
-
const
|
1044
|
+
const Dt = "DataValidationPanel", Fe = {
|
1055
1045
|
id: "data-validation.operation.open-validation-panel",
|
1056
1046
|
type: nt.OPERATION,
|
1057
1047
|
handler(e, t) {
|
1058
1048
|
if (!t)
|
1059
1049
|
return !1;
|
1060
|
-
const { ruleId: r, isAdd: n } = t, i = e.get(_e), o = e.get(
|
1050
|
+
const { ruleId: r, isAdd: n } = t, i = e.get(_e), o = e.get(fn), a = e.get(le), l = e.get(ar), s = gr(a);
|
1061
1051
|
if (!s) return !1;
|
1062
|
-
const { unitId:
|
1052
|
+
const { unitId: c, subUnitId: u } = s, h = r ? o.getRuleById(c, u, r) : void 0;
|
1063
1053
|
i.open(), i.setActiveRule(h && {
|
1064
|
-
unitId:
|
1054
|
+
unitId: c,
|
1065
1055
|
subUnitId: u,
|
1066
1056
|
rule: h
|
1067
1057
|
});
|
1068
|
-
const
|
1069
|
-
id:
|
1058
|
+
const d = l.open({
|
1059
|
+
id: Dt,
|
1070
1060
|
header: { title: n ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
1071
|
-
children: { label:
|
1061
|
+
children: { label: Dt },
|
1072
1062
|
width: 312,
|
1073
1063
|
onClose: () => i.close()
|
1074
1064
|
});
|
1075
|
-
return i.setCloseDisposable(
|
1065
|
+
return i.setCloseDisposable(d), !0;
|
1076
1066
|
}
|
1077
|
-
},
|
1067
|
+
}, Rn = {
|
1078
1068
|
id: "data-validation.operation.close-validation-panel",
|
1079
1069
|
type: nt.OPERATION,
|
1080
1070
|
handler(e) {
|
1081
1071
|
return e.get(_e).close(), !0;
|
1082
1072
|
}
|
1083
|
-
},
|
1073
|
+
}, yr = {
|
1084
1074
|
id: "data-validation.operation.toggle-validation-panel",
|
1085
1075
|
type: nt.OPERATION,
|
1086
1076
|
handler(e) {
|
1087
1077
|
const t = e.get(J), r = e.get(_e);
|
1088
|
-
return r.open(), r.isOpen ? t.executeCommand(
|
1078
|
+
return r.open(), r.isOpen ? t.executeCommand(Rn.id) : t.executeCommand(Fe.id), !0;
|
1089
1079
|
}
|
1090
|
-
},
|
1080
|
+
}, kt = {
|
1091
1081
|
type: nt.OPERATION,
|
1092
1082
|
id: "sheet.operation.show-data-validation-dropdown",
|
1093
1083
|
handler(e, t) {
|
@@ -1101,36 +1091,36 @@ const Mt = "DataValidationPanel", Fe = {
|
|
1101
1091
|
a
|
1102
1092
|
), !0;
|
1103
1093
|
}
|
1104
|
-
},
|
1094
|
+
}, Mr = {
|
1105
1095
|
type: nt.OPERATION,
|
1106
1096
|
id: "sheet.operation.hide-data-validation-dropdown",
|
1107
1097
|
handler(e, t) {
|
1108
1098
|
return t ? (e.get(Ae).hideDropdown(), !0) : !1;
|
1109
1099
|
}
|
1110
|
-
},
|
1100
|
+
}, Nt = {
|
1111
1101
|
type: nt.COMMAND,
|
1112
1102
|
id: "data-validation.command.addRuleAndOpen",
|
1113
1103
|
handler(e) {
|
1114
|
-
const t = e.get(le), r =
|
1104
|
+
const t = e.get(le), r = gr(t);
|
1115
1105
|
if (!r) return !1;
|
1116
|
-
const { workbook: n, worksheet: i } = r, o =
|
1106
|
+
const { workbook: n, worksheet: i } = r, o = er(e), a = e.get(J), l = n.getUnitId(), s = i.getSheetId(), c = {
|
1117
1107
|
rule: o,
|
1118
1108
|
unitId: l,
|
1119
1109
|
subUnitId: s
|
1120
1110
|
};
|
1121
|
-
return a.syncExecuteCommand(
|
1111
|
+
return a.syncExecuteCommand(gn.id, c) ? (a.syncExecuteCommand(Fe.id, {
|
1122
1112
|
ruleId: o.uid,
|
1123
1113
|
isAdd: !0
|
1124
1114
|
}), !0) : !1;
|
1125
1115
|
}
|
1126
1116
|
};
|
1127
|
-
var
|
1128
|
-
for (var i = n > 1 ? void 0 : n ?
|
1117
|
+
var ho = Object.getOwnPropertyDescriptor, go = (e, t, r, n) => {
|
1118
|
+
for (var i = n > 1 ? void 0 : n ? ho(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1129
1119
|
(a = e[o]) && (i = a(i) || i);
|
1130
1120
|
return i;
|
1131
1121
|
}, $e = (e, t) => (r, n) => t(r, n, e);
|
1132
|
-
const
|
1133
|
-
let
|
1122
|
+
const Me = "SHEET_DATA_VALIDATION_ALERT";
|
1123
|
+
let ut = class extends Re {
|
1134
1124
|
constructor(e, t, r, n, i, o) {
|
1135
1125
|
super(), this._hoverManagerService = e, this._cellAlertManagerService = t, this._univerInstanceService = r, this._localeService = n, this._zenZoneService = i, this._dataValidationModel = o, this._init();
|
1136
1126
|
}
|
@@ -1138,61 +1128,61 @@ let ct = class extends Re {
|
|
1138
1128
|
this._initCellAlertPopup(), this._initZenService();
|
1139
1129
|
}
|
1140
1130
|
_initCellAlertPopup() {
|
1141
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1131
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(cr(100)).subscribe((e) => {
|
1142
1132
|
var t;
|
1143
1133
|
if (e) {
|
1144
|
-
const r = this._univerInstanceService.getUnit(e.location.unitId,
|
1134
|
+
const r = this._univerInstanceService.getUnit(e.location.unitId, Y.UNIVER_SHEET), n = r.getSheetBySheetId(e.location.subUnitId);
|
1145
1135
|
if (!n) return;
|
1146
1136
|
const i = this._dataValidationModel.getRuleByLocation(e.location.unitId, e.location.subUnitId, e.location.row, e.location.col);
|
1147
1137
|
if (!i) {
|
1148
|
-
this._cellAlertManagerService.removeAlert(
|
1138
|
+
this._cellAlertManagerService.removeAlert(Me);
|
1149
1139
|
return;
|
1150
1140
|
}
|
1151
1141
|
if (this._dataValidationModel.validator(i, { ...e.location, workbook: r, worksheet: n }) === je.INVALID) {
|
1152
|
-
const a = this._cellAlertManagerService.currentAlert.get(
|
1142
|
+
const a = this._cellAlertManagerService.currentAlert.get(Me), l = (t = a == null ? void 0 : a.alert) == null ? void 0 : t.location;
|
1153
1143
|
if (l && l.row === e.location.row && l.col === e.location.col && l.subUnitId === e.location.subUnitId && l.unitId === e.location.unitId) {
|
1154
|
-
this._cellAlertManagerService.removeAlert(
|
1144
|
+
this._cellAlertManagerService.removeAlert(Me);
|
1155
1145
|
return;
|
1156
1146
|
}
|
1157
1147
|
const s = this._dataValidationModel.getValidator(i.type);
|
1158
1148
|
if (!s) {
|
1159
|
-
this._cellAlertManagerService.removeAlert(
|
1149
|
+
this._cellAlertManagerService.removeAlert(Me);
|
1160
1150
|
return;
|
1161
1151
|
}
|
1162
1152
|
this._cellAlertManagerService.showAlert({
|
1163
|
-
type:
|
1153
|
+
type: Ti.ERROR,
|
1164
1154
|
title: this._localeService.t("dataValidation.error.title"),
|
1165
1155
|
message: s == null ? void 0 : s.getRuleFinalError(i, e.location),
|
1166
1156
|
location: e.location,
|
1167
1157
|
width: 200,
|
1168
1158
|
height: 74,
|
1169
|
-
key:
|
1159
|
+
key: Me
|
1170
1160
|
});
|
1171
1161
|
return;
|
1172
1162
|
}
|
1173
1163
|
}
|
1174
|
-
this._cellAlertManagerService.removeAlert(
|
1164
|
+
this._cellAlertManagerService.removeAlert(Me);
|
1175
1165
|
}));
|
1176
1166
|
}
|
1177
1167
|
_initZenService() {
|
1178
1168
|
this.disposeWithMe(this._zenZoneService.visible$.subscribe((e) => {
|
1179
|
-
e && this._cellAlertManagerService.removeAlert(
|
1169
|
+
e && this._cellAlertManagerService.removeAlert(Me);
|
1180
1170
|
}));
|
1181
1171
|
}
|
1182
1172
|
};
|
1183
|
-
|
1184
|
-
$e(0,
|
1185
|
-
$e(1,
|
1173
|
+
ut = go([
|
1174
|
+
$e(0, b(Vi)),
|
1175
|
+
$e(1, b(Oi)),
|
1186
1176
|
$e(2, le),
|
1187
|
-
$e(3,
|
1188
|
-
$e(4,
|
1189
|
-
$e(5,
|
1190
|
-
],
|
1191
|
-
var
|
1192
|
-
for (var i = n > 1 ? void 0 : n ?
|
1177
|
+
$e(3, b(se)),
|
1178
|
+
$e(4, sr),
|
1179
|
+
$e(5, b(ee))
|
1180
|
+
], ut);
|
1181
|
+
var po = Object.getOwnPropertyDescriptor, vo = (e, t, r, n) => {
|
1182
|
+
for (var i = n > 1 ? void 0 : n ? po(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1193
1183
|
(a = e[o]) && (i = a(i) || i);
|
1194
1184
|
return i;
|
1195
|
-
},
|
1185
|
+
}, Bt = (e, t) => (r, n) => t(r, n, e);
|
1196
1186
|
let qe = class extends Re {
|
1197
1187
|
constructor(e, t, r) {
|
1198
1188
|
super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = r, this._initAutoFill();
|
@@ -1200,11 +1190,11 @@ let qe = class extends Re {
|
|
1200
1190
|
// eslint-disable-next-line max-lines-per-function
|
1201
1191
|
_initAutoFill() {
|
1202
1192
|
const e = () => ({ redos: [], undos: [] }), t = (n, i) => {
|
1203
|
-
const { source: o, target: a, unitId: l, subUnitId: s } = n,
|
1193
|
+
const { source: o, target: a, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = on([o, a]), [h, d] = u.ranges, { mapFunc: m } = u, g = {
|
1204
1194
|
row: h.startRow,
|
1205
1195
|
col: h.startColumn
|
1206
|
-
},
|
1207
|
-
|
1196
|
+
}, M = Ai(h, d), y = new Rt(), p = /* @__PURE__ */ new Set();
|
1197
|
+
M.forEach((I) => {
|
1208
1198
|
const R = I.repeatStartCell, T = I.relativeRange, N = {
|
1209
1199
|
startRow: g.row,
|
1210
1200
|
startColumn: g.col,
|
@@ -1216,8 +1206,8 @@ let qe = class extends Re {
|
|
1216
1206
|
endColumn: R.col,
|
1217
1207
|
endRow: R.row
|
1218
1208
|
};
|
1219
|
-
|
1220
|
-
const L =
|
1209
|
+
xr.foreach(T, (P, A) => {
|
1210
|
+
const L = yt.getPositionRange(
|
1221
1211
|
{
|
1222
1212
|
startRow: P,
|
1223
1213
|
startColumn: A,
|
@@ -1225,7 +1215,7 @@ let qe = class extends Re {
|
|
1225
1215
|
endRow: P
|
1226
1216
|
},
|
1227
1217
|
N
|
1228
|
-
), { row: V, col: F } = m(L.startRow, L.startColumn), x = this._sheetDataValidationModel.getRuleIdByLocation(l, s, V, F) || "",
|
1218
|
+
), { row: V, col: F } = m(L.startRow, L.startColumn), x = this._sheetDataValidationModel.getRuleIdByLocation(l, s, V, F) || "", X = yt.getPositionRange(
|
1229
1219
|
{
|
1230
1220
|
startRow: P,
|
1231
1221
|
startColumn: A,
|
@@ -1233,25 +1223,25 @@ let qe = class extends Re {
|
|
1233
1223
|
endRow: P
|
1234
1224
|
},
|
1235
1225
|
D
|
1236
|
-
), { row: Z, col:
|
1237
|
-
y.setValue(Z,
|
1226
|
+
), { row: Z, col: z } = m(X.startRow, X.startColumn);
|
1227
|
+
y.setValue(Z, z, x), p.add(x);
|
1238
1228
|
});
|
1239
1229
|
});
|
1240
|
-
const S = Array.from(p).map((I) => ({ id: I, ranges:
|
1241
|
-
|
1242
|
-
const v =
|
1230
|
+
const S = Array.from(p).map((I) => ({ id: I, ranges: qt(y, (R) => R === I) }));
|
1231
|
+
c.addRangeRules(S);
|
1232
|
+
const v = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: C, undoMutations: w } = Jt(l, s, v, this._injector, "patched", i === ot.ONLY_FORMAT);
|
1243
1233
|
return {
|
1244
1234
|
undos: w,
|
1245
1235
|
redos: C
|
1246
1236
|
};
|
1247
1237
|
}, r = {
|
1248
|
-
id:
|
1238
|
+
id: tr,
|
1249
1239
|
onBeforeFillData: (n) => {
|
1250
1240
|
const { source: i, unitId: o, subUnitId: a } = n;
|
1251
1241
|
for (const l of i.rows)
|
1252
1242
|
for (const s of i.cols) {
|
1253
|
-
const
|
1254
|
-
if (
|
1243
|
+
const c = this._sheetDataValidationModel.getRuleByLocation(o, a, l, s);
|
1244
|
+
if (c && c.type === G.CHECKBOX) {
|
1255
1245
|
this._autoFillService.setDisableApplyType(ot.SERIES, !0);
|
1256
1246
|
return;
|
1257
1247
|
}
|
@@ -1264,16 +1254,16 @@ let qe = class extends Re {
|
|
1264
1254
|
this.disposeWithMe(this._autoFillService.addHook(r));
|
1265
1255
|
}
|
1266
1256
|
};
|
1267
|
-
qe =
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1257
|
+
qe = vo([
|
1258
|
+
Bt(0, Pi),
|
1259
|
+
Bt(1, b(ee)),
|
1260
|
+
Bt(2, b(we))
|
1271
1261
|
], qe);
|
1272
|
-
var
|
1273
|
-
for (var i = n > 1 ? void 0 : n ?
|
1262
|
+
var mo = Object.getOwnPropertyDescriptor, fo = (e, t, r, n) => {
|
1263
|
+
for (var i = n > 1 ? void 0 : n ? mo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1274
1264
|
(a = e[o]) && (i = a(i) || i);
|
1275
1265
|
return i;
|
1276
|
-
},
|
1266
|
+
}, Ht = (e, t) => (r, n) => t(r, n, e);
|
1277
1267
|
let Je = class extends Re {
|
1278
1268
|
constructor(t, r, n) {
|
1279
1269
|
super();
|
@@ -1282,29 +1272,29 @@ let Je = class extends Re {
|
|
1282
1272
|
}
|
1283
1273
|
_initCopyPaste() {
|
1284
1274
|
this._sheetClipboardService.addClipboardHook({
|
1285
|
-
id:
|
1275
|
+
id: tr,
|
1286
1276
|
onBeforeCopy: (t, r, n) => this._collect(t, r, n),
|
1287
1277
|
onPasteCells: (t, r, n, i) => {
|
1288
|
-
const { copyType: o =
|
1289
|
-
return this._generateMutations(s, { copyType: o, pasteType: a, copyRange: l, unitId:
|
1278
|
+
const { copyType: o = kn.COPY, pasteType: a } = i, { range: l } = t || {}, { range: s, unitId: c, subUnitId: u } = r;
|
1279
|
+
return this._generateMutations(s, { copyType: o, pasteType: a, copyRange: l, unitId: c, subUnitId: u });
|
1290
1280
|
}
|
1291
1281
|
});
|
1292
1282
|
}
|
1293
1283
|
_collect(t, r, n) {
|
1294
|
-
const i = new
|
1284
|
+
const i = new Rt();
|
1295
1285
|
this._copyInfo = {
|
1296
1286
|
unitId: t,
|
1297
1287
|
subUnitId: r,
|
1298
1288
|
matrix: i
|
1299
1289
|
};
|
1300
|
-
const o = this._injector.invoke((s) =>
|
1290
|
+
const o = this._injector.invoke((s) => yi(n, s, t, r));
|
1301
1291
|
if (!o)
|
1302
1292
|
return;
|
1303
1293
|
const { rows: a, cols: l } = o;
|
1304
|
-
a.forEach((s,
|
1294
|
+
a.forEach((s, c) => {
|
1305
1295
|
l.forEach((u, h) => {
|
1306
|
-
const
|
1307
|
-
i.setValue(
|
1296
|
+
const d = this._sheetDataValidationModel.getRuleIdByLocation(t, r, s, u);
|
1297
|
+
i.setValue(c, h, d != null ? d : "");
|
1308
1298
|
});
|
1309
1299
|
});
|
1310
1300
|
}
|
@@ -1312,24 +1302,24 @@ let Je = class extends Re {
|
|
1312
1302
|
_generateMutations(t, r) {
|
1313
1303
|
if (!this._copyInfo)
|
1314
1304
|
return { redos: [], undos: [] };
|
1315
|
-
if (r.copyType ===
|
1305
|
+
if (r.copyType === kn.CUT)
|
1316
1306
|
return this._copyInfo = null, { redos: [], undos: [] };
|
1317
1307
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !r.copyRange)
|
1318
1308
|
return { redos: [], undos: [] };
|
1319
1309
|
if ([
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1310
|
+
mt.SPECIAL_PASTE_COL_WIDTH,
|
1311
|
+
mt.SPECIAL_PASTE_VALUE,
|
1312
|
+
mt.SPECIAL_PASTE_FORMAT,
|
1313
|
+
mt.SPECIAL_PASTE_FORMULA
|
1324
1314
|
].includes(r.pasteType))
|
1325
1315
|
return { redos: [], undos: [] };
|
1326
1316
|
const { unitId: i, subUnitId: o } = this._copyInfo;
|
1327
1317
|
if (r.unitId !== i || o !== r.subUnitId) {
|
1328
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(r.unitId, r.subUnitId).clone(), l = new
|
1329
|
-
|
1318
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(r.unitId, r.subUnitId).clone(), l = new Rt(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = on([r.copyRange, t]), d = Nn(c, u, !0), m = /* @__PURE__ */ new Map();
|
1319
|
+
d.forEach(({ startRange: p }) => {
|
1330
1320
|
var S;
|
1331
1321
|
(S = this._copyInfo) == null || S.matrix.forValue((v, C, w) => {
|
1332
|
-
const I =
|
1322
|
+
const I = yt.getPositionRange(
|
1333
1323
|
{
|
1334
1324
|
startRow: v,
|
1335
1325
|
endRow: v,
|
@@ -1343,9 +1333,9 @@ let Je = class extends Re {
|
|
1343
1333
|
s.add(R), l.setValue(N, D, R);
|
1344
1334
|
});
|
1345
1335
|
});
|
1346
|
-
const g = Array.from(s).map((p) => ({ id: p, ranges:
|
1336
|
+
const g = Array.from(s).map((p) => ({ id: p, ranges: qt(l, (S) => S === p) }));
|
1347
1337
|
a.addRangeRules(g);
|
1348
|
-
const { redoMutations:
|
1338
|
+
const { redoMutations: M, undoMutations: y } = Jt(
|
1349
1339
|
r.unitId,
|
1350
1340
|
r.subUnitId,
|
1351
1341
|
a.diffWithAddition(this._sheetDataValidationModel.getRules(r.unitId, r.subUnitId), m.values()),
|
@@ -1354,15 +1344,15 @@ let Je = class extends Re {
|
|
1354
1344
|
!1
|
1355
1345
|
);
|
1356
1346
|
return {
|
1357
|
-
redos:
|
1347
|
+
redos: M,
|
1358
1348
|
undos: y
|
1359
1349
|
};
|
1360
1350
|
} else {
|
1361
|
-
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new
|
1362
|
-
|
1351
|
+
const a = this._sheetDataValidationModel.getRuleObjectMatrix(i, o).clone(), l = new Rt(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = on([r.copyRange, t]);
|
1352
|
+
Nn(c, u, !0).forEach(({ startRange: y }) => {
|
1363
1353
|
var p;
|
1364
1354
|
(p = this._copyInfo) == null || p.matrix.forValue((S, v, C) => {
|
1365
|
-
const w =
|
1355
|
+
const w = yt.getPositionRange(
|
1366
1356
|
{
|
1367
1357
|
startRow: S,
|
1368
1358
|
endRow: S,
|
@@ -1374,9 +1364,9 @@ let Je = class extends Re {
|
|
1374
1364
|
l.setValue(I, R, C), s.add(C);
|
1375
1365
|
});
|
1376
1366
|
});
|
1377
|
-
const m = Array.from(s).map((y) => ({ id: y, ranges:
|
1367
|
+
const m = Array.from(s).map((y) => ({ id: y, ranges: qt(l, (p) => p === y) }));
|
1378
1368
|
a.addRangeRules(m);
|
1379
|
-
const { redoMutations: g, undoMutations:
|
1369
|
+
const { redoMutations: g, undoMutations: M } = Jt(
|
1380
1370
|
i,
|
1381
1371
|
o,
|
1382
1372
|
a.diff(this._sheetDataValidationModel.getRules(i, o)),
|
@@ -1386,21 +1376,21 @@ let Je = class extends Re {
|
|
1386
1376
|
);
|
1387
1377
|
return {
|
1388
1378
|
redos: g,
|
1389
|
-
undos:
|
1379
|
+
undos: M
|
1390
1380
|
};
|
1391
1381
|
}
|
1392
1382
|
}
|
1393
1383
|
};
|
1394
|
-
Je =
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1384
|
+
Je = fo([
|
1385
|
+
Ht(0, Li),
|
1386
|
+
Ht(1, b(ee)),
|
1387
|
+
Ht(2, b(we))
|
1398
1388
|
], Je);
|
1399
|
-
var
|
1400
|
-
for (var i = n > 1 ? void 0 : n ?
|
1389
|
+
var _o = Object.getOwnPropertyDescriptor, So = (e, t, r, n) => {
|
1390
|
+
for (var i = n > 1 ? void 0 : n ? _o(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1401
1391
|
(a = e[o]) && (i = a(i) || i);
|
1402
1392
|
return i;
|
1403
|
-
},
|
1393
|
+
}, Wt = (e, t) => (r, n) => t(r, n, e);
|
1404
1394
|
let Qe = class extends Re {
|
1405
1395
|
constructor(e, t, r) {
|
1406
1396
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionCheckController = r, this._commandExecutedListener();
|
@@ -1408,82 +1398,82 @@ let Qe = class extends Re {
|
|
1408
1398
|
_commandExecutedListener() {
|
1409
1399
|
this.disposeWithMe(
|
1410
1400
|
this._commandService.beforeCommandExecuted((e) => {
|
1411
|
-
e.id ===
|
1412
|
-
workbookTypes: [
|
1413
|
-
rangeTypes: [
|
1414
|
-
worksheetTypes: [
|
1415
|
-
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id ===
|
1416
|
-
workbookTypes: [
|
1417
|
-
rangeTypes: [
|
1418
|
-
worksheetTypes: [
|
1401
|
+
e.id === gn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1402
|
+
workbookTypes: [rn],
|
1403
|
+
rangeTypes: [nn],
|
1404
|
+
worksheetTypes: [en, tn]
|
1405
|
+
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === nr.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1406
|
+
workbookTypes: [rn],
|
1407
|
+
rangeTypes: [nn],
|
1408
|
+
worksheetTypes: [en, tn]
|
1419
1409
|
}, e.params.ranges) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")));
|
1420
1410
|
})
|
1421
1411
|
);
|
1422
1412
|
}
|
1423
1413
|
};
|
1424
|
-
Qe =
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1414
|
+
Qe = So([
|
1415
|
+
Wt(0, b(se)),
|
1416
|
+
Wt(1, J),
|
1417
|
+
Wt(2, b(Mi))
|
1428
1418
|
], Qe);
|
1429
|
-
const br = "data-validation-single",
|
1430
|
-
function
|
1419
|
+
const br = "data-validation-single", Er = "sheet.menu.data-validation";
|
1420
|
+
function Co(e) {
|
1431
1421
|
return {
|
1432
|
-
id:
|
1433
|
-
type:
|
1422
|
+
id: Er,
|
1423
|
+
type: vn.SUBITEMS,
|
1434
1424
|
icon: br,
|
1435
1425
|
tooltip: "dataValidation.title",
|
1436
|
-
hidden$:
|
1437
|
-
disabled$:
|
1426
|
+
hidden$: si(e, Y.UNIVER_SHEET),
|
1427
|
+
disabled$: ki(e, { workbookTypes: [rn], worksheetTypes: [tn, en], rangeTypes: [nn] })
|
1438
1428
|
};
|
1439
1429
|
}
|
1440
|
-
function
|
1430
|
+
function Io(e) {
|
1441
1431
|
return {
|
1442
1432
|
id: Fe.id,
|
1443
1433
|
title: "dataValidation.panel.title",
|
1444
|
-
type:
|
1434
|
+
type: vn.BUTTON
|
1445
1435
|
};
|
1446
1436
|
}
|
1447
|
-
function
|
1437
|
+
function wo(e) {
|
1448
1438
|
return {
|
1449
|
-
id:
|
1439
|
+
id: Nt.id,
|
1450
1440
|
title: "dataValidation.panel.add",
|
1451
|
-
type:
|
1441
|
+
type: vn.BUTTON
|
1452
1442
|
};
|
1453
1443
|
}
|
1454
|
-
const
|
1455
|
-
[
|
1456
|
-
[
|
1444
|
+
const Ro = {
|
1445
|
+
[li.FORMULAS_INSERT]: {
|
1446
|
+
[Er]: {
|
1457
1447
|
order: 9,
|
1458
|
-
menuItemFactory:
|
1448
|
+
menuItemFactory: Co,
|
1459
1449
|
[Fe.id]: {
|
1460
1450
|
order: 0,
|
1461
|
-
menuItemFactory:
|
1451
|
+
menuItemFactory: Io
|
1462
1452
|
},
|
1463
|
-
[
|
1453
|
+
[Nt.id]: {
|
1464
1454
|
order: 1,
|
1465
|
-
menuItemFactory:
|
1455
|
+
menuItemFactory: wo
|
1466
1456
|
}
|
1467
1457
|
}
|
1468
1458
|
}
|
1469
1459
|
};
|
1470
|
-
var
|
1471
|
-
for (var i = n > 1 ? void 0 : n ?
|
1460
|
+
var yo = Object.getOwnPropertyDescriptor, Dr = (e, t, r, n) => {
|
1461
|
+
for (var i = n > 1 ? void 0 : n ? yo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1472
1462
|
(a = e[o]) && (i = a(i) || i);
|
1473
1463
|
return i;
|
1474
|
-
},
|
1475
|
-
const
|
1464
|
+
}, K = (e, t) => (r, n) => t(r, n, e);
|
1465
|
+
const Vr = {
|
1476
1466
|
tr: {
|
1477
1467
|
size: 6,
|
1478
1468
|
color: "#fe4b4b"
|
1479
1469
|
}
|
1480
1470
|
};
|
1481
|
-
let et = class extends
|
1482
|
-
constructor(e, t, r, n, i, o, a, l, s,
|
1483
|
-
super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = r, this._univerInstanceService = n, this._autoHeightController = i, this._dropdownManagerService = o, this._sheetDataValidationModel = a, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService =
|
1471
|
+
let et = class extends un {
|
1472
|
+
constructor(e, t, r, n, i, o, a, l, s, c, u) {
|
1473
|
+
super(), this._commandService = e, this._menuManagerService = t, this._renderManagerService = r, this._univerInstanceService = n, this._autoHeightController = i, this._dropdownManagerService = o, this._sheetDataValidationModel = a, this._dataValidatorRegistryService = l, this._sheetInterceptorService = s, this._dataValidationCacheService = c, this._editorBridgeService = u, this._initMenu(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
1484
1474
|
}
|
1485
1475
|
_initMenu() {
|
1486
|
-
this._menuManagerService.mergeMenu(
|
1476
|
+
this._menuManagerService.mergeMenu(Ro);
|
1487
1477
|
}
|
1488
1478
|
_initDropdown() {
|
1489
1479
|
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
|
@@ -1500,13 +1490,13 @@ let et = class extends dn {
|
|
1500
1490
|
const s = this._sheetDataValidationModel.getRuleByLocation(n, i, o, a);
|
1501
1491
|
if (!s)
|
1502
1492
|
return;
|
1503
|
-
const
|
1504
|
-
if (!(
|
1493
|
+
const c = this._dataValidatorRegistryService.getValidatorItem(s.type);
|
1494
|
+
if (!(c != null && c.dropdownType))
|
1505
1495
|
return;
|
1506
1496
|
const u = l.getActiveSheet();
|
1507
1497
|
if (!u) return;
|
1508
|
-
const h = this._dropdownManagerService.activeDropdown,
|
1509
|
-
if (
|
1498
|
+
const h = this._dropdownManagerService.activeDropdown, d = h == null ? void 0 : h.location;
|
1499
|
+
if (d && d.unitId === n && d.subUnitId === i && d.row === o && d.col === a)
|
1510
1500
|
return;
|
1511
1501
|
this._dropdownManagerService.showDropdown(
|
1512
1502
|
{
|
@@ -1529,23 +1519,23 @@ let et = class extends dn {
|
|
1529
1519
|
_initViewModelIntercept() {
|
1530
1520
|
this.disposeWithMe(
|
1531
1521
|
this._sheetInterceptorService.intercept(
|
1532
|
-
|
1522
|
+
pr.CELL_CONTENT,
|
1533
1523
|
{
|
1534
|
-
effect:
|
1524
|
+
effect: Xn.Style,
|
1535
1525
|
// must be after numfmt
|
1536
|
-
priority:
|
1526
|
+
priority: vr.DATA_VALIDATION,
|
1537
1527
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1538
1528
|
handler: (e, t, r) => {
|
1539
1529
|
var p, S, v, C, w;
|
1540
|
-
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t,
|
1541
|
-
if (!
|
1530
|
+
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(o, a, n, i);
|
1531
|
+
if (!c)
|
1542
1532
|
return r(e);
|
1543
|
-
const u = this._sheetDataValidationModel.getRuleById(o, a,
|
1533
|
+
const u = this._sheetDataValidationModel.getRuleById(o, a, c);
|
1544
1534
|
if (!u)
|
1545
1535
|
return r(e);
|
1546
|
-
const h = (p = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? p : je.VALID,
|
1536
|
+
const h = (p = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? p : je.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), m = t.rawData;
|
1547
1537
|
let g;
|
1548
|
-
const
|
1538
|
+
const M = {
|
1549
1539
|
get value() {
|
1550
1540
|
var I;
|
1551
1541
|
return g !== void 0 || (g = (I = Q(m)) != null ? I : null), g;
|
@@ -1553,26 +1543,26 @@ let et = class extends dn {
|
|
1553
1543
|
}, y = {
|
1554
1544
|
get value() {
|
1555
1545
|
var I;
|
1556
|
-
return `${(I =
|
1546
|
+
return `${(I = M.value) != null ? I : ""}`;
|
1557
1547
|
}
|
1558
1548
|
};
|
1559
1549
|
return r({
|
1560
1550
|
...e,
|
1561
1551
|
markers: {
|
1562
1552
|
...e == null ? void 0 : e.markers,
|
1563
|
-
...h === je.INVALID ?
|
1553
|
+
...h === je.INVALID ? Vr : null
|
1564
1554
|
},
|
1565
1555
|
customRender: [
|
1566
1556
|
...(S = e == null ? void 0 : e.customRender) != null ? S : [],
|
1567
|
-
...
|
1557
|
+
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1568
1558
|
],
|
1569
1559
|
fontRenderExtension: {
|
1570
1560
|
...e == null ? void 0 : e.fontRenderExtension,
|
1571
|
-
isSkip: ((v = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : v.isSkip) || ((C =
|
1561
|
+
isSkip: ((v = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : v.isSkip) || ((C = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : C.call(d, u, M.value, t))
|
1572
1562
|
},
|
1573
1563
|
interceptorStyle: {
|
1574
1564
|
...e == null ? void 0 : e.interceptorStyle,
|
1575
|
-
...
|
1565
|
+
...d == null ? void 0 : d.getExtraStyle(u, y.value, {
|
1576
1566
|
get style() {
|
1577
1567
|
const I = l.getStyles();
|
1578
1568
|
return (typeof (e == null ? void 0 : e.s) == "string" ? I.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
@@ -1581,7 +1571,7 @@ let et = class extends dn {
|
|
1581
1571
|
},
|
1582
1572
|
interceptorAutoHeight: () => {
|
1583
1573
|
var N, D, P, A, L, V;
|
1584
|
-
const I = (D = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(
|
1574
|
+
const I = (D = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(bt).getSkeletonParam(a)) == null ? void 0 : D.skeleton;
|
1585
1575
|
if (!I)
|
1586
1576
|
return;
|
1587
1577
|
const R = I.worksheet.getMergedCell(n, i), T = {
|
@@ -1595,11 +1585,11 @@ let et = class extends dn {
|
|
1595
1585
|
workbook: l,
|
1596
1586
|
worksheet: s
|
1597
1587
|
};
|
1598
|
-
return (V = (L =
|
1588
|
+
return (V = (L = d == null ? void 0 : d.canvasRender) == null ? void 0 : L.calcCellAutoHeight) == null ? void 0 : V.call(L, T);
|
1599
1589
|
},
|
1600
1590
|
interceptorAutoWidth: () => {
|
1601
1591
|
var N, D, P, A, L, V;
|
1602
|
-
const I = (D = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(
|
1592
|
+
const I = (D = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(bt).getSkeletonParam(a)) == null ? void 0 : D.skeleton;
|
1603
1593
|
if (!I)
|
1604
1594
|
return;
|
1605
1595
|
const R = I.worksheet.getMergedCell(n, i), T = {
|
@@ -1613,7 +1603,7 @@ let et = class extends dn {
|
|
1613
1603
|
workbook: l,
|
1614
1604
|
worksheet: s
|
1615
1605
|
};
|
1616
|
-
return (V = (L =
|
1606
|
+
return (V = (L = d == null ? void 0 : d.canvasRender) == null ? void 0 : L.calcCellAutoWidth) == null ? void 0 : V.call(L, T);
|
1617
1607
|
},
|
1618
1608
|
coverable: ((w = e == null ? void 0 : e.coverable) != null ? w : !0) && !(u.type === G.LIST || u.type === G.LIST_MULTIPLE)
|
1619
1609
|
});
|
@@ -1626,7 +1616,7 @@ let et = class extends dn {
|
|
1626
1616
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1627
1617
|
// patched data-validation change don't need to re-calc row height
|
1628
1618
|
// re-calc of row height will be triggered precisely by the origin command
|
1629
|
-
|
1619
|
+
_n((e) => e.source === "command"),
|
1630
1620
|
dr(100)
|
1631
1621
|
).subscribe((e) => {
|
1632
1622
|
if (e.length === 0)
|
@@ -1637,63 +1627,63 @@ let et = class extends dn {
|
|
1637
1627
|
(r.rule.type === G.LIST_MULTIPLE || r.rule.type === G.LIST) && (n = r.rule) != null && n.ranges && t.push(...r.rule.ranges);
|
1638
1628
|
}), t.length) {
|
1639
1629
|
const r = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1640
|
-
|
1630
|
+
zn(r.redos, this._commandService);
|
1641
1631
|
}
|
1642
1632
|
});
|
1643
1633
|
}
|
1644
1634
|
};
|
1645
|
-
et =
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1635
|
+
et = Dr([
|
1636
|
+
K(0, J),
|
1637
|
+
K(1, ci),
|
1638
|
+
K(2, Ne),
|
1639
|
+
K(3, le),
|
1640
|
+
K(4, b(fr)),
|
1641
|
+
K(5, b(Ae)),
|
1642
|
+
K(6, b(ee)),
|
1643
|
+
K(7, b(ye)),
|
1644
|
+
K(8, b(Sn)),
|
1645
|
+
K(9, b(rr)),
|
1646
|
+
K(10, $r(mr))
|
1657
1647
|
], et);
|
1658
|
-
let
|
1648
|
+
let xn = class extends un {
|
1659
1649
|
constructor(e, t, r, n, i, o, a) {
|
1660
1650
|
super(), this._commandService = e, this._renderManagerService = t, this._autoHeightController = r, this._dataValidatorRegistryService = n, this._sheetInterceptorService = i, this._sheetDataValidationModel = o, this._dataValidationCacheService = a, this._initViewModelIntercept(), this._initAutoHeight();
|
1661
1651
|
}
|
1662
1652
|
_initViewModelIntercept() {
|
1663
1653
|
this.disposeWithMe(
|
1664
1654
|
this._sheetInterceptorService.intercept(
|
1665
|
-
|
1655
|
+
pr.CELL_CONTENT,
|
1666
1656
|
{
|
1667
|
-
effect:
|
1657
|
+
effect: Xn.Style,
|
1668
1658
|
// must be after numfmt
|
1669
|
-
priority:
|
1659
|
+
priority: vr.DATA_VALIDATION,
|
1670
1660
|
// eslint-disable-next-line complexity
|
1671
1661
|
handler: (e, t, r) => {
|
1672
1662
|
var y, p, S, v, C;
|
1673
|
-
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t,
|
1674
|
-
if (!
|
1663
|
+
const { row: n, col: i, unitId: o, subUnitId: a, workbook: l, worksheet: s } = t, c = this._sheetDataValidationModel.getRuleIdByLocation(o, a, n, i);
|
1664
|
+
if (!c)
|
1675
1665
|
return r(e);
|
1676
|
-
const u = this._sheetDataValidationModel.getRuleById(o, a,
|
1666
|
+
const u = this._sheetDataValidationModel.getRuleById(o, a, c);
|
1677
1667
|
if (!u)
|
1678
1668
|
return r(e);
|
1679
|
-
const h = (y = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? y : je.VALID,
|
1669
|
+
const h = (y = this._dataValidationCacheService.getValue(o, a, n, i)) != null ? y : je.VALID, d = this._dataValidatorRegistryService.getValidatorItem(u.type), m = s.getCellRaw(n, i), g = Q(m), M = `${g != null ? g : ""}`;
|
1680
1670
|
return r({
|
1681
1671
|
...e,
|
1682
1672
|
markers: {
|
1683
1673
|
...e == null ? void 0 : e.markers,
|
1684
|
-
...h === je.INVALID ?
|
1674
|
+
...h === je.INVALID ? Vr : null
|
1685
1675
|
},
|
1686
1676
|
customRender: [
|
1687
1677
|
...(p = e == null ? void 0 : e.customRender) != null ? p : [],
|
1688
|
-
...
|
1678
|
+
...d != null && d.canvasRender ? [d.canvasRender] : []
|
1689
1679
|
],
|
1690
1680
|
fontRenderExtension: {
|
1691
1681
|
...e == null ? void 0 : e.fontRenderExtension,
|
1692
|
-
isSkip: ((S = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : S.isSkip) || ((v =
|
1682
|
+
isSkip: ((S = e == null ? void 0 : e.fontRenderExtension) == null ? void 0 : S.isSkip) || ((v = d == null ? void 0 : d.skipDefaultFontRender) == null ? void 0 : v.call(d, u, g, t))
|
1693
1683
|
},
|
1694
1684
|
interceptorStyle: {
|
1695
1685
|
...e == null ? void 0 : e.interceptorStyle,
|
1696
|
-
...
|
1686
|
+
...d == null ? void 0 : d.getExtraStyle(u, M, {
|
1697
1687
|
get style() {
|
1698
1688
|
const w = l.getStyles();
|
1699
1689
|
return (typeof (e == null ? void 0 : e.s) == "string" ? w.get(e == null ? void 0 : e.s) : e == null ? void 0 : e.s) || {};
|
@@ -1702,7 +1692,7 @@ let Un = class extends dn {
|
|
1702
1692
|
},
|
1703
1693
|
interceptorAutoHeight: () => {
|
1704
1694
|
var T, N, D, P, A, L;
|
1705
|
-
const w = (N = (T = this._renderManagerService.getRenderById(o)) == null ? void 0 : T.with(
|
1695
|
+
const w = (N = (T = this._renderManagerService.getRenderById(o)) == null ? void 0 : T.with(bt).getSkeletonParam(a)) == null ? void 0 : N.skeleton;
|
1706
1696
|
if (!w)
|
1707
1697
|
return;
|
1708
1698
|
const I = w.worksheet.getMergedCell(n, i), R = {
|
@@ -1716,7 +1706,7 @@ let Un = class extends dn {
|
|
1716
1706
|
workbook: l,
|
1717
1707
|
worksheet: s
|
1718
1708
|
};
|
1719
|
-
return (L = (A =
|
1709
|
+
return (L = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : L.call(A, R);
|
1720
1710
|
},
|
1721
1711
|
coverable: ((C = e == null ? void 0 : e.coverable) != null ? C : !0) && !(u.type === G.LIST || u.type === G.LIST_MULTIPLE)
|
1722
1712
|
});
|
@@ -1727,7 +1717,7 @@ let Un = class extends dn {
|
|
1727
1717
|
}
|
1728
1718
|
_initAutoHeight() {
|
1729
1719
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1730
|
-
|
1720
|
+
_n((e) => e.source === "command"),
|
1731
1721
|
dr(16)
|
1732
1722
|
).subscribe((e) => {
|
1733
1723
|
const t = [];
|
@@ -1736,26 +1726,26 @@ let Un = class extends dn {
|
|
1736
1726
|
(n = r.rule) != null && n.ranges && t.push(...r.rule.ranges);
|
1737
1727
|
}), t.length) {
|
1738
1728
|
const r = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1739
|
-
|
1729
|
+
zn(r.redos, this._commandService);
|
1740
1730
|
}
|
1741
1731
|
});
|
1742
1732
|
}
|
1743
1733
|
};
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
],
|
1753
|
-
var
|
1754
|
-
for (var i = n > 1 ? void 0 : n ?
|
1734
|
+
xn = Dr([
|
1735
|
+
K(0, J),
|
1736
|
+
K(1, Ne),
|
1737
|
+
K(2, b(fr)),
|
1738
|
+
K(3, b(ye)),
|
1739
|
+
K(4, b(Sn)),
|
1740
|
+
K(5, b(ee)),
|
1741
|
+
K(6, b(rr))
|
1742
|
+
], xn);
|
1743
|
+
var Mo = Object.getOwnPropertyDescriptor, bo = (e, t, r, n) => {
|
1744
|
+
for (var i = n > 1 ? void 0 : n ? Mo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
1755
1745
|
(a = e[o]) && (i = a(i) || i);
|
1756
1746
|
return i;
|
1757
|
-
},
|
1758
|
-
let
|
1747
|
+
}, $n = (e, t) => (r, n) => t(r, n, e);
|
1748
|
+
let Vt = class extends Re {
|
1759
1749
|
constructor(e, t, r) {
|
1760
1750
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = r, this._initSkeletonChange();
|
1761
1751
|
}
|
@@ -1772,40 +1762,41 @@ let Et = class extends Re {
|
|
1772
1762
|
(o = this._sheetSkeletonManagerService.getSkeletonParam(i)) == null || o.skeleton.makeDirty(!0);
|
1773
1763
|
}), (n = this._context.mainComponent) == null || n.makeForceDirty();
|
1774
1764
|
};
|
1775
|
-
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(
|
1765
|
+
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(Br(16)).subscribe(e));
|
1776
1766
|
}
|
1777
1767
|
};
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
],
|
1782
|
-
function
|
1783
|
-
var
|
1784
|
-
const t = U(se), r = U(
|
1785
|
-
return /* @__PURE__ */ W(
|
1768
|
+
Vt = bo([
|
1769
|
+
$n(1, b(ee)),
|
1770
|
+
$n(2, b(bt))
|
1771
|
+
], Vt);
|
1772
|
+
function Eo(e) {
|
1773
|
+
var c;
|
1774
|
+
const t = U(se), r = U(mn), { value: n, onChange: i, extraComponent: o } = e, [a, l] = H(!1), s = o ? r.get(o) : null;
|
1775
|
+
return /* @__PURE__ */ W(ct, { children: [
|
1786
1776
|
/* @__PURE__ */ W(
|
1787
1777
|
"div",
|
1788
1778
|
{
|
1789
1779
|
className: `
|
1790
|
-
univer-mb-3 univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-text-
|
1780
|
+
univer-mb-3 univer-flex univer-cursor-pointer univer-items-center univer-text-sm univer-text-gray-900
|
1781
|
+
dark:univer-text-white
|
1791
1782
|
`,
|
1792
1783
|
onClick: () => l(!a),
|
1793
1784
|
children: [
|
1794
1785
|
t.t("dataValidation.panel.options"),
|
1795
|
-
a ? /* @__PURE__ */ _(
|
1786
|
+
a ? /* @__PURE__ */ _(wr, { className: "univer-ml-1" }) : /* @__PURE__ */ _(In, { className: "univer-ml-1" })
|
1796
1787
|
]
|
1797
1788
|
}
|
1798
1789
|
),
|
1799
|
-
a && /* @__PURE__ */ W(
|
1790
|
+
a && /* @__PURE__ */ W(ct, { children: [
|
1800
1791
|
s ? /* @__PURE__ */ _(s, { value: n, onChange: i }) : null,
|
1801
1792
|
/* @__PURE__ */ _(
|
1802
|
-
|
1793
|
+
j,
|
1803
1794
|
{
|
1804
1795
|
label: t.t("dataValidation.panel.invalid"),
|
1805
1796
|
children: /* @__PURE__ */ W(
|
1806
|
-
|
1797
|
+
pn,
|
1807
1798
|
{
|
1808
|
-
value: `${(
|
1799
|
+
value: `${(c = n.errorStyle) != null ? c : lt.WARNING}`,
|
1809
1800
|
onChange: (u) => i({ ...n, errorStyle: +u }),
|
1810
1801
|
children: [
|
1811
1802
|
/* @__PURE__ */ _(Oe, { value: `${lt.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
@@ -1816,11 +1807,11 @@ function Mo(e) {
|
|
1816
1807
|
}
|
1817
1808
|
),
|
1818
1809
|
/* @__PURE__ */ _(
|
1819
|
-
|
1810
|
+
j,
|
1820
1811
|
{
|
1821
1812
|
label: t.t("dataValidation.panel.messageInfo"),
|
1822
1813
|
children: /* @__PURE__ */ _(
|
1823
|
-
|
1814
|
+
Lt,
|
1824
1815
|
{
|
1825
1816
|
checked: n.showErrorMessage,
|
1826
1817
|
onChange: () => i({
|
@@ -1832,56 +1823,56 @@ function Mo(e) {
|
|
1832
1823
|
)
|
1833
1824
|
}
|
1834
1825
|
),
|
1835
|
-
n.showErrorMessage ? /* @__PURE__ */ _(
|
1826
|
+
n.showErrorMessage ? /* @__PURE__ */ _(j, { children: /* @__PURE__ */ _(Ve, { value: n.error, onChange: (u) => i({ ...n, error: u }) }) }) : null
|
1836
1827
|
] })
|
1837
1828
|
] });
|
1838
1829
|
}
|
1839
|
-
const
|
1830
|
+
const Do = (e) => Hr(
|
1840
1831
|
async (t, r, n, i) => {
|
1841
1832
|
const o = await e.executeCommand(t, r, n);
|
1842
1833
|
i == null || i(o);
|
1843
1834
|
},
|
1844
1835
|
1e3
|
1845
1836
|
);
|
1846
|
-
function
|
1837
|
+
function Vo(e, t, r) {
|
1847
1838
|
var n, i, o, a;
|
1848
|
-
return t ? ((i = (n = e.getUnit(t)) == null ? void 0 : n.getSheetBySheetName(r)) == null ? void 0 : i.getSheetId()) || "" : ((a = (o = e.getCurrentUnitForType(
|
1839
|
+
return t ? ((i = (n = e.getUnit(t)) == null ? void 0 : n.getSheetBySheetName(r)) == null ? void 0 : i.getSheetId()) || "" : ((a = (o = e.getCurrentUnitForType(Y.UNIVER_SHEET)) == null ? void 0 : o.getSheetBySheetName(r)) == null ? void 0 : a.getSheetId()) || "";
|
1849
1840
|
}
|
1850
|
-
function
|
1841
|
+
function Oo() {
|
1851
1842
|
var O, B;
|
1852
|
-
const [e, t] = H(0), r = U(_e), n = Te(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = U(ye),
|
1843
|
+
const [e, t] = H(0), r = U(_e), n = Te(r.activeRule$, r.activeRule), { unitId: i, subUnitId: o, rule: a } = n || {}, l = a.uid, s = U(ye), c = U(le), u = U(mn), h = U(J), d = U(fn), m = U(se), [g, M] = H(a), y = s.getValidatorItem(g.type), [p, S] = H(!1), v = s.getValidatorsByScope(ui.SHEET), [C, w] = H(() => g.ranges.map((f) => ({ unitId: "", sheetId: "", range: f }))), I = dt(() => Do(h), [h]), [R, T] = H(!1), [N, D] = H(!1), P = ht(null), A = U(hr);
|
1853
1844
|
if (Pe(() => () => {
|
1854
1845
|
const f = A.getCurrentLastSelection();
|
1855
1846
|
f && A.setSelections([f]);
|
1856
1847
|
}, [A]), Pe(() => {
|
1857
1848
|
h.onCommandExecuted((f) => {
|
1858
|
-
(f.id ===
|
1859
|
-
const k =
|
1860
|
-
t(($) => $ + 1), k && (
|
1849
|
+
(f.id === Wr.id || f.id === jr.id) && setTimeout(() => {
|
1850
|
+
const k = d.getRuleById(i, o, l);
|
1851
|
+
t(($) => $ + 1), k && (M(k), w(k.ranges.map(($) => ({ unitId: "", sheetId: "", range: $ }))));
|
1861
1852
|
}, 20);
|
1862
1853
|
});
|
1863
|
-
}, [h,
|
1854
|
+
}, [h, d, l, o, i]), !y)
|
1864
1855
|
return null;
|
1865
|
-
const L = y.operators, V = y.operatorNames, F = g.operator ?
|
1856
|
+
const L = y.operators, V = y.operatorNames, F = g.operator ? hi.includes(g.operator) : !1, x = () => {
|
1866
1857
|
var f, k, $;
|
1867
|
-
(k = (f = P.current) == null ? void 0 : f.editor) != null && k.isFocus() &&
|
1868
|
-
},
|
1869
|
-
const k = f.split(",").filter(Boolean).map(
|
1870
|
-
const
|
1871
|
-
if (
|
1872
|
-
const
|
1873
|
-
return { ...q, sheetId:
|
1858
|
+
(k = (f = P.current) == null ? void 0 : f.editor) != null && k.isFocus() && X(($ = P.current) == null ? void 0 : $.getValue()), !(!g.ranges.length || R) && (y.validatorFormula(g, i, o).success ? r.setActiveRule(null) : S(!0));
|
1859
|
+
}, X = Qt((f) => {
|
1860
|
+
const k = f.split(",").filter(Boolean).map(Ui).map((q) => {
|
1861
|
+
const yn = q.sheetName;
|
1862
|
+
if (yn) {
|
1863
|
+
const Ar = Vo(c, q.unitId, yn);
|
1864
|
+
return { ...q, sheetId: Ar };
|
1874
1865
|
}
|
1875
1866
|
return {
|
1876
1867
|
...q,
|
1877
1868
|
sheetId: ""
|
1878
1869
|
};
|
1879
1870
|
});
|
1880
|
-
if (
|
1871
|
+
if (Yr(k, C))
|
1881
1872
|
return;
|
1882
1873
|
w(k);
|
1883
1874
|
const $ = k.filter((q) => (!q.unitId || q.unitId === i) && (!q.sheetId || q.sheetId === o)).map((q) => q.range);
|
1884
|
-
if (
|
1875
|
+
if (M({
|
1885
1876
|
...g,
|
1886
1877
|
ranges: $
|
1887
1878
|
}), $.length === 0)
|
@@ -1892,11 +1883,11 @@ function Vo() {
|
|
1892
1883
|
ruleId: l,
|
1893
1884
|
ranges: $
|
1894
1885
|
};
|
1895
|
-
I(
|
1886
|
+
I(nr.id, Ce);
|
1896
1887
|
}), Z = (f) => {
|
1897
|
-
if (
|
1888
|
+
if (bn(f, Pn(g)))
|
1898
1889
|
return;
|
1899
|
-
|
1890
|
+
M({
|
1900
1891
|
...g,
|
1901
1892
|
...f
|
1902
1893
|
});
|
@@ -1907,12 +1898,12 @@ function Vo() {
|
|
1907
1898
|
setting: f
|
1908
1899
|
};
|
1909
1900
|
I(
|
1910
|
-
|
1901
|
+
En.id,
|
1911
1902
|
k,
|
1912
1903
|
void 0
|
1913
1904
|
);
|
1914
|
-
},
|
1915
|
-
await h.executeCommand(
|
1905
|
+
}, z = async () => {
|
1906
|
+
await h.executeCommand(ir.id, {
|
1916
1907
|
ruleId: l,
|
1917
1908
|
unitId: i,
|
1918
1909
|
subUnitId: o
|
@@ -1927,7 +1918,7 @@ function Vo() {
|
|
1927
1918
|
const k = s.getValidatorItem(f);
|
1928
1919
|
if (!k)
|
1929
1920
|
return;
|
1930
|
-
const $ = k.operators, Ce =
|
1921
|
+
const $ = k.operators, Ce = d.getRuleById(i, o, l), q = f === (Ce == null ? void 0 : Ce.type) || f.includes("list") && (Ce != null && Ce.type.includes("list")) ? {
|
1931
1922
|
...Ce,
|
1932
1923
|
type: f
|
1933
1924
|
} : {
|
@@ -1937,18 +1928,18 @@ function Vo() {
|
|
1937
1928
|
formula1: void 0,
|
1938
1929
|
formula2: void 0
|
1939
1930
|
};
|
1940
|
-
|
1931
|
+
M(q), h.executeCommand(En.id, {
|
1941
1932
|
unitId: i,
|
1942
1933
|
subUnitId: o,
|
1943
1934
|
ruleId: g.uid,
|
1944
|
-
setting:
|
1935
|
+
setting: Pn(q)
|
1945
1936
|
});
|
1946
|
-
},
|
1947
|
-
|
1937
|
+
}, ce = u.get(y.formulaInput), ne = dt(() => C.map((f) => _r(f.range)).join(","), []), de = Tn(g), Se = (f) => {
|
1938
|
+
bn(f, Tn(g)) || (M({
|
1948
1939
|
...g,
|
1949
1940
|
...f
|
1950
1941
|
}), I(
|
1951
|
-
|
1942
|
+
Jr.id,
|
1952
1943
|
{
|
1953
1944
|
unitId: i,
|
1954
1945
|
subUnitId: o,
|
@@ -1959,7 +1950,7 @@ function Vo() {
|
|
1959
1950
|
}, ve = L.length && !g.operator;
|
1960
1951
|
return /* @__PURE__ */ W("div", { className: "univer-py-4", children: [
|
1961
1952
|
/* @__PURE__ */ _(
|
1962
|
-
|
1953
|
+
j,
|
1963
1954
|
{
|
1964
1955
|
label: m.t("dataValidation.panel.range"),
|
1965
1956
|
error: !g.ranges.length || R ? m.t("dataValidation.panel.rangeError") : "",
|
@@ -1972,19 +1963,19 @@ function Vo() {
|
|
1972
1963
|
initialValue: ne,
|
1973
1964
|
onChange: (f, k) => {
|
1974
1965
|
var $;
|
1975
|
-
!N && (($ = P.current) != null && $.verify()) &&
|
1966
|
+
!N && (($ = P.current) != null && $.verify()) && X(k);
|
1976
1967
|
},
|
1977
1968
|
onFocusChange: (f, k) => {
|
1978
1969
|
var $;
|
1979
|
-
D(f), !f && k && (($ = P.current) != null && $.verify()) &&
|
1970
|
+
D(f), !f && k && (($ = P.current) != null && $.verify()) && X(k);
|
1980
1971
|
},
|
1981
1972
|
onVerify: (f) => T(!f)
|
1982
1973
|
}
|
1983
1974
|
)
|
1984
1975
|
}
|
1985
1976
|
),
|
1986
|
-
/* @__PURE__ */ _(
|
1987
|
-
|
1977
|
+
/* @__PURE__ */ _(j, { label: m.t("dataValidation.panel.type"), children: /* @__PURE__ */ _(
|
1978
|
+
Vn,
|
1988
1979
|
{
|
1989
1980
|
className: "univer-w-full",
|
1990
1981
|
value: g.type,
|
@@ -1995,8 +1986,8 @@ function Vo() {
|
|
1995
1986
|
onChange: pe
|
1996
1987
|
}
|
1997
1988
|
) }),
|
1998
|
-
L != null && L.length ? /* @__PURE__ */ _(
|
1999
|
-
|
1989
|
+
L != null && L.length ? /* @__PURE__ */ _(j, { label: m.t("dataValidation.panel.operator"), children: /* @__PURE__ */ _(
|
1990
|
+
Vn,
|
2000
1991
|
{
|
2001
1992
|
className: "univer-w-full",
|
2002
1993
|
value: `${g.operator}`,
|
@@ -2018,8 +2009,8 @@ function Vo() {
|
|
2018
2009
|
}
|
2019
2010
|
}
|
2020
2011
|
) }) : null,
|
2021
|
-
|
2022
|
-
|
2012
|
+
ce && !ve ? /* @__PURE__ */ _(
|
2013
|
+
ce,
|
2023
2014
|
{
|
2024
2015
|
isTwoFormula: F,
|
2025
2016
|
value: {
|
@@ -2039,9 +2030,9 @@ function Vo() {
|
|
2039
2030
|
ruleId: l
|
2040
2031
|
},
|
2041
2032
|
e + g.type
|
2042
|
-
)
|
2043
|
-
/* @__PURE__ */ _(
|
2044
|
-
|
2033
|
+
) : null,
|
2034
|
+
/* @__PURE__ */ _(j, { children: /* @__PURE__ */ _(
|
2035
|
+
Lt,
|
2045
2036
|
{
|
2046
2037
|
checked: (B = g.allowBlank) != null ? B : !0,
|
2047
2038
|
onChange: () => {
|
@@ -2054,23 +2045,23 @@ function Vo() {
|
|
2054
2045
|
children: m.t("dataValidation.panel.allowBlank")
|
2055
2046
|
}
|
2056
2047
|
) }),
|
2057
|
-
/* @__PURE__ */ _(
|
2048
|
+
/* @__PURE__ */ _(Eo, { value: de, onChange: Se, extraComponent: y.optionsInput }),
|
2058
2049
|
/* @__PURE__ */ W("div", { className: "univer-mt-5 univer-flex univer-flex-row univer-justify-end", children: [
|
2059
|
-
/* @__PURE__ */ _(ze, { className: "univer-ml-3", onClick:
|
2050
|
+
/* @__PURE__ */ _(ze, { className: "univer-ml-3", onClick: z, children: m.t("dataValidation.panel.removeRule") }),
|
2060
2051
|
/* @__PURE__ */ _(ze, { className: "univer-ml-3", variant: "primary", onClick: x, children: m.t("dataValidation.panel.done") })
|
2061
2052
|
] })
|
2062
2053
|
] });
|
2063
2054
|
}
|
2064
|
-
const
|
2065
|
-
const { rule: t, onClick: r, unitId: n, subUnitId: i, disable: o } = e, a = U(ye), l = U(J), s = U(
|
2055
|
+
const To = (e) => {
|
2056
|
+
const { rule: t, onClick: r, unitId: n, subUnitId: i, disable: o } = e, a = U(ye), l = U(J), s = U(Ni), c = a.getValidatorItem(t.type), u = ht(void 0), [h, d] = H(!1), m = U(Kn), g = Te(m.currentTheme$), M = dt(() => {
|
2066
2057
|
var w;
|
2067
|
-
const p = m.getColorFromTheme("primary.600"), S = m.getColorFromTheme("loop-color.2"), v = (w = m.getColorFromTheme(S)) != null ? w : p, C = new
|
2058
|
+
const p = m.getColorFromTheme("primary.600"), S = m.getColorFromTheme("loop-color.2"), v = (w = m.getColorFromTheme(S)) != null ? w : p, C = new Xr(v).toRgb();
|
2068
2059
|
return {
|
2069
2060
|
fill: `rgba(${C.r}, ${C.g}, ${C.b}, 0.1)`,
|
2070
2061
|
stroke: v
|
2071
2062
|
};
|
2072
2063
|
}, [g]), y = (p) => {
|
2073
|
-
l.executeCommand(
|
2064
|
+
l.executeCommand(ir.id, {
|
2074
2065
|
ruleId: t.uid,
|
2075
2066
|
unitId: n,
|
2076
2067
|
subUnitId: i
|
@@ -2084,7 +2075,7 @@ const Oo = (e) => {
|
|
2084
2075
|
}, [s]), /* @__PURE__ */ W(
|
2085
2076
|
"div",
|
2086
2077
|
{
|
2087
|
-
className:
|
2078
|
+
className: Xe(
|
2088
2079
|
`
|
2089
2080
|
univer-rounded-md univer-bg-secondary univer-relative univer--ml-2 univer--mr-2 univer-box-border
|
2090
2081
|
univer-flex univer-w-[287px] univer-cursor-pointer univer-flex-col univer-justify-between
|
@@ -2097,15 +2088,15 @@ const Oo = (e) => {
|
|
2097
2088
|
),
|
2098
2089
|
onClick: r,
|
2099
2090
|
onMouseEnter: () => {
|
2100
|
-
o || (
|
2091
|
+
o || (d(!0), u.current = t.ranges.map((p) => s.addShape({
|
2101
2092
|
range: p,
|
2102
|
-
style:
|
2093
|
+
style: M,
|
2103
2094
|
primary: null
|
2104
2095
|
})));
|
2105
2096
|
},
|
2106
2097
|
onMouseLeave: () => {
|
2107
2098
|
var p;
|
2108
|
-
|
2099
|
+
d(!1), (p = u.current) == null || p.forEach((S) => {
|
2109
2100
|
S && s.removeShape(S);
|
2110
2101
|
}), u.current = void 0;
|
2111
2102
|
},
|
@@ -2114,19 +2105,17 @@ const Oo = (e) => {
|
|
2114
2105
|
"div",
|
2115
2106
|
{
|
2116
2107
|
className: `
|
2117
|
-
univer-
|
2118
|
-
univer-text-
|
2108
|
+
univer-truncate univer-text-sm univer-font-medium univer-leading-[22px] univer-text-gray-900
|
2109
|
+
dark:univer-text-white
|
2119
2110
|
`,
|
2120
|
-
children:
|
2111
|
+
children: c == null ? void 0 : c.generateRuleName(t)
|
2121
2112
|
}
|
2122
2113
|
),
|
2123
2114
|
/* @__PURE__ */ _(
|
2124
2115
|
"div",
|
2125
2116
|
{
|
2126
|
-
className:
|
2127
|
-
|
2128
|
-
`,
|
2129
|
-
children: t.ranges.map((p) => fr(p)).join(",")
|
2117
|
+
className: "univer-text-secondary univer-truncate univer-text-xs univer-leading-[18px]",
|
2118
|
+
children: t.ranges.map((p) => _r(p)).join(",")
|
2130
2119
|
}
|
2131
2120
|
),
|
2132
2121
|
h ? /* @__PURE__ */ _(
|
@@ -2138,56 +2127,56 @@ const Oo = (e) => {
|
|
2138
2127
|
hover:univer-bg-gray-200
|
2139
2128
|
`,
|
2140
2129
|
onClick: y,
|
2141
|
-
children: /* @__PURE__ */ _(
|
2130
|
+
children: /* @__PURE__ */ _(Cn, {})
|
2142
2131
|
}
|
2143
2132
|
) : null
|
2144
2133
|
]
|
2145
2134
|
}
|
2146
2135
|
);
|
2147
2136
|
};
|
2148
|
-
function
|
2149
|
-
const t = U(ee), r = U(le), n = U(J), i = U(we), o = U(_e), a = U(se), [l, s] = H([]), { workbook:
|
2137
|
+
function Po(e) {
|
2138
|
+
const t = U(ee), r = U(le), n = U(J), i = U(we), o = U(_e), a = U(se), [l, s] = H([]), { workbook: c } = e, u = Te(c.activeSheet$, void 0, !0), h = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
2150
2139
|
Pe(() => {
|
2151
|
-
s(t.getRules(h,
|
2140
|
+
s(t.getRules(h, d));
|
2152
2141
|
const S = t.ruleChange$.subscribe((v) => {
|
2153
|
-
v.unitId === h && v.subUnitId ===
|
2142
|
+
v.unitId === h && v.subUnitId === d && s(t.getRules(h, d));
|
2154
2143
|
});
|
2155
2144
|
return () => {
|
2156
2145
|
S.unsubscribe();
|
2157
2146
|
};
|
2158
|
-
}, [h,
|
2147
|
+
}, [h, d, t]);
|
2159
2148
|
const m = async () => {
|
2160
|
-
const S =
|
2149
|
+
const S = er(i), v = {
|
2161
2150
|
unitId: h,
|
2162
|
-
subUnitId:
|
2151
|
+
subUnitId: d,
|
2163
2152
|
rule: S
|
2164
2153
|
};
|
2165
|
-
await n.executeCommand(
|
2154
|
+
await n.executeCommand(gn.id, v), o.setActiveRule({
|
2166
2155
|
unitId: h,
|
2167
|
-
subUnitId:
|
2156
|
+
subUnitId: d,
|
2168
2157
|
rule: S
|
2169
2158
|
});
|
2170
2159
|
}, g = () => {
|
2171
|
-
n.executeCommand(
|
2160
|
+
n.executeCommand(Qr.id, {
|
2172
2161
|
unitId: h,
|
2173
|
-
subUnitId:
|
2162
|
+
subUnitId: d
|
2174
2163
|
});
|
2175
2164
|
}, y = ((S) => {
|
2176
|
-
const v = r.getCurrentUnitForType(
|
2165
|
+
const v = r.getCurrentUnitForType(Y.UNIVER_SHEET), C = v.getActiveSheet(), w = v.getUnitId(), I = C.getSheetId();
|
2177
2166
|
return S.map((T) => bi(i, w, I, T.ranges) ? { ...T } : { ...T, disable: !0 });
|
2178
2167
|
})(l), p = y == null ? void 0 : y.some((S) => S.disable);
|
2179
2168
|
return /* @__PURE__ */ W("div", { className: "univer-pb-4", children: [
|
2180
2169
|
y == null ? void 0 : y.map((S) => {
|
2181
2170
|
var v;
|
2182
2171
|
return /* @__PURE__ */ _(
|
2183
|
-
|
2172
|
+
To,
|
2184
2173
|
{
|
2185
2174
|
unitId: h,
|
2186
|
-
subUnitId:
|
2175
|
+
subUnitId: d,
|
2187
2176
|
onClick: () => {
|
2188
2177
|
S.disable || o.setActiveRule({
|
2189
2178
|
unitId: h,
|
2190
|
-
subUnitId:
|
2179
|
+
subUnitId: d,
|
2191
2180
|
rule: S
|
2192
2181
|
});
|
2193
2182
|
},
|
@@ -2203,34 +2192,34 @@ function To(e) {
|
|
2203
2192
|
] })
|
2204
2193
|
] });
|
2205
2194
|
}
|
2206
|
-
const
|
2195
|
+
const Ao = () => {
|
2207
2196
|
const e = U(_e), t = Te(e.activeRule$, e.activeRule), r = U(le), n = Te(
|
2208
|
-
() => r.getCurrentTypeOfUnit$(
|
2197
|
+
() => r.getCurrentTypeOfUnit$(Y.UNIVER_SHEET),
|
2209
2198
|
void 0,
|
2210
2199
|
void 0,
|
2211
2200
|
[]
|
2212
2201
|
), i = Te(() => {
|
2213
2202
|
var o;
|
2214
|
-
return (o = n == null ? void 0 : n.activeSheet$) != null ? o :
|
2203
|
+
return (o = n == null ? void 0 : n.activeSheet$) != null ? o : vi(null);
|
2215
2204
|
}, void 0, void 0, []);
|
2216
|
-
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */ _(
|
2217
|
-
},
|
2218
|
-
function
|
2205
|
+
return !n || !i ? null : t && t.subUnitId === i.getSheetId() ? /* @__PURE__ */ _(Oo, {}, t.rule.uid) : /* @__PURE__ */ _(Po, { workbook: n });
|
2206
|
+
}, Lo = "LIST_RENDER_MODE_OPTION_INPUT";
|
2207
|
+
function Ot(e) {
|
2219
2208
|
var i;
|
2220
2209
|
const { value: t, onChange: r } = e, n = U(se);
|
2221
|
-
return /* @__PURE__ */ _(
|
2210
|
+
return /* @__PURE__ */ _(j, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ W(pn, { value: `${(i = t.renderMode) != null ? i : ie.CUSTOM}`, onChange: (o) => r({ ...t, renderMode: +o }), children: [
|
2222
2211
|
/* @__PURE__ */ _(Oe, { value: `${ie.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2223
2212
|
/* @__PURE__ */ _(Oe, { value: `${ie.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2224
2213
|
/* @__PURE__ */ _(Oe, { value: `${ie.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2225
2214
|
] }) });
|
2226
2215
|
}
|
2227
|
-
|
2228
|
-
const
|
2229
|
-
function
|
2216
|
+
Ot.componentKey = Lo;
|
2217
|
+
const ko = "DATE_SHOW_TIME_OPTION";
|
2218
|
+
function Tt(e) {
|
2230
2219
|
var i;
|
2231
2220
|
const { value: t, onChange: r } = e, n = U(se);
|
2232
|
-
return /* @__PURE__ */ _(
|
2233
|
-
|
2221
|
+
return /* @__PURE__ */ _(j, { children: /* @__PURE__ */ _(
|
2222
|
+
Lt,
|
2234
2223
|
{
|
2235
2224
|
checked: (i = t.bizInfo) == null ? void 0 : i.showTime,
|
2236
2225
|
onChange: (o) => {
|
@@ -2246,20 +2235,20 @@ function Vt(e) {
|
|
2246
2235
|
}
|
2247
2236
|
) });
|
2248
2237
|
}
|
2249
|
-
|
2250
|
-
var
|
2251
|
-
for (var i = n > 1 ? void 0 : n ?
|
2238
|
+
Tt.componentKey = ko;
|
2239
|
+
var No = Object.getOwnPropertyDescriptor, Uo = (e, t, r, n) => {
|
2240
|
+
for (var i = n > 1 ? void 0 : n ? No(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2252
2241
|
(a = e[o]) && (i = a(i) || i);
|
2253
2242
|
return i;
|
2254
2243
|
}, Be = (e, t) => (r, n) => t(r, n, e);
|
2255
|
-
const
|
2256
|
-
let
|
2244
|
+
const ft = 6;
|
2245
|
+
let an = class {
|
2257
2246
|
constructor(e, t, r, n, i, o) {
|
2258
2247
|
this._commandService = e, this._univerInstanceService = t, this._formulaService = r, this._themeService = n, this._renderManagerService = i, this._dataValidationModel = o;
|
2259
2248
|
}
|
2260
2249
|
_calc(e, t) {
|
2261
|
-
var
|
2262
|
-
const { vt: r, ht: n } = t || {}, i = e.endX - e.startX -
|
2250
|
+
var c, u, h;
|
2251
|
+
const { vt: r, ht: n } = t || {}, i = e.endX - e.startX - ft * 2, o = e.endY - e.startY, a = ((c = t == null ? void 0 : t.fs) != null ? c : 10) * 1.6;
|
2263
2252
|
let l = 0, s = 0;
|
2264
2253
|
switch (r) {
|
2265
2254
|
case ae.TOP:
|
@@ -2274,13 +2263,13 @@ let rn = class {
|
|
2274
2263
|
}
|
2275
2264
|
switch (n) {
|
2276
2265
|
case Ye.LEFT:
|
2277
|
-
l =
|
2266
|
+
l = ft;
|
2278
2267
|
break;
|
2279
2268
|
case Ye.RIGHT:
|
2280
|
-
l =
|
2269
|
+
l = ft + (i - a);
|
2281
2270
|
break;
|
2282
2271
|
default:
|
2283
|
-
l =
|
2272
|
+
l = ft + (i - a) / 2;
|
2284
2273
|
break;
|
2285
2274
|
}
|
2286
2275
|
return {
|
@@ -2301,23 +2290,23 @@ let rn = class {
|
|
2301
2290
|
return ((r = t == null ? void 0 : t.fs) != null ? r : 10) * 1.6;
|
2302
2291
|
}
|
2303
2292
|
async _parseFormula(e, t, r) {
|
2304
|
-
var
|
2305
|
-
const { formula1: n =
|
2293
|
+
var c, u, h, d, m, g, M, y, p;
|
2294
|
+
const { formula1: n = ni, formula2: i = ti } = e, o = await this._formulaService.getRuleFormulaResult(t, r, e.uid), a = Ft((h = (u = (c = o == null ? void 0 : o[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Ft((g = (m = (d = o == null ? void 0 : o[1]) == null ? void 0 : d.result) == null ? void 0 : m[0]) == null ? void 0 : g[0]), s = Dn(String(a)) && Dn(String(l));
|
2306
2295
|
return {
|
2307
|
-
formula1: De(n) ?
|
2296
|
+
formula1: De(n) ? Ft((p = (y = (M = o == null ? void 0 : o[0]) == null ? void 0 : M.result) == null ? void 0 : y[0]) == null ? void 0 : p[0]) : n,
|
2308
2297
|
formula2: De(i) ? l : i,
|
2309
2298
|
isFormulaValid: s
|
2310
2299
|
};
|
2311
2300
|
}
|
2312
2301
|
drawWith(e, t) {
|
2313
2302
|
var P, A, L, V;
|
2314
|
-
const { style: r, primaryWithCoord: n, unitId: i, subUnitId: o, worksheet: a, row: l, col: s } = t,
|
2303
|
+
const { style: r, primaryWithCoord: n, unitId: i, subUnitId: o, worksheet: a, row: l, col: s } = t, c = n.isMergedMainCell ? n.mergeInfo : n, u = Q(a.getCellRaw(l, s)), h = this._dataValidationModel.getRuleByLocation(i, o, l, s);
|
2315
2304
|
if (!h)
|
2316
2305
|
return;
|
2317
|
-
const
|
2318
|
-
if (!
|
2306
|
+
const d = this._dataValidationModel.getValidator(h.type);
|
2307
|
+
if (!d || !((P = d.skipDefaultFontRender) != null && P.call(d, h, u, { unitId: i, subUnitId: o, row: l, column: s })))
|
2319
2308
|
return;
|
2320
|
-
const m =
|
2309
|
+
const m = d.parseFormulaSync(h, i, o), { formula1: g } = m, M = this._calc(c, r), { a: y, d: p } = e.getTransform(), S = Ln(M.left, y), v = Ln(M.top, p), C = mi.create().composeMatrix({
|
2321
2310
|
left: S,
|
2322
2311
|
top: v,
|
2323
2312
|
scaleX: 1,
|
@@ -2327,12 +2316,12 @@ let rn = class {
|
|
2327
2316
|
skewY: 0,
|
2328
2317
|
flipX: !1,
|
2329
2318
|
flipY: !1
|
2330
|
-
}), w =
|
2331
|
-
e.save(), e.beginPath(), e.rect(
|
2319
|
+
}), w = c.endX - c.startX, I = c.endY - c.startY;
|
2320
|
+
e.save(), e.beginPath(), e.rect(c.startX, c.startY, w, I), e.clip();
|
2332
2321
|
const R = C.getMatrix();
|
2333
2322
|
e.transform(R[0], R[1], R[2], R[3], R[4], R[5]);
|
2334
2323
|
const T = ((A = r == null ? void 0 : r.fs) != null ? A : 10) * 1.6, N = String(u) === String(g), D = this._themeService.getColorFromTheme("primary.600");
|
2335
|
-
|
2324
|
+
fi.drawWith(e, {
|
2336
2325
|
checked: N,
|
2337
2326
|
width: T,
|
2338
2327
|
height: T,
|
@@ -2340,20 +2329,20 @@ let rn = class {
|
|
2340
2329
|
}), e.restore();
|
2341
2330
|
}
|
2342
2331
|
isHit(e, t) {
|
2343
|
-
const r = t.primaryWithCoord.isMergedMainCell ? t.primaryWithCoord.mergeInfo : t.primaryWithCoord, n = this._calc(r, t.style), i = n.top, o = n.top + n.height, a = n.left, l = n.left + n.width, { x: s, y:
|
2344
|
-
return s <= l && s >= a &&
|
2332
|
+
const r = t.primaryWithCoord.isMergedMainCell ? t.primaryWithCoord.mergeInfo : t.primaryWithCoord, n = this._calc(r, t.style), i = n.top, o = n.top + n.height, a = n.left, l = n.left + n.width, { x: s, y: c } = e;
|
2333
|
+
return s <= l && s >= a && c <= o && c >= i;
|
2345
2334
|
}
|
2346
2335
|
async onPointerDown(e, t) {
|
2347
2336
|
var g;
|
2348
2337
|
if (t.button === 2)
|
2349
2338
|
return;
|
2350
|
-
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s = Q(o.getCellRaw(a, l)),
|
2351
|
-
if (!
|
2339
|
+
const { primaryWithCoord: r, unitId: n, subUnitId: i, worksheet: o, row: a, col: l } = e, s = Q(o.getCellRaw(a, l)), c = this._dataValidationModel.getRuleByLocation(n, i, a, l);
|
2340
|
+
if (!c)
|
2352
2341
|
return;
|
2353
|
-
const u = this._dataValidationModel.getValidator(
|
2354
|
-
if (!u || !((g = u.skipDefaultFontRender) != null && g.call(u,
|
2342
|
+
const u = this._dataValidationModel.getValidator(c.type);
|
2343
|
+
if (!u || !((g = u.skipDefaultFontRender) != null && g.call(u, c, s, { unitId: n, subUnitId: i, row: a, column: l })))
|
2355
2344
|
return;
|
2356
|
-
const { formula1: h, formula2:
|
2345
|
+
const { formula1: h, formula2: d } = await this._parseFormula(c, n, i), m = {
|
2357
2346
|
range: {
|
2358
2347
|
startColumn: r.actualColumn,
|
2359
2348
|
endColumn: r.actualColumn,
|
@@ -2361,7 +2350,7 @@ let rn = class {
|
|
2361
2350
|
endRow: r.actualRow
|
2362
2351
|
},
|
2363
2352
|
value: {
|
2364
|
-
v: String(s) ===
|
2353
|
+
v: String(s) === ri(String(h)) ? d : h,
|
2365
2354
|
p: null
|
2366
2355
|
}
|
2367
2356
|
};
|
@@ -2372,114 +2361,114 @@ let rn = class {
|
|
2372
2361
|
}
|
2373
2362
|
onPointerEnter(e, t) {
|
2374
2363
|
var r, n;
|
2375
|
-
(n = (r = Ke(
|
2364
|
+
(n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(Ge.POINTER);
|
2376
2365
|
}
|
2377
2366
|
onPointerLeave(e, t) {
|
2378
2367
|
var r, n;
|
2379
|
-
(n = (r = Ke(
|
2368
|
+
(n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(Ge.DEFAULT);
|
2380
2369
|
}
|
2381
2370
|
};
|
2382
|
-
|
2371
|
+
an = Uo([
|
2383
2372
|
Be(0, J),
|
2384
2373
|
Be(1, le),
|
2385
|
-
Be(2,
|
2386
|
-
Be(3,
|
2387
|
-
Be(4,
|
2388
|
-
Be(5,
|
2389
|
-
],
|
2390
|
-
class
|
2374
|
+
Be(2, b(ei)),
|
2375
|
+
Be(3, b(Kn)),
|
2376
|
+
Be(4, b(Ne)),
|
2377
|
+
Be(5, b(ee))
|
2378
|
+
], an);
|
2379
|
+
class Fo extends fe {
|
2391
2380
|
constructor() {
|
2392
2381
|
super(...arguments);
|
2393
2382
|
E(this, "id", G.CHECKBOX);
|
2394
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2395
|
-
E(this, "formulaInput",
|
2383
|
+
E(this, "canvasRender", this.injector.createInstance(an));
|
2384
|
+
E(this, "formulaInput", Qn);
|
2396
2385
|
}
|
2397
2386
|
}
|
2398
|
-
class
|
2387
|
+
class xo extends fe {
|
2399
2388
|
constructor() {
|
2400
2389
|
super(...arguments);
|
2401
2390
|
E(this, "id", G.CUSTOM);
|
2402
|
-
E(this, "formulaInput",
|
2391
|
+
E(this, "formulaInput", Jn);
|
2403
2392
|
}
|
2404
2393
|
}
|
2405
|
-
const
|
2406
|
-
class
|
2394
|
+
const $o = "data-validation.formula-input";
|
2395
|
+
class Bo extends fe {
|
2407
2396
|
constructor() {
|
2408
2397
|
super(...arguments);
|
2409
2398
|
E(this, "id", G.DATE);
|
2410
|
-
E(this, "formulaInput",
|
2411
|
-
E(this, "optionsInput",
|
2399
|
+
E(this, "formulaInput", $o);
|
2400
|
+
E(this, "optionsInput", Tt.componentKey);
|
2412
2401
|
E(this, "dropdownType", ge.DATE);
|
2413
2402
|
}
|
2414
2403
|
}
|
2415
|
-
class
|
2404
|
+
class Ho extends fe {
|
2416
2405
|
constructor() {
|
2417
2406
|
super(...arguments);
|
2418
2407
|
E(this, "id", G.DECIMAL);
|
2419
|
-
E(this, "formulaInput",
|
2408
|
+
E(this, "formulaInput", At);
|
2420
2409
|
}
|
2421
2410
|
}
|
2422
|
-
const
|
2423
|
-
function
|
2424
|
-
const r =
|
2411
|
+
const Or = 4, Wo = 0, jt = 4, Tr = 4, sn = 6, Pt = 6, Ee = 14;
|
2412
|
+
function jo(e, t) {
|
2413
|
+
const r = _i.getTextSize(e, t), n = r.width + Or * 2, { ba: i, bd: o } = r, a = i + o;
|
2425
2414
|
return {
|
2426
2415
|
width: n,
|
2427
|
-
height: a +
|
2416
|
+
height: a + Wo * 2,
|
2428
2417
|
ba: i
|
2429
2418
|
};
|
2430
2419
|
}
|
2431
|
-
function
|
2432
|
-
const i = Ee +
|
2433
|
-
layout:
|
2434
|
-
text:
|
2420
|
+
function Yt(e, t, r, n) {
|
2421
|
+
const i = Ee + sn * 2, o = r - i, a = n - Pt * 2, l = e.map((d) => ({
|
2422
|
+
layout: jo(d, t),
|
2423
|
+
text: d
|
2435
2424
|
}));
|
2436
2425
|
let s;
|
2437
|
-
const
|
2438
|
-
l.forEach((
|
2439
|
-
const { layout: m } =
|
2440
|
-
!s || s.width + g +
|
2426
|
+
const c = [];
|
2427
|
+
l.forEach((d) => {
|
2428
|
+
const { layout: m } = d, { width: g, height: M } = m;
|
2429
|
+
!s || s.width + g + jt > o ? (s = {
|
2441
2430
|
width: g,
|
2442
|
-
height:
|
2431
|
+
height: M,
|
2443
2432
|
items: [{
|
2444
|
-
...
|
2433
|
+
...d,
|
2445
2434
|
left: 0
|
2446
2435
|
}]
|
2447
|
-
},
|
2448
|
-
...
|
2449
|
-
left: s.width +
|
2450
|
-
}), s.width = s.width + g +
|
2436
|
+
}, c.push(s)) : (s.items.push({
|
2437
|
+
...d,
|
2438
|
+
left: s.width + jt
|
2439
|
+
}), s.width = s.width + g + jt);
|
2451
2440
|
});
|
2452
2441
|
let u = 0, h = 0;
|
2453
|
-
return
|
2454
|
-
h = Math.max(h,
|
2442
|
+
return c.forEach((d, m) => {
|
2443
|
+
h = Math.max(h, d.width), m === c.length - 1 ? u += d.height : u += d.height + Tr;
|
2455
2444
|
}), {
|
2456
|
-
lines:
|
2445
|
+
lines: c,
|
2457
2446
|
totalHeight: u,
|
2458
2447
|
contentWidth: o,
|
2459
2448
|
contentHeight: a,
|
2460
|
-
cellAutoHeight: u +
|
2449
|
+
cellAutoHeight: u + Pt * 2,
|
2461
2450
|
calcAutoWidth: h + i
|
2462
2451
|
};
|
2463
2452
|
}
|
2464
|
-
const
|
2465
|
-
class
|
2453
|
+
const Yo = 8;
|
2454
|
+
class Xo extends Si {
|
2466
2455
|
static drawWith(t, r) {
|
2467
2456
|
const { fontString: n, info: i, fill: o, color: a } = r, { layout: l, text: s } = i;
|
2468
|
-
t.save(),
|
2457
|
+
t.save(), ur.drawWith(t, {
|
2469
2458
|
width: l.width,
|
2470
2459
|
height: l.height,
|
2471
|
-
radius:
|
2460
|
+
radius: Yo,
|
2472
2461
|
fill: o || He
|
2473
|
-
}), t.translateWithPrecision(
|
2462
|
+
}), t.translateWithPrecision(Or, l.ba), t.font = n, t.fillStyle = a, t.fillText(s, 0, 0), t.restore();
|
2474
2463
|
}
|
2475
2464
|
}
|
2476
|
-
var
|
2477
|
-
for (var i = n > 1 ? void 0 : n ?
|
2465
|
+
var zo = Object.getOwnPropertyDescriptor, Ko = (e, t, r, n) => {
|
2466
|
+
for (var i = n > 1 ? void 0 : n ? zo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2478
2467
|
(a = e[o]) && (i = a(i) || i);
|
2479
2468
|
return i;
|
2480
|
-
},
|
2481
|
-
const
|
2482
|
-
let
|
2469
|
+
}, _t = (e, t) => (r, n) => t(r, n, e);
|
2470
|
+
const Go = 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");
|
2471
|
+
let ln = class {
|
2483
2472
|
constructor(e, t, r, n) {
|
2484
2473
|
E(this, "zIndex");
|
2485
2474
|
E(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2503,47 +2492,47 @@ let an = class {
|
|
2503
2492
|
a = n - Ee + 4;
|
2504
2493
|
break;
|
2505
2494
|
}
|
2506
|
-
e.save(), e.translateWithPrecision(t.startX + o, t.startY + a), e.fillStyle = "#565656", e.fill(
|
2495
|
+
e.save(), e.translateWithPrecision(t.startX + o, t.startY + a), e.fillStyle = "#565656", e.fill(Go), e.restore();
|
2507
2496
|
}
|
2508
2497
|
// eslint-disable-next-line max-lines-per-function
|
2509
2498
|
drawWith(e, t, r, n) {
|
2510
|
-
var Z,
|
2511
|
-
const { primaryWithCoord: i, row: o, col: a, style: l, data: s, subUnitId:
|
2499
|
+
var Z, z;
|
2500
|
+
const { primaryWithCoord: i, row: o, col: a, style: l, data: s, subUnitId: c } = t, u = i.isMergedMainCell ? i.mergeInfo : i, h = s == null ? void 0 : s.fontRenderExtension, { leftOffset: d = 0, rightOffset: m = 0, topOffset: g = 0, downOffset: M = 0 } = h || {}, y = this._ensureMap(c), p = this._generateKey(o, a), S = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, o, a);
|
2512
2501
|
if (!S)
|
2513
2502
|
return;
|
2514
2503
|
const v = this._dataValidationModel.getValidator(S.type);
|
2515
2504
|
if (!v)
|
2516
2505
|
return;
|
2517
2506
|
const C = {
|
2518
|
-
startX: u.startX +
|
2507
|
+
startX: u.startX + d,
|
2519
2508
|
endX: u.endX - m,
|
2520
2509
|
startY: u.startY + g,
|
2521
|
-
endY: u.endY -
|
2522
|
-
}, w = C.endX - C.startX, I = C.endY - C.startY, { cl: R } = l || {}, T = (Z = typeof R == "object" ? R == null ? void 0 : R.rgb : R) != null ? Z : "#000", N =
|
2523
|
-
this._drawDownIcon(e, C, w, I, A), e.save(), e.translateWithPrecision(C.startX, C.startY), e.beginPath(), e.rect(0, 0, w - Ee, I), e.clip(), e.translateWithPrecision(
|
2524
|
-
let
|
2510
|
+
endY: u.endY - M
|
2511
|
+
}, w = C.endX - C.startX, I = C.endY - C.startY, { cl: R } = l || {}, T = (Z = typeof R == "object" ? R == null ? void 0 : R.rgb : R) != null ? Z : "#000", N = xt(l != null ? l : void 0), { vt: D, ht: P } = l || {}, A = D != null ? D : ae.MIDDLE, L = (z = Q(s)) != null ? z : "", V = v.parseCellValue(L), F = v.getListWithColorMap(S), x = Yt(V, N, w, I);
|
2512
|
+
this._drawDownIcon(e, C, w, I, A), e.save(), e.translateWithPrecision(C.startX, C.startY), e.beginPath(), e.rect(0, 0, w - Ee, I), e.clip(), e.translateWithPrecision(sn, Pt);
|
2513
|
+
let X = 0;
|
2525
2514
|
switch (A) {
|
2526
2515
|
case ae.MIDDLE:
|
2527
|
-
|
2516
|
+
X = (x.contentHeight - x.totalHeight) / 2;
|
2528
2517
|
break;
|
2529
2518
|
case ae.BOTTOM:
|
2530
|
-
|
2519
|
+
X = x.contentHeight - x.totalHeight;
|
2531
2520
|
break;
|
2532
2521
|
}
|
2533
|
-
e.translateWithPrecision(0,
|
2522
|
+
e.translateWithPrecision(0, X), x.lines.forEach((te, pe) => {
|
2534
2523
|
e.save();
|
2535
|
-
const { width:
|
2524
|
+
const { width: ce, height: ne, items: de } = te;
|
2536
2525
|
let Se = 0;
|
2537
2526
|
switch (P) {
|
2538
2527
|
case Ye.RIGHT:
|
2539
|
-
Se = x.contentWidth -
|
2528
|
+
Se = x.contentWidth - ce;
|
2540
2529
|
break;
|
2541
2530
|
case Ye.CENTER:
|
2542
|
-
Se = (x.contentWidth -
|
2531
|
+
Se = (x.contentWidth - ce) / 2;
|
2543
2532
|
break;
|
2544
2533
|
}
|
2545
|
-
e.translate(Se, pe * (ne +
|
2546
|
-
e.save(), e.translateWithPrecision(ve.left, 0),
|
2534
|
+
e.translate(Se, pe * (ne + Tr)), de.forEach((ve) => {
|
2535
|
+
e.save(), e.translateWithPrecision(ve.left, 0), Xo.drawWith(e, {
|
2547
2536
|
...N,
|
2548
2537
|
info: ve,
|
2549
2538
|
color: T,
|
@@ -2553,16 +2542,16 @@ let an = class {
|
|
2553
2542
|
}), e.restore(), y.set(p, {
|
2554
2543
|
left: C.startX,
|
2555
2544
|
top: C.startY,
|
2556
|
-
width: x.contentWidth +
|
2557
|
-
height: x.contentHeight +
|
2545
|
+
width: x.contentWidth + sn + Ee,
|
2546
|
+
height: x.contentHeight + Pt * 2
|
2558
2547
|
});
|
2559
2548
|
}
|
2560
2549
|
calcCellAutoHeight(e) {
|
2561
2550
|
var w;
|
2562
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset:
|
2551
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: c = 0, downOffset: u = 0 } = a || {}, h = t.isMergedMainCell ? t.mergeInfo : t, d = {
|
2563
2552
|
startX: h.startX + l,
|
2564
2553
|
endX: h.endX - s,
|
2565
|
-
startY: h.startY +
|
2554
|
+
startY: h.startY + c,
|
2566
2555
|
endY: h.endY - u
|
2567
2556
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2568
2557
|
if (!m)
|
@@ -2570,15 +2559,15 @@ let an = class {
|
|
2570
2559
|
const g = this._dataValidationModel.getValidator(m.type);
|
2571
2560
|
if (!g)
|
2572
2561
|
return;
|
2573
|
-
const
|
2574
|
-
return
|
2562
|
+
const M = d.endX - d.startX, y = d.endY - d.startY, p = (w = Q(n)) != null ? w : "", S = g.parseCellValue(p), v = xt(r != null ? r : void 0);
|
2563
|
+
return Yt(S, v, M, y).cellAutoHeight;
|
2575
2564
|
}
|
2576
2565
|
calcCellAutoWidth(e) {
|
2577
2566
|
var w;
|
2578
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset:
|
2567
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = n == null ? void 0 : n.fontRenderExtension, { leftOffset: l = 0, rightOffset: s = 0, topOffset: c = 0, downOffset: u = 0 } = a || {}, h = t.isMergedMainCell ? t.mergeInfo : t, d = {
|
2579
2568
|
startX: h.startX + l,
|
2580
2569
|
endX: h.endX - s,
|
2581
|
-
startY: h.startY +
|
2570
|
+
startY: h.startY + c,
|
2582
2571
|
endY: h.endY - u
|
2583
2572
|
}, m = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2584
2573
|
if (!m)
|
@@ -2586,8 +2575,8 @@ let an = class {
|
|
2586
2575
|
const g = this._dataValidationModel.getValidator(m.type);
|
2587
2576
|
if (!g)
|
2588
2577
|
return;
|
2589
|
-
const
|
2590
|
-
return
|
2578
|
+
const M = d.endX - d.startX, y = d.endY - d.startY, p = (w = Q(n)) != null ? w : "", S = g.parseCellValue(p), v = xt(r != null ? r : void 0);
|
2579
|
+
return Yt(S, v, M, y).calcAutoWidth;
|
2591
2580
|
}
|
2592
2581
|
isHit(e, t) {
|
2593
2582
|
const { primaryWithCoord: r } = t, n = r.isMergedMainCell ? r.mergeInfo : r, { endX: i } = n, { x: o } = e;
|
@@ -2602,43 +2591,43 @@ let an = class {
|
|
2602
2591
|
row: i,
|
2603
2592
|
column: o
|
2604
2593
|
};
|
2605
|
-
this._commandService.executeCommand(
|
2594
|
+
this._commandService.executeCommand(kt.id, a);
|
2606
2595
|
}
|
2607
2596
|
onPointerEnter(e, t) {
|
2608
2597
|
var r, n;
|
2609
|
-
return (n = (r = Ke(
|
2598
|
+
return (n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null ? void 0 : n.setCursor(Ge.POINTER);
|
2610
2599
|
}
|
2611
2600
|
onPointerLeave(e, t) {
|
2612
2601
|
var r, n;
|
2613
|
-
return (n = (r = Ke(
|
2602
|
+
return (n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null ? void 0 : n.setCursor(Ge.DEFAULT);
|
2614
2603
|
}
|
2615
2604
|
};
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
],
|
2622
|
-
class
|
2605
|
+
ln = Ko([
|
2606
|
+
_t(0, J),
|
2607
|
+
_t(1, le),
|
2608
|
+
_t(2, b(Ne)),
|
2609
|
+
_t(3, b(ee))
|
2610
|
+
], ln);
|
2611
|
+
class Zo extends fe {
|
2623
2612
|
constructor() {
|
2624
2613
|
super(...arguments);
|
2625
2614
|
E(this, "id", G.LIST_MULTIPLE);
|
2626
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2615
|
+
E(this, "canvasRender", this.injector.createInstance(ln));
|
2627
2616
|
E(this, "dropdownType", ge.MULTIPLE_LIST);
|
2628
2617
|
}
|
2629
2618
|
}
|
2630
|
-
var
|
2631
|
-
for (var i = n > 1 ? void 0 : n ?
|
2619
|
+
var qo = Object.getOwnPropertyDescriptor, Jo = (e, t, r, n) => {
|
2620
|
+
for (var i = n > 1 ? void 0 : n ? qo(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2632
2621
|
(a = e[o]) && (i = a(i) || i);
|
2633
2622
|
return i;
|
2634
2623
|
}, at = (e, t) => (r, n) => t(r, n, e);
|
2635
|
-
const
|
2636
|
-
function
|
2624
|
+
const be = 4, St = 4, he = 14, me = 6, We = 4, Xt = 8, Qo = "#565656", Bn = 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");
|
2625
|
+
function ea(e, t) {
|
2637
2626
|
const r = e.length;
|
2638
2627
|
return {
|
2639
2628
|
id: "d",
|
2640
2629
|
body: {
|
2641
|
-
dataStream: `${e}${
|
2630
|
+
dataStream: `${e}${Kr}`,
|
2642
2631
|
textRuns: [
|
2643
2632
|
{
|
2644
2633
|
ts: {
|
@@ -2673,22 +2662,22 @@ function Qo(e, t) {
|
|
2673
2662
|
}
|
2674
2663
|
};
|
2675
2664
|
}
|
2676
|
-
function
|
2677
|
-
const n =
|
2665
|
+
function Pr(e, t, r) {
|
2666
|
+
const n = ea(e, r), i = new zr(n), o = new Ii(i);
|
2678
2667
|
return {
|
2679
|
-
documentSkeleton:
|
2668
|
+
documentSkeleton: wi.create(o, t),
|
2680
2669
|
docModel: i,
|
2681
2670
|
docViewModel: o
|
2682
2671
|
};
|
2683
2672
|
}
|
2684
|
-
function
|
2673
|
+
function Ct(e, t, r) {
|
2685
2674
|
const {
|
2686
2675
|
documentSkeleton: n,
|
2687
2676
|
docModel: i,
|
2688
2677
|
docViewModel: o
|
2689
|
-
} =
|
2678
|
+
} = Pr(e, t, r);
|
2690
2679
|
return {
|
2691
|
-
documents: new
|
2680
|
+
documents: new Ci(`DOCUMENTS_${Zt.generateRandomId()}`, n, {
|
2692
2681
|
pageMarginLeft: 0,
|
2693
2682
|
pageMarginTop: 0
|
2694
2683
|
}),
|
@@ -2697,7 +2686,7 @@ function St(e, t, r) {
|
|
2697
2686
|
docViewModel: o
|
2698
2687
|
};
|
2699
2688
|
}
|
2700
|
-
function
|
2689
|
+
function Hn(e, t, r, n, i, o, a = !0) {
|
2701
2690
|
let l = 0;
|
2702
2691
|
const s = a ? We : 0;
|
2703
2692
|
switch (i) {
|
@@ -2712,21 +2701,21 @@ function $n(e, t, r, n, i, o, a = !0) {
|
|
2712
2701
|
break;
|
2713
2702
|
}
|
2714
2703
|
l = Math.max(We, l);
|
2715
|
-
let
|
2704
|
+
let c = 0;
|
2716
2705
|
switch (o) {
|
2717
2706
|
case Ye.CENTER:
|
2718
|
-
|
2707
|
+
c = (e - r) / 2;
|
2719
2708
|
break;
|
2720
2709
|
case Ye.RIGHT:
|
2721
|
-
|
2710
|
+
c = e - r;
|
2722
2711
|
break;
|
2723
2712
|
}
|
2724
|
-
return
|
2725
|
-
paddingLeft:
|
2713
|
+
return c = Math.max(me, c), {
|
2714
|
+
paddingLeft: c,
|
2726
2715
|
paddingTop: l
|
2727
2716
|
};
|
2728
2717
|
}
|
2729
|
-
let
|
2718
|
+
let cn = class {
|
2730
2719
|
constructor(e, t, r, n, i) {
|
2731
2720
|
E(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2732
2721
|
E(this, "zIndex");
|
@@ -2740,88 +2729,88 @@ let sn = class {
|
|
2740
2729
|
return `${e}.${t}`;
|
2741
2730
|
}
|
2742
2731
|
_drawDownIcon(e, t, r, n, i, o, a) {
|
2743
|
-
const { t: l = re.pd.t, b: s = re.pd.b } = a,
|
2732
|
+
const { t: l = re.pd.t, b: s = re.pd.b } = a, c = r - he;
|
2744
2733
|
let u;
|
2745
2734
|
switch (o) {
|
2746
2735
|
case ae.MIDDLE:
|
2747
|
-
u = (n -
|
2736
|
+
u = (n - St) / 2;
|
2748
2737
|
break;
|
2749
2738
|
case ae.BOTTOM:
|
2750
|
-
u = n - s - i - We + (i / 2 -
|
2739
|
+
u = n - s - i - We + (i / 2 - St / 2);
|
2751
2740
|
break;
|
2752
2741
|
default:
|
2753
|
-
u = l + We + (i / 2 -
|
2742
|
+
u = l + We + (i / 2 - St / 2);
|
2754
2743
|
break;
|
2755
2744
|
}
|
2756
|
-
e.save(), e.translateWithPrecision(t.startX +
|
2745
|
+
e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(Bn), e.restore();
|
2757
2746
|
}
|
2758
2747
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2759
2748
|
drawWith(e, t, r) {
|
2760
|
-
const { primaryWithCoord: n, row: i, col: o, style: a, data: l, subUnitId: s } = t,
|
2749
|
+
const { primaryWithCoord: n, row: i, col: o, style: a, data: l, subUnitId: s } = t, c = n.isMergedMainCell ? n.mergeInfo : n, u = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, i, o);
|
2761
2750
|
if (!u)
|
2762
2751
|
return;
|
2763
2752
|
const h = this._dataValidationModel.getValidator(u.type);
|
2764
2753
|
if (!h)
|
2765
2754
|
return;
|
2766
|
-
const
|
2755
|
+
const d = l == null ? void 0 : l.fontRenderExtension, { leftOffset: m = 0, rightOffset: g = 0, topOffset: M = 0, downOffset: y = 0 } = d || {};
|
2767
2756
|
if (!u || !h || !h || h.id.indexOf(G.LIST) !== 0 || !h.skipDefaultFontRender(u))
|
2768
2757
|
return;
|
2769
2758
|
const p = {
|
2770
|
-
startX:
|
2771
|
-
endX:
|
2772
|
-
startY:
|
2773
|
-
endY:
|
2759
|
+
startX: c.startX + m,
|
2760
|
+
endX: c.endX - g,
|
2761
|
+
startY: c.startY + M,
|
2762
|
+
endY: c.endY - y
|
2774
2763
|
}, S = p.endX - p.startX, v = p.endY - p.startY, C = this._ensureMap(s), w = this._generateKey(i, o), I = h.getListWithColor(u), R = Q(l), T = `${R != null ? R : ""}`, N = I.find((V) => V.label === T);
|
2775
2764
|
let { tb: D, vt: P, ht: A, pd: L } = a || {};
|
2776
2765
|
if (D = D != null ? D : Ie.WRAP, P = P != null ? P : ae.BOTTOM, A = A != null ? A : re.ht, L = L != null ? L : re.pd, u.renderMode === ie.ARROW) {
|
2777
|
-
const { l: V = re.pd.l, t: F = re.pd.t, r: x = re.pd.r, b:
|
2778
|
-
D === Ie.WRAP && pe.updateDocumentDataPageSize(Math.max(Z, 1)),
|
2779
|
-
const
|
2780
|
-
this._drawDownIcon(e, p, S, v, ne, P, L), e.save(), e.translateWithPrecision(p.startX + V, p.startY + F), e.beginPath(), e.rect(0, 0, S - V - x, v - F -
|
2766
|
+
const { l: V = re.pd.l, t: F = re.pd.t, r: x = re.pd.r, b: X = re.pd.b } = L, Z = S - V - x - he - 4, { documentSkeleton: z, documents: te, docModel: pe } = Ct(T, this._localeService, a);
|
2767
|
+
D === Ie.WRAP && pe.updateDocumentDataPageSize(Math.max(Z, 1)), z.calculate(), z.getActualSize();
|
2768
|
+
const ce = it(z), { height: ne, width: de } = ce, { paddingTop: Se, paddingLeft: ve } = Hn(Z, v - F - X, de, ne, P, A, !0);
|
2769
|
+
this._drawDownIcon(e, p, S, v, ne, P, L), e.save(), e.translateWithPrecision(p.startX + V, p.startY + F), e.beginPath(), e.rect(0, 0, S - V - x, v - F - X), e.clip(), e.translateWithPrecision(0, Se), e.save(), e.translateWithPrecision(be, 0), e.beginPath(), e.rect(0, 0, Z, ne), e.clip(), te.render(e), e.translateWithPrecision(ve, 0), e.restore(), e.restore(), C.set(w, {
|
2781
2770
|
left: p.endX + V + r.rowHeaderWidth - he,
|
2782
2771
|
top: p.startY + F + r.columnHeaderHeight,
|
2783
2772
|
width: he,
|
2784
|
-
height: v - F -
|
2773
|
+
height: v - F - X
|
2785
2774
|
});
|
2786
2775
|
} else {
|
2787
2776
|
e.save(), e.translateWithPrecision(p.startX, p.startY), e.beginPath(), e.rect(0, 0, S, v), e.clip();
|
2788
|
-
const V = S - me * 2 -
|
2789
|
-
D === Ie.WRAP &&
|
2790
|
-
const Z = it(F), { height:
|
2777
|
+
const V = S - me * 2 - be - he - 4, { documentSkeleton: F, documents: x, docModel: X } = Ct(T, this._localeService, a);
|
2778
|
+
D === Ie.WRAP && X.updateDocumentDataPageSize(Math.max(V, 1)), F.calculate();
|
2779
|
+
const Z = it(F), { height: z, width: te } = Z, { paddingTop: pe, paddingLeft: ce } = Hn(V, v, te, z, P, A);
|
2791
2780
|
e.translateWithPrecision(me, pe);
|
2792
|
-
const ne = Math.max(S - me * 2, 1),
|
2793
|
-
|
2781
|
+
const ne = Math.max(S - me * 2, 1), de = z;
|
2782
|
+
ur.drawWith(e, {
|
2794
2783
|
width: ne,
|
2795
|
-
height:
|
2784
|
+
height: de,
|
2796
2785
|
fill: (N == null ? void 0 : N.color) || He,
|
2797
|
-
radius:
|
2798
|
-
}), e.save(), e.translateWithPrecision(
|
2786
|
+
radius: Xt
|
2787
|
+
}), e.save(), e.translateWithPrecision(be, 0), e.beginPath(), e.rect(0, 0, V, z), e.clip(), e.translateWithPrecision(ce, 0), x.render(e), e.restore(), e.translateWithPrecision(V + be + 4, (z - St) / 2), e.fillStyle = Qo, e.fill(Bn), e.restore(), C.set(w, {
|
2799
2788
|
left: p.startX + me + r.rowHeaderWidth,
|
2800
2789
|
top: p.startY + pe + r.columnHeaderHeight,
|
2801
2790
|
width: ne,
|
2802
|
-
height:
|
2791
|
+
height: de
|
2803
2792
|
});
|
2804
2793
|
}
|
2805
2794
|
}
|
2806
2795
|
calcCellAutoHeight(e) {
|
2807
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset:
|
2808
|
-
if (!
|
2796
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2797
|
+
if (!d || d.renderMode === ie.TEXT)
|
2809
2798
|
return;
|
2810
2799
|
const m = {
|
2811
2800
|
startX: a.startX + s,
|
2812
|
-
endX: a.endX -
|
2801
|
+
endX: a.endX - c,
|
2813
2802
|
startY: a.startY + u,
|
2814
2803
|
endY: a.endY - h
|
2815
|
-
}, g = m.endX - m.startX,
|
2804
|
+
}, g = m.endX - m.startX, M = Q(n), y = `${M != null ? M : ""}`;
|
2816
2805
|
let { tb: p, pd: S } = r || {};
|
2817
2806
|
const { t: v = re.pd.t, b: C = re.pd.b } = S != null ? S : {};
|
2818
|
-
if (p = p != null ? p : Ie.WRAP,
|
2819
|
-
const w = g - he, { documentSkeleton: I, docModel: R } =
|
2807
|
+
if (p = p != null ? p : Ie.WRAP, d.renderMode === ie.ARROW) {
|
2808
|
+
const w = g - he, { documentSkeleton: I, docModel: R } = Ct(y, this._localeService, r);
|
2820
2809
|
p === Ie.WRAP && R.updateDocumentDataPageSize(Math.max(w, 1)), I.calculate(), I.getActualSize();
|
2821
2810
|
const T = it(I), { height: N } = T;
|
2822
2811
|
return N + v + C + We * 2;
|
2823
2812
|
} else {
|
2824
|
-
const w = g - me * 2 -
|
2813
|
+
const w = g - me * 2 - be - he, { documentSkeleton: I, docModel: R } = Pr(y, this._localeService, r);
|
2825
2814
|
p === Ie.WRAP && R.updateDocumentDataPageSize(Math.max(w, 1)), I.calculate();
|
2826
2815
|
const T = it(I), {
|
2827
2816
|
height: N
|
@@ -2830,39 +2819,39 @@ let sn = class {
|
|
2830
2819
|
}
|
2831
2820
|
}
|
2832
2821
|
calcCellAutoWidth(e) {
|
2833
|
-
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset:
|
2834
|
-
if (!
|
2822
|
+
const { primaryWithCoord: t, style: r, data: n, row: i, col: o } = e, a = t.isMergedMainCell ? t.mergeInfo : t, l = n == null ? void 0 : n.fontRenderExtension, { leftOffset: s = 0, rightOffset: c = 0, topOffset: u = 0, downOffset: h = 0 } = l || {}, d = this._dataValidationModel.getRuleByLocation(e.unitId, e.subUnitId, i, o);
|
2823
|
+
if (!d || d.renderMode === ie.TEXT)
|
2835
2824
|
return;
|
2836
2825
|
const m = {
|
2837
2826
|
startX: a.startX + s,
|
2838
|
-
endX: a.endX -
|
2827
|
+
endX: a.endX - c,
|
2839
2828
|
startY: a.startY + u,
|
2840
2829
|
endY: a.endY - h
|
2841
|
-
}, g = m.endX - m.startX,
|
2830
|
+
}, g = m.endX - m.startX, M = Q(n), y = `${M != null ? M : ""}`;
|
2842
2831
|
let { tb: p, pd: S } = r || {};
|
2843
2832
|
const { l: v = re.pd.l, r: C = re.pd.r } = S != null ? S : {};
|
2844
2833
|
p = p != null ? p : Ie.WRAP;
|
2845
2834
|
let w = me * 2 + he;
|
2846
|
-
switch (
|
2835
|
+
switch (d.renderMode) {
|
2847
2836
|
case ie.ARROW:
|
2848
2837
|
w = he + me * 2 + C + v;
|
2849
2838
|
break;
|
2850
2839
|
case ie.CUSTOM:
|
2851
|
-
w = he + me * 2 +
|
2840
|
+
w = he + me * 2 + be * 2 + C + v + Xt / 2 + 1;
|
2852
2841
|
break;
|
2853
2842
|
// default is CUSTOM
|
2854
2843
|
default:
|
2855
|
-
w = he + me * 2 +
|
2844
|
+
w = he + me * 2 + be * 2 + C + v + Xt / 2 + 1;
|
2856
2845
|
}
|
2857
|
-
const I = g - w, { documentSkeleton: R, docModel: T } =
|
2846
|
+
const I = g - w, { documentSkeleton: R, docModel: T } = Ct(y, this._localeService, r);
|
2858
2847
|
return p === Ie.WRAP && T.updateDocumentDataPageSize(Math.max(I, 1)), R.calculate(), R.getActualSize(), it(R).width + w;
|
2859
2848
|
}
|
2860
2849
|
isHit(e, t) {
|
2861
2850
|
const { subUnitId: r, row: n, col: i } = t, a = this._ensureMap(r).get(this._generateKey(n, i)), l = this._dataValidationModel.getRuleByLocation(t.unitId, t.subUnitId, n, i);
|
2862
2851
|
if (!l || !a || l.renderMode === ie.TEXT)
|
2863
2852
|
return !1;
|
2864
|
-
const { top: s, left:
|
2865
|
-
return
|
2853
|
+
const { top: s, left: c, width: u, height: h } = a, { x: d, y: m } = e;
|
2854
|
+
return d >= c && d <= c + u && m >= s && m <= s + h;
|
2866
2855
|
}
|
2867
2856
|
onPointerDown(e, t) {
|
2868
2857
|
if (t.button === 2)
|
@@ -2873,64 +2862,64 @@ let sn = class {
|
|
2873
2862
|
row: i,
|
2874
2863
|
column: o
|
2875
2864
|
};
|
2876
|
-
this._commandService.executeCommand(
|
2865
|
+
this._commandService.executeCommand(kt.id, a);
|
2877
2866
|
}
|
2878
2867
|
onPointerEnter(e, t) {
|
2879
2868
|
var r, n;
|
2880
|
-
(n = (r = Ke(
|
2869
|
+
(n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(Ge.POINTER);
|
2881
2870
|
}
|
2882
2871
|
onPointerLeave(e, t) {
|
2883
2872
|
var r, n;
|
2884
|
-
(n = (r = Ke(
|
2873
|
+
(n = (r = Ke(Y.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.mainComponent) == null || n.setCursor(Ge.DEFAULT);
|
2885
2874
|
}
|
2886
2875
|
};
|
2887
|
-
|
2876
|
+
cn = Jo([
|
2888
2877
|
at(0, le),
|
2889
|
-
at(1,
|
2878
|
+
at(1, b(se)),
|
2890
2879
|
at(2, J),
|
2891
|
-
at(3,
|
2892
|
-
at(4,
|
2893
|
-
],
|
2894
|
-
class
|
2880
|
+
at(3, b(Ne)),
|
2881
|
+
at(4, b(ee))
|
2882
|
+
], cn);
|
2883
|
+
class ta extends fe {
|
2895
2884
|
constructor() {
|
2896
2885
|
super(...arguments);
|
2897
2886
|
E(this, "id", G.LIST);
|
2898
|
-
E(this, "canvasRender", this.injector.createInstance(
|
2887
|
+
E(this, "canvasRender", this.injector.createInstance(cn));
|
2899
2888
|
E(this, "dropdownType", ge.LIST);
|
2900
|
-
E(this, "optionsInput",
|
2901
|
-
E(this, "formulaInput",
|
2889
|
+
E(this, "optionsInput", Ot.componentKey);
|
2890
|
+
E(this, "formulaInput", hn);
|
2902
2891
|
}
|
2903
2892
|
}
|
2904
|
-
class
|
2893
|
+
class na extends fe {
|
2905
2894
|
constructor() {
|
2906
2895
|
super(...arguments);
|
2907
2896
|
E(this, "id", G.TEXT_LENGTH);
|
2908
|
-
E(this, "formulaInput",
|
2897
|
+
E(this, "formulaInput", At);
|
2909
2898
|
}
|
2910
2899
|
}
|
2911
|
-
class
|
2900
|
+
class ra extends fe {
|
2912
2901
|
constructor() {
|
2913
2902
|
super(...arguments);
|
2914
2903
|
E(this, "id", G.WHOLE);
|
2915
|
-
E(this, "formulaInput",
|
2904
|
+
E(this, "formulaInput", At);
|
2916
2905
|
}
|
2917
2906
|
}
|
2918
|
-
var
|
2919
|
-
for (var i = n > 1 ? void 0 : n ?
|
2907
|
+
var ia = Object.getOwnPropertyDescriptor, oa = (e, t, r, n) => {
|
2908
|
+
for (var i = n > 1 ? void 0 : n ? ia(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2920
2909
|
(a = e[o]) && (i = a(i) || i);
|
2921
2910
|
return i;
|
2922
|
-
},
|
2923
|
-
let tt = class extends
|
2911
|
+
}, zt = (e, t) => (r, n) => t(r, n, e);
|
2912
|
+
let tt = class extends un {
|
2924
2913
|
constructor(e, t, r) {
|
2925
2914
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = r, this._initComponents(), this._registerValidatorViews();
|
2926
2915
|
}
|
2927
2916
|
_initComponents() {
|
2928
2917
|
[
|
2929
|
-
[br,
|
2930
|
-
[
|
2931
|
-
[
|
2932
|
-
[
|
2933
|
-
...
|
2918
|
+
[br, Cr],
|
2919
|
+
[Dt, Ao],
|
2920
|
+
[Ot.componentKey, Ot],
|
2921
|
+
[Tt.componentKey, Tt],
|
2922
|
+
...eo
|
2934
2923
|
].forEach(([e, t]) => {
|
2935
2924
|
this.disposeWithMe(this._componentManger.register(
|
2936
2925
|
e,
|
@@ -2940,47 +2929,47 @@ let tt = class extends dn {
|
|
2940
2929
|
}
|
2941
2930
|
_registerValidatorViews() {
|
2942
2931
|
[
|
2943
|
-
|
2932
|
+
Ho,
|
2933
|
+
ra,
|
2944
2934
|
na,
|
2935
|
+
Bo,
|
2936
|
+
Fo,
|
2945
2937
|
ta,
|
2946
|
-
|
2947
|
-
|
2948
|
-
ea,
|
2949
|
-
Go,
|
2950
|
-
Fo
|
2938
|
+
Zo,
|
2939
|
+
xo
|
2951
2940
|
].forEach((e) => {
|
2952
2941
|
const t = this._injector.createInstance(e), r = this._dataValidatorRegistryService.getValidatorItem(t.id);
|
2953
2942
|
r && (r.formulaInput = t.formulaInput, r.canvasRender = t.canvasRender, r.dropdownType = t.dropdownType, r.optionsInput = t.optionsInput);
|
2954
2943
|
});
|
2955
2944
|
}
|
2956
2945
|
};
|
2957
|
-
tt =
|
2958
|
-
|
2959
|
-
|
2960
|
-
|
2946
|
+
tt = oa([
|
2947
|
+
zt(0, b(we)),
|
2948
|
+
zt(1, b(mn)),
|
2949
|
+
zt(2, b(ye))
|
2961
2950
|
], tt);
|
2962
|
-
var
|
2963
|
-
for (var i = n > 1 ? void 0 : n ?
|
2951
|
+
var aa = Object.getOwnPropertyDescriptor, sa = (e, t, r, n) => {
|
2952
|
+
for (var i = n > 1 ? void 0 : n ? aa(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
2964
2953
|
(a = e[o]) && (i = a(i) || i);
|
2965
2954
|
return i;
|
2966
|
-
},
|
2967
|
-
const
|
2968
|
-
var
|
2969
|
-
let
|
2970
|
-
constructor(e =
|
2955
|
+
}, Kt = (e, t) => (r, n) => t(r, n, e);
|
2956
|
+
const la = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2957
|
+
var It;
|
2958
|
+
let Wn = (It = class extends Gn {
|
2959
|
+
constructor(e = Et, t, r, n) {
|
2971
2960
|
super(), this._config = e, this._injector = t, this._commandService = r, this._configService = n;
|
2972
|
-
const { menu: i, ...o } =
|
2961
|
+
const { menu: i, ...o } = Zn(
|
2973
2962
|
{},
|
2974
|
-
|
2963
|
+
Et,
|
2975
2964
|
this._config
|
2976
2965
|
);
|
2977
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
2966
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(wn, o);
|
2978
2967
|
}
|
2979
2968
|
onStarting() {
|
2980
2969
|
[
|
2981
2970
|
[_e],
|
2982
2971
|
[Ae],
|
2983
|
-
[
|
2972
|
+
[ut],
|
2984
2973
|
[qe],
|
2985
2974
|
[et],
|
2986
2975
|
[Qe],
|
@@ -2990,20 +2979,20 @@ let Bn = (Ct = class extends zn {
|
|
2990
2979
|
].forEach((e) => {
|
2991
2980
|
this._injector.add(e);
|
2992
2981
|
}), [
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2982
|
+
Nt,
|
2983
|
+
kt,
|
2984
|
+
Mr,
|
2985
|
+
Rn,
|
2997
2986
|
Fe,
|
2998
|
-
|
2987
|
+
yr
|
2999
2988
|
].forEach((e) => {
|
3000
2989
|
this._commandService.registerCommand(e);
|
3001
2990
|
});
|
3002
2991
|
}
|
3003
2992
|
onReady() {
|
3004
|
-
this._injector.get(Je), this._injector.get(Qe), this._injector.get(Ze), this._injector.get(
|
3005
|
-
|
3006
|
-
[
|
2993
|
+
this._injector.get(Je), this._injector.get(Qe), this._injector.get(Ze), this._injector.get(ut), this._injector.get(Ne).registerRenderModule(
|
2994
|
+
Y.UNIVER_SHEET,
|
2995
|
+
[Vt]
|
3007
2996
|
);
|
3008
2997
|
}
|
3009
2998
|
onRendered() {
|
@@ -3012,34 +3001,34 @@ let Bn = (Ct = class extends zn {
|
|
3012
3001
|
onSteady() {
|
3013
3002
|
this._injector.get(qe);
|
3014
3003
|
}
|
3015
|
-
}, E(
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
],
|
3021
|
-
var
|
3022
|
-
for (var i = n > 1 ? void 0 : n ?
|
3004
|
+
}, E(It, "pluginName", la), E(It, "type", Y.UNIVER_SHEET), It);
|
3005
|
+
Wn = sa([
|
3006
|
+
Kt(1, b(we)),
|
3007
|
+
Kt(2, J),
|
3008
|
+
Kt(3, dn)
|
3009
|
+
], Wn);
|
3010
|
+
var ca = Object.getOwnPropertyDescriptor, da = (e, t, r, n) => {
|
3011
|
+
for (var i = n > 1 ? void 0 : n ? ca(t, r) : t, o = e.length - 1, a; o >= 0; o--)
|
3023
3012
|
(a = e[o]) && (i = a(i) || i);
|
3024
3013
|
return i;
|
3025
|
-
},
|
3026
|
-
const
|
3027
|
-
var
|
3028
|
-
let
|
3029
|
-
constructor(e =
|
3014
|
+
}, Gt = (e, t) => (r, n) => t(r, n, e);
|
3015
|
+
const ua = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
3016
|
+
var wt;
|
3017
|
+
let jn = (wt = class extends Gn {
|
3018
|
+
constructor(e = Et, t, r, n) {
|
3030
3019
|
super(), this._config = e, this._injector = t, this._commandService = r, this._configService = n;
|
3031
|
-
const { menu: i, ...o } =
|
3020
|
+
const { menu: i, ...o } = Zn(
|
3032
3021
|
{},
|
3033
|
-
|
3022
|
+
Et,
|
3034
3023
|
this._config
|
3035
3024
|
);
|
3036
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
3025
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(wn, o);
|
3037
3026
|
}
|
3038
3027
|
onStarting() {
|
3039
3028
|
[
|
3040
3029
|
[_e],
|
3041
3030
|
[Ae],
|
3042
|
-
[
|
3031
|
+
[ut],
|
3043
3032
|
[qe],
|
3044
3033
|
[et],
|
3045
3034
|
[Qe],
|
@@ -3048,20 +3037,20 @@ let Hn = (It = class extends zn {
|
|
3048
3037
|
].forEach((e) => {
|
3049
3038
|
this._injector.add(e);
|
3050
3039
|
}), [
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3040
|
+
Nt,
|
3041
|
+
kt,
|
3042
|
+
Mr,
|
3043
|
+
Rn,
|
3055
3044
|
Fe,
|
3056
|
-
|
3045
|
+
yr
|
3057
3046
|
].forEach((e) => {
|
3058
3047
|
this._commandService.registerCommand(e);
|
3059
3048
|
});
|
3060
3049
|
}
|
3061
3050
|
onReady() {
|
3062
3051
|
this._injector.get(Je), this._injector.get(Qe), this._injector.get(Ne).registerRenderModule(
|
3063
|
-
|
3064
|
-
[
|
3052
|
+
Y.UNIVER_SHEET,
|
3053
|
+
[Vt]
|
3065
3054
|
);
|
3066
3055
|
}
|
3067
3056
|
onRendered() {
|
@@ -3070,14 +3059,14 @@ let Hn = (It = class extends zn {
|
|
3070
3059
|
onSteady() {
|
3071
3060
|
this._injector.get(qe);
|
3072
3061
|
}
|
3073
|
-
}, E(
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
|
3078
|
-
],
|
3062
|
+
}, E(wt, "pluginName", ua), E(wt, "type", Y.UNIVER_SHEET), wt);
|
3063
|
+
jn = da([
|
3064
|
+
Gt(1, b(we)),
|
3065
|
+
Gt(2, J),
|
3066
|
+
Gt(3, dn)
|
3067
|
+
], jn);
|
3079
3068
|
export {
|
3080
3069
|
fe as BaseSheetDataValidatorView,
|
3081
|
-
|
3082
|
-
|
3070
|
+
jn as UniverSheetsDataValidationMobileUIPlugin,
|
3071
|
+
Wn as UniverSheetsDataValidationUIPlugin
|
3083
3072
|
};
|