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