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