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