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