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