@univerjs/sheets-data-validation 0.2.3 → 0.2.4-alpha.0
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 +2 -2
- package/lib/es/index.js +986 -971
- package/lib/types/commands/commands/data-validation.command.d.ts +1 -2
- package/lib/types/controllers/dv-auto-fill.controller.d.ts +1 -2
- package/lib/types/controllers/dv-copy-paste.controller.d.ts +1 -2
- package/lib/types/controllers/dv-model.controller.d.ts +1 -2
- package/lib/types/controllers/dv-ref-range.controller.d.ts +1 -2
- package/lib/types/controllers/dv-render.controller.d.ts +1 -2
- package/lib/types/controllers/dv.controller.d.ts +1 -2
- package/lib/types/controllers/dv.menu.d.ts +1 -1
- package/lib/types/mobile-plugin.d.ts +1 -2
- package/lib/types/models/sheet-data-validation-manager.d.ts +1 -2
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/data-validation-panel.service.d.ts +1 -2
- package/lib/types/services/dropdown-manager.service.d.ts +2 -2
- package/lib/types/services/dv.service.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +26 -28
package/lib/es/index.js
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
var fo = Object.defineProperty;
|
|
2
|
-
var po = (
|
|
3
|
-
var S = (
|
|
4
|
-
import { DEFAULT_EMPTY_DOCUMENT_VALUE as cr, Disposable as
|
|
5
|
-
import { ICommandService as
|
|
6
|
-
import {
|
|
7
|
-
import { DataValidatorRegistryService as we, DataValidationModel as q, BaseDataValidator as Ye, DataValidatorRegistryScope as Eo, TWO_FORMULA_OPERATOR_COUNT as bo, getRuleOptions as ma, getRuleSetting as fa, RemoveDataValidationCommand as pr, createDefaultNewRule as gr, RemoveAllDataValidationCommand as Oo, TextLengthErrorTitleMap as No, AddDataValidationMutation as pa, RemoveDataValidationMutation as Ot, UpdateRuleType as me, UpdateDataValidationMutation as pe, removeDataValidationUndoFactory as To, DataValidationManager as Fo, AddDataValidationCommand as Lo, UniverDataValidationPlugin as vr } from "@univerjs/data-validation";
|
|
2
|
+
var po = (a, t, e) => t in a ? fo(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var S = (a, t, e) => po(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { DEFAULT_EMPTY_DOCUMENT_VALUE as cr, useDependency as $, Inject as I, Disposable as ue, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as go, DisposableCollection as ur, IUniverInstanceService as J, UniverInstanceType as re, toDisposable as Ea, CommandType as Ie, ICommandService as ee, ObjectMatrix as ke, Range as W, isFormulaString as A, ThemeService as vo, VerticalAlign as me, HorizontalAlign as Be, createInternalEditorID as ba, LocaleService as ie, OnLifecycle as ve, LifecycleStages as _e, IPermissionService as _o, DataValidationType as B, Tools as Y, DataValidationOperator as V, DataValidationErrorStyle as st, UndoCommand as So, RedoCommand as Ro, isUnitRangesEqual as Co, isValidRange as Vo, debounce as Mo, shallowEqual as Ga, Injector as Ee, DataValidationRenderMode as le, WrapStrategy as se, DocumentDataModel as Io, BooleanNumber as ot, Rectangle as Ue, IUndoRedoService as Ht, sequenceExecuteAsync as hr, sequenceExecute as Oa, Optional as wo, RxDisposable as Na, DataValidationStatus as Ce, isRangesEqual as yo, queryObjectMatrix as Kt, IResourceManagerService as Do, DependentOn as mr, Plugin as fr } from "@univerjs/core";
|
|
5
|
+
import { ICommandService as Gl, LocaleService as ql, Plugin as zl } from "@univerjs/core";
|
|
6
|
+
import { DataValidatorRegistryService as we, DataValidationModel as z, BaseDataValidator as Ye, DataValidatorRegistryScope as Eo, TWO_FORMULA_OPERATOR_COUNT as bo, getRuleOptions as ma, getRuleSetting as fa, RemoveDataValidationCommand as pr, createDefaultNewRule as gr, RemoveAllDataValidationCommand as Oo, TextLengthErrorTitleMap as No, AddDataValidationMutation as pa, RemoveDataValidationMutation as Ot, UpdateRuleType as fe, UpdateDataValidationMutation as pe, removeDataValidationUndoFactory as To, DataValidationManager as Fo, AddDataValidationCommand as Lo, UniverDataValidationPlugin as vr } from "@univerjs/data-validation";
|
|
8
7
|
import { getSheetCommandTarget as Wt, SetRangeValuesCommand as Ta, WorksheetViewPermission as Po, SetRangeValuesMutation as Nt, SetRangeValuesUndoMutationFactory as _r, WorkbookEditablePermission as ga, WorksheetSetCellStylePermission as va, WorksheetEditPermission as _a, RangeProtectionPermissionEditPoint as Sa, SheetInterceptorService as Fa, INTERCEPTOR_POINT as Sr, SheetsSelectionsService as Ao, ClearSelectionAllCommand as xo, RefRangeService as jo, handleCommonDefaultRangeChangeWithEffectRefCommands as $o, UniverSheetsPlugin as Rr } from "@univerjs/sheets";
|
|
9
8
|
import { SheetCanvasPopManagerService as Bo, IMarkSelectionService as Uo, IEditorBridgeService as La, getCurrentRangeDisable$ as Ho, AutoHeightController as Cr, SheetSkeletonManagerService as Tt, HoverManagerService as Wo, CellAlertManagerService as ko, CellAlertType as Yo, IAutoFillService as Xo, APPLY_TYPE as Ct, virtualizeDiscreteRanges as Ra, getAutoFillRepeatRange as Go, COPY_TYPE as qa, rangeToDiscreteRange as qo, PREDEFINED_HOOK_NAME as Vt, getRepeatRange as za, ISheetClipboardService as zo, SheetPermissionInterceptorBaseController as Ko, UniverSheetsUIPlugin as Vr } from "@univerjs/sheets-ui";
|
|
10
9
|
import { useObservable as Xe, ComponentManager as St, IZenZoneService as Qo, ISidebarService as Mr, TextEditor as Ir, useEvent as wr, RangeSelector as Zo, KeyCode as Jo, IDialogService as en, MenuItemType as Pa, MenuPosition as tn, MenuGroup as an, getMenuHiddenObservable as rn, IMenuService as on } from "@univerjs/ui";
|
|
11
10
|
import { IRenderManagerService as Aa, fixLineWidthByScale as Ka, Transform as nn, Checkbox as sn, DeviceInputEventType as ln, getDocsSkeletonPageSize as Mt, Rect as yr, DocumentViewModel as dn, DocumentSkeleton as cn, Documents as un, FontCache as hn, Shape as mn, getFontStyleString as Qa } from "@univerjs/engine-render";
|
|
12
11
|
import { Subject as Dr, filter as fn, BehaviorSubject as Za, distinctUntilChanged as pn, debounceTime as gn } from "rxjs";
|
|
13
12
|
import Ca, { forwardRef as Te, useRef as xa, createElement as Fe, useState as te, useEffect as Ze, useMemo as Ft } from "react";
|
|
14
|
-
import { useDependency as $ } from "@wendellhu/redi/react-bindings";
|
|
15
13
|
import { RegisterOtherFormulaService as Er, FormulaRefRangeService as vn } from "@univerjs/sheets-formula";
|
|
16
14
|
import { FormLayout as Z, Input as je, RadioGroup as ja, Radio as $e, DraggableList as _n, Select as Va, Checkbox as $a, Button as He, RectPopup as Sn, Scrollbar as Rn, DatePanel as Cn } from "@univerjs/design";
|
|
17
15
|
import Vn from "clsx";
|
|
18
16
|
import { LexerTreeBuilder as Ba, deserializeRangeWithSheet as br, serializeRange as Or, isReferenceString as Ua, sequenceNodeType as Mn, isFormulaTransformable as In, transformFormula as Ja } from "@univerjs/engine-formula";
|
|
19
17
|
import Ve from "dayjs";
|
|
20
18
|
import wn from "@univerjs/engine-numfmt";
|
|
21
|
-
function ae(
|
|
22
|
-
if (
|
|
19
|
+
function ae(a) {
|
|
20
|
+
if (a === null)
|
|
23
21
|
return "";
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
22
|
+
if (a != null && a.p) {
|
|
23
|
+
const t = a == null ? void 0 : a.p.body;
|
|
24
|
+
if (t == null)
|
|
27
25
|
return "";
|
|
28
|
-
const e =
|
|
26
|
+
const e = t.dataStream;
|
|
29
27
|
return e.substring(e.length - 2, e.length) === cr ? e.substring(0, e.length - 2) : e;
|
|
30
28
|
}
|
|
31
|
-
return
|
|
29
|
+
return a == null ? void 0 : a.v;
|
|
32
30
|
}
|
|
33
|
-
function Nr(
|
|
34
|
-
var
|
|
35
|
-
return String((
|
|
31
|
+
function Nr(a) {
|
|
32
|
+
var t;
|
|
33
|
+
return String((t = ae(a)) != null ? t : "");
|
|
36
34
|
}
|
|
37
35
|
var yn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
38
|
-
function Dn(
|
|
39
|
-
return
|
|
36
|
+
function Dn(a) {
|
|
37
|
+
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
40
38
|
}
|
|
41
39
|
var Tr = { exports: {} }, kt = {};
|
|
42
40
|
/**
|
|
@@ -49,12 +47,12 @@ var Tr = { exports: {} }, kt = {};
|
|
|
49
47
|
* LICENSE file in the root directory of this source tree.
|
|
50
48
|
*/
|
|
51
49
|
var En = Ca, bn = Symbol.for("react.element"), On = Symbol.for("react.fragment"), Nn = Object.prototype.hasOwnProperty, Tn = En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Fn = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
52
|
-
function Fr(
|
|
50
|
+
function Fr(a, t, e) {
|
|
53
51
|
var r, o = {}, n = null, i = null;
|
|
54
|
-
e !== void 0 && (n = "" + e),
|
|
55
|
-
for (r in
|
|
56
|
-
if (
|
|
57
|
-
return { $$typeof: bn, type:
|
|
52
|
+
e !== void 0 && (n = "" + e), t.key !== void 0 && (n = "" + t.key), t.ref !== void 0 && (i = t.ref);
|
|
53
|
+
for (r in t) Nn.call(t, r) && !Fn.hasOwnProperty(r) && (o[r] = t[r]);
|
|
54
|
+
if (a && a.defaultProps) for (r in t = a.defaultProps, t) o[r] === void 0 && (o[r] = t[r]);
|
|
55
|
+
return { $$typeof: bn, type: a, key: n, ref: i, props: o, _owner: Tn.current };
|
|
58
56
|
}
|
|
59
57
|
kt.Fragment = On;
|
|
60
58
|
kt.jsx = Fr;
|
|
@@ -62,14 +60,14 @@ kt.jsxs = Fr;
|
|
|
62
60
|
Tr.exports = kt;
|
|
63
61
|
var v = Tr.exports;
|
|
64
62
|
function Ln() {
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
63
|
+
const a = $(Ne), t = Xe(a.activeDropdown$, a.activeDropdown), e = $(St);
|
|
64
|
+
if (!t)
|
|
67
65
|
return null;
|
|
68
|
-
const { location: r, componentKey: o } =
|
|
66
|
+
const { location: r, componentKey: o } = t, n = e.get(o), i = `${r.unitId}-${r.subUnitId}-${r.row}-${r.col}`;
|
|
69
67
|
if (!n)
|
|
70
68
|
return null;
|
|
71
69
|
const s = () => {
|
|
72
|
-
|
|
70
|
+
a.hideDropdown();
|
|
73
71
|
};
|
|
74
72
|
return /* @__PURE__ */ v.jsx(
|
|
75
73
|
n,
|
|
@@ -81,67 +79,69 @@ function Ln() {
|
|
|
81
79
|
);
|
|
82
80
|
}
|
|
83
81
|
const Lr = "sheet.ui.dropdown";
|
|
84
|
-
var Pn = Object.defineProperty, An = Object.getOwnPropertyDescriptor, xn = (
|
|
85
|
-
for (var o = r > 1 ? void 0 : r ? An(
|
|
86
|
-
(i =
|
|
87
|
-
return r && o && Pn(
|
|
88
|
-
}, Ge = (
|
|
89
|
-
let Ne = class extends
|
|
90
|
-
constructor(
|
|
82
|
+
var Pn = Object.defineProperty, An = Object.getOwnPropertyDescriptor, xn = (a, t, e, r) => {
|
|
83
|
+
for (var o = r > 1 ? void 0 : r ? An(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
84
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
85
|
+
return r && o && Pn(t, e, o), o;
|
|
86
|
+
}, Ge = (a, t) => (e, r) => t(e, r, a);
|
|
87
|
+
let Ne = class extends ue {
|
|
88
|
+
constructor(t, e, r, o, n, i) {
|
|
91
89
|
super();
|
|
92
90
|
S(this, "_activeDropdown");
|
|
93
91
|
S(this, "_activeDropdown$", new Dr());
|
|
94
92
|
S(this, "_currentPopup", null);
|
|
95
93
|
S(this, "activeDropdown$", this._activeDropdown$.asObservable());
|
|
96
94
|
S(this, "_zenVisible", !1);
|
|
97
|
-
this._canvasPopupManagerService =
|
|
95
|
+
this._canvasPopupManagerService = t, this._univerInstanceService = e, this._dataValidatorRegistryService = r, this._zenZoneService = o, this._renderManagerService = n, this._dataValidationModel = i, this._init(), this.disposeWithMe(() => {
|
|
96
|
+
this._activeDropdown$.complete();
|
|
97
|
+
});
|
|
98
98
|
}
|
|
99
99
|
get activeDropdown() {
|
|
100
100
|
return this._activeDropdown;
|
|
101
101
|
}
|
|
102
102
|
_init() {
|
|
103
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((
|
|
104
|
-
this._zenVisible =
|
|
103
|
+
this.disposeWithMe(this._zenZoneService.visible$.subscribe((t) => {
|
|
104
|
+
this._zenVisible = t, t && this.hideDropdown();
|
|
105
105
|
}));
|
|
106
106
|
}
|
|
107
|
-
showDropdown(
|
|
108
|
-
const { location:
|
|
107
|
+
showDropdown(t, e = !0) {
|
|
108
|
+
const { location: r } = t, { row: o, col: n } = r;
|
|
109
109
|
if (this._currentPopup && this._currentPopup.dispose(), this._zenVisible)
|
|
110
110
|
return;
|
|
111
|
-
this._activeDropdown =
|
|
112
|
-
const
|
|
113
|
-
r,
|
|
111
|
+
this._activeDropdown = t, this._activeDropdown$.next(this._activeDropdown);
|
|
112
|
+
const i = this._renderManagerService.getRenderById(go), s = this._canvasPopupManagerService.attachPopupToCell(
|
|
114
113
|
o,
|
|
114
|
+
n,
|
|
115
115
|
{
|
|
116
116
|
componentKey: Lr,
|
|
117
117
|
onClickOutside: () => {
|
|
118
|
-
this.hideDropdown();
|
|
118
|
+
e && this.hideDropdown();
|
|
119
119
|
},
|
|
120
120
|
offset: [0, 3],
|
|
121
|
-
excludeOutside: [
|
|
121
|
+
excludeOutside: [i == null ? void 0 : i.engine.getCanvasElement()].filter(Boolean)
|
|
122
122
|
}
|
|
123
123
|
);
|
|
124
|
-
if (!
|
|
124
|
+
if (!s)
|
|
125
125
|
throw new Error("[DataValidationDropdownManagerService]: cannot show dropdown!");
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const l = new ur();
|
|
127
|
+
l.add(s), l.add({
|
|
128
128
|
dispose: () => {
|
|
129
|
-
var
|
|
130
|
-
(
|
|
129
|
+
var d, c;
|
|
130
|
+
(c = (d = this._activeDropdown) == null ? void 0 : d.onHide) == null || c.call(d);
|
|
131
131
|
}
|
|
132
|
-
}), this._currentPopup =
|
|
132
|
+
}), this._currentPopup = l;
|
|
133
133
|
}
|
|
134
134
|
hideDropdown() {
|
|
135
135
|
this._activeDropdown && (this._currentPopup && this._currentPopup.dispose(), this._currentPopup = null, this._activeDropdown = null, this._activeDropdown$.next(null));
|
|
136
136
|
}
|
|
137
|
-
showDataValidationDropdown(
|
|
138
|
-
const i = this._univerInstanceService.getUniverSheetInstance(
|
|
137
|
+
showDataValidationDropdown(t, e, r, o, n) {
|
|
138
|
+
const i = this._univerInstanceService.getUniverSheetInstance(t);
|
|
139
139
|
if (!i)
|
|
140
140
|
return;
|
|
141
141
|
const s = i.getSheetBySheetId(e);
|
|
142
142
|
if (!s)
|
|
143
143
|
return;
|
|
144
|
-
const d = this._dataValidationModel.ensureManager(
|
|
144
|
+
const d = this._dataValidationModel.ensureManager(t, e).getRuleByLocation(r, o);
|
|
145
145
|
if (!d)
|
|
146
146
|
return;
|
|
147
147
|
const c = this._dataValidatorRegistryService.getValidatorItem(d.type);
|
|
@@ -155,7 +155,7 @@ let Ne = class extends fe {
|
|
|
155
155
|
worksheet: s,
|
|
156
156
|
row: r,
|
|
157
157
|
col: o,
|
|
158
|
-
unitId:
|
|
158
|
+
unitId: t,
|
|
159
159
|
subUnitId: e
|
|
160
160
|
},
|
|
161
161
|
componentKey: c.dropdown,
|
|
@@ -169,15 +169,15 @@ Ne = xn([
|
|
|
169
169
|
Ge(2, I(we)),
|
|
170
170
|
Ge(3, Qo),
|
|
171
171
|
Ge(4, Aa),
|
|
172
|
-
Ge(5, I(
|
|
172
|
+
Ge(5, I(z))
|
|
173
173
|
], Ne);
|
|
174
|
-
var jn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Bn = (
|
|
175
|
-
for (var o = r > 1 ? void 0 : r ? $n(
|
|
176
|
-
(i =
|
|
177
|
-
return r && o && jn(
|
|
178
|
-
}, er = (
|
|
179
|
-
let Me = class extends
|
|
180
|
-
constructor(
|
|
174
|
+
var jn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Bn = (a, t, e, r) => {
|
|
175
|
+
for (var o = r > 1 ? void 0 : r ? $n(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
176
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
177
|
+
return r && o && jn(t, e, o), o;
|
|
178
|
+
}, er = (a, t) => (e, r) => t(e, r, a);
|
|
179
|
+
let Me = class extends ue {
|
|
180
|
+
constructor(t, e) {
|
|
181
181
|
super();
|
|
182
182
|
S(this, "_open$", new Za(!1));
|
|
183
183
|
S(this, "open$", this._open$.pipe(pn()));
|
|
@@ -185,7 +185,7 @@ let Me = class extends fe {
|
|
|
185
185
|
S(this, "_activeRule$", new Za(void 0));
|
|
186
186
|
S(this, "activeRule$", this._activeRule$.asObservable());
|
|
187
187
|
S(this, "_closeDisposable", null);
|
|
188
|
-
this._univerInstanceService =
|
|
188
|
+
this._univerInstanceService = t, this._sidebarService = e, this.disposeWithMe(
|
|
189
189
|
this._univerInstanceService.getCurrentTypeOfUnit$(re.UNIVER_SHEET).pipe(fn((r) => !r)).subscribe(() => {
|
|
190
190
|
this.close();
|
|
191
191
|
})
|
|
@@ -198,23 +198,23 @@ let Me = class extends fe {
|
|
|
198
198
|
return this._open$.getValue();
|
|
199
199
|
}
|
|
200
200
|
dispose() {
|
|
201
|
-
var
|
|
202
|
-
super.dispose(), this._open$.next(!1), this._open$.complete(), (
|
|
201
|
+
var t;
|
|
202
|
+
super.dispose(), this._open$.next(!1), this._open$.complete(), this._activeRule$.complete(), (t = this._closeDisposable) == null || t.dispose();
|
|
203
203
|
}
|
|
204
204
|
open() {
|
|
205
205
|
this._open$.next(!0);
|
|
206
206
|
}
|
|
207
207
|
close() {
|
|
208
|
-
var
|
|
209
|
-
this._open$.next(!1), (
|
|
208
|
+
var t;
|
|
209
|
+
this._open$.next(!1), (t = this._closeDisposable) == null || t.dispose();
|
|
210
210
|
}
|
|
211
|
-
setCloseDisposable(
|
|
211
|
+
setCloseDisposable(t) {
|
|
212
212
|
this._closeDisposable = Ea(() => {
|
|
213
|
-
|
|
213
|
+
t.dispose(), this._closeDisposable = null;
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
setActiveRule(
|
|
217
|
-
this._activeRule =
|
|
216
|
+
setActiveRule(t) {
|
|
217
|
+
this._activeRule = t, this._activeRule$.next(t);
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
Me = Bn([
|
|
@@ -224,10 +224,10 @@ Me = Bn([
|
|
|
224
224
|
const Pr = "DataValidationPanel", at = {
|
|
225
225
|
id: "data-validation.operation.open-validation-panel",
|
|
226
226
|
type: Ie.OPERATION,
|
|
227
|
-
handler(
|
|
228
|
-
if (!
|
|
227
|
+
handler(a, t) {
|
|
228
|
+
if (!t)
|
|
229
229
|
return !1;
|
|
230
|
-
const { ruleId: e, isAdd: r } =
|
|
230
|
+
const { ruleId: e, isAdd: r } = t, o = a.get(Me), n = a.get(z), i = a.get(J), s = a.get(Mr), l = Wt(i);
|
|
231
231
|
if (!l) return !1;
|
|
232
232
|
const { unitId: d, subUnitId: c } = l, u = e ? n.getRuleById(d, c, e) : void 0;
|
|
233
233
|
o.open(), o.setActiveRule(u && {
|
|
@@ -246,23 +246,23 @@ const Pr = "DataValidationPanel", at = {
|
|
|
246
246
|
}, Ha = {
|
|
247
247
|
id: "data-validation.operation.close-validation-panel",
|
|
248
248
|
type: Ie.OPERATION,
|
|
249
|
-
handler(
|
|
250
|
-
return
|
|
249
|
+
handler(a) {
|
|
250
|
+
return a.get(Me).close(), !0;
|
|
251
251
|
}
|
|
252
252
|
}, Ar = {
|
|
253
253
|
id: "data-validation.operation.toggle-validation-panel",
|
|
254
254
|
type: Ie.OPERATION,
|
|
255
|
-
handler(
|
|
256
|
-
const
|
|
257
|
-
return e.open(), e.isOpen ?
|
|
255
|
+
handler(a) {
|
|
256
|
+
const t = a.get(ee), e = a.get(Me);
|
|
257
|
+
return e.open(), e.isOpen ? t.executeCommand(Ha.id) : t.executeCommand(at.id), !0;
|
|
258
258
|
}
|
|
259
259
|
}, Yt = {
|
|
260
260
|
type: Ie.OPERATION,
|
|
261
261
|
id: "sheet.operation.show-data-validation-dropdown",
|
|
262
|
-
handler(
|
|
263
|
-
if (!
|
|
262
|
+
handler(a, t) {
|
|
263
|
+
if (!t)
|
|
264
264
|
return !1;
|
|
265
|
-
const e =
|
|
265
|
+
const e = a.get(Ne), { unitId: r, subUnitId: o, row: n, column: i } = t, s = e.activeDropdown, l = s == null ? void 0 : s.location;
|
|
266
266
|
return l && l.unitId === r && l.subUnitId === o && l.row === n && l.col === i || e.showDataValidationDropdown(
|
|
267
267
|
r,
|
|
268
268
|
o,
|
|
@@ -273,31 +273,31 @@ const Pr = "DataValidationPanel", at = {
|
|
|
273
273
|
}, xr = {
|
|
274
274
|
type: Ie.OPERATION,
|
|
275
275
|
id: "sheet.operation.hide-data-validation-dropdown",
|
|
276
|
-
handler(
|
|
277
|
-
return
|
|
276
|
+
handler(a, t) {
|
|
277
|
+
return t ? (a.get(Ne).hideDropdown(), !0) : !1;
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
class rt {
|
|
281
281
|
constructor() {
|
|
282
282
|
S(this, "_cacheMatrix", /* @__PURE__ */ new Map());
|
|
283
283
|
}
|
|
284
|
-
_ensureCache(
|
|
285
|
-
let r = this._cacheMatrix.get(
|
|
286
|
-
r || (r = /* @__PURE__ */ new Map(), this._cacheMatrix.set(
|
|
284
|
+
_ensureCache(t, e) {
|
|
285
|
+
let r = this._cacheMatrix.get(t);
|
|
286
|
+
r || (r = /* @__PURE__ */ new Map(), this._cacheMatrix.set(t, r));
|
|
287
287
|
let o = r.get(e);
|
|
288
288
|
return o || (o = new ke(), r.set(e, o)), o;
|
|
289
289
|
}
|
|
290
|
-
ensureCache(
|
|
291
|
-
return this._ensureCache(
|
|
290
|
+
ensureCache(t, e) {
|
|
291
|
+
return this._ensureCache(t, e);
|
|
292
292
|
}
|
|
293
|
-
addRule(
|
|
294
|
-
this.markRangeDirty(
|
|
293
|
+
addRule(t, e, r) {
|
|
294
|
+
this.markRangeDirty(t, e, r.ranges);
|
|
295
295
|
}
|
|
296
|
-
removeRule(
|
|
297
|
-
this._deleteRange(
|
|
296
|
+
removeRule(t, e, r) {
|
|
297
|
+
this._deleteRange(t, e, r.ranges);
|
|
298
298
|
}
|
|
299
|
-
updateRuleRanges(
|
|
300
|
-
const i = this._ensureCache(
|
|
299
|
+
updateRuleRanges(t, e, r, o, n) {
|
|
300
|
+
const i = this._ensureCache(t, e);
|
|
301
301
|
n.forEach((s) => {
|
|
302
302
|
W.foreach(s, (l, d) => {
|
|
303
303
|
const c = i.getValue(l, d);
|
|
@@ -315,47 +315,47 @@ class rt {
|
|
|
315
315
|
});
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
markRangeDirty(
|
|
319
|
-
const o = this._ensureCache(
|
|
318
|
+
markRangeDirty(t, e, r) {
|
|
319
|
+
const o = this._ensureCache(t, e);
|
|
320
320
|
r.forEach((n) => {
|
|
321
321
|
W.foreach(n, (i, s) => {
|
|
322
322
|
o.setValue(i, s, void 0);
|
|
323
323
|
});
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
markCellDirty(
|
|
327
|
-
this._ensureCache(
|
|
326
|
+
markCellDirty(t, e, r, o) {
|
|
327
|
+
this._ensureCache(t, e).setValue(r, o, void 0);
|
|
328
328
|
}
|
|
329
|
-
_deleteRange(
|
|
330
|
-
const o = this._ensureCache(
|
|
329
|
+
_deleteRange(t, e, r) {
|
|
330
|
+
const o = this._ensureCache(t, e);
|
|
331
331
|
r.forEach((n) => {
|
|
332
332
|
W.foreach(n, (i, s) => {
|
|
333
333
|
o.realDeleteValue(i, s);
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
|
-
getValue(
|
|
338
|
-
return this._ensureCache(
|
|
337
|
+
getValue(t, e, r, o) {
|
|
338
|
+
return this._ensureCache(t, e).getValue(r, o);
|
|
339
339
|
}
|
|
340
|
-
setValue(
|
|
341
|
-
return this._ensureCache(
|
|
340
|
+
setValue(t, e, r, o, n) {
|
|
341
|
+
return this._ensureCache(t, e).setValue(r, o, n);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
var Un = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Wn = (
|
|
345
|
-
for (var o = r > 1 ? void 0 : r ? Hn(
|
|
346
|
-
(i =
|
|
347
|
-
return r && o && Un(
|
|
348
|
-
}, Qt = (
|
|
349
|
-
let ce = class extends
|
|
350
|
-
constructor(
|
|
344
|
+
var Un = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Wn = (a, t, e, r) => {
|
|
345
|
+
for (var o = r > 1 ? void 0 : r ? Hn(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
346
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
347
|
+
return r && o && Un(t, e, o), o;
|
|
348
|
+
}, Qt = (a, t) => (e, r) => t(e, r, a);
|
|
349
|
+
let ce = class extends ue {
|
|
350
|
+
constructor(t, e, r) {
|
|
351
351
|
super();
|
|
352
352
|
S(this, "_formulaRuleMap", /* @__PURE__ */ new Map());
|
|
353
|
-
this._registerOtherFormulaService =
|
|
353
|
+
this._registerOtherFormulaService = t, this._dataValidationCacheService = e, this._dataValidationModel = r, this._initFormulaResultHandler();
|
|
354
354
|
}
|
|
355
355
|
_initFormulaResultHandler() {
|
|
356
|
-
this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((
|
|
357
|
-
for (const e in
|
|
358
|
-
const r =
|
|
356
|
+
this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((t) => {
|
|
357
|
+
for (const e in t) {
|
|
358
|
+
const r = t[e];
|
|
359
359
|
for (const o in r) {
|
|
360
360
|
const n = r[o], i = this._ensureRuleFormulaMap(e, o), s = this._dataValidationModel.ensureManager(e, o);
|
|
361
361
|
n.forEach((l) => {
|
|
@@ -369,44 +369,44 @@ let ce = class extends fe {
|
|
|
369
369
|
}
|
|
370
370
|
}));
|
|
371
371
|
}
|
|
372
|
-
_ensureRuleFormulaMap(
|
|
373
|
-
let r = this._formulaRuleMap.get(
|
|
374
|
-
r || (r = /* @__PURE__ */ new Map(), this._formulaRuleMap.set(
|
|
372
|
+
_ensureRuleFormulaMap(t, e) {
|
|
373
|
+
let r = this._formulaRuleMap.get(t);
|
|
374
|
+
r || (r = /* @__PURE__ */ new Map(), this._formulaRuleMap.set(t, r));
|
|
375
375
|
let o = r.get(e);
|
|
376
376
|
return o || (o = /* @__PURE__ */ new Map(), r.set(e, o)), o;
|
|
377
377
|
}
|
|
378
|
-
addRule(
|
|
378
|
+
addRule(t, e, r, o, n) {
|
|
379
379
|
const i = A(o), s = A(n);
|
|
380
380
|
if (!i && !s)
|
|
381
381
|
return;
|
|
382
|
-
const l = this._ensureRuleFormulaMap(
|
|
382
|
+
const l = this._ensureRuleFormulaMap(t, e), d = [void 0, void 0];
|
|
383
383
|
if (i) {
|
|
384
|
-
const c = this._registerOtherFormulaService.registerFormula(
|
|
384
|
+
const c = this._registerOtherFormulaService.registerFormula(t, e, o, { ruleId: r });
|
|
385
385
|
d[0] = { id: c, text: o };
|
|
386
386
|
}
|
|
387
387
|
if (s) {
|
|
388
|
-
const c = this._registerOtherFormulaService.registerFormula(
|
|
388
|
+
const c = this._registerOtherFormulaService.registerFormula(t, e, n, { ruleId: r });
|
|
389
389
|
d[1] = { id: c, text: n };
|
|
390
390
|
}
|
|
391
391
|
l.set(r, d);
|
|
392
392
|
}
|
|
393
|
-
removeRule(
|
|
394
|
-
const n = this._ensureRuleFormulaMap(
|
|
393
|
+
removeRule(t, e, r) {
|
|
394
|
+
const n = this._ensureRuleFormulaMap(t, e).get(r);
|
|
395
395
|
if (!n)
|
|
396
396
|
return;
|
|
397
397
|
const [i, s] = n, l = [i == null ? void 0 : i.id, s == null ? void 0 : s.id].filter(Boolean);
|
|
398
|
-
l.length && this._registerOtherFormulaService.deleteFormula(
|
|
398
|
+
l.length && this._registerOtherFormulaService.deleteFormula(t, e, l);
|
|
399
399
|
}
|
|
400
|
-
updateRuleFormulaText(
|
|
401
|
-
const s = this._ensureRuleFormulaMap(
|
|
400
|
+
updateRuleFormulaText(t, e, r, o, n) {
|
|
401
|
+
const s = this._ensureRuleFormulaMap(t, e).get(r);
|
|
402
402
|
if (!s) {
|
|
403
|
-
this.addRule(
|
|
403
|
+
this.addRule(t, e, r, o, n);
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
406
|
const [l, d] = s;
|
|
407
407
|
if ((l == null ? void 0 : l.text) !== o)
|
|
408
|
-
if (l && this._registerOtherFormulaService.deleteFormula(
|
|
409
|
-
const c = this._registerOtherFormulaService.registerFormula(
|
|
408
|
+
if (l && this._registerOtherFormulaService.deleteFormula(t, e, [l.id]), A(o)) {
|
|
409
|
+
const c = this._registerOtherFormulaService.registerFormula(t, e, o, { ruleId: r });
|
|
410
410
|
s[0] = {
|
|
411
411
|
text: o,
|
|
412
412
|
id: c
|
|
@@ -414,8 +414,8 @@ let ce = class extends fe {
|
|
|
414
414
|
} else
|
|
415
415
|
s[0] = void 0;
|
|
416
416
|
if ((d == null ? void 0 : d.text) !== n)
|
|
417
|
-
if (d && this._registerOtherFormulaService.deleteFormula(
|
|
418
|
-
const c = this._registerOtherFormulaService.registerFormula(
|
|
417
|
+
if (d && this._registerOtherFormulaService.deleteFormula(t, e, [d.id]), A(n)) {
|
|
418
|
+
const c = this._registerOtherFormulaService.registerFormula(t, e, n, { ruleId: r });
|
|
419
419
|
s[1] = {
|
|
420
420
|
text: n,
|
|
421
421
|
id: c
|
|
@@ -423,56 +423,56 @@ let ce = class extends fe {
|
|
|
423
423
|
} else
|
|
424
424
|
s[1] = void 0;
|
|
425
425
|
}
|
|
426
|
-
getRuleFormulaResult(
|
|
427
|
-
const n = this._ensureRuleFormulaMap(
|
|
426
|
+
getRuleFormulaResult(t, e, r) {
|
|
427
|
+
const n = this._ensureRuleFormulaMap(t, e).get(r);
|
|
428
428
|
if (!n)
|
|
429
429
|
return Promise.resolve(null);
|
|
430
|
-
const i = async (s) => s && this._registerOtherFormulaService.getFormulaValue(
|
|
430
|
+
const i = async (s) => s && this._registerOtherFormulaService.getFormulaValue(t, e, s.id);
|
|
431
431
|
return Promise.all([
|
|
432
432
|
i(n[0]),
|
|
433
433
|
i(n[1])
|
|
434
434
|
]);
|
|
435
435
|
}
|
|
436
|
-
getRuleFormulaResultSync(
|
|
437
|
-
const n = this._ensureRuleFormulaMap(
|
|
436
|
+
getRuleFormulaResultSync(t, e, r) {
|
|
437
|
+
const n = this._ensureRuleFormulaMap(t, e).get(r);
|
|
438
438
|
if (n)
|
|
439
439
|
return n.map((i) => {
|
|
440
440
|
if (i)
|
|
441
|
-
return this._registerOtherFormulaService.getFormulaValueSync(
|
|
441
|
+
return this._registerOtherFormulaService.getFormulaValueSync(t, e, i.id);
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
-
getRuleFormulaInfo(
|
|
445
|
-
return this._ensureRuleFormulaMap(
|
|
444
|
+
getRuleFormulaInfo(t, e, r) {
|
|
445
|
+
return this._ensureRuleFormulaMap(t, e).get(r);
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
448
|
ce = Wn([
|
|
449
449
|
Qt(0, I(Er)),
|
|
450
450
|
Qt(1, I(rt)),
|
|
451
|
-
Qt(2, I(
|
|
451
|
+
Qt(2, I(z))
|
|
452
452
|
], ce);
|
|
453
|
-
function ge(
|
|
454
|
-
var
|
|
455
|
-
return (e = (
|
|
453
|
+
function ge(a) {
|
|
454
|
+
var t, e;
|
|
455
|
+
return (e = (t = a == null ? void 0 : a[0]) == null ? void 0 : t[0]) == null ? void 0 : e.v;
|
|
456
456
|
}
|
|
457
|
-
var kn = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, Xn = (
|
|
458
|
-
for (var o = r > 1 ? void 0 : r ? Yn(
|
|
459
|
-
(i =
|
|
460
|
-
return r && o && kn(
|
|
461
|
-
}, Zt = (
|
|
457
|
+
var kn = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, Xn = (a, t, e, r) => {
|
|
458
|
+
for (var o = r > 1 ? void 0 : r ? Yn(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
459
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
460
|
+
return r && o && kn(t, e, o), o;
|
|
461
|
+
}, Zt = (a, t) => (e, r) => t(e, r, a);
|
|
462
462
|
const It = 6;
|
|
463
463
|
let Ma = class {
|
|
464
|
-
constructor(
|
|
465
|
-
this._commandService =
|
|
464
|
+
constructor(a, t, e) {
|
|
465
|
+
this._commandService = a, this._formulaService = t, this._themeService = e;
|
|
466
466
|
}
|
|
467
|
-
_calc(
|
|
467
|
+
_calc(a, t) {
|
|
468
468
|
var d, c, u;
|
|
469
|
-
const { vt: e, ht: r } =
|
|
469
|
+
const { vt: e, ht: r } = t || {}, o = a.endX - a.startX - It * 2, n = a.endY - a.startY, i = ((d = t == null ? void 0 : t.fs) != null ? d : 10) * 1.6;
|
|
470
470
|
let s = 0, l = 0;
|
|
471
471
|
switch (e) {
|
|
472
|
-
case
|
|
472
|
+
case me.TOP:
|
|
473
473
|
l = 0;
|
|
474
474
|
break;
|
|
475
|
-
case
|
|
475
|
+
case me.BOTTOM:
|
|
476
476
|
l = 0 + (n - i);
|
|
477
477
|
break;
|
|
478
478
|
default:
|
|
@@ -491,34 +491,34 @@ let Ma = class {
|
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
493
493
|
return {
|
|
494
|
-
left:
|
|
495
|
-
top:
|
|
496
|
-
width: ((c =
|
|
497
|
-
height: ((u =
|
|
494
|
+
left: a.startX + s,
|
|
495
|
+
top: a.startY + l,
|
|
496
|
+
width: ((c = t == null ? void 0 : t.fs) != null ? c : 10) * 1.6,
|
|
497
|
+
height: ((u = t == null ? void 0 : t.fs) != null ? u : 10) * 1.6
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
calcCellAutoHeight(
|
|
500
|
+
calcCellAutoHeight(a) {
|
|
501
501
|
var e;
|
|
502
|
-
const { style:
|
|
503
|
-
return ((e =
|
|
502
|
+
const { style: t } = a;
|
|
503
|
+
return ((e = t == null ? void 0 : t.fs) != null ? e : 10) * 1.6;
|
|
504
504
|
}
|
|
505
|
-
async _parseFormula(
|
|
505
|
+
async _parseFormula(a, t, e) {
|
|
506
506
|
var i, s;
|
|
507
|
-
const { formula1: r = gt, formula2: o = vt } =
|
|
507
|
+
const { formula1: r = gt, formula2: o = vt } = a, n = await this._formulaService.getRuleFormulaResult(t, e, a.uid);
|
|
508
508
|
return {
|
|
509
509
|
formula1: A(r) ? ge((i = n == null ? void 0 : n[0]) == null ? void 0 : i.result) : r,
|
|
510
510
|
formula2: A(o) ? ge((s = n == null ? void 0 : n[1]) == null ? void 0 : s.result) : o
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
drawWith(
|
|
513
|
+
drawWith(a, t) {
|
|
514
514
|
var F, b, P, U, O;
|
|
515
|
-
const { style: e, data: r, primaryWithCoord: o, unitId: n, subUnitId: i } =
|
|
515
|
+
const { style: e, data: r, primaryWithCoord: o, unitId: n, subUnitId: i } = t, s = o.isMergedMainCell ? o.mergeInfo : o, l = ae(r), d = (F = r.dataValidation) == null ? void 0 : F.rule, c = (b = r.dataValidation) == null ? void 0 : b.validator;
|
|
516
516
|
if (!d || !c)
|
|
517
517
|
return;
|
|
518
518
|
const u = this._themeService.getCurrentTheme();
|
|
519
519
|
if (!c.skipDefaultFontRender(d, l, { unitId: n, subUnitId: i }))
|
|
520
520
|
return;
|
|
521
|
-
const f = c.parseFormulaSync(d, n, i), { formula1: p } = f, m = this._calc(s, e), { a: h, d: R } =
|
|
521
|
+
const f = c.parseFormulaSync(d, n, i), { formula1: p } = f, m = this._calc(s, e), { a: h, d: R } = a.getTransform(), g = Ka(m.left, h), C = Ka(m.top, R), _ = nn.create().composeMatrix({
|
|
522
522
|
left: g,
|
|
523
523
|
top: C,
|
|
524
524
|
scaleX: 1,
|
|
@@ -528,27 +528,27 @@ let Ma = class {
|
|
|
528
528
|
skewY: 0,
|
|
529
529
|
flipX: !1,
|
|
530
530
|
flipY: !1
|
|
531
|
-
}), M = s.endX - s.startX,
|
|
532
|
-
|
|
531
|
+
}), M = s.endX - s.startX, y = s.endY - s.startY;
|
|
532
|
+
a.save(), a.beginPath(), a.rect(s.startX, s.startY, M, y), a.clip();
|
|
533
533
|
const D = _.getMatrix();
|
|
534
|
-
|
|
534
|
+
a.transform(D[0], D[1], D[2], D[3], D[4], D[5]);
|
|
535
535
|
const E = ((P = e == null ? void 0 : e.fs) != null ? P : 10) * 1.6, x = String(l) === String(p), T = u.hyacinth500;
|
|
536
|
-
sn.drawWith(
|
|
536
|
+
sn.drawWith(a, {
|
|
537
537
|
checked: x,
|
|
538
538
|
width: E,
|
|
539
539
|
height: E,
|
|
540
540
|
fill: (O = (U = e == null ? void 0 : e.cl) == null ? void 0 : U.rgb) != null ? O : T
|
|
541
|
-
}),
|
|
541
|
+
}), a.restore();
|
|
542
542
|
}
|
|
543
|
-
isHit(
|
|
544
|
-
const e =
|
|
543
|
+
isHit(a, t) {
|
|
544
|
+
const e = t.primaryWithCoord.isMergedMainCell ? t.primaryWithCoord.mergeInfo : t.primaryWithCoord, r = this._calc(e, t.style), o = r.top, n = r.top + r.height, i = r.left, s = r.left + r.width, { x: l, y: d } = a;
|
|
545
545
|
return l <= s && l >= i && d <= n && d >= o;
|
|
546
546
|
}
|
|
547
|
-
async onPointerDown(
|
|
547
|
+
async onPointerDown(a, t) {
|
|
548
548
|
var f, p;
|
|
549
|
-
if (
|
|
549
|
+
if (t.button === 2)
|
|
550
550
|
return;
|
|
551
|
-
const { primaryWithCoord: e, unitId: r, subUnitId: o, data: n } =
|
|
551
|
+
const { primaryWithCoord: e, unitId: r, subUnitId: o, data: n } = a, i = ae(n), s = (f = n.dataValidation) == null ? void 0 : f.rule, l = (p = n.dataValidation) == null ? void 0 : p.validator;
|
|
552
552
|
if (!s || !l || !l.skipDefaultFontRender(s, i, { unitId: r, subUnitId: o }))
|
|
553
553
|
return;
|
|
554
554
|
const { formula1: d, formula2: c } = await this._parseFormula(s, r, o), u = {
|
|
@@ -574,14 +574,14 @@ Ma = Xn([
|
|
|
574
574
|
Zt(1, I(ce)),
|
|
575
575
|
Zt(2, I(vo))
|
|
576
576
|
], Ma);
|
|
577
|
-
function Gn(
|
|
577
|
+
function Gn(a) {
|
|
578
578
|
var l;
|
|
579
|
-
const { unitId:
|
|
579
|
+
const { unitId: t, subUnitId: e, value: r, onChange: o, showError: n, validResult: i } = a, s = n ? i == null ? void 0 : i.formula1 : "";
|
|
580
580
|
return /* @__PURE__ */ v.jsx(Z, { error: s, children: /* @__PURE__ */ v.jsx(
|
|
581
581
|
Ir,
|
|
582
582
|
{
|
|
583
583
|
value: (l = r == null ? void 0 : r.formula1) != null ? l : "",
|
|
584
|
-
id: ba(`dataValidation-custom-formula-${
|
|
584
|
+
id: ba(`dataValidation-custom-formula-${t}-${e}`),
|
|
585
585
|
onChange: (d) => {
|
|
586
586
|
o == null || o({
|
|
587
587
|
...r,
|
|
@@ -589,7 +589,7 @@ function Gn(t) {
|
|
|
589
589
|
});
|
|
590
590
|
},
|
|
591
591
|
onlyInputFormula: !0,
|
|
592
|
-
openForSheetUnitId:
|
|
592
|
+
openForSheetUnitId: t,
|
|
593
593
|
openForSheetSubUnitId: e
|
|
594
594
|
}
|
|
595
595
|
) });
|
|
@@ -604,9 +604,9 @@ const qn = "univer-data-validation-formula", zn = "univer-data-validation-formul
|
|
|
604
604
|
dataValidationFormulaColorSelect: ei,
|
|
605
605
|
dataValidationFormulaColorSelectPanel: ti,
|
|
606
606
|
dataValidationFormulaColorItem: ai
|
|
607
|
-
}, ri = (
|
|
608
|
-
const { isTwoFormula:
|
|
609
|
-
return
|
|
607
|
+
}, ri = (a) => {
|
|
608
|
+
const { isTwoFormula: t = !1, value: e, onChange: r, showError: o, validResult: n } = a, i = $(ie), s = o ? n == null ? void 0 : n.formula1 : "", l = o ? n == null ? void 0 : n.formula2 : "";
|
|
609
|
+
return t ? /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
610
610
|
/* @__PURE__ */ v.jsx(Z, { error: s, children: /* @__PURE__ */ v.jsx(
|
|
611
611
|
je,
|
|
612
612
|
{
|
|
@@ -648,132 +648,132 @@ const qn = "univer-data-validation-formula", zn = "univer-data-validation-formul
|
|
|
648
648
|
}
|
|
649
649
|
) });
|
|
650
650
|
};
|
|
651
|
-
var
|
|
652
|
-
return
|
|
653
|
-
for (var
|
|
654
|
-
|
|
655
|
-
for (var o in
|
|
651
|
+
var he = function() {
|
|
652
|
+
return he = Object.assign || function(a) {
|
|
653
|
+
for (var t, e = 1, r = arguments.length; e < r; e++) {
|
|
654
|
+
t = arguments[e];
|
|
655
|
+
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (a[o] = t[o]);
|
|
656
656
|
}
|
|
657
|
-
return
|
|
658
|
-
},
|
|
659
|
-
}, oi = function(
|
|
657
|
+
return a;
|
|
658
|
+
}, he.apply(this, arguments);
|
|
659
|
+
}, oi = function(a, t) {
|
|
660
660
|
var e = {};
|
|
661
|
-
for (var r in
|
|
662
|
-
if (
|
|
663
|
-
for (var o = 0, r = Object.getOwnPropertySymbols(
|
|
664
|
-
|
|
661
|
+
for (var r in a) Object.prototype.hasOwnProperty.call(a, r) && t.indexOf(r) < 0 && (e[r] = a[r]);
|
|
662
|
+
if (a != null && typeof Object.getOwnPropertySymbols == "function")
|
|
663
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(a); o < r.length; o++)
|
|
664
|
+
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(a, r[o]) && (e[r[o]] = a[r[o]]);
|
|
665
665
|
return e;
|
|
666
|
-
}, Le = Te(function(
|
|
667
|
-
var e =
|
|
668
|
-
return jr(e, "".concat(r), { defIds: e.defIds, idSuffix: l.current },
|
|
666
|
+
}, Le = Te(function(a, t) {
|
|
667
|
+
var e = a.icon, r = a.id, o = a.className, n = a.extend, i = oi(a, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), l = xa("_".concat(si()));
|
|
668
|
+
return jr(e, "".concat(r), { defIds: e.defIds, idSuffix: l.current }, he({ ref: t, className: s }, i), n);
|
|
669
669
|
});
|
|
670
|
-
function jr(
|
|
671
|
-
return Fe(
|
|
672
|
-
return jr(n, "".concat(
|
|
670
|
+
function jr(a, t, e, r, o) {
|
|
671
|
+
return Fe(a.tag, he(he({ key: t }, ni(a, e, o)), r), (ii(a, e).children || []).map(function(n, i) {
|
|
672
|
+
return jr(n, "".concat(t, "-").concat(a.tag, "-").concat(i), e, void 0, o);
|
|
673
673
|
}));
|
|
674
674
|
}
|
|
675
|
-
function ni(
|
|
676
|
-
var r =
|
|
675
|
+
function ni(a, t, e) {
|
|
676
|
+
var r = he({}, a.attrs);
|
|
677
677
|
e != null && e.colorChannel1 && r.fill === "colorChannel1" && (r.fill = e.colorChannel1);
|
|
678
|
-
var o =
|
|
679
|
-
return !o || o.length === 0 || (
|
|
678
|
+
var o = t.defIds;
|
|
679
|
+
return !o || o.length === 0 || (a.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(n) {
|
|
680
680
|
var i = n[0], s = n[1];
|
|
681
|
-
typeof s == "string" && (r[i] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(
|
|
681
|
+
typeof s == "string" && (r[i] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
682
682
|
})), r;
|
|
683
683
|
}
|
|
684
|
-
function ii(
|
|
685
|
-
var e, r =
|
|
686
|
-
return !r || r.length === 0 ?
|
|
687
|
-
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ?
|
|
688
|
-
}) }) :
|
|
684
|
+
function ii(a, t) {
|
|
685
|
+
var e, r = t.defIds;
|
|
686
|
+
return !r || r.length === 0 ? a : a.tag === "defs" && (!((e = a.children) === null || e === void 0) && e.length) ? he(he({}, a), { children: a.children.map(function(o) {
|
|
687
|
+
return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? he(he({}, o), { attrs: he(he({}, o.attrs), { id: o.attrs.id + t.idSuffix }) }) : o;
|
|
688
|
+
}) }) : a;
|
|
689
689
|
}
|
|
690
690
|
function si() {
|
|
691
691
|
return Math.random().toString(36).substring(2, 8);
|
|
692
692
|
}
|
|
693
693
|
Le.displayName = "UniverIcon";
|
|
694
|
-
var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, $r = Te(function(
|
|
695
|
-
return Fe(Le, Object.assign({},
|
|
694
|
+
var li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, $r = Te(function(a, t) {
|
|
695
|
+
return Fe(Le, Object.assign({}, a, {
|
|
696
696
|
id: "check-mark-single",
|
|
697
|
-
ref:
|
|
697
|
+
ref: t,
|
|
698
698
|
icon: li
|
|
699
699
|
}));
|
|
700
700
|
});
|
|
701
701
|
$r.displayName = "CheckMarkSingle";
|
|
702
|
-
var di = { 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" } }] }, Br = Te(function(
|
|
703
|
-
return Fe(Le, Object.assign({},
|
|
702
|
+
var di = { 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" } }] }, Br = Te(function(a, t) {
|
|
703
|
+
return Fe(Le, Object.assign({}, a, {
|
|
704
704
|
id: "data-validation-single",
|
|
705
|
-
ref:
|
|
705
|
+
ref: t,
|
|
706
706
|
icon: di
|
|
707
707
|
}));
|
|
708
708
|
});
|
|
709
709
|
Br.displayName = "DataValidationSingle";
|
|
710
|
-
var ci = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Wa = Te(function(
|
|
711
|
-
return Fe(Le, Object.assign({},
|
|
710
|
+
var ci = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Wa = Te(function(a, t) {
|
|
711
|
+
return Fe(Le, Object.assign({}, a, {
|
|
712
712
|
id: "delete-single",
|
|
713
|
-
ref:
|
|
713
|
+
ref: t,
|
|
714
714
|
icon: ci
|
|
715
715
|
}));
|
|
716
716
|
});
|
|
717
717
|
Wa.displayName = "DeleteSingle";
|
|
718
|
-
var ui = { 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" } }] }, Ur = Te(function(
|
|
719
|
-
return Fe(Le, Object.assign({},
|
|
718
|
+
var ui = { 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" } }] }, Ur = Te(function(a, t) {
|
|
719
|
+
return Fe(Le, Object.assign({}, a, {
|
|
720
720
|
id: "increase-single",
|
|
721
|
-
ref:
|
|
721
|
+
ref: t,
|
|
722
722
|
icon: ui
|
|
723
723
|
}));
|
|
724
724
|
});
|
|
725
725
|
Ur.displayName = "IncreaseSingle";
|
|
726
|
-
var hi = { 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" } }] }, Hr = Te(function(
|
|
727
|
-
return Fe(Le, Object.assign({},
|
|
726
|
+
var hi = { 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" } }] }, Hr = Te(function(a, t) {
|
|
727
|
+
return Fe(Le, Object.assign({}, a, {
|
|
728
728
|
id: "more-down-single",
|
|
729
|
-
ref:
|
|
729
|
+
ref: t,
|
|
730
730
|
icon: hi
|
|
731
731
|
}));
|
|
732
732
|
});
|
|
733
733
|
Hr.displayName = "MoreDownSingle";
|
|
734
|
-
var mi = { 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" } }] }, Wr = Te(function(
|
|
735
|
-
return Fe(Le, Object.assign({},
|
|
734
|
+
var mi = { 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" } }] }, Wr = Te(function(a, t) {
|
|
735
|
+
return Fe(Le, Object.assign({}, a, {
|
|
736
736
|
id: "more-up-single",
|
|
737
|
-
ref:
|
|
737
|
+
ref: t,
|
|
738
738
|
icon: mi
|
|
739
739
|
}));
|
|
740
740
|
});
|
|
741
741
|
Wr.displayName = "MoreUpSingle";
|
|
742
|
-
var fi = { 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" } }] }] }, kr = Te(function(
|
|
743
|
-
return Fe(Le, Object.assign({},
|
|
742
|
+
var fi = { 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" } }] }] }, kr = Te(function(a, t) {
|
|
743
|
+
return Fe(Le, Object.assign({}, a, {
|
|
744
744
|
id: "sequence-single",
|
|
745
|
-
ref:
|
|
745
|
+
ref: t,
|
|
746
746
|
icon: fi
|
|
747
747
|
}));
|
|
748
748
|
});
|
|
749
749
|
kr.displayName = "SequenceSingle";
|
|
750
|
-
function Yr(
|
|
751
|
-
return
|
|
750
|
+
function Yr(a) {
|
|
751
|
+
return a.filter(Boolean).join(",");
|
|
752
752
|
}
|
|
753
|
-
function Qe(
|
|
754
|
-
return
|
|
753
|
+
function Qe(a) {
|
|
754
|
+
return a.split(",").filter(Boolean);
|
|
755
755
|
}
|
|
756
|
-
function pi(
|
|
757
|
-
const
|
|
758
|
-
return
|
|
756
|
+
function pi(a) {
|
|
757
|
+
const t = ae(a);
|
|
758
|
+
return t == null ? "" : t.toString();
|
|
759
759
|
}
|
|
760
760
|
const Xt = "SHEET_DATA_VALIDATION_PLUGIN", xe = "#ECECEC";
|
|
761
|
-
var Lt = /* @__PURE__ */ ((
|
|
762
|
-
for (var o = r > 1 ? void 0 : r ? vi(
|
|
763
|
-
(i =
|
|
764
|
-
return r && o && gi(
|
|
765
|
-
}, Jt = (
|
|
766
|
-
let Je = class extends
|
|
767
|
-
constructor(
|
|
768
|
-
super(), this._univerInstanceService =
|
|
769
|
-
}
|
|
770
|
-
getFormulaRefCheck(
|
|
761
|
+
var Lt = /* @__PURE__ */ ((a) => (a[a.View = 0] = "View", a[a.Edit = 1] = "Edit", a[a.ManageCollaborator = 2] = "ManageCollaborator", a[a.Print = 3] = "Print", a[a.Duplicate = 4] = "Duplicate", a[a.Comment = 5] = "Comment", a[a.Copy = 6] = "Copy", a[a.Share = 7] = "Share", a[a.Export = 8] = "Export", a[a.MoveWorksheet = 9] = "MoveWorksheet", a[a.DeleteWorksheet = 10] = "DeleteWorksheet", a[a.HideWorksheet = 11] = "HideWorksheet", a[a.RenameWorksheet = 12] = "RenameWorksheet", a[a.CreateWorksheet = 13] = "CreateWorksheet", a[a.SetWorksheetStyle = 14] = "SetWorksheetStyle", a[a.EditWorksheetCell = 15] = "EditWorksheetCell", a[a.InsertHyperlink = 16] = "InsertHyperlink", a[a.Sort = 17] = "Sort", a[a.Filter = 18] = "Filter", a[a.PivotTable = 19] = "PivotTable", a[a.FloatImg = 20] = "FloatImg", a[a.History = 21] = "History", a[a.RwHgtClWdt = 22] = "RwHgtClWdt", a[a.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", a[a.ViewFilter = 24] = "ViewFilter", a[a.MoveSheet = 25] = "MoveSheet", a[a.DeleteSheet = 26] = "DeleteSheet", a[a.HideSheet = 27] = "HideSheet", a[a.CopySheet = 28] = "CopySheet", a[a.RenameSheet = 29] = "RenameSheet", a[a.CreateSheet = 30] = "CreateSheet", a[a.SelectProtectedCells = 31] = "SelectProtectedCells", a[a.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", a[a.SetCellStyle = 33] = "SetCellStyle", a[a.SetCellValue = 34] = "SetCellValue", a[a.SetRowStyle = 35] = "SetRowStyle", a[a.SetColumnStyle = 36] = "SetColumnStyle", a[a.InsertRow = 37] = "InsertRow", a[a.InsertColumn = 38] = "InsertColumn", a[a.DeleteRow = 39] = "DeleteRow", a[a.DeleteColumn = 40] = "DeleteColumn", a[a.EditExtraObject = 41] = "EditExtraObject", a[a.Delete = 42] = "Delete", a[a.RecoverHistory = 43] = "RecoverHistory", a[a.ViewHistory = 44] = "ViewHistory", a[a.UNRECOGNIZED = -1] = "UNRECOGNIZED", a))(Lt || {}), gi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, _i = (a, t, e, r) => {
|
|
762
|
+
for (var o = r > 1 ? void 0 : r ? vi(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
763
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
764
|
+
return r && o && gi(t, e, o), o;
|
|
765
|
+
}, Jt = (a, t) => (e, r) => t(e, r, a);
|
|
766
|
+
let Je = class extends ue {
|
|
767
|
+
constructor(a, t, e) {
|
|
768
|
+
super(), this._univerInstanceService = a, this._permissionService = t, this._lexerTreeBuilder = e;
|
|
769
|
+
}
|
|
770
|
+
getFormulaRefCheck(a) {
|
|
771
771
|
var e, r;
|
|
772
|
-
const
|
|
773
|
-
if (!
|
|
772
|
+
const t = this._lexerTreeBuilder.sequenceNodesBuilder(a);
|
|
773
|
+
if (!t)
|
|
774
774
|
return !0;
|
|
775
|
-
for (let o = 0; o <
|
|
776
|
-
const n =
|
|
775
|
+
for (let o = 0; o < t.length; o++) {
|
|
776
|
+
const n = t[o];
|
|
777
777
|
if (typeof n == "string")
|
|
778
778
|
continue;
|
|
779
779
|
const { token: i } = n, s = br(i), l = this._univerInstanceService.getCurrentUnitForType(re.UNIVER_SHEET);
|
|
@@ -829,8 +829,8 @@ const Si = [
|
|
|
829
829
|
"#3A60F7",
|
|
830
830
|
"#9E6DE3",
|
|
831
831
|
"#F248A6"
|
|
832
|
-
], Ri = (
|
|
833
|
-
const { value:
|
|
832
|
+
], Ri = (a) => {
|
|
833
|
+
const { value: t, onChange: e, disabled: r } = a, [o, n] = te(!1);
|
|
834
834
|
return /* @__PURE__ */ v.jsx(
|
|
835
835
|
Va,
|
|
836
836
|
{
|
|
@@ -839,7 +839,7 @@ const Si = [
|
|
|
839
839
|
onDropdownVisibleChange: n,
|
|
840
840
|
dropdownStyle: { width: 112 },
|
|
841
841
|
className: de.dataValidationFormulaColorSelect,
|
|
842
|
-
value:
|
|
842
|
+
value: t,
|
|
843
843
|
onChange: e,
|
|
844
844
|
labelRender: (i) => /* @__PURE__ */ v.jsx(
|
|
845
845
|
"div",
|
|
@@ -863,44 +863,44 @@ const Si = [
|
|
|
863
863
|
) })
|
|
864
864
|
}
|
|
865
865
|
);
|
|
866
|
-
}, tr = (
|
|
867
|
-
const { item:
|
|
866
|
+
}, tr = (a) => {
|
|
867
|
+
const { item: t, commonProps: e, style: r } = a, { onItemChange: o, onItemDelete: n } = e;
|
|
868
868
|
return /* @__PURE__ */ v.jsxs("div", { className: de.dataValidationFormulaListItem, style: r, children: [
|
|
869
|
-
|
|
869
|
+
t.isRef ? null : /* @__PURE__ */ v.jsx("div", { className: Vn(de.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ v.jsx(kr, {}) }),
|
|
870
870
|
/* @__PURE__ */ v.jsx(
|
|
871
871
|
Ri,
|
|
872
872
|
{
|
|
873
|
-
value:
|
|
873
|
+
value: t.color,
|
|
874
874
|
onChange: (i) => {
|
|
875
|
-
o(
|
|
875
|
+
o(t.id, t.label, i);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
),
|
|
879
879
|
/* @__PURE__ */ v.jsx(
|
|
880
880
|
je,
|
|
881
881
|
{
|
|
882
|
-
disabled:
|
|
883
|
-
value:
|
|
882
|
+
disabled: t.isRef,
|
|
883
|
+
value: t.label,
|
|
884
884
|
onChange: (i) => {
|
|
885
|
-
o(
|
|
885
|
+
o(t.id, i, t.color);
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
),
|
|
889
|
-
|
|
889
|
+
t.isRef ? null : /* @__PURE__ */ v.jsx("div", { className: de.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ v.jsx(Wa, { onClick: () => n(t.id) }) })
|
|
890
890
|
] });
|
|
891
891
|
};
|
|
892
|
-
function Ci(
|
|
893
|
-
const { value:
|
|
894
|
-
}, unitId: r, subUnitId: o, validResult: n, showError: i, ruleId: s } =
|
|
892
|
+
function Ci(a) {
|
|
893
|
+
const { value: t, onChange: e = () => {
|
|
894
|
+
}, unitId: r, subUnitId: o, validResult: n, showError: i, ruleId: s } = a, { formula1: l = "", formula2: d = "" } = t || {}, c = xa(null), [u, f] = te(() => A(l) ? "1" : "0"), [p, m] = te(u === "1" ? l : "="), [h, R] = te(u === "1" ? l : "="), g = $(ie), C = $(we), _ = $(z), M = $(Je), [y, D] = te(() => d.split(",")), E = C.getValidatorItem(B.LIST), [x, T] = te([]), [F, b] = te(""), P = i ? n == null ? void 0 : n.formula1 : "", U = Xe(_.ruleChange$), O = wr(e);
|
|
895
895
|
Ze(() => {
|
|
896
896
|
(async () => {
|
|
897
|
-
await new Promise((
|
|
898
|
-
setTimeout(() =>
|
|
897
|
+
await new Promise((q) => {
|
|
898
|
+
setTimeout(() => q(!0), 100);
|
|
899
899
|
});
|
|
900
900
|
const N = _.getRuleById(r, o, s), X = N == null ? void 0 : N.formula1;
|
|
901
901
|
if (A(X) && E && N) {
|
|
902
|
-
const
|
|
903
|
-
T(
|
|
902
|
+
const q = await E.getListAsync(N, r, o);
|
|
903
|
+
T(q);
|
|
904
904
|
}
|
|
905
905
|
})();
|
|
906
906
|
}, [_, U, E, s, o, r]), Ze(() => {
|
|
@@ -908,30 +908,30 @@ function Ci(t) {
|
|
|
908
908
|
}, [h, l]);
|
|
909
909
|
const [L, H] = te(() => {
|
|
910
910
|
const N = u !== "1" ? Qe(l) : [], X = d.split(",");
|
|
911
|
-
return N.map((
|
|
912
|
-
label:
|
|
911
|
+
return N.map((q, ne) => ({
|
|
912
|
+
label: q,
|
|
913
913
|
color: X[ne] || xe,
|
|
914
914
|
isRef: !1,
|
|
915
915
|
id: Y.generateRandomId(4)
|
|
916
916
|
}));
|
|
917
|
-
}), K = (N, X,
|
|
917
|
+
}), K = (N, X, q) => {
|
|
918
918
|
const ne = L.find((ye) => ye.id === N);
|
|
919
|
-
ne && (ne.label = X, ne.color =
|
|
919
|
+
ne && (ne.label = X, ne.color = q, H([...L]));
|
|
920
920
|
}, k = (N) => {
|
|
921
|
-
const X = L.findIndex((
|
|
921
|
+
const X = L.findIndex((q) => q.id === N);
|
|
922
922
|
X !== -1 && (L.splice(X, 1), H([...L]));
|
|
923
|
-
},
|
|
923
|
+
}, w = d.split(","), j = Ft(() => x.map((N, X) => ({
|
|
924
924
|
label: N,
|
|
925
|
-
color:
|
|
925
|
+
color: w[X] || xe,
|
|
926
926
|
id: `${X}`,
|
|
927
927
|
isRef: !0
|
|
928
|
-
})), [
|
|
929
|
-
const ne = [...
|
|
930
|
-
ne[+N] =
|
|
928
|
+
})), [w, x]), oe = (N, X, q) => {
|
|
929
|
+
const ne = [...y];
|
|
930
|
+
ne[+N] = q, D(ne), O({
|
|
931
931
|
formula1: l,
|
|
932
932
|
formula2: ne.join(",")
|
|
933
933
|
});
|
|
934
|
-
},
|
|
934
|
+
}, G = () => {
|
|
935
935
|
H([
|
|
936
936
|
...L,
|
|
937
937
|
{
|
|
@@ -946,21 +946,21 @@ function Ci(t) {
|
|
|
946
946
|
if (u === "1")
|
|
947
947
|
return;
|
|
948
948
|
const N = /* @__PURE__ */ new Set(), X = [];
|
|
949
|
-
L.map((
|
|
950
|
-
labelList:
|
|
951
|
-
item:
|
|
952
|
-
})).forEach(({ item:
|
|
949
|
+
L.map((q) => ({
|
|
950
|
+
labelList: q.label.split(","),
|
|
951
|
+
item: q
|
|
952
|
+
})).forEach(({ item: q, labelList: ne }) => {
|
|
953
953
|
ne.forEach((ye) => {
|
|
954
954
|
N.has(ye) || (N.add(ye), X.push({
|
|
955
955
|
label: ye,
|
|
956
|
-
color:
|
|
956
|
+
color: q.color
|
|
957
957
|
}));
|
|
958
958
|
});
|
|
959
959
|
}), O({
|
|
960
|
-
formula1: Yr(X.map((
|
|
961
|
-
formula2: X.map((
|
|
960
|
+
formula1: Yr(X.map((q) => q.label)),
|
|
961
|
+
formula2: X.map((q) => q.color === xe ? "" : q.color).join(",")
|
|
962
962
|
});
|
|
963
|
-
}, [L, O, u, h,
|
|
963
|
+
}, [L, O, u, h, y]);
|
|
964
964
|
const Se = Ft(
|
|
965
965
|
() => async (N) => {
|
|
966
966
|
if (!A(N)) {
|
|
@@ -988,7 +988,7 @@ function Ci(t) {
|
|
|
988
988
|
onChange: (N) => {
|
|
989
989
|
f(N), m(h), N === "1" && O({
|
|
990
990
|
formula1: h === "=" ? "" : h,
|
|
991
|
-
formula2:
|
|
991
|
+
formula2: y.join(",")
|
|
992
992
|
});
|
|
993
993
|
},
|
|
994
994
|
children: [
|
|
@@ -1036,15 +1036,15 @@ function Ci(t) {
|
|
|
1036
1036
|
idKey: "id"
|
|
1037
1037
|
}
|
|
1038
1038
|
),
|
|
1039
|
-
/* @__PURE__ */ v.jsxs("a", { className: de.dataValidationFormulaListAdd, onClick:
|
|
1039
|
+
/* @__PURE__ */ v.jsxs("a", { className: de.dataValidationFormulaListAdd, onClick: G, children: [
|
|
1040
1040
|
/* @__PURE__ */ v.jsx(Ur, {}),
|
|
1041
1041
|
g.t("dataValidation.list.add")
|
|
1042
1042
|
] })
|
|
1043
1043
|
] }) })
|
|
1044
1044
|
] });
|
|
1045
1045
|
}
|
|
1046
|
-
function Vi(
|
|
1047
|
-
const { value:
|
|
1046
|
+
function Vi(a) {
|
|
1047
|
+
const { value: t, onChange: e, showError: r, validResult: o } = a, n = $(ie), i = r ? o == null ? void 0 : o.formula1 : "", s = r ? o == null ? void 0 : o.formula2 : "", [l, d] = te(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
|
1048
1048
|
return /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
1049
1049
|
/* @__PURE__ */ v.jsx(Z, { children: /* @__PURE__ */ v.jsx(
|
|
1050
1050
|
$a,
|
|
@@ -1052,7 +1052,7 @@ function Vi(t) {
|
|
|
1052
1052
|
checked: l,
|
|
1053
1053
|
onChange: (c) => {
|
|
1054
1054
|
c ? d(!0) : (d(!1), e == null || e({
|
|
1055
|
-
...
|
|
1055
|
+
...t,
|
|
1056
1056
|
formula1: void 0,
|
|
1057
1057
|
formula2: void 0
|
|
1058
1058
|
}));
|
|
@@ -1065,10 +1065,10 @@ function Vi(t) {
|
|
|
1065
1065
|
{
|
|
1066
1066
|
className: de.dataValidationFormula,
|
|
1067
1067
|
placeholder: n.t("dataValidation.panel.valuePlaceholder"),
|
|
1068
|
-
value:
|
|
1068
|
+
value: t == null ? void 0 : t.formula1,
|
|
1069
1069
|
onChange: (c) => {
|
|
1070
1070
|
e == null || e({
|
|
1071
|
-
...
|
|
1071
|
+
...t,
|
|
1072
1072
|
formula1: c || void 0
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
@@ -1079,10 +1079,10 @@ function Vi(t) {
|
|
|
1079
1079
|
{
|
|
1080
1080
|
className: de.dataValidationFormula,
|
|
1081
1081
|
placeholder: n.t("dataValidation.panel.valuePlaceholder"),
|
|
1082
|
-
value:
|
|
1082
|
+
value: t == null ? void 0 : t.formula2,
|
|
1083
1083
|
onChange: (c) => {
|
|
1084
1084
|
e == null || e({
|
|
1085
|
-
...
|
|
1085
|
+
...t,
|
|
1086
1086
|
formula2: c || void 0
|
|
1087
1087
|
});
|
|
1088
1088
|
}
|
|
@@ -1108,8 +1108,8 @@ const Xr = "data-validation.custom-formula-input", Rt = "data-validation.formula
|
|
|
1108
1108
|
Vi
|
|
1109
1109
|
]
|
|
1110
1110
|
], gt = 1, vt = 0;
|
|
1111
|
-
function ar(
|
|
1112
|
-
return Y.isBlank(
|
|
1111
|
+
function ar(a, t) {
|
|
1112
|
+
return Y.isBlank(a) ? t.t("dataValidation.validFail.value") : A(a) ? t.t("dataValidation.validFail.primitive") : "";
|
|
1113
1113
|
}
|
|
1114
1114
|
class Ii extends Ye {
|
|
1115
1115
|
constructor() {
|
|
@@ -1173,19 +1173,19 @@ const Gt = [
|
|
|
1173
1173
|
V.BETWEEN,
|
|
1174
1174
|
V.NOT_BETWEEN
|
|
1175
1175
|
];
|
|
1176
|
-
function wi(
|
|
1177
|
-
return new Date((
|
|
1176
|
+
function wi(a) {
|
|
1177
|
+
return new Date((a - 25569) * 86400).getTime();
|
|
1178
1178
|
}
|
|
1179
|
-
const zr = (
|
|
1179
|
+
const zr = (a) => a / 86400 + 25569, yi = "univer-data-validation-options-button", Di = "univer-data-validation-options-button-icon", ea = {
|
|
1180
1180
|
dataValidationOptionsButton: yi,
|
|
1181
1181
|
dataValidationOptionsButtonIcon: Di
|
|
1182
1182
|
};
|
|
1183
|
-
function Ei(
|
|
1183
|
+
function Ei(a) {
|
|
1184
1184
|
var d;
|
|
1185
|
-
const
|
|
1185
|
+
const t = $(ie), e = $(St), { value: r, onChange: o, extraComponent: n } = a, [i, s] = te(!1), l = n ? e.get(n) : null;
|
|
1186
1186
|
return /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
1187
1187
|
/* @__PURE__ */ v.jsxs("div", { className: ea.dataValidationOptionsButton, onClick: () => s(!i), children: [
|
|
1188
|
-
|
|
1188
|
+
t.t("dataValidation.panel.options"),
|
|
1189
1189
|
i ? /* @__PURE__ */ v.jsx(Wr, { className: ea.dataValidationOptionsButtonIcon }) : /* @__PURE__ */ v.jsx(Hr, { className: ea.dataValidationOptionsButtonIcon })
|
|
1190
1190
|
] }),
|
|
1191
1191
|
i && /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
@@ -1193,15 +1193,15 @@ function Ei(t) {
|
|
|
1193
1193
|
/* @__PURE__ */ v.jsx(
|
|
1194
1194
|
Z,
|
|
1195
1195
|
{
|
|
1196
|
-
label:
|
|
1196
|
+
label: t.t("dataValidation.panel.invalid"),
|
|
1197
1197
|
children: /* @__PURE__ */ v.jsxs(
|
|
1198
1198
|
ja,
|
|
1199
1199
|
{
|
|
1200
1200
|
value: `${(d = r.errorStyle) != null ? d : st.WARNING}`,
|
|
1201
1201
|
onChange: (c) => o({ ...r, errorStyle: +c }),
|
|
1202
1202
|
children: [
|
|
1203
|
-
/* @__PURE__ */ v.jsx($e, { value: `${st.WARNING}`, children:
|
|
1204
|
-
/* @__PURE__ */ v.jsx($e, { value: `${st.STOP}`, children:
|
|
1203
|
+
/* @__PURE__ */ v.jsx($e, { value: `${st.WARNING}`, children: t.t("dataValidation.panel.showWarning") }),
|
|
1204
|
+
/* @__PURE__ */ v.jsx($e, { value: `${st.STOP}`, children: t.t("dataValidation.panel.rejectInput") })
|
|
1205
1205
|
]
|
|
1206
1206
|
}
|
|
1207
1207
|
)
|
|
@@ -1210,7 +1210,7 @@ function Ei(t) {
|
|
|
1210
1210
|
/* @__PURE__ */ v.jsx(
|
|
1211
1211
|
Z,
|
|
1212
1212
|
{
|
|
1213
|
-
label:
|
|
1213
|
+
label: t.t("dataValidation.panel.messageInfo"),
|
|
1214
1214
|
children: /* @__PURE__ */ v.jsx(
|
|
1215
1215
|
$a,
|
|
1216
1216
|
{
|
|
@@ -1219,7 +1219,7 @@ function Ei(t) {
|
|
|
1219
1219
|
...r,
|
|
1220
1220
|
showInputMessage: !r.showInputMessage
|
|
1221
1221
|
}),
|
|
1222
|
-
children:
|
|
1222
|
+
children: t.t("dataValidation.panel.showInfo")
|
|
1223
1223
|
}
|
|
1224
1224
|
)
|
|
1225
1225
|
}
|
|
@@ -1232,31 +1232,31 @@ const bi = "univer-data-validation-detail-form-item", Oi = "univer-data-validati
|
|
|
1232
1232
|
dataValidationDetailFormItem: bi,
|
|
1233
1233
|
dataValidationDetailButtons: Oi,
|
|
1234
1234
|
dataValidationDetailButton: Ni
|
|
1235
|
-
}, Ti = (
|
|
1236
|
-
async (
|
|
1237
|
-
const n = await
|
|
1235
|
+
}, Ti = (a) => Mo(
|
|
1236
|
+
async (t, e, r, o) => {
|
|
1237
|
+
const n = await a.executeCommand(t, e, r);
|
|
1238
1238
|
o == null || o(n);
|
|
1239
1239
|
},
|
|
1240
1240
|
275
|
|
1241
1241
|
);
|
|
1242
1242
|
function Fi() {
|
|
1243
|
-
const [
|
|
1243
|
+
const [a, t] = te(0), e = $(Me), r = Xe(e.activeRule$, e.activeRule), { unitId: o, subUnitId: n, rule: i } = r || {}, s = i.uid, l = $(we), d = $(St), c = $(ee), u = $(z), f = $(ie), [p, m] = te(i), h = l.getValidatorItem(p.type), [R, g] = te(!1), C = l.getValidatorsByScope(Eo.SHEET), [_, M] = te(() => p.ranges.map((w) => ({ unitId: "", sheetId: "", range: w }))), y = Ft(() => Ti(c), [c]);
|
|
1244
1244
|
if (Ze(() => {
|
|
1245
|
-
c.onCommandExecuted((
|
|
1246
|
-
(
|
|
1245
|
+
c.onCommandExecuted((w) => {
|
|
1246
|
+
(w.id === So.id || w.id === Ro.id) && setTimeout(() => {
|
|
1247
1247
|
const j = u.getRuleById(o, n, s);
|
|
1248
|
-
|
|
1248
|
+
t((oe) => oe + 1), j && (m(j), M(j.ranges.map((oe) => ({ unitId: "", sheetId: "", range: oe }))));
|
|
1249
1249
|
}, 20);
|
|
1250
1250
|
});
|
|
1251
1251
|
}, [c, u, s, n, o]), !h)
|
|
1252
1252
|
return null;
|
|
1253
1253
|
const D = h.operators, E = h.operatorNames, x = p.operator ? bo.includes(p.operator) : !1, T = () => {
|
|
1254
1254
|
h.validatorFormula(p, o, n).success ? e.setActiveRule(null) : g(!0);
|
|
1255
|
-
}, F = wr((
|
|
1256
|
-
if (Co(
|
|
1255
|
+
}, F = wr((w) => {
|
|
1256
|
+
if (Co(w, _))
|
|
1257
1257
|
return;
|
|
1258
|
-
M(
|
|
1259
|
-
const j =
|
|
1258
|
+
M(w);
|
|
1259
|
+
const j = w.filter((G) => (!G.unitId || G.unitId === o) && (!G.sheetId || G.sheetId === n)).map((G) => G.range);
|
|
1260
1260
|
if (m({
|
|
1261
1261
|
...p,
|
|
1262
1262
|
ranges: j
|
|
@@ -1268,21 +1268,21 @@ function Fi() {
|
|
|
1268
1268
|
ruleId: s,
|
|
1269
1269
|
ranges: j
|
|
1270
1270
|
};
|
|
1271
|
-
|
|
1272
|
-
}), b = (
|
|
1273
|
-
if (Ga(
|
|
1271
|
+
y(qt.id, oe);
|
|
1272
|
+
}), b = (w) => {
|
|
1273
|
+
if (Ga(w, fa(p)))
|
|
1274
1274
|
return;
|
|
1275
1275
|
m({
|
|
1276
1276
|
...p,
|
|
1277
|
-
...
|
|
1277
|
+
...w
|
|
1278
1278
|
});
|
|
1279
1279
|
const j = {
|
|
1280
1280
|
unitId: o,
|
|
1281
1281
|
subUnitId: n,
|
|
1282
1282
|
ruleId: s,
|
|
1283
|
-
setting:
|
|
1283
|
+
setting: w
|
|
1284
1284
|
};
|
|
1285
|
-
|
|
1285
|
+
y(
|
|
1286
1286
|
wa.id,
|
|
1287
1287
|
j,
|
|
1288
1288
|
void 0
|
|
@@ -1299,15 +1299,16 @@ function Fi() {
|
|
|
1299
1299
|
formula1: p.formula1,
|
|
1300
1300
|
formula2: p.formula2,
|
|
1301
1301
|
allowBlank: p.allowBlank
|
|
1302
|
-
}, O = (
|
|
1303
|
-
const j = l.getValidatorItem(
|
|
1302
|
+
}, O = (w) => {
|
|
1303
|
+
const j = l.getValidatorItem(w);
|
|
1304
1304
|
if (!j)
|
|
1305
1305
|
return;
|
|
1306
|
-
const oe = j.operators,
|
|
1307
|
-
...
|
|
1306
|
+
const oe = j.operators, G = u.getRuleById(o, n, s), Se = w === (G == null ? void 0 : G.type) || w.includes("list") && (G != null && G.type.includes("list")) ? {
|
|
1307
|
+
...G,
|
|
1308
|
+
type: w
|
|
1308
1309
|
} : {
|
|
1309
1310
|
...p,
|
|
1310
|
-
type:
|
|
1311
|
+
type: w,
|
|
1311
1312
|
operator: oe[0],
|
|
1312
1313
|
formula1: void 0,
|
|
1313
1314
|
formula2: void 0
|
|
@@ -1318,17 +1319,17 @@ function Fi() {
|
|
|
1318
1319
|
ruleId: p.uid,
|
|
1319
1320
|
setting: fa(Se)
|
|
1320
1321
|
});
|
|
1321
|
-
}, L = d.get(h.formulaInput), H = Ft(() => _.map((
|
|
1322
|
-
Ga(
|
|
1322
|
+
}, L = d.get(h.formulaInput), H = Ft(() => _.map((w) => Or(w.range)).join(","), []), K = ma(p), k = (w) => {
|
|
1323
|
+
Ga(w, ma(p)) || (m({
|
|
1323
1324
|
...p,
|
|
1324
|
-
...
|
|
1325
|
-
}),
|
|
1325
|
+
...w
|
|
1326
|
+
}), y(
|
|
1326
1327
|
ao.id,
|
|
1327
1328
|
{
|
|
1328
1329
|
unitId: o,
|
|
1329
1330
|
subUnitId: n,
|
|
1330
1331
|
ruleId: s,
|
|
1331
|
-
options:
|
|
1332
|
+
options: w
|
|
1332
1333
|
}
|
|
1333
1334
|
));
|
|
1334
1335
|
};
|
|
@@ -1341,18 +1342,18 @@ function Fi() {
|
|
|
1341
1342
|
id: ba("data-validation-detail"),
|
|
1342
1343
|
openForSheetUnitId: o,
|
|
1343
1344
|
openForSheetSubUnitId: n,
|
|
1344
|
-
onChange: (
|
|
1345
|
-
|
|
1345
|
+
onChange: (w) => {
|
|
1346
|
+
w.some((j) => !Vo(j.range) || j.range.endColumn < j.range.startColumn || j.range.endRow < j.range.startRow) || F(w);
|
|
1346
1347
|
}
|
|
1347
1348
|
},
|
|
1348
|
-
|
|
1349
|
+
a
|
|
1349
1350
|
) }),
|
|
1350
1351
|
/* @__PURE__ */ v.jsx(Z, { label: f.t("dataValidation.panel.type"), children: /* @__PURE__ */ v.jsx(
|
|
1351
1352
|
Va,
|
|
1352
1353
|
{
|
|
1353
|
-
options: C == null ? void 0 : C.map((
|
|
1354
|
-
label: f.t(
|
|
1355
|
-
value:
|
|
1354
|
+
options: C == null ? void 0 : C.map((w) => ({
|
|
1355
|
+
label: f.t(w.title),
|
|
1356
|
+
value: w.id
|
|
1356
1357
|
})),
|
|
1357
1358
|
value: p.type,
|
|
1358
1359
|
onChange: O,
|
|
@@ -1362,15 +1363,15 @@ function Fi() {
|
|
|
1362
1363
|
D != null && D.length ? /* @__PURE__ */ v.jsx(Z, { label: f.t("dataValidation.panel.operator"), children: /* @__PURE__ */ v.jsx(
|
|
1363
1364
|
Va,
|
|
1364
1365
|
{
|
|
1365
|
-
options: D.map((
|
|
1366
|
-
value: `${
|
|
1366
|
+
options: D.map((w, j) => ({
|
|
1367
|
+
value: `${w}`,
|
|
1367
1368
|
label: E[j]
|
|
1368
1369
|
})),
|
|
1369
1370
|
value: `${p.operator}`,
|
|
1370
|
-
onChange: (
|
|
1371
|
+
onChange: (w) => {
|
|
1371
1372
|
b({
|
|
1372
1373
|
...U,
|
|
1373
|
-
operator:
|
|
1374
|
+
operator: w
|
|
1374
1375
|
});
|
|
1375
1376
|
},
|
|
1376
1377
|
className: qe.dataValidationDetailFormItem
|
|
@@ -1384,10 +1385,10 @@ function Fi() {
|
|
|
1384
1385
|
formula1: p.formula1,
|
|
1385
1386
|
formula2: p.formula2
|
|
1386
1387
|
},
|
|
1387
|
-
onChange: (
|
|
1388
|
+
onChange: (w) => {
|
|
1388
1389
|
b({
|
|
1389
1390
|
...U,
|
|
1390
|
-
...
|
|
1391
|
+
...w
|
|
1391
1392
|
});
|
|
1392
1393
|
},
|
|
1393
1394
|
showError: R,
|
|
@@ -1396,7 +1397,7 @@ function Fi() {
|
|
|
1396
1397
|
subUnitId: n,
|
|
1397
1398
|
ruleId: s
|
|
1398
1399
|
},
|
|
1399
|
-
|
|
1400
|
+
a + p.type
|
|
1400
1401
|
) : null,
|
|
1401
1402
|
/* @__PURE__ */ v.jsx(Ei, { value: K, onChange: k, extraComponent: h.optionsInput }),
|
|
1402
1403
|
/* @__PURE__ */ v.jsxs("div", { className: qe.dataValidationDetailButtons, children: [
|
|
@@ -1410,10 +1411,10 @@ const Li = "univer-data-validation-item-container", Pi = "univer-data-validation
|
|
|
1410
1411
|
dataValidationItemTitle: Pi,
|
|
1411
1412
|
dataValidationItemContent: Ai,
|
|
1412
1413
|
dataValidationItemIcon: xi
|
|
1413
|
-
}, ji = (
|
|
1414
|
-
const { rule:
|
|
1414
|
+
}, ji = (a) => {
|
|
1415
|
+
const { rule: t, onClick: e, unitId: r, subUnitId: o, disable: n } = a, i = $(we), s = $(ee), l = $(Uo), d = i.getValidatorItem(t.type), c = xa(), [u, f] = te(!1), p = (m) => {
|
|
1415
1416
|
s.executeCommand(pr.id, {
|
|
1416
|
-
ruleId:
|
|
1417
|
+
ruleId: t.uid,
|
|
1417
1418
|
unitId: r,
|
|
1418
1419
|
subUnitId: o
|
|
1419
1420
|
}), m.stopPropagation();
|
|
@@ -1429,7 +1430,7 @@ const Li = "univer-data-validation-item-container", Pi = "univer-data-validation
|
|
|
1429
1430
|
className: wt.dataValidationItemContainer,
|
|
1430
1431
|
onClick: e,
|
|
1431
1432
|
onMouseEnter: () => {
|
|
1432
|
-
n || (f(!0), c.current =
|
|
1433
|
+
n || (f(!0), c.current = t.ranges.map((m) => l.addShape({
|
|
1433
1434
|
range: m,
|
|
1434
1435
|
style: {
|
|
1435
1436
|
hasAutoFill: !1,
|
|
@@ -1457,8 +1458,8 @@ const Li = "univer-data-validation-item-container", Pi = "univer-data-validation
|
|
|
1457
1458
|
}), c.current = void 0;
|
|
1458
1459
|
},
|
|
1459
1460
|
children: [
|
|
1460
|
-
/* @__PURE__ */ v.jsx("div", { className: wt.dataValidationItemTitle, children: d == null ? void 0 : d.generateRuleName(
|
|
1461
|
-
/* @__PURE__ */ v.jsx("div", { className: wt.dataValidationItemContent, children:
|
|
1461
|
+
/* @__PURE__ */ v.jsx("div", { className: wt.dataValidationItemTitle, children: d == null ? void 0 : d.generateRuleName(t) }),
|
|
1462
|
+
/* @__PURE__ */ v.jsx("div", { className: wt.dataValidationItemContent, children: t.ranges.map((m) => Or(m)).join(",") }),
|
|
1462
1463
|
u ? /* @__PURE__ */ v.jsx("div", { className: wt.dataValidationItemIcon, onClick: p, children: /* @__PURE__ */ v.jsx(Wa, {}) }) : null
|
|
1463
1464
|
]
|
|
1464
1465
|
}
|
|
@@ -1468,16 +1469,16 @@ const Li = "univer-data-validation-item-container", Pi = "univer-data-validation
|
|
|
1468
1469
|
dataValidationListButton: Bi
|
|
1469
1470
|
};
|
|
1470
1471
|
function Ui() {
|
|
1471
|
-
const
|
|
1472
|
-
() =>
|
|
1472
|
+
const a = $(J), t = Xe(
|
|
1473
|
+
() => a.getCurrentTypeOfUnit$(re.UNIVER_SHEET),
|
|
1473
1474
|
void 0,
|
|
1474
1475
|
void 0,
|
|
1475
1476
|
[]
|
|
1476
1477
|
);
|
|
1477
|
-
return
|
|
1478
|
+
return t ? /* @__PURE__ */ v.jsx(Hi, { workbook: t }) : null;
|
|
1478
1479
|
}
|
|
1479
|
-
function Hi(
|
|
1480
|
-
const
|
|
1480
|
+
function Hi(a) {
|
|
1481
|
+
const t = $(z), e = $(J), r = $(ee), o = $(Ee), n = $(Me), i = $(ie), [s, l] = te([]), { workbook: d } = a, c = Xe(d.activeSheet$, void 0, !0), u = d.getUnitId(), f = c == null ? void 0 : c.getSheetId(), p = t.ensureManager(u, f);
|
|
1481
1482
|
Ze(() => {
|
|
1482
1483
|
l(p.getDataValidations());
|
|
1483
1484
|
const _ = p.dataValidations$.subscribe((M) => {
|
|
@@ -1504,7 +1505,7 @@ function Hi(t) {
|
|
|
1504
1505
|
subUnitId: f
|
|
1505
1506
|
});
|
|
1506
1507
|
}, g = ((_) => {
|
|
1507
|
-
const
|
|
1508
|
+
const y = e.getCurrentUnitForType(re.UNIVER_SHEET).getActiveSheet();
|
|
1508
1509
|
return _.map((E) => {
|
|
1509
1510
|
const { ranges: x } = E;
|
|
1510
1511
|
return (x == null ? void 0 : x.some((F) => {
|
|
@@ -1512,8 +1513,8 @@ function Hi(t) {
|
|
|
1512
1513
|
const { startRow: b, startColumn: P, endRow: U, endColumn: O } = F;
|
|
1513
1514
|
for (let K = b; K <= U; K++)
|
|
1514
1515
|
for (let k = P; k <= O; k++) {
|
|
1515
|
-
const
|
|
1516
|
-
if ((
|
|
1516
|
+
const w = (H = (L = y == null ? void 0 : y.getCell(K, k)) == null ? void 0 : L.selectionProtection) == null ? void 0 : H[0];
|
|
1517
|
+
if ((w == null ? void 0 : w[Lt.Edit]) === !1 || (w == null ? void 0 : w[Lt.View]) === !1)
|
|
1517
1518
|
return !0;
|
|
1518
1519
|
}
|
|
1519
1520
|
return !1;
|
|
@@ -1548,8 +1549,8 @@ function Hi(t) {
|
|
|
1548
1549
|
] });
|
|
1549
1550
|
}
|
|
1550
1551
|
const Wi = () => {
|
|
1551
|
-
const
|
|
1552
|
-
return
|
|
1552
|
+
const a = $(Me), t = Xe(a.activeRule$, a.activeRule);
|
|
1553
|
+
return t ? /* @__PURE__ */ v.jsx(Fi, {}, t.rule.uid) : /* @__PURE__ */ v.jsx(Ui, {});
|
|
1553
1554
|
}, ki = "univer-dv-list-dropdown", Yi = "univer-dv-list-dropdown-title", Xi = "univer-dv-list-dropdown-list", Gi = "univer-dv-list-dropdown-list-container", qi = "univer-dv-list-dropdown-selected-icon", zi = "univer-dv-list-dropdown-item-container", Ki = "univer-dv-list-dropdown-item", Qi = "univer-dv-list-dropdown-split", Zi = "univer-dv-list-dropdown-edit", De = {
|
|
1554
1555
|
dvListDropdown: ki,
|
|
1555
1556
|
dvListDropdownTitle: Yi,
|
|
@@ -1560,14 +1561,14 @@ const Wi = () => {
|
|
|
1560
1561
|
dvListDropdownItem: Ki,
|
|
1561
1562
|
dvListDropdownSplit: Qi,
|
|
1562
1563
|
dvListDropdownEdit: Zi
|
|
1563
|
-
}, Ji = (
|
|
1564
|
-
const { value:
|
|
1564
|
+
}, Ji = (a) => {
|
|
1565
|
+
const { value: t, onChange: e, multiple: r, options: o, title: n, onEdit: i, style: s } = a;
|
|
1565
1566
|
return /* @__PURE__ */ v.jsxs("div", { className: De.dvListDropdown, style: s, children: [
|
|
1566
1567
|
/* @__PURE__ */ v.jsx("div", { className: De.dvListDropdownTitle, children: n }),
|
|
1567
1568
|
/* @__PURE__ */ v.jsx("div", { className: De.dvListDropdownList, children: /* @__PURE__ */ v.jsx(Rn, { children: /* @__PURE__ */ v.jsx("div", { className: De.dvListDropdownListContainer, children: o.map((l, d) => {
|
|
1568
|
-
const c =
|
|
1569
|
+
const c = t.indexOf(l.value) > -1, u = () => {
|
|
1569
1570
|
let f;
|
|
1570
|
-
c ? f = new Set(
|
|
1571
|
+
c ? f = new Set(t.filter((m) => m !== l.value)) : f = new Set(r ? [...t, l.value] : [l.value]);
|
|
1571
1572
|
const p = [];
|
|
1572
1573
|
o.forEach((m) => {
|
|
1573
1574
|
f.has(m.value) && p.push(m.value);
|
|
@@ -1582,9 +1583,9 @@ const Wi = () => {
|
|
|
1582
1583
|
/* @__PURE__ */ v.jsx("div", { className: De.dvListDropdownEdit, children: /* @__PURE__ */ v.jsx("a", { onClick: i, children: "编辑" }) })
|
|
1583
1584
|
] });
|
|
1584
1585
|
};
|
|
1585
|
-
function es(
|
|
1586
|
+
function es(a) {
|
|
1586
1587
|
var T, F;
|
|
1587
|
-
const { location:
|
|
1588
|
+
const { location: t, hideFn: e } = a, { worksheet: r, row: o, col: n, unitId: i, subUnitId: s } = t, l = $(z), d = $(ee), c = $(ie), [u, f] = te(""), p = $(La);
|
|
1588
1589
|
Xe(l.ruleChange$);
|
|
1589
1590
|
const m = Sn.useContext(), h = m.right - m.left;
|
|
1590
1591
|
if (!r)
|
|
@@ -1592,7 +1593,7 @@ function es(t) {
|
|
|
1592
1593
|
const R = r.getCell(o, n), g = (T = R == null ? void 0 : R.dataValidation) == null ? void 0 : T.rule, C = (F = R == null ? void 0 : R.dataValidation) == null ? void 0 : F.validator, _ = (g == null ? void 0 : g.renderMode) === le.CUSTOM || (g == null ? void 0 : g.renderMode) === void 0;
|
|
1593
1594
|
if (!R || !g || !C)
|
|
1594
1595
|
return;
|
|
1595
|
-
const M = g.type === B.LIST_MULTIPLE,
|
|
1596
|
+
const M = g.type === B.LIST_MULTIPLE, y = C.getListWithColor(g, i, s), D = u || pi(R), E = Qe(D), x = () => {
|
|
1596
1597
|
d.executeCommand(at.id, {
|
|
1597
1598
|
ruleId: g.uid
|
|
1598
1599
|
}), e();
|
|
@@ -1618,16 +1619,20 @@ function es(t) {
|
|
|
1618
1619
|
v: P,
|
|
1619
1620
|
p: null,
|
|
1620
1621
|
f: null,
|
|
1621
|
-
si: null
|
|
1622
|
+
si: null,
|
|
1623
|
+
custom: {
|
|
1624
|
+
__link_url: ""
|
|
1625
|
+
}
|
|
1622
1626
|
}
|
|
1623
1627
|
};
|
|
1624
1628
|
p.isVisible() && p.changeVisible({
|
|
1625
1629
|
visible: !1,
|
|
1626
1630
|
keycode: Jo.ESC,
|
|
1627
|
-
eventType: ln.Keyboard
|
|
1631
|
+
eventType: ln.Keyboard,
|
|
1632
|
+
unitId: i
|
|
1628
1633
|
}), d.executeCommand(Ta.id, U), f(P), M || e();
|
|
1629
1634
|
},
|
|
1630
|
-
options:
|
|
1635
|
+
options: y.map((b) => ({
|
|
1631
1636
|
label: b.label,
|
|
1632
1637
|
value: b.label,
|
|
1633
1638
|
color: _ ? b.color : "transparent"
|
|
@@ -1637,9 +1642,9 @@ function es(t) {
|
|
|
1637
1642
|
);
|
|
1638
1643
|
}
|
|
1639
1644
|
var Kr = { exports: {} };
|
|
1640
|
-
(function(
|
|
1645
|
+
(function(a, t) {
|
|
1641
1646
|
(function(e, r) {
|
|
1642
|
-
|
|
1647
|
+
a.exports = r();
|
|
1643
1648
|
})(yn, function() {
|
|
1644
1649
|
var e = "minute", r = /[+-]\d\d(?::?\d\d)?/g, o = /([+-]|\d\d)/g;
|
|
1645
1650
|
return function(n, i, s) {
|
|
@@ -1668,9 +1673,9 @@ var Kr = { exports: {} };
|
|
|
1668
1673
|
l.utcOffset = function(h, R) {
|
|
1669
1674
|
var g = this.$utils().u;
|
|
1670
1675
|
if (g(h)) return this.$u ? 0 : g(this.$offset) ? u.call(this) : this.$offset;
|
|
1671
|
-
if (typeof h == "string" && (h = function(
|
|
1672
|
-
|
|
1673
|
-
var D =
|
|
1676
|
+
if (typeof h == "string" && (h = function(y) {
|
|
1677
|
+
y === void 0 && (y = "");
|
|
1678
|
+
var D = y.match(r);
|
|
1674
1679
|
if (!D) return null;
|
|
1675
1680
|
var E = ("" + D[0]).match(o) || ["-", 0, 0], x = E[0], T = 60 * +E[1] + +E[2];
|
|
1676
1681
|
return T === 0 ? 0 : x === "+" ? T : -T;
|
|
@@ -1712,21 +1717,21 @@ var Kr = { exports: {} };
|
|
|
1712
1717
|
})(Kr);
|
|
1713
1718
|
var ts = Kr.exports;
|
|
1714
1719
|
const as = /* @__PURE__ */ Dn(ts);
|
|
1715
|
-
var rs = Object.defineProperty, os = Object.getOwnPropertyDescriptor, ns = (
|
|
1716
|
-
for (var o = r > 1 ? void 0 : r ? os(
|
|
1717
|
-
(i =
|
|
1718
|
-
return r && o && rs(
|
|
1719
|
-
}, nt = (
|
|
1720
|
-
let lt = class extends
|
|
1721
|
-
constructor(
|
|
1722
|
-
super(), this._editorBridgeService =
|
|
1720
|
+
var rs = Object.defineProperty, os = Object.getOwnPropertyDescriptor, ns = (a, t, e, r) => {
|
|
1721
|
+
for (var o = r > 1 ? void 0 : r ? os(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
1722
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
1723
|
+
return r && o && rs(t, e, o), o;
|
|
1724
|
+
}, nt = (a, t) => (e, r) => t(e, r, a);
|
|
1725
|
+
let lt = class extends ue {
|
|
1726
|
+
constructor(a, t, e, r, o) {
|
|
1727
|
+
super(), this._editorBridgeService = a, this._dataValidationModel = t, this._dataValidatorRegistryService = e, this._dialogService = r, this._localeService = o, this._initEditorBridgeInterceptor();
|
|
1723
1728
|
}
|
|
1724
1729
|
_initEditorBridgeInterceptor() {
|
|
1725
1730
|
this._editorBridgeService.interceptor.intercept(
|
|
1726
1731
|
this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT_ASYNC,
|
|
1727
1732
|
{
|
|
1728
|
-
handler: async (
|
|
1729
|
-
const r = await
|
|
1733
|
+
handler: async (a, t, e) => {
|
|
1734
|
+
const r = await a, { worksheet: o, row: n, col: i, unitId: s, subUnitId: l } = t, d = this._dataValidationModel.ensureManager(s, l), c = d.getRuleIdByLocation(n, i), u = c ? d.getRuleById(c) : void 0;
|
|
1730
1735
|
if (!u || u.errorStyle !== st.STOP)
|
|
1731
1736
|
return e(Promise.resolve(r));
|
|
1732
1737
|
const f = await this._dataValidatorRegistryService.getValidatorItem(u.type);
|
|
@@ -1769,7 +1774,7 @@ let lt = class extends fe {
|
|
|
1769
1774
|
}
|
|
1770
1775
|
);
|
|
1771
1776
|
}
|
|
1772
|
-
showReject(
|
|
1777
|
+
showReject(a) {
|
|
1773
1778
|
this._dialogService.open({
|
|
1774
1779
|
width: 368,
|
|
1775
1780
|
title: {
|
|
@@ -1777,7 +1782,7 @@ let lt = class extends fe {
|
|
|
1777
1782
|
},
|
|
1778
1783
|
id: "reject-input-dialog",
|
|
1779
1784
|
children: {
|
|
1780
|
-
title:
|
|
1785
|
+
title: a
|
|
1781
1786
|
},
|
|
1782
1787
|
footer: {
|
|
1783
1788
|
title: Ca.createElement(
|
|
@@ -1798,7 +1803,7 @@ let lt = class extends fe {
|
|
|
1798
1803
|
lt = ns([
|
|
1799
1804
|
ve(_e.Ready, lt),
|
|
1800
1805
|
nt(0, La),
|
|
1801
|
-
nt(1, I(
|
|
1806
|
+
nt(1, I(z)),
|
|
1802
1807
|
nt(2, I(we)),
|
|
1803
1808
|
nt(3, en),
|
|
1804
1809
|
nt(4, I(ie))
|
|
@@ -1808,18 +1813,20 @@ const is = "univer-dv-date-dropdown", ss = "univer-dv-date-dropdown-btns", rr =
|
|
|
1808
1813
|
dvDateDropdownBtns: ss
|
|
1809
1814
|
};
|
|
1810
1815
|
Ve.extend(as);
|
|
1811
|
-
const ls = (
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
return Ve(t);
|
|
1816
|
+
const ls = (a) => {
|
|
1817
|
+
if (a == null || typeof a == "boolean")
|
|
1818
|
+
return;
|
|
1819
|
+
if (typeof a == "number" || !Number.isNaN(+a)) {
|
|
1820
|
+
const e = Ve.unix(wi(+a)).utc().format().slice(0, -1);
|
|
1821
|
+
return Ve(e);
|
|
1818
1822
|
}
|
|
1823
|
+
const t = Ve(a);
|
|
1824
|
+
if (t.isValid())
|
|
1825
|
+
return t;
|
|
1819
1826
|
};
|
|
1820
|
-
function ds(
|
|
1821
|
-
var M,
|
|
1822
|
-
const { location:
|
|
1827
|
+
function ds(a) {
|
|
1828
|
+
var M, y, D;
|
|
1829
|
+
const { location: t, hideFn: e } = a, { worksheet: r, row: o, col: n, unitId: i, subUnitId: s } = t, l = $(ee), d = $(lt), c = r.getCell(o, n), u = (M = c == null ? void 0 : c.dataValidation) == null ? void 0 : M.rule, f = (y = c == null ? void 0 : c.dataValidation) == null ? void 0 : y.validator, p = ae(c), m = ls(p), [h, R] = te(m), g = !!((D = u == null ? void 0 : u.bizInfo) != null && D.showTime), C = h && h.isValid() ? h : Ve();
|
|
1823
1830
|
if (!c || !u || !f)
|
|
1824
1831
|
return;
|
|
1825
1832
|
const _ = async () => {
|
|
@@ -1903,18 +1910,18 @@ const us = {
|
|
|
1903
1910
|
[V.NOT_BETWEEN]: "dataValidation.date.errorMsg.notBetween",
|
|
1904
1911
|
[V.NOT_EQUAL]: "dataValidation.date.errorMsg.notEqual"
|
|
1905
1912
|
}, ms = "DATE_SHOW_TIME_OPTION";
|
|
1906
|
-
function Pt(
|
|
1913
|
+
function Pt(a) {
|
|
1907
1914
|
var o;
|
|
1908
|
-
const { value:
|
|
1915
|
+
const { value: t, onChange: e } = a, r = $(ie);
|
|
1909
1916
|
return /* @__PURE__ */ v.jsx(Z, { children: /* @__PURE__ */ v.jsx(
|
|
1910
1917
|
$a,
|
|
1911
1918
|
{
|
|
1912
|
-
checked: (o =
|
|
1919
|
+
checked: (o = t.bizInfo) == null ? void 0 : o.showTime,
|
|
1913
1920
|
onChange: (n) => {
|
|
1914
1921
|
e({
|
|
1915
|
-
...
|
|
1922
|
+
...t,
|
|
1916
1923
|
bizInfo: {
|
|
1917
|
-
...
|
|
1924
|
+
...t.bizInfo,
|
|
1918
1925
|
showTime: n
|
|
1919
1926
|
}
|
|
1920
1927
|
});
|
|
@@ -1924,13 +1931,13 @@ function Pt(t) {
|
|
|
1924
1931
|
) });
|
|
1925
1932
|
}
|
|
1926
1933
|
Pt.componentKey = ms;
|
|
1927
|
-
const or = "{FORMULA1}", nr = "{FORMULA2}", it = (
|
|
1928
|
-
if (
|
|
1934
|
+
const or = "{FORMULA1}", nr = "{FORMULA2}", it = (a) => {
|
|
1935
|
+
if (a == null || typeof a == "boolean")
|
|
1929
1936
|
return;
|
|
1930
|
-
if (typeof
|
|
1931
|
-
return +
|
|
1932
|
-
const
|
|
1933
|
-
return zr(Ve(
|
|
1937
|
+
if (typeof a == "number" || !Number.isNaN(+a))
|
|
1938
|
+
return +a;
|
|
1939
|
+
const t = `${Ve(a).format("YYYY-MM-DD HH:mm:ss").split(" ").join("T")}Z`;
|
|
1940
|
+
return zr(Ve(t).unix());
|
|
1934
1941
|
};
|
|
1935
1942
|
class fs extends Ye {
|
|
1936
1943
|
constructor() {
|
|
@@ -1971,7 +1978,7 @@ class fs extends Ye {
|
|
|
1971
1978
|
}
|
|
1972
1979
|
async isValidType(e) {
|
|
1973
1980
|
const { value: r } = e;
|
|
1974
|
-
return typeof r == "string" ? Ve(r).isValid() : typeof r == "number";
|
|
1981
|
+
return typeof r == "string" ? Ve(r, "YYYY-MM-DD HH:mm:ss", !0).isValid() : typeof r == "number";
|
|
1975
1982
|
}
|
|
1976
1983
|
_validatorSingleFormula(e) {
|
|
1977
1984
|
return !Y.isBlank(e) && (A(e) || !Number.isNaN(+e) || !!e && Ve(e).isValid());
|
|
@@ -2056,18 +2063,18 @@ class fs extends Ye {
|
|
|
2056
2063
|
return e.operator ? `${this.localeService.t(hs[e.operator]).replace(or, (o = e.formula1) != null ? o : "").replace(nr, (n = e.formula2) != null ? n : "")}` : this.titleStr;
|
|
2057
2064
|
}
|
|
2058
2065
|
}
|
|
2059
|
-
var ps = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, vs = (
|
|
2060
|
-
for (var o = r > 1 ? void 0 : r ? gs(
|
|
2061
|
-
(i =
|
|
2062
|
-
return r && o && ps(
|
|
2063
|
-
}, ir = (
|
|
2066
|
+
var ps = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, vs = (a, t, e, r) => {
|
|
2067
|
+
for (var o = r > 1 ? void 0 : r ? gs(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
2068
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
2069
|
+
return r && o && ps(t, e, o), o;
|
|
2070
|
+
}, ir = (a, t) => (e, r) => t(e, r, a);
|
|
2064
2071
|
const ze = 4, _s = 6, Re = 14, Pe = 6, Oe = 4, Ss = "#565656", sr = 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");
|
|
2065
|
-
function Rs(
|
|
2066
|
-
const e =
|
|
2072
|
+
function Rs(a, t) {
|
|
2073
|
+
const e = a.length;
|
|
2067
2074
|
return {
|
|
2068
2075
|
id: "d",
|
|
2069
2076
|
body: {
|
|
2070
|
-
dataStream: `${
|
|
2077
|
+
dataStream: `${a}${cr}`,
|
|
2071
2078
|
textRuns: [
|
|
2072
2079
|
{
|
|
2073
2080
|
ts: {
|
|
@@ -2085,7 +2092,7 @@ function Rs(t, a) {
|
|
|
2085
2092
|
s: ot.FALSE
|
|
2086
2093
|
},
|
|
2087
2094
|
cl: void 0,
|
|
2088
|
-
...
|
|
2095
|
+
...t,
|
|
2089
2096
|
bg: void 0,
|
|
2090
2097
|
bd: void 0
|
|
2091
2098
|
},
|
|
@@ -2102,20 +2109,20 @@ function Rs(t, a) {
|
|
|
2102
2109
|
}
|
|
2103
2110
|
};
|
|
2104
2111
|
}
|
|
2105
|
-
function Jr(
|
|
2106
|
-
const r = Rs(
|
|
2112
|
+
function Jr(a, t, e) {
|
|
2113
|
+
const r = Rs(a, e), o = new Io(r), n = new dn(o);
|
|
2107
2114
|
return {
|
|
2108
|
-
documentSkeleton: cn.create(n,
|
|
2115
|
+
documentSkeleton: cn.create(n, t),
|
|
2109
2116
|
docModel: o,
|
|
2110
2117
|
docViewModel: n
|
|
2111
2118
|
};
|
|
2112
2119
|
}
|
|
2113
|
-
function aa(
|
|
2120
|
+
function aa(a, t, e) {
|
|
2114
2121
|
const {
|
|
2115
2122
|
documentSkeleton: r,
|
|
2116
2123
|
docModel: o,
|
|
2117
2124
|
docViewModel: n
|
|
2118
|
-
} = Jr(
|
|
2125
|
+
} = Jr(a, t, e);
|
|
2119
2126
|
return {
|
|
2120
2127
|
documents: new un(`DOCUMENTS_${Y.generateRandomId()}`, r, {
|
|
2121
2128
|
pageMarginLeft: 0,
|
|
@@ -2126,14 +2133,14 @@ function aa(t, a, e) {
|
|
|
2126
2133
|
docViewModel: n
|
|
2127
2134
|
};
|
|
2128
2135
|
}
|
|
2129
|
-
function lr(
|
|
2136
|
+
function lr(a, t, e, r, o, n) {
|
|
2130
2137
|
let i = 0;
|
|
2131
2138
|
switch (o) {
|
|
2132
|
-
case
|
|
2133
|
-
i =
|
|
2139
|
+
case me.BOTTOM:
|
|
2140
|
+
i = t - Oe * 2 - r + Oe;
|
|
2134
2141
|
break;
|
|
2135
|
-
case
|
|
2136
|
-
i = (
|
|
2142
|
+
case me.MIDDLE:
|
|
2143
|
+
i = (t - Oe * 2 - r) / 2 + Oe;
|
|
2137
2144
|
break;
|
|
2138
2145
|
default:
|
|
2139
2146
|
i = Oe;
|
|
@@ -2142,10 +2149,10 @@ function lr(t, a, e, r, o, n) {
|
|
|
2142
2149
|
let s = 0;
|
|
2143
2150
|
switch (n) {
|
|
2144
2151
|
case Be.CENTER:
|
|
2145
|
-
s = (
|
|
2152
|
+
s = (a - e) / 2;
|
|
2146
2153
|
break;
|
|
2147
2154
|
case Be.RIGHT:
|
|
2148
|
-
s =
|
|
2155
|
+
s = a - e;
|
|
2149
2156
|
break;
|
|
2150
2157
|
}
|
|
2151
2158
|
return {
|
|
@@ -2155,37 +2162,37 @@ function lr(t, a, e, r, o, n) {
|
|
|
2155
2162
|
}
|
|
2156
2163
|
var ha;
|
|
2157
2164
|
let Ia = (ha = class {
|
|
2158
|
-
constructor(
|
|
2165
|
+
constructor(a, t) {
|
|
2159
2166
|
S(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
2160
2167
|
S(this, "zIndex");
|
|
2161
2168
|
S(this, "onPointerEnter");
|
|
2162
2169
|
S(this, "onPointerLeave");
|
|
2163
|
-
this._localeService =
|
|
2170
|
+
this._localeService = a, this._commandService = t;
|
|
2164
2171
|
}
|
|
2165
|
-
_ensureMap(
|
|
2166
|
-
let
|
|
2167
|
-
return
|
|
2172
|
+
_ensureMap(a) {
|
|
2173
|
+
let t = this._dropdownInfoMap.get(a);
|
|
2174
|
+
return t || (t = /* @__PURE__ */ new Map(), this._dropdownInfoMap.set(a, t)), t;
|
|
2168
2175
|
}
|
|
2169
|
-
_generateKey(
|
|
2170
|
-
return `${
|
|
2176
|
+
_generateKey(a, t) {
|
|
2177
|
+
return `${a}.${t}`;
|
|
2171
2178
|
}
|
|
2172
|
-
_drawDownIcon(
|
|
2179
|
+
_drawDownIcon(a, t, e, r, o) {
|
|
2173
2180
|
const n = e - Re + 4;
|
|
2174
2181
|
let i = 9;
|
|
2175
2182
|
switch (o) {
|
|
2176
|
-
case
|
|
2183
|
+
case me.MIDDLE:
|
|
2177
2184
|
i = (r - Re) / 2 + 4;
|
|
2178
2185
|
break;
|
|
2179
|
-
case
|
|
2186
|
+
case me.BOTTOM:
|
|
2180
2187
|
i = r - Re - 1;
|
|
2181
2188
|
break;
|
|
2182
2189
|
}
|
|
2183
|
-
|
|
2190
|
+
a.save(), a.translateWithPrecision(t.startX + n, t.startY + i), a.fillStyle = "#565656", a.fill(sr), a.restore();
|
|
2184
2191
|
}
|
|
2185
2192
|
// eslint-disable-next-line max-lines-per-function
|
|
2186
|
-
drawWith(
|
|
2193
|
+
drawWith(a, t, e) {
|
|
2187
2194
|
var U, O;
|
|
2188
|
-
const { primaryWithCoord: r, row: o, col: n, style: i, data: s, subUnitId: l } =
|
|
2195
|
+
const { primaryWithCoord: r, row: o, col: n, style: i, data: s, subUnitId: l } = t, d = r.isMergedMainCell ? r.mergeInfo : r, c = (U = s.dataValidation) == null ? void 0 : U.rule, u = (O = s.dataValidation) == null ? void 0 : O.validator, f = s.fontRenderExtension, { leftOffset: p = 0, rightOffset: m = 0, topOffset: h = 0, downOffset: R = 0 } = f || {};
|
|
2189
2196
|
if (!c || !u || !u.skipDefaultFontRender(c))
|
|
2190
2197
|
return;
|
|
2191
2198
|
const g = {
|
|
@@ -2193,42 +2200,42 @@ let Ia = (ha = class {
|
|
|
2193
2200
|
endX: d.endX - m,
|
|
2194
2201
|
startY: d.startY + h,
|
|
2195
2202
|
endY: d.endY - R
|
|
2196
|
-
}, C = g.endX - g.startX, _ = g.endY - g.startY, M = this._ensureMap(l),
|
|
2203
|
+
}, C = g.endX - g.startX, _ = g.endY - g.startY, M = this._ensureMap(l), y = this._generateKey(o, n), D = u.getListWithColor(c), E = ae(s), x = `${E != null ? E : ""}`, T = D.find((L) => L.label === x);
|
|
2197
2204
|
let { tb: F, vt: b, ht: P } = i || {};
|
|
2198
|
-
if (F = F != null ? F : se.WRAP, b = b != null ? b :
|
|
2199
|
-
this._drawDownIcon(
|
|
2205
|
+
if (F = F != null ? F : se.WRAP, b = b != null ? b : me.BOTTOM, P = P != null ? P : Be.LEFT, c.renderMode === le.ARROW) {
|
|
2206
|
+
this._drawDownIcon(a, g, C, _, b), a.save(), a.translateWithPrecision(g.startX, g.startY), a.beginPath(), a.rect(0, 0, C, _), a.clip();
|
|
2200
2207
|
const L = C - Re, { documentSkeleton: H, documents: K, docModel: k } = aa(x, this._localeService, i);
|
|
2201
2208
|
F === se.WRAP && k.updateDocumentDataPageSize(Math.max(L, 1)), H.calculate(), H.getActualSize();
|
|
2202
|
-
const
|
|
2203
|
-
|
|
2209
|
+
const w = Mt(H), { height: j, width: oe } = w, { paddingTop: G, paddingLeft: Se } = lr(L, _, oe, j, b, P);
|
|
2210
|
+
a.translate(0, G), a.save(), a.translateWithPrecision(ze, 0), a.beginPath(), a.rect(0, 0, L, j), a.clip(), K.render(a), a.translateWithPrecision(Se, 0), a.restore(), a.restore(), M.set(y, {
|
|
2204
2211
|
left: g.endX + e.rowHeaderWidth - Re,
|
|
2205
2212
|
top: g.startY + e.columnHeaderHeight,
|
|
2206
2213
|
width: Re,
|
|
2207
2214
|
height: _
|
|
2208
2215
|
});
|
|
2209
2216
|
} else {
|
|
2210
|
-
|
|
2217
|
+
a.save(), a.translateWithPrecision(g.startX, g.startY), a.beginPath(), a.rect(0, 0, C, _), a.clip();
|
|
2211
2218
|
const L = C - Pe * 2 - ze - Re, { documentSkeleton: H, documents: K, docModel: k } = aa(x, this._localeService, i);
|
|
2212
2219
|
F === se.WRAP && k.updateDocumentDataPageSize(Math.max(L, 1)), H.calculate();
|
|
2213
|
-
const
|
|
2214
|
-
|
|
2220
|
+
const w = Mt(H), { height: j, width: oe } = w, { paddingTop: G, paddingLeft: Se } = lr(L, _, oe, j, b, P);
|
|
2221
|
+
a.translate(Pe, G);
|
|
2215
2222
|
const N = Math.max(C - Pe * 2, 1), X = j;
|
|
2216
|
-
yr.drawWith(
|
|
2223
|
+
yr.drawWith(a, {
|
|
2217
2224
|
width: N,
|
|
2218
2225
|
height: X,
|
|
2219
2226
|
fill: (T == null ? void 0 : T.color) || xe,
|
|
2220
2227
|
radius: 8
|
|
2221
|
-
}),
|
|
2228
|
+
}), a.save(), a.translateWithPrecision(ze, 0), a.beginPath(), a.rect(0, 0, L, j), a.clip(), a.translateWithPrecision(Se, 0), K.render(a), a.restore(), a.translate(L + ze + 4, (j - _s) / 2), a.fillStyle = Ss, a.fill(sr), a.restore(), M.set(y, {
|
|
2222
2229
|
left: g.startX + Pe + e.rowHeaderWidth,
|
|
2223
|
-
top: g.startY +
|
|
2230
|
+
top: g.startY + G + e.columnHeaderHeight,
|
|
2224
2231
|
width: N,
|
|
2225
2232
|
height: X
|
|
2226
2233
|
});
|
|
2227
2234
|
}
|
|
2228
2235
|
}
|
|
2229
|
-
calcCellAutoHeight(
|
|
2236
|
+
calcCellAutoHeight(a) {
|
|
2230
2237
|
var R;
|
|
2231
|
-
const { primaryWithCoord:
|
|
2238
|
+
const { primaryWithCoord: t, style: e, data: r } = a, o = t.isMergedMainCell ? t.mergeInfo : t, n = r.fontRenderExtension, { leftOffset: i = 0, rightOffset: s = 0, topOffset: l = 0, downOffset: d = 0 } = n || {}, c = (R = r.dataValidation) == null ? void 0 : R.rule;
|
|
2232
2239
|
if (!c || c.renderMode === le.TEXT)
|
|
2233
2240
|
return;
|
|
2234
2241
|
const u = {
|
|
@@ -2241,28 +2248,28 @@ let Ia = (ha = class {
|
|
|
2241
2248
|
if (h = h != null ? h : se.WRAP, c.renderMode === le.ARROW) {
|
|
2242
2249
|
const g = f - Re, { documentSkeleton: C, docModel: _ } = aa(m, this._localeService, e);
|
|
2243
2250
|
h === se.WRAP && _.updateDocumentDataPageSize(Math.max(g, 1)), C.calculate(), C.getActualSize();
|
|
2244
|
-
const M = Mt(C), { height:
|
|
2245
|
-
return
|
|
2251
|
+
const M = Mt(C), { height: y } = M;
|
|
2252
|
+
return y;
|
|
2246
2253
|
} else {
|
|
2247
2254
|
const g = f - Pe * 2 - ze - Re, { documentSkeleton: C, docModel: _ } = Jr(m, this._localeService, e);
|
|
2248
2255
|
h === se.WRAP && _.updateDocumentDataPageSize(Math.max(g, 1)), C.calculate();
|
|
2249
2256
|
const M = Mt(C), {
|
|
2250
|
-
height:
|
|
2257
|
+
height: y
|
|
2251
2258
|
} = M;
|
|
2252
|
-
return
|
|
2259
|
+
return y + Oe * 2;
|
|
2253
2260
|
}
|
|
2254
2261
|
}
|
|
2255
|
-
isHit(
|
|
2256
|
-
const { data: e, subUnitId: r, row: o, col: n } =
|
|
2262
|
+
isHit(a, t) {
|
|
2263
|
+
const { data: e, subUnitId: r, row: o, col: n } = t, s = this._ensureMap(r).get(this._generateKey(o, n)), l = e.dataValidation;
|
|
2257
2264
|
if (!l || !s || l.rule.renderMode === le.TEXT)
|
|
2258
2265
|
return !1;
|
|
2259
|
-
const { top: d, left: c, width: u, height: f } = s, { x: p, y: m } =
|
|
2266
|
+
const { top: d, left: c, width: u, height: f } = s, { x: p, y: m } = a;
|
|
2260
2267
|
return p >= c && p <= c + u && m >= d && m <= d + f;
|
|
2261
2268
|
}
|
|
2262
|
-
onPointerDown(
|
|
2263
|
-
if (
|
|
2269
|
+
onPointerDown(a, t) {
|
|
2270
|
+
if (t.button === 2)
|
|
2264
2271
|
return;
|
|
2265
|
-
const { unitId: e, subUnitId: r, row: o, col: n } =
|
|
2272
|
+
const { unitId: e, subUnitId: r, row: o, col: n } = a, i = {
|
|
2266
2273
|
unitId: e,
|
|
2267
2274
|
subUnitId: r,
|
|
2268
2275
|
row: o,
|
|
@@ -2281,35 +2288,35 @@ Ia = vs([
|
|
|
2281
2288
|
ir(1, ee)
|
|
2282
2289
|
], Ia);
|
|
2283
2290
|
const Cs = "LIST_RENDER_MODE_OPTION_INPUT";
|
|
2284
|
-
function At(
|
|
2291
|
+
function At(a) {
|
|
2285
2292
|
var o;
|
|
2286
|
-
const { value:
|
|
2287
|
-
return /* @__PURE__ */ v.jsx(Z, { label: r.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ v.jsxs(ja, { value: `${(o =
|
|
2293
|
+
const { value: t, onChange: e } = a, r = $(ie);
|
|
2294
|
+
return /* @__PURE__ */ v.jsx(Z, { label: r.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ v.jsxs(ja, { value: `${(o = t.renderMode) != null ? o : le.CUSTOM}`, onChange: (n) => e({ ...t, renderMode: +n }), children: [
|
|
2288
2295
|
/* @__PURE__ */ v.jsx($e, { value: `${le.CUSTOM}`, children: r.t("dataValidation.renderMode.chip") }),
|
|
2289
2296
|
/* @__PURE__ */ v.jsx($e, { value: `${le.ARROW}`, children: r.t("dataValidation.renderMode.arrow") }),
|
|
2290
2297
|
/* @__PURE__ */ v.jsx($e, { value: `${le.TEXT}`, children: r.t("dataValidation.renderMode.text") })
|
|
2291
2298
|
] }) });
|
|
2292
2299
|
}
|
|
2293
2300
|
At.componentKey = Cs;
|
|
2294
|
-
function ra(
|
|
2295
|
-
if (!
|
|
2301
|
+
function ra(a) {
|
|
2302
|
+
if (!a)
|
|
2296
2303
|
return [];
|
|
2297
|
-
const
|
|
2298
|
-
return
|
|
2304
|
+
const t = /* @__PURE__ */ new Set();
|
|
2305
|
+
return a.forEach(
|
|
2299
2306
|
(e) => {
|
|
2300
2307
|
e.forEach((r) => {
|
|
2301
2308
|
var n, i;
|
|
2302
2309
|
const o = ae(r);
|
|
2303
2310
|
if (o != null) {
|
|
2304
2311
|
if (typeof o != "string" && typeof (r == null ? void 0 : r.s) == "object" && ((i = (n = r.s) == null ? void 0 : n.n) != null && i.pattern)) {
|
|
2305
|
-
|
|
2312
|
+
t.add(wn.format(r.s.n.pattern, o));
|
|
2306
2313
|
return;
|
|
2307
2314
|
}
|
|
2308
|
-
|
|
2315
|
+
t.add(o.toString());
|
|
2309
2316
|
}
|
|
2310
2317
|
});
|
|
2311
2318
|
}
|
|
2312
|
-
), [...
|
|
2319
|
+
), [...t];
|
|
2313
2320
|
}
|
|
2314
2321
|
const Vs = [
|
|
2315
2322
|
"if",
|
|
@@ -2317,17 +2324,17 @@ const Vs = [
|
|
|
2317
2324
|
"choose",
|
|
2318
2325
|
"offset"
|
|
2319
2326
|
];
|
|
2320
|
-
function Ms(
|
|
2321
|
-
if (!A(
|
|
2327
|
+
function Ms(a, t) {
|
|
2328
|
+
if (!A(a) || Ua(a.slice(1)))
|
|
2322
2329
|
return !0;
|
|
2323
|
-
const r =
|
|
2330
|
+
const r = t.sequenceNodesBuilder(a);
|
|
2324
2331
|
return r && r.some((o) => typeof o == "object" && o.nodeType === Mn.FUNCTION && Vs.indexOf(o.token.toLowerCase()) > -1);
|
|
2325
2332
|
}
|
|
2326
|
-
function Is(
|
|
2327
|
-
const { formula1: e = "", ranges: r } =
|
|
2333
|
+
function Is(a, t) {
|
|
2334
|
+
const { formula1: e = "", ranges: r } = a;
|
|
2328
2335
|
if (Ua(e.slice(1))) {
|
|
2329
2336
|
const n = br(e.slice(1));
|
|
2330
|
-
if ((!n.sheetName || n.sheetName ===
|
|
2337
|
+
if ((!n.sheetName || n.sheetName === t) && r.some((i) => Ue.intersects(i, n.range)))
|
|
2331
2338
|
return !0;
|
|
2332
2339
|
}
|
|
2333
2340
|
return !1;
|
|
@@ -2409,9 +2416,9 @@ class eo extends Ye {
|
|
|
2409
2416
|
}), i;
|
|
2410
2417
|
}
|
|
2411
2418
|
}
|
|
2412
|
-
function xt(
|
|
2413
|
-
let
|
|
2414
|
-
return typeof
|
|
2419
|
+
function xt(a) {
|
|
2420
|
+
let t = a;
|
|
2421
|
+
return typeof a == "string" ? ((a.startsWith("¥") || a.startsWith("$")) && (t = a.slice(1)), +t) : +a;
|
|
2415
2422
|
}
|
|
2416
2423
|
class ws extends Ye {
|
|
2417
2424
|
constructor() {
|
|
@@ -2619,12 +2626,12 @@ class Es extends Ye {
|
|
|
2619
2626
|
return e.operator ? `${this.localeService.t(No[e.operator]).replace(ys, (o = e.formula1) != null ? o : "").replace(Ds, (n = e.formula2) != null ? n : "")}` : this.titleStr;
|
|
2620
2627
|
}
|
|
2621
2628
|
}
|
|
2622
|
-
function to(
|
|
2629
|
+
function to(a) {
|
|
2623
2630
|
var e, r;
|
|
2624
|
-
return
|
|
2631
|
+
return a ? a.p ? !((r = (e = a.p.body) == null ? void 0 : e.dataStream) != null ? r : "").slice(0, -2).trim() : Y.isBlank(a.v) : !0;
|
|
2625
2632
|
}
|
|
2626
|
-
function tt(
|
|
2627
|
-
const o = [], n = [], s = r.get(
|
|
2633
|
+
function tt(a, t, e, r) {
|
|
2634
|
+
const o = [], n = [], s = r.get(z).ensureManager(a, t), l = r.get(J), d = Wt(l, { unitId: a, subUnitId: t });
|
|
2628
2635
|
if (!d)
|
|
2629
2636
|
return {
|
|
2630
2637
|
redoMutations: o,
|
|
@@ -2634,8 +2641,8 @@ function tt(t, a, e, r) {
|
|
|
2634
2641
|
function f(h, R) {
|
|
2635
2642
|
h.forEach((g) => {
|
|
2636
2643
|
W.foreach(g, (C, _) => {
|
|
2637
|
-
const M = c.getCellRaw(C, _),
|
|
2638
|
-
(to(M) ||
|
|
2644
|
+
const M = c.getCellRaw(C, _), y = Nr(M);
|
|
2645
|
+
(to(M) || y === R) && u.setValue(C, _, {
|
|
2639
2646
|
v: R,
|
|
2640
2647
|
p: null
|
|
2641
2648
|
});
|
|
@@ -2648,15 +2655,15 @@ function tt(t, a, e, r) {
|
|
|
2648
2655
|
o.push({
|
|
2649
2656
|
id: Ot.id,
|
|
2650
2657
|
params: {
|
|
2651
|
-
unitId:
|
|
2652
|
-
subUnitId:
|
|
2658
|
+
unitId: a,
|
|
2659
|
+
subUnitId: t,
|
|
2653
2660
|
ruleId: h.rule.uid
|
|
2654
2661
|
}
|
|
2655
2662
|
}), n.unshift({
|
|
2656
2663
|
id: pa.id,
|
|
2657
2664
|
params: {
|
|
2658
|
-
unitId:
|
|
2659
|
-
subUnitId:
|
|
2665
|
+
unitId: a,
|
|
2666
|
+
subUnitId: t,
|
|
2660
2667
|
rule: h.rule,
|
|
2661
2668
|
index: h.index
|
|
2662
2669
|
}
|
|
@@ -2666,29 +2673,29 @@ function tt(t, a, e, r) {
|
|
|
2666
2673
|
o.push({
|
|
2667
2674
|
id: pe.id,
|
|
2668
2675
|
params: {
|
|
2669
|
-
unitId:
|
|
2670
|
-
subUnitId:
|
|
2676
|
+
unitId: a,
|
|
2677
|
+
subUnitId: t,
|
|
2671
2678
|
ruleId: h.ruleId,
|
|
2672
2679
|
payload: {
|
|
2673
|
-
type:
|
|
2680
|
+
type: fe.RANGE,
|
|
2674
2681
|
payload: h.newRanges
|
|
2675
2682
|
}
|
|
2676
2683
|
}
|
|
2677
2684
|
}), n.unshift({
|
|
2678
2685
|
id: pe.id,
|
|
2679
2686
|
params: {
|
|
2680
|
-
unitId:
|
|
2681
|
-
subUnitId:
|
|
2687
|
+
unitId: a,
|
|
2688
|
+
subUnitId: t,
|
|
2682
2689
|
ruleId: h.ruleId,
|
|
2683
2690
|
payload: {
|
|
2684
|
-
type:
|
|
2691
|
+
type: fe.RANGE,
|
|
2685
2692
|
payload: h.oldRanges
|
|
2686
2693
|
}
|
|
2687
2694
|
}
|
|
2688
2695
|
});
|
|
2689
2696
|
const R = s.getRuleById(h.ruleId);
|
|
2690
2697
|
if (R && R.type === B.CHECKBOX) {
|
|
2691
|
-
const C = s.getValidator(B.CHECKBOX).parseFormulaSync(R,
|
|
2698
|
+
const C = s.getValidator(B.CHECKBOX).parseFormulaSync(R, a, t);
|
|
2692
2699
|
f(h.newRanges, C.formula2);
|
|
2693
2700
|
}
|
|
2694
2701
|
break;
|
|
@@ -2697,19 +2704,19 @@ function tt(t, a, e, r) {
|
|
|
2697
2704
|
if (o.push({
|
|
2698
2705
|
id: pa.id,
|
|
2699
2706
|
params: {
|
|
2700
|
-
unitId:
|
|
2701
|
-
subUnitId:
|
|
2707
|
+
unitId: a,
|
|
2708
|
+
subUnitId: t,
|
|
2702
2709
|
rule: h.rule
|
|
2703
2710
|
}
|
|
2704
2711
|
}), n.unshift({
|
|
2705
2712
|
id: Ot.id,
|
|
2706
2713
|
params: {
|
|
2707
|
-
unitId:
|
|
2708
|
-
subUnitId:
|
|
2714
|
+
unitId: a,
|
|
2715
|
+
subUnitId: t,
|
|
2709
2716
|
ruleId: h.rule.uid
|
|
2710
2717
|
}
|
|
2711
2718
|
}), h.rule.type === B.CHECKBOX) {
|
|
2712
|
-
const g = s.getValidator(B.CHECKBOX).parseFormulaSync(h.rule,
|
|
2719
|
+
const g = s.getValidator(B.CHECKBOX).parseFormulaSync(h.rule, a, t);
|
|
2713
2720
|
f(h.rule.ranges, g.formula2);
|
|
2714
2721
|
}
|
|
2715
2722
|
break;
|
|
@@ -2719,8 +2726,8 @@ function tt(t, a, e, r) {
|
|
|
2719
2726
|
const p = {
|
|
2720
2727
|
id: Nt.id,
|
|
2721
2728
|
params: {
|
|
2722
|
-
unitId:
|
|
2723
|
-
subUnitId:
|
|
2729
|
+
unitId: a,
|
|
2730
|
+
subUnitId: t,
|
|
2724
2731
|
cellValue: u.getData()
|
|
2725
2732
|
}
|
|
2726
2733
|
}, m = {
|
|
@@ -2735,15 +2742,15 @@ function tt(t, a, e, r) {
|
|
|
2735
2742
|
const qt = {
|
|
2736
2743
|
type: Ie.COMMAND,
|
|
2737
2744
|
id: "sheet.command.updateDataValidationRuleRange",
|
|
2738
|
-
async handler(
|
|
2739
|
-
if (!
|
|
2745
|
+
async handler(a, t) {
|
|
2746
|
+
if (!t)
|
|
2740
2747
|
return !1;
|
|
2741
|
-
const { unitId: e, subUnitId: r, ranges: o, ruleId: n } =
|
|
2748
|
+
const { unitId: e, subUnitId: r, ranges: o, ruleId: n } = t, i = a.get(z), s = a.get(ee), l = a.get(Ht), d = i.ensureManager(e, r), c = d.getRuleById(n);
|
|
2742
2749
|
if (!c)
|
|
2743
2750
|
return !1;
|
|
2744
2751
|
const u = c.ranges, f = d.getRuleObjectMatrix().clone();
|
|
2745
2752
|
f.updateRange(n, u, o);
|
|
2746
|
-
const p = f.diff(d.getDataValidations()), { redoMutations: m, undoMutations: h } = tt(e, r, p,
|
|
2753
|
+
const p = f.diff(d.getDataValidations()), { redoMutations: m, undoMutations: h } = tt(e, r, p, a);
|
|
2747
2754
|
return l.pushUndoRedo({
|
|
2748
2755
|
undoMutations: h,
|
|
2749
2756
|
redoMutations: m,
|
|
@@ -2753,16 +2760,16 @@ const qt = {
|
|
|
2753
2760
|
}, zt = {
|
|
2754
2761
|
type: Ie.COMMAND,
|
|
2755
2762
|
id: "sheet.command.addDataValidation",
|
|
2756
|
-
async handler(
|
|
2757
|
-
if (!
|
|
2763
|
+
async handler(a, t) {
|
|
2764
|
+
if (!t)
|
|
2758
2765
|
return !1;
|
|
2759
|
-
const { unitId: e, subUnitId: r, rule: o } =
|
|
2766
|
+
const { unitId: e, subUnitId: r, rule: o } = t, n = a.get(z), i = a.get(ee), s = a.get(Ht), l = n.ensureManager(e, r), d = l.getRuleObjectMatrix().clone();
|
|
2760
2767
|
d.addRule(o);
|
|
2761
2768
|
const c = d.diff(l.getDataValidations()), u = {
|
|
2762
2769
|
unitId: e,
|
|
2763
2770
|
subUnitId: r,
|
|
2764
2771
|
rule: o
|
|
2765
|
-
}, { redoMutations: f, undoMutations: p } = tt(e, r, c,
|
|
2772
|
+
}, { redoMutations: f, undoMutations: p } = tt(e, r, c, a);
|
|
2766
2773
|
return f.push({
|
|
2767
2774
|
id: pa.id,
|
|
2768
2775
|
params: u
|
|
@@ -2782,10 +2789,10 @@ const qt = {
|
|
|
2782
2789
|
}, ka = {
|
|
2783
2790
|
type: Ie.COMMAND,
|
|
2784
2791
|
id: "data-validation.command.addRuleAndOpen",
|
|
2785
|
-
async handler(
|
|
2786
|
-
const
|
|
2792
|
+
async handler(a) {
|
|
2793
|
+
const t = a.get(J), e = Wt(t);
|
|
2787
2794
|
if (!e) return !1;
|
|
2788
|
-
const { workbook: r, worksheet: o } = e, n = gr(
|
|
2795
|
+
const { workbook: r, worksheet: o } = e, n = gr(a), i = a.get(ee), s = r.getUnitId(), l = o.getSheetId(), d = {
|
|
2789
2796
|
rule: n,
|
|
2790
2797
|
unitId: s,
|
|
2791
2798
|
subUnitId: l
|
|
@@ -2799,10 +2806,10 @@ const qt = {
|
|
|
2799
2806
|
type: Ie.COMMAND,
|
|
2800
2807
|
id: "sheets.command.update-data-validation-setting",
|
|
2801
2808
|
// eslint-disable-next-line max-lines-per-function
|
|
2802
|
-
handler(
|
|
2803
|
-
if (!
|
|
2809
|
+
handler(a, t) {
|
|
2810
|
+
if (!t)
|
|
2804
2811
|
return !1;
|
|
2805
|
-
const e =
|
|
2812
|
+
const e = a.get(ee), r = a.get(Ht), o = a.get(z), n = a.get(we), { unitId: i, subUnitId: s, ruleId: l, setting: d } = t, c = n.getValidatorItem(d.type);
|
|
2806
2813
|
if (!c)
|
|
2807
2814
|
return !1;
|
|
2808
2815
|
const u = o.getRuleById(i, s, l);
|
|
@@ -2813,7 +2820,7 @@ const qt = {
|
|
|
2813
2820
|
subUnitId: s,
|
|
2814
2821
|
ruleId: l,
|
|
2815
2822
|
payload: {
|
|
2816
|
-
type:
|
|
2823
|
+
type: fe.SETTING,
|
|
2817
2824
|
payload: d
|
|
2818
2825
|
}
|
|
2819
2826
|
}, p = [{
|
|
@@ -2824,7 +2831,7 @@ const qt = {
|
|
|
2824
2831
|
subUnitId: s,
|
|
2825
2832
|
ruleId: l,
|
|
2826
2833
|
payload: {
|
|
2827
|
-
type:
|
|
2834
|
+
type: fe.SETTING,
|
|
2828
2835
|
payload: fa(u)
|
|
2829
2836
|
}
|
|
2830
2837
|
}, h = [{
|
|
@@ -2832,12 +2839,12 @@ const qt = {
|
|
|
2832
2839
|
params: m
|
|
2833
2840
|
}];
|
|
2834
2841
|
if (d.type === B.CHECKBOX) {
|
|
2835
|
-
const g = u.ranges, C =
|
|
2842
|
+
const g = u.ranges, C = a.get(J), _ = Wt(C, { unitId: i, subUnitId: s });
|
|
2836
2843
|
if (_) {
|
|
2837
|
-
const M = new ke(), { worksheet:
|
|
2844
|
+
const M = new ke(), { worksheet: y } = _, { formula2: D = vt, formula1: E = gt } = u, { formula2: x = vt, formula1: T = gt } = d;
|
|
2838
2845
|
g.forEach((P) => {
|
|
2839
2846
|
W.foreach(P, (U, O) => {
|
|
2840
|
-
const L =
|
|
2847
|
+
const L = y.getCellRaw(U, O), H = Nr(L);
|
|
2841
2848
|
to(L) || H === String(D) ? M.setValue(U, O, {
|
|
2842
2849
|
v: x,
|
|
2843
2850
|
p: null
|
|
@@ -2856,7 +2863,7 @@ const qt = {
|
|
|
2856
2863
|
}
|
|
2857
2864
|
}, b = {
|
|
2858
2865
|
id: Nt.id,
|
|
2859
|
-
params: _r(
|
|
2866
|
+
params: _r(a, F.params)
|
|
2860
2867
|
};
|
|
2861
2868
|
p.push(F), h.push(b);
|
|
2862
2869
|
}
|
|
@@ -2870,10 +2877,10 @@ const qt = {
|
|
|
2870
2877
|
}, ao = {
|
|
2871
2878
|
type: Ie.COMMAND,
|
|
2872
2879
|
id: "sheets.command.update-data-validation-options",
|
|
2873
|
-
handler(
|
|
2874
|
-
if (!
|
|
2880
|
+
handler(a, t) {
|
|
2881
|
+
if (!t)
|
|
2875
2882
|
return !1;
|
|
2876
|
-
const e =
|
|
2883
|
+
const e = a.get(ee), r = a.get(Ht), o = a.get(z), { unitId: n, subUnitId: i, ruleId: s, options: l } = t, d = o.getRuleById(n, i, s);
|
|
2877
2884
|
if (!d)
|
|
2878
2885
|
return !1;
|
|
2879
2886
|
const c = {
|
|
@@ -2881,7 +2888,7 @@ const qt = {
|
|
|
2881
2888
|
subUnitId: i,
|
|
2882
2889
|
ruleId: s,
|
|
2883
2890
|
payload: {
|
|
2884
|
-
type:
|
|
2891
|
+
type: fe.OPTIONS,
|
|
2885
2892
|
payload: l
|
|
2886
2893
|
}
|
|
2887
2894
|
}, u = [{
|
|
@@ -2892,7 +2899,7 @@ const qt = {
|
|
|
2892
2899
|
subUnitId: i,
|
|
2893
2900
|
ruleId: s,
|
|
2894
2901
|
payload: {
|
|
2895
|
-
type:
|
|
2902
|
+
type: fe.OPTIONS,
|
|
2896
2903
|
payload: ma(d)
|
|
2897
2904
|
}
|
|
2898
2905
|
}, p = [{
|
|
@@ -2906,7 +2913,7 @@ const qt = {
|
|
|
2906
2913
|
}), e.executeCommand(pe.id, c), !0;
|
|
2907
2914
|
}
|
|
2908
2915
|
}, ro = "data-validation-single", Ya = "sheet.menu.data-validation";
|
|
2909
|
-
function bs(
|
|
2916
|
+
function bs(a) {
|
|
2910
2917
|
return {
|
|
2911
2918
|
id: Ya,
|
|
2912
2919
|
type: Pa.SUBITEMS,
|
|
@@ -2914,11 +2921,11 @@ function bs(t) {
|
|
|
2914
2921
|
group: an.TOOLBAR_FORMULAS_INSERT,
|
|
2915
2922
|
icon: ro,
|
|
2916
2923
|
tooltip: "dataValidation.title",
|
|
2917
|
-
hidden$: rn(
|
|
2918
|
-
disabled$: Ho(
|
|
2924
|
+
hidden$: rn(a, re.UNIVER_SHEET),
|
|
2925
|
+
disabled$: Ho(a, { workbookTypes: [ga], worksheetTypes: [va, _a], rangeTypes: [Sa] })
|
|
2919
2926
|
};
|
|
2920
2927
|
}
|
|
2921
|
-
function Os(
|
|
2928
|
+
function Os(a) {
|
|
2922
2929
|
return {
|
|
2923
2930
|
id: at.id,
|
|
2924
2931
|
title: "dataValidation.panel.title",
|
|
@@ -2926,7 +2933,7 @@ function Os(t) {
|
|
|
2926
2933
|
positions: [Ya]
|
|
2927
2934
|
};
|
|
2928
2935
|
}
|
|
2929
|
-
function Ns(
|
|
2936
|
+
function Ns(a) {
|
|
2930
2937
|
return {
|
|
2931
2938
|
id: ka.id,
|
|
2932
2939
|
title: "dataValidation.panel.add",
|
|
@@ -2934,11 +2941,11 @@ function Ns(t) {
|
|
|
2934
2941
|
positions: [Ya]
|
|
2935
2942
|
};
|
|
2936
2943
|
}
|
|
2937
|
-
var Ts = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, oo = (
|
|
2938
|
-
for (var o = r > 1 ? void 0 : r ? Fs(
|
|
2939
|
-
(i =
|
|
2940
|
-
return r && o && Ts(
|
|
2941
|
-
}, Q = (
|
|
2944
|
+
var Ts = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, oo = (a, t, e, r) => {
|
|
2945
|
+
for (var o = r > 1 ? void 0 : r ? Fs(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
2946
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
2947
|
+
return r && o && Ts(t, e, o), o;
|
|
2948
|
+
}, Q = (a, t) => (e, r) => t(e, r, a);
|
|
2942
2949
|
const no = {}, io = {
|
|
2943
2950
|
tr: {
|
|
2944
2951
|
size: 6,
|
|
@@ -2946,28 +2953,30 @@ const no = {}, io = {
|
|
|
2946
2953
|
}
|
|
2947
2954
|
};
|
|
2948
2955
|
let dt = class extends Na {
|
|
2949
|
-
constructor(
|
|
2950
|
-
super(), this._config =
|
|
2956
|
+
constructor(a, t, e, r, o, n, i, s, l, d, c, u, f) {
|
|
2957
|
+
super(), this._config = a, this._commandService = t, this._menuService = e, this._renderManagerService = r, this._univerInstanceService = o, this._autoHeightController = n, this._componentManager = i, this._dropdownManagerService = s, this._dataValidationModel = l, this._dataValidatorRegistryService = d, this._injector = c, this._sheetInterceptorService = u, this._editorBridgeService = f, this._initMenu(), this._initSkeletonChange(), this._initDropdown(), this._initViewModelIntercept(), this._initAutoHeight();
|
|
2951
2958
|
}
|
|
2952
2959
|
_initMenu() {
|
|
2953
|
-
const { menu:
|
|
2960
|
+
const { menu: a = {} } = this._config;
|
|
2954
2961
|
[
|
|
2955
2962
|
bs,
|
|
2956
2963
|
Os,
|
|
2957
2964
|
Ns
|
|
2958
|
-
].forEach((
|
|
2965
|
+
].forEach((t) => {
|
|
2959
2966
|
this.disposeWithMe(
|
|
2960
|
-
this._menuService.addMenuItem(
|
|
2967
|
+
this._menuService.addMenuItem(t(this._injector), a)
|
|
2961
2968
|
);
|
|
2962
2969
|
});
|
|
2963
2970
|
}
|
|
2964
2971
|
_initDropdown() {
|
|
2965
|
-
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((
|
|
2966
|
-
if (!
|
|
2972
|
+
this._editorBridgeService && this.disposeWithMe(this._editorBridgeService.visible$.subscribe((a) => {
|
|
2973
|
+
if (!a.visible) {
|
|
2974
|
+
this._dropdownManagerService.hideDropdown();
|
|
2967
2975
|
return;
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2976
|
+
}
|
|
2977
|
+
const t = this._editorBridgeService.getEditCellState();
|
|
2978
|
+
if (t) {
|
|
2979
|
+
const { unitId: e, sheetId: r, row: o, column: n } = t, i = this._univerInstanceService.getUniverSheetInstance(e);
|
|
2971
2980
|
if (!i)
|
|
2972
2981
|
return;
|
|
2973
2982
|
const l = this._dataValidationModel.ensureManager(e, r).getRuleByLocation(o, n);
|
|
@@ -2981,33 +2990,36 @@ let dt = class extends Na {
|
|
|
2981
2990
|
const u = this._dropdownManagerService.activeDropdown, f = u == null ? void 0 : u.location;
|
|
2982
2991
|
if (f && f.unitId === e && f.subUnitId === r && f.row === o && f.col === n)
|
|
2983
2992
|
return;
|
|
2984
|
-
this._dropdownManagerService.showDropdown(
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2993
|
+
this._dropdownManagerService.showDropdown(
|
|
2994
|
+
{
|
|
2995
|
+
location: {
|
|
2996
|
+
unitId: e,
|
|
2997
|
+
subUnitId: r,
|
|
2998
|
+
row: o,
|
|
2999
|
+
col: n,
|
|
3000
|
+
workbook: i,
|
|
3001
|
+
worksheet: c
|
|
3002
|
+
},
|
|
3003
|
+
componentKey: d.dropdown,
|
|
3004
|
+
onHide: () => {
|
|
3005
|
+
}
|
|
2992
3006
|
},
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
}
|
|
2996
|
-
});
|
|
3007
|
+
!1
|
|
3008
|
+
);
|
|
2997
3009
|
}
|
|
2998
3010
|
}));
|
|
2999
3011
|
}
|
|
3000
3012
|
_initSkeletonChange() {
|
|
3001
|
-
const
|
|
3013
|
+
const a = () => {
|
|
3002
3014
|
var i, s, l;
|
|
3003
|
-
const
|
|
3004
|
-
if (!
|
|
3005
|
-
const e =
|
|
3015
|
+
const t = this._univerInstanceService.getCurrentUnitForType(re.UNIVER_SHEET);
|
|
3016
|
+
if (!t) return;
|
|
3017
|
+
const e = t.getUnitId(), r = (i = t.getActiveSheet()) == null ? void 0 : i.getSheetId();
|
|
3006
3018
|
if (!r) return;
|
|
3007
3019
|
const o = (l = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.with(Tt).getWorksheetSkeleton(r)) == null ? void 0 : l.skeleton, n = this._renderManagerService.getRenderById(e);
|
|
3008
3020
|
o == null || o.makeDirty(!0), o == null || o.calculate(), n && n.mainComponent.makeForceDirty();
|
|
3009
3021
|
};
|
|
3010
|
-
this.disposeWithMe(this._dataValidationModel.ruleChange$.subscribe(() =>
|
|
3022
|
+
this.disposeWithMe(this._dataValidationModel.ruleChange$.subscribe(() => a())), this.disposeWithMe(this._dataValidationModel.validStatusChange$.subscribe(() => a()));
|
|
3011
3023
|
}
|
|
3012
3024
|
// eslint-disable-next-line max-lines-per-function
|
|
3013
3025
|
_initViewModelIntercept() {
|
|
@@ -3017,34 +3029,34 @@ let dt = class extends Na {
|
|
|
3017
3029
|
{
|
|
3018
3030
|
priority: 200,
|
|
3019
3031
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
3020
|
-
handler: (
|
|
3021
|
-
var M,
|
|
3022
|
-
const { row: r, col: o, unitId: n, subUnitId: i, workbook: s, worksheet: l } =
|
|
3032
|
+
handler: (a, t, e) => {
|
|
3033
|
+
var M, y, D, E, x, T;
|
|
3034
|
+
const { row: r, col: o, unitId: n, subUnitId: i, workbook: s, worksheet: l } = t, d = this._dataValidationModel.ensureManager(n, i);
|
|
3023
3035
|
if (!d)
|
|
3024
|
-
return e(
|
|
3025
|
-
const c = (
|
|
3036
|
+
return e(a);
|
|
3037
|
+
const c = (y = (M = this._renderManagerService.getRenderById(n)) == null ? void 0 : M.with(Tt).getWorksheetSkeleton(i)) == null ? void 0 : y.skeleton;
|
|
3026
3038
|
if (!c)
|
|
3027
|
-
return e(
|
|
3028
|
-
const u =
|
|
3039
|
+
return e(a);
|
|
3040
|
+
const u = t.workbook.getStyles(), f = (typeof (a == null ? void 0 : a.s) == "string" ? u.get(a == null ? void 0 : a.s) : a == null ? void 0 : a.s) || {}, p = d.getRuleIdByLocation(r, o);
|
|
3029
3041
|
if (!p)
|
|
3030
|
-
return e(
|
|
3042
|
+
return e(a);
|
|
3031
3043
|
const m = d.getRuleById(p);
|
|
3032
3044
|
if (!m)
|
|
3033
|
-
return e(
|
|
3034
|
-
const h = l.getCellRaw(
|
|
3045
|
+
return e(a);
|
|
3046
|
+
const h = l.getCellRaw(t.row, t.col), R = this._dataValidationModel.validator(ae(h), m, t), g = this._dataValidatorRegistryService.getValidatorItem(m.type), C = ae(a);
|
|
3035
3047
|
let _ = {};
|
|
3036
3048
|
if ((m.type === B.LIST || m.type === B.LIST_MULTIPLE) && (_ = {
|
|
3037
3049
|
interceptorStyle: {
|
|
3038
|
-
...
|
|
3050
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3039
3051
|
tb: (D = f.tb !== se.OVERFLOW ? f.tb : se.CLIP) != null ? D : se.WRAP
|
|
3040
3052
|
}
|
|
3041
3053
|
}), m.type === B.CHECKBOX && (_ = {
|
|
3042
3054
|
interceptorStyle: {
|
|
3043
|
-
...
|
|
3055
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3044
3056
|
tb: se.CLIP
|
|
3045
3057
|
}
|
|
3046
3058
|
}), m.type === B.LIST && (m.renderMode === le.ARROW || m.renderMode === le.TEXT)) {
|
|
3047
|
-
const F = g.getListWithColorMap(m), b = `${(E = ae(
|
|
3059
|
+
const F = g.getListWithColorMap(m), b = `${(E = ae(a)) != null ? E : ""}`, P = F[b];
|
|
3048
3060
|
P && (_ = {
|
|
3049
3061
|
..._,
|
|
3050
3062
|
interceptorStyle: {
|
|
@@ -3056,7 +3068,7 @@ let dt = class extends Na {
|
|
|
3056
3068
|
});
|
|
3057
3069
|
}
|
|
3058
3070
|
return e({
|
|
3059
|
-
...
|
|
3071
|
+
...a,
|
|
3060
3072
|
..._,
|
|
3061
3073
|
dataValidation: {
|
|
3062
3074
|
ruleId: p,
|
|
@@ -3065,31 +3077,31 @@ let dt = class extends Na {
|
|
|
3065
3077
|
validator: g
|
|
3066
3078
|
},
|
|
3067
3079
|
markers: {
|
|
3068
|
-
...
|
|
3080
|
+
...a == null ? void 0 : a.markers,
|
|
3069
3081
|
...R === Ce.INVALID ? io : null
|
|
3070
3082
|
},
|
|
3071
3083
|
customRender: [
|
|
3072
|
-
...(x =
|
|
3084
|
+
...(x = a == null ? void 0 : a.customRender) != null ? x : [],
|
|
3073
3085
|
...g != null && g.canvasRender ? [g.canvasRender] : []
|
|
3074
3086
|
],
|
|
3075
3087
|
// @ts-ignore
|
|
3076
3088
|
fontRenderExtension: {
|
|
3077
3089
|
// @ts-ignore
|
|
3078
|
-
...
|
|
3079
|
-
isSkip: g == null ? void 0 : g.skipDefaultFontRender(m, C,
|
|
3090
|
+
...a == null ? void 0 : a.fontRenderExtension,
|
|
3091
|
+
isSkip: g == null ? void 0 : g.skipDefaultFontRender(m, C, t)
|
|
3080
3092
|
},
|
|
3081
3093
|
interceptorStyle: {
|
|
3082
|
-
...
|
|
3094
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3083
3095
|
..._.interceptorStyle
|
|
3084
3096
|
},
|
|
3085
3097
|
get interceptorAutoHeight() {
|
|
3086
3098
|
var P, U, O, L;
|
|
3087
3099
|
const F = c.mergeData.find((H) => {
|
|
3088
|
-
const { startColumn: K, startRow: k, endColumn:
|
|
3089
|
-
return r >= k && o >= K && r <= j && o <=
|
|
3100
|
+
const { startColumn: K, startRow: k, endColumn: w, endRow: j } = H;
|
|
3101
|
+
return r >= k && o >= K && r <= j && o <= w;
|
|
3090
3102
|
}), b = {
|
|
3091
3103
|
data: {
|
|
3092
|
-
...
|
|
3104
|
+
...a,
|
|
3093
3105
|
dataValidation: {
|
|
3094
3106
|
ruleId: p,
|
|
3095
3107
|
validStatus: R,
|
|
@@ -3097,7 +3109,7 @@ let dt = class extends Na {
|
|
|
3097
3109
|
validator: g
|
|
3098
3110
|
}
|
|
3099
3111
|
},
|
|
3100
|
-
style: c.getsStyles().getStyleByCell(
|
|
3112
|
+
style: c.getsStyles().getStyleByCell(a),
|
|
3101
3113
|
primaryWithCoord: c.getCellByIndex((P = F == null ? void 0 : F.startRow) != null ? P : r, (U = F == null ? void 0 : F.startColumn) != null ? U : o),
|
|
3102
3114
|
unitId: n,
|
|
3103
3115
|
subUnitId: i,
|
|
@@ -3108,7 +3120,7 @@ let dt = class extends Na {
|
|
|
3108
3120
|
};
|
|
3109
3121
|
return (L = (O = g == null ? void 0 : g.canvasRender) == null ? void 0 : O.calcCellAutoHeight) == null ? void 0 : L.call(O, b);
|
|
3110
3122
|
},
|
|
3111
|
-
coverable: ((T =
|
|
3123
|
+
coverable: ((T = a == null ? void 0 : a.coverable) != null ? T : !0) && !(m.type === B.LIST || m.type === B.LIST_MULTIPLE)
|
|
3112
3124
|
});
|
|
3113
3125
|
}
|
|
3114
3126
|
}
|
|
@@ -3116,10 +3128,10 @@ let dt = class extends Na {
|
|
|
3116
3128
|
);
|
|
3117
3129
|
}
|
|
3118
3130
|
_initAutoHeight() {
|
|
3119
|
-
this._dataValidationModel.ruleChange$.subscribe((
|
|
3120
|
-
var
|
|
3121
|
-
if ((
|
|
3122
|
-
const e = this._autoHeightController.getUndoRedoParamsOfAutoHeight(
|
|
3131
|
+
this._dataValidationModel.ruleChange$.subscribe((a) => {
|
|
3132
|
+
var t;
|
|
3133
|
+
if ((t = a.rule) != null && t.ranges) {
|
|
3134
|
+
const e = this._autoHeightController.getUndoRedoParamsOfAutoHeight(a.rule.ranges);
|
|
3123
3135
|
Oa(e.redos, this._commandService);
|
|
3124
3136
|
}
|
|
3125
3137
|
});
|
|
@@ -3134,27 +3146,27 @@ dt = oo([
|
|
|
3134
3146
|
Q(5, I(Cr)),
|
|
3135
3147
|
Q(6, I(St)),
|
|
3136
3148
|
Q(7, I(Ne)),
|
|
3137
|
-
Q(8, I(
|
|
3149
|
+
Q(8, I(z)),
|
|
3138
3150
|
Q(9, I(we)),
|
|
3139
3151
|
Q(10, I(Ee)),
|
|
3140
3152
|
Q(11, I(Fa)),
|
|
3141
|
-
Q(12,
|
|
3153
|
+
Q(12, wo(La))
|
|
3142
3154
|
], dt);
|
|
3143
3155
|
let ct = class extends Na {
|
|
3144
|
-
constructor(
|
|
3145
|
-
super(), this._config =
|
|
3156
|
+
constructor(a, t, e, r, o, n, i, s) {
|
|
3157
|
+
super(), this._config = a, this._commandService = t, this._renderManagerService = e, this._univerInstanceService = r, this._autoHeightController = o, this._dataValidationModel = n, this._dataValidatorRegistryService = i, this._sheetInterceptorService = s, this._initSkeletonChange(), this._initViewModelIntercept(), this._initAutoHeight();
|
|
3146
3158
|
}
|
|
3147
3159
|
_initSkeletonChange() {
|
|
3148
|
-
const
|
|
3160
|
+
const a = () => {
|
|
3149
3161
|
var i, s, l;
|
|
3150
|
-
const
|
|
3151
|
-
if (!
|
|
3152
|
-
const e =
|
|
3162
|
+
const t = this._univerInstanceService.getCurrentUnitForType(re.UNIVER_SHEET);
|
|
3163
|
+
if (!t) return;
|
|
3164
|
+
const e = t.getUnitId(), r = (i = t.getActiveSheet()) == null ? void 0 : i.getSheetId();
|
|
3153
3165
|
if (!r) return;
|
|
3154
3166
|
const o = (l = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.with(Tt).getWorksheetSkeleton(r)) == null ? void 0 : l.skeleton, n = this._renderManagerService.getRenderById(e);
|
|
3155
3167
|
o == null || o.makeDirty(!0), o == null || o.calculate(), n && n.mainComponent.makeForceDirty();
|
|
3156
3168
|
};
|
|
3157
|
-
this.disposeWithMe(this._dataValidationModel.ruleChange$.subscribe(() =>
|
|
3169
|
+
this.disposeWithMe(this._dataValidationModel.ruleChange$.subscribe(() => a())), this.disposeWithMe(this._dataValidationModel.validStatusChange$.subscribe(() => a()));
|
|
3158
3170
|
}
|
|
3159
3171
|
// eslint-disable-next-line max-lines-per-function
|
|
3160
3172
|
_initViewModelIntercept() {
|
|
@@ -3164,34 +3176,34 @@ let ct = class extends Na {
|
|
|
3164
3176
|
{
|
|
3165
3177
|
priority: 200,
|
|
3166
3178
|
// eslint-disable-next-line max-lines-per-function
|
|
3167
|
-
handler: (
|
|
3168
|
-
var M,
|
|
3169
|
-
const { row: r, col: o, unitId: n, subUnitId: i, workbook: s, worksheet: l } =
|
|
3179
|
+
handler: (a, t, e) => {
|
|
3180
|
+
var M, y, D, E, x;
|
|
3181
|
+
const { row: r, col: o, unitId: n, subUnitId: i, workbook: s, worksheet: l } = t, d = this._dataValidationModel.ensureManager(n, i);
|
|
3170
3182
|
if (!d)
|
|
3171
|
-
return e(
|
|
3172
|
-
const c = (
|
|
3183
|
+
return e(a);
|
|
3184
|
+
const c = (y = (M = this._renderManagerService.getRenderById(n)) == null ? void 0 : M.with(Tt).getWorksheetSkeleton(i)) == null ? void 0 : y.skeleton;
|
|
3173
3185
|
if (!c)
|
|
3174
|
-
return e(
|
|
3175
|
-
const u =
|
|
3186
|
+
return e(a);
|
|
3187
|
+
const u = t.workbook.getStyles(), f = (typeof (a == null ? void 0 : a.s) == "string" ? u.get(a == null ? void 0 : a.s) : a == null ? void 0 : a.s) || {}, p = d.getRuleIdByLocation(r, o);
|
|
3176
3188
|
if (!p)
|
|
3177
|
-
return e(
|
|
3189
|
+
return e(a);
|
|
3178
3190
|
const m = d.getRuleById(p);
|
|
3179
3191
|
if (!m)
|
|
3180
|
-
return e(
|
|
3181
|
-
const h =
|
|
3192
|
+
return e(a);
|
|
3193
|
+
const h = t.worksheet.getCellRaw(t.row, t.col), R = this._dataValidationModel.validator(ae(h), m, t), g = this._dataValidatorRegistryService.getValidatorItem(m.type), C = ae(a);
|
|
3182
3194
|
let _ = {};
|
|
3183
3195
|
if ((m.type === B.LIST || m.type === B.LIST_MULTIPLE) && (_ = {
|
|
3184
3196
|
interceptorStyle: {
|
|
3185
|
-
...
|
|
3197
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3186
3198
|
tb: (D = f.tb !== se.OVERFLOW ? f.tb : se.CLIP) != null ? D : se.WRAP
|
|
3187
3199
|
}
|
|
3188
3200
|
}), m.type === B.CHECKBOX && (_ = {
|
|
3189
3201
|
interceptorStyle: {
|
|
3190
|
-
...
|
|
3202
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3191
3203
|
tb: se.CLIP
|
|
3192
3204
|
}
|
|
3193
3205
|
}), m.type === B.LIST && (m.renderMode === le.ARROW || m.renderMode === le.TEXT)) {
|
|
3194
|
-
const T = g.getListWithColorMap(m), F = `${(E = ae(
|
|
3206
|
+
const T = g.getListWithColorMap(m), F = `${(E = ae(a)) != null ? E : ""}`, b = T[F];
|
|
3195
3207
|
b && (_ = {
|
|
3196
3208
|
..._,
|
|
3197
3209
|
interceptorStyle: {
|
|
@@ -3203,7 +3215,7 @@ let ct = class extends Na {
|
|
|
3203
3215
|
});
|
|
3204
3216
|
}
|
|
3205
3217
|
return e({
|
|
3206
|
-
...
|
|
3218
|
+
...a,
|
|
3207
3219
|
..._,
|
|
3208
3220
|
dataValidation: {
|
|
3209
3221
|
ruleId: p,
|
|
@@ -3212,31 +3224,31 @@ let ct = class extends Na {
|
|
|
3212
3224
|
validator: g
|
|
3213
3225
|
},
|
|
3214
3226
|
markers: {
|
|
3215
|
-
...
|
|
3227
|
+
...a == null ? void 0 : a.markers,
|
|
3216
3228
|
...R === Ce.INVALID ? io : null
|
|
3217
3229
|
},
|
|
3218
3230
|
customRender: [
|
|
3219
|
-
...(x =
|
|
3231
|
+
...(x = a == null ? void 0 : a.customRender) != null ? x : [],
|
|
3220
3232
|
...g != null && g.canvasRender ? [g.canvasRender] : []
|
|
3221
3233
|
],
|
|
3222
3234
|
// @ts-ignore
|
|
3223
3235
|
fontRenderExtension: {
|
|
3224
3236
|
// @ts-ignore
|
|
3225
|
-
...
|
|
3226
|
-
isSkip: g == null ? void 0 : g.skipDefaultFontRender(m, C,
|
|
3237
|
+
...a == null ? void 0 : a.fontRenderExtension,
|
|
3238
|
+
isSkip: g == null ? void 0 : g.skipDefaultFontRender(m, C, t)
|
|
3227
3239
|
},
|
|
3228
3240
|
interceptorStyle: {
|
|
3229
|
-
...
|
|
3241
|
+
...a == null ? void 0 : a.interceptorStyle,
|
|
3230
3242
|
..._.interceptorStyle
|
|
3231
3243
|
},
|
|
3232
3244
|
get interceptorAutoHeight() {
|
|
3233
3245
|
var b, P, U, O;
|
|
3234
3246
|
const T = c.mergeData.find((L) => {
|
|
3235
|
-
const { startColumn: H, startRow: K, endColumn: k, endRow:
|
|
3236
|
-
return r >= K && o >= H && r <=
|
|
3247
|
+
const { startColumn: H, startRow: K, endColumn: k, endRow: w } = L;
|
|
3248
|
+
return r >= K && o >= H && r <= w && o <= k;
|
|
3237
3249
|
}), F = {
|
|
3238
3250
|
data: {
|
|
3239
|
-
...
|
|
3251
|
+
...a,
|
|
3240
3252
|
dataValidation: {
|
|
3241
3253
|
ruleId: p,
|
|
3242
3254
|
validStatus: R,
|
|
@@ -3244,7 +3256,7 @@ let ct = class extends Na {
|
|
|
3244
3256
|
validator: g
|
|
3245
3257
|
}
|
|
3246
3258
|
},
|
|
3247
|
-
style: c.getsStyles().getStyleByCell(
|
|
3259
|
+
style: c.getsStyles().getStyleByCell(a),
|
|
3248
3260
|
primaryWithCoord: c.getCellByIndex((b = T == null ? void 0 : T.startRow) != null ? b : r, (P = T == null ? void 0 : T.startColumn) != null ? P : o),
|
|
3249
3261
|
unitId: n,
|
|
3250
3262
|
subUnitId: i,
|
|
@@ -3262,10 +3274,10 @@ let ct = class extends Na {
|
|
|
3262
3274
|
);
|
|
3263
3275
|
}
|
|
3264
3276
|
_initAutoHeight() {
|
|
3265
|
-
this._dataValidationModel.ruleChange$.subscribe((
|
|
3266
|
-
var
|
|
3267
|
-
if ((
|
|
3268
|
-
const e = this._autoHeightController.getUndoRedoParamsOfAutoHeight(
|
|
3277
|
+
this._dataValidationModel.ruleChange$.subscribe((a) => {
|
|
3278
|
+
var t;
|
|
3279
|
+
if ((t = a.rule) != null && t.ranges) {
|
|
3280
|
+
const e = this._autoHeightController.getUndoRedoParamsOfAutoHeight(a.rule.ranges);
|
|
3269
3281
|
Oa(e.redos, this._commandService);
|
|
3270
3282
|
}
|
|
3271
3283
|
});
|
|
@@ -3277,53 +3289,56 @@ ct = oo([
|
|
|
3277
3289
|
Q(2, Aa),
|
|
3278
3290
|
Q(3, J),
|
|
3279
3291
|
Q(4, I(Cr)),
|
|
3280
|
-
Q(5, I(
|
|
3292
|
+
Q(5, I(z)),
|
|
3281
3293
|
Q(6, I(we)),
|
|
3282
3294
|
Q(7, I(Fa))
|
|
3283
3295
|
], ct);
|
|
3284
|
-
var Ls = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, As = (
|
|
3285
|
-
for (var o = r > 1 ? void 0 : r ? Ps(
|
|
3286
|
-
(i =
|
|
3287
|
-
return r && o && Ls(
|
|
3288
|
-
}, xs = (
|
|
3289
|
-
let _t = class {
|
|
3296
|
+
var Ls = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, As = (a, t, e, r) => {
|
|
3297
|
+
for (var o = r > 1 ? void 0 : r ? Ps(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3298
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3299
|
+
return r && o && Ls(t, e, o), o;
|
|
3300
|
+
}, xs = (a, t) => (e, r) => t(e, r, a);
|
|
3301
|
+
let _t = class extends ue {
|
|
3290
3302
|
constructor(t) {
|
|
3303
|
+
super();
|
|
3291
3304
|
S(this, "_currentManager");
|
|
3292
3305
|
S(this, "_currentManager$", new Dr());
|
|
3293
3306
|
S(this, "currentManager$", this._currentManager$.asObservable());
|
|
3294
|
-
this._dataValidationModel = t
|
|
3307
|
+
this._dataValidationModel = t, this.disposeWithMe(() => {
|
|
3308
|
+
this._currentManager$.complete();
|
|
3309
|
+
});
|
|
3295
3310
|
}
|
|
3296
3311
|
get currentManager() {
|
|
3297
3312
|
return this._currentManager;
|
|
3298
3313
|
}
|
|
3299
|
-
_ensureManager(t,
|
|
3300
|
-
return this._dataValidationModel.ensureManager(t,
|
|
3314
|
+
_ensureManager(t, e) {
|
|
3315
|
+
return this._dataValidationModel.ensureManager(t, e);
|
|
3301
3316
|
}
|
|
3302
|
-
switchCurrent(t,
|
|
3303
|
-
var
|
|
3304
|
-
if (t === ((
|
|
3317
|
+
switchCurrent(t, e) {
|
|
3318
|
+
var o, n;
|
|
3319
|
+
if (t === ((o = this.currentManager) == null ? void 0 : o.unitId) && e === ((n = this._currentManager) == null ? void 0 : n.subUnitId))
|
|
3305
3320
|
return;
|
|
3306
|
-
const
|
|
3321
|
+
const r = this._ensureManager(t, e);
|
|
3307
3322
|
this._currentManager = {
|
|
3308
|
-
manager:
|
|
3323
|
+
manager: r,
|
|
3309
3324
|
unitId: t,
|
|
3310
|
-
subUnitId:
|
|
3325
|
+
subUnitId: e
|
|
3311
3326
|
}, this._currentManager$.next(this._currentManager);
|
|
3312
3327
|
}
|
|
3313
|
-
get(t,
|
|
3314
|
-
return this._ensureManager(t,
|
|
3328
|
+
get(t, e) {
|
|
3329
|
+
return this._ensureManager(t, e);
|
|
3315
3330
|
}
|
|
3316
3331
|
};
|
|
3317
3332
|
_t = As([
|
|
3318
|
-
xs(0, I(
|
|
3333
|
+
xs(0, I(z))
|
|
3319
3334
|
], _t);
|
|
3320
|
-
var js = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Bs = (
|
|
3321
|
-
for (var o = r > 1 ? void 0 : r ? $s(
|
|
3322
|
-
(i =
|
|
3323
|
-
return r && o && js(
|
|
3324
|
-
}, yt = (
|
|
3325
|
-
let We = class extends
|
|
3326
|
-
constructor(
|
|
3335
|
+
var js = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Bs = (a, t, e, r) => {
|
|
3336
|
+
for (var o = r > 1 ? void 0 : r ? $s(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3337
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3338
|
+
return r && o && js(t, e, o), o;
|
|
3339
|
+
}, yt = (a, t) => (e, r) => t(e, r, a);
|
|
3340
|
+
let We = class extends ue {
|
|
3341
|
+
constructor(t, e, r, o) {
|
|
3327
3342
|
super();
|
|
3328
3343
|
S(this, "_formulaMap", /* @__PURE__ */ new Map());
|
|
3329
3344
|
/**
|
|
@@ -3334,12 +3349,12 @@ let We = class extends fe {
|
|
|
3334
3349
|
* reflect of formulaId to cell, only store transformable formula
|
|
3335
3350
|
*/
|
|
3336
3351
|
S(this, "_formulaCellMap", /* @__PURE__ */ new Map());
|
|
3337
|
-
this._registerOtherFormulaService =
|
|
3352
|
+
this._registerOtherFormulaService = t, this._lexerTreeBuilder = e, this._dataValidationModel = r, this._dataValidationCacheService = o, this._initFormulaResultHandler();
|
|
3338
3353
|
}
|
|
3339
3354
|
_initFormulaResultHandler() {
|
|
3340
|
-
this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((
|
|
3341
|
-
for (const e in
|
|
3342
|
-
const r =
|
|
3355
|
+
this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((t) => {
|
|
3356
|
+
for (const e in t) {
|
|
3357
|
+
const r = t[e];
|
|
3343
3358
|
for (const o in r) {
|
|
3344
3359
|
const n = r[o], { formulaCellMap: i, ruleFormulaMap: s } = this._ensureMaps(e, o), l = this._dataValidationModel.ensureManager(e, o);
|
|
3345
3360
|
n.forEach((d) => {
|
|
@@ -3351,9 +3366,9 @@ let We = class extends fe {
|
|
|
3351
3366
|
}
|
|
3352
3367
|
}));
|
|
3353
3368
|
}
|
|
3354
|
-
_ensureMaps(
|
|
3355
|
-
let r = this._formulaMap.get(
|
|
3356
|
-
(!r || !o || !n) && (r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), this._formulaMap.set(
|
|
3369
|
+
_ensureMaps(t, e) {
|
|
3370
|
+
let r = this._formulaMap.get(t), o = this._ruleFormulaMap.get(t), n = this._formulaCellMap.get(t);
|
|
3371
|
+
(!r || !o || !n) && (r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), this._formulaMap.set(t, r), this._ruleFormulaMap.set(t, o), this._formulaCellMap.set(t, n));
|
|
3357
3372
|
let i = r.get(e), s = o.get(e), l = n.get(e);
|
|
3358
3373
|
return (!i || !s || !l) && (i = new ke(), r.set(e, i), s = /* @__PURE__ */ new Map(), o.set(e, s), l = /* @__PURE__ */ new Map(), n.set(e, l)), {
|
|
3359
3374
|
formulaMap: i,
|
|
@@ -3361,11 +3376,11 @@ let We = class extends fe {
|
|
|
3361
3376
|
formulaCellMap: l
|
|
3362
3377
|
};
|
|
3363
3378
|
}
|
|
3364
|
-
_registerFormula(
|
|
3365
|
-
return this._registerOtherFormulaService.registerFormula(
|
|
3379
|
+
_registerFormula(t, e, r, o) {
|
|
3380
|
+
return this._registerOtherFormulaService.registerFormula(t, e, o, { ruleId: r });
|
|
3366
3381
|
}
|
|
3367
|
-
deleteByRuleId(
|
|
3368
|
-
const { formulaMap: o, formulaCellMap: n, ruleFormulaMap: i } = this._ensureMaps(
|
|
3382
|
+
deleteByRuleId(t, e, r) {
|
|
3383
|
+
const { formulaMap: o, formulaCellMap: n, ruleFormulaMap: i } = this._ensureMaps(t, e), s = this._dataValidationModel.getRuleById(t, e, r), l = /* @__PURE__ */ new Set(), d = i.get(r);
|
|
3369
3384
|
!s || !d || (i.delete(r), s.ranges.forEach((c) => {
|
|
3370
3385
|
W.foreach(c, (u, f) => {
|
|
3371
3386
|
const p = o.getValue(u, f);
|
|
@@ -3374,10 +3389,10 @@ let We = class extends fe {
|
|
|
3374
3389
|
o.realDeleteValue(u, f), l.add(m), n.delete(m);
|
|
3375
3390
|
}
|
|
3376
3391
|
});
|
|
3377
|
-
}), this._registerOtherFormulaService.deleteFormula(
|
|
3392
|
+
}), this._registerOtherFormulaService.deleteFormula(t, e, Array.from(l.values())));
|
|
3378
3393
|
}
|
|
3379
|
-
_addFormulaByRange(
|
|
3380
|
-
const { formulaMap: i, ruleFormulaMap: s, formulaCellMap: l } = this._ensureMaps(
|
|
3394
|
+
_addFormulaByRange(t, e, r, o, n) {
|
|
3395
|
+
const { formulaMap: i, ruleFormulaMap: s, formulaCellMap: l } = this._ensureMaps(t, e);
|
|
3381
3396
|
if (!o)
|
|
3382
3397
|
return;
|
|
3383
3398
|
const d = In(
|
|
@@ -3394,14 +3409,14 @@ let We = class extends fe {
|
|
|
3394
3409
|
u,
|
|
3395
3410
|
m,
|
|
3396
3411
|
h
|
|
3397
|
-
), g = this._registerFormula(
|
|
3412
|
+
), g = this._registerFormula(t, e, r, R);
|
|
3398
3413
|
i.setValue(m, h, {
|
|
3399
3414
|
formulaId: g,
|
|
3400
3415
|
// formulaText: relativeFormula,
|
|
3401
3416
|
ruleId: r
|
|
3402
3417
|
}), l.set(g, { row: m, column: h });
|
|
3403
3418
|
});
|
|
3404
|
-
}) : (f = this._registerFormula(
|
|
3419
|
+
}) : (f = this._registerFormula(t, e, r, o), n.forEach((p) => {
|
|
3405
3420
|
W.foreach(p, (m, h) => {
|
|
3406
3421
|
i.setValue(m, h, {
|
|
3407
3422
|
formulaId: f,
|
|
@@ -3417,12 +3432,12 @@ let We = class extends fe {
|
|
|
3417
3432
|
formulaId: f
|
|
3418
3433
|
});
|
|
3419
3434
|
}
|
|
3420
|
-
addRule(
|
|
3435
|
+
addRule(t, e, r) {
|
|
3421
3436
|
const { ranges: o, formula1: n, uid: i, type: s } = r;
|
|
3422
|
-
s !== B.CUSTOM || !n || !A(n) || this._addFormulaByRange(
|
|
3437
|
+
s !== B.CUSTOM || !n || !A(n) || this._addFormulaByRange(t, e, i, n, o);
|
|
3423
3438
|
}
|
|
3424
|
-
updateRuleRanges(
|
|
3425
|
-
const { formulaMap: i, ruleFormulaMap: s, formulaCellMap: l } = this._ensureMaps(
|
|
3439
|
+
updateRuleRanges(t, e, r, o, n) {
|
|
3440
|
+
const { formulaMap: i, ruleFormulaMap: s, formulaCellMap: l } = this._ensureMaps(t, e), d = s.get(r);
|
|
3426
3441
|
if (!d)
|
|
3427
3442
|
return;
|
|
3428
3443
|
const { formula: c, originCol: u, originRow: f, isTransformable: p, formulaId: m } = d, h = /* @__PURE__ */ new Set();
|
|
@@ -3436,9 +3451,9 @@ let We = class extends fe {
|
|
|
3436
3451
|
var M;
|
|
3437
3452
|
const _ = (M = i.getValue(g, C)) != null ? M : {};
|
|
3438
3453
|
if (_.ruleId !== r) {
|
|
3439
|
-
const
|
|
3440
|
-
if (
|
|
3441
|
-
const D = Ja(this._lexerTreeBuilder, c, f, u, g, C), E = this._registerFormula(
|
|
3454
|
+
const y = s.get(_.ruleId);
|
|
3455
|
+
if (y != null && y.isTransformable && h.add(_.formulaId), p) {
|
|
3456
|
+
const D = Ja(this._lexerTreeBuilder, c, f, u, g, C), E = this._registerFormula(t, e, r, D);
|
|
3442
3457
|
i.setValue(g, C, {
|
|
3443
3458
|
// formulaText: relativeText,
|
|
3444
3459
|
ruleId: r,
|
|
@@ -3460,25 +3475,25 @@ let We = class extends fe {
|
|
|
3460
3475
|
});
|
|
3461
3476
|
}), h.forEach((R) => {
|
|
3462
3477
|
l.delete(R);
|
|
3463
|
-
}), this._registerOtherFormulaService.deleteFormula(
|
|
3478
|
+
}), this._registerOtherFormulaService.deleteFormula(t, e, Array.from(h.values()));
|
|
3464
3479
|
}
|
|
3465
|
-
updateRuleFormula(
|
|
3466
|
-
const { ruleFormulaMap: i } = this._ensureMaps(
|
|
3467
|
-
(!s || s.formula !== n) && this._addFormulaByRange(
|
|
3480
|
+
updateRuleFormula(t, e, r, o, n) {
|
|
3481
|
+
const { ruleFormulaMap: i } = this._ensureMaps(t, e), s = i.get(r);
|
|
3482
|
+
(!s || s.formula !== n) && this._addFormulaByRange(t, e, r, n, o);
|
|
3468
3483
|
}
|
|
3469
|
-
getCellFormulaValue(
|
|
3470
|
-
const { formulaMap: n } = this._ensureMaps(
|
|
3471
|
-
return i ? this._registerOtherFormulaService.getFormulaValue(
|
|
3484
|
+
getCellFormulaValue(t, e, r, o) {
|
|
3485
|
+
const { formulaMap: n } = this._ensureMaps(t, e), i = n.getValue(r, o);
|
|
3486
|
+
return i ? this._registerOtherFormulaService.getFormulaValue(t, e, i.formulaId) : Promise.resolve(void 0);
|
|
3472
3487
|
}
|
|
3473
|
-
getRuleFormulaInfo(
|
|
3474
|
-
const { ruleFormulaMap: o } = this._ensureMaps(
|
|
3488
|
+
getRuleFormulaInfo(t, e, r) {
|
|
3489
|
+
const { ruleFormulaMap: o } = this._ensureMaps(t, e);
|
|
3475
3490
|
return o.get(r);
|
|
3476
3491
|
}
|
|
3477
3492
|
};
|
|
3478
3493
|
We = Bs([
|
|
3479
3494
|
yt(0, I(Er)),
|
|
3480
3495
|
yt(1, I(Ba)),
|
|
3481
|
-
yt(2, I(
|
|
3496
|
+
yt(2, I(z)),
|
|
3482
3497
|
yt(3, I(rt))
|
|
3483
3498
|
], We);
|
|
3484
3499
|
class Us extends Ye {
|
|
@@ -3613,17 +3628,17 @@ class Hs extends Ye {
|
|
|
3613
3628
|
}
|
|
3614
3629
|
}
|
|
3615
3630
|
const so = 4, Ws = 0, oa = 4, lo = 4, ya = 6, jt = 6, Ae = 14;
|
|
3616
|
-
function ks(
|
|
3617
|
-
const e = hn.getTextSize(
|
|
3631
|
+
function ks(a, t) {
|
|
3632
|
+
const e = hn.getTextSize(a, t), r = e.width + so * 2, { ba: o, bd: n } = e, i = o + n;
|
|
3618
3633
|
return {
|
|
3619
3634
|
width: r,
|
|
3620
3635
|
height: i + Ws * 2,
|
|
3621
3636
|
ba: o
|
|
3622
3637
|
};
|
|
3623
3638
|
}
|
|
3624
|
-
function dr(
|
|
3625
|
-
const o = e - Ae - ya, n = r - jt * 2, i =
|
|
3626
|
-
layout: ks(c,
|
|
3639
|
+
function dr(a, t, e, r) {
|
|
3640
|
+
const o = e - Ae - ya, n = r - jt * 2, i = a.map((c) => ({
|
|
3641
|
+
layout: ks(c, t),
|
|
3627
3642
|
text: c
|
|
3628
3643
|
}));
|
|
3629
3644
|
let s;
|
|
@@ -3655,52 +3670,52 @@ function dr(t, a, e, r) {
|
|
|
3655
3670
|
}
|
|
3656
3671
|
const Ys = 8;
|
|
3657
3672
|
class Xs extends mn {
|
|
3658
|
-
static drawWith(
|
|
3673
|
+
static drawWith(t, e) {
|
|
3659
3674
|
const { fontFamily: r, fontString: o, fontSize: n, info: i, fill: s, color: l } = e, { layout: d, text: c } = i;
|
|
3660
|
-
|
|
3675
|
+
t.save(), yr.drawWith(t, {
|
|
3661
3676
|
width: d.width,
|
|
3662
3677
|
height: d.height,
|
|
3663
3678
|
radius: Ys,
|
|
3664
3679
|
fill: s || xe
|
|
3665
|
-
}),
|
|
3680
|
+
}), t.translateWithPrecision(so, d.ba), t.font = o, t.fillStyle = l, t.fillText(c, 0, 0), t.restore();
|
|
3666
3681
|
}
|
|
3667
3682
|
}
|
|
3668
|
-
var Gs = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, zs = (
|
|
3669
|
-
for (var o = r > 1 ? void 0 : r ? qs(
|
|
3670
|
-
(i =
|
|
3671
|
-
return r && o && Gs(
|
|
3672
|
-
}, Ks = (
|
|
3683
|
+
var Gs = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, zs = (a, t, e, r) => {
|
|
3684
|
+
for (var o = r > 1 ? void 0 : r ? qs(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3685
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3686
|
+
return r && o && Gs(t, e, o), o;
|
|
3687
|
+
}, Ks = (a, t) => (e, r) => t(e, r, a);
|
|
3673
3688
|
const Qs = 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");
|
|
3674
3689
|
let Da = class {
|
|
3675
|
-
constructor(
|
|
3690
|
+
constructor(a) {
|
|
3676
3691
|
S(this, "zIndex");
|
|
3677
3692
|
S(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
|
3678
|
-
this._commandService =
|
|
3693
|
+
this._commandService = a;
|
|
3679
3694
|
}
|
|
3680
|
-
_ensureMap(
|
|
3681
|
-
let
|
|
3682
|
-
return
|
|
3695
|
+
_ensureMap(a) {
|
|
3696
|
+
let t = this._dropdownInfoMap.get(a);
|
|
3697
|
+
return t || (t = /* @__PURE__ */ new Map(), this._dropdownInfoMap.set(a, t)), t;
|
|
3683
3698
|
}
|
|
3684
|
-
_generateKey(
|
|
3685
|
-
return `${
|
|
3699
|
+
_generateKey(a, t) {
|
|
3700
|
+
return `${a}.${t}`;
|
|
3686
3701
|
}
|
|
3687
|
-
_drawDownIcon(
|
|
3702
|
+
_drawDownIcon(a, t, e, r, o) {
|
|
3688
3703
|
const n = e - Ae + 4;
|
|
3689
3704
|
let i = 4;
|
|
3690
3705
|
switch (o) {
|
|
3691
|
-
case
|
|
3706
|
+
case me.MIDDLE:
|
|
3692
3707
|
i = (r - Ae) / 2 + 4;
|
|
3693
3708
|
break;
|
|
3694
|
-
case
|
|
3709
|
+
case me.BOTTOM:
|
|
3695
3710
|
i = r - Ae + 4;
|
|
3696
3711
|
break;
|
|
3697
3712
|
}
|
|
3698
|
-
|
|
3713
|
+
a.save(), a.translateWithPrecision(t.startX + n, t.startY + i), a.fillStyle = "#565656", a.fill(Qs), a.restore();
|
|
3699
3714
|
}
|
|
3700
3715
|
// eslint-disable-next-line max-lines-per-function
|
|
3701
|
-
drawWith(
|
|
3716
|
+
drawWith(a, t, e, r) {
|
|
3702
3717
|
var j, oe;
|
|
3703
|
-
const { primaryWithCoord: o, row: n, col: i, style: s, data: l, subUnitId: d } =
|
|
3718
|
+
const { primaryWithCoord: o, row: n, col: i, style: s, data: l, subUnitId: d } = t, c = o.isMergedMainCell ? o.mergeInfo : o, u = l.fontRenderExtension, { leftOffset: f = 0, rightOffset: p = 0, topOffset: m = 0, downOffset: h = 0 } = u || {}, R = l.dataValidation, g = this._ensureMap(d), C = this._generateKey(n, i);
|
|
3704
3719
|
if (!R)
|
|
3705
3720
|
return;
|
|
3706
3721
|
const _ = {
|
|
@@ -3708,20 +3723,20 @@ let Da = class {
|
|
|
3708
3723
|
endX: c.endX - p,
|
|
3709
3724
|
startY: c.startY + m,
|
|
3710
3725
|
endY: c.endY - h
|
|
3711
|
-
}, M = _.endX - _.startX,
|
|
3712
|
-
this._drawDownIcon(
|
|
3713
|
-
let
|
|
3726
|
+
}, M = _.endX - _.startX, y = _.endY - _.startY, { cl: D } = s || {}, E = (j = typeof D == "object" ? D == null ? void 0 : D.rgb : D) != null ? j : "#000", x = Qa(s != null ? s : void 0), { rule: T, validator: F } = R, b = F, { vt: P, ht: U } = s || {}, O = P != null ? P : me.MIDDLE, L = (oe = ae(l)) != null ? oe : "", H = b.parseCellValue(L), K = b.getListWithColorMap(T), k = dr(H, x, M, y);
|
|
3727
|
+
this._drawDownIcon(a, _, M, y, O), a.save(), a.translateWithPrecision(_.startX, _.startY), a.beginPath(), a.rect(0, 0, M - Ae, y), a.clip(), a.translateWithPrecision(ya, jt);
|
|
3728
|
+
let w = 0;
|
|
3714
3729
|
switch (O) {
|
|
3715
|
-
case
|
|
3716
|
-
|
|
3730
|
+
case me.MIDDLE:
|
|
3731
|
+
w = (k.contentHeight - k.totalHeight) / 2;
|
|
3717
3732
|
break;
|
|
3718
|
-
case
|
|
3719
|
-
|
|
3733
|
+
case me.BOTTOM:
|
|
3734
|
+
w = k.contentHeight - k.totalHeight;
|
|
3720
3735
|
break;
|
|
3721
3736
|
}
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
const { width: N, height: X, items:
|
|
3737
|
+
a.translateWithPrecision(0, w), k.lines.forEach((G, Se) => {
|
|
3738
|
+
a.save();
|
|
3739
|
+
const { width: N, height: X, items: q } = G;
|
|
3725
3740
|
let ne = 0;
|
|
3726
3741
|
switch (U) {
|
|
3727
3742
|
case Be.RIGHT:
|
|
@@ -3731,24 +3746,24 @@ let Da = class {
|
|
|
3731
3746
|
ne = (k.contentWidth - N) / 2;
|
|
3732
3747
|
break;
|
|
3733
3748
|
}
|
|
3734
|
-
|
|
3735
|
-
|
|
3749
|
+
a.translate(ne, Se * (X + lo)), q.forEach((ye) => {
|
|
3750
|
+
a.save(), a.translateWithPrecision(ye.left, 0), Xs.drawWith(a, {
|
|
3736
3751
|
...x,
|
|
3737
3752
|
info: ye,
|
|
3738
3753
|
color: E,
|
|
3739
3754
|
fill: K[ye.text]
|
|
3740
|
-
}),
|
|
3741
|
-
}),
|
|
3742
|
-
}),
|
|
3755
|
+
}), a.restore();
|
|
3756
|
+
}), a.restore();
|
|
3757
|
+
}), a.restore(), g.set(C, {
|
|
3743
3758
|
left: _.startX,
|
|
3744
3759
|
top: _.startY,
|
|
3745
3760
|
width: k.contentWidth + ya + Ae,
|
|
3746
3761
|
height: k.contentHeight + jt * 2
|
|
3747
3762
|
});
|
|
3748
3763
|
}
|
|
3749
|
-
calcCellAutoHeight(
|
|
3764
|
+
calcCellAutoHeight(a) {
|
|
3750
3765
|
var M;
|
|
3751
|
-
const { primaryWithCoord:
|
|
3766
|
+
const { primaryWithCoord: t, style: e, data: r } = a, o = r.fontRenderExtension, { leftOffset: n = 0, rightOffset: i = 0, topOffset: s = 0, downOffset: l = 0 } = o || {}, d = t.isMergedMainCell ? t.mergeInfo : t, c = {
|
|
3752
3767
|
startX: d.startX + n,
|
|
3753
3768
|
endX: d.endX - i,
|
|
3754
3769
|
startY: d.startY + s,
|
|
@@ -3759,14 +3774,14 @@ let Da = class {
|
|
|
3759
3774
|
const f = c.endX - c.startX, p = c.endY - c.startY, m = (M = ae(r)) != null ? M : "", { validator: h } = u, g = h.parseCellValue(m), C = Qa(e != null ? e : void 0);
|
|
3760
3775
|
return dr(g, C, f, p).cellAutoHeight;
|
|
3761
3776
|
}
|
|
3762
|
-
isHit(
|
|
3763
|
-
const { primaryWithCoord: e } =
|
|
3777
|
+
isHit(a, t) {
|
|
3778
|
+
const { primaryWithCoord: e } = t, r = e.isMergedMainCell ? e.mergeInfo : e, { endX: o } = r, { x: n } = a;
|
|
3764
3779
|
return n >= o - Ae && n <= o;
|
|
3765
3780
|
}
|
|
3766
|
-
onPointerDown(
|
|
3767
|
-
if (
|
|
3781
|
+
onPointerDown(a, t) {
|
|
3782
|
+
if (t.button === 2)
|
|
3768
3783
|
return;
|
|
3769
|
-
const { unitId: e, subUnitId: r, row: o, col: n } =
|
|
3784
|
+
const { unitId: e, subUnitId: r, row: o, col: n } = a, i = {
|
|
3770
3785
|
unitId: e,
|
|
3771
3786
|
subUnitId: r,
|
|
3772
3787
|
row: o,
|
|
@@ -3789,14 +3804,14 @@ class Zs extends eo {
|
|
|
3789
3804
|
return !0;
|
|
3790
3805
|
}
|
|
3791
3806
|
}
|
|
3792
|
-
var Js = Object.defineProperty, el = Object.getOwnPropertyDescriptor, tl = (
|
|
3793
|
-
for (var o = r > 1 ? void 0 : r ? el(
|
|
3794
|
-
(i =
|
|
3795
|
-
return r && o && Js(
|
|
3796
|
-
}, be = (
|
|
3807
|
+
var Js = Object.defineProperty, el = Object.getOwnPropertyDescriptor, tl = (a, t, e, r) => {
|
|
3808
|
+
for (var o = r > 1 ? void 0 : r ? el(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3809
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3810
|
+
return r && o && Js(t, e, o), o;
|
|
3811
|
+
}, be = (a, t) => (e, r) => t(e, r, a);
|
|
3797
3812
|
let ut = class extends Na {
|
|
3798
|
-
constructor(
|
|
3799
|
-
super(), this._univerInstanceService =
|
|
3813
|
+
constructor(a, t, e, r, o, n, i, s) {
|
|
3814
|
+
super(), this._univerInstanceService = a, this._sheetDataValidationService = t, this._dataValidatorRegistryService = e, this._injector = r, this._componentManger = o, this._selectionManagerService = n, this._sheetInterceptorService = i, this._dataValidationModel = s, this._init();
|
|
3800
3815
|
}
|
|
3801
3816
|
_init() {
|
|
3802
3817
|
this._registerValidators(), this._initInstanceChange(), this._initCommandInterceptor(), this._initComponents();
|
|
@@ -3811,42 +3826,42 @@ let ut = class extends Na {
|
|
|
3811
3826
|
eo,
|
|
3812
3827
|
Zs,
|
|
3813
3828
|
Us
|
|
3814
|
-
].forEach((
|
|
3815
|
-
const
|
|
3829
|
+
].forEach((a) => {
|
|
3830
|
+
const t = this._injector.createInstance(a);
|
|
3816
3831
|
this.disposeWithMe(
|
|
3817
|
-
this._dataValidatorRegistryService.register(
|
|
3832
|
+
this._dataValidatorRegistryService.register(t)
|
|
3818
3833
|
), this.disposeWithMe({
|
|
3819
3834
|
dispose: () => {
|
|
3820
|
-
this._injector.delete(
|
|
3835
|
+
this._injector.delete(a);
|
|
3821
3836
|
}
|
|
3822
3837
|
});
|
|
3823
3838
|
});
|
|
3824
3839
|
}
|
|
3825
3840
|
_initInstanceChange() {
|
|
3826
|
-
const
|
|
3827
|
-
this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(re.UNIVER_SHEET).subscribe((
|
|
3828
|
-
if (
|
|
3841
|
+
const a = new ur();
|
|
3842
|
+
this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(re.UNIVER_SHEET).subscribe((t) => {
|
|
3843
|
+
if (a.dispose(), !t)
|
|
3829
3844
|
return;
|
|
3830
|
-
const e =
|
|
3831
|
-
e && (this._sheetDataValidationService.switchCurrent(
|
|
3832
|
-
|
|
3845
|
+
const e = t.getActiveSheet();
|
|
3846
|
+
e && (this._sheetDataValidationService.switchCurrent(t.getUnitId(), e.getSheetId()), a.add(Ea(
|
|
3847
|
+
t.activeSheet$.subscribe((r) => {
|
|
3833
3848
|
if (r) {
|
|
3834
|
-
const o =
|
|
3849
|
+
const o = t.getUnitId(), n = r.getSheetId();
|
|
3835
3850
|
this._sheetDataValidationService.switchCurrent(o, n);
|
|
3836
3851
|
}
|
|
3837
3852
|
})
|
|
3838
3853
|
)));
|
|
3839
|
-
})), this.disposeWithMe(
|
|
3854
|
+
})), this.disposeWithMe(a);
|
|
3840
3855
|
}
|
|
3841
3856
|
_initCommandInterceptor() {
|
|
3842
3857
|
this._sheetInterceptorService.interceptCommand({
|
|
3843
|
-
getMutations: (
|
|
3844
|
-
var
|
|
3845
|
-
if (
|
|
3858
|
+
getMutations: (a) => {
|
|
3859
|
+
var t;
|
|
3860
|
+
if (a.id === xo.id) {
|
|
3846
3861
|
const e = this._univerInstanceService.getCurrentUnitForType(re.UNIVER_SHEET), r = e.getUnitId(), o = e.getActiveSheet();
|
|
3847
3862
|
if (!o)
|
|
3848
3863
|
throw new Error("No active sheet found");
|
|
3849
|
-
const n = o.getSheetId(), i = (
|
|
3864
|
+
const n = o.getSheetId(), i = (t = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : t.map((f) => f.range), s = this._dataValidationModel.ensureManager(r, n), l = s.getRuleObjectMatrix().clone();
|
|
3850
3865
|
i && l.removeRange(i);
|
|
3851
3866
|
const d = l.diff(s.getDataValidations()), { redoMutations: c, undoMutations: u } = tt(r, n, d, this._injector);
|
|
3852
3867
|
return {
|
|
@@ -3871,10 +3886,10 @@ let ut = class extends Na {
|
|
|
3871
3886
|
[At.componentKey, At],
|
|
3872
3887
|
[Pt.componentKey, Pt],
|
|
3873
3888
|
...Mi
|
|
3874
|
-
].forEach(([
|
|
3889
|
+
].forEach(([a, t]) => {
|
|
3875
3890
|
this.disposeWithMe(this._componentManger.register(
|
|
3876
|
-
|
|
3877
|
-
|
|
3891
|
+
a,
|
|
3892
|
+
t
|
|
3878
3893
|
));
|
|
3879
3894
|
});
|
|
3880
3895
|
}
|
|
@@ -3888,31 +3903,31 @@ ut = tl([
|
|
|
3888
3903
|
be(4, I(St)),
|
|
3889
3904
|
be(5, I(Ao)),
|
|
3890
3905
|
be(6, I(Fa)),
|
|
3891
|
-
be(7, I(
|
|
3906
|
+
be(7, I(z))
|
|
3892
3907
|
], ut);
|
|
3893
|
-
var al = Object.defineProperty, rl = Object.getOwnPropertyDescriptor, ol = (
|
|
3894
|
-
for (var o = r > 1 ? void 0 : r ? rl(
|
|
3895
|
-
(i =
|
|
3896
|
-
return r && o && al(
|
|
3897
|
-
}, Dt = (
|
|
3908
|
+
var al = Object.defineProperty, rl = Object.getOwnPropertyDescriptor, ol = (a, t, e, r) => {
|
|
3909
|
+
for (var o = r > 1 ? void 0 : r ? rl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3910
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3911
|
+
return r && o && al(t, e, o), o;
|
|
3912
|
+
}, Dt = (a, t) => (e, r) => t(e, r, a);
|
|
3898
3913
|
const na = "SHEET_DATA_VALIDATION_ALERT";
|
|
3899
|
-
let ht = class extends
|
|
3900
|
-
constructor(
|
|
3901
|
-
super(), this._hoverManagerService =
|
|
3914
|
+
let ht = class extends ue {
|
|
3915
|
+
constructor(a, t, e, r) {
|
|
3916
|
+
super(), this._hoverManagerService = a, this._cellAlertManagerService = t, this._univerInstanceService = e, this._localeService = r, this._init();
|
|
3902
3917
|
}
|
|
3903
3918
|
_init() {
|
|
3904
3919
|
this._initCellAlertPopup();
|
|
3905
3920
|
}
|
|
3906
3921
|
_initCellAlertPopup() {
|
|
3907
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(gn(100)).subscribe((
|
|
3908
|
-
var
|
|
3909
|
-
if (
|
|
3922
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(gn(100)).subscribe((a) => {
|
|
3923
|
+
var t, e;
|
|
3924
|
+
if (a) {
|
|
3910
3925
|
const o = this._univerInstanceService.getCurrentUnitForType(re.UNIVER_SHEET).getActiveSheet();
|
|
3911
3926
|
if (!o) return;
|
|
3912
|
-
const n = o.getCell(
|
|
3913
|
-
if (((
|
|
3927
|
+
const n = o.getCell(a.location.row, a.location.col);
|
|
3928
|
+
if (((t = n == null ? void 0 : n.dataValidation) == null ? void 0 : t.validStatus) === Ce.INVALID) {
|
|
3914
3929
|
const i = this._cellAlertManagerService.currentAlert.get(na), s = (e = i == null ? void 0 : i.alert) == null ? void 0 : e.location;
|
|
3915
|
-
if (s && s.row ===
|
|
3930
|
+
if (s && s.row === a.location.row && s.col === a.location.col && s.subUnitId === a.location.subUnitId && s.unitId === a.location.unitId)
|
|
3916
3931
|
return;
|
|
3917
3932
|
const l = n.dataValidation.validator, d = n.dataValidation.rule;
|
|
3918
3933
|
if (!l)
|
|
@@ -3921,7 +3936,7 @@ let ht = class extends fe {
|
|
|
3921
3936
|
type: Yo.ERROR,
|
|
3922
3937
|
title: this._localeService.t("dataValidation.error.title"),
|
|
3923
3938
|
message: l == null ? void 0 : l.getRuleFinalError(d),
|
|
3924
|
-
location:
|
|
3939
|
+
location: a.location,
|
|
3925
3940
|
width: 200,
|
|
3926
3941
|
height: 74,
|
|
3927
3942
|
key: na
|
|
@@ -3940,39 +3955,39 @@ ht = ol([
|
|
|
3940
3955
|
Dt(2, J),
|
|
3941
3956
|
Dt(3, I(ie))
|
|
3942
3957
|
], ht);
|
|
3943
|
-
var nl = Object.defineProperty, il = Object.getOwnPropertyDescriptor, sl = (
|
|
3944
|
-
for (var o = r > 1 ? void 0 : r ? il(
|
|
3945
|
-
(i =
|
|
3946
|
-
return r && o && nl(
|
|
3947
|
-
}, Ke = (
|
|
3948
|
-
let et = class extends
|
|
3949
|
-
constructor(
|
|
3958
|
+
var nl = Object.defineProperty, il = Object.getOwnPropertyDescriptor, sl = (a, t, e, r) => {
|
|
3959
|
+
for (var o = r > 1 ? void 0 : r ? il(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
3960
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
3961
|
+
return r && o && nl(t, e, o), o;
|
|
3962
|
+
}, Ke = (a, t) => (e, r) => t(e, r, a);
|
|
3963
|
+
let et = class extends ue {
|
|
3964
|
+
constructor(t, e, r, o, n, i) {
|
|
3950
3965
|
super();
|
|
3951
3966
|
S(this, "_disposableMap", /* @__PURE__ */ new Map());
|
|
3952
|
-
S(this, "registerRule", (
|
|
3953
|
-
this.register(
|
|
3967
|
+
S(this, "registerRule", (t, e, r) => {
|
|
3968
|
+
this.register(t, e, r), this.registerFormula(t, e, r);
|
|
3954
3969
|
});
|
|
3955
|
-
this._dataValidationModel =
|
|
3970
|
+
this._dataValidationModel = t, this._injector = e, this._refRangeService = r, this._dataValidationCustomFormulaService = o, this._dataValidationFormulaService = n, this._formulaRefRangeService = i, this._initRefRange();
|
|
3956
3971
|
}
|
|
3957
|
-
_getIdWithUnitId(
|
|
3958
|
-
return `${
|
|
3972
|
+
_getIdWithUnitId(t, e, r) {
|
|
3973
|
+
return `${t}_${e}_${r}`;
|
|
3959
3974
|
}
|
|
3960
3975
|
// eslint-disable-next-line max-lines-per-function
|
|
3961
|
-
registerFormula(
|
|
3976
|
+
registerFormula(t, e, r) {
|
|
3962
3977
|
var l;
|
|
3963
|
-
const o = r.uid, n = this._getIdWithUnitId(
|
|
3964
|
-
const u = this._dataValidationModel.getRuleById(
|
|
3978
|
+
const o = r.uid, n = this._getIdWithUnitId(t, e, o), i = (l = this._disposableMap.get(n)) != null ? l : /* @__PURE__ */ new Set(), s = (d, c) => {
|
|
3979
|
+
const u = this._dataValidationModel.getRuleById(t, e, o);
|
|
3965
3980
|
if (!u)
|
|
3966
3981
|
return { redos: [], undos: [] };
|
|
3967
3982
|
const f = u[d];
|
|
3968
3983
|
if (!f || f === c)
|
|
3969
3984
|
return { redos: [], undos: [] };
|
|
3970
3985
|
const p = {
|
|
3971
|
-
unitId:
|
|
3986
|
+
unitId: t,
|
|
3972
3987
|
subUnitId: e,
|
|
3973
3988
|
ruleId: r.uid,
|
|
3974
3989
|
payload: {
|
|
3975
|
-
type:
|
|
3990
|
+
type: fe.SETTING,
|
|
3976
3991
|
payload: {
|
|
3977
3992
|
type: u.type,
|
|
3978
3993
|
formula1: u.formula1,
|
|
@@ -3981,11 +3996,11 @@ let et = class extends fe {
|
|
|
3981
3996
|
}
|
|
3982
3997
|
}
|
|
3983
3998
|
}, m = {
|
|
3984
|
-
unitId:
|
|
3999
|
+
unitId: t,
|
|
3985
4000
|
subUnitId: e,
|
|
3986
4001
|
ruleId: r.uid,
|
|
3987
4002
|
payload: {
|
|
3988
|
-
type:
|
|
4003
|
+
type: fe.SETTING,
|
|
3989
4004
|
payload: {
|
|
3990
4005
|
type: u.type,
|
|
3991
4006
|
formula1: u.formula1,
|
|
@@ -4006,7 +4021,7 @@ let et = class extends fe {
|
|
|
4006
4021
|
return { redos: h, undos: R };
|
|
4007
4022
|
};
|
|
4008
4023
|
if (r.type === B.CUSTOM) {
|
|
4009
|
-
const d = this._dataValidationCustomFormulaService.getRuleFormulaInfo(
|
|
4024
|
+
const d = this._dataValidationCustomFormulaService.getRuleFormulaInfo(t, e, o);
|
|
4010
4025
|
if (d) {
|
|
4011
4026
|
const c = this._formulaRefRangeService.registerFormula(
|
|
4012
4027
|
d.formula,
|
|
@@ -4016,7 +4031,7 @@ let et = class extends fe {
|
|
|
4016
4031
|
}
|
|
4017
4032
|
}
|
|
4018
4033
|
if (r.type !== B.CUSTOM) {
|
|
4019
|
-
const d = this._dataValidationFormulaService.getRuleFormulaInfo(
|
|
4034
|
+
const d = this._dataValidationFormulaService.getRuleFormulaInfo(t, e, o);
|
|
4020
4035
|
if (d) {
|
|
4021
4036
|
const [c, u] = d;
|
|
4022
4037
|
if (c) {
|
|
@@ -4036,54 +4051,54 @@ let et = class extends fe {
|
|
|
4036
4051
|
}
|
|
4037
4052
|
}
|
|
4038
4053
|
}
|
|
4039
|
-
register(
|
|
4054
|
+
register(t, e, r) {
|
|
4040
4055
|
var l;
|
|
4041
4056
|
const o = (d) => {
|
|
4042
4057
|
const c = [...r.ranges], f = c.map((m) => $o(m, d)).filter((m) => !!m).flat();
|
|
4043
|
-
if (
|
|
4058
|
+
if (yo(f, c))
|
|
4044
4059
|
return { redos: [], undos: [] };
|
|
4045
4060
|
if (f.length) {
|
|
4046
4061
|
const m = {
|
|
4047
|
-
unitId:
|
|
4062
|
+
unitId: t,
|
|
4048
4063
|
subUnitId: e,
|
|
4049
4064
|
ruleId: r.uid,
|
|
4050
4065
|
payload: {
|
|
4051
|
-
type:
|
|
4066
|
+
type: fe.RANGE,
|
|
4052
4067
|
payload: f
|
|
4053
4068
|
}
|
|
4054
4069
|
}, h = [{ id: pe.id, params: m }], R = [{
|
|
4055
4070
|
id: pe.id,
|
|
4056
4071
|
params: {
|
|
4057
|
-
unitId:
|
|
4072
|
+
unitId: t,
|
|
4058
4073
|
subUnitId: e,
|
|
4059
4074
|
ruleId: r.uid,
|
|
4060
4075
|
payload: {
|
|
4061
|
-
type:
|
|
4076
|
+
type: fe.RANGE,
|
|
4062
4077
|
payload: c
|
|
4063
4078
|
}
|
|
4064
4079
|
}
|
|
4065
4080
|
}];
|
|
4066
4081
|
return { redos: h, undos: R };
|
|
4067
4082
|
} else {
|
|
4068
|
-
const m = { unitId:
|
|
4083
|
+
const m = { unitId: t, subUnitId: e, ruleId: r.uid }, h = [{ id: Ot.id, params: m }], R = To(this._injector, m);
|
|
4069
4084
|
return { redos: h, undos: R };
|
|
4070
4085
|
}
|
|
4071
4086
|
}, n = [];
|
|
4072
4087
|
r.ranges.forEach((d) => {
|
|
4073
|
-
const c = this._refRangeService.registerRefRange(d, o,
|
|
4088
|
+
const c = this._refRangeService.registerRefRange(d, o, t, e);
|
|
4074
4089
|
n.push(() => c.dispose());
|
|
4075
4090
|
});
|
|
4076
|
-
const i = this._getIdWithUnitId(
|
|
4091
|
+
const i = this._getIdWithUnitId(t, e, r.uid), s = (l = this._disposableMap.get(i)) != null ? l : /* @__PURE__ */ new Set();
|
|
4077
4092
|
s.add(() => n.forEach((d) => d())), this._disposableMap.set(i, s);
|
|
4078
4093
|
}
|
|
4079
4094
|
_initRefRange() {
|
|
4080
4095
|
this.disposeWithMe(
|
|
4081
|
-
this._dataValidationModel.ruleChange$.subscribe((
|
|
4082
|
-
const { unitId: e, subUnitId: r, rule: o } =
|
|
4083
|
-
switch (
|
|
4096
|
+
this._dataValidationModel.ruleChange$.subscribe((t) => {
|
|
4097
|
+
const { unitId: e, subUnitId: r, rule: o } = t;
|
|
4098
|
+
switch (t.type) {
|
|
4084
4099
|
case "add": {
|
|
4085
|
-
const n =
|
|
4086
|
-
this.registerRule(
|
|
4100
|
+
const n = t.rule;
|
|
4101
|
+
this.registerRule(t.unitId, t.subUnitId, n);
|
|
4087
4102
|
break;
|
|
4088
4103
|
}
|
|
4089
4104
|
case "remove": {
|
|
@@ -4092,55 +4107,55 @@ let et = class extends fe {
|
|
|
4092
4107
|
break;
|
|
4093
4108
|
}
|
|
4094
4109
|
case "update": {
|
|
4095
|
-
const n =
|
|
4096
|
-
i && i.forEach((s) => s()), this.registerRule(
|
|
4110
|
+
const n = t.rule, i = this._disposableMap.get(this._getIdWithUnitId(e, r, n.uid));
|
|
4111
|
+
i && i.forEach((s) => s()), this.registerRule(t.unitId, t.subUnitId, n);
|
|
4097
4112
|
break;
|
|
4098
4113
|
}
|
|
4099
4114
|
}
|
|
4100
4115
|
})
|
|
4101
4116
|
), this.disposeWithMe(Ea(() => {
|
|
4102
|
-
this._disposableMap.forEach((
|
|
4103
|
-
|
|
4117
|
+
this._disposableMap.forEach((t) => {
|
|
4118
|
+
t.forEach((e) => e());
|
|
4104
4119
|
}), this._disposableMap.clear();
|
|
4105
4120
|
}));
|
|
4106
4121
|
}
|
|
4107
4122
|
};
|
|
4108
4123
|
et = sl([
|
|
4109
4124
|
ve(_e.Ready, et),
|
|
4110
|
-
Ke(0, I(
|
|
4125
|
+
Ke(0, I(z)),
|
|
4111
4126
|
Ke(1, I(Ee)),
|
|
4112
4127
|
Ke(2, I(jo)),
|
|
4113
4128
|
Ke(3, I(We)),
|
|
4114
4129
|
Ke(4, I(ce)),
|
|
4115
4130
|
Ke(5, I(vn))
|
|
4116
4131
|
], et);
|
|
4117
|
-
var ll = Object.defineProperty, dl = Object.getOwnPropertyDescriptor, cl = (
|
|
4118
|
-
for (var o = r > 1 ? void 0 : r ? dl(
|
|
4119
|
-
(i =
|
|
4120
|
-
return r && o && ll(
|
|
4121
|
-
}, ia = (
|
|
4122
|
-
let bt = class extends
|
|
4123
|
-
constructor(
|
|
4124
|
-
super(), this._autoFillService =
|
|
4132
|
+
var ll = Object.defineProperty, dl = Object.getOwnPropertyDescriptor, cl = (a, t, e, r) => {
|
|
4133
|
+
for (var o = r > 1 ? void 0 : r ? dl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4134
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4135
|
+
return r && o && ll(t, e, o), o;
|
|
4136
|
+
}, ia = (a, t) => (e, r) => t(e, r, a);
|
|
4137
|
+
let bt = class extends ue {
|
|
4138
|
+
constructor(a, t, e) {
|
|
4139
|
+
super(), this._autoFillService = a, this._dataValidationModel = t, this._injector = e, this._initAutoFill();
|
|
4125
4140
|
}
|
|
4126
4141
|
// eslint-disable-next-line max-lines-per-function
|
|
4127
4142
|
_initAutoFill() {
|
|
4128
|
-
const
|
|
4143
|
+
const a = () => ({ redos: [], undos: [] }), t = (o) => {
|
|
4129
4144
|
const { source: n, target: i, unitId: s, subUnitId: l } = o, d = this._dataValidationModel.ensureManager(s, l), c = d.getRuleObjectMatrix().clone(), u = Ra([n, i]), [f, p] = u.ranges, { mapFunc: m } = u, h = {
|
|
4130
4145
|
row: f.startRow,
|
|
4131
4146
|
col: f.startColumn
|
|
4132
4147
|
};
|
|
4133
4148
|
Go(f, p).forEach((M) => {
|
|
4134
|
-
const
|
|
4149
|
+
const y = M.repeatStartCell, D = M.relativeRange, E = {
|
|
4135
4150
|
startRow: h.row,
|
|
4136
4151
|
startColumn: h.col,
|
|
4137
4152
|
endColumn: h.col,
|
|
4138
4153
|
endRow: h.row
|
|
4139
4154
|
}, x = {
|
|
4140
|
-
startRow:
|
|
4141
|
-
startColumn:
|
|
4142
|
-
endColumn:
|
|
4143
|
-
endRow:
|
|
4155
|
+
startRow: y.row,
|
|
4156
|
+
startColumn: y.col,
|
|
4157
|
+
endColumn: y.col,
|
|
4158
|
+
endRow: y.row
|
|
4144
4159
|
};
|
|
4145
4160
|
W.foreach(D, (T, F) => {
|
|
4146
4161
|
const b = Ue.getPositionRange(
|
|
@@ -4186,7 +4201,7 @@ let bt = class extends fe {
|
|
|
4186
4201
|
}
|
|
4187
4202
|
}
|
|
4188
4203
|
},
|
|
4189
|
-
onFillData: (o, n, i) => i === Ct.COPY || i === Ct.ONLY_FORMAT || i === Ct.SERIES ?
|
|
4204
|
+
onFillData: (o, n, i) => i === Ct.COPY || i === Ct.ONLY_FORMAT || i === Ct.SERIES ? t(o) : a(),
|
|
4190
4205
|
onAfterFillData: () => {
|
|
4191
4206
|
}
|
|
4192
4207
|
};
|
|
@@ -4196,40 +4211,40 @@ let bt = class extends fe {
|
|
|
4196
4211
|
bt = cl([
|
|
4197
4212
|
ve(_e.Ready, bt),
|
|
4198
4213
|
ia(0, Xo),
|
|
4199
|
-
ia(1, I(
|
|
4214
|
+
ia(1, I(z)),
|
|
4200
4215
|
ia(2, I(Ee))
|
|
4201
4216
|
], bt);
|
|
4202
|
-
var ul = Object.defineProperty, hl = Object.getOwnPropertyDescriptor, ml = (
|
|
4203
|
-
for (var o = r > 1 ? void 0 : r ? hl(
|
|
4204
|
-
(i =
|
|
4205
|
-
return r && o && ul(
|
|
4206
|
-
}, sa = (
|
|
4207
|
-
let mt = class extends
|
|
4208
|
-
constructor(
|
|
4217
|
+
var ul = Object.defineProperty, hl = Object.getOwnPropertyDescriptor, ml = (a, t, e, r) => {
|
|
4218
|
+
for (var o = r > 1 ? void 0 : r ? hl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4219
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4220
|
+
return r && o && ul(t, e, o), o;
|
|
4221
|
+
}, sa = (a, t) => (e, r) => t(e, r, a);
|
|
4222
|
+
let mt = class extends ue {
|
|
4223
|
+
constructor(t, e, r) {
|
|
4209
4224
|
super();
|
|
4210
4225
|
S(this, "_copyInfo");
|
|
4211
|
-
this._sheetClipboardService =
|
|
4226
|
+
this._sheetClipboardService = t, this._dataValidationModel = e, this._injector = r, this._initCopyPaste();
|
|
4212
4227
|
}
|
|
4213
4228
|
_initCopyPaste() {
|
|
4214
4229
|
this._sheetClipboardService.addClipboardHook({
|
|
4215
4230
|
id: Xt,
|
|
4216
|
-
onBeforeCopy: (
|
|
4217
|
-
onPasteCells: (
|
|
4218
|
-
const { copyType: n = qa.COPY, pasteType: i } = o, { range: s } =
|
|
4231
|
+
onBeforeCopy: (t, e, r) => this._collect(t, e, r),
|
|
4232
|
+
onPasteCells: (t, e, r, o) => {
|
|
4233
|
+
const { copyType: n = qa.COPY, pasteType: i } = o, { range: s } = t || {}, { range: l, unitId: d, subUnitId: c } = e;
|
|
4219
4234
|
return this._generateMutations(l, { copyType: n, pasteType: i, copyRange: s, unitId: d, subUnitId: c });
|
|
4220
4235
|
}
|
|
4221
4236
|
});
|
|
4222
4237
|
}
|
|
4223
|
-
_collect(
|
|
4238
|
+
_collect(t, e, r) {
|
|
4224
4239
|
const o = new ke();
|
|
4225
4240
|
this._copyInfo = {
|
|
4226
|
-
unitId:
|
|
4241
|
+
unitId: t,
|
|
4227
4242
|
subUnitId: e,
|
|
4228
4243
|
matrix: o
|
|
4229
4244
|
};
|
|
4230
|
-
const n = this._dataValidationModel.ensureManager(
|
|
4245
|
+
const n = this._dataValidationModel.ensureManager(t, e), i = {
|
|
4231
4246
|
get: this._injector.get.bind(this._injector)
|
|
4232
|
-
}, s = qo(r, i,
|
|
4247
|
+
}, s = qo(r, i, t, e);
|
|
4233
4248
|
if (!s)
|
|
4234
4249
|
return;
|
|
4235
4250
|
const { rows: l, cols: d } = s;
|
|
@@ -4241,7 +4256,7 @@ let mt = class extends fe {
|
|
|
4241
4256
|
});
|
|
4242
4257
|
}
|
|
4243
4258
|
// eslint-disable-next-line max-lines-per-function
|
|
4244
|
-
_generateMutations(
|
|
4259
|
+
_generateMutations(t, e) {
|
|
4245
4260
|
if (!this._copyInfo)
|
|
4246
4261
|
return { redos: [], undos: [] };
|
|
4247
4262
|
if (e.copyType === qa.CUT)
|
|
@@ -4259,7 +4274,7 @@ let mt = class extends fe {
|
|
|
4259
4274
|
return { redos: [], undos: [] };
|
|
4260
4275
|
const { unitId: r, subUnitId: o } = this._copyInfo;
|
|
4261
4276
|
if (e.unitId !== r || o !== e.subUnitId) {
|
|
4262
|
-
const n = this._dataValidationModel.ensureManager(r, o), i = this._dataValidationModel.ensureManager(e.unitId, e.subUnitId), s = i.getRuleObjectMatrix().clone(), { ranges: [l, d], mapFunc: c } = Ra([e.copyRange,
|
|
4277
|
+
const n = this._dataValidationModel.ensureManager(r, o), i = this._dataValidationModel.ensureManager(e.unitId, e.subUnitId), s = i.getRuleObjectMatrix().clone(), { ranges: [l, d], mapFunc: c } = Ra([e.copyRange, t]), u = za(l, d, !0), f = /* @__PURE__ */ new Map();
|
|
4263
4278
|
u.forEach(({ startRange: h }) => {
|
|
4264
4279
|
var R;
|
|
4265
4280
|
(R = this._copyInfo) == null || R.matrix.forValue((g, C, _) => {
|
|
@@ -4271,10 +4286,10 @@ let mt = class extends fe {
|
|
|
4271
4286
|
endColumn: C
|
|
4272
4287
|
},
|
|
4273
4288
|
h
|
|
4274
|
-
),
|
|
4275
|
-
!i.getRuleById(
|
|
4289
|
+
), y = `${o}-${_}`, D = n.getRuleById(_);
|
|
4290
|
+
!i.getRuleById(y) && D && f.set(y, { ...D, uid: y });
|
|
4276
4291
|
const { row: E, col: x } = c(M.startRow, M.startColumn);
|
|
4277
|
-
s.setValue(E, x,
|
|
4292
|
+
s.setValue(E, x, y);
|
|
4278
4293
|
});
|
|
4279
4294
|
});
|
|
4280
4295
|
const { redoMutations: p, undoMutations: m } = tt(
|
|
@@ -4288,7 +4303,7 @@ let mt = class extends fe {
|
|
|
4288
4303
|
undos: m
|
|
4289
4304
|
};
|
|
4290
4305
|
} else {
|
|
4291
|
-
const n = this._dataValidationModel.ensureManager(r, o), i = n.getRuleObjectMatrix().clone(), { ranges: [s, l], mapFunc: d } = Ra([e.copyRange,
|
|
4306
|
+
const n = this._dataValidationModel.ensureManager(r, o), i = n.getRuleObjectMatrix().clone(), { ranges: [s, l], mapFunc: d } = Ra([e.copyRange, t]);
|
|
4292
4307
|
za(s, l, !0).forEach(({ startRange: p }) => {
|
|
4293
4308
|
var m;
|
|
4294
4309
|
(m = this._copyInfo) == null || m.matrix.forValue((h, R, g) => {
|
|
@@ -4320,17 +4335,17 @@ let mt = class extends fe {
|
|
|
4320
4335
|
mt = ml([
|
|
4321
4336
|
ve(_e.Ready, mt),
|
|
4322
4337
|
sa(0, zo),
|
|
4323
|
-
sa(1, I(
|
|
4338
|
+
sa(1, I(z)),
|
|
4324
4339
|
sa(2, I(Ee))
|
|
4325
4340
|
], mt);
|
|
4326
4341
|
class Xa {
|
|
4327
|
-
constructor(
|
|
4342
|
+
constructor(t, e) {
|
|
4328
4343
|
S(this, "value");
|
|
4329
|
-
this._worksheet = e, this.value =
|
|
4344
|
+
this._worksheet = e, this.value = t;
|
|
4330
4345
|
}
|
|
4331
|
-
addRule(
|
|
4332
|
-
const e =
|
|
4333
|
-
|
|
4346
|
+
addRule(t) {
|
|
4347
|
+
const e = t.uid;
|
|
4348
|
+
t.ranges.forEach((r) => {
|
|
4334
4349
|
W.foreach(
|
|
4335
4350
|
W.transformRange(r, this._worksheet),
|
|
4336
4351
|
(o, n) => {
|
|
@@ -4339,29 +4354,29 @@ class Xa {
|
|
|
4339
4354
|
);
|
|
4340
4355
|
});
|
|
4341
4356
|
}
|
|
4342
|
-
removeRange(
|
|
4343
|
-
|
|
4357
|
+
removeRange(t) {
|
|
4358
|
+
t.forEach((e) => {
|
|
4344
4359
|
W.foreach(W.transformRange(e, this._worksheet), (r, o) => {
|
|
4345
4360
|
this.value.realDeleteValue(r, o);
|
|
4346
4361
|
});
|
|
4347
4362
|
});
|
|
4348
4363
|
}
|
|
4349
|
-
removeRule(
|
|
4350
|
-
|
|
4364
|
+
removeRule(t) {
|
|
4365
|
+
t.ranges.forEach((e) => {
|
|
4351
4366
|
W.foreach(W.transformRange(e, this._worksheet), (r, o) => {
|
|
4352
4367
|
this.value.setValue(r, o, "");
|
|
4353
4368
|
});
|
|
4354
4369
|
});
|
|
4355
4370
|
}
|
|
4356
|
-
updateRange(
|
|
4357
|
-
const o = `${
|
|
4371
|
+
updateRange(t, e, r) {
|
|
4372
|
+
const o = `${t}$`, n = e.map((s) => W.transformRange(s, this._worksheet)), i = r.map((s) => W.transformRange(s, this._worksheet));
|
|
4358
4373
|
n.forEach((s) => {
|
|
4359
4374
|
W.foreach(s, (l, d) => {
|
|
4360
|
-
this.value.getValue(l, d) ===
|
|
4375
|
+
this.value.getValue(l, d) === t && this.value.setValue(l, d, o);
|
|
4361
4376
|
});
|
|
4362
4377
|
}), i.forEach((s) => {
|
|
4363
4378
|
W.foreach(s, (l, d) => {
|
|
4364
|
-
this.value.setValue(l, d,
|
|
4379
|
+
this.value.setValue(l, d, t);
|
|
4365
4380
|
});
|
|
4366
4381
|
}), n.forEach((s) => {
|
|
4367
4382
|
W.foreach(s, (l, d) => {
|
|
@@ -4369,10 +4384,10 @@ class Xa {
|
|
|
4369
4384
|
});
|
|
4370
4385
|
});
|
|
4371
4386
|
}
|
|
4372
|
-
diff(
|
|
4387
|
+
diff(t) {
|
|
4373
4388
|
const e = [];
|
|
4374
4389
|
let r = 0;
|
|
4375
|
-
return
|
|
4390
|
+
return t.forEach((o, n) => {
|
|
4376
4391
|
const i = Kt(this.value, (l) => l === o.uid), s = o.ranges;
|
|
4377
4392
|
(i.length !== s.length || i.some((l, d) => !Ue.equals(l, s[d]))) && e.push({
|
|
4378
4393
|
type: "update",
|
|
@@ -4386,10 +4401,10 @@ class Xa {
|
|
|
4386
4401
|
}), r++);
|
|
4387
4402
|
}), e;
|
|
4388
4403
|
}
|
|
4389
|
-
diffWithAddition(
|
|
4404
|
+
diffWithAddition(t, e) {
|
|
4390
4405
|
const r = [];
|
|
4391
4406
|
let o = 0;
|
|
4392
|
-
return
|
|
4407
|
+
return t.forEach((n, i) => {
|
|
4393
4408
|
const s = Kt(this.value, (d) => d === n.uid), l = n.ranges;
|
|
4394
4409
|
(s.length !== l.length || s.some((d, c) => !Ue.equals(d, l[c]))) && r.push({
|
|
4395
4410
|
type: "update",
|
|
@@ -4415,11 +4430,11 @@ class Xa {
|
|
|
4415
4430
|
clone() {
|
|
4416
4431
|
return new Xa(new ke(this.value.clone()), this._worksheet);
|
|
4417
4432
|
}
|
|
4418
|
-
getValue(
|
|
4419
|
-
return this.value.getValue(
|
|
4433
|
+
getValue(t, e) {
|
|
4434
|
+
return this.value.getValue(t, e);
|
|
4420
4435
|
}
|
|
4421
|
-
setValue(
|
|
4422
|
-
return this.value.setValue(
|
|
4436
|
+
setValue(t, e, r) {
|
|
4437
|
+
return this.value.setValue(t, e, r);
|
|
4423
4438
|
}
|
|
4424
4439
|
}
|
|
4425
4440
|
class fl extends Fo {
|
|
@@ -4462,7 +4477,7 @@ class fl extends Fo {
|
|
|
4462
4477
|
const o = this.getRuleById(e);
|
|
4463
4478
|
if (!o)
|
|
4464
4479
|
throw new Error(`Rule not found! id: ${e}`);
|
|
4465
|
-
return r.type ===
|
|
4480
|
+
return r.type === fe.RANGE ? (this._ruleMatrix.updateRange(e, o.ranges, r.payload), this._dataValidationCacheService.updateRuleRanges(this.unitId, this.subUnitId, e, r.payload, o.ranges), this._dataValidationCustomFormulaService.updateRuleRanges(this.unitId, this.subUnitId, e, o.ranges, r.payload)) : r.type === fe.SETTING && (this._dataValidationCacheService.markRangeDirty(this.unitId, this.subUnitId, o.ranges), this._dataValidationFormulaService.updateRuleFormulaText(this.unitId, this.subUnitId, e, r.payload.formula1, r.payload.formula2), this._dataValidationCustomFormulaService.updateRuleFormula(this.unitId, this.subUnitId, e, o.ranges, r.payload.formula1)), super.updateRule(e, r);
|
|
4466
4481
|
}
|
|
4467
4482
|
removeRule(e) {
|
|
4468
4483
|
const r = this.getRuleById(e);
|
|
@@ -4509,19 +4524,19 @@ class fl extends Fo {
|
|
|
4509
4524
|
return this._ruleMatrix;
|
|
4510
4525
|
}
|
|
4511
4526
|
}
|
|
4512
|
-
var pl = Object.defineProperty, gl = Object.getOwnPropertyDescriptor, vl = (
|
|
4513
|
-
for (var o = r > 1 ? void 0 : r ? gl(
|
|
4514
|
-
(i =
|
|
4515
|
-
return r && o && pl(
|
|
4516
|
-
}, Et = (
|
|
4517
|
-
let ft = class extends
|
|
4518
|
-
constructor(
|
|
4519
|
-
super(), this._resourceManagerService =
|
|
4520
|
-
}
|
|
4521
|
-
_createSheetDataValidationManager(
|
|
4527
|
+
var pl = Object.defineProperty, gl = Object.getOwnPropertyDescriptor, vl = (a, t, e, r) => {
|
|
4528
|
+
for (var o = r > 1 ? void 0 : r ? gl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4529
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4530
|
+
return r && o && pl(t, e, o), o;
|
|
4531
|
+
}, Et = (a, t) => (e, r) => t(e, r, a);
|
|
4532
|
+
let ft = class extends ue {
|
|
4533
|
+
constructor(a, t, e, r) {
|
|
4534
|
+
super(), this._resourceManagerService = a, this._univerInstanceService = t, this._dataValidationModel = e, this._injector = r, this._initDataValidationDataSource();
|
|
4535
|
+
}
|
|
4536
|
+
_createSheetDataValidationManager(a, t) {
|
|
4522
4537
|
return new fl(
|
|
4523
|
-
t,
|
|
4524
4538
|
a,
|
|
4539
|
+
t,
|
|
4525
4540
|
[],
|
|
4526
4541
|
this._injector
|
|
4527
4542
|
);
|
|
@@ -4532,32 +4547,32 @@ let ft = class extends fe {
|
|
|
4532
4547
|
};
|
|
4533
4548
|
ft = vl([
|
|
4534
4549
|
ve(_e.Starting, ft),
|
|
4535
|
-
Et(0,
|
|
4550
|
+
Et(0, Do),
|
|
4536
4551
|
Et(1, J),
|
|
4537
|
-
Et(2, I(
|
|
4552
|
+
Et(2, I(z)),
|
|
4538
4553
|
Et(3, I(Ee))
|
|
4539
4554
|
], ft);
|
|
4540
|
-
var _l = Object.defineProperty, Sl = Object.getOwnPropertyDescriptor, Rl = (
|
|
4541
|
-
for (var o = r > 1 ? void 0 : r ? Sl(
|
|
4542
|
-
(i =
|
|
4543
|
-
return r && o && _l(
|
|
4544
|
-
}, la = (
|
|
4545
|
-
let pt = class extends
|
|
4546
|
-
constructor(
|
|
4547
|
-
super(), this._localeService =
|
|
4555
|
+
var _l = Object.defineProperty, Sl = Object.getOwnPropertyDescriptor, Rl = (a, t, e, r) => {
|
|
4556
|
+
for (var o = r > 1 ? void 0 : r ? Sl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4557
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4558
|
+
return r && o && _l(t, e, o), o;
|
|
4559
|
+
}, la = (a, t) => (e, r) => t(e, r, a);
|
|
4560
|
+
let pt = class extends ue {
|
|
4561
|
+
constructor(a, t, e) {
|
|
4562
|
+
super(), this._localeService = a, this._commandService = t, this._sheetPermissionInterceptorBaseController = e, this._commandExecutedListener();
|
|
4548
4563
|
}
|
|
4549
4564
|
_commandExecutedListener() {
|
|
4550
4565
|
this.disposeWithMe(
|
|
4551
|
-
this._commandService.beforeCommandExecuted((
|
|
4552
|
-
|
|
4566
|
+
this._commandService.beforeCommandExecuted((a) => {
|
|
4567
|
+
a.id === Lo.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
4553
4568
|
workbookTypes: [ga],
|
|
4554
4569
|
rangeTypes: [Sa],
|
|
4555
4570
|
worksheetTypes: [_a, va]
|
|
4556
|
-
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))),
|
|
4571
|
+
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), a.id === qt.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
4557
4572
|
workbookTypes: [ga],
|
|
4558
4573
|
rangeTypes: [Sa],
|
|
4559
4574
|
worksheetTypes: [_a, va]
|
|
4560
|
-
},
|
|
4575
|
+
}, a.params.ranges) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")));
|
|
4561
4576
|
})
|
|
4562
4577
|
);
|
|
4563
4578
|
}
|
|
@@ -4568,58 +4583,58 @@ pt = Rl([
|
|
|
4568
4583
|
la(1, ee),
|
|
4569
4584
|
la(2, I(Ko))
|
|
4570
4585
|
], pt);
|
|
4571
|
-
var Cl = Object.defineProperty, Vl = Object.getOwnPropertyDescriptor, Ml = (
|
|
4572
|
-
for (var o = r > 1 ? void 0 : r ? Vl(
|
|
4573
|
-
(i =
|
|
4574
|
-
return r && o && Cl(
|
|
4575
|
-
}, da = (
|
|
4586
|
+
var Cl = Object.defineProperty, Vl = Object.getOwnPropertyDescriptor, Ml = (a, t, e, r) => {
|
|
4587
|
+
for (var o = r > 1 ? void 0 : r ? Vl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4588
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4589
|
+
return r && o && Cl(t, e, o), o;
|
|
4590
|
+
}, da = (a, t) => (e, r) => t(e, r, a);
|
|
4576
4591
|
let $t = class {
|
|
4577
|
-
constructor(
|
|
4578
|
-
this._univerInstanceService =
|
|
4592
|
+
constructor(a, t, e) {
|
|
4593
|
+
this._univerInstanceService = a, this._dataValidationModel = t, this._dataValidationCacheService = e;
|
|
4579
4594
|
}
|
|
4580
|
-
async validatorCell(
|
|
4581
|
-
const o = this._univerInstanceService.getUnit(
|
|
4595
|
+
async validatorCell(a, t, e, r) {
|
|
4596
|
+
const o = this._univerInstanceService.getUnit(a, re.UNIVER_SHEET);
|
|
4582
4597
|
if (!o)
|
|
4583
|
-
throw new Error(`cannot find current workbook, unitId: ${
|
|
4584
|
-
const n = o.getSheetBySheetId(
|
|
4598
|
+
throw new Error(`cannot find current workbook, unitId: ${a}`);
|
|
4599
|
+
const n = o.getSheetBySheetId(t);
|
|
4585
4600
|
if (!n)
|
|
4586
|
-
throw new Error(`cannot find current worksheet, sheetId: ${
|
|
4587
|
-
const i = n.getCellRaw(e, r), s = this._dataValidationModel.ensureManager(
|
|
4601
|
+
throw new Error(`cannot find current worksheet, sheetId: ${t}`);
|
|
4602
|
+
const i = n.getCellRaw(e, r), s = this._dataValidationModel.ensureManager(a, t), l = s.getRuleByLocation(e, r);
|
|
4588
4603
|
return l ? new Promise((d) => {
|
|
4589
|
-
s.validator(ae(i), l, { unitId:
|
|
4604
|
+
s.validator(ae(i), l, { unitId: a, subUnitId: t, row: e, col: r }, d);
|
|
4590
4605
|
}) : Ce.VALID;
|
|
4591
4606
|
}
|
|
4592
|
-
async validatorWorksheet(
|
|
4593
|
-
const r = this._dataValidationModel.ensureManager(
|
|
4607
|
+
async validatorWorksheet(a, t) {
|
|
4608
|
+
const r = this._dataValidationModel.ensureManager(a, t).getDataValidations();
|
|
4594
4609
|
return await Promise.all(r.map((o) => Promise.all(o.ranges.map((n) => {
|
|
4595
4610
|
const i = [];
|
|
4596
4611
|
return W.foreach(n, (s, l) => {
|
|
4597
|
-
i.push(this.validatorCell(
|
|
4612
|
+
i.push(this.validatorCell(a, t, s, l));
|
|
4598
4613
|
}), i;
|
|
4599
|
-
})))), this._dataValidationCacheService.ensureCache(
|
|
4614
|
+
})))), this._dataValidationCacheService.ensureCache(a, t);
|
|
4600
4615
|
}
|
|
4601
|
-
async validatorWorkbook(
|
|
4602
|
-
const
|
|
4616
|
+
async validatorWorkbook(a) {
|
|
4617
|
+
const t = this._dataValidationModel.getSubUnitIds(a), e = await Promise.all(t.map((o) => this.validatorWorksheet(a, o))), r = {};
|
|
4603
4618
|
return e.forEach((o, n) => {
|
|
4604
|
-
r[
|
|
4619
|
+
r[t[n]] = o;
|
|
4605
4620
|
}), r;
|
|
4606
4621
|
}
|
|
4607
4622
|
};
|
|
4608
4623
|
$t = Ml([
|
|
4609
4624
|
da(0, J),
|
|
4610
|
-
da(1, I(
|
|
4625
|
+
da(1, I(z)),
|
|
4611
4626
|
da(2, I(rt))
|
|
4612
4627
|
], $t);
|
|
4613
|
-
var co = Object.defineProperty, Il = Object.getOwnPropertyDescriptor, wl = (
|
|
4614
|
-
for (var o = r > 1 ? void 0 : r ? Il(
|
|
4615
|
-
(i =
|
|
4616
|
-
return r && o && co(
|
|
4617
|
-
}, ca = (
|
|
4628
|
+
var co = Object.defineProperty, Il = Object.getOwnPropertyDescriptor, wl = (a, t, e) => t in a ? co(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, yl = (a, t, e, r) => {
|
|
4629
|
+
for (var o = r > 1 ? void 0 : r ? Il(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4630
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4631
|
+
return r && o && co(t, e, o), o;
|
|
4632
|
+
}, ca = (a, t) => (e, r) => t(e, r, a), uo = (a, t, e) => wl(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4618
4633
|
let Bt = class extends fr {
|
|
4619
|
-
constructor(
|
|
4620
|
-
super(), this._config =
|
|
4634
|
+
constructor(a = {}, t, e, r) {
|
|
4635
|
+
super(), this._config = a, this._injector = t, this._commandService = e, this._localeService = r, this._config = Y.deepMerge({}, no, this._config);
|
|
4621
4636
|
}
|
|
4622
|
-
onStarting(
|
|
4637
|
+
onStarting(a) {
|
|
4623
4638
|
[
|
|
4624
4639
|
[Me],
|
|
4625
4640
|
[_t],
|
|
@@ -4644,8 +4659,8 @@ let Bt = class extends fr {
|
|
|
4644
4659
|
[mt],
|
|
4645
4660
|
[Je],
|
|
4646
4661
|
[lt]
|
|
4647
|
-
].forEach((
|
|
4648
|
-
|
|
4662
|
+
].forEach((t) => {
|
|
4663
|
+
a.add(t);
|
|
4649
4664
|
}), [
|
|
4650
4665
|
zt,
|
|
4651
4666
|
ka,
|
|
@@ -4658,8 +4673,8 @@ let Bt = class extends fr {
|
|
|
4658
4673
|
Ha,
|
|
4659
4674
|
at,
|
|
4660
4675
|
Ar
|
|
4661
|
-
].forEach((
|
|
4662
|
-
this._commandService.registerCommand(
|
|
4676
|
+
].forEach((t) => {
|
|
4677
|
+
this._commandService.registerCommand(t);
|
|
4663
4678
|
});
|
|
4664
4679
|
}
|
|
4665
4680
|
};
|
|
@@ -4671,16 +4686,16 @@ Bt = yl([
|
|
|
4671
4686
|
ca(2, ee),
|
|
4672
4687
|
ca(3, I(ie))
|
|
4673
4688
|
], Bt);
|
|
4674
|
-
var ho = Object.defineProperty, Dl = Object.getOwnPropertyDescriptor, El = (
|
|
4675
|
-
for (var o = r > 1 ? void 0 : r ? Dl(
|
|
4676
|
-
(i =
|
|
4677
|
-
return r && o && ho(
|
|
4678
|
-
}, ua = (
|
|
4689
|
+
var ho = Object.defineProperty, Dl = Object.getOwnPropertyDescriptor, El = (a, t, e) => t in a ? ho(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, bl = (a, t, e, r) => {
|
|
4690
|
+
for (var o = r > 1 ? void 0 : r ? Dl(t, e) : t, n = a.length - 1, i; n >= 0; n--)
|
|
4691
|
+
(i = a[n]) && (o = (r ? i(t, e, o) : i(o)) || o);
|
|
4692
|
+
return r && o && ho(t, e, o), o;
|
|
4693
|
+
}, ua = (a, t) => (e, r) => t(e, r, a), mo = (a, t, e) => El(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4679
4694
|
let Ut = class extends fr {
|
|
4680
|
-
constructor(
|
|
4681
|
-
super(), this._config =
|
|
4695
|
+
constructor(a = {}, t, e, r) {
|
|
4696
|
+
super(), this._config = a, this._injector = t, this._commandService = e, this._localeService = r, this._config = Y.deepMerge({}, no, this._config);
|
|
4682
4697
|
}
|
|
4683
|
-
onStarting(
|
|
4698
|
+
onStarting(a) {
|
|
4684
4699
|
[
|
|
4685
4700
|
[Me],
|
|
4686
4701
|
[_t],
|
|
@@ -4703,8 +4718,8 @@ let Ut = class extends fr {
|
|
|
4703
4718
|
[pt],
|
|
4704
4719
|
[mt],
|
|
4705
4720
|
[Je]
|
|
4706
|
-
].forEach((
|
|
4707
|
-
|
|
4721
|
+
].forEach((t) => {
|
|
4722
|
+
a.add(t);
|
|
4708
4723
|
}), [
|
|
4709
4724
|
zt,
|
|
4710
4725
|
ka,
|
|
@@ -4715,8 +4730,8 @@ let Ut = class extends fr {
|
|
|
4715
4730
|
Ha,
|
|
4716
4731
|
at,
|
|
4717
4732
|
Ar
|
|
4718
|
-
].forEach((
|
|
4719
|
-
this._commandService.registerCommand(
|
|
4733
|
+
].forEach((t) => {
|
|
4734
|
+
this._commandService.registerCommand(t);
|
|
4720
4735
|
});
|
|
4721
4736
|
}
|
|
4722
4737
|
};
|
|
@@ -4744,10 +4759,10 @@ export {
|
|
|
4744
4759
|
et as DataValidationRefRangeController,
|
|
4745
4760
|
lt as DataValidationRejectInputController,
|
|
4746
4761
|
xr as HideDataValidationDropdown,
|
|
4747
|
-
|
|
4748
|
-
|
|
4762
|
+
Gl as ICommandService,
|
|
4763
|
+
ql as LocaleService,
|
|
4749
4764
|
at as OpenValidationPanelOperation,
|
|
4750
|
-
|
|
4765
|
+
zl as Plugin,
|
|
4751
4766
|
_t as SheetDataValidationService,
|
|
4752
4767
|
dt as SheetsDataValidationRenderController,
|
|
4753
4768
|
$t as SheetsDataValidationValidatorService,
|