@univerjs/sheets-data-validation-ui 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +237 -237
- package/lib/types/const.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/zh-CN.d.ts +1 -1
- package/lib/types/views/components/detail/index.d.ts +1 -1
- package/lib/types/views/components/drop-down/CellDropdown.d.ts +1 -1
- package/lib/types/views/components/drop-down/index.d.ts +1 -1
- package/lib/types/views/components/index.d.ts +1 -1
- package/lib/types/views/components/list/index.d.ts +1 -1
- package/lib/types/views/components/panel/index.d.ts +1 -1
- package/lib/types/views/widgets/shape/index.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +17 -17
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
@@ -2,18 +2,18 @@ var ko = Object.defineProperty;
|
|
2
2
|
var Wo = (e, t, o) => t in e ? ko(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
3
3
|
var y = (e, t, o) => Wo(e, typeof t != "symbol" ? t + "" : t, o);
|
4
4
|
import { jsxs as x, jsx as f, Fragment as we } from "react/jsx-runtime";
|
5
|
-
import { Inject as b, LocaleService as Q, Disposable as De, DataValidationErrorStyle as rt,
|
6
|
-
import { Button as Be, DatePanel as oa, Scrollbar as aa, FormLayout as q, RadioGroup as
|
7
|
-
import { DeviceInputEventType as tn, IRenderManagerService as Ve, fixLineWidthByScale as
|
8
|
-
import { SheetInterceptorService as
|
9
|
-
import { SheetDataValidationModel as ae, getCellValueOrigin as re, getDataValidationCellValue as ma, deserializeListOptions as
|
5
|
+
import { Inject as b, LocaleService as Q, Disposable as De, DataValidationErrorStyle as rt, ICommandService as ee, dayjs as Zt, numfmt as qt, CellValueType as Ho, UniverInstanceType as X, toDisposable as jo, IUniverInstanceService as ve, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as xo, DisposableCollection as Yo, CommandType as et, BuildTextUtils as Xo, DataValidationRenderMode as ce, DataValidationType as K, IConfigService as pn, UndoCommand as zo, RedoCommand as Ko, isUnitRangesEqual as Go, debounce as Zo, shallowEqual as bn, Injector as $e, DataValidationStatus as st, ObjectMatrix as St, Range as qo, Rectangle as Ct, queryObjectMatrix as Jt, Optional as Jo, RxDisposable as fn, InterceptorEffectEnum as zn, sequenceExecute as Kn, bufferDebounceTime as Qo, isFormulaString as Ae, Tools as Qt, ThemeService as ea, VerticalAlign as he, HorizontalAlign as Ye, DEFAULT_STYLES as de, WrapStrategy as Ce, DocumentDataModel as ta, DEFAULT_EMPTY_DOCUMENT_VALUE as na, BooleanNumber as tt, Plugin as Gn, merge as Zn } from "@univerjs/core";
|
6
|
+
import { Button as Be, DatePanel as oa, Scrollbar as aa, FormLayout as q, RadioGroup as mn, Radio as Ne, Checkbox as Pt, Input as Ue, Select as en, DraggableList as ia } from "@univerjs/design";
|
7
|
+
import { DeviceInputEventType as tn, IRenderManagerService as Ve, fixLineWidthByScale as En, Transform as ra, CheckboxShape as sa, CURSOR_TYPE as Xe, FontCache as la, Shape as da, Rect as qn, getFontStyleString as Ut, getDocsSkeletonPageSize as nt, DocumentViewModel as ca, DocumentSkeleton as ua, Documents as ha } from "@univerjs/engine-render";
|
8
|
+
import { SheetInterceptorService as gn, AFTER_CELL_EDIT_ASYNC as pa, SetRangeValuesCommand as vn, SheetsSelectionsService as Jn, getSheetCommandTarget as Qn, SheetPermissionCheckController as eo, WorkbookEditablePermission as It, RangeProtectionPermissionEditPoint as wt, WorksheetEditPermission as Rt, checkRangesEditablePermission as fa, WorksheetSetCellStylePermission as nn, INTERCEPTOR_POINT as to, InterceptCellContentPriority as no } from "@univerjs/sheets";
|
9
|
+
import { SheetDataValidationModel as ae, getCellValueOrigin as re, getDataValidationCellValue as ma, deserializeListOptions as oo, serializeListOptions as ao, UpdateSheetDataValidationRangeCommand as io, UpdateSheetDataValidationSettingCommand as On, RemoveSheetDataValidationCommand as ro, UpdateSheetDataValidationOptionsCommand as ga, createDefaultNewRule as so, AddSheetDataValidationCommand as _n, RemoveSheetAllDataValidationCommand as va, DATA_VALIDATION_PLUGIN_NAME as lo, getDataValidationDiffMutations as on, DataValidationCacheService as co, DataValidationFormulaController as _a, DataValidationFormulaService as Sa, getFormulaResult as Bt, isLegalFormulaResult as Pn, 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
|
12
|
-
import { IDialogService as Aa, KeyCode as
|
13
|
-
import
|
14
|
-
import { DataValidatorRegistryService as be, DataValidationModel as Tt, DataValidatorRegistryScope as $a, TWO_FORMULA_OPERATOR_COUNT as ka, getRuleOptions as
|
11
|
+
import { SetCellEditVisibleOperation as an, SheetCanvasPopManagerService as Da, IEditorBridgeService as uo, IMarkSelectionService as Va, HoverManagerService as Ma, CellAlertManagerService as ya, CellAlertType as ba, IAutoFillService as Ea, APPLY_TYPE as ot, virtualizeDiscreteRanges as rn, getAutoFillRepeatRange as Oa, COPY_TYPE as Ln, rangeToDiscreteRange as Pa, PREDEFINED_HOOK_NAME as ct, getRepeatRange as Tn, ISheetClipboardService as La, getCurrentRangeDisable$ as Ta, AutoHeightController as ho, SheetSkeletonManagerService as Dt } from "@univerjs/sheets-ui";
|
12
|
+
import { IDialogService as Aa, useDependency as P, KeyCode as sn, ISidebarService as po, useObservable as ke, ComponentManager as Lt, IZenZoneService as fo, RectPopup as Fa, useEvent as ln, useSidebarClick as Sn, MenuItemType as Cn, getMenuHiddenObservable as Na, RibbonStartGroup as Ua, IMenuManagerService as Ba } from "@univerjs/ui";
|
13
|
+
import An, { useState as j, forwardRef as Me, useRef as ze, createElement as ye, useMemo as Ke, useEffect as Ie } from "react";
|
14
|
+
import { DataValidatorRegistryService as be, DataValidationModel as Tt, DataValidatorRegistryScope as $a, TWO_FORMULA_OPERATOR_COUNT as ka, getRuleOptions as Fn, getRuleSetting as Nn } from "@univerjs/data-validation";
|
15
15
|
import { RichTextEditingMutation as Wa } from "@univerjs/docs";
|
16
|
-
import { filter as
|
16
|
+
import { filter as In, BehaviorSubject as Un, distinctUntilChanged as Ha, Subject as ja, debounceTime as wn, bufferTime as mo } from "rxjs";
|
17
17
|
import { deserializeRangeWithSheet as xa, serializeRange as go } from "@univerjs/engine-formula";
|
18
18
|
import { RangeSelector as Ya, FormulaEditor as vo } from "@univerjs/sheets-formula-ui";
|
19
19
|
var Xa = Object.defineProperty, za = Object.getOwnPropertyDescriptor, Ka = (e, t, o, n) => {
|
@@ -61,7 +61,7 @@ let lt = class extends De {
|
|
61
61
|
title: d.getRuleFinalError(h, { row: i, col: r, unitId: l, subUnitId: s })
|
62
62
|
},
|
63
63
|
footer: {
|
64
|
-
title:
|
64
|
+
title: An.createElement(
|
65
65
|
Be,
|
66
66
|
{
|
67
67
|
type: "primary",
|
@@ -89,7 +89,7 @@ let lt = class extends De {
|
|
89
89
|
title: e
|
90
90
|
},
|
91
91
|
footer: {
|
92
|
-
title:
|
92
|
+
title: An.createElement(
|
93
93
|
Be,
|
94
94
|
{
|
95
95
|
type: "primary",
|
@@ -105,13 +105,13 @@ let lt = class extends De {
|
|
105
105
|
}
|
106
106
|
};
|
107
107
|
lt = Ka([
|
108
|
-
at(0, b(
|
108
|
+
at(0, b(gn)),
|
109
109
|
at(1, b(ae)),
|
110
110
|
at(2, b(be)),
|
111
111
|
at(3, Aa),
|
112
112
|
at(4, b(Q))
|
113
113
|
], lt);
|
114
|
-
const Ga = "univer-dv-date-dropdown", Za = "univer-dv-date-dropdown-btns",
|
114
|
+
const Ga = "univer-dv-date-dropdown", Za = "univer-dv-date-dropdown-btns", Bn = {
|
115
115
|
dvDateDropdown: Ga,
|
116
116
|
dvDateDropdownBtns: Za
|
117
117
|
}, qa = (e) => {
|
@@ -125,7 +125,7 @@ const Ga = "univer-dv-date-dropdown", Za = "univer-dv-date-dropdown-btns", Un =
|
|
125
125
|
};
|
126
126
|
function Ja(e) {
|
127
127
|
var m;
|
128
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c =
|
128
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l, workbook: s } = t, c = P(ee), u = P(lt), h = n.getCell(a, i), d = re(n.getCellRaw(a, i)), v = qa(d), [p, C] = j(v), R = p && p.isValid() ? p : Zt(), g = P(Q), w = P(ae), I = w.getRuleByLocation(r, l, a, i);
|
129
129
|
if (!I)
|
130
130
|
return null;
|
131
131
|
const V = w.getValidator(I.type);
|
@@ -135,7 +135,7 @@ function Ja(e) {
|
|
135
135
|
var F, N, B;
|
136
136
|
if (!R)
|
137
137
|
return;
|
138
|
-
const
|
138
|
+
const L = R.format(_ ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD 00:00:00"), U = (F = qt.parseDate(L)) == null ? void 0 : F.v, T = s.getStyles().getStyleByCell(h), E = (B = (N = T == null ? void 0 : T.n) == null ? void 0 : N.pattern) != null ? B : "", A = Ra(E);
|
139
139
|
I.errorStyle !== rt.STOP || await V.validator({
|
140
140
|
value: U,
|
141
141
|
unitId: r,
|
@@ -144,14 +144,14 @@ function Ja(e) {
|
|
144
144
|
column: i,
|
145
145
|
worksheet: n,
|
146
146
|
workbook: s,
|
147
|
-
interceptValue:
|
147
|
+
interceptValue: L.replace("Z", "").replace("T", " "),
|
148
148
|
t: Ho.NUMBER
|
149
|
-
}, I) ? (o(), await c.executeCommand(
|
149
|
+
}, I) ? (o(), await c.executeCommand(an.id, {
|
150
150
|
visible: !1,
|
151
151
|
eventType: tn.Keyboard,
|
152
152
|
unitId: r,
|
153
|
-
keycode:
|
154
|
-
}), await c.executeCommand(
|
153
|
+
keycode: sn.ESC
|
154
|
+
}), await c.executeCommand(vn.id, {
|
155
155
|
unitId: r,
|
156
156
|
subUnitId: l,
|
157
157
|
range: {
|
@@ -174,7 +174,7 @@ function Ja(e) {
|
|
174
174
|
}
|
175
175
|
})) : u.showReject(V.getRuleFinalError(I, { row: a, col: i, unitId: r, subUnitId: l }));
|
176
176
|
};
|
177
|
-
return /* @__PURE__ */ x("div", { className:
|
177
|
+
return /* @__PURE__ */ x("div", { className: Bn.dvDateDropdown, children: [
|
178
178
|
/* @__PURE__ */ f(
|
179
179
|
oa,
|
180
180
|
{
|
@@ -190,7 +190,7 @@ function Ja(e) {
|
|
190
190
|
disabledDate: (M) => !qt.parseDate(M.format("YYYY-MM-DD"))
|
191
191
|
}
|
192
192
|
),
|
193
|
-
/* @__PURE__ */ f("div", { className:
|
193
|
+
/* @__PURE__ */ f("div", { className: Bn.dvDateDropdownBtns, children: /* @__PURE__ */ f(Be, { size: "small", type: "primary", onClick: S, disabled: !R.isValid(), children: g.t("dataValidation.alert.ok") }) })
|
194
194
|
] });
|
195
195
|
}
|
196
196
|
var ue = function() {
|
@@ -252,14 +252,14 @@ var ai = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em"
|
|
252
252
|
}));
|
253
253
|
});
|
254
254
|
Co.displayName = "DataValidationSingle";
|
255
|
-
var ii = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] },
|
255
|
+
var ii = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rn = Me(function(e, t) {
|
256
256
|
return ye(Ee, Object.assign({}, e, {
|
257
257
|
id: "delete-single",
|
258
258
|
ref: t,
|
259
259
|
icon: ii
|
260
260
|
}));
|
261
261
|
});
|
262
|
-
|
262
|
+
Rn.displayName = "DeleteSingle";
|
263
263
|
var ri = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Io = Me(function(e, t) {
|
264
264
|
return ye(Ee, Object.assign({}, e, {
|
265
265
|
id: "increase-single",
|
@@ -296,18 +296,18 @@ var ci = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, hi = (e, t
|
|
296
296
|
for (var a = n > 1 ? void 0 : n ? ui(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
297
297
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
298
298
|
return n && a && ci(t, o, a), a;
|
299
|
-
},
|
299
|
+
}, $n = (e, t) => (o, n) => t(o, n, e);
|
300
300
|
let me = class extends De {
|
301
301
|
constructor(t, o) {
|
302
302
|
super();
|
303
|
-
y(this, "_open$", new
|
303
|
+
y(this, "_open$", new Un(!1));
|
304
304
|
y(this, "open$", this._open$.pipe(Ha()));
|
305
305
|
y(this, "_activeRule");
|
306
|
-
y(this, "_activeRule$", new
|
306
|
+
y(this, "_activeRule$", new Un(void 0));
|
307
307
|
y(this, "activeRule$", this._activeRule$.asObservable());
|
308
308
|
y(this, "_closeDisposable", null);
|
309
309
|
this._univerInstanceService = t, this._sidebarService = o, this.disposeWithMe(
|
310
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(
|
310
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(X.UNIVER_SHEET).pipe(In((n) => !n)).subscribe(() => {
|
311
311
|
this.close();
|
312
312
|
})
|
313
313
|
), this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe((n) => {
|
@@ -343,11 +343,11 @@ let me = class extends De {
|
|
343
343
|
}
|
344
344
|
};
|
345
345
|
me = hi([
|
346
|
-
|
347
|
-
|
346
|
+
$n(0, ve),
|
347
|
+
$n(1, po)
|
348
348
|
], me);
|
349
349
|
function pi() {
|
350
|
-
const e =
|
350
|
+
const e = P(Re), t = ke(e.activeDropdown$, e.activeDropdown), o = P(Lt);
|
351
351
|
if (!t)
|
352
352
|
return null;
|
353
353
|
const { location: n, componentKey: a } = t, i = o.get(a), r = `${n.unitId}-${n.subUnitId}-${n.row}-${n.col}`;
|
@@ -474,7 +474,7 @@ Re = gi([
|
|
474
474
|
Oe(3, fo),
|
475
475
|
Oe(4, Ve),
|
476
476
|
Oe(5, b(ae)),
|
477
|
-
Oe(6, b(
|
477
|
+
Oe(6, b(Jn))
|
478
478
|
], Re);
|
479
479
|
const Vt = "DataValidationPanel", We = {
|
480
480
|
id: "data-validation.operation.open-validation-panel",
|
@@ -482,7 +482,7 @@ const Vt = "DataValidationPanel", We = {
|
|
482
482
|
handler(e, t) {
|
483
483
|
if (!t)
|
484
484
|
return !1;
|
485
|
-
const { ruleId: o, isAdd: n } = t, a = e.get(me), i = e.get(Tt), r = e.get(ve), l = e.get(po), s =
|
485
|
+
const { ruleId: o, isAdd: n } = t, a = e.get(me), i = e.get(Tt), r = e.get(ve), l = e.get(po), s = Qn(r);
|
486
486
|
if (!s) return !1;
|
487
487
|
const { unitId: c, subUnitId: u } = s, h = o ? i.getRuleById(c, u, o) : void 0;
|
488
488
|
a.open(), a.setActiveRule(h && {
|
@@ -499,7 +499,7 @@ const Vt = "DataValidationPanel", We = {
|
|
499
499
|
});
|
500
500
|
return a.setCloseDisposable(d), !0;
|
501
501
|
}
|
502
|
-
},
|
502
|
+
}, Dn = {
|
503
503
|
id: "data-validation.operation.close-validation-panel",
|
504
504
|
type: et.OPERATION,
|
505
505
|
handler(e) {
|
@@ -510,7 +510,7 @@ const Vt = "DataValidationPanel", We = {
|
|
510
510
|
type: et.OPERATION,
|
511
511
|
handler(e) {
|
512
512
|
const t = e.get(ee), o = e.get(me);
|
513
|
-
return o.open(), o.isOpen ? t.executeCommand(
|
513
|
+
return o.open(), o.isOpen ? t.executeCommand(Dn.id) : t.executeCommand(We.id), !0;
|
514
514
|
}
|
515
515
|
}, At = {
|
516
516
|
type: et.OPERATION,
|
@@ -532,7 +532,7 @@ const Vt = "DataValidationPanel", We = {
|
|
532
532
|
handler(e, t) {
|
533
533
|
return t ? (e.get(Re).hideDropdown(), !0) : !1;
|
534
534
|
}
|
535
|
-
}, Fe = "#ECECEC",
|
535
|
+
}, Fe = "#ECECEC", Vn = "sheets-data-validation-ui.config", Mt = {}, vi = "univer-dv-list-dropdown", _i = "univer-dv-list-dropdown-title", Si = "univer-dv-list-dropdown-list", Ci = "univer-dv-list-dropdown-list-container", Ii = "univer-dv-list-dropdown-selected-icon", wi = "univer-dv-list-dropdown-item-container", Ri = "univer-dv-list-dropdown-item", Di = "univer-dv-list-dropdown-split", Vi = "univer-dv-list-dropdown-edit", _e = {
|
536
536
|
dvListDropdown: vi,
|
537
537
|
dvListDropdownTitle: _i,
|
538
538
|
dvListDropdownList: Si,
|
@@ -544,7 +544,7 @@ const Vt = "DataValidationPanel", We = {
|
|
544
544
|
dvListDropdownEdit: Vi
|
545
545
|
}, Mi = (e) => {
|
546
546
|
var _, S;
|
547
|
-
const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u =
|
547
|
+
const { value: t, onChange: o, multiple: n, options: a, title: i, onEdit: r, style: l, filter: s, location: c } = e, u = P(Q), h = P(pn), d = s == null ? void 0 : s.toLowerCase(), { row: v, col: p, unitId: C, subUnitId: R } = c, g = a.filter((m) => d ? m.label.toLowerCase().includes(d) : !0), w = (S = (_ = h.getConfig(Vn)) == null ? void 0 : _.showEditOnDropdown) != null ? S : !0, I = P(eo), V = Ke(() => I.permissionCheckWithRanges(
|
548
548
|
{
|
549
549
|
workbookTypes: [It],
|
550
550
|
rangeTypes: [wt],
|
@@ -557,9 +557,9 @@ const Vt = "DataValidationPanel", We = {
|
|
557
557
|
return /* @__PURE__ */ x("div", { className: _e.dvListDropdown, style: l, children: [
|
558
558
|
/* @__PURE__ */ f("div", { className: _e.dvListDropdownTitle, children: i }),
|
559
559
|
/* @__PURE__ */ f("div", { className: _e.dvListDropdownList, children: /* @__PURE__ */ f(aa, { children: /* @__PURE__ */ f("div", { className: _e.dvListDropdownListContainer, children: g.map((m, M) => {
|
560
|
-
const
|
560
|
+
const L = t.indexOf(m.value) > -1, U = () => {
|
561
561
|
let E;
|
562
|
-
|
562
|
+
L ? E = new Set(t.filter((F) => F !== m.value)) : E = new Set(n ? [...t, m.value] : [m.value]);
|
563
563
|
const A = [];
|
564
564
|
a.forEach((F) => {
|
565
565
|
E.has(F.value) && A.push(F.value);
|
@@ -571,7 +571,7 @@ const Vt = "DataValidationPanel", We = {
|
|
571
571
|
/* @__PURE__ */ f("span", { style: { fontWeight: "bold" }, children: m.label.substring(T, T + d.length) }),
|
572
572
|
/* @__PURE__ */ f("span", { children: m.label.substring(T + d.length) })
|
573
573
|
] }) : m.label }),
|
574
|
-
/* @__PURE__ */ f("div", { className: _e.dvListDropdownSelectedIcon, children:
|
574
|
+
/* @__PURE__ */ f("div", { className: _e.dvListDropdownSelectedIcon, children: L ? /* @__PURE__ */ f(So, {}) : null })
|
575
575
|
] }, M);
|
576
576
|
}) }) }, s) }),
|
577
577
|
w && V ? /* @__PURE__ */ x(we, { children: [
|
@@ -582,7 +582,7 @@ const Vt = "DataValidationPanel", We = {
|
|
582
582
|
};
|
583
583
|
function yi(e) {
|
584
584
|
var N, B, Y, z;
|
585
|
-
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s =
|
585
|
+
const { location: t, hideFn: o } = e, { worksheet: n, row: a, col: i, unitId: r, subUnitId: l } = t, s = P(Tt), [c, u] = j(""), h = P(ee), d = P(Q), [v, p] = j(""), C = P(uo), R = P(ve), g = Ke(() => s.ruleChange$.pipe(wn(16)), []), w = P(ae);
|
586
586
|
ke(g);
|
587
587
|
const I = Fa.useContext(), V = ((B = (N = I.current) == null ? void 0 : N.right) != null ? B : 0) - ((z = (Y = I.current) == null ? void 0 : Y.left) != null ? z : 0);
|
588
588
|
if (Ie(() => {
|
@@ -609,7 +609,7 @@ function yi(e) {
|
|
609
609
|
const m = n.getCell(a, i), M = (_ == null ? void 0 : _.renderMode) === ce.CUSTOM || (_ == null ? void 0 : _.renderMode) === void 0;
|
610
610
|
if (!m || !_ || !S || S.id.indexOf(K.LIST) !== 0)
|
611
611
|
return;
|
612
|
-
const
|
612
|
+
const L = _.type === K.LIST_MULTIPLE, U = S.getListWithColor(_, r, l), T = v || ma(n.getCellRaw(a, i)), E = oo(T), A = () => {
|
613
613
|
h.executeCommand(We.id, {
|
614
614
|
ruleId: _.uid
|
615
615
|
}), o();
|
@@ -622,11 +622,11 @@ function yi(e) {
|
|
622
622
|
Mi,
|
623
623
|
{
|
624
624
|
style: { minWidth: V, maxWidth: Math.max(V, 200) },
|
625
|
-
title:
|
625
|
+
title: L ? d.t("dataValidation.listMultiple.dropdown") : d.t("dataValidation.list.dropdown"),
|
626
626
|
value: E,
|
627
|
-
multiple:
|
627
|
+
multiple: L,
|
628
628
|
onChange: async (H) => {
|
629
|
-
const G =
|
629
|
+
const G = ao(H), J = {
|
630
630
|
unitId: r,
|
631
631
|
subUnitId: l,
|
632
632
|
range: {
|
@@ -642,17 +642,17 @@ function yi(e) {
|
|
642
642
|
si: null
|
643
643
|
}
|
644
644
|
};
|
645
|
-
C.isVisible() &&
|
645
|
+
C.isVisible() && h.executeCommand(an.id, {
|
646
646
|
visible: !1,
|
647
|
-
keycode: rn.ESC,
|
648
647
|
eventType: tn.Keyboard,
|
649
|
-
unitId: r
|
650
|
-
|
648
|
+
unitId: r,
|
649
|
+
keycode: sn.ESC
|
650
|
+
}), p(G), L || o(), C.isVisible().visible && await h.executeCommand(an.id, {
|
651
651
|
visible: !1,
|
652
652
|
eventType: tn.Keyboard,
|
653
653
|
unitId: r,
|
654
|
-
keycode:
|
655
|
-
}), h.executeCommand(
|
654
|
+
keycode: sn.ESC
|
655
|
+
}), h.executeCommand(vn.id, J);
|
656
656
|
},
|
657
657
|
options: F,
|
658
658
|
onEdit: A,
|
@@ -667,7 +667,7 @@ const bi = "univer-data-validation-options-button", Ei = "univer-data-validation
|
|
667
667
|
};
|
668
668
|
function Oi(e) {
|
669
669
|
var c;
|
670
|
-
const t =
|
670
|
+
const t = P(Q), o = P(Lt), { value: n, onChange: a, extraComponent: i } = e, [r, l] = j(!1), s = i ? o.get(i) : null;
|
671
671
|
return /* @__PURE__ */ x(we, { children: [
|
672
672
|
/* @__PURE__ */ x("div", { className: $t.dataValidationOptionsButton, onClick: () => l(!r), children: [
|
673
673
|
t.t("dataValidation.panel.options"),
|
@@ -680,7 +680,7 @@ function Oi(e) {
|
|
680
680
|
{
|
681
681
|
label: t.t("dataValidation.panel.invalid"),
|
682
682
|
children: /* @__PURE__ */ x(
|
683
|
-
|
683
|
+
mn,
|
684
684
|
{
|
685
685
|
value: `${(c = n.errorStyle) != null ? c : rt.WARNING}`,
|
686
686
|
onChange: (u) => a({ ...n, errorStyle: +u }),
|
@@ -697,7 +697,7 @@ function Oi(e) {
|
|
697
697
|
{
|
698
698
|
label: t.t("dataValidation.panel.messageInfo"),
|
699
699
|
children: /* @__PURE__ */ f(
|
700
|
-
|
700
|
+
Pt,
|
701
701
|
{
|
702
702
|
checked: n.showErrorMessage,
|
703
703
|
onChange: () => a({
|
@@ -713,9 +713,9 @@ function Oi(e) {
|
|
713
713
|
] })
|
714
714
|
] });
|
715
715
|
}
|
716
|
-
const
|
717
|
-
dataValidationDetail:
|
718
|
-
dataValidationDetailFormItem:
|
716
|
+
const Pi = "univer-data-validation-detail", Li = "univer-data-validation-detail-form-item", Ti = "univer-data-validation-detail-buttons", Ai = "univer-data-validation-detail-button", He = {
|
717
|
+
dataValidationDetail: Pi,
|
718
|
+
dataValidationDetailFormItem: Li,
|
719
719
|
dataValidationDetailButtons: Ti,
|
720
720
|
dataValidationDetailButton: Ai
|
721
721
|
}, Fi = (e) => Zo(
|
@@ -731,7 +731,7 @@ function Ni(e, t, o) {
|
|
731
731
|
}
|
732
732
|
function Ui() {
|
733
733
|
var le;
|
734
|
-
const [e, t] = j(0), o =
|
734
|
+
const [e, t] = j(0), o = P(me), n = ke(o.activeRule$, o.activeRule), { unitId: a, subUnitId: i, rule: r } = n || {}, l = r.uid, s = P(be), c = P(ve), u = P(Lt), h = P(ee), d = P(Tt), v = P(Q), [p, C] = j(r), R = s.getValidatorItem(p.type), [g, w] = j(!1), I = s.getValidatorsByScope($a.SHEET), [V, _] = j(() => p.ranges.map((O) => ({ unitId: "", sheetId: "", range: O }))), S = Ke(() => Fi(h), [h]), [m, M] = j(!1), L = ze({}), [U, T] = j(!1), E = P(Jn);
|
735
735
|
if (Ie(() => () => {
|
736
736
|
const O = E.getCurrentLastSelection();
|
737
737
|
O && E.setSelections([O]);
|
@@ -746,7 +746,7 @@ function Ui() {
|
|
746
746
|
return null;
|
747
747
|
const A = R.operators, F = R.operatorNames, N = p.operator ? ka.includes(p.operator) : !1, B = () => {
|
748
748
|
!p.ranges.length || m || (R.validatorFormula(p, a, i).success ? o.setActiveRule(null) : w(!0));
|
749
|
-
}, Y =
|
749
|
+
}, Y = ln((O) => {
|
750
750
|
const D = O.split(",").filter(Boolean).map(xa).map((W) => {
|
751
751
|
const Se = W.sheetName;
|
752
752
|
if (Se) {
|
@@ -773,9 +773,9 @@ function Ui() {
|
|
773
773
|
ruleId: l,
|
774
774
|
ranges: $
|
775
775
|
};
|
776
|
-
S(
|
776
|
+
S(io.id, k);
|
777
777
|
}), z = (O) => {
|
778
|
-
if (
|
778
|
+
if (bn(O, Nn(p)))
|
779
779
|
return;
|
780
780
|
C({
|
781
781
|
...p,
|
@@ -788,12 +788,12 @@ function Ui() {
|
|
788
788
|
setting: O
|
789
789
|
};
|
790
790
|
S(
|
791
|
-
|
791
|
+
On.id,
|
792
792
|
D,
|
793
793
|
void 0
|
794
794
|
);
|
795
795
|
}, H = async () => {
|
796
|
-
await h.executeCommand(
|
796
|
+
await h.executeCommand(ro.id, {
|
797
797
|
ruleId: l,
|
798
798
|
unitId: a,
|
799
799
|
subUnitId: i
|
@@ -818,14 +818,14 @@ function Ui() {
|
|
818
818
|
formula1: void 0,
|
819
819
|
formula2: void 0
|
820
820
|
};
|
821
|
-
C(W), h.executeCommand(
|
821
|
+
C(W), h.executeCommand(On.id, {
|
822
822
|
unitId: a,
|
823
823
|
subUnitId: i,
|
824
824
|
ruleId: p.uid,
|
825
|
-
setting:
|
825
|
+
setting: Nn(W)
|
826
826
|
});
|
827
|
-
}, te = u.get(R.formulaInput), ne = Ke(() => V.map((O) => go(O.range)).join(","), []), se =
|
828
|
-
|
827
|
+
}, te = u.get(R.formulaInput), ne = Ke(() => V.map((O) => go(O.range)).join(","), []), se = Fn(p), ie = (O) => {
|
828
|
+
bn(O, Fn(p)) || (C({
|
829
829
|
...p,
|
830
830
|
...O
|
831
831
|
}), S(
|
@@ -838,9 +838,9 @@ function Ui() {
|
|
838
838
|
}
|
839
839
|
));
|
840
840
|
};
|
841
|
-
return
|
841
|
+
return Sn((O) => {
|
842
842
|
var $;
|
843
|
-
const D = ($ =
|
843
|
+
const D = ($ = L.current) == null ? void 0 : $.handleOutClick;
|
844
844
|
D && D(O, () => T(!1));
|
845
845
|
}), /* @__PURE__ */ x("div", { className: He.dataValidationDetail, children: [
|
846
846
|
/* @__PURE__ */ f(
|
@@ -857,7 +857,7 @@ function Ui() {
|
|
857
857
|
onChange: Y,
|
858
858
|
onFocus: () => T(!0),
|
859
859
|
isFocus: U,
|
860
|
-
actions:
|
860
|
+
actions: L.current,
|
861
861
|
onVerify: (O) => M(!O)
|
862
862
|
}
|
863
863
|
)
|
@@ -915,7 +915,7 @@ function Ui() {
|
|
915
915
|
e + p.type
|
916
916
|
) : null,
|
917
917
|
/* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
|
918
|
-
|
918
|
+
Pt,
|
919
919
|
{
|
920
920
|
checked: (le = p.allowBlank) != null ? le : !0,
|
921
921
|
onChange: () => {
|
@@ -941,8 +941,8 @@ const Bi = "univer-data-validation-item-container", $i = "univer-data-validation
|
|
941
941
|
dataValidationItemContent: ki,
|
942
942
|
dataValidationItemIcon: Wi
|
943
943
|
}, Hi = (e) => {
|
944
|
-
const { rule: t, onClick: o, unitId: n, subUnitId: a, disable: i } = e, r =
|
945
|
-
l.executeCommand(
|
944
|
+
const { rule: t, onClick: o, unitId: n, subUnitId: a, disable: i } = e, r = P(be), l = P(ee), s = P(Va), c = r.getValidatorItem(t.type), u = ze(void 0), [h, d] = j(!1), v = (p) => {
|
945
|
+
l.executeCommand(ro.id, {
|
946
946
|
ruleId: t.uid,
|
947
947
|
unitId: n,
|
948
948
|
subUnitId: a
|
@@ -980,7 +980,7 @@ const Bi = "univer-data-validation-item-container", $i = "univer-data-validation
|
|
980
980
|
children: [
|
981
981
|
/* @__PURE__ */ f("div", { className: ut.dataValidationItemTitle, children: c == null ? void 0 : c.generateRuleName(t) }),
|
982
982
|
/* @__PURE__ */ f("div", { className: ut.dataValidationItemContent, children: t.ranges.map((p) => go(p)).join(",") }),
|
983
|
-
h ? /* @__PURE__ */ f("div", { className: ut.dataValidationItemIcon, onClick: v, children: /* @__PURE__ */ f(
|
983
|
+
h ? /* @__PURE__ */ f("div", { className: ut.dataValidationItemIcon, onClick: v, children: /* @__PURE__ */ f(Rn, {}) }) : null
|
984
984
|
]
|
985
985
|
}
|
986
986
|
);
|
@@ -990,7 +990,7 @@ const Bi = "univer-data-validation-item-container", $i = "univer-data-validation
|
|
990
990
|
dataValidationListButton: Yi
|
991
991
|
};
|
992
992
|
function Xi() {
|
993
|
-
const e =
|
993
|
+
const e = P(ve), t = ke(
|
994
994
|
() => e.getCurrentTypeOfUnit$(X.UNIVER_SHEET),
|
995
995
|
void 0,
|
996
996
|
void 0,
|
@@ -999,7 +999,7 @@ function Xi() {
|
|
999
999
|
return t ? /* @__PURE__ */ f(zi, { workbook: t }) : null;
|
1000
1000
|
}
|
1001
1001
|
function zi(e) {
|
1002
|
-
const t =
|
1002
|
+
const t = P(ae), o = P(ve), n = P(ee), a = P($e), i = P(me), r = P(Q), [l, s] = j([]), { workbook: c } = e, u = ke(c.activeSheet$, void 0, !0), h = c.getUnitId(), d = u == null ? void 0 : u.getSheetId();
|
1003
1003
|
Ie(() => {
|
1004
1004
|
s(t.getRules(h, d));
|
1005
1005
|
const w = t.ruleChange$.subscribe((I) => {
|
@@ -1010,12 +1010,12 @@ function zi(e) {
|
|
1010
1010
|
};
|
1011
1011
|
}, [h, d, t]);
|
1012
1012
|
const v = async () => {
|
1013
|
-
const w =
|
1013
|
+
const w = so(a), I = {
|
1014
1014
|
unitId: h,
|
1015
1015
|
subUnitId: d,
|
1016
1016
|
rule: w
|
1017
1017
|
};
|
1018
|
-
await n.executeCommand(
|
1018
|
+
await n.executeCommand(_n.id, I), i.setActiveRule({
|
1019
1019
|
unitId: h,
|
1020
1020
|
subUnitId: d,
|
1021
1021
|
rule: w
|
@@ -1057,20 +1057,20 @@ function zi(e) {
|
|
1057
1057
|
] });
|
1058
1058
|
}
|
1059
1059
|
const Ki = () => {
|
1060
|
-
const e =
|
1060
|
+
const e = P(me), t = ke(e.activeRule$, e.activeRule);
|
1061
1061
|
return t ? /* @__PURE__ */ f(Ui, {}, t.rule.uid) : /* @__PURE__ */ f(Xi, {});
|
1062
|
-
},
|
1062
|
+
}, Mn = "data-validation.list.dropdown", bo = "data-validation.date.dropdown", Ft = {
|
1063
1063
|
type: et.COMMAND,
|
1064
1064
|
id: "data-validation.command.addRuleAndOpen",
|
1065
1065
|
handler(e) {
|
1066
|
-
const t = e.get(ve), o =
|
1066
|
+
const t = e.get(ve), o = Qn(t);
|
1067
1067
|
if (!o) return !1;
|
1068
|
-
const { workbook: n, worksheet: a } = o, i =
|
1068
|
+
const { workbook: n, worksheet: a } = o, i = so(e), r = e.get(ee), l = n.getUnitId(), s = a.getSheetId(), c = {
|
1069
1069
|
rule: i,
|
1070
1070
|
unitId: l,
|
1071
1071
|
subUnitId: s
|
1072
1072
|
};
|
1073
|
-
return r.syncExecuteCommand(
|
1073
|
+
return r.syncExecuteCommand(_n.id, c) ? (r.syncExecuteCommand(We.id, {
|
1074
1074
|
ruleId: i.uid,
|
1075
1075
|
isAdd: !0
|
1076
1076
|
}), !0) : !1;
|
@@ -1081,7 +1081,7 @@ var Gi = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, qi = (e, t
|
|
1081
1081
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1082
1082
|
return n && a && Gi(t, o, a), a;
|
1083
1083
|
}, je = (e, t) => (o, n) => t(o, n, e);
|
1084
|
-
const
|
1084
|
+
const Pe = "SHEET_DATA_VALIDATION_ALERT";
|
1085
1085
|
let dt = class extends De {
|
1086
1086
|
constructor(e, t, o, n, a, i) {
|
1087
1087
|
super(), this._hoverManagerService = e, this._cellAlertManagerService = t, this._univerInstanceService = o, this._localeService = n, this._zenZoneService = a, this._dataValidationModel = i, this._init();
|
@@ -1090,25 +1090,25 @@ let dt = class extends De {
|
|
1090
1090
|
this._initCellAlertPopup(), this._initZenService();
|
1091
1091
|
}
|
1092
1092
|
_initCellAlertPopup() {
|
1093
|
-
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(
|
1093
|
+
this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(wn(100)).subscribe((e) => {
|
1094
1094
|
var t;
|
1095
1095
|
if (e) {
|
1096
1096
|
const o = this._univerInstanceService.getUnit(e.location.unitId, X.UNIVER_SHEET), n = o.getSheetBySheetId(e.location.subUnitId);
|
1097
1097
|
if (!n) return;
|
1098
1098
|
const a = this._dataValidationModel.getRuleByLocation(e.location.unitId, e.location.subUnitId, e.location.row, e.location.col);
|
1099
1099
|
if (!a) {
|
1100
|
-
this._cellAlertManagerService.removeAlert(
|
1100
|
+
this._cellAlertManagerService.removeAlert(Pe);
|
1101
1101
|
return;
|
1102
1102
|
}
|
1103
1103
|
if (this._dataValidationModel.validator(a, { ...e.location, workbook: o, worksheet: n }) === st.INVALID) {
|
1104
|
-
const r = this._cellAlertManagerService.currentAlert.get(
|
1104
|
+
const r = this._cellAlertManagerService.currentAlert.get(Pe), l = (t = r == null ? void 0 : r.alert) == null ? void 0 : t.location;
|
1105
1105
|
if (l && l.row === e.location.row && l.col === e.location.col && l.subUnitId === e.location.subUnitId && l.unitId === e.location.unitId) {
|
1106
|
-
this._cellAlertManagerService.removeAlert(
|
1106
|
+
this._cellAlertManagerService.removeAlert(Pe);
|
1107
1107
|
return;
|
1108
1108
|
}
|
1109
1109
|
const s = this._dataValidationModel.getValidator(a.type);
|
1110
1110
|
if (!s) {
|
1111
|
-
this._cellAlertManagerService.removeAlert(
|
1111
|
+
this._cellAlertManagerService.removeAlert(Pe);
|
1112
1112
|
return;
|
1113
1113
|
}
|
1114
1114
|
this._cellAlertManagerService.showAlert({
|
@@ -1118,17 +1118,17 @@ let dt = class extends De {
|
|
1118
1118
|
location: e.location,
|
1119
1119
|
width: 200,
|
1120
1120
|
height: 74,
|
1121
|
-
key:
|
1121
|
+
key: Pe
|
1122
1122
|
});
|
1123
1123
|
return;
|
1124
1124
|
}
|
1125
1125
|
}
|
1126
|
-
this._cellAlertManagerService.removeAlert(
|
1126
|
+
this._cellAlertManagerService.removeAlert(Pe);
|
1127
1127
|
}));
|
1128
1128
|
}
|
1129
1129
|
_initZenService() {
|
1130
1130
|
this.disposeWithMe(this._zenZoneService.visible$.subscribe((e) => {
|
1131
|
-
e && this._cellAlertManagerService.removeAlert(
|
1131
|
+
e && this._cellAlertManagerService.removeAlert(Pe);
|
1132
1132
|
}));
|
1133
1133
|
}
|
1134
1134
|
};
|
@@ -1152,12 +1152,12 @@ let Ge = class extends De {
|
|
1152
1152
|
// eslint-disable-next-line max-lines-per-function
|
1153
1153
|
_initAutoFill() {
|
1154
1154
|
const e = () => ({ redos: [], undos: [] }), t = (n, a) => {
|
1155
|
-
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u =
|
1155
|
+
const { source: i, target: r, unitId: l, subUnitId: s } = n, c = this._sheetDataValidationModel.getRuleObjectMatrix(l, s).clone(), u = rn([i, r]), [h, d] = u.ranges, { mapFunc: v } = u, p = {
|
1156
1156
|
row: h.startRow,
|
1157
1157
|
col: h.startColumn
|
1158
1158
|
}, C = Oa(h, d), R = new St(), g = /* @__PURE__ */ new Set();
|
1159
1159
|
C.forEach((S) => {
|
1160
|
-
const m = S.repeatStartCell, M = S.relativeRange,
|
1160
|
+
const m = S.repeatStartCell, M = S.relativeRange, L = {
|
1161
1161
|
startRow: p.row,
|
1162
1162
|
startColumn: p.col,
|
1163
1163
|
endColumn: p.col,
|
@@ -1176,7 +1176,7 @@ let Ge = class extends De {
|
|
1176
1176
|
endColumn: E,
|
1177
1177
|
endRow: T
|
1178
1178
|
},
|
1179
|
-
|
1179
|
+
L
|
1180
1180
|
), { row: F, col: N } = v(A.startRow, A.startColumn), B = this._sheetDataValidationModel.getRuleIdByLocation(l, s, F, N) || "", Y = Ct.getPositionRange(
|
1181
1181
|
{
|
1182
1182
|
startRow: T,
|
@@ -1197,7 +1197,7 @@ let Ge = class extends De {
|
|
1197
1197
|
redos: V
|
1198
1198
|
};
|
1199
1199
|
}, o = {
|
1200
|
-
id:
|
1200
|
+
id: lo,
|
1201
1201
|
onBeforeFillData: (n) => {
|
1202
1202
|
const { source: a, unitId: i, subUnitId: r } = n;
|
1203
1203
|
for (const l of a.rows)
|
@@ -1234,7 +1234,7 @@ let Ze = class extends De {
|
|
1234
1234
|
}
|
1235
1235
|
_initCopyPaste() {
|
1236
1236
|
this._sheetClipboardService.addClipboardHook({
|
1237
|
-
id:
|
1237
|
+
id: lo,
|
1238
1238
|
onBeforeCopy: (t, o, n) => this._collect(t, o, n),
|
1239
1239
|
onPasteCells: (t, o, n, a) => {
|
1240
1240
|
const { copyType: i = Ln.COPY, pasteType: r } = a, { range: l } = t || {}, { range: s, unitId: c, subUnitId: u } = o;
|
@@ -1249,7 +1249,7 @@ let Ze = class extends De {
|
|
1249
1249
|
subUnitId: o,
|
1250
1250
|
matrix: a
|
1251
1251
|
};
|
1252
|
-
const i = this._injector.invoke((s) =>
|
1252
|
+
const i = this._injector.invoke((s) => Pa(n, s, t, o));
|
1253
1253
|
if (!i)
|
1254
1254
|
return;
|
1255
1255
|
const { rows: r, cols: l } = i;
|
@@ -1277,7 +1277,7 @@ let Ze = class extends De {
|
|
1277
1277
|
return { redos: [], undos: [] };
|
1278
1278
|
const { unitId: a, subUnitId: i } = this._copyInfo;
|
1279
1279
|
if (o.unitId !== a || i !== o.subUnitId) {
|
1280
|
-
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), l = new St(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } =
|
1280
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(o.unitId, o.subUnitId).clone(), l = new St(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = rn([o.copyRange, t]), d = Tn(c, u, !0), v = /* @__PURE__ */ new Map();
|
1281
1281
|
d.forEach(({ startRange: g }) => {
|
1282
1282
|
var w;
|
1283
1283
|
(w = this._copyInfo) == null || w.matrix.forValue((I, V, _) => {
|
@@ -1291,8 +1291,8 @@ let Ze = class extends De {
|
|
1291
1291
|
g
|
1292
1292
|
), m = `${i}-${_}`, M = this._sheetDataValidationModel.getRuleById(a, i, _);
|
1293
1293
|
!this._sheetDataValidationModel.getRuleById(o.unitId, o.subUnitId, m) && M && v.set(m, { ...M, uid: m });
|
1294
|
-
const { row:
|
1295
|
-
s.add(m), l.setValue(
|
1294
|
+
const { row: L, col: U } = h(S.startRow, S.startColumn);
|
1295
|
+
s.add(m), l.setValue(L, U, m);
|
1296
1296
|
});
|
1297
1297
|
});
|
1298
1298
|
const p = Array.from(s).map((g) => ({ id: g, ranges: Jt(l, (w) => w === g) }));
|
@@ -1310,8 +1310,8 @@ let Ze = class extends De {
|
|
1310
1310
|
undos: R
|
1311
1311
|
};
|
1312
1312
|
} else {
|
1313
|
-
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), l = new St(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } =
|
1314
|
-
|
1313
|
+
const r = this._sheetDataValidationModel.getRuleObjectMatrix(a, i).clone(), l = new St(), s = /* @__PURE__ */ new Set(), { ranges: [c, u], mapFunc: h } = rn([o.copyRange, t]);
|
1314
|
+
Tn(c, u, !0).forEach(({ startRange: R }) => {
|
1315
1315
|
var g;
|
1316
1316
|
(g = this._copyInfo) == null || g.matrix.forValue((w, I, V) => {
|
1317
1317
|
const _ = Ct.getPositionRange(
|
@@ -1344,7 +1344,7 @@ let Ze = class extends De {
|
|
1344
1344
|
}
|
1345
1345
|
};
|
1346
1346
|
Ze = or([
|
1347
|
-
Wt(0,
|
1347
|
+
Wt(0, La),
|
1348
1348
|
Wt(1, b(ae)),
|
1349
1349
|
Wt(2, b($e))
|
1350
1350
|
], Ze);
|
@@ -1360,11 +1360,11 @@ let qe = class extends De {
|
|
1360
1360
|
_commandExecutedListener() {
|
1361
1361
|
this.disposeWithMe(
|
1362
1362
|
this._commandService.beforeCommandExecuted((e) => {
|
1363
|
-
e.id ===
|
1363
|
+
e.id === _n.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1364
1364
|
workbookTypes: [It],
|
1365
1365
|
rangeTypes: [wt],
|
1366
1366
|
worksheetTypes: [Rt, nn]
|
1367
|
-
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id ===
|
1367
|
+
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"))), e.id === io.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
1368
1368
|
workbookTypes: [It],
|
1369
1369
|
rangeTypes: [wt],
|
1370
1370
|
worksheetTypes: [Rt, nn]
|
@@ -1376,13 +1376,13 @@ let qe = class extends De {
|
|
1376
1376
|
qe = rr([
|
1377
1377
|
Ht(0, b(Q)),
|
1378
1378
|
Ht(1, ee),
|
1379
|
-
Ht(2, b(
|
1379
|
+
Ht(2, b(eo))
|
1380
1380
|
], qe);
|
1381
1381
|
const Eo = "data-validation-single", Oo = "sheet.menu.data-validation";
|
1382
1382
|
function sr(e) {
|
1383
1383
|
return {
|
1384
1384
|
id: Oo,
|
1385
|
-
type:
|
1385
|
+
type: Cn.SUBITEMS,
|
1386
1386
|
icon: Eo,
|
1387
1387
|
tooltip: "dataValidation.title",
|
1388
1388
|
hidden$: Na(e, X.UNIVER_SHEET),
|
@@ -1393,14 +1393,14 @@ function lr(e) {
|
|
1393
1393
|
return {
|
1394
1394
|
id: We.id,
|
1395
1395
|
title: "dataValidation.panel.title",
|
1396
|
-
type:
|
1396
|
+
type: Cn.BUTTON
|
1397
1397
|
};
|
1398
1398
|
}
|
1399
1399
|
function dr(e) {
|
1400
1400
|
return {
|
1401
1401
|
id: Ft.id,
|
1402
1402
|
title: "dataValidation.panel.add",
|
1403
|
-
type:
|
1403
|
+
type: Cn.BUTTON
|
1404
1404
|
};
|
1405
1405
|
}
|
1406
1406
|
const cr = {
|
@@ -1419,18 +1419,18 @@ const cr = {
|
|
1419
1419
|
}
|
1420
1420
|
}
|
1421
1421
|
};
|
1422
|
-
var ur = Object.defineProperty, hr = Object.getOwnPropertyDescriptor,
|
1422
|
+
var ur = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, Po = (e, t, o, n) => {
|
1423
1423
|
for (var a = n > 1 ? void 0 : n ? hr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1424
1424
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1425
1425
|
return n && a && ur(t, o, a), a;
|
1426
1426
|
}, Z = (e, t) => (o, n) => t(o, n, e);
|
1427
|
-
const
|
1427
|
+
const Lo = {
|
1428
1428
|
tr: {
|
1429
1429
|
size: 6,
|
1430
1430
|
color: "#fe4b4b"
|
1431
1431
|
}
|
1432
1432
|
};
|
1433
|
-
let Je = class extends
|
1433
|
+
let Je = class extends fn {
|
1434
1434
|
constructor(e, t, o, n, a, i, r, l, s, c, u) {
|
1435
1435
|
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();
|
1436
1436
|
}
|
@@ -1484,11 +1484,11 @@ let Je = class extends pn {
|
|
1484
1484
|
_initViewModelIntercept() {
|
1485
1485
|
this.disposeWithMe(
|
1486
1486
|
this._sheetInterceptorService.intercept(
|
1487
|
-
|
1487
|
+
to.CELL_CONTENT,
|
1488
1488
|
{
|
1489
|
-
effect:
|
1489
|
+
effect: zn.Style,
|
1490
1490
|
// must be after numfmt
|
1491
|
-
priority:
|
1491
|
+
priority: no.DATA_VALIDATION,
|
1492
1492
|
// eslint-disable-next-line max-lines-per-function, complexity
|
1493
1493
|
handler: (e, t, o) => {
|
1494
1494
|
var g, w, I, V, _;
|
@@ -1515,7 +1515,7 @@ let Je = class extends pn {
|
|
1515
1515
|
...e,
|
1516
1516
|
markers: {
|
1517
1517
|
...e == null ? void 0 : e.markers,
|
1518
|
-
...h === st.INVALID ?
|
1518
|
+
...h === st.INVALID ? Lo : null
|
1519
1519
|
},
|
1520
1520
|
customRender: [
|
1521
1521
|
...(w = e == null ? void 0 : e.customRender) != null ? w : [],
|
@@ -1535,13 +1535,13 @@ let Je = class extends pn {
|
|
1535
1535
|
}, n, a)
|
1536
1536
|
},
|
1537
1537
|
interceptorAutoHeight: () => {
|
1538
|
-
var
|
1539
|
-
const S = (U = (
|
1538
|
+
var L, U, T, E, A, F;
|
1539
|
+
const S = (U = (L = this._renderManagerService.getRenderById(i)) == null ? void 0 : L.with(Dt).getSkeletonParam(r)) == null ? void 0 : U.skeleton;
|
1540
1540
|
if (!S)
|
1541
1541
|
return;
|
1542
1542
|
const m = S.worksheet.getMergedCell(n, a), M = {
|
1543
1543
|
data: e,
|
1544
|
-
style: S.
|
1544
|
+
style: S.getStyles().getStyleByCell(e),
|
1545
1545
|
primaryWithCoord: S.getCellWithCoordByIndex((T = m == null ? void 0 : m.startRow) != null ? T : n, (E = m == null ? void 0 : m.startColumn) != null ? E : a),
|
1546
1546
|
unitId: i,
|
1547
1547
|
subUnitId: r,
|
@@ -1553,13 +1553,13 @@ let Je = class extends pn {
|
|
1553
1553
|
return (F = (A = d == null ? void 0 : d.canvasRender) == null ? void 0 : A.calcCellAutoHeight) == null ? void 0 : F.call(A, M);
|
1554
1554
|
},
|
1555
1555
|
interceptorAutoWidth: () => {
|
1556
|
-
var
|
1557
|
-
const S = (U = (
|
1556
|
+
var L, U, T, E, A, F;
|
1557
|
+
const S = (U = (L = this._renderManagerService.getRenderById(i)) == null ? void 0 : L.with(Dt).getSkeletonParam(r)) == null ? void 0 : U.skeleton;
|
1558
1558
|
if (!S)
|
1559
1559
|
return;
|
1560
1560
|
const m = S.worksheet.getMergedCell(n, a), M = {
|
1561
1561
|
data: e,
|
1562
|
-
style: S.
|
1562
|
+
style: S.getStyles().getStyleByCell(e),
|
1563
1563
|
primaryWithCoord: S.getCellWithCoordByIndex((T = m == null ? void 0 : m.startRow) != null ? T : n, (E = m == null ? void 0 : m.startColumn) != null ? E : a),
|
1564
1564
|
unitId: i,
|
1565
1565
|
subUnitId: r,
|
@@ -1581,7 +1581,7 @@ let Je = class extends pn {
|
|
1581
1581
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1582
1582
|
// patched data-validation change don't need to re-calc row height
|
1583
1583
|
// re-calc of row height will be triggered precisely by the origin command
|
1584
|
-
|
1584
|
+
In((e) => e.source === "command"),
|
1585
1585
|
mo(100)
|
1586
1586
|
).subscribe((e) => {
|
1587
1587
|
if (e.length === 0)
|
@@ -1592,12 +1592,12 @@ let Je = class extends pn {
|
|
1592
1592
|
(o.rule.type === K.LIST_MULTIPLE || o.rule.type === K.LIST) && (n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1593
1593
|
}), t.length) {
|
1594
1594
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1595
|
-
|
1595
|
+
Kn(o.redos, this._commandService);
|
1596
1596
|
}
|
1597
1597
|
});
|
1598
1598
|
}
|
1599
1599
|
};
|
1600
|
-
Je =
|
1600
|
+
Je = Po([
|
1601
1601
|
Z(0, ee),
|
1602
1602
|
Z(1, Ba),
|
1603
1603
|
Z(2, Ve),
|
@@ -1606,22 +1606,22 @@ Je = Lo([
|
|
1606
1606
|
Z(5, b(Re)),
|
1607
1607
|
Z(6, b(ae)),
|
1608
1608
|
Z(7, b(be)),
|
1609
|
-
Z(8, b(
|
1610
|
-
Z(9, b(
|
1609
|
+
Z(8, b(gn)),
|
1610
|
+
Z(9, b(co)),
|
1611
1611
|
Z(10, Jo(uo))
|
1612
1612
|
], Je);
|
1613
|
-
let
|
1613
|
+
let kn = class extends fn {
|
1614
1614
|
constructor(e, t, o, n, a, i, r) {
|
1615
1615
|
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();
|
1616
1616
|
}
|
1617
1617
|
_initViewModelIntercept() {
|
1618
1618
|
this.disposeWithMe(
|
1619
1619
|
this._sheetInterceptorService.intercept(
|
1620
|
-
|
1620
|
+
to.CELL_CONTENT,
|
1621
1621
|
{
|
1622
|
-
effect:
|
1622
|
+
effect: zn.Style,
|
1623
1623
|
// must be after numfmt
|
1624
|
-
priority:
|
1624
|
+
priority: no.DATA_VALIDATION,
|
1625
1625
|
// eslint-disable-next-line complexity
|
1626
1626
|
handler: (e, t, o) => {
|
1627
1627
|
var R, g, w, I, V;
|
@@ -1636,7 +1636,7 @@ let $n = class extends pn {
|
|
1636
1636
|
...e,
|
1637
1637
|
markers: {
|
1638
1638
|
...e == null ? void 0 : e.markers,
|
1639
|
-
...h === st.INVALID ?
|
1639
|
+
...h === st.INVALID ? Lo : null
|
1640
1640
|
},
|
1641
1641
|
customRender: [
|
1642
1642
|
...(g = e == null ? void 0 : e.customRender) != null ? g : [],
|
@@ -1656,13 +1656,13 @@ let $n = class extends pn {
|
|
1656
1656
|
}, n, a)
|
1657
1657
|
},
|
1658
1658
|
interceptorAutoHeight: () => {
|
1659
|
-
var M,
|
1660
|
-
const _ = (
|
1659
|
+
var M, L, U, T, E, A;
|
1660
|
+
const _ = (L = (M = this._renderManagerService.getRenderById(i)) == null ? void 0 : M.with(Dt).getSkeletonParam(r)) == null ? void 0 : L.skeleton;
|
1661
1661
|
if (!_)
|
1662
1662
|
return;
|
1663
1663
|
const S = _.worksheet.getMergedCell(n, a), m = {
|
1664
1664
|
data: e,
|
1665
|
-
style: _.
|
1665
|
+
style: _.getStyles().getStyleByCell(e),
|
1666
1666
|
primaryWithCoord: _.getCellWithCoordByIndex((U = S == null ? void 0 : S.startRow) != null ? U : n, (T = S == null ? void 0 : S.startColumn) != null ? T : a),
|
1667
1667
|
unitId: i,
|
1668
1668
|
subUnitId: r,
|
@@ -1682,7 +1682,7 @@ let $n = class extends pn {
|
|
1682
1682
|
}
|
1683
1683
|
_initAutoHeight() {
|
1684
1684
|
this._sheetDataValidationModel.ruleChange$.pipe(
|
1685
|
-
|
1685
|
+
In((e) => e.source === "command"),
|
1686
1686
|
mo(16)
|
1687
1687
|
).subscribe((e) => {
|
1688
1688
|
const t = [];
|
@@ -1691,25 +1691,25 @@ let $n = class extends pn {
|
|
1691
1691
|
(n = o.rule) != null && n.ranges && t.push(...o.rule.ranges);
|
1692
1692
|
}), t.length) {
|
1693
1693
|
const o = this._autoHeightController.getUndoRedoParamsOfAutoHeight(t);
|
1694
|
-
|
1694
|
+
Kn(o.redos, this._commandService);
|
1695
1695
|
}
|
1696
1696
|
});
|
1697
1697
|
}
|
1698
1698
|
};
|
1699
|
-
|
1699
|
+
kn = Po([
|
1700
1700
|
Z(0, ee),
|
1701
1701
|
Z(1, Ve),
|
1702
1702
|
Z(2, b(ho)),
|
1703
1703
|
Z(3, b(be)),
|
1704
|
-
Z(4, b(
|
1704
|
+
Z(4, b(gn)),
|
1705
1705
|
Z(5, b(ae)),
|
1706
|
-
Z(6, b(
|
1707
|
-
],
|
1706
|
+
Z(6, b(co))
|
1707
|
+
], kn);
|
1708
1708
|
var pr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, mr = (e, t, o, n) => {
|
1709
1709
|
for (var a = n > 1 ? void 0 : n ? fr(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
1710
1710
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
1711
1711
|
return n && a && pr(t, o, a), a;
|
1712
|
-
},
|
1712
|
+
}, Wn = (e, t) => (o, n) => t(o, n, e);
|
1713
1713
|
let yt = class extends De {
|
1714
1714
|
constructor(e, t, o) {
|
1715
1715
|
super(), this._context = e, this._sheetDataValidationModel = t, this._sheetSkeletonManagerService = o, this._initSkeletonChange();
|
@@ -1724,15 +1724,15 @@ let yt = class extends De {
|
|
1724
1724
|
o.add(a.subUnitId);
|
1725
1725
|
}), o.forEach((a) => {
|
1726
1726
|
var i;
|
1727
|
-
(i = this._sheetSkeletonManagerService.
|
1727
|
+
(i = this._sheetSkeletonManagerService.getSkeletonParam(a)) == null || i.skeleton.makeDirty(!0);
|
1728
1728
|
}), (n = this._context.mainComponent) == null || n.makeForceDirty();
|
1729
1729
|
};
|
1730
1730
|
this.disposeWithMe(this._sheetDataValidationModel.validStatusChange$.pipe(Qo(16)).subscribe(e));
|
1731
1731
|
}
|
1732
1732
|
};
|
1733
1733
|
yt = mr([
|
1734
|
-
|
1735
|
-
|
1734
|
+
Wn(1, b(ae)),
|
1735
|
+
Wn(2, b(Dt))
|
1736
1736
|
], yt);
|
1737
1737
|
const gr = "univer-data-validation-formula", vr = "univer-data-validation-formula-and", _r = "univer-data-validation-formula-list-item", Sr = "univer-data-validation-formula-list-item-icon", Cr = "univer-data-validation-formula-list-item-drag", Ir = "univer-data-validation-formula-list-add", wr = "univer-data-validation-formula-color-select", Rr = "univer-data-validation-formula-color-select-panel", Dr = "univer-data-validation-formula-color-item", oe = {
|
1738
1738
|
dataValidationFormula: gr,
|
@@ -1745,7 +1745,7 @@ const gr = "univer-data-validation-formula", vr = "univer-data-validation-formul
|
|
1745
1745
|
dataValidationFormulaColorSelectPanel: Rr,
|
1746
1746
|
dataValidationFormulaColorItem: Dr
|
1747
1747
|
}, Vr = (e) => {
|
1748
|
-
const { isTwoFormula: t = !1, value: o, onChange: n, showError: a, validResult: i } = e, r =
|
1748
|
+
const { isTwoFormula: t = !1, value: o, onChange: n, showError: a, validResult: i } = e, r = P(Q), l = a ? i == null ? void 0 : i.formula1 : "", s = a ? i == null ? void 0 : i.formula2 : "";
|
1749
1749
|
return t ? /* @__PURE__ */ x(we, { children: [
|
1750
1750
|
/* @__PURE__ */ f(q, { error: l, children: /* @__PURE__ */ f(
|
1751
1751
|
Ue,
|
@@ -1789,10 +1789,10 @@ const gr = "univer-data-validation-formula", vr = "univer-data-validation-formul
|
|
1789
1789
|
) });
|
1790
1790
|
};
|
1791
1791
|
function Mr(e) {
|
1792
|
-
const { value: t, onChange: o, showError: n, validResult: a } = e, i =
|
1792
|
+
const { value: t, onChange: o, showError: n, validResult: a } = e, i = P(Q), r = n ? a == null ? void 0 : a.formula1 : "", l = n ? a == null ? void 0 : a.formula2 : "", [s, c] = j(!((t == null ? void 0 : t.formula1) === void 0 && (t == null ? void 0 : t.formula2) === void 0));
|
1793
1793
|
return /* @__PURE__ */ x(we, { children: [
|
1794
1794
|
/* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
|
1795
|
-
|
1795
|
+
Pt,
|
1796
1796
|
{
|
1797
1797
|
checked: s,
|
1798
1798
|
onChange: (u) => {
|
@@ -1838,7 +1838,7 @@ function Mr(e) {
|
|
1838
1838
|
function yr(e) {
|
1839
1839
|
var h;
|
1840
1840
|
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 = ze({}), [c, u] = j(!1);
|
1841
|
-
return
|
1841
|
+
return Sn((d) => {
|
1842
1842
|
var p;
|
1843
1843
|
const v = (p = s.current) == null ? void 0 : p.handleOutClick;
|
1844
1844
|
v && v(d, () => u(!1));
|
@@ -1936,7 +1936,7 @@ const Er = [
|
|
1936
1936
|
) })
|
1937
1937
|
}
|
1938
1938
|
);
|
1939
|
-
},
|
1939
|
+
}, Hn = (e) => {
|
1940
1940
|
const { item: t, commonProps: o, style: n } = e, { onItemChange: a, onItemDelete: i } = o;
|
1941
1941
|
return /* @__PURE__ */ x("div", { className: oe.dataValidationFormulaListItem, style: n, children: [
|
1942
1942
|
t.isRef ? null : /* @__PURE__ */ f("div", { className: br(oe.dataValidationFormulaListItemDrag, "draggableHandle"), children: /* @__PURE__ */ f(Do, {}) }),
|
@@ -1959,12 +1959,12 @@ const Er = [
|
|
1959
1959
|
}
|
1960
1960
|
}
|
1961
1961
|
),
|
1962
|
-
t.isRef ? null : /* @__PURE__ */ f("div", { className: oe.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ f(
|
1962
|
+
t.isRef ? null : /* @__PURE__ */ f("div", { className: oe.dataValidationFormulaListItemIcon, children: /* @__PURE__ */ f(Rn, { onClick: () => i(t.id) }) })
|
1963
1963
|
] });
|
1964
1964
|
};
|
1965
|
-
function
|
1965
|
+
function Pr(e) {
|
1966
1966
|
const { value: t, onChange: o = () => {
|
1967
|
-
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = ze(null), [h, d] = j(() => Ae(s) ? "1" : "0"), [v, p] = j(h === "1" ? s : "="), [C, R] = j(h === "1" ? s : "="), g =
|
1967
|
+
}, unitId: n, subUnitId: a, validResult: i, showError: r, ruleId: l } = e, { formula1: s = "", formula2: c = "" } = t || {}, u = ze(null), [h, d] = j(() => Ae(s) ? "1" : "0"), [v, p] = j(h === "1" ? s : "="), [C, R] = j(h === "1" ? s : "="), g = P(Q), w = P(be), I = P(Tt), V = P(_a), [_, S] = j(() => c.split(",")), m = w.getValidatorItem(K.LIST), [M, L] = j([]), [U, T] = j(""), E = r ? i == null ? void 0 : i.formula1 : "", A = Ke(() => I.ruleChange$.pipe(wn(16)), []), F = ke(A), N = ln(o);
|
1968
1968
|
Ie(() => {
|
1969
1969
|
(async () => {
|
1970
1970
|
await new Promise((k) => {
|
@@ -1973,14 +1973,14 @@ function Lr(e) {
|
|
1973
1973
|
const D = I.getRuleById(n, a, l), $ = D == null ? void 0 : D.formula1;
|
1974
1974
|
if (Ae($) && m && D) {
|
1975
1975
|
const k = await m.getListAsync(D, n, a);
|
1976
|
-
|
1976
|
+
L(k);
|
1977
1977
|
}
|
1978
1978
|
})();
|
1979
1979
|
}, [I, F, m, l, a, n]), Ie(() => {
|
1980
1980
|
Ae(s) && s !== C && (p(s), R(C));
|
1981
1981
|
}, [C, s]);
|
1982
1982
|
const [B, Y] = j(() => {
|
1983
|
-
const D = h !== "1" ?
|
1983
|
+
const D = h !== "1" ? oo(s) : [], $ = c.split(",");
|
1984
1984
|
return D.map((k, W) => ({
|
1985
1985
|
label: k,
|
1986
1986
|
color: $[W] || Fe,
|
@@ -2030,11 +2030,11 @@ function Lr(e) {
|
|
2030
2030
|
}));
|
2031
2031
|
});
|
2032
2032
|
}), N({
|
2033
|
-
formula1:
|
2033
|
+
formula1: ao($.map((k) => k.label)),
|
2034
2034
|
formula2: $.map((k) => k.color === Fe ? "" : k.color).join(",")
|
2035
2035
|
});
|
2036
2036
|
}, [B, N, h, C, _]);
|
2037
|
-
const se =
|
2037
|
+
const se = ln(async (D) => {
|
2038
2038
|
if (!Ae(D)) {
|
2039
2039
|
N == null || N({
|
2040
2040
|
formula1: "",
|
@@ -2050,13 +2050,13 @@ function Lr(e) {
|
|
2050
2050
|
formula2: c
|
2051
2051
|
}), p("="), T(g.t("dataValidation.validFail.formulaError")));
|
2052
2052
|
}), ie = ze({}), [le, O] = j(!1);
|
2053
|
-
return
|
2053
|
+
return Sn((D) => {
|
2054
2054
|
var k;
|
2055
2055
|
const $ = (k = ie.current) == null ? void 0 : k.handleOutClick;
|
2056
2056
|
$ && $(D, () => O(!1));
|
2057
2057
|
}), /* @__PURE__ */ x(we, { children: [
|
2058
2058
|
/* @__PURE__ */ f(q, { label: g.t("dataValidation.list.options"), children: /* @__PURE__ */ x(
|
2059
|
-
|
2059
|
+
mn,
|
2060
2060
|
{
|
2061
2061
|
value: h,
|
2062
2062
|
onChange: (D) => {
|
@@ -2089,7 +2089,7 @@ function Lr(e) {
|
|
2089
2089
|
isSupportAcrossSheet: !0
|
2090
2090
|
}
|
2091
2091
|
),
|
2092
|
-
/* @__PURE__ */ f("div", { ref: u, style: { marginTop: "12px" }, children: J.map((D) => /* @__PURE__ */ f(
|
2092
|
+
/* @__PURE__ */ f("div", { ref: u, style: { marginTop: "12px" }, children: J.map((D) => /* @__PURE__ */ f(Hn, { item: D, commonProps: { onItemChange: te }, style: { marginBottom: 12 } }, D.id)) })
|
2093
2093
|
] }) : /* @__PURE__ */ f(q, { error: E, children: /* @__PURE__ */ x("div", { ref: u, style: { marginTop: "-12px" }, children: [
|
2094
2094
|
/* @__PURE__ */ f(
|
2095
2095
|
ia,
|
@@ -2100,7 +2100,7 @@ function Lr(e) {
|
|
2100
2100
|
margin: [0, 12],
|
2101
2101
|
draggableHandle: ".draggableHandle",
|
2102
2102
|
itemRender: (D) => /* @__PURE__ */ f(
|
2103
|
-
|
2103
|
+
Hn,
|
2104
2104
|
{
|
2105
2105
|
item: D,
|
2106
2106
|
commonProps: {
|
@@ -2120,7 +2120,7 @@ function Lr(e) {
|
|
2120
2120
|
] }) })
|
2121
2121
|
] });
|
2122
2122
|
}
|
2123
|
-
const Ao = "data-validation.custom-formula-input", Nt = "data-validation.formula-input",
|
2123
|
+
const Ao = "data-validation.custom-formula-input", Nt = "data-validation.formula-input", yn = "data-validation.list-formula-input", Fo = "data-validation.checkbox-formula-input", Lr = [
|
2124
2124
|
[
|
2125
2125
|
Ao,
|
2126
2126
|
yr
|
@@ -2130,8 +2130,8 @@ const Ao = "data-validation.custom-formula-input", Nt = "data-validation.formula
|
|
2130
2130
|
Vr
|
2131
2131
|
],
|
2132
2132
|
[
|
2133
|
-
|
2134
|
-
|
2133
|
+
yn,
|
2134
|
+
Pr
|
2135
2135
|
],
|
2136
2136
|
[
|
2137
2137
|
Fo,
|
@@ -2140,8 +2140,8 @@ const Ao = "data-validation.custom-formula-input", Nt = "data-validation.formula
|
|
2140
2140
|
], Tr = "LIST_RENDER_MODE_OPTION_INPUT";
|
2141
2141
|
function bt(e) {
|
2142
2142
|
var a;
|
2143
|
-
const { value: t, onChange: o } = e, n =
|
2144
|
-
return /* @__PURE__ */ f(q, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ x(
|
2143
|
+
const { value: t, onChange: o } = e, n = P(Q);
|
2144
|
+
return /* @__PURE__ */ f(q, { label: n.t("dataValidation.renderMode.label"), children: /* @__PURE__ */ x(mn, { value: `${(a = t.renderMode) != null ? a : ce.CUSTOM}`, onChange: (i) => o({ ...t, renderMode: +i }), children: [
|
2145
2145
|
/* @__PURE__ */ f(Ne, { value: `${ce.CUSTOM}`, children: n.t("dataValidation.renderMode.chip") }),
|
2146
2146
|
/* @__PURE__ */ f(Ne, { value: `${ce.ARROW}`, children: n.t("dataValidation.renderMode.arrow") }),
|
2147
2147
|
/* @__PURE__ */ f(Ne, { value: `${ce.TEXT}`, children: n.t("dataValidation.renderMode.text") })
|
@@ -2151,9 +2151,9 @@ bt.componentKey = Tr;
|
|
2151
2151
|
const Ar = "DATE_SHOW_TIME_OPTION";
|
2152
2152
|
function Et(e) {
|
2153
2153
|
var a;
|
2154
|
-
const { value: t, onChange: o } = e, n =
|
2154
|
+
const { value: t, onChange: o } = e, n = P(Q);
|
2155
2155
|
return /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
|
2156
|
-
|
2156
|
+
Pt,
|
2157
2157
|
{
|
2158
2158
|
checked: (a = t.bizInfo) == null ? void 0 : a.showTime,
|
2159
2159
|
onChange: (i) => {
|
@@ -2176,7 +2176,7 @@ var Fr = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, Ur = (e, t
|
|
2176
2176
|
return n && a && Fr(t, o, a), a;
|
2177
2177
|
}, it = (e, t) => (o, n) => t(o, n, e);
|
2178
2178
|
const pt = 6;
|
2179
|
-
let
|
2179
|
+
let dn = class {
|
2180
2180
|
constructor(e, t, o, n, a) {
|
2181
2181
|
this._commandService = e, this._formulaService = t, this._themeService = o, this._renderManagerService = n, this._dataValidationModel = a;
|
2182
2182
|
}
|
@@ -2225,7 +2225,7 @@ let ln = class {
|
|
2225
2225
|
}
|
2226
2226
|
async _parseFormula(e, t, o) {
|
2227
2227
|
var c, u, h, d, v, p, C, R, g;
|
2228
|
-
const { formula1: n = Ia, formula2: a = wa } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = Bt((h = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Bt((p = (v = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : v[0]) == null ? void 0 : p[0]), s =
|
2228
|
+
const { formula1: n = Ia, formula2: a = wa } = e, i = await this._formulaService.getRuleFormulaResult(t, o, e.uid), r = Bt((h = (u = (c = i == null ? void 0 : i[0]) == null ? void 0 : c.result) == null ? void 0 : u[0]) == null ? void 0 : h[0]), l = Bt((p = (v = (d = i == null ? void 0 : i[1]) == null ? void 0 : d.result) == null ? void 0 : v[0]) == null ? void 0 : p[0]), s = Pn(String(r)) && Pn(String(l));
|
2229
2229
|
return {
|
2230
2230
|
formula1: Ae(n) ? Bt((g = (R = (C = i == null ? void 0 : i[0]) == null ? void 0 : C.result) == null ? void 0 : R[0]) == null ? void 0 : g[0]) : n,
|
2231
2231
|
formula2: Ae(a) ? l : a,
|
@@ -2243,7 +2243,7 @@ let ln = class {
|
|
2243
2243
|
const v = this._themeService.getCurrentTheme();
|
2244
2244
|
if (!((E = d.skipDefaultFontRender) != null && E.call(d, h, u, { unitId: a, subUnitId: i, row: l, column: s })))
|
2245
2245
|
return;
|
2246
|
-
const p = d.parseFormulaSync(h, a, i), { formula1: C } = p, R = this._calc(c, o), { a: g, d: w } = e.getTransform(), I =
|
2246
|
+
const p = d.parseFormulaSync(h, a, i), { formula1: C } = p, R = this._calc(c, o), { a: g, d: w } = e.getTransform(), I = En(R.left, g), V = En(R.top, w), _ = ra.create().composeMatrix({
|
2247
2247
|
left: I,
|
2248
2248
|
top: V,
|
2249
2249
|
scaleX: 1,
|
@@ -2257,11 +2257,11 @@ let ln = class {
|
|
2257
2257
|
e.save(), e.beginPath(), e.rect(c.startX, c.startY, S, m), e.clip();
|
2258
2258
|
const M = _.getMatrix();
|
2259
2259
|
e.transform(M[0], M[1], M[2], M[3], M[4], M[5]);
|
2260
|
-
const
|
2260
|
+
const L = ((A = o == null ? void 0 : o.fs) != null ? A : 10) * 1.6, U = String(u) === String(C), T = v.hyacinth500;
|
2261
2261
|
sa.drawWith(e, {
|
2262
2262
|
checked: U,
|
2263
|
-
width:
|
2264
|
-
height:
|
2263
|
+
width: L,
|
2264
|
+
height: L,
|
2265
2265
|
fill: (N = (F = o == null ? void 0 : o.cl) == null ? void 0 : F.rgb) != null ? N : T
|
2266
2266
|
}), e.restore();
|
2267
2267
|
}
|
@@ -2292,7 +2292,7 @@ let ln = class {
|
|
2292
2292
|
}
|
2293
2293
|
};
|
2294
2294
|
this._commandService.executeCommand(
|
2295
|
-
|
2295
|
+
vn.id,
|
2296
2296
|
v
|
2297
2297
|
);
|
2298
2298
|
}
|
@@ -2305,13 +2305,13 @@ let ln = class {
|
|
2305
2305
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(X.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2306
2306
|
}
|
2307
2307
|
};
|
2308
|
-
|
2308
|
+
dn = Ur([
|
2309
2309
|
it(0, ee),
|
2310
2310
|
it(1, b(Sa)),
|
2311
2311
|
it(2, b(ea)),
|
2312
2312
|
it(3, b(Ve)),
|
2313
2313
|
it(4, b(ae))
|
2314
|
-
],
|
2314
|
+
], dn);
|
2315
2315
|
var Br = Object.defineProperty, $r = Object.getOwnPropertyDescriptor, kr = (e, t, o, n) => {
|
2316
2316
|
for (var a = n > 1 ? void 0 : n ? $r(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2317
2317
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
@@ -2322,7 +2322,7 @@ let ge = class {
|
|
2322
2322
|
y(this, "canvasRender", null);
|
2323
2323
|
y(this, "dropdown");
|
2324
2324
|
y(this, "optionsInput");
|
2325
|
-
y(this, "formulaInput",
|
2325
|
+
y(this, "formulaInput", yn);
|
2326
2326
|
this.injector = e;
|
2327
2327
|
}
|
2328
2328
|
};
|
@@ -2333,7 +2333,7 @@ class Hr extends ge {
|
|
2333
2333
|
constructor() {
|
2334
2334
|
super(...arguments);
|
2335
2335
|
y(this, "id", K.CHECKBOX);
|
2336
|
-
y(this, "canvasRender", this.injector.createInstance(
|
2336
|
+
y(this, "canvasRender", this.injector.createInstance(dn));
|
2337
2337
|
y(this, "formulaInput", Fo);
|
2338
2338
|
}
|
2339
2339
|
}
|
@@ -2361,7 +2361,7 @@ class Xr extends ge {
|
|
2361
2361
|
y(this, "formulaInput", Nt);
|
2362
2362
|
}
|
2363
2363
|
}
|
2364
|
-
const No = 4, zr = 0, jt = 4, Uo = 4,
|
2364
|
+
const No = 4, zr = 0, jt = 4, Uo = 4, cn = 6, Ot = 6, Te = 14;
|
2365
2365
|
function Kr(e, t) {
|
2366
2366
|
const o = la.getTextSize(e, t), n = o.width + No * 2, { ba: a, bd: i } = o, r = a + i;
|
2367
2367
|
return {
|
@@ -2371,7 +2371,7 @@ function Kr(e, t) {
|
|
2371
2371
|
};
|
2372
2372
|
}
|
2373
2373
|
function xt(e, t, o, n) {
|
2374
|
-
const a = Te +
|
2374
|
+
const a = Te + cn * 2, i = o - a, r = n - Ot * 2, l = e.map((d) => ({
|
2375
2375
|
layout: Kr(d, t),
|
2376
2376
|
text: d
|
2377
2377
|
}));
|
@@ -2407,7 +2407,7 @@ const Gr = 8;
|
|
2407
2407
|
class Zr extends da {
|
2408
2408
|
static drawWith(t, o) {
|
2409
2409
|
const { fontString: n, info: a, fill: i, color: r } = o, { layout: l, text: s } = a;
|
2410
|
-
t.save(),
|
2410
|
+
t.save(), qn.drawWith(t, {
|
2411
2411
|
width: l.width,
|
2412
2412
|
height: l.height,
|
2413
2413
|
radius: Gr,
|
@@ -2421,7 +2421,7 @@ var qr = Object.defineProperty, Jr = Object.getOwnPropertyDescriptor, Qr = (e, t
|
|
2421
2421
|
return n && a && qr(t, o, a), a;
|
2422
2422
|
}, Yt = (e, t) => (o, n) => t(o, n, e);
|
2423
2423
|
const es = new Path2D("M3.32201 4.84556C3.14417 5.05148 2.85583 5.05148 2.67799 4.84556L0.134292 1.90016C-0.152586 1.56798 0.0505937 1 0.456301 1L5.5437 1C5.94941 1 6.15259 1.56798 5.86571 1.90016L3.32201 4.84556Z");
|
2424
|
-
let
|
2424
|
+
let un = class {
|
2425
2425
|
constructor(e, t, o) {
|
2426
2426
|
y(this, "zIndex");
|
2427
2427
|
y(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
@@ -2461,8 +2461,8 @@ let cn = class {
|
|
2461
2461
|
endX: u.endX - v,
|
2462
2462
|
startY: u.startY + p,
|
2463
2463
|
endY: u.endY - C
|
2464
|
-
}, _ = V.endX - V.startX, S = V.endY - V.startY, { cl: m } = l || {}, M = (z = typeof m == "object" ? m == null ? void 0 : m.rgb : m) != null ? z : "#000",
|
2465
|
-
this._drawDownIcon(e, V, _, S, E), e.save(), e.translateWithPrecision(V.startX, V.startY), e.beginPath(), e.rect(0, 0, _ - Te, S), e.clip(), e.translateWithPrecision(
|
2464
|
+
}, _ = V.endX - V.startX, S = V.endY - V.startY, { cl: m } = l || {}, M = (z = typeof m == "object" ? m == null ? void 0 : m.rgb : m) != null ? z : "#000", L = Ut(l != null ? l : void 0), { vt: U, ht: T } = l || {}, E = U != null ? U : he.MIDDLE, A = (H = re(s)) != null ? H : "", F = I.parseCellValue(A), N = I.getListWithColorMap(w), B = xt(F, L, _, S);
|
2465
|
+
this._drawDownIcon(e, V, _, S, E), e.save(), e.translateWithPrecision(V.startX, V.startY), e.beginPath(), e.rect(0, 0, _ - Te, S), e.clip(), e.translateWithPrecision(cn, Ot);
|
2466
2466
|
let Y = 0;
|
2467
2467
|
switch (E) {
|
2468
2468
|
case he.MIDDLE:
|
@@ -2486,7 +2486,7 @@ let cn = class {
|
|
2486
2486
|
}
|
2487
2487
|
e.translate(ie, J * (ne + Uo)), se.forEach((le) => {
|
2488
2488
|
e.save(), e.translateWithPrecision(le.left, 0), Zr.drawWith(e, {
|
2489
|
-
...
|
2489
|
+
...L,
|
2490
2490
|
info: le,
|
2491
2491
|
color: M,
|
2492
2492
|
fill: N[le.text]
|
@@ -2495,7 +2495,7 @@ let cn = class {
|
|
2495
2495
|
}), e.restore(), R.set(g, {
|
2496
2496
|
left: V.startX,
|
2497
2497
|
top: V.startY,
|
2498
|
-
width: B.contentWidth +
|
2498
|
+
width: B.contentWidth + cn + Te,
|
2499
2499
|
height: B.contentHeight + Ot * 2
|
2500
2500
|
});
|
2501
2501
|
}
|
@@ -2555,17 +2555,17 @@ let cn = class {
|
|
2555
2555
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(X.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2556
2556
|
}
|
2557
2557
|
};
|
2558
|
-
|
2558
|
+
un = Qr([
|
2559
2559
|
Yt(0, ee),
|
2560
2560
|
Yt(1, b(Ve)),
|
2561
2561
|
Yt(2, b(ae))
|
2562
|
-
],
|
2562
|
+
], un);
|
2563
2563
|
class ts extends ge {
|
2564
2564
|
constructor() {
|
2565
2565
|
super(...arguments);
|
2566
2566
|
y(this, "id", K.LIST_MULTIPLE);
|
2567
|
-
y(this, "canvasRender", this.injector.createInstance(
|
2568
|
-
y(this, "dropdown",
|
2567
|
+
y(this, "canvasRender", this.injector.createInstance(un));
|
2568
|
+
y(this, "dropdown", Mn);
|
2569
2569
|
}
|
2570
2570
|
}
|
2571
2571
|
var ns = Object.defineProperty, os = Object.getOwnPropertyDescriptor, as = (e, t, o, n) => {
|
@@ -2573,7 +2573,7 @@ var ns = Object.defineProperty, os = Object.getOwnPropertyDescriptor, as = (e, t
|
|
2573
2573
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2574
2574
|
return n && a && ns(t, o, a), a;
|
2575
2575
|
}, ft = (e, t) => (o, n) => t(o, n, e);
|
2576
|
-
const
|
2576
|
+
const Le = 4, mt = 4, pe = 14, fe = 6, xe = 4, Xt = 8, is = "#565656", jn = 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");
|
2577
2577
|
function rs(e, t) {
|
2578
2578
|
const o = e.length;
|
2579
2579
|
return {
|
@@ -2638,7 +2638,7 @@ function gt(e, t, o) {
|
|
2638
2638
|
docViewModel: i
|
2639
2639
|
};
|
2640
2640
|
}
|
2641
|
-
function
|
2641
|
+
function xn(e, t, o, n, a, i, r = !0) {
|
2642
2642
|
let l = 0;
|
2643
2643
|
const s = r ? xe : 0;
|
2644
2644
|
switch (a) {
|
@@ -2667,7 +2667,7 @@ function jn(e, t, o, n, a, i, r = !0) {
|
|
2667
2667
|
paddingTop: l
|
2668
2668
|
};
|
2669
2669
|
}
|
2670
|
-
let
|
2670
|
+
let hn = class {
|
2671
2671
|
constructor(e, t, o, n) {
|
2672
2672
|
y(this, "_dropdownInfoMap", /* @__PURE__ */ new Map());
|
2673
2673
|
y(this, "zIndex");
|
@@ -2694,7 +2694,7 @@ let un = class {
|
|
2694
2694
|
u = l + xe + (a / 2 - mt / 2);
|
2695
2695
|
break;
|
2696
2696
|
}
|
2697
|
-
e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(
|
2697
|
+
e.save(), e.translateWithPrecision(t.startX + c, t.startY + u), e.fillStyle = "#565656", e.fill(jn), e.restore();
|
2698
2698
|
}
|
2699
2699
|
// eslint-disable-next-line max-lines-per-function, complexity
|
2700
2700
|
drawWith(e, t, o) {
|
@@ -2712,13 +2712,13 @@ let un = class {
|
|
2712
2712
|
endX: c.endX - p,
|
2713
2713
|
startY: c.startY + C,
|
2714
2714
|
endY: c.endY - R
|
2715
|
-
}, w = g.endX - g.startX, I = g.endY - g.startY, V = this._ensureMap(s), _ = this._generateKey(a, i), S = h.getListWithColor(u), m = re(l), M = `${m != null ? m : ""}`,
|
2715
|
+
}, w = g.endX - g.startX, I = g.endY - g.startY, V = this._ensureMap(s), _ = this._generateKey(a, i), S = h.getListWithColor(u), m = re(l), M = `${m != null ? m : ""}`, L = S.find((F) => F.label === M);
|
2716
2716
|
let { tb: U, vt: T, ht: E, pd: A } = r || {};
|
2717
2717
|
if (U = U != null ? U : Ce.WRAP, T = T != null ? T : he.BOTTOM, E = E != null ? E : de.ht, A = A != null ? A : de.pd, u.renderMode === ce.ARROW) {
|
2718
2718
|
const { l: F = de.pd.l, t: N = de.pd.t, r: B = de.pd.r, b: Y = de.pd.b } = A, z = w - F - B - pe - 4, { documentSkeleton: H, documents: G, docModel: J } = gt(M, this._localeService, r);
|
2719
2719
|
U === Ce.WRAP && J.updateDocumentDataPageSize(Math.max(z, 1)), H.calculate(), H.getActualSize();
|
2720
|
-
const te = nt(H), { height: ne, width: se } = te, { paddingTop: ie, paddingLeft: le } =
|
2721
|
-
this._drawDownIcon(e, g, w, I, ne, T, A), e.save(), e.translateWithPrecision(g.startX + F, g.startY + N), e.beginPath(), e.rect(0, 0, w - F - B, I - N - Y), e.clip(), e.translateWithPrecision(0, ie), e.save(), e.translateWithPrecision(
|
2720
|
+
const te = nt(H), { height: ne, width: se } = te, { paddingTop: ie, paddingLeft: le } = xn(z, I - N - Y, se, ne, T, E, !0);
|
2721
|
+
this._drawDownIcon(e, g, w, I, ne, T, A), e.save(), e.translateWithPrecision(g.startX + F, g.startY + N), e.beginPath(), e.rect(0, 0, w - F - B, I - N - Y), e.clip(), e.translateWithPrecision(0, ie), e.save(), e.translateWithPrecision(Le, 0), e.beginPath(), e.rect(0, 0, z, ne), e.clip(), G.render(e), e.translateWithPrecision(le, 0), e.restore(), e.restore(), V.set(_, {
|
2722
2722
|
left: g.endX + F + o.rowHeaderWidth - pe,
|
2723
2723
|
top: g.startY + N + o.columnHeaderHeight,
|
2724
2724
|
width: pe,
|
@@ -2726,17 +2726,17 @@ let un = class {
|
|
2726
2726
|
});
|
2727
2727
|
} else {
|
2728
2728
|
e.save(), e.translateWithPrecision(g.startX, g.startY), e.beginPath(), e.rect(0, 0, w, I), e.clip();
|
2729
|
-
const F = w - fe * 2 -
|
2729
|
+
const F = w - fe * 2 - Le - pe - 4, { documentSkeleton: N, documents: B, docModel: Y } = gt(M, this._localeService, r);
|
2730
2730
|
U === Ce.WRAP && Y.updateDocumentDataPageSize(Math.max(F, 1)), N.calculate();
|
2731
|
-
const z = nt(N), { height: H, width: G } = z, { paddingTop: J, paddingLeft: te } =
|
2731
|
+
const z = nt(N), { height: H, width: G } = z, { paddingTop: J, paddingLeft: te } = xn(F, I, G, H, T, E);
|
2732
2732
|
e.translateWithPrecision(fe, J);
|
2733
2733
|
const ne = Math.max(w - fe * 2, 1), se = H;
|
2734
|
-
|
2734
|
+
qn.drawWith(e, {
|
2735
2735
|
width: ne,
|
2736
2736
|
height: se,
|
2737
|
-
fill: (
|
2737
|
+
fill: (L == null ? void 0 : L.color) || Fe,
|
2738
2738
|
radius: Xt
|
2739
|
-
}), e.save(), e.translateWithPrecision(
|
2739
|
+
}), e.save(), e.translateWithPrecision(Le, 0), e.beginPath(), e.rect(0, 0, F, H), e.clip(), e.translateWithPrecision(te, 0), B.render(e), e.restore(), e.translateWithPrecision(F + Le + 4, (H - mt) / 2), e.fillStyle = is, e.fill(jn), e.restore(), V.set(_, {
|
2740
2740
|
left: g.startX + fe + o.rowHeaderWidth,
|
2741
2741
|
top: g.startY + J + o.columnHeaderHeight,
|
2742
2742
|
width: ne,
|
@@ -2759,15 +2759,15 @@ let un = class {
|
|
2759
2759
|
if (g = g != null ? g : Ce.WRAP, d.renderMode === ce.ARROW) {
|
2760
2760
|
const _ = p - pe, { documentSkeleton: S, docModel: m } = gt(R, this._localeService, o);
|
2761
2761
|
g === Ce.WRAP && m.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate(), S.getActualSize();
|
2762
|
-
const M = nt(S), { height:
|
2763
|
-
return
|
2762
|
+
const M = nt(S), { height: L } = M;
|
2763
|
+
return L + I + V + xe * 2;
|
2764
2764
|
} else {
|
2765
|
-
const _ = p - fe * 2 -
|
2765
|
+
const _ = p - fe * 2 - Le - pe, { documentSkeleton: S, docModel: m } = Bo(R, this._localeService, o);
|
2766
2766
|
g === Ce.WRAP && m.updateDocumentDataPageSize(Math.max(_, 1)), S.calculate();
|
2767
2767
|
const M = nt(S), {
|
2768
|
-
height:
|
2768
|
+
height: L
|
2769
2769
|
} = M;
|
2770
|
-
return
|
2770
|
+
return L + xe * 2;
|
2771
2771
|
}
|
2772
2772
|
}
|
2773
2773
|
calcCellAutoWidth(e) {
|
@@ -2789,11 +2789,11 @@ let un = class {
|
|
2789
2789
|
_ = pe + fe * 2 + V + I;
|
2790
2790
|
break;
|
2791
2791
|
case ce.CUSTOM:
|
2792
|
-
_ = pe + fe * 2 +
|
2792
|
+
_ = pe + fe * 2 + Le * 2 + V + I + Xt / 2 + 1;
|
2793
2793
|
break;
|
2794
2794
|
// default is CUSTOM
|
2795
2795
|
default:
|
2796
|
-
_ = pe + fe * 2 +
|
2796
|
+
_ = pe + fe * 2 + Le * 2 + V + I + Xt / 2 + 1;
|
2797
2797
|
}
|
2798
2798
|
const S = p - _, { documentSkeleton: m, docModel: M } = gt(R, this._localeService, o);
|
2799
2799
|
return g === Ce.WRAP && M.updateDocumentDataPageSize(Math.max(S, 1)), m.calculate(), m.getActualSize(), nt(m).width + _;
|
@@ -2825,20 +2825,20 @@ let un = class {
|
|
2825
2825
|
(n = (o = this._renderManagerService.getCurrentTypeOfRenderer(X.UNIVER_SHEET)) == null ? void 0 : o.mainComponent) == null || n.setCursor(Xe.DEFAULT);
|
2826
2826
|
}
|
2827
2827
|
};
|
2828
|
-
|
2828
|
+
hn = as([
|
2829
2829
|
ft(0, b(Q)),
|
2830
2830
|
ft(1, ee),
|
2831
2831
|
ft(2, b(Ve)),
|
2832
2832
|
ft(3, b(ae))
|
2833
|
-
],
|
2833
|
+
], hn);
|
2834
2834
|
class ss extends ge {
|
2835
2835
|
constructor() {
|
2836
2836
|
super(...arguments);
|
2837
2837
|
y(this, "id", K.LIST);
|
2838
|
-
y(this, "canvasRender", this.injector.createInstance(
|
2839
|
-
y(this, "dropdown",
|
2838
|
+
y(this, "canvasRender", this.injector.createInstance(hn));
|
2839
|
+
y(this, "dropdown", Mn);
|
2840
2840
|
y(this, "optionsInput", bt.componentKey);
|
2841
|
-
y(this, "formulaInput",
|
2841
|
+
y(this, "formulaInput", yn);
|
2842
2842
|
}
|
2843
2843
|
}
|
2844
2844
|
class ls extends ge {
|
@@ -2860,7 +2860,7 @@ var cs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, hs = (e, t
|
|
2860
2860
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
2861
2861
|
return n && a && cs(t, o, a), a;
|
2862
2862
|
}, zt = (e, t) => (o, n) => t(o, n, e);
|
2863
|
-
let Qe = class extends
|
2863
|
+
let Qe = class extends fn {
|
2864
2864
|
constructor(e, t, o) {
|
2865
2865
|
super(), this._injector = e, this._componentManger = t, this._dataValidatorRegistryService = o, this._initComponents(), this._registerValidatorViews();
|
2866
2866
|
}
|
@@ -2869,11 +2869,11 @@ let Qe = class extends pn {
|
|
2869
2869
|
[Eo, Co],
|
2870
2870
|
[Vt, Ki],
|
2871
2871
|
[Vo, pi],
|
2872
|
-
[
|
2872
|
+
[Mn, yi],
|
2873
2873
|
[bo, Ja],
|
2874
2874
|
[bt.componentKey, bt],
|
2875
2875
|
[Et.componentKey, Et],
|
2876
|
-
...
|
2876
|
+
...Lr
|
2877
2877
|
].forEach(([e, t]) => {
|
2878
2878
|
this.disposeWithMe(this._componentManger.register(
|
2879
2879
|
e,
|
@@ -2899,7 +2899,7 @@ let Qe = class extends pn {
|
|
2899
2899
|
};
|
2900
2900
|
Qe = hs([
|
2901
2901
|
zt(0, b($e)),
|
2902
|
-
zt(1, b(
|
2902
|
+
zt(1, b(Lt)),
|
2903
2903
|
zt(2, b(be))
|
2904
2904
|
], Qe);
|
2905
2905
|
var ps = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, ms = (e, t, o, n) => {
|
@@ -2909,15 +2909,15 @@ var ps = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, ms = (e, t
|
|
2909
2909
|
}, Kt = (e, t) => (o, n) => t(o, n, e);
|
2910
2910
|
const gs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2911
2911
|
var vt;
|
2912
|
-
let
|
2912
|
+
let Yn = (vt = class extends Gn {
|
2913
2913
|
constructor(e = Mt, t, o, n) {
|
2914
2914
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
2915
|
-
const { menu: a, ...i } =
|
2915
|
+
const { menu: a, ...i } = Zn(
|
2916
2916
|
{},
|
2917
2917
|
Mt,
|
2918
2918
|
this._config
|
2919
2919
|
);
|
2920
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
2920
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
2921
2921
|
}
|
2922
2922
|
onStarting() {
|
2923
2923
|
[
|
@@ -2936,7 +2936,7 @@ let xn = (vt = class extends Kn {
|
|
2936
2936
|
Ft,
|
2937
2937
|
At,
|
2938
2938
|
yo,
|
2939
|
-
|
2939
|
+
Dn,
|
2940
2940
|
We,
|
2941
2941
|
Mo
|
2942
2942
|
].forEach((e) => {
|
@@ -2956,11 +2956,11 @@ let xn = (vt = class extends Kn {
|
|
2956
2956
|
this._injector.get(Ge);
|
2957
2957
|
}
|
2958
2958
|
}, y(vt, "pluginName", gs), y(vt, "type", X.UNIVER_SHEET), vt);
|
2959
|
-
|
2959
|
+
Yn = ms([
|
2960
2960
|
Kt(1, b($e)),
|
2961
2961
|
Kt(2, ee),
|
2962
|
-
Kt(3,
|
2963
|
-
],
|
2962
|
+
Kt(3, pn)
|
2963
|
+
], Yn);
|
2964
2964
|
var vs = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, Ss = (e, t, o, n) => {
|
2965
2965
|
for (var a = n > 1 ? void 0 : n ? _s(t, o) : t, i = e.length - 1, r; i >= 0; i--)
|
2966
2966
|
(r = e[i]) && (a = (n ? r(t, o, a) : r(a)) || a);
|
@@ -2968,15 +2968,15 @@ var vs = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, Ss = (e, t
|
|
2968
2968
|
}, Gt = (e, t) => (o, n) => t(o, n, e);
|
2969
2969
|
const Cs = "SHEET_DATA_VALIDATION_UI_PLUGIN";
|
2970
2970
|
var _t;
|
2971
|
-
let
|
2971
|
+
let Xn = (_t = class extends Gn {
|
2972
2972
|
constructor(e = Mt, t, o, n) {
|
2973
2973
|
super(), this._config = e, this._injector = t, this._commandService = o, this._configService = n;
|
2974
|
-
const { menu: a, ...i } =
|
2974
|
+
const { menu: a, ...i } = Zn(
|
2975
2975
|
{},
|
2976
2976
|
Mt,
|
2977
2977
|
this._config
|
2978
2978
|
);
|
2979
|
-
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(
|
2979
|
+
a && this._configService.setConfig("menu", a, { merge: !0 }), this._configService.setConfig(Vn, i);
|
2980
2980
|
}
|
2981
2981
|
onStarting() {
|
2982
2982
|
[
|
@@ -2994,7 +2994,7 @@ let Yn = (_t = class extends Kn {
|
|
2994
2994
|
Ft,
|
2995
2995
|
At,
|
2996
2996
|
yo,
|
2997
|
-
|
2997
|
+
Dn,
|
2998
2998
|
We,
|
2999
2999
|
Mo
|
3000
3000
|
].forEach((e) => {
|
@@ -3014,14 +3014,14 @@ let Yn = (_t = class extends Kn {
|
|
3014
3014
|
this._injector.get(Ge);
|
3015
3015
|
}
|
3016
3016
|
}, y(_t, "pluginName", Cs), y(_t, "type", X.UNIVER_SHEET), _t);
|
3017
|
-
|
3017
|
+
Xn = Ss([
|
3018
3018
|
Gt(1, b($e)),
|
3019
3019
|
Gt(2, ee),
|
3020
|
-
Gt(3,
|
3021
|
-
],
|
3020
|
+
Gt(3, pn)
|
3021
|
+
], Xn);
|
3022
3022
|
export {
|
3023
3023
|
bo as DATE_DROPDOWN_KEY,
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3024
|
+
Mn as LIST_DROPDOWN_KEY,
|
3025
|
+
Xn as UniverSheetsDataValidationMobileUIPlugin,
|
3026
|
+
Yn as UniverSheetsDataValidationUIPlugin
|
3027
3027
|
};
|