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