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