@univerjs/sheets-data-validation-ui 0.5.1-nightly.202412241606 → 0.5.1-nightly.202412251606
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 +178 -177
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
var $o = Object.defineProperty;
|
2
2
|
var ko = (e, t, o) => t in e ? $o(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
3
3
|
var M = (e, t, o) => ko(e, typeof t != "symbol" ? t + "" : t, o);
|
4
|
-
import
|
5
|
-
import { Inject as b, LocaleService as J, Disposable as De, DataValidationErrorStyle as at, useDependency as P, ICommandService as Q, dayjs as
|
6
|
-
import { Button as je, DatePanel as aa, Scrollbar as ia, FormLayout as G, RadioGroup as
|
7
|
-
import { DeviceInputEventType as
|
8
|
-
import { SheetInterceptorService as
|
9
|
-
import { SheetDataValidationModel as oe, getCellValueOrigin as ie, getDataValidationCellValue as ga, deserializeListOptions as eo, serializeListOptions as to, UpdateSheetDataValidationRangeCommand as no, UpdateSheetDataValidationSettingCommand as bn, RemoveSheetDataValidationCommand as oo, UpdateSheetDataValidationOptionsCommand as va, createDefaultNewRule as ao, AddSheetDataValidationCommand as
|
4
|
+
import Gt, { useState as W, 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 at, useDependency as P, ICommandService as Q, dayjs as Zt, numfmt as qt, CellValueType as Wo, UniverInstanceType as Y, toDisposable as Ho, IUniverInstanceService as ge, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Yo, DisposableCollection as Xo, CommandType as qe, BuildTextUtils as zo, DataValidationRenderMode as de, DataValidationType as Z, IConfigService as un, UndoCommand as Ko, RedoCommand as Go, isUnitRangesEqual as Zo, debounce as qo, shallowEqual as yn, Injector as Fe, DataValidationStatus as it, ObjectMatrix as _t, Range as Jo, Rectangle as St, queryObjectMatrix as Jt, Optional as Qo, RxDisposable as hn, InterceptorEffectEnum as Xn, sequenceExecute as zn, bufferDebounceTime as ea, isFormulaString as Pe, Tools as Qt, ThemeService as ta, VerticalAlign as ue, HorizontalAlign as He, DEFAULT_STYLES as le, WrapStrategy as Se, DocumentDataModel as na, DEFAULT_EMPTY_DOCUMENT_VALUE as oa, BooleanNumber as Je, Plugin as Kn } from "@univerjs/core";
|
6
|
+
import { Button as je, DatePanel as aa, Scrollbar as ia, FormLayout as G, RadioGroup as pn, Radio as Ae, Checkbox as Et, Input as xe, Select as en, DraggableList as ra } from "@univerjs/design";
|
7
|
+
import { DeviceInputEventType as tn, IRenderManagerService as Ve, fixLineWidthByScale as Mn, Transform as sa, CheckboxShape as la, CURSOR_TYPE as Ye, FontCache as da, Shape as ca, Rect as Gn, getFontStyleString as xt, getDocsSkeletonPageSize as Qe, DocumentViewModel as ua, DocumentSkeleton as ha, Documents as pa } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as mn, AFTER_CELL_EDIT_ASYNC as ma, SetRangeValuesCommand as fn, SheetsSelectionsService as Zn, getSheetCommandTarget as qn, WorkbookEditablePermission as Ct, RangeProtectionPermissionEditPoint as It, WorksheetEditPermission as wt, checkRangesEditablePermission as fa, WorksheetSetCellStylePermission as nn, INTERCEPTOR_POINT as Jn, InterceptCellContentPriority as Qn } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as oe, getCellValueOrigin as ie, getDataValidationCellValue as ga, deserializeListOptions as eo, serializeListOptions as to, UpdateSheetDataValidationRangeCommand as no, UpdateSheetDataValidationSettingCommand as bn, RemoveSheetDataValidationCommand as oo, UpdateSheetDataValidationOptionsCommand as va, createDefaultNewRule as ao, AddSheetDataValidationCommand as gn, RemoveSheetAllDataValidationCommand as _a, DATA_VALIDATION_PLUGIN_NAME as io, getDataValidationDiffMutations as on, DataValidationCacheService as ro, DataValidationFormulaController as Sa, DataValidationFormulaService as Ca, getFormulaResult as jt, isLegalFormulaResult as En, transformCheckboxValue as Ia, CHECKBOX_FORMULA_1 as wa, CHECKBOX_FORMULA_2 as Ra } from "@univerjs/sheets-data-validation";
|
10
10
|
import { getPatternType as Da } from "@univerjs/sheets-numfmt";
|
11
|
-
import { SetCellEditVisibleOperation as so, SheetCanvasPopManagerService as Va, IEditorBridgeService as lo, SheetPermissionInterceptorBaseController as co, IMarkSelectionService as ya, HoverManagerService as Ma, CellAlertManagerService as ba, CellAlertType as Ea, IAutoFillService as Oa, APPLY_TYPE as et, virtualizeDiscreteRanges as
|
12
|
-
import { IDialogService as xa, KeyCode as
|
13
|
-
import { DataValidatorRegistryService as ye, DataValidationModel as
|
11
|
+
import { SetCellEditVisibleOperation as so, SheetCanvasPopManagerService as Va, IEditorBridgeService as lo, SheetPermissionInterceptorBaseController as co, IMarkSelectionService as ya, HoverManagerService as Ma, CellAlertManagerService as ba, CellAlertType as Ea, IAutoFillService as Oa, APPLY_TYPE as et, virtualizeDiscreteRanges as an, getAutoFillRepeatRange as Pa, COPY_TYPE as On, rangeToDiscreteRange as La, PREDEFINED_HOOK_NAME as lt, getRepeatRange as Pn, ISheetClipboardService as Ta, getCurrentRangeDisable$ as Aa, AutoHeightController as uo, SheetSkeletonManagerService as Rt } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as xa, KeyCode as rn, ISidebarService as ho, useObservable as Ne, ComponentManager as Ot, IZenZoneService as po, RectPopup as ja, useEvent as mo, useSidebarClick as vn, MenuItemType as _n, getMenuHiddenObservable as Fa, RibbonStartGroup as Na, IMenuManagerService as Ua } from "@univerjs/ui";
|
13
|
+
import { DataValidatorRegistryService as ye, DataValidationModel as Pt, DataValidatorRegistryScope as Ba, TWO_FORMULA_OPERATOR_COUNT as $a, getRuleOptions as Ln, getRuleSetting as Tn } from "@univerjs/data-validation";
|
14
14
|
import { RichTextEditingMutation as ka } from "@univerjs/docs";
|
15
|
-
import { filter as
|
15
|
+
import { filter as Sn, BehaviorSubject as An, distinctUntilChanged as Wa, Subject as Ha, debounceTime as Cn, bufferTime as fo } from "rxjs";
|
16
16
|
import { deserializeRangeWithSheet as Ya, serializeRange as go } from "@univerjs/engine-formula";
|
17
17
|
import { RangeSelector as Xa, FormulaEditor as vo } from "@univerjs/sheets-formula-ui";
|
18
|
-
var
|
18
|
+
var Ft = { exports: {} }, tt = {};
|
19
19
|
/**
|
20
20
|
* @license React
|
21
21
|
* react-jsx-runtime.production.min.js
|
@@ -29,7 +29,7 @@ var xn;
|
|
29
29
|
function za() {
|
30
30
|
if (xn) return tt;
|
31
31
|
xn = 1;
|
32
|
-
var e =
|
32
|
+
var e = Gt, t = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
33
33
|
function r(l, s, c) {
|
34
34
|
var u, p = {}, d = null, f = null;
|
35
35
|
c !== void 0 && (d = "" + c), s.key !== void 0 && (d = "" + s.key), s.ref !== void 0 && (f = s.ref);
|
@@ -41,7 +41,7 @@ function za() {
|
|
41
41
|
}
|
42
42
|
var jn;
|
43
43
|
function Ka() {
|
44
|
-
return jn || (jn = 1,
|
44
|
+
return jn || (jn = 1, Ft.exports = za()), Ft.exports;
|
45
45
|
}
|
46
46
|
var h = Ka(), Ga = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, qa = (e, t, o, n) => {
|
47
47
|
for (var a = n > 1 ? void 0 : n ? Za(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
@@ -88,7 +88,7 @@ let rt = class extends De {
|
|
88
88
|
title: d.getRuleFinalError(p, { row: i, col: r, unitId: l, subUnitId: s })
|
89
89
|
},
|
90
90
|
footer: {
|
91
|
-
title:
|
91
|
+
title: Gt.createElement(
|
92
92
|
je,
|
93
93
|
{
|
94
94
|
type: "primary",
|
@@ -116,7 +116,7 @@ let rt = class extends De {
|
|
116
116
|
title: e
|
117
117
|
},
|
118
118
|
footer: {
|
119
|
-
title:
|
119
|
+
title: Gt.createElement(
|
120
120
|
je,
|
121
121
|
{
|
122
122
|
type: "primary",
|
@@ -132,7 +132,7 @@ let rt = class extends De {
|
|
132
132
|
}
|
133
133
|
};
|
134
134
|
rt = qa([
|
135
|
-
nt(0, b(
|
135
|
+
nt(0, b(mn)),
|
136
136
|
nt(1, b(oe)),
|
137
137
|
nt(2, b(ye)),
|
138
138
|
nt(3, xa),
|
@@ -145,14 +145,14 @@ const Ja = "univer-dv-date-dropdown", Qa = "univer-dv-date-dropdown-btns", Fn =
|
|
145
145
|
if (e == null || typeof e == "boolean")
|
146
146
|
return;
|
147
147
|
if (typeof e == "number" || !Number.isNaN(+e))
|
148
|
-
return
|
149
|
-
const t =
|
148
|
+
return Zt(qt.format("yyyy-MM-dd HH:mm:ss", Number(e)));
|
149
|
+
const t = Zt(e);
|
150
150
|
if (t.isValid())
|
151
151
|
return t;
|
152
152
|
};
|
153
153
|
function ti(e) {
|
154
154
|
var v;
|
155
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = P(Q), u = P(rt), p = n.getCell(a, i), d = ie(n.getCellRaw(a, i)), f = ei(d), [m, _] = W(f), w = m && m.isValid() ? m :
|
155
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = P(Q), u = P(rt), p = n.getCell(a, i), d = ie(n.getCellRaw(a, i)), f = ei(d), [m, _] = W(f), w = m && m.isValid() ? m : Zt(), S = P(J), R = P(oe), I = R.getRuleByLocation(r, l, a, i);
|
156
156
|
if (!I)
|
157
157
|
return null;
|
158
158
|
const V = R.getValidator(I.type);
|
@@ -162,7 +162,7 @@ function ti(e) {
|
|
162
162
|
var x, j, F;
|
163
163
|
if (!w)
|
164
164
|
return;
|
165
|
-
const L = w.format(C ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (x =
|
165
|
+
const L = w.format(C ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (x = qt.parseDate(L)) == null ? void 0 : x.v, T = s.getStyles().getStyleByCell(p), E = (F = (j = T == null ? void 0 : T.n) == null ? void 0 : j.pattern) != null ? F : "", A = Da(E);
|
166
166
|
I.errorStyle !== at.STOP || await V.validator({
|
167
167
|
value: U,
|
168
168
|
unitId: r,
|
@@ -175,10 +175,10 @@ function ti(e) {
|
|
175
175
|
t: Wo.NUMBER
|
176
176
|
}, I) ? (o(), await c.executeCommand(so.id, {
|
177
177
|
visible: !1,
|
178
|
-
eventType:
|
178
|
+
eventType: tn.Keyboard,
|
179
179
|
unitId: r,
|
180
|
-
keycode:
|
181
|
-
}), await c.executeCommand(
|
180
|
+
keycode: rn.ESC
|
181
|
+
}), await c.executeCommand(fn.id, {
|
182
182
|
unitId: r,
|
183
183
|
subUnitId: l,
|
184
184
|
range: {
|
@@ -214,7 +214,7 @@ function ti(e) {
|
|
214
214
|
onPanelChange: (y) => {
|
215
215
|
_(y);
|
216
216
|
},
|
217
|
-
disabledDate: (y) => !
|
217
|
+
disabledDate: (y) => !qt.parseDate(y.format("YYYY-MM-DD"))
|
218
218
|
}
|
219
219
|
),
|
220
220
|
/* @__PURE__ */ h.jsx("div", { className: Fn.dvDateDropdownBtns, children: /* @__PURE__ */ h.jsx(je, { size: "small", type: "primary", onClick: g, disabled: !w.isValid(), children: S.t("dataValidation.alert.ok") }) })
|
@@ -279,14 +279,14 @@ var si = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em"
|
|
279
279
|
}));
|
280
280
|
});
|
281
281
|
Co.displayName = "DataValidationSingle";
|
282
|
-
var li = { 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" } }] },
|
282
|
+
var li = { 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" } }] }, In = we(function(e, t) {
|
283
283
|
return Re(Me, Object.assign({}, e, {
|
284
284
|
id: "delete-single",
|
285
285
|
ref: t,
|
286
286
|
icon: li
|
287
287
|
}));
|
288
288
|
});
|
289
|
-
|
289
|
+
In.displayName = "DeleteSingle";
|
290
290
|
var di = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Io = we(function(e, t) {
|
291
291
|
return Re(Me, Object.assign({}, e, {
|
292
292
|
id: "increase-single",
|
@@ -334,11 +334,11 @@ let me = class extends De {
|
|
334
334
|
M(this, "activeRule$", this._activeRule$.asObservable());
|
335
335
|
M(this, "_closeDisposable", null);
|
336
336
|
this._univerInstanceService = t, this._sidebarService = o, this.disposeWithMe(
|
337
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(
|
337
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(Sn((n) => !n)).subscribe(() => {
|
338
338
|
this.close();
|
339
339
|
})
|
340
340
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
341
|
-
n.id ===
|
341
|
+
n.id === Dt && (n.visible || setTimeout(() => {
|
342
342
|
this._sidebarService.sidebarOptions$.next({ visible: !1 });
|
343
343
|
}));
|
344
344
|
}));
|
@@ -374,7 +374,7 @@ me = fi([
|
|
374
374
|
Nn(1, ho)
|
375
375
|
], me);
|
376
376
|
function gi() {
|
377
|
-
const e = P(Ie), t = Ne(e.activeDropdown$, e.activeDropdown), o = P(
|
377
|
+
const e = P(Ie), t = Ne(e.activeDropdown$, e.activeDropdown), o = P(Ot);
|
378
378
|
if (!t)
|
379
379
|
return null;
|
380
380
|
const { location: n, componentKey: a } = t, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
@@ -506,13 +506,13 @@ Ie = Si([
|
|
506
506
|
be(5, b(oe)),
|
507
507
|
be(6, b(Zn))
|
508
508
|
], Ie);
|
509
|
-
const
|
509
|
+
const Dt = "DataValidationPanel", Ue = {
|
510
510
|
id: "data-validation.operation.open-validation-panel",
|
511
511
|
type: qe.OPERATION,
|
512
512
|
handler(e, t) {
|
513
513
|
if (!t)
|
514
514
|
return !1;
|
515
|
-
const { ruleId: o, isAdd: n } = t, a = e.get(me), i = e.get(
|
515
|
+
const { ruleId: o, isAdd: n } = t, a = e.get(me), i = e.get(Pt), r = e.get(ge), l = e.get(ho), s = qn(r);
|
516
516
|
if (!s) return !1;
|
517
517
|
const { unitId: c, subUnitId: u } = s, p = o ? i.getRuleById(c, u, o) : void 0;
|
518
518
|
a.open(), a.setActiveRule(p && {
|
@@ -521,8 +521,9 @@ const In = "DataValidationPanel", Ue = {
|
|
521
521
|
rule: p
|
522
522
|
});
|
523
523
|
const d = l.open({
|
524
|
+
id: Dt,
|
524
525
|
header: { title: n ? "dataValidation.panel.addTitle" : "dataValidation.panel.title" },
|
525
|
-
children: { label:
|
526
|
+
children: { label: Dt },
|
526
527
|
width: 312,
|
527
528
|
onClose: () => a.close()
|
528
529
|
});
|
@@ -541,7 +542,7 @@ const In = "DataValidationPanel", Ue = {
|
|
541
542
|
const t = e.get(Q), o = e.get(me);
|
542
543
|
return o.open(), o.isOpen ? t.executeCommand(wn.id) : t.executeCommand(Ue.id), !0;
|
543
544
|
}
|
544
|
-
},
|
545
|
+
}, Lt = {
|
545
546
|
type: qe.OPERATION,
|
546
547
|
id: "sheet.operation.show-data-validation-dropdown",
|
547
548
|
handler(e, t) {
|
@@ -573,7 +574,7 @@ const In = "DataValidationPanel", Ue = {
|
|
573
574
|
dvListDropdownEdit: bi
|
574
575
|
}, Ei = (e) => {
|
575
576
|
var C, g;
|
576
|
-
const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u = P(J), p = P(
|
577
|
+
const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u = P(J), p = P(un), d = s == null ? void 0 : s.toLowerCase(), { row: f, col: m, unitId: _, subUnitId: w } = c, S = a.filter((v) => d ? v.label.toLowerCase().includes(d) : !0), R = (g = (C = p.getConfig(Rn)) == null ? void 0 : C.showEditOnDropdown) != null ? g : !0, I = P(co), V = Te(() => I.permissionCheckWithRanges(
|
577
578
|
{
|
578
579
|
workbookTypes: [Ct],
|
579
580
|
rangeTypes: [It],
|
@@ -611,7 +612,7 @@ const In = "DataValidationPanel", Ue = {
|
|
611
612
|
};
|
612
613
|
function Oi(e) {
|
613
614
|
var j, F, H, X;
|
614
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = P(
|
615
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = P(Pt), [c, u] = W(""), p = P(Q), d = P(J), [f, m] = W(""), _ = P(lo), w = P(ge), S = Te(() => s.ruleChange$.pipe(Cn(16)), []), R = P(oe);
|
615
616
|
Ne(S);
|
616
617
|
const I = ja.useContext(), V = ((F = (j = I.current) == null ? void 0 : j.right) != null ? F : 0) - ((X = (H = I.current) == null ? void 0 : H.left) != null ? X : 0);
|
617
618
|
if (Ce(() => {
|
@@ -674,15 +675,15 @@ function Oi(e) {
|
|
674
675
|
};
|
675
676
|
_.isVisible() && _.changeVisible({
|
676
677
|
visible: !1,
|
677
|
-
keycode:
|
678
|
-
eventType:
|
678
|
+
keycode: rn.ESC,
|
679
|
+
eventType: tn.Keyboard,
|
679
680
|
unitId: r
|
680
681
|
}), m(z), L || o(), _.isVisible().visible && await p.executeCommand(so.id, {
|
681
682
|
visible: !1,
|
682
|
-
eventType:
|
683
|
+
eventType: tn.Keyboard,
|
683
684
|
unitId: r,
|
684
|
-
keycode:
|
685
|
-
}), p.executeCommand(
|
685
|
+
keycode: rn.ESC
|
686
|
+
}), p.executeCommand(fn.id, q);
|
686
687
|
},
|
687
688
|
options: x,
|
688
689
|
onEdit: A,
|
@@ -691,17 +692,17 @@ function Oi(e) {
|
|
691
692
|
}
|
692
693
|
);
|
693
694
|
}
|
694
|
-
const Pi = "univer-data-validation-options-button", Li = "univer-data-validation-options-button-icon",
|
695
|
+
const Pi = "univer-data-validation-options-button", Li = "univer-data-validation-options-button-icon", Nt = {
|
695
696
|
dataValidationOptionsButton: Pi,
|
696
697
|
dataValidationOptionsButtonIcon: Li
|
697
698
|
};
|
698
699
|
function Ti(e) {
|
699
700
|
var c;
|
700
|
-
const t = P(J), o = P(
|
701
|
+
const t = P(J), o = P(Ot), { value: n, onChange: a, extraComponent: i } = e, [r, l] = W(!1), s = i ? o.get(i) : null;
|
701
702
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
702
|
-
/* @__PURE__ */ h.jsxs("div", { className:
|
703
|
+
/* @__PURE__ */ h.jsxs("div", { className: Nt.dataValidationOptionsButton, onClick: () => l(!r), children: [
|
703
704
|
t.t("dataValidation.panel.options"),
|
704
|
-
r ? /* @__PURE__ */ h.jsx(Ro, { className:
|
705
|
+
r ? /* @__PURE__ */ h.jsx(Ro, { className: Nt.dataValidationOptionsButtonIcon }) : /* @__PURE__ */ h.jsx(wo, { className: Nt.dataValidationOptionsButtonIcon })
|
705
706
|
] }),
|
706
707
|
r && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
707
708
|
s ? /* @__PURE__ */ h.jsx(s, { value: n, onChange: a }) : null,
|
@@ -710,7 +711,7 @@ function Ti(e) {
|
|
710
711
|
{
|
711
712
|
label: t.t("dataValidation.panel.invalid"),
|
712
713
|
children: /* @__PURE__ */ h.jsxs(
|
713
|
-
|
714
|
+
pn,
|
714
715
|
{
|
715
716
|
value: `${(c = n.errorStyle) != null ? c : at.WARNING}`,
|
716
717
|
onChange: (u) => a({ ...n, errorStyle: +u }),
|
@@ -727,7 +728,7 @@ function Ti(e) {
|
|
727
728
|
{
|
728
729
|
label: t.t("dataValidation.panel.messageInfo"),
|
729
730
|
children: /* @__PURE__ */ h.jsx(
|
730
|
-
|
731
|
+
Et,
|
731
732
|
{
|
732
733
|
checked: n.showErrorMessage,
|
733
734
|
onChange: () => a({
|
@@ -761,7 +762,7 @@ function Ui(e, t, o) {
|
|
761
762
|
}
|
762
763
|
function Bi() {
|
763
764
|
var se;
|
764
|
-
const [e, t] = W(0), o = P(me), n = Ne(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = P(ye), c = P(ge), u = P(
|
765
|
+
const [e, t] = W(0), o = P(me), n = Ne(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = P(ye), c = P(ge), u = P(Ot), p = P(Q), d = P(Pt), f = P(J), [m, _] = W(r), w = s.getValidatorItem(m.type), [S, R] = W(!1), I = s.getValidatorsByScope(Ba.SHEET), [V, C] = W(() => m.ranges.map((O) => ({ unitId: "", sheetId: "", range: O }))), g = Te(() => Ni(p), [p]), [v, y] = W(!1), L = We({}), [U, T] = W(!1), E = P(Zn);
|
765
766
|
if (Ce(() => () => {
|
766
767
|
const O = E.getCurrentLastSelection();
|
767
768
|
O && E.setSelections([O]);
|
@@ -868,7 +869,7 @@ function Bi() {
|
|
868
869
|
}
|
869
870
|
));
|
870
871
|
};
|
871
|
-
return
|
872
|
+
return vn((O) => {
|
872
873
|
var N;
|
873
874
|
const D = (N = L.current) == null ? void 0 : N.handleOutClick;
|
874
875
|
D && D(O, () => T(!1));
|
@@ -894,7 +895,7 @@ function Bi() {
|
|
894
895
|
}
|
895
896
|
),
|
896
897
|
/* @__PURE__ */ h.jsx(G, { label: f.t("dataValidation.panel.type"), children: /* @__PURE__ */ h.jsx(
|
897
|
-
|
898
|
+
en,
|
898
899
|
{
|
899
900
|
options: I == null ? void 0 : I.map((O) => ({
|
900
901
|
label: f.t(O.title),
|
@@ -906,7 +907,7 @@ function Bi() {
|
|
906
907
|
}
|
907
908
|
) }),
|
908
909
|
A != null && A.length ? /* @__PURE__ */ h.jsx(G, { label: f.t("dataValidation.panel.operator"), children: /* @__PURE__ */ h.jsx(
|
909
|
-
|
910
|
+
en,
|
910
911
|
{
|
911
912
|
options: A.map((O, D) => ({
|
912
913
|
value: `${O}`,
|
@@ -945,7 +946,7 @@ function Bi() {
|
|
945
946
|
e + m.type
|
946
947
|
) : null,
|
947
948
|
/* @__PURE__ */ h.jsx(G, { children: /* @__PURE__ */ h.jsx(
|
948
|
-
|
949
|
+
Et,
|
949
950
|
{
|
950
951
|
checked: (se = m.allowBlank) != null ? se : !0,
|
951
952
|
onChange: () => {
|
@@ -1010,7 +1011,7 @@ const $i = "univer-data-validation-item-container", ki = "univer-data-validation
|
|
1010
1011
|
children: [
|
1011
1012
|
/* @__PURE__ */ h.jsx("div", { className: dt.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(t) }),
|
1012
1013
|
/* @__PURE__ */ h.jsx("div", { className: dt.dataValidationItemContent, children: t.ranges.map((m) => go(m)).join(",") }),
|
1013
|
-
p ? /* @__PURE__ */ h.jsx("div", { className: dt.dataValidationItemIcon, onClick: f, children: /* @__PURE__ */ h.jsx(
|
1014
|
+
p ? /* @__PURE__ */ h.jsx("div", { className: dt.dataValidationItemIcon, onClick: f, children: /* @__PURE__ */ h.jsx(In, {}) }) : null
|
1014
1015
|
]
|
1015
1016
|
}
|
1016
1017
|
);
|
@@ -1045,7 +1046,7 @@ function Zi(e) {
|
|
1045
1046
|
subUnitId: d,
|
1046
1047
|
rule: R
|
1047
1048
|
};
|
1048
|
-
await n.executeCommand(
|
1049
|
+
await n.executeCommand(gn.id, I), i.setActiveRule({
|
1049
1050
|
unitId: p,
|
1050
1051
|
subUnitId: d,
|
1051
1052
|
rule: R
|
@@ -1089,7 +1090,7 @@ function Zi(e) {
|
|
1089
1090
|
const qi = () => {
|
1090
1091
|
const e = P(me), t = Ne(e.activeRule$, e.activeRule);
|
1091
1092
|
return t ? /* @__PURE__ */ h.jsx(Bi, {}, t.rule.uid) : /* @__PURE__ */ h.jsx(Gi, {});
|
1092
|
-
}, Dn = "data-validation.list.dropdown", Eo = "data-validation.date.dropdown",
|
1093
|
+
}, Dn = "data-validation.list.dropdown", Eo = "data-validation.date.dropdown", Tt = {
|
1093
1094
|
type: qe.COMMAND,
|
1094
1095
|
id: "data-validation.command.addRuleAndOpen",
|
1095
1096
|
handler(e) {
|
@@ -1100,7 +1101,7 @@ const qi = () => {
|
|
1100
1101
|
unitId: l,
|
1101
1102
|
subUnitId: s
|
1102
1103
|
};
|
1103
|
-
return r.syncExecuteCommand(
|
1104
|
+
return r.syncExecuteCommand(gn.id, c) ? (r.syncExecuteCommand(Ue.id, {
|
1104
1105
|
ruleId: i.uid,
|
1105
1106
|
isAdd: !0
|
1106
1107
|
}), !0) : !1;
|
@@ -1120,7 +1121,7 @@ let st = class extends De {
|
|
1120
1121
|
this._initCellAlertPopup(), this._initZenService();
|
1121
1122
|
}
|
1122
1123
|
_initCellAlertPopup() {
|
1123
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1124
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(Cn(100)).subscribe((e) => {
|
1124
1125
|
var t;
|
1125
1126
|
if (e) {
|
1126
1127
|
const o = this._univerInstanceService.getUnit(e.location.unitId, Y.UNIVER_SHEET), n = o.getSheetBySheetId(e.location.subUnitId);
|
@@ -1167,7 +1168,7 @@ var tr = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, or = (e, t
|
|
1167
1168
|
for (var a = n > 1 ? void 0 : n ? nr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1168
1169
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1169
1170
|
return n && a && tr(t, o, a), a;
|
1170
|
-
},
|
1171
|
+
}, Ut = (e, t) => (o, n) => t(o, n, e);
|
1171
1172
|
let Xe = class extends De {
|
1172
1173
|
constructor(e, t, o) {
|
1173
1174
|
super(), this._autoFillService = e, this._sheetDataValidationModel = t, this._injector = o, this._initAutoFill();
|
@@ -1175,7 +1176,7 @@ let Xe = class extends De {
|
|
1175
1176
|
// eslint-disable-next-line max-lines-per-function
|
1176
1177
|
_initAutoFill() {
|
1177
1178
|
const e = () => ({ redos: [], undos: [] }), t = (n, a) => {
|
1178
|
-
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u =
|
1179
|
+
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = an([i, r]), [p, d] = u.ranges, { mapFunc: f } = u, m = {
|
1179
1180
|
row: p.startRow,
|
1180
1181
|
col: p.startColumn
|
1181
1182
|
}, _ = Pa(p, d), w = new _t(), S = /* @__PURE__ */ new Set();
|
@@ -1212,9 +1213,9 @@ let Xe = class extends De {
|
|
1212
1213
|
w.setValue(X, k, F), S.add(F);
|
1213
1214
|
});
|
1214
1215
|
});
|
1215
|
-
const R = Array.from(S).map((g) => ({ id: g, ranges:
|
1216
|
+
const R = Array.from(S).map((g) => ({ id: g, ranges: Jt(w, (v) => v === g) }));
|
1216
1217
|
c.addRangeRules(R);
|
1217
|
-
const I = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: V, undoMutations: C } =
|
1218
|
+
const I = c.diff(this._sheetDataValidationModel.getRules(l, s)), { redoMutations: V, undoMutations: C } = on(l, s, I, this._injector, "patched", a === et.ONLY_FORMAT);
|
1218
1219
|
return {
|
1219
1220
|
undos: C,
|
1220
1221
|
redos: V
|
@@ -1240,15 +1241,15 @@ let Xe = class extends De {
|
|
1240
1241
|
}
|
1241
1242
|
};
|
1242
1243
|
Xe = or([
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1244
|
+
Ut(0, Oa),
|
1245
|
+
Ut(1, b(oe)),
|
1246
|
+
Ut(2, b(Fe))
|
1246
1247
|
], Xe);
|
1247
1248
|
var ar = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, rr = (e, t, o, n) => {
|
1248
1249
|
for (var a = n > 1 ? void 0 : n ? ir(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1249
1250
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1250
1251
|
return n && a && ar(t, o, a), a;
|
1251
|
-
},
|
1252
|
+
}, Bt = (e, t) => (o, n) => t(o, n, e);
|
1252
1253
|
let ze = class extends De {
|
1253
1254
|
constructor(t, o, n) {
|
1254
1255
|
super();
|
@@ -1302,7 +1303,7 @@ let ze = class extends De {
|
|
1302
1303
|
return { redos: [], undos: [] };
|
1303
1304
|
const { unitId: n, subUnitId: a } = this._copyInfo;
|
1304
1305
|
if (o.unitId !== n || a !== o.subUnitId) {
|
1305
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), r = new _t(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } =
|
1306
|
+
const i = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), r = new _t(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } = an([o.copyRange, t]), p = Pn(s, c, !0), d = /* @__PURE__ */ new Map();
|
1306
1307
|
p.forEach(({ startRange: w }) => {
|
1307
1308
|
var S;
|
1308
1309
|
(S = this._copyInfo) == null || S.matrix.forValue((R, I, V) => {
|
@@ -1320,9 +1321,9 @@ let ze = class extends De {
|
|
1320
1321
|
l.add(g), r.setValue(y, L, g);
|
1321
1322
|
});
|
1322
1323
|
});
|
1323
|
-
const f = Array.from(l).map((w) => ({ id: w, ranges:
|
1324
|
+
const f = Array.from(l).map((w) => ({ id: w, ranges: Jt(r, (S) => S === w) }));
|
1324
1325
|
i.addRangeRules(f);
|
1325
|
-
const { redoMutations: m, undoMutations: _ } =
|
1326
|
+
const { redoMutations: m, undoMutations: _ } = on(
|
1326
1327
|
o.unitId,
|
1327
1328
|
o.subUnitId,
|
1328
1329
|
i.diffWithAddition(this._sheetDataValidationModel.getRules(o.unitId, o.subUnitId), d.values()),
|
@@ -1335,7 +1336,7 @@ let ze = class extends De {
|
|
1335
1336
|
undos: _
|
1336
1337
|
};
|
1337
1338
|
} else {
|
1338
|
-
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n, a).clone(), r = new _t(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } =
|
1339
|
+
const i = this._sheetDataValidationModel.getRuleObjectMatrix(n, a).clone(), r = new _t(), l = /* @__PURE__ */ new Set(), { ranges: [s, c], mapFunc: u } = an([o.copyRange, t]);
|
1339
1340
|
Pn(s, c, !0).forEach(({ startRange: _ }) => {
|
1340
1341
|
var w;
|
1341
1342
|
(w = this._copyInfo) == null || w.matrix.forValue((S, R, I) => {
|
@@ -1351,9 +1352,9 @@ let ze = class extends De {
|
|
1351
1352
|
r.setValue(C, g, I), l.add(I);
|
1352
1353
|
});
|
1353
1354
|
});
|
1354
|
-
const d = Array.from(l).map((_) => ({ id: _, ranges:
|
1355
|
+
const d = Array.from(l).map((_) => ({ id: _, ranges: Jt(r, (w) => w === _) }));
|
1355
1356
|
i.addRangeRules(d);
|
1356
|
-
const { redoMutations: f, undoMutations: m } =
|
1357
|
+
const { redoMutations: f, undoMutations: m } = on(
|
1357
1358
|
n,
|
1358
1359
|
a,
|
1359
1360
|
i.diff(this._sheetDataValidationModel.getRules(n, a)),
|
@@ -1369,15 +1370,15 @@ let ze = class extends De {
|
|
1369
1370
|
}
|
1370
1371
|
};
|
1371
1372
|
ze = rr([
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1373
|
+
Bt(0, Ta),
|
1374
|
+
Bt(1, b(oe)),
|
1375
|
+
Bt(2, b(Fe))
|
1375
1376
|
], ze);
|
1376
1377
|
var sr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, dr = (e, t, o, n) => {
|
1377
1378
|
for (var a = n > 1 ? void 0 : n ? lr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1378
1379
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1379
1380
|
return n && a && sr(t, o, a), a;
|
1380
|
-
},
|
1381
|
+
}, $t = (e, t) => (o, n) => t(o, n, e);
|
1381
1382
|
let Ke = class extends De {
|
1382
1383
|
constructor(e, t, o) {
|
1383
1384
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionInterceptorBaseController = o, this._commandExecutedListener();
|
@@ -1385,47 +1386,47 @@ let Ke = class extends De {
|
|
1385
1386
|
_commandExecutedListener() {
|
1386
1387
|
this.disposeWithMe(
|
1387
1388
|
this._commandService.beforeCommandExecuted((e) => {
|
1388
|
-
e.id ===
|
1389
|
+
e.id === gn.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
1389
1390
|
workbookTypes: [Ct],
|
1390
1391
|
rangeTypes: [It],
|
1391
|
-
worksheetTypes: [wt,
|
1392
|
+
worksheetTypes: [wt, nn]
|
1392
1393
|
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr"))), e.id === no.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
1393
1394
|
workbookTypes: [Ct],
|
1394
1395
|
rangeTypes: [It],
|
1395
|
-
worksheetTypes: [wt,
|
1396
|
+
worksheetTypes: [wt, nn]
|
1396
1397
|
}, e.params.ranges) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")));
|
1397
1398
|
})
|
1398
1399
|
);
|
1399
1400
|
}
|
1400
1401
|
};
|
1401
1402
|
Ke = dr([
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1403
|
+
$t(0, b(J)),
|
1404
|
+
$t(1, Q),
|
1405
|
+
$t(2, b(co))
|
1405
1406
|
], Ke);
|
1406
1407
|
const Oo = "data-validation-single", Po = "sheet.menu.data-validation";
|
1407
1408
|
function cr(e) {
|
1408
1409
|
return {
|
1409
1410
|
id: Po,
|
1410
|
-
type:
|
1411
|
+
type: _n.SUBITEMS,
|
1411
1412
|
icon: Oo,
|
1412
1413
|
tooltip: "dataValidation.title",
|
1413
1414
|
hidden$: Fa(e, Y.UNIVER_SHEET),
|
1414
|
-
disabled$: Aa(e, { workbookTypes: [Ct], worksheetTypes: [
|
1415
|
+
disabled$: Aa(e, { workbookTypes: [Ct], worksheetTypes: [nn, wt], rangeTypes: [It] })
|
1415
1416
|
};
|
1416
1417
|
}
|
1417
1418
|
function ur(e) {
|
1418
1419
|
return {
|
1419
1420
|
id: Ue.id,
|
1420
1421
|
title: "dataValidation.panel.title",
|
1421
|
-
type:
|
1422
|
+
type: _n.BUTTON
|
1422
1423
|
};
|
1423
1424
|
}
|
1424
1425
|
function hr(e) {
|
1425
1426
|
return {
|
1426
|
-
id:
|
1427
|
+
id: Tt.id,
|
1427
1428
|
title: "dataValidation.panel.add",
|
1428
|
-
type:
|
1429
|
+
type: _n.BUTTON
|
1429
1430
|
};
|
1430
1431
|
}
|
1431
1432
|
const pr = {
|
@@ -1437,7 +1438,7 @@ const pr = {
|
|
1437
1438
|
order: 0,
|
1438
1439
|
menuItemFactory: ur
|
1439
1440
|
},
|
1440
|
-
[
|
1441
|
+
[Tt.id]: {
|
1441
1442
|
order: 1,
|
1442
1443
|
menuItemFactory: hr
|
1443
1444
|
}
|
@@ -1455,7 +1456,7 @@ const To = {
|
|
1455
1456
|
color: "#fe4b4b"
|
1456
1457
|
}
|
1457
1458
|
};
|
1458
|
-
let Ge = class extends
|
1459
|
+
let Ge = class extends hn {
|
1459
1460
|
constructor(e, t, o, n, a, i, r, l, s, c, u) {
|
1460
1461
|
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();
|
1461
1462
|
}
|
@@ -1606,7 +1607,7 @@ let Ge = class extends un {
|
|
1606
1607
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1607
1608
|
// patched data-validation change don't need to re-calc row height
|
1608
1609
|
// re-calc of row height will be triggered precisely by the origin command
|
1609
|
-
|
1610
|
+
Sn((e) => e.source === "command"),
|
1610
1611
|
fo(16)
|
1611
1612
|
).subscribe((e) => {
|
1612
1613
|
const t = [];
|
@@ -1629,11 +1630,11 @@ Ge = Lo([
|
|
1629
1630
|
K(5, b(Ie)),
|
1630
1631
|
K(6, b(oe)),
|
1631
1632
|
K(7, b(ye)),
|
1632
|
-
K(8, b(
|
1633
|
+
K(8, b(mn)),
|
1633
1634
|
K(9, b(ro)),
|
1634
1635
|
K(10, Qo(lo))
|
1635
1636
|
], Ge);
|
1636
|
-
let Un = class extends
|
1637
|
+
let Un = class extends hn {
|
1637
1638
|
constructor(e, t, o, n, a, i, r) {
|
1638
1639
|
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();
|
1639
1640
|
}
|
@@ -1705,7 +1706,7 @@ let Un = class extends un {
|
|
1705
1706
|
}
|
1706
1707
|
_initAutoHeight() {
|
1707
1708
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1708
|
-
|
1709
|
+
Sn((e) => e.source === "command"),
|
1709
1710
|
fo(16)
|
1710
1711
|
).subscribe((e) => {
|
1711
1712
|
const t = [];
|
@@ -1724,7 +1725,7 @@ Un = Lo([
|
|
1724
1725
|
K(1, Ve),
|
1725
1726
|
K(2, b(uo)),
|
1726
1727
|
K(3, b(ye)),
|
1727
|
-
K(4, b(
|
1728
|
+
K(4, b(mn)),
|
1728
1729
|
K(5, b(oe)),
|
1729
1730
|
K(6, b(ro))
|
1730
1731
|
], Un);
|
@@ -1733,7 +1734,7 @@ var gr = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, _r = (e, t
|
|
1733
1734
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1734
1735
|
return n && a && gr(t, o, a), a;
|
1735
1736
|
}, Bn = (e, t) => (o, n) => t(o, n, e);
|
1736
|
-
let
|
1737
|
+
let Vt = class extends De {
|
1737
1738
|
constructor(e, t, o) {
|
1738
1739
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
1739
1740
|
}
|
@@ -1753,10 +1754,10 @@ let Dt = class extends De {
|
|
1753
1754
|
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(ea(16)).subscribe(e));
|
1754
1755
|
}
|
1755
1756
|
};
|
1756
|
-
|
1757
|
+
Vt = _r([
|
1757
1758
|
Bn(1, b(oe)),
|
1758
1759
|
Bn(2, b(Rt))
|
1759
|
-
],
|
1760
|
+
], Vt);
|
1760
1761
|
const Sr = "univer-data-validation-formula", Cr = "univer-data-validation-formula-and", Ir = "univer-data-validation-formula-list-item", wr = "univer-data-validation-formula-list-item-icon", Rr = "univer-data-validation-formula-list-item-drag", Dr = "univer-data-validation-formula-list-add", Vr = "univer-data-validation-formula-color-select", yr = "univer-data-validation-formula-color-select-panel", Mr = "univer-data-validation-formula-color-item", ne = {
|
1761
1762
|
dataValidationFormula: Sr,
|
1762
1763
|
dataValidationFormulaAnd: Cr,
|
@@ -1815,7 +1816,7 @@ function Er(e) {
|
|
1815
1816
|
const { value: t, onChange: o, showError: n, validResult: a } = e, i = P(J), r = n ? a == null ? void 0 : a.formula1 : "", l = n ? a == null ? void 0 : a.formula2 : "", [s, c] = W(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
1816
1817
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
1817
1818
|
/* @__PURE__ */ h.jsx(G, { children: /* @__PURE__ */ h.jsx(
|
1818
|
-
|
1819
|
+
Et,
|
1819
1820
|
{
|
1820
1821
|
checked: s,
|
1821
1822
|
onChange: (u) => {
|
@@ -1861,7 +1862,7 @@ function Er(e) {
|
|
1861
1862
|
function Or(e) {
|
1862
1863
|
var p;
|
1863
1864
|
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] = W(!1);
|
1864
|
-
return
|
1865
|
+
return vn((d) => {
|
1865
1866
|
var m;
|
1866
1867
|
const f = (m = s.current) == null ? void 0 : m.handleOutClick;
|
1867
1868
|
f && f(d, () => u(!1));
|
@@ -1927,7 +1928,7 @@ const Lr = [
|
|
1927
1928
|
], Tr = (e) => {
|
1928
1929
|
const { value: t, onChange: o, disabled: n } = e, [a, i] = W(!1);
|
1929
1930
|
return /* @__PURE__ */ h.jsx(
|
1930
|
-
|
1931
|
+
en,
|
1931
1932
|
{
|
1932
1933
|
disabled: n,
|
1933
1934
|
open: a,
|
@@ -1982,12 +1983,12 @@ const Lr = [
|
|
1982
1983
|
}
|
1983
1984
|
}
|
1984
1985
|
),
|
1985
|
-
t.isRef ? null : /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ h.jsx(
|
1986
|
+
t.isRef ? null : /* @__PURE__ */ h.jsx("div", { className: ne.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ h.jsx(In, { onClick: () => i(t.id) }) })
|
1986
1987
|
] });
|
1987
1988
|
};
|
1988
1989
|
function Ar(e) {
|
1989
1990
|
const { value: t, onChange: o = () => {
|
1990
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = We(null), [p, d] = W(() => Pe(s) ? "1" : "0"), [f, m] = W(p === "1" ? s : "="), [_, w] = W(p === "1" ? s : "="), S = P(J), R = P(ye), I = P(
|
1991
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = We(null), [p, d] = W(() => Pe(s) ? "1" : "0"), [f, m] = W(p === "1" ? s : "="), [_, w] = W(p === "1" ? s : "="), S = P(J), R = P(ye), I = P(Pt), V = P(Sa), [C, g] = W(() => c.split(",")), v = R.getValidatorItem(Z.LIST), [y, L] = W([]), [U, T] = W(""), E = r ? i == null ? void 0 : i.formula1 : "", A = Te(() => I.ruleChange$.pipe(Cn(16)), []), x = Ne(A), j = mo(o);
|
1991
1992
|
Ce(() => {
|
1992
1993
|
(async () => {
|
1993
1994
|
await new Promise((B) => {
|
@@ -2008,7 +2009,7 @@ function Ar(e) {
|
|
2008
2009
|
label: B,
|
2009
2010
|
color: N[$] || Le,
|
2010
2011
|
isRef: !1,
|
2011
|
-
id:
|
2012
|
+
id: Qt.generateRandomId(4)
|
2012
2013
|
}));
|
2013
2014
|
}), X = (D, N, B) => {
|
2014
2015
|
const $ = F.find((_e) => _e.id === D);
|
@@ -2034,7 +2035,7 @@ function Ar(e) {
|
|
2034
2035
|
label: "",
|
2035
2036
|
color: Le,
|
2036
2037
|
isRef: !1,
|
2037
|
-
id:
|
2038
|
+
id: Qt.generateRandomId(4)
|
2038
2039
|
}
|
2039
2040
|
]);
|
2040
2041
|
};
|
@@ -2076,13 +2077,13 @@ function Ar(e) {
|
|
2076
2077
|
},
|
2077
2078
|
[c, j]
|
2078
2079
|
), ae = We({}), [se, O] = W(!1);
|
2079
|
-
return
|
2080
|
+
return vn((D) => {
|
2080
2081
|
var B;
|
2081
2082
|
const N = (B = ae.current) == null ? void 0 : B.handleOutClick;
|
2082
2083
|
N && N(D, () => O(!1));
|
2083
2084
|
}), /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
2084
2085
|
/* @__PURE__ */ h.jsx(G, { label: S.t("dataValidation.list.options"), children: /* @__PURE__ */ h.jsxs(
|
2085
|
-
|
2086
|
+
pn,
|
2086
2087
|
{
|
2087
2088
|
value: p,
|
2088
2089
|
onChange: (D) => {
|
@@ -2146,13 +2147,13 @@ function Ar(e) {
|
|
2146
2147
|
] }) })
|
2147
2148
|
] });
|
2148
2149
|
}
|
2149
|
-
const xo = "data-validation.custom-formula-input",
|
2150
|
+
const xo = "data-validation.custom-formula-input", At = "data-validation.formula-input", Vn = "data-validation.list-formula-input", jo = "data-validation.checkbox-formula-input", xr = [
|
2150
2151
|
[
|
2151
2152
|
xo,
|
2152
2153
|
Or
|
2153
2154
|
],
|
2154
2155
|
[
|
2155
|
-
|
2156
|
+
At,
|
2156
2157
|
br
|
2157
2158
|
],
|
2158
2159
|
[
|
@@ -2164,22 +2165,22 @@ const xo = "data-validation.custom-formula-input", Tt = "data-validation.formula
|
|
2164
2165
|
Er
|
2165
2166
|
]
|
2166
2167
|
], jr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2167
|
-
function
|
2168
|
+
function yt(e) {
|
2168
2169
|
var a;
|
2169
2170
|
const { value: t, onChange: o } = e, n = P(J);
|
2170
|
-
return /* @__PURE__ */ h.jsx(G, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ h.jsxs(
|
2171
|
+
return /* @__PURE__ */ h.jsx(G, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ h.jsxs(pn, { value: `${(a = t.renderMode) != null ? a : de.CUSTOM}`, onChange: (i) => o({ ...t, renderMode: +i }), children: [
|
2171
2172
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2172
2173
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2173
2174
|
/* @__PURE__ */ h.jsx(Ae, { value: `${de.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
2174
2175
|
] }) });
|
2175
2176
|
}
|
2176
|
-
|
2177
|
+
yt.componentKey = jr;
|
2177
2178
|
const Fr = "DATE_SHOW_TIME_OPTION";
|
2178
|
-
function
|
2179
|
+
function Mt(e) {
|
2179
2180
|
var a;
|
2180
2181
|
const { value: t, onChange: o } = e, n = P(J);
|
2181
2182
|
return /* @__PURE__ */ h.jsx(G, { children: /* @__PURE__ */ h.jsx(
|
2182
|
-
|
2183
|
+
Et,
|
2183
2184
|
{
|
2184
2185
|
checked: (a = t.bizInfo) == null ? void 0 : a.showTime,
|
2185
2186
|
onChange: (i) => {
|
@@ -2195,14 +2196,14 @@ function yt(e) {
|
|
2195
2196
|
}
|
2196
2197
|
) });
|
2197
2198
|
}
|
2198
|
-
|
2199
|
+
Mt.componentKey = Fr;
|
2199
2200
|
var Nr = Object.defineProperty, Ur = Object.getOwnPropertyDescriptor, Br = (e, t, o, n) => {
|
2200
2201
|
for (var a = n > 1 ? void 0 : n ? Ur(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2201
2202
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2202
2203
|
return n && a && Nr(t, o, a), a;
|
2203
2204
|
}, ot = (e, t) => (o, n) => t(o, n, e);
|
2204
2205
|
const ht = 6;
|
2205
|
-
let
|
2206
|
+
let sn = class {
|
2206
2207
|
constructor(e, t, o, n, a) {
|
2207
2208
|
this._commandService = e, this._formulaService = t, this._themeService = o, this._renderManagerService = n, this._dataValidationModel = a;
|
2208
2209
|
}
|
@@ -2251,9 +2252,9 @@ let rn = class {
|
|
2251
2252
|
}
|
2252
2253
|
async _parseFormula(e, t, o) {
|
2253
2254
|
var c, u, p, d, f, m, _, w, S;
|
2254
|
-
const { formula1: n = wa, formula2: a = Ra } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r =
|
2255
|
+
const { formula1: n = wa, formula2: a = Ra } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = jt((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 = jt((m = (f = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : f[0]) == null ? void 0 : m[0]), s = En(String(r)) && En(String(l));
|
2255
2256
|
return {
|
2256
|
-
formula1: Pe(n) ?
|
2257
|
+
formula1: Pe(n) ? jt((S = (w = (_ = i == null ? void 0 : i[0]) == null ? void 0 : _.result) == null ? void 0 : w[0]) == null ? void 0 : S[0]) : n,
|
2257
2258
|
formula2: Pe(a) ? l : a,
|
2258
2259
|
isFormulaValid: s
|
2259
2260
|
};
|
@@ -2318,7 +2319,7 @@ let rn = class {
|
|
2318
2319
|
}
|
2319
2320
|
};
|
2320
2321
|
this._commandService.executeCommand(
|
2321
|
-
|
2322
|
+
fn.id,
|
2322
2323
|
f
|
2323
2324
|
);
|
2324
2325
|
}
|
@@ -2331,13 +2332,13 @@ let rn = class {
|
|
2331
2332
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2332
2333
|
}
|
2333
2334
|
};
|
2334
|
-
|
2335
|
+
sn = Br([
|
2335
2336
|
ot(0, Q),
|
2336
2337
|
ot(1, b(Ca)),
|
2337
2338
|
ot(2, b(ta)),
|
2338
2339
|
ot(3, b(Ve)),
|
2339
2340
|
ot(4, b(oe))
|
2340
|
-
],
|
2341
|
+
], sn);
|
2341
2342
|
var $r = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, Wr = (e, t, o, n) => {
|
2342
2343
|
for (var a = n > 1 ? void 0 : n ? kr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2343
2344
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
@@ -2359,7 +2360,7 @@ class Yr extends fe {
|
|
2359
2360
|
constructor() {
|
2360
2361
|
super(...arguments);
|
2361
2362
|
M(this, "id", Z.CHECKBOX);
|
2362
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2363
|
+
M(this, "canvasRender", this.injector.createInstance(sn));
|
2363
2364
|
M(this, "formulaInput", jo);
|
2364
2365
|
}
|
2365
2366
|
}
|
@@ -2376,7 +2377,7 @@ class Kr extends fe {
|
|
2376
2377
|
super(...arguments);
|
2377
2378
|
M(this, "id", Z.DATE);
|
2378
2379
|
M(this, "formulaInput", zr);
|
2379
|
-
M(this, "optionsInput",
|
2380
|
+
M(this, "optionsInput", Mt.componentKey);
|
2380
2381
|
M(this, "dropdown", Eo);
|
2381
2382
|
}
|
2382
2383
|
}
|
@@ -2384,10 +2385,10 @@ class Gr extends fe {
|
|
2384
2385
|
constructor() {
|
2385
2386
|
super(...arguments);
|
2386
2387
|
M(this, "id", Z.DECIMAL);
|
2387
|
-
M(this, "formulaInput",
|
2388
|
+
M(this, "formulaInput", At);
|
2388
2389
|
}
|
2389
2390
|
}
|
2390
|
-
const Fo = 4, Zr = 0,
|
2391
|
+
const Fo = 4, Zr = 0, kt = 4, No = 4, ln = 6, bt = 6, Oe = 14;
|
2391
2392
|
function qr(e, t) {
|
2392
2393
|
const o = da.getTextSize(e, t), n = o.width + Fo * 2, { ba: a, bd: i } = o, r = a + i;
|
2393
2394
|
return {
|
@@ -2396,8 +2397,8 @@ function qr(e, t) {
|
|
2396
2397
|
ba: a
|
2397
2398
|
};
|
2398
2399
|
}
|
2399
|
-
function
|
2400
|
-
const a = Oe +
|
2400
|
+
function Wt(e, t, o, n) {
|
2401
|
+
const a = Oe + ln * 2, i = o - a, r = n - bt * 2, l = e.map((d) => ({
|
2401
2402
|
layout: qr(d, t),
|
2402
2403
|
text: d
|
2403
2404
|
}));
|
@@ -2405,7 +2406,7 @@ function kt(e, t, o, n) {
|
|
2405
2406
|
const c = [];
|
2406
2407
|
l.forEach((d) => {
|
2407
2408
|
const { layout: f } = d, { width: m, height: _ } = f;
|
2408
|
-
!s || s.width + m +
|
2409
|
+
!s || s.width + m + kt > i ? (s = {
|
2409
2410
|
width: m,
|
2410
2411
|
height: _,
|
2411
2412
|
items: [{
|
@@ -2414,8 +2415,8 @@ function kt(e, t, o, n) {
|
|
2414
2415
|
}]
|
2415
2416
|
}, c.push(s)) : (s.items.push({
|
2416
2417
|
...d,
|
2417
|
-
left: s.width +
|
2418
|
-
}), s.width = s.width + m +
|
2418
|
+
left: s.width + kt
|
2419
|
+
}), s.width = s.width + m + kt);
|
2419
2420
|
});
|
2420
2421
|
let u = 0, p = 0;
|
2421
2422
|
return c.forEach((d, f) => {
|
@@ -2425,7 +2426,7 @@ function kt(e, t, o, n) {
|
|
2425
2426
|
totalHeight: u,
|
2426
2427
|
contentWidth: i,
|
2427
2428
|
contentHeight: r,
|
2428
|
-
cellAutoHeight: u +
|
2429
|
+
cellAutoHeight: u + bt * 2,
|
2429
2430
|
calcAutoWidth: p + a
|
2430
2431
|
};
|
2431
2432
|
}
|
@@ -2445,9 +2446,9 @@ var es = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, ns = (e, t
|
|
2445
2446
|
for (var a = n > 1 ? void 0 : n ? ts(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2446
2447
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2447
2448
|
return n && a && es(t, o, a), a;
|
2448
|
-
},
|
2449
|
+
}, Ht = (e, t) => (o, n) => t(o, n, e);
|
2449
2450
|
const os = 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");
|
2450
|
-
let
|
2451
|
+
let dn = class {
|
2451
2452
|
constructor(e, t, o) {
|
2452
2453
|
M(this, "zIndex");
|
2453
2454
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2487,8 +2488,8 @@ let ln = class {
|
|
2487
2488
|
endX: u.endX - f,
|
2488
2489
|
startY: u.startY + m,
|
2489
2490
|
endY: u.endY - _
|
2490
|
-
}, C = V.endX - V.startX, g = V.endY - V.startY, { cl: v } = l || {}, y = (X = typeof v == "object" ? v == null ? void 0 : v.rgb : v) != null ? X : "#000", L =
|
2491
|
-
this._drawDownIcon(e, V, C, g, E), e.save(), e.translateWithPrecision(V.startX, V.startY), e.beginPath(), e.rect(0, 0, C - Oe, g), e.clip(), e.translateWithPrecision(
|
2491
|
+
}, C = V.endX - V.startX, g = V.endY - V.startY, { cl: v } = l || {}, y = (X = typeof v == "object" ? v == null ? void 0 : v.rgb : v) != null ? X : "#000", L = xt(l != null ? l : void 0), { vt: U, ht: T } = l || {}, E = U != null ? U : ue.MIDDLE, A = (k = ie(s)) != null ? k : "", x = I.parseCellValue(A), j = I.getListWithColorMap(R), F = Wt(x, L, C, g);
|
2492
|
+
this._drawDownIcon(e, V, C, g, E), e.save(), e.translateWithPrecision(V.startX, V.startY), e.beginPath(), e.rect(0, 0, C - Oe, g), e.clip(), e.translateWithPrecision(ln, bt);
|
2492
2493
|
let H = 0;
|
2493
2494
|
switch (E) {
|
2494
2495
|
case ue.MIDDLE:
|
@@ -2521,8 +2522,8 @@ let ln = class {
|
|
2521
2522
|
}), e.restore(), w.set(S, {
|
2522
2523
|
left: V.startX,
|
2523
2524
|
top: V.startY,
|
2524
|
-
width: F.contentWidth +
|
2525
|
-
height: F.contentHeight +
|
2525
|
+
width: F.contentWidth + ln + Oe,
|
2526
|
+
height: F.contentHeight + bt * 2
|
2526
2527
|
});
|
2527
2528
|
}
|
2528
2529
|
calcCellAutoHeight(e) {
|
@@ -2538,8 +2539,8 @@ let ln = class {
|
|
2538
2539
|
const m = this._dataValidationModel.getValidator(f.type);
|
2539
2540
|
if (!m)
|
2540
2541
|
return;
|
2541
|
-
const _ = d.endX - d.startX, w = d.endY - d.startY, S = (C = ie(n)) != null ? C : "", R = m.parseCellValue(S), I =
|
2542
|
-
return
|
2542
|
+
const _ = d.endX - d.startX, w = d.endY - d.startY, S = (C = ie(n)) != null ? C : "", R = m.parseCellValue(S), I = xt(o != null ? o : void 0);
|
2543
|
+
return Wt(R, I, _, w).cellAutoHeight;
|
2543
2544
|
}
|
2544
2545
|
calcCellAutoWidth(e) {
|
2545
2546
|
var C;
|
@@ -2554,8 +2555,8 @@ let ln = class {
|
|
2554
2555
|
const m = this._dataValidationModel.getValidator(f.type);
|
2555
2556
|
if (!m)
|
2556
2557
|
return;
|
2557
|
-
const _ = d.endX - d.startX, w = d.endY - d.startY, S = (C = ie(n)) != null ? C : "", R = m.parseCellValue(S), I =
|
2558
|
-
return
|
2558
|
+
const _ = d.endX - d.startX, w = d.endY - d.startY, S = (C = ie(n)) != null ? C : "", R = m.parseCellValue(S), I = xt(o != null ? o : void 0);
|
2559
|
+
return Wt(R, I, _, w).calcAutoWidth;
|
2559
2560
|
}
|
2560
2561
|
isHit(e, t) {
|
2561
2562
|
const { primaryWithCoord: o } = t, n = o.isMergedMainCell ? o.mergeInfo : o, { endX: a } = n, { x: i } = e;
|
@@ -2570,7 +2571,7 @@ let ln = class {
|
|
2570
2571
|
row: a,
|
2571
2572
|
column: i
|
2572
2573
|
};
|
2573
|
-
this._commandService.executeCommand(
|
2574
|
+
this._commandService.executeCommand(Lt.id, r);
|
2574
2575
|
}
|
2575
2576
|
onPointerEnter(e, t) {
|
2576
2577
|
var o, n;
|
@@ -2581,16 +2582,16 @@ let ln = class {
|
|
2581
2582
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2582
2583
|
}
|
2583
2584
|
};
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
],
|
2585
|
+
dn = ns([
|
2586
|
+
Ht(0, Q),
|
2587
|
+
Ht(1, b(Ve)),
|
2588
|
+
Ht(2, b(oe))
|
2589
|
+
], dn);
|
2589
2590
|
class as extends fe {
|
2590
2591
|
constructor() {
|
2591
2592
|
super(...arguments);
|
2592
2593
|
M(this, "id", Z.LIST_MULTIPLE);
|
2593
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2594
|
+
M(this, "canvasRender", this.injector.createInstance(dn));
|
2594
2595
|
M(this, "dropdown", Dn);
|
2595
2596
|
}
|
2596
2597
|
}
|
@@ -2599,7 +2600,7 @@ var is = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, ss = (e, t
|
|
2599
2600
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2600
2601
|
return n && a && is(t, o, a), a;
|
2601
2602
|
}, pt = (e, t) => (o, n) => t(o, n, e);
|
2602
|
-
const Ee = 4, mt = 4, he = 14, pe = 6, ke = 4,
|
2603
|
+
const Ee = 4, mt = 4, he = 14, pe = 6, ke = 4, Yt = 8, ls = "#565656", kn = 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");
|
2603
2604
|
function ds(e, t) {
|
2604
2605
|
const o = e.length;
|
2605
2606
|
return {
|
@@ -2655,7 +2656,7 @@ function ft(e, t, o) {
|
|
2655
2656
|
docViewModel: i
|
2656
2657
|
} = Uo(e, t, o);
|
2657
2658
|
return {
|
2658
|
-
documents: new pa(`DOCUMENTS_${
|
2659
|
+
documents: new pa(`DOCUMENTS_${Qt.generateRandomId()}`, n, {
|
2659
2660
|
pageMarginLeft: 0,
|
2660
2661
|
pageMarginTop: 0
|
2661
2662
|
}),
|
@@ -2693,7 +2694,7 @@ function Wn(e, t, o, n, a, i, r = !0) {
|
|
2693
2694
|
paddingTop: l
|
2694
2695
|
};
|
2695
2696
|
}
|
2696
|
-
let
|
2697
|
+
let cn = class {
|
2697
2698
|
constructor(e, t, o, n) {
|
2698
2699
|
M(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2699
2700
|
M(this, "zIndex");
|
@@ -2761,7 +2762,7 @@ let dn = class {
|
|
2761
2762
|
width: te,
|
2762
2763
|
height: re,
|
2763
2764
|
fill: (L == null ? void 0 : L.color) || Le,
|
2764
|
-
radius:
|
2765
|
+
radius: Yt
|
2765
2766
|
}), e.save(), e.translateWithPrecision(Ee, 0), e.beginPath(), e.rect(0, 0, x, k), e.clip(), e.translateWithPrecision(ee, 0), F.render(e), e.restore(), e.translateWithPrecision(x + Ee + 4, (k - mt) / 2), e.fillStyle = ls, e.fill(kn), e.restore(), V.set(C, {
|
2766
2767
|
left: S.startX + pe + o.rowHeaderWidth,
|
2767
2768
|
top: S.startY + q + o.columnHeaderHeight,
|
@@ -2815,11 +2816,11 @@ let dn = class {
|
|
2815
2816
|
C = he + pe * 2 + V + I;
|
2816
2817
|
break;
|
2817
2818
|
case de.CUSTOM:
|
2818
|
-
C = he + pe * 2 + Ee * 2 + V + I +
|
2819
|
+
C = he + pe * 2 + Ee * 2 + V + I + Yt / 2 + 1;
|
2819
2820
|
break;
|
2820
2821
|
// default is CUSTOM
|
2821
2822
|
default:
|
2822
|
-
C = he + pe * 2 + Ee * 2 + V + I +
|
2823
|
+
C = he + pe * 2 + Ee * 2 + V + I + Yt / 2 + 1;
|
2823
2824
|
}
|
2824
2825
|
const g = m - C, { documentSkeleton: v, docModel: y } = ft(w, this._localeService, o);
|
2825
2826
|
return S === Se.WRAP && y.updateDocumentDataPageSize(Math.max(g, 1)), v.calculate(), v.getActualSize(), Qe(v).width + C;
|
@@ -2840,7 +2841,7 @@ let dn = class {
|
|
2840
2841
|
row: a,
|
2841
2842
|
column: i
|
2842
2843
|
};
|
2843
|
-
this._commandService.executeCommand(
|
2844
|
+
this._commandService.executeCommand(Lt.id, r);
|
2844
2845
|
}
|
2845
2846
|
onPointerEnter(e, t) {
|
2846
2847
|
var o, n;
|
@@ -2851,19 +2852,19 @@ let dn = class {
|
|
2851
2852
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Ye.DEFAULT);
|
2852
2853
|
}
|
2853
2854
|
};
|
2854
|
-
|
2855
|
+
cn = ss([
|
2855
2856
|
pt(0, b(J)),
|
2856
2857
|
pt(1, Q),
|
2857
2858
|
pt(2, b(Ve)),
|
2858
2859
|
pt(3, b(oe))
|
2859
|
-
],
|
2860
|
+
], cn);
|
2860
2861
|
class cs extends fe {
|
2861
2862
|
constructor() {
|
2862
2863
|
super(...arguments);
|
2863
2864
|
M(this, "id", Z.LIST);
|
2864
|
-
M(this, "canvasRender", this.injector.createInstance(
|
2865
|
+
M(this, "canvasRender", this.injector.createInstance(cn));
|
2865
2866
|
M(this, "dropdown", Dn);
|
2866
|
-
M(this, "optionsInput",
|
2867
|
+
M(this, "optionsInput", yt.componentKey);
|
2867
2868
|
M(this, "formulaInput", Vn);
|
2868
2869
|
}
|
2869
2870
|
}
|
@@ -2871,34 +2872,34 @@ class us extends fe {
|
|
2871
2872
|
constructor() {
|
2872
2873
|
super(...arguments);
|
2873
2874
|
M(this, "id", Z.TEXT_LENGTH);
|
2874
|
-
M(this, "formulaInput",
|
2875
|
+
M(this, "formulaInput", At);
|
2875
2876
|
}
|
2876
2877
|
}
|
2877
2878
|
class hs extends fe {
|
2878
2879
|
constructor() {
|
2879
2880
|
super(...arguments);
|
2880
2881
|
M(this, "id", Z.WHOLE);
|
2881
|
-
M(this, "formulaInput",
|
2882
|
+
M(this, "formulaInput", At);
|
2882
2883
|
}
|
2883
2884
|
}
|
2884
2885
|
var ps = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, fs = (e, t, o, n) => {
|
2885
2886
|
for (var a = n > 1 ? void 0 : n ? ms(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2886
2887
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2887
2888
|
return n && a && ps(t, o, a), a;
|
2888
|
-
},
|
2889
|
-
let Ze = class extends
|
2889
|
+
}, Xt = (e, t) => (o, n) => t(o, n, e);
|
2890
|
+
let Ze = class extends hn {
|
2890
2891
|
constructor(e, t, o) {
|
2891
2892
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2892
2893
|
}
|
2893
2894
|
_initComponents() {
|
2894
2895
|
[
|
2895
2896
|
[Oo, Co],
|
2896
|
-
[
|
2897
|
+
[Dt, qi],
|
2897
2898
|
[Vo, gi],
|
2898
2899
|
[Dn, Oi],
|
2899
2900
|
[Eo, ti],
|
2900
|
-
[Vt.componentKey, Vt],
|
2901
2901
|
[yt.componentKey, yt],
|
2902
|
+
[Mt.componentKey, Mt],
|
2902
2903
|
...xr
|
2903
2904
|
].forEach(([e, t]) => {
|
2904
2905
|
this.disposeWithMe(this._componentManger.register(
|
@@ -2924,15 +2925,15 @@ let Ze = class extends un {
|
|
2924
2925
|
}
|
2925
2926
|
};
|
2926
2927
|
Ze = fs([
|
2927
|
-
|
2928
|
-
|
2929
|
-
|
2928
|
+
Xt(0, b(Fe)),
|
2929
|
+
Xt(1, b(Ot)),
|
2930
|
+
Xt(2, b(ye))
|
2930
2931
|
], Ze);
|
2931
2932
|
var gs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, _s = (e, t, o, n) => {
|
2932
2933
|
for (var a = n > 1 ? void 0 : n ? vs(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2933
2934
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2934
2935
|
return n && a && gs(t, o, a), a;
|
2935
|
-
},
|
2936
|
+
}, zt = (e, t) => (o, n) => t(o, n, e);
|
2936
2937
|
const Ss = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2937
2938
|
var gt;
|
2938
2939
|
let Hn = (gt = class extends Kn {
|
@@ -2955,8 +2956,8 @@ let Hn = (gt = class extends Kn {
|
|
2955
2956
|
].forEach((e) => {
|
2956
2957
|
this._injector.add(e);
|
2957
2958
|
}), [
|
2959
|
+
Tt,
|
2958
2960
|
Lt,
|
2959
|
-
Pt,
|
2960
2961
|
Mo,
|
2961
2962
|
wn,
|
2962
2963
|
Ue,
|
@@ -2968,7 +2969,7 @@ let Hn = (gt = class extends Kn {
|
|
2968
2969
|
onReady() {
|
2969
2970
|
this._injector.get(ze), this._injector.get(Ke), this._injector.get(rt), this._injector.get(st), this._injector.get(Ve).registerRenderModule(
|
2970
2971
|
Y.UNIVER_SHEET,
|
2971
|
-
[
|
2972
|
+
[Vt]
|
2972
2973
|
);
|
2973
2974
|
}
|
2974
2975
|
onRendered() {
|
@@ -2979,15 +2980,15 @@ let Hn = (gt = class extends Kn {
|
|
2979
2980
|
}
|
2980
2981
|
}, M(gt, "pluginName", Ss), M(gt, "type", Y.UNIVER_SHEET), gt);
|
2981
2982
|
Hn = _s([
|
2982
|
-
|
2983
|
-
|
2984
|
-
|
2983
|
+
zt(1, b(Fe)),
|
2984
|
+
zt(2, Q),
|
2985
|
+
zt(3, un)
|
2985
2986
|
], Hn);
|
2986
2987
|
var Cs = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, ws = (e, t, o, n) => {
|
2987
2988
|
for (var a = n > 1 ? void 0 : n ? Is(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2988
2989
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2989
2990
|
return n && a && Cs(t, o, a), a;
|
2990
|
-
},
|
2991
|
+
}, Kt = (e, t) => (o, n) => t(o, n, e);
|
2991
2992
|
const Rs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2992
2993
|
var vt;
|
2993
2994
|
let Yn = (vt = class extends Kn {
|
@@ -3009,8 +3010,8 @@ let Yn = (vt = class extends Kn {
|
|
3009
3010
|
].forEach((e) => {
|
3010
3011
|
this._injector.add(e);
|
3011
3012
|
}), [
|
3013
|
+
Tt,
|
3012
3014
|
Lt,
|
3013
|
-
Pt,
|
3014
3015
|
Mo,
|
3015
3016
|
wn,
|
3016
3017
|
Ue,
|
@@ -3022,7 +3023,7 @@ let Yn = (vt = class extends Kn {
|
|
3022
3023
|
onReady() {
|
3023
3024
|
this._injector.get(ze), this._injector.get(Ke), this._injector.get(Ve).registerRenderModule(
|
3024
3025
|
Y.UNIVER_SHEET,
|
3025
|
-
[
|
3026
|
+
[Vt]
|
3026
3027
|
);
|
3027
3028
|
}
|
3028
3029
|
onRendered() {
|
@@ -3033,9 +3034,9 @@ let Yn = (vt = class extends Kn {
|
|
3033
3034
|
}
|
3034
3035
|
}, M(vt, "pluginName", Rs), M(vt, "type", Y.UNIVER_SHEET), vt);
|
3035
3036
|
Yn = ws([
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3037
|
+
Kt(1, b(Fe)),
|
3038
|
+
Kt(2, Q),
|
3039
|
+
Kt(3, un)
|
3039
3040
|
], Yn);
|
3040
3041
|
export {
|
3041
3042
|
Eo as DATE_DROPDOWN_KEY,
|