@univerjs/sheets-data-validation-ui 0.6.10 → 0.7.0-beta.1

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