@univerjs/data-validation 0.2.4 → 0.2.6

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