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