@univerjs/data-validation 0.1.6 → 0.1.8

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,237 +1,313 @@
1
- var P = Object.defineProperty;
2
- var q = (e, a, t) => a in e ? P(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
3
- var c = (e, a, t) => (q(e, typeof a != "symbol" ? a + "" : a, t), t);
4
- import { toDisposable as G, Disposable as U, ILogService as H, CommandType as m, Tools as L, DataValidationType as Q, DataValidationOperator as s, ICommandService as T, IUndoRedoService as M, Plugin as W, LocaleService as j, DataValidationStatus as F } from "@univerjs/core";
5
- import { Inject as I, Injector as B } from "@wendellhu/redi";
6
- import { BehaviorSubject as J, Subject as S, debounceTime as A } from "rxjs";
7
- import { SelectionManagerService as z } from "@univerjs/sheets";
8
- var K = /* @__PURE__ */ ((e) => (e.SHEET = "sheet", e))(K || {});
9
- class b {
1
+ var X = Object.defineProperty;
2
+ var Y = (a, e, t) => e in a ? X(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var c = (a, e, t) => (Y(a, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { toDisposable as Z, Tools as H, DataValidationType as k, DataValidationOperator as s, Disposable as N, DataValidationStatus as ee, ILogService as te, CommandType as m, ICommandService as M, IUndoRedoService as S, UniverInstanceType as w, OnLifecycle as q, LifecycleStages as G, IResourceManagerService as ae, IUniverInstanceService as Q, Plugin as re, LocaleService as ne } from "@univerjs/core";
5
+ import { Inject as E, Injector as W } from "@wendellhu/redi";
6
+ import { BehaviorSubject as oe, Subject as U, debounceTime as D } from "rxjs";
7
+ import { SelectionManagerService as ie, RemoveSheetCommand as se, SheetInterceptorService as de } from "@univerjs/sheets";
8
+ var le = /* @__PURE__ */ ((a) => (a.SHEET = "sheet", a))(le || {});
9
+ class j {
10
10
  constructor() {
11
11
  c(this, "_validatorByScopes", /* @__PURE__ */ new Map());
12
12
  c(this, "_validatorMap", /* @__PURE__ */ new Map());
13
- c(this, "_validatorsChange$", new J(void 0));
13
+ c(this, "_validatorsChange$", new oe(void 0));
14
14
  c(this, "validatorsChange$", this._validatorsChange$.asObservable());
15
15
  }
16
- _addValidatorToScope(a, t) {
16
+ _addValidatorToScope(e, t) {
17
17
  this._validatorByScopes.has(t) || this._validatorByScopes.set(t, []);
18
18
  const r = this._validatorByScopes.get(t);
19
- if (r.findIndex((o) => o.id === a.id) > -1)
20
- throw new Error(`Validator item with the same id ${a.id} has already been added!`);
21
- r.push(a);
19
+ if (r.findIndex((n) => n.id === e.id) > -1)
20
+ throw new Error(`Validator item with the same id ${e.id} has already been added!`);
21
+ r.push(e);
22
22
  }
23
- _removeValidatorFromScope(a, t) {
23
+ _removeValidatorFromScope(e, t) {
24
24
  const r = this._validatorByScopes.get(t);
25
25
  if (!r)
26
26
  return;
27
- const o = r.findIndex((n) => n.id === a.id);
28
- o > -1 && r.splice(o, 1);
29
- }
30
- register(a) {
31
- return this._validatorMap.set(a.id, a), Array.isArray(a.scopes) ? a.scopes.forEach((t) => {
32
- this._addValidatorToScope(a, t);
33
- }) : this._addValidatorToScope(a, a.scopes), this._validatorsChange$.next(), G(() => {
34
- this._validatorMap.delete(a.id), Array.isArray(a.scopes) ? a.scopes.forEach((t) => {
35
- this._removeValidatorFromScope(a, t);
36
- }) : this._removeValidatorFromScope(a, a.scopes), this._validatorsChange$.next();
27
+ const n = r.findIndex((o) => o.id === e.id);
28
+ n > -1 && r.splice(n, 1);
29
+ }
30
+ register(e) {
31
+ return this._validatorMap.set(e.id, e), Array.isArray(e.scopes) ? e.scopes.forEach((t) => {
32
+ this._addValidatorToScope(e, t);
33
+ }) : this._addValidatorToScope(e, e.scopes), this._validatorsChange$.next(), Z(() => {
34
+ this._validatorMap.delete(e.id), Array.isArray(e.scopes) ? e.scopes.forEach((t) => {
35
+ this._removeValidatorFromScope(e, t);
36
+ }) : this._removeValidatorFromScope(e, e.scopes), this._validatorsChange$.next();
37
37
  });
38
38
  }
39
- getValidatorItem(a) {
40
- return this._validatorMap.get(a);
39
+ getValidatorItem(e) {
40
+ return this._validatorMap.get(e);
41
41
  }
42
- getValidatorsByScope(a) {
43
- return this._validatorByScopes.get(a);
42
+ getValidatorsByScope(e) {
43
+ return this._validatorByScopes.get(e);
44
44
  }
45
45
  }
46
- var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, Z = (e, a, t, r) => {
47
- for (var o = r > 1 ? void 0 : r ? Y(a, t) : a, n = e.length - 1, i; n >= 0; n--)
48
- (i = e[n]) && (o = (r ? i(a, t, o) : i(o)) || o);
49
- return r && o && X(a, t, o), o;
50
- }, k = (e, a) => (t, r) => a(t, r, e);
51
- let h = class extends U {
52
- constructor(a) {
46
+ var _ = /* @__PURE__ */ ((a) => (a[a.SETTING = 0] = "SETTING", a[a.RANGE = 1] = "RANGE", a[a.OPTIONS = 2] = "OPTIONS", a))(_ || {});
47
+ function F(a) {
48
+ return {
49
+ type: a.type,
50
+ operator: a.operator,
51
+ formula1: a.formula1,
52
+ formula2: a.formula2,
53
+ allowBlank: a.allowBlank
54
+ };
55
+ }
56
+ function J(a) {
57
+ return {
58
+ error: a.error,
59
+ errorStyle: a.errorStyle,
60
+ errorTitle: a.errorTitle,
61
+ imeMode: a.imeMode,
62
+ prompt: a.prompt,
63
+ promptTitle: a.promptTitle,
64
+ showDropDown: a.showDropDown,
65
+ showErrorMessage: a.showErrorMessage,
66
+ showInputMessage: a.showInputMessage,
67
+ renderMode: a.renderMode
68
+ };
69
+ }
70
+ function Ge(a) {
71
+ const t = a.get(ie).getSelectionRanges();
72
+ return {
73
+ uid: H.generateRandomId(6),
74
+ type: k.DECIMAL,
75
+ operator: s.EQUAL,
76
+ formula1: "100",
77
+ ranges: t != null ? t : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
78
+ };
79
+ }
80
+ class ue extends N {
81
+ constructor(t, r, n) {
82
+ super();
83
+ c(this, "_dataValidations");
84
+ c(this, "_dataValidationMap", /* @__PURE__ */ new Map());
85
+ c(this, "_dataValidations$", new U());
86
+ c(this, "unitId");
87
+ c(this, "subUnitId");
88
+ c(this, "dataValidations$", this._dataValidations$.asObservable());
89
+ this.unitId = t, this.subUnitId = r, n && (this._insertRules(n), this._notice(), this.disposeWithMe({
90
+ dispose: () => {
91
+ this._dataValidations$.complete();
92
+ }
93
+ }));
94
+ }
95
+ _notice() {
96
+ this._dataValidations$.next(this._dataValidations);
97
+ }
98
+ _insertRules(t) {
99
+ this._dataValidations = t, t.forEach((r) => {
100
+ this._dataValidationMap.set(r.uid, r);
101
+ });
102
+ }
103
+ getRuleById(t) {
104
+ return this._dataValidationMap.get(t);
105
+ }
106
+ getRuleIndex(t) {
107
+ return this._dataValidations.findIndex((r) => r.uid === t);
108
+ }
109
+ addRule(t, r) {
110
+ const o = (Array.isArray(t) ? t : [t]).filter((i) => !this._dataValidationMap.has(i.uid));
111
+ typeof r == "number" && r < this._dataValidations.length ? this._dataValidations.splice(r, 0, ...o) : this._dataValidations.push(...o), o.forEach((i) => {
112
+ this._dataValidationMap.set(i.uid, i);
113
+ }), this._notice();
114
+ }
115
+ removeRule(t) {
116
+ const r = this._dataValidations.findIndex((n) => n.uid === t);
117
+ r > -1 && (this._dataValidations.splice(r, 1), this._dataValidationMap.delete(t), this._notice());
118
+ }
119
+ updateRule(t, r) {
120
+ const n = this._dataValidationMap.get(t), o = this._dataValidations.findIndex((d) => t === d.uid);
121
+ if (!n)
122
+ throw new Error(`Data validation rule is not found, ruleId: ${t}.`);
123
+ const i = { ...n };
124
+ switch (r.type) {
125
+ case _.RANGE: {
126
+ i.ranges = r.payload;
127
+ break;
128
+ }
129
+ case _.SETTING: {
130
+ Object.assign(i, F(r.payload));
131
+ break;
132
+ }
133
+ case _.OPTIONS: {
134
+ Object.assign(i, J(r.payload));
135
+ break;
136
+ }
137
+ }
138
+ return this._dataValidations[o] = i, this._dataValidationMap.set(t, i), this._notice(), i;
139
+ }
140
+ getDataValidations() {
141
+ return this._dataValidations;
142
+ }
143
+ toJSON() {
144
+ return this._dataValidations;
145
+ }
146
+ validator(t, r, n, o) {
147
+ return ee.VALID;
148
+ }
149
+ }
150
+ var ce = Object.defineProperty, he = Object.getOwnPropertyDescriptor, pe = (a, e, t, r) => {
151
+ for (var n = r > 1 ? void 0 : r ? he(e, t) : e, o = a.length - 1, i; o >= 0; o--)
152
+ (i = a[o]) && (n = (r ? i(e, t, n) : i(n)) || n);
153
+ return r && n && ce(e, t, n), n;
154
+ }, _e = (a, e) => (t, r) => e(t, r, a);
155
+ let h = class extends N {
156
+ constructor(e) {
53
157
  super();
54
158
  c(this, "_model", /* @__PURE__ */ new Map());
55
- c(this, "_managerCreator");
56
- c(this, "_ruleChange$", new S());
57
- c(this, "_validStatusChange$", new S());
159
+ c(this, "_managerCreator", (e, t) => new ue(e, t, []));
160
+ c(this, "_ruleChange$", new U());
161
+ c(this, "_validStatusChange$", new U());
58
162
  c(this, "ruleChange$", this._ruleChange$.asObservable());
59
- c(this, "ruleChangeDebounce$", this.ruleChange$.pipe(A(20)));
60
- c(this, "validStatusChange$", this._validStatusChange$.asObservable().pipe(A(20)));
61
- this._logService = a, this.disposeWithMe({
163
+ c(this, "ruleChangeDebounce$", this.ruleChange$.pipe(D(20)));
164
+ c(this, "validStatusChange$", this._validStatusChange$.asObservable().pipe(D(20)));
165
+ this._logService = e, this.disposeWithMe({
62
166
  dispose: () => {
63
167
  this._ruleChange$.complete(), this._validStatusChange$.complete();
64
168
  }
65
169
  });
66
170
  }
67
- setManagerCreator(a) {
68
- this._managerCreator = a;
171
+ setManagerCreator(e) {
172
+ this._managerCreator = e;
69
173
  }
70
- ensureManager(a, t) {
71
- this._model.has(a) || this._model.set(a, /* @__PURE__ */ new Map());
72
- const r = this._model.get(a);
174
+ ensureManager(e, t) {
175
+ this._model.has(e) || this._model.set(e, /* @__PURE__ */ new Map());
176
+ const r = this._model.get(e);
73
177
  if (r.has(t))
74
178
  return r.get(t);
75
- const o = this._managerCreator(a, t);
76
- return r.set(t, o), o;
179
+ const n = this._managerCreator(e, t);
180
+ return r.set(t, n), n;
181
+ }
182
+ _addRuleSideEffect(e, t, r) {
183
+ this.ensureManager(e, t).getRuleById(r.uid) || this._ruleChange$.next({
184
+ rule: r,
185
+ type: "add",
186
+ unitId: e,
187
+ subUnitId: t
188
+ });
77
189
  }
78
- addRule(a, t, r, o) {
190
+ addRule(e, t, r, n) {
79
191
  try {
80
- this.ensureManager(a, t).addRule(r, o), this._ruleChange$.next({
81
- rule: r,
82
- type: "add",
83
- unitId: a,
84
- subUnitId: t
85
- });
86
- } catch (n) {
87
- this._logService.error(n);
192
+ const o = this.ensureManager(e, t);
193
+ (Array.isArray(r) ? r : [r]).forEach((d) => {
194
+ this._addRuleSideEffect(e, t, d);
195
+ }), o.addRule(r, n);
196
+ } catch (o) {
197
+ this._logService.error(o);
88
198
  }
89
199
  }
90
- updateRule(a, t, r, o) {
200
+ updateRule(e, t, r, n) {
91
201
  try {
92
- const i = this.ensureManager(a, t).updateRule(r, o);
202
+ const i = this.ensureManager(e, t).updateRule(r, n);
93
203
  this._ruleChange$.next({
94
204
  rule: i,
95
205
  type: "update",
96
- unitId: a,
206
+ unitId: e,
97
207
  subUnitId: t
98
208
  });
99
- } catch (n) {
100
- this._logService.error(n);
209
+ } catch (o) {
210
+ this._logService.error(o);
101
211
  }
102
212
  }
103
- removeRule(a, t, r) {
213
+ removeRule(e, t, r) {
104
214
  try {
105
- const o = this.ensureManager(a, t), n = o.getRuleById(r);
106
- o.removeRule(r), this._ruleChange$.next({
107
- rule: n,
215
+ const n = this.ensureManager(e, t), o = n.getRuleById(r);
216
+ o && (n.removeRule(r), this._ruleChange$.next({
217
+ rule: o,
108
218
  type: "remove",
109
- unitId: a,
219
+ unitId: e,
110
220
  subUnitId: t
111
- });
112
- } catch (o) {
113
- this._logService.error(o);
221
+ }));
222
+ } catch (n) {
223
+ this._logService.error(n);
114
224
  }
115
225
  }
116
- getRuleById(a, t, r) {
117
- return this.ensureManager(a, t).getRuleById(r);
226
+ getRuleById(e, t, r) {
227
+ return this.ensureManager(e, t).getRuleById(r);
118
228
  }
119
- getRuleIndex(a, t, r) {
120
- return this.ensureManager(a, t).getRuleIndex(r);
229
+ getRuleIndex(e, t, r) {
230
+ return this.ensureManager(e, t).getRuleIndex(r);
121
231
  }
122
- getRules(a, t) {
123
- return this.ensureManager(a, t).getDataValidations();
232
+ getRules(e, t) {
233
+ return this.ensureManager(e, t).getDataValidations();
124
234
  }
125
- validator(a, t, r) {
126
- const { unitId: o, subUnitId: n } = r;
127
- return this.ensureManager(o, n).validator(a, t, r, (d) => {
235
+ validator(e, t, r) {
236
+ const { unitId: n, subUnitId: o } = r;
237
+ return this.ensureManager(n, o).validator(e, t, r, (d) => {
128
238
  this._validStatusChange$.next({
129
- unitId: o,
130
- subUnitId: n,
239
+ unitId: n,
240
+ subUnitId: o,
131
241
  ruleId: t.uid,
132
242
  status: d
133
243
  });
134
244
  });
135
245
  }
136
- getUnitRules(a) {
137
- const t = this._model.get(a);
246
+ getUnitRules(e) {
247
+ const t = this._model.get(e);
138
248
  if (!t)
139
249
  return [];
140
250
  const r = [];
141
- return t.forEach((o) => {
142
- r.push([o.subUnitId, o.getDataValidations()]);
251
+ return t.forEach((n) => {
252
+ r.push([n.subUnitId, n.getDataValidations()]);
143
253
  }), r;
144
254
  }
255
+ deleteUnitRules(e) {
256
+ this._model.delete(e);
257
+ }
145
258
  };
146
- h = Z([
147
- k(0, H)
259
+ h = pe([
260
+ _e(0, te)
148
261
  ], h);
149
- const E = {
262
+ const g = {
150
263
  type: m.MUTATION,
151
264
  id: "data-validation.mutation.addRule",
152
- handler(e, a) {
153
- if (!a)
265
+ handler(a, e) {
266
+ if (!e)
154
267
  return !1;
155
- const { unitId: t, subUnitId: r, rule: o, index: n } = a, i = e.get(h);
156
- return Array.isArray(o) ? o.forEach((d) => {
157
- i.addRule(t, r, d, n);
158
- }) : i.addRule(t, r, o, n), !0;
268
+ const { unitId: t, subUnitId: r, rule: n, index: o } = e;
269
+ return a.get(h).addRule(t, r, n, o), !0;
159
270
  }
160
- }, v = {
271
+ }, f = {
161
272
  type: m.MUTATION,
162
273
  id: "data-validation.mutation.removeRule",
163
- handler(e, a) {
164
- if (!a)
274
+ handler(a, e) {
275
+ if (!e)
165
276
  return !1;
166
- const { unitId: t, subUnitId: r, ruleId: o } = a, n = e.get(h);
167
- return Array.isArray(o) ? o.forEach((i) => {
168
- n.removeRule(t, r, i);
169
- }) : n.removeRule(t, r, o), !0;
277
+ const { unitId: t, subUnitId: r, ruleId: n } = e, o = a.get(h);
278
+ return Array.isArray(n) ? n.forEach((i) => {
279
+ o.removeRule(t, r, i);
280
+ }) : o.removeRule(t, r, n), !0;
170
281
  }
171
- }, g = {
282
+ }, v = {
172
283
  type: m.MUTATION,
173
284
  id: "data-validation.mutation.updateRule",
174
- handler(e, a) {
175
- if (!a)
285
+ handler(a, e) {
286
+ if (!e)
176
287
  return !1;
177
- const { unitId: t, subUnitId: r, ruleId: o, payload: n } = a;
178
- return e.get(h).updateRule(t, r, o, n), !0;
288
+ const { unitId: t, subUnitId: r, ruleId: n, payload: o } = e;
289
+ return a.get(h).updateRule(t, r, n, o), !0;
179
290
  }
180
- };
181
- function aa(e) {
182
- return {
183
- type: e.type,
184
- operator: e.operator,
185
- formula1: e.formula1,
186
- formula2: e.formula2,
187
- allowBlank: e.allowBlank
188
- };
189
- }
190
- function ta(e) {
191
- return {
192
- error: e.error,
193
- errorStyle: e.errorStyle,
194
- errorTitle: e.errorTitle,
195
- imeMode: e.imeMode,
196
- prompt: e.prompt,
197
- promptTitle: e.promptTitle,
198
- showDropDown: e.showDropDown,
199
- showErrorMessage: e.showErrorMessage,
200
- showInputMessage: e.showInputMessage,
201
- renderMode: e.renderMode
202
- };
203
- }
204
- function Ra(e) {
205
- const t = e.get(z).getSelectionRanges();
206
- return {
207
- uid: L.generateRandomId(6),
208
- type: Q.DECIMAL,
209
- operator: s.EQUAL,
210
- formula1: "100",
211
- ranges: t != null ? t : [{ startColumn: 0, endColumn: 0, startRow: 0, endRow: 0 }]
212
- };
213
- }
214
- var p = /* @__PURE__ */ ((e) => (e[e.SETTING = 0] = "SETTING", e[e.RANGE = 1] = "RANGE", e[e.OPTIONS = 2] = "OPTIONS", e))(p || {});
215
- const ea = {
291
+ }, ge = {
216
292
  type: m.COMMAND,
217
293
  id: "data-validation.command.addRule",
218
- async handler(e, a) {
219
- if (!a)
294
+ async handler(a, e) {
295
+ if (!e)
220
296
  return !1;
221
- const { rule: t, unitId: r, subUnitId: o } = a, n = e.get(T), i = e.get(M), d = {
222
- ...a,
297
+ const { rule: t, unitId: r, subUnitId: n } = e, o = a.get(M), i = a.get(S), d = {
298
+ ...e,
223
299
  rule: {
224
- ...a.rule,
225
- ranges: [a.rule.range]
300
+ ...e.rule,
301
+ ranges: [e.rule.range]
226
302
  }
227
303
  }, l = [{
228
- id: E.id,
304
+ id: g.id,
229
305
  params: d
230
306
  }], u = [{
231
- id: v.id,
307
+ id: f.id,
232
308
  params: {
233
309
  unitId: r,
234
- subUnitId: o,
310
+ subUnitId: n,
235
311
  ruleId: t.uid
236
312
  }
237
313
  }];
@@ -239,152 +315,152 @@ const ea = {
239
315
  unitID: r,
240
316
  redoMutations: l,
241
317
  undoMutations: u
242
- }), await n.executeCommand(E.id, d), !0;
318
+ }), await o.executeCommand(g.id, d), !0;
243
319
  }
244
- }, Va = (e, a) => {
245
- const t = e.get(h), { unitId: r, subUnitId: o, ruleId: n } = a;
246
- if (Array.isArray(n)) {
247
- const d = n.map((l) => t.getRuleById(r, o, l)).filter(Boolean);
320
+ }, Qe = (a, e) => {
321
+ const t = a.get(h), { unitId: r, subUnitId: n, ruleId: o } = e;
322
+ if (Array.isArray(o)) {
323
+ const d = o.map((l) => t.getRuleById(r, n, l)).filter(Boolean);
248
324
  return [{
249
- id: E.id,
325
+ id: g.id,
250
326
  params: {
251
327
  unitId: r,
252
- subUnitId: o,
328
+ subUnitId: n,
253
329
  rule: d
254
330
  }
255
331
  }];
256
332
  }
257
333
  return [{
258
- id: E.id,
334
+ id: g.id,
259
335
  params: {
260
336
  unitId: r,
261
- subUnitId: o,
337
+ subUnitId: n,
262
338
  rule: {
263
- ...t.getRuleById(r, o, n)
339
+ ...t.getRuleById(r, n, o)
264
340
  },
265
- index: t.getRuleIndex(r, o, n)
341
+ index: t.getRuleIndex(r, n, o)
266
342
  }
267
343
  }];
268
- }, ra = {
344
+ }, me = {
269
345
  type: m.COMMAND,
270
346
  id: "data-validation.command.removeRule",
271
- handler(e, a) {
272
- if (!a)
347
+ handler(a, e) {
348
+ if (!e)
273
349
  return !1;
274
- const { unitId: t, subUnitId: r, ruleId: o } = a, n = e.get(T), i = e.get(M), d = e.get(h), l = [{
275
- id: v.id,
276
- params: a
350
+ const { unitId: t, subUnitId: r, ruleId: n } = e, o = a.get(M), i = a.get(S), d = a.get(h), l = [{
351
+ id: f.id,
352
+ params: e
277
353
  }], u = [{
278
- id: E.id,
354
+ id: g.id,
279
355
  params: {
280
356
  unitId: t,
281
357
  subUnitId: r,
282
358
  rule: {
283
- ...d.getRuleById(t, r, o)
359
+ ...d.getRuleById(t, r, n)
284
360
  },
285
- index: d.getRuleIndex(t, r, o)
361
+ index: d.getRuleIndex(t, r, n)
286
362
  }
287
363
  }];
288
364
  return i.pushUndoRedo({
289
365
  undoMutations: u,
290
366
  redoMutations: l,
291
- unitID: a.unitId
292
- }), n.executeCommand(v.id, a), !0;
367
+ unitID: e.unitId
368
+ }), o.executeCommand(f.id, e), !0;
293
369
  }
294
- }, oa = {
370
+ }, Ee = {
295
371
  type: m.COMMAND,
296
372
  id: "data-validation.command.updateDataValidationSetting",
297
- handler(e, a) {
298
- if (!a)
373
+ handler(a, e) {
374
+ if (!e)
299
375
  return !1;
300
- const t = e.get(T), r = e.get(M), o = e.get(h), { unitId: n, subUnitId: i, ruleId: d, options: l } = a, u = o.getRuleById(n, i, d);
376
+ const t = a.get(M), r = a.get(S), n = a.get(h), { unitId: o, subUnitId: i, ruleId: d, options: l } = e, u = n.getRuleById(o, i, d);
301
377
  if (!u)
302
378
  return !1;
303
- const _ = {
304
- unitId: n,
379
+ const p = {
380
+ unitId: o,
305
381
  subUnitId: i,
306
382
  ruleId: d,
307
383
  payload: {
308
- type: p.OPTIONS,
384
+ type: _.OPTIONS,
309
385
  payload: l
310
386
  }
311
- }, f = [{
312
- id: g.id,
313
- params: _
314
- }], R = {
315
- unitId: n,
387
+ }, T = [{
388
+ id: v.id,
389
+ params: p
390
+ }], V = {
391
+ unitId: o,
316
392
  subUnitId: i,
317
393
  ruleId: d,
318
394
  payload: {
319
- type: p.OPTIONS,
320
- payload: ta(u)
395
+ type: _.OPTIONS,
396
+ payload: J(u)
321
397
  }
322
- }, V = [{
323
- id: g.id,
324
- params: R
398
+ }, O = [{
399
+ id: v.id,
400
+ params: V
325
401
  }];
326
402
  return r.pushUndoRedo({
327
- unitID: n,
328
- redoMutations: f,
329
- undoMutations: V
330
- }), t.executeCommand(g.id, _), !0;
403
+ unitID: o,
404
+ redoMutations: T,
405
+ undoMutations: O
406
+ }), t.executeCommand(v.id, p), !0;
331
407
  }
332
- }, na = {
408
+ }, ve = {
333
409
  type: m.COMMAND,
334
410
  id: "data-validation.command.updateDataValidationOptions",
335
- handler(e, a) {
336
- if (!a)
411
+ handler(a, e) {
412
+ if (!e)
337
413
  return !1;
338
- const t = e.get(T), r = e.get(M), o = e.get(h), n = e.get(b), { unitId: i, subUnitId: d, ruleId: l, setting: u } = a, _ = n.getValidatorItem(u.type);
339
- if (!_ || !_.validatorFormula(u).success)
414
+ const t = a.get(M), r = a.get(S), n = a.get(h), o = a.get(j), { unitId: i, subUnitId: d, ruleId: l, setting: u } = e, p = o.getValidatorItem(u.type);
415
+ if (!p || !p.validatorFormula(u).success)
340
416
  return !1;
341
- const f = o.getRuleById(i, d, l);
342
- if (!f)
417
+ const T = n.getRuleById(i, d, l);
418
+ if (!T)
343
419
  return !1;
344
- const R = {
420
+ const V = {
345
421
  unitId: i,
346
422
  subUnitId: d,
347
423
  ruleId: l,
348
424
  payload: {
349
- type: p.SETTING,
425
+ type: _.SETTING,
350
426
  payload: u
351
427
  }
352
- }, V = [{
353
- id: g.id,
354
- params: R
355
- }], $ = {
428
+ }, O = [{
429
+ id: v.id,
430
+ params: V
431
+ }], z = {
356
432
  unitId: i,
357
433
  subUnitId: d,
358
434
  ruleId: l,
359
435
  payload: {
360
- type: p.SETTING,
361
- payload: aa(f)
436
+ type: _.SETTING,
437
+ payload: F(T)
362
438
  }
363
- }, x = [{
364
- id: g.id,
365
- params: $
439
+ }, K = [{
440
+ id: v.id,
441
+ params: z
366
442
  }];
367
443
  return r.pushUndoRedo({
368
444
  unitID: i,
369
- redoMutations: V,
370
- undoMutations: x
371
- }), t.executeCommand(g.id, R), !0;
445
+ redoMutations: O,
446
+ undoMutations: K
447
+ }), t.executeCommand(v.id, V), !0;
372
448
  }
373
- }, ia = {
449
+ }, fe = {
374
450
  type: m.COMMAND,
375
451
  id: "data-validation.command.removeAll",
376
- handler(e, a) {
377
- if (!a)
452
+ handler(a, e) {
453
+ if (!e)
378
454
  return !1;
379
- const { unitId: t, subUnitId: r } = a, o = e.get(T), n = e.get(h), i = e.get(M), d = [...n.getRules(t, r)], l = {
455
+ const { unitId: t, subUnitId: r } = e, n = a.get(M), o = a.get(h), i = a.get(S), d = [...o.getRules(t, r)], l = {
380
456
  unitId: t,
381
457
  subUnitId: r,
382
- ruleId: d.map((f) => f.uid)
458
+ ruleId: d.map((T) => T.uid)
383
459
  }, u = [{
384
- id: v.id,
460
+ id: f.id,
385
461
  params: l
386
- }], _ = [{
387
- id: E.id,
462
+ }], p = [{
463
+ id: g.id,
388
464
  params: {
389
465
  unitId: t,
390
466
  subUnitId: r,
@@ -393,53 +469,159 @@ const ea = {
393
469
  }];
394
470
  return i.pushUndoRedo({
395
471
  redoMutations: u,
396
- undoMutations: _,
472
+ undoMutations: p,
397
473
  unitID: t
398
- }), o.executeCommand(v.id, l), !0;
474
+ }), n.executeCommand(f.id, l), !0;
475
+ }
476
+ };
477
+ var Te = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, Se = (a, e, t, r) => {
478
+ for (var n = r > 1 ? void 0 : r ? Me(e, t) : e, o = a.length - 1, i; o >= 0; o--)
479
+ (i = a[o]) && (n = (r ? i(e, t, n) : i(n)) || n);
480
+ return r && n && Te(e, t, n), n;
481
+ }, y = (a, e) => (t, r) => e(t, r, a);
482
+ const Ve = "SHEET_DATA_VALIDATION_PLUGIN";
483
+ let I = class extends N {
484
+ constructor(a, e, t) {
485
+ super(), this._resourceManagerService = a, this._univerInstanceService = e, this._dataValidationModel = t, this._initSnapshot();
486
+ }
487
+ _initSnapshot() {
488
+ const a = (t) => {
489
+ const r = this._dataValidationModel.getUnitRules(t), n = {};
490
+ return r ? (r.forEach(([o, i]) => {
491
+ n[o] = i;
492
+ }), JSON.stringify(n)) : "";
493
+ }, e = (t) => {
494
+ if (!t)
495
+ return {};
496
+ try {
497
+ return JSON.parse(t);
498
+ } catch {
499
+ return {};
500
+ }
501
+ };
502
+ this.disposeWithMe(
503
+ this._resourceManagerService.registerPluginResource({
504
+ pluginName: Ve,
505
+ businesses: [w.UNIVER_SHEET],
506
+ toJson: (t) => a(t),
507
+ parseJson: (t) => e(t),
508
+ onUnLoad: (t) => {
509
+ this._dataValidationModel.deleteUnitRules(t);
510
+ },
511
+ onLoad: (t, r) => {
512
+ Object.keys(r).forEach((n) => {
513
+ r[n].forEach((i) => {
514
+ this._dataValidationModel.addRule(t, n, i);
515
+ });
516
+ });
517
+ }
518
+ })
519
+ );
399
520
  }
400
521
  };
401
- var sa = Object.defineProperty, da = Object.getOwnPropertyDescriptor, la = (e, a, t, r) => {
402
- for (var o = r > 1 ? void 0 : r ? da(a, t) : a, n = e.length - 1, i; n >= 0; n--)
403
- (i = e[n]) && (o = (r ? i(a, t, o) : i(o)) || o);
404
- return r && o && sa(a, t, o), o;
405
- }, N = (e, a) => (t, r) => a(t, r, e);
406
- const ua = "data-validation";
407
- let O = class extends W {
408
- constructor(e, a) {
409
- super(ua), this._injector = e, this._commandService = a;
410
- }
411
- onStarting(e) {
522
+ I = Se([
523
+ q(G.Ready, I),
524
+ y(0, ae),
525
+ y(1, Q),
526
+ y(2, E(h))
527
+ ], I);
528
+ var Re = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, Ae = (a, e, t, r) => {
529
+ for (var n = r > 1 ? void 0 : r ? Ie(e, t) : e, o = a.length - 1, i; o >= 0; o--)
530
+ (i = a[o]) && (n = (r ? i(e, t, n) : i(n)) || n);
531
+ return r && n && Re(e, t, n), n;
532
+ }, L = (a, e) => (t, r) => e(t, r, a);
533
+ let A = class extends N {
534
+ constructor(a, e, t) {
535
+ super(), this._sheetInterceptorService = a, this._univerInstanceService = e, this._dataValidationModel = t, this._initSheetChange();
536
+ }
537
+ _initSheetChange() {
538
+ this.disposeWithMe(
539
+ this._sheetInterceptorService.interceptCommand({
540
+ getMutations: (a) => {
541
+ if (a.id === se.id) {
542
+ const e = a.params, t = e.unitId || this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET).getUnitId(), r = this._univerInstanceService.getUniverSheetInstance(t);
543
+ if (!r)
544
+ return { redos: [], undos: [] };
545
+ const n = e.subUnitId || r.getActiveSheet().getSheetId(), o = this._dataValidationModel.ensureManager(t, n);
546
+ if (!o)
547
+ return { redos: [], undos: [] };
548
+ const i = o.getDataValidations(), d = i.map((p) => p.uid), l = {
549
+ unitId: t,
550
+ subUnitId: n,
551
+ ruleId: d
552
+ }, u = {
553
+ unitId: t,
554
+ subUnitId: n,
555
+ rule: i
556
+ };
557
+ return {
558
+ redos: [{
559
+ id: f.id,
560
+ params: l
561
+ }],
562
+ undos: [{
563
+ id: g.id,
564
+ params: u
565
+ }]
566
+ };
567
+ }
568
+ return { redos: [], undos: [] };
569
+ }
570
+ })
571
+ );
572
+ }
573
+ };
574
+ A = Ae([
575
+ q(G.Ready, A),
576
+ L(0, E(de)),
577
+ L(1, E(Q)),
578
+ L(2, E(h))
579
+ ], A);
580
+ var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, ye = (a, e, t, r) => {
581
+ for (var n = r > 1 ? void 0 : r ? Oe(e, t) : e, o = a.length - 1, i; o >= 0; o--)
582
+ (i = a[o]) && (n = (r ? i(e, t, n) : i(n)) || n);
583
+ return r && n && Ne(e, t, n), n;
584
+ }, C = (a, e) => (t, r) => e(t, r, a);
585
+ const Le = "data-validation";
586
+ var R;
587
+ let b = (R = class extends re {
588
+ constructor(a, e, t) {
589
+ super(), this._injector = e, this._commandService = t;
590
+ }
591
+ onStarting(a) {
412
592
  [
413
593
  // model
414
594
  [h],
415
595
  // service
416
- [b]
596
+ [j],
597
+ [I],
598
+ [A]
417
599
  ].forEach(
418
- (a) => {
419
- e.add(a);
600
+ (e) => {
601
+ a.add(e);
420
602
  }
421
603
  ), [
422
604
  // command
423
- ea,
424
- ia,
425
- oa,
426
- na,
427
- ra,
605
+ ge,
606
+ fe,
607
+ Ee,
608
+ ve,
609
+ me,
428
610
  // mutation
429
- E,
430
611
  g,
431
- v
432
- ].forEach((a) => {
433
- this._commandService.registerCommand(a);
612
+ v,
613
+ f
614
+ ].forEach((e) => {
615
+ this._commandService.registerCommand(e);
434
616
  });
435
617
  }
436
- };
437
- O = la([
438
- N(0, I(B)),
439
- N(1, T)
440
- ], O);
618
+ }, c(R, "pluginName", Le), c(R, "type", w.UNIVER_SHEET), R);
619
+ b = ye([
620
+ C(1, E(W)),
621
+ C(2, M)
622
+ ], b);
441
623
  s.BETWEEN + "", s.EQUAL + "", s.GREATER_THAN + "", s.GREATER_THAN_OR_EQUAL + "", s.LESS_THAN + "", s.LESS_THAN_OR_EQUAL + "", s.NOT_BETWEEN + "", s.NOT_EQUAL + "";
442
- const ca = {
624
+ const Ue = {
443
625
  [s.BETWEEN]: "dataValidation.ruleName.between",
444
626
  [s.EQUAL]: "dataValidation.ruleName.equal",
445
627
  [s.GREATER_THAN]: "dataValidation.ruleName.greaterThan",
@@ -448,7 +630,7 @@ const ca = {
448
630
  [s.LESS_THAN_OR_EQUAL]: "dataValidation.ruleName.lessThanOrEqual",
449
631
  [s.NOT_BETWEEN]: "dataValidation.ruleName.notBetween",
450
632
  [s.NOT_EQUAL]: "dataValidation.ruleName.notEqual"
451
- }, ha = {
633
+ }, we = {
452
634
  [s.BETWEEN]: "dataValidation.errorMsg.between",
453
635
  [s.EQUAL]: "dataValidation.errorMsg.equal",
454
636
  [s.GREATER_THAN]: "dataValidation.errorMsg.greaterThan",
@@ -457,13 +639,22 @@ const ca = {
457
639
  [s.LESS_THAN_OR_EQUAL]: "dataValidation.errorMsg.lessThanOrEqual",
458
640
  [s.NOT_BETWEEN]: "dataValidation.errorMsg.notBetween",
459
641
  [s.NOT_EQUAL]: "dataValidation.errorMsg.notEqual"
642
+ }, We = {
643
+ [s.BETWEEN]: "dataValidation.textLength.errorMsg.between",
644
+ [s.EQUAL]: "dataValidation.textLength.errorMsg.equal",
645
+ [s.GREATER_THAN]: "dataValidation.textLength.errorMsg.greaterThan",
646
+ [s.GREATER_THAN_OR_EQUAL]: "dataValidation.textLength.errorMsg.greaterThanOrEqual",
647
+ [s.LESS_THAN]: "dataValidation.textLength.errorMsg.lessThan",
648
+ [s.LESS_THAN_OR_EQUAL]: "dataValidation.textLength.errorMsg.lessThanOrEqual",
649
+ [s.NOT_BETWEEN]: "dataValidation.textLength.errorMsg.notBetween",
650
+ [s.NOT_EQUAL]: "dataValidation.textLength.errorMsg.notEqual"
460
651
  };
461
- var pa = Object.defineProperty, ma = Object.getOwnPropertyDescriptor, _a = (e, a, t, r) => {
462
- for (var o = r > 1 ? void 0 : r ? ma(a, t) : a, n = e.length - 1, i; n >= 0; n--)
463
- (i = e[n]) && (o = (r ? i(a, t, o) : i(o)) || o);
464
- return r && o && pa(a, t, o), o;
465
- }, y = (e, a) => (t, r) => a(t, r, e);
466
- const w = "{FORMULA1}", C = "{FORMULA2}", ga = {
652
+ var De = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, be = (a, e, t, r) => {
653
+ for (var n = r > 1 ? void 0 : r ? Ce(e, t) : e, o = a.length - 1, i; o >= 0; o--)
654
+ (i = a[o]) && (n = (r ? i(e, t, n) : i(n)) || n);
655
+ return r && n && De(e, t, n), n;
656
+ }, B = (a, e) => (t, r) => e(t, r, a);
657
+ const P = "{FORMULA1}", $ = "{FORMULA2}", Be = {
467
658
  [s.BETWEEN]: "dataValidation.operators.between",
468
659
  [s.EQUAL]: "dataValidation.operators.equal",
469
660
  [s.GREATER_THAN]: "dataValidation.operators.greaterThan",
@@ -473,195 +664,131 @@ const w = "{FORMULA1}", C = "{FORMULA2}", ga = {
473
664
  [s.NOT_BETWEEN]: "dataValidation.operators.notBetween",
474
665
  [s.NOT_EQUAL]: "dataValidation.operators.notEqual"
475
666
  };
476
- let D = class {
477
- constructor(e, a) {
667
+ let x = class {
668
+ constructor(a, e) {
478
669
  c(this, "canvasRender", null);
479
670
  c(this, "dropdown");
480
671
  c(this, "optionsInput");
481
- this.localeService = e, this.injector = a;
672
+ this.localeService = a, this.injector = e;
482
673
  }
483
674
  get operatorNames() {
484
- return this.operators.map((e) => this.localeService.t(ga[e]));
675
+ return this.operators.map((a) => this.localeService.t(Be[a]));
485
676
  }
486
677
  get titleStr() {
487
678
  return this.localeService.t(this.title);
488
679
  }
489
- skipDefaultFontRender(e, a, t) {
680
+ skipDefaultFontRender(a, e, t) {
490
681
  return !1;
491
682
  }
492
- generateRuleName(e) {
683
+ generateRuleName(a) {
493
684
  var t, r;
494
- if (!e.operator)
685
+ if (!a.operator)
495
686
  return this.titleStr;
496
- const a = this.localeService.t(ca[e.operator]).replace(w, (t = e.formula1) != null ? t : "").replace(C, (r = e.formula2) != null ? r : "");
497
- return `${this.titleStr} ${a}`;
687
+ const e = this.localeService.t(Ue[a.operator]).replace(P, (t = a.formula1) != null ? t : "").replace($, (r = a.formula2) != null ? r : "");
688
+ return `${this.titleStr} ${e}`;
498
689
  }
499
- generateRuleErrorMessage(e) {
690
+ generateRuleErrorMessage(a) {
500
691
  var t, r;
501
- return e.operator ? `${this.localeService.t(ha[e.operator]).replace(w, (t = e.formula1) != null ? t : "").replace(C, (r = e.formula2) != null ? r : "")}` : this.titleStr;
692
+ return a.operator ? `${this.localeService.t(we[a.operator]).replace(P, (t = a.formula1) != null ? t : "").replace($, (r = a.formula2) != null ? r : "")}` : this.titleStr;
502
693
  }
503
- getRuleFinalError(e) {
504
- return e.showInputMessage && e.error ? e.error : this.generateRuleErrorMessage(e);
694
+ getRuleFinalError(a) {
695
+ return a.showInputMessage && a.error ? a.error : this.generateRuleErrorMessage(a);
505
696
  }
506
- isEmptyCellValue(e) {
507
- return e === "" || e === void 0 || e === null;
697
+ isEmptyCellValue(a) {
698
+ return a === "" || a === void 0 || a === null;
508
699
  }
509
- async isValidType(e, a, t) {
700
+ async isValidType(a, e, t) {
510
701
  return !0;
511
702
  }
512
- transform(e, a, t) {
513
- return e;
703
+ transform(a, e, t) {
704
+ return a;
514
705
  }
515
- async validatorIsEqual(e, a, t) {
706
+ async validatorIsEqual(a, e, t) {
516
707
  return !0;
517
708
  }
518
- async validatorIsNotEqual(e, a, t) {
709
+ async validatorIsNotEqual(a, e, t) {
519
710
  return !0;
520
711
  }
521
- async validatorIsBetween(e, a, t) {
712
+ async validatorIsBetween(a, e, t) {
522
713
  return !0;
523
714
  }
524
- async validatorIsNotBetween(e, a, t) {
715
+ async validatorIsNotBetween(a, e, t) {
525
716
  return !0;
526
717
  }
527
- async validatorIsGreaterThan(e, a, t) {
718
+ async validatorIsGreaterThan(a, e, t) {
528
719
  return !0;
529
720
  }
530
- async validatorIsGreaterThanOrEqual(e, a, t) {
721
+ async validatorIsGreaterThanOrEqual(a, e, t) {
531
722
  return !0;
532
723
  }
533
- async validatorIsLessThan(e, a, t) {
724
+ async validatorIsLessThan(a, e, t) {
534
725
  return !0;
535
726
  }
536
- async validatorIsLessThanOrEqual(e, a, t) {
727
+ async validatorIsLessThanOrEqual(a, e, t) {
537
728
  return !0;
538
729
  }
539
- async validator(e, a) {
540
- const { value: t, unitId: r, subUnitId: o } = e, n = this.isEmptyCellValue(t), { allowBlank: i = !0, operator: d } = a;
541
- if (n)
730
+ async validator(a, e) {
731
+ const { value: t, unitId: r, subUnitId: n } = a, o = this.isEmptyCellValue(t), { allowBlank: i = !0, operator: d } = e;
732
+ if (o)
542
733
  return i;
543
- const l = await this.parseFormula(a, r, o);
544
- if (!await this.isValidType(e, l, a))
734
+ const l = await this.parseFormula(e, r, n);
735
+ if (!await this.isValidType(a, l, e))
545
736
  return !1;
546
- if (!L.isDefine(d))
737
+ if (!H.isDefine(d))
547
738
  return !0;
548
- const u = this.transform(e, l, a);
739
+ const u = this.transform(a, l, e);
549
740
  switch (d) {
550
741
  case s.BETWEEN:
551
- return this.validatorIsBetween(u, l, a);
742
+ return this.validatorIsBetween(u, l, e);
552
743
  case s.EQUAL:
553
- return this.validatorIsEqual(u, l, a);
744
+ return this.validatorIsEqual(u, l, e);
554
745
  case s.GREATER_THAN:
555
- return this.validatorIsGreaterThan(u, l, a);
746
+ return this.validatorIsGreaterThan(u, l, e);
556
747
  case s.GREATER_THAN_OR_EQUAL:
557
- return this.validatorIsGreaterThanOrEqual(u, l, a);
748
+ return this.validatorIsGreaterThanOrEqual(u, l, e);
558
749
  case s.LESS_THAN:
559
- return this.validatorIsLessThan(u, l, a);
750
+ return this.validatorIsLessThan(u, l, e);
560
751
  case s.LESS_THAN_OR_EQUAL:
561
- return this.validatorIsLessThanOrEqual(u, l, a);
752
+ return this.validatorIsLessThanOrEqual(u, l, e);
562
753
  case s.NOT_BETWEEN:
563
- return this.validatorIsNotBetween(u, l, a);
754
+ return this.validatorIsNotBetween(u, l, e);
564
755
  case s.NOT_EQUAL:
565
- return this.validatorIsNotEqual(u, l, a);
756
+ return this.validatorIsNotEqual(u, l, e);
566
757
  default:
567
758
  throw new Error("Unknown operator.");
568
759
  }
569
760
  }
570
761
  };
571
- D = _a([
572
- y(0, I(j)),
573
- y(1, I(B))
574
- ], D);
575
- class Ia extends U {
576
- constructor(t, r, o) {
577
- super();
578
- c(this, "_dataValidations");
579
- c(this, "_dataValidationMap", /* @__PURE__ */ new Map());
580
- c(this, "_dataValidations$", new S());
581
- c(this, "unitId");
582
- c(this, "subUnitId");
583
- c(this, "dataValidations$", this._dataValidations$.asObservable());
584
- this.unitId = t, this.subUnitId = r, o && (this._insertRules(o), this._notice(), this.disposeWithMe({
585
- dispose: () => {
586
- this._dataValidations$.complete();
587
- }
588
- }));
589
- }
590
- _notice() {
591
- this._dataValidations$.next(this._dataValidations);
592
- }
593
- _insertRules(t) {
594
- this._dataValidations = t, t.forEach((r) => {
595
- this._dataValidationMap.set(r.uid, r);
596
- });
597
- }
598
- getRuleById(t) {
599
- return this._dataValidationMap.get(t);
600
- }
601
- getRuleIndex(t) {
602
- return this._dataValidations.findIndex((r) => r.uid === t);
603
- }
604
- addRule(t, r) {
605
- typeof r == "number" && r < this._dataValidations.length ? this._dataValidations.splice(r, 0, t) : this._dataValidations.push(t), this._dataValidationMap.set(t.uid, t), this._notice();
606
- }
607
- removeRule(t) {
608
- const r = this._dataValidations.findIndex((o) => o.uid === t);
609
- this._dataValidations.splice(r, 1), this._dataValidationMap.delete(t), this._notice();
610
- }
611
- updateRule(t, r) {
612
- const o = this._dataValidationMap.get(t), n = this._dataValidations.findIndex((d) => t === d.uid);
613
- if (!o)
614
- throw new Error(`Data validation rule is not found, ruleId: ${t}.`);
615
- const i = { ...o };
616
- switch (r.type) {
617
- case p.RANGE: {
618
- i.ranges = r.payload;
619
- break;
620
- }
621
- case p.SETTING: {
622
- Object.assign(i, r.payload);
623
- break;
624
- }
625
- case p.OPTIONS: {
626
- Object.assign(i, r.payload);
627
- break;
628
- }
629
- }
630
- return this._dataValidations[n] = i, this._dataValidationMap.set(t, i), this._notice(), i;
631
- }
632
- getDataValidations() {
633
- return this._dataValidations;
634
- }
635
- toJSON() {
636
- return this._dataValidations;
637
- }
638
- validator(t, r, o, n) {
639
- return F.VALID;
640
- }
641
- }
642
- const Sa = [
762
+ x = be([
763
+ B(0, E(ne)),
764
+ B(1, E(W))
765
+ ], x);
766
+ const je = [
643
767
  s.BETWEEN,
644
768
  s.NOT_BETWEEN
645
769
  ];
646
770
  export {
647
- ea as AddDataValidationCommand,
648
- E as AddDataValidationMutation,
649
- D as BaseDataValidator,
650
- Ia as DataValidationManager,
771
+ ge as AddDataValidationCommand,
772
+ g as AddDataValidationMutation,
773
+ x as BaseDataValidator,
774
+ ue as DataValidationManager,
651
775
  h as DataValidationModel,
652
- K as DataValidatorRegistryScope,
653
- b as DataValidatorRegistryService,
654
- ia as RemoveAllDataValidationCommand,
655
- ra as RemoveDataValidationCommand,
656
- v as RemoveDataValidationMutation,
657
- Sa as TWO_FORMULA_OPERATOR_COUNT,
658
- O as UniverDataValidationPlugin,
659
- g as UpdateDataValidationMutation,
660
- oa as UpdateDataValidationOptionsCommand,
661
- na as UpdateDataValidationSettingCommand,
662
- p as UpdateRuleType,
663
- Ra as createDefaultNewRule,
664
- ta as getRuleOptions,
665
- aa as getRuleSetting,
666
- Va as removeDataValidationUndoFactory
776
+ I as DataValidationResourceController,
777
+ A as DataValidationSheetController,
778
+ le as DataValidatorRegistryScope,
779
+ j as DataValidatorRegistryService,
780
+ fe as RemoveAllDataValidationCommand,
781
+ me as RemoveDataValidationCommand,
782
+ f as RemoveDataValidationMutation,
783
+ je as TWO_FORMULA_OPERATOR_COUNT,
784
+ We as TextLengthErrorTitleMap,
785
+ b as UniverDataValidationPlugin,
786
+ v as UpdateDataValidationMutation,
787
+ Ee as UpdateDataValidationOptionsCommand,
788
+ ve as UpdateDataValidationSettingCommand,
789
+ _ as UpdateRuleType,
790
+ Ge as createDefaultNewRule,
791
+ J as getRuleOptions,
792
+ F as getRuleSetting,
793
+ Qe as removeDataValidationUndoFactory
667
794
  };