@univerjs/data-validation 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +7 -7
- package/lib/es/index.js +7 -7
- package/lib/index.js +7 -7
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
package/lib/cjs/index.js
CHANGED
|
@@ -52,7 +52,7 @@ let UpdateRuleType = /* @__PURE__ */ function(UpdateRuleType) {
|
|
|
52
52
|
return UpdateRuleType;
|
|
53
53
|
}({});
|
|
54
54
|
|
|
55
|
-
// \0@oxc-project+runtime@0.
|
|
55
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
56
56
|
function _typeof(o) {
|
|
57
57
|
"@babel/helpers - typeof";
|
|
58
58
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -62,7 +62,7 @@ function _typeof(o) {
|
|
|
62
62
|
}, _typeof(o);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// \0@oxc-project+runtime@0.
|
|
65
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
66
66
|
function toPrimitive(t, e) {
|
|
67
67
|
if ("object" != _typeof(t) || !t) return t;
|
|
68
68
|
var r;
|
|
@@ -74,13 +74,13 @@ function toPrimitive(t, e) {
|
|
|
74
74
|
return ("string" === e ? String : Number)(t);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// \0@oxc-project+runtime@0.
|
|
77
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
78
78
|
function toPropertyKey(t) {
|
|
79
79
|
var i = toPrimitive(t, "string");
|
|
80
80
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// \0@oxc-project+runtime@0.
|
|
83
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
84
84
|
function _defineProperty(e, r, t) {
|
|
85
85
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
86
86
|
value: t,
|
|
@@ -90,14 +90,14 @@ function _defineProperty(e, r, t) {
|
|
|
90
90
|
}) : e[r] = t, e;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// \0@oxc-project+runtime@0.
|
|
93
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
94
94
|
function __decorateParam(paramIndex, decorator) {
|
|
95
95
|
return function(target, key) {
|
|
96
96
|
decorator(target, key, paramIndex);
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// \0@oxc-project+runtime@0.
|
|
100
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
101
101
|
function __decorate(decorators, target, key, desc) {
|
|
102
102
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
103
103
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -350,7 +350,7 @@ DataValidationResourceController = __decorate([
|
|
|
350
350
|
|
|
351
351
|
// package.json
|
|
352
352
|
var name = "@univerjs/data-validation";
|
|
353
|
-
var version = "1.
|
|
353
|
+
var version = "1.6.0";
|
|
354
354
|
|
|
355
355
|
// src/config/config.ts
|
|
356
356
|
/**
|
package/lib/es/index.js
CHANGED
|
@@ -51,7 +51,7 @@ let UpdateRuleType = /* @__PURE__ */ function(UpdateRuleType) {
|
|
|
51
51
|
return UpdateRuleType;
|
|
52
52
|
}({});
|
|
53
53
|
|
|
54
|
-
// \0@oxc-project+runtime@0.
|
|
54
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
55
55
|
function _typeof(o) {
|
|
56
56
|
"@babel/helpers - typeof";
|
|
57
57
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -61,7 +61,7 @@ function _typeof(o) {
|
|
|
61
61
|
}, _typeof(o);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// \0@oxc-project+runtime@0.
|
|
64
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
65
65
|
function toPrimitive(t, e) {
|
|
66
66
|
if ("object" != _typeof(t) || !t) return t;
|
|
67
67
|
var r;
|
|
@@ -73,13 +73,13 @@ function toPrimitive(t, e) {
|
|
|
73
73
|
return ("string" === e ? String : Number)(t);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// \0@oxc-project+runtime@0.
|
|
76
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
77
77
|
function toPropertyKey(t) {
|
|
78
78
|
var i = toPrimitive(t, "string");
|
|
79
79
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
// \0@oxc-project+runtime@0.
|
|
82
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
83
83
|
function _defineProperty(e, r, t) {
|
|
84
84
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
85
85
|
value: t,
|
|
@@ -89,14 +89,14 @@ function _defineProperty(e, r, t) {
|
|
|
89
89
|
}) : e[r] = t, e;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// \0@oxc-project+runtime@0.
|
|
92
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
93
93
|
function __decorateParam(paramIndex, decorator) {
|
|
94
94
|
return function(target, key) {
|
|
95
95
|
decorator(target, key, paramIndex);
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// \0@oxc-project+runtime@0.
|
|
99
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
100
100
|
function __decorate(decorators, target, key, desc) {
|
|
101
101
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
102
102
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -349,7 +349,7 @@ DataValidationResourceController = __decorate([
|
|
|
349
349
|
|
|
350
350
|
// package.json
|
|
351
351
|
var name = "@univerjs/data-validation";
|
|
352
|
-
var version = "1.
|
|
352
|
+
var version = "1.6.0";
|
|
353
353
|
|
|
354
354
|
// src/config/config.ts
|
|
355
355
|
/**
|
package/lib/index.js
CHANGED
|
@@ -51,7 +51,7 @@ let UpdateRuleType = /* @__PURE__ */ function(UpdateRuleType) {
|
|
|
51
51
|
return UpdateRuleType;
|
|
52
52
|
}({});
|
|
53
53
|
|
|
54
|
-
// \0@oxc-project+runtime@0.
|
|
54
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
|
|
55
55
|
function _typeof(o) {
|
|
56
56
|
"@babel/helpers - typeof";
|
|
57
57
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -61,7 +61,7 @@ function _typeof(o) {
|
|
|
61
61
|
}, _typeof(o);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// \0@oxc-project+runtime@0.
|
|
64
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
|
|
65
65
|
function toPrimitive(t, e) {
|
|
66
66
|
if ("object" != _typeof(t) || !t) return t;
|
|
67
67
|
var r;
|
|
@@ -73,13 +73,13 @@ function toPrimitive(t, e) {
|
|
|
73
73
|
return ("string" === e ? String : Number)(t);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// \0@oxc-project+runtime@0.
|
|
76
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
|
|
77
77
|
function toPropertyKey(t) {
|
|
78
78
|
var i = toPrimitive(t, "string");
|
|
79
79
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
// \0@oxc-project+runtime@0.
|
|
82
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
|
|
83
83
|
function _defineProperty(e, r, t) {
|
|
84
84
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
85
85
|
value: t,
|
|
@@ -89,14 +89,14 @@ function _defineProperty(e, r, t) {
|
|
|
89
89
|
}) : e[r] = t, e;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// \0@oxc-project+runtime@0.
|
|
92
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
|
|
93
93
|
function __decorateParam(paramIndex, decorator) {
|
|
94
94
|
return function(target, key) {
|
|
95
95
|
decorator(target, key, paramIndex);
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// \0@oxc-project+runtime@0.
|
|
99
|
+
// \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
|
|
100
100
|
function __decorate(decorators, target, key, desc) {
|
|
101
101
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
102
102
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -349,7 +349,7 @@ DataValidationResourceController = __decorate([
|
|
|
349
349
|
|
|
350
350
|
// package.json
|
|
351
351
|
var name = "@univerjs/data-validation";
|
|
352
|
-
var version = "1.
|
|
352
|
+
var version = "1.6.0";
|
|
353
353
|
|
|
354
354
|
// src/config/config.ts
|
|
355
355
|
/**
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("rxjs")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`rxjs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDataValidation={},e.UniverCore,e.rxjs))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function r(e){return{type:e.type,operator:e.operator,formula1:e.formula1,formula2:e.formula2,allowBlank:e.allowBlank}}function i(e){return{error:e.error,errorStyle:e.errorStyle,errorTitle:e.errorTitle,imeMode:e.imeMode,prompt:e.prompt,promptTitle:e.promptTitle,showDropDown:e.showDropDown,showErrorMessage:e.showErrorMessage,showInputMessage:e.showInputMessage,renderMode:e.renderMode,bizInfo:e.bizInfo}}let a=/* @__PURE__ */ function(e){return e[e.SETTING=0]=`SETTING`,e[e.RANGE=1]=`RANGE`,e[e.OPTIONS=2]=`OPTIONS`,e[e.ALL=3]=`ALL`,e}({});function o(e){"@babel/helpers - typeof";return o=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},o(e)}function s(e,t){if(o(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(o(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return o(t)==`symbol`?t:t+``}function l(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return function(n,r){t(n,r,e)}}function d(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let f=class extends t.Disposable{constructor(e){super(),this._logService=e,l(this,`_model`,/* @__PURE__ */ new Map),l(this,`_ruleChange$`,new n.Subject),l(this,`ruleChange$`,this._ruleChange$.asObservable()),l(this,`ruleChangeDebounce$`,this.ruleChange$.pipe((0,n.debounceTime)(20))),this.disposeWithMe({dispose:()=>{this._ruleChange$.complete()}})}_ensureMap(e,t){this._model.has(e)||this._model.set(e,/* @__PURE__ */ new Map);let n=this._model.get(e);if(n.has(t))return n.get(t);let r={map:/* @__PURE__ */ new Map,list:[]};return n.set(t,r),r}_addSubUnitRule(e,t,n){let{map:r,list:i}=e,a=(Array.isArray(t)?t:[t]).filter(e=>!r.has(e.uid));typeof n==`number`&&n<i.length?i.splice(n,0,...a):i.push(...a),a.forEach(e=>{r.set(e.uid,e)})}_removeSubUnitRule(e,t){let{map:n,list:r}=e,i=r.findIndex(e=>e.uid===t);i>-1&&(r.splice(i,1),n.delete(t))}_updateSubUnitRule(e,t,n){let{map:a,list:o}=e,s=a.get(t),c=o.findIndex(e=>t===e.uid);if(!s)throw Error(`Data validation rule is not found, ruleId: ${t}.`);let l={...s};switch(n.type){case 1:l.ranges=n.payload;break;case 0:Object.assign(l,r(n.payload));break;case 2:Object.assign(l,i(n.payload));break;case 3:Object.assign(l,n.payload)}return o[c]=l,a.set(t,l),l}_addRuleSideEffect(e,t,n,r){if(!this._ensureMap(e,t).map.get(n.uid))return{rule:n,type:`add`,unitId:e,subUnitId:t,source:r}}addRule(e,t,n,r,i){try{let a=this._ensureMap(e,t),o=(Array.isArray(n)?n:[n]).map(n=>this._addRuleSideEffect(e,t,n,r));this._addSubUnitRule(a,n,i),o.forEach(e=>{e&&this._ruleChange$.next(e)})}catch(e){this._logService.error(e)}}updateRule(e,n,r,i,a){try{let o=this._ensureMap(e,n),s=t.Tools.deepClone(o.map.get(r));if(!s)throw Error(`Data validation rule is not found, ruleId: ${r}.`);let c=this._updateSubUnitRule(o,r,i);this._ruleChange$.next({rule:c,type:`update`,unitId:e,subUnitId:n,source:a,updatePayload:i,oldRule:s})}catch(e){this._logService.error(e)}}removeRule(e,t,n,r){try{let i=this._ensureMap(e,t),a=i.map.get(n);a&&(this._removeSubUnitRule(i,n),this._ruleChange$.next({rule:a,type:`remove`,unitId:e,subUnitId:t,source:r}))}catch(e){this._logService.error(e)}}getRuleById(e,t,n){return this._ensureMap(e,t).map.get(n)}getRuleIndex(e,t,n){return this._ensureMap(e,t).list.findIndex(e=>e.uid===n)}getRules(e,t){return[...this._ensureMap(e,t).list]}getUnitRules(e){let t=this._model.get(e);if(!t)return[];let n=[];return t.forEach((e,t)=>{n.push([t,e.list])}),n}deleteUnitRules(e){this._model.delete(e)}getSubUnitIds(e){var t;return Array.from(((t=this._model.get(e))==null?void 0:t.keys())??[])}getAll(){return Array.from(this._model.keys()).map(e=>[e,this.getUnitRules(e)])}};f=d([u(0,t.ILogService)],f);let p={type:t.CommandType.MUTATION,id:`data-validation.mutation.addRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,rule:i,index:a,source:o=`command`}=t;return e.get(f).addRule(n,r,i,o,a),!0}},m={type:t.CommandType.MUTATION,id:`data-validation.mutation.removeRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,ruleId:i,source:a=`command`}=t,o=e.get(f);return Array.isArray(i)?i.forEach(e=>{o.removeRule(n,r,e,a)}):o.removeRule(n,r,i,a),!0}},h={type:t.CommandType.MUTATION,id:`data-validation.mutation.updateRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,ruleId:i,payload:a,source:o=`command`}=t;return e.get(f).updateRule(n,r,i,a,o),!0}},g=class extends t.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._dataValidationModel=n,this._initSnapshot()}_initSnapshot(){let e=e=>{let t=this._dataValidationModel.getUnitRules(e),n={};return t?(t.forEach(([e,t])=>{t.length>0&&(n[e]=t)}),JSON.stringify(n)):``},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:`SHEET_DATA_VALIDATION_PLUGIN`,businesses:[t.UniverInstanceType.UNIVER_SHEET],toJson:t=>e(t),parseJson:e=>n(e),onUnLoad:e=>{this._dataValidationModel.deleteUnitRules(e)},onLoad:(e,t)=>{Object.keys(t).forEach(n=>{t[n].forEach(t=>{this._dataValidationModel.addRule(e,n,t,`patched`)})})}}))}};g=d([u(0,t.IResourceManagerService),u(1,t.IUniverInstanceService),u(2,(0,t.Inject)(f))],g);var _=`@univerjs/data-validation`,v=`1.5.2`;let y={},b=/* @__PURE__ */ function(e){return e.SHEET=`sheet`,e}({});var x=class{constructor(){l(this,`_validatorByScopes`,/* @__PURE__ */ new Map),l(this,`_validatorMap`,/* @__PURE__ */ new Map),l(this,`_validatorsChange$`,new n.BehaviorSubject(void 0)),l(this,`validatorsChange$`,this._validatorsChange$.asObservable())}_addValidatorToScope(e,t){this._validatorByScopes.has(t)||this._validatorByScopes.set(t,[]);let n=this._validatorByScopes.get(t);if(n.findIndex(t=>t.id===e.id)>-1)throw Error(`Validator item with the same id ${e.id} has already been added!`);n.push(e)}_removeValidatorFromScope(e,t){let n=this._validatorByScopes.get(t);if(!n)return;let r=n.findIndex(t=>t.id===e.id);r>-1&&n.splice(r,1)}register(e){return this._validatorMap.set(e.id,e),Array.isArray(e.scopes)?e.scopes.forEach(t=>{this._addValidatorToScope(e,t)}):this._addValidatorToScope(e,e.scopes),this._validatorsChange$.next(),(0,t.toDisposable)(()=>{this._validatorMap.delete(e.id),Array.isArray(e.scopes)?e.scopes.forEach(t=>{this._removeValidatorFromScope(e,t)}):this._removeValidatorFromScope(e,e.scopes),this._validatorsChange$.next()})}getValidatorItem(e){return this._validatorMap.get(e)}getValidatorsByScope(e){return this._validatorByScopes.get(e)}};let S=class extends t.Plugin{constructor(e=y,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{...a}=(0,t.merge)({},y,this._config);this._configService.setConfig(`data-validation.config`,a)}onStarting(){[[f],[x],[g]].forEach(e=>this._injector.add(e)),[p,h,m].forEach(e=>{this._commandService.registerCommand(e)})}onReady(){this._injector.get(g)}};l(S,`pluginName`,`UNIVER_DATA_VALIDATION_PLUGIN`),l(S,`packageName`,_),l(S,`version`,v),l(S,`type`,t.UniverInstanceType.UNIVER_SHEET),S=d([u(1,(0,t.Inject)(t.Injector)),u(2,t.ICommandService),u(3,t.IConfigService)],S);let C=[t.DataValidationOperator.BETWEEN,t.DataValidationOperator.NOT_BETWEEN];t.DataValidationOperator.BETWEEN,t.DataValidationOperator.EQUAL,t.DataValidationOperator.GREATER_THAN,t.DataValidationOperator.GREATER_THAN_OR_EQUAL,t.DataValidationOperator.LESS_THAN,t.DataValidationOperator.LESS_THAN_OR_EQUAL,t.DataValidationOperator.NOT_BETWEEN,t.DataValidationOperator.NOT_EQUAL;let w={[t.DataValidationOperator.BETWEEN]:`data-validation.ruleName.between`,[t.DataValidationOperator.EQUAL]:`data-validation.ruleName.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.ruleName.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.ruleName.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.ruleName.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.ruleName.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.ruleName.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.ruleName.notEqual`,NONE:`data-validation.ruleName.legal`},T={[t.DataValidationOperator.BETWEEN]:`data-validation.errorMsg.between`,[t.DataValidationOperator.EQUAL]:`data-validation.errorMsg.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.errorMsg.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.errorMsg.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.errorMsg.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.errorMsg.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.errorMsg.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.errorMsg.notEqual`,NONE:`data-validation.errorMsg.legal`},E=`{FORMULA1}`,D=`{FORMULA2}`,O=`{TYPE}`,k={[t.DataValidationOperator.BETWEEN]:`data-validation.operators.between`,[t.DataValidationOperator.EQUAL]:`data-validation.operators.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.operators.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.operators.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.operators.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.operators.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.operators.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.operators.notEqual`},A=/* @__PURE__ */ function(e){return e.DATE=`date`,e.TIME=`time`,e.DATETIME=`datetime`,e.LIST=`list`,e.MULTIPLE_LIST=`multipleList`,e.COLOR=`color`,e.CASCADE=`cascade`,e}({}),j=class{constructor(e,t){this.localeService=e,this.injector=t,l(this,`offsetFormulaByRange`,!0),l(this,`formulaInput`,void 0),l(this,`canvasRender`,null),l(this,`dropdownType`,void 0),l(this,`optionsInput`,void 0),l(this,`skipDefaultFontRender`,void 0)}get operatorNames(){return this.operators.map(e=>this.localeService.t(k[e]))}get titleStr(){return this.localeService.t(this.title)}generateRuleName(e){if(!e.operator)return this.localeService.t(w.NONE).replace(O,this.titleStr);let t=this.localeService.t(w[e.operator]).replace(E,e.formula1??``).replace(D,e.formula2??``);return`${this.titleStr} ${t}`}generateRuleErrorMessage(e,t){return e.operator?`${this.localeService.t(T[e.operator]).replace(E,e.formula1??``).replace(D,e.formula2??``)}`:this.localeService.t(T.NONE).replace(O,this.titleStr)}getExtraStyle(e,t,n,r,i){}getRuleFinalError(e,t){return e.showErrorMessage&&e.error?e.error:this.generateRuleErrorMessage(e,t)}isEmptyCellValue(e){return e===``||e==null}normalizeFormula(e,t,n){return{formula1:e.formula1,formula2:e.formula2}}async isValidType(e,t,n){return!0}transform(e,t,n){return e}async validatorIsEqual(e,t,n){let{formula1:r}=t,{value:i}=e;return Number.isNaN(r)?!0:i===r}async validatorIsNotEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value!==r}async validatorIsBetween(e,t,n){let{formula1:r,formula2:i}=t;if(Number.isNaN(r)||Number.isNaN(i))return!0;let a=Math.min(r,i),o=Math.max(r,i);return e.value>=a&&e.value<=o}async validatorIsNotBetween(e,t,n){let{formula1:r,formula2:i}=t;if(Number.isNaN(r)||Number.isNaN(i))return!0;let a=Math.min(r,i),o=Math.max(r,i);return e.value<a||e.value>o}async validatorIsGreaterThan(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value>r}async validatorIsGreaterThanOrEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value>=r}async validatorIsLessThan(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value<r}async validatorIsLessThanOrEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value<=r}async validator(e,n){let{value:r,unitId:i,subUnitId:a}=e,o=this.isEmptyCellValue(r),{allowBlank:s=!0,operator:c}=n;if(o)return s;let l=await this.parseFormula(n,i,a,e.row,e.column);if(!l.isFormulaValid||!await this.isValidType(e,l,n))return!1;if(!c)return!0;let u=this.transform(e,l,n);switch(c){case t.DataValidationOperator.BETWEEN:return this.validatorIsBetween(u,l,n);case t.DataValidationOperator.EQUAL:return this.validatorIsEqual(u,l,n);case t.DataValidationOperator.GREATER_THAN:return this.validatorIsGreaterThan(u,l,n);case t.DataValidationOperator.GREATER_THAN_OR_EQUAL:return this.validatorIsGreaterThanOrEqual(u,l,n);case t.DataValidationOperator.LESS_THAN:return this.validatorIsLessThan(u,l,n);case t.DataValidationOperator.LESS_THAN_OR_EQUAL:return this.validatorIsLessThanOrEqual(u,l,n);case t.DataValidationOperator.NOT_BETWEEN:return this.validatorIsNotBetween(u,l,n);case t.DataValidationOperator.NOT_EQUAL:return this.validatorIsNotEqual(u,l,n);default:throw Error(`Unknown operator.`)}}};j=d([u(0,(0,t.Inject)(t.LocaleService)),u(1,(0,t.Inject)(t.Injector))],j),e.AddDataValidationMutation=p,Object.defineProperty(e,"BaseDataValidator",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"DataValidationModel",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"DataValidationResourceController",{enumerable:!0,get:function(){return g}}),e.DataValidatorDropdownType=A,e.DataValidatorRegistryScope=b,e.DataValidatorRegistryService=x,e.FORMULA1=E,e.FORMULA2=D,e.RemoveDataValidationMutation=m,e.TWO_FORMULA_OPERATOR_COUNT=C,e.TYPE=O,Object.defineProperty(e,"UniverDataValidationPlugin",{enumerable:!0,get:function(){return S}}),e.UpdateDataValidationMutation=h,e.UpdateRuleType=a,e.getRuleOptions=i,e.getRuleSetting=r});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("rxjs")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`rxjs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDataValidation={},e.UniverCore,e.rxjs))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function r(e){return{type:e.type,operator:e.operator,formula1:e.formula1,formula2:e.formula2,allowBlank:e.allowBlank}}function i(e){return{error:e.error,errorStyle:e.errorStyle,errorTitle:e.errorTitle,imeMode:e.imeMode,prompt:e.prompt,promptTitle:e.promptTitle,showDropDown:e.showDropDown,showErrorMessage:e.showErrorMessage,showInputMessage:e.showInputMessage,renderMode:e.renderMode,bizInfo:e.bizInfo}}let a=/* @__PURE__ */ function(e){return e[e.SETTING=0]=`SETTING`,e[e.RANGE=1]=`RANGE`,e[e.OPTIONS=2]=`OPTIONS`,e[e.ALL=3]=`ALL`,e}({});function o(e){"@babel/helpers - typeof";return o=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},o(e)}function s(e,t){if(o(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(o(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return o(t)==`symbol`?t:t+``}function l(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return function(n,r){t(n,r,e)}}function d(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let f=class extends t.Disposable{constructor(e){super(),this._logService=e,l(this,`_model`,/* @__PURE__ */ new Map),l(this,`_ruleChange$`,new n.Subject),l(this,`ruleChange$`,this._ruleChange$.asObservable()),l(this,`ruleChangeDebounce$`,this.ruleChange$.pipe((0,n.debounceTime)(20))),this.disposeWithMe({dispose:()=>{this._ruleChange$.complete()}})}_ensureMap(e,t){this._model.has(e)||this._model.set(e,/* @__PURE__ */ new Map);let n=this._model.get(e);if(n.has(t))return n.get(t);let r={map:/* @__PURE__ */ new Map,list:[]};return n.set(t,r),r}_addSubUnitRule(e,t,n){let{map:r,list:i}=e,a=(Array.isArray(t)?t:[t]).filter(e=>!r.has(e.uid));typeof n==`number`&&n<i.length?i.splice(n,0,...a):i.push(...a),a.forEach(e=>{r.set(e.uid,e)})}_removeSubUnitRule(e,t){let{map:n,list:r}=e,i=r.findIndex(e=>e.uid===t);i>-1&&(r.splice(i,1),n.delete(t))}_updateSubUnitRule(e,t,n){let{map:a,list:o}=e,s=a.get(t),c=o.findIndex(e=>t===e.uid);if(!s)throw Error(`Data validation rule is not found, ruleId: ${t}.`);let l={...s};switch(n.type){case 1:l.ranges=n.payload;break;case 0:Object.assign(l,r(n.payload));break;case 2:Object.assign(l,i(n.payload));break;case 3:Object.assign(l,n.payload)}return o[c]=l,a.set(t,l),l}_addRuleSideEffect(e,t,n,r){if(!this._ensureMap(e,t).map.get(n.uid))return{rule:n,type:`add`,unitId:e,subUnitId:t,source:r}}addRule(e,t,n,r,i){try{let a=this._ensureMap(e,t),o=(Array.isArray(n)?n:[n]).map(n=>this._addRuleSideEffect(e,t,n,r));this._addSubUnitRule(a,n,i),o.forEach(e=>{e&&this._ruleChange$.next(e)})}catch(e){this._logService.error(e)}}updateRule(e,n,r,i,a){try{let o=this._ensureMap(e,n),s=t.Tools.deepClone(o.map.get(r));if(!s)throw Error(`Data validation rule is not found, ruleId: ${r}.`);let c=this._updateSubUnitRule(o,r,i);this._ruleChange$.next({rule:c,type:`update`,unitId:e,subUnitId:n,source:a,updatePayload:i,oldRule:s})}catch(e){this._logService.error(e)}}removeRule(e,t,n,r){try{let i=this._ensureMap(e,t),a=i.map.get(n);a&&(this._removeSubUnitRule(i,n),this._ruleChange$.next({rule:a,type:`remove`,unitId:e,subUnitId:t,source:r}))}catch(e){this._logService.error(e)}}getRuleById(e,t,n){return this._ensureMap(e,t).map.get(n)}getRuleIndex(e,t,n){return this._ensureMap(e,t).list.findIndex(e=>e.uid===n)}getRules(e,t){return[...this._ensureMap(e,t).list]}getUnitRules(e){let t=this._model.get(e);if(!t)return[];let n=[];return t.forEach((e,t)=>{n.push([t,e.list])}),n}deleteUnitRules(e){this._model.delete(e)}getSubUnitIds(e){var t;return Array.from(((t=this._model.get(e))==null?void 0:t.keys())??[])}getAll(){return Array.from(this._model.keys()).map(e=>[e,this.getUnitRules(e)])}};f=d([u(0,t.ILogService)],f);let p={type:t.CommandType.MUTATION,id:`data-validation.mutation.addRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,rule:i,index:a,source:o=`command`}=t;return e.get(f).addRule(n,r,i,o,a),!0}},m={type:t.CommandType.MUTATION,id:`data-validation.mutation.removeRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,ruleId:i,source:a=`command`}=t,o=e.get(f);return Array.isArray(i)?i.forEach(e=>{o.removeRule(n,r,e,a)}):o.removeRule(n,r,i,a),!0}},h={type:t.CommandType.MUTATION,id:`data-validation.mutation.updateRule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,ruleId:i,payload:a,source:o=`command`}=t;return e.get(f).updateRule(n,r,i,a,o),!0}},g=class extends t.Disposable{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._dataValidationModel=n,this._initSnapshot()}_initSnapshot(){let e=e=>{let t=this._dataValidationModel.getUnitRules(e),n={};return t?(t.forEach(([e,t])=>{t.length>0&&(n[e]=t)}),JSON.stringify(n)):``},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:`SHEET_DATA_VALIDATION_PLUGIN`,businesses:[t.UniverInstanceType.UNIVER_SHEET],toJson:t=>e(t),parseJson:e=>n(e),onUnLoad:e=>{this._dataValidationModel.deleteUnitRules(e)},onLoad:(e,t)=>{Object.keys(t).forEach(n=>{t[n].forEach(t=>{this._dataValidationModel.addRule(e,n,t,`patched`)})})}}))}};g=d([u(0,t.IResourceManagerService),u(1,t.IUniverInstanceService),u(2,(0,t.Inject)(f))],g);var _=`@univerjs/data-validation`,v=`1.6.0`;let y={},b=/* @__PURE__ */ function(e){return e.SHEET=`sheet`,e}({});var x=class{constructor(){l(this,`_validatorByScopes`,/* @__PURE__ */ new Map),l(this,`_validatorMap`,/* @__PURE__ */ new Map),l(this,`_validatorsChange$`,new n.BehaviorSubject(void 0)),l(this,`validatorsChange$`,this._validatorsChange$.asObservable())}_addValidatorToScope(e,t){this._validatorByScopes.has(t)||this._validatorByScopes.set(t,[]);let n=this._validatorByScopes.get(t);if(n.findIndex(t=>t.id===e.id)>-1)throw Error(`Validator item with the same id ${e.id} has already been added!`);n.push(e)}_removeValidatorFromScope(e,t){let n=this._validatorByScopes.get(t);if(!n)return;let r=n.findIndex(t=>t.id===e.id);r>-1&&n.splice(r,1)}register(e){return this._validatorMap.set(e.id,e),Array.isArray(e.scopes)?e.scopes.forEach(t=>{this._addValidatorToScope(e,t)}):this._addValidatorToScope(e,e.scopes),this._validatorsChange$.next(),(0,t.toDisposable)(()=>{this._validatorMap.delete(e.id),Array.isArray(e.scopes)?e.scopes.forEach(t=>{this._removeValidatorFromScope(e,t)}):this._removeValidatorFromScope(e,e.scopes),this._validatorsChange$.next()})}getValidatorItem(e){return this._validatorMap.get(e)}getValidatorsByScope(e){return this._validatorByScopes.get(e)}};let S=class extends t.Plugin{constructor(e=y,n,r,i){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=i;let{...a}=(0,t.merge)({},y,this._config);this._configService.setConfig(`data-validation.config`,a)}onStarting(){[[f],[x],[g]].forEach(e=>this._injector.add(e)),[p,h,m].forEach(e=>{this._commandService.registerCommand(e)})}onReady(){this._injector.get(g)}};l(S,`pluginName`,`UNIVER_DATA_VALIDATION_PLUGIN`),l(S,`packageName`,_),l(S,`version`,v),l(S,`type`,t.UniverInstanceType.UNIVER_SHEET),S=d([u(1,(0,t.Inject)(t.Injector)),u(2,t.ICommandService),u(3,t.IConfigService)],S);let C=[t.DataValidationOperator.BETWEEN,t.DataValidationOperator.NOT_BETWEEN];t.DataValidationOperator.BETWEEN,t.DataValidationOperator.EQUAL,t.DataValidationOperator.GREATER_THAN,t.DataValidationOperator.GREATER_THAN_OR_EQUAL,t.DataValidationOperator.LESS_THAN,t.DataValidationOperator.LESS_THAN_OR_EQUAL,t.DataValidationOperator.NOT_BETWEEN,t.DataValidationOperator.NOT_EQUAL;let w={[t.DataValidationOperator.BETWEEN]:`data-validation.ruleName.between`,[t.DataValidationOperator.EQUAL]:`data-validation.ruleName.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.ruleName.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.ruleName.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.ruleName.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.ruleName.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.ruleName.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.ruleName.notEqual`,NONE:`data-validation.ruleName.legal`},T={[t.DataValidationOperator.BETWEEN]:`data-validation.errorMsg.between`,[t.DataValidationOperator.EQUAL]:`data-validation.errorMsg.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.errorMsg.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.errorMsg.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.errorMsg.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.errorMsg.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.errorMsg.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.errorMsg.notEqual`,NONE:`data-validation.errorMsg.legal`},E=`{FORMULA1}`,D=`{FORMULA2}`,O=`{TYPE}`,k={[t.DataValidationOperator.BETWEEN]:`data-validation.operators.between`,[t.DataValidationOperator.EQUAL]:`data-validation.operators.equal`,[t.DataValidationOperator.GREATER_THAN]:`data-validation.operators.greaterThan`,[t.DataValidationOperator.GREATER_THAN_OR_EQUAL]:`data-validation.operators.greaterThanOrEqual`,[t.DataValidationOperator.LESS_THAN]:`data-validation.operators.lessThan`,[t.DataValidationOperator.LESS_THAN_OR_EQUAL]:`data-validation.operators.lessThanOrEqual`,[t.DataValidationOperator.NOT_BETWEEN]:`data-validation.operators.notBetween`,[t.DataValidationOperator.NOT_EQUAL]:`data-validation.operators.notEqual`},A=/* @__PURE__ */ function(e){return e.DATE=`date`,e.TIME=`time`,e.DATETIME=`datetime`,e.LIST=`list`,e.MULTIPLE_LIST=`multipleList`,e.COLOR=`color`,e.CASCADE=`cascade`,e}({}),j=class{constructor(e,t){this.localeService=e,this.injector=t,l(this,`offsetFormulaByRange`,!0),l(this,`formulaInput`,void 0),l(this,`canvasRender`,null),l(this,`dropdownType`,void 0),l(this,`optionsInput`,void 0),l(this,`skipDefaultFontRender`,void 0)}get operatorNames(){return this.operators.map(e=>this.localeService.t(k[e]))}get titleStr(){return this.localeService.t(this.title)}generateRuleName(e){if(!e.operator)return this.localeService.t(w.NONE).replace(O,this.titleStr);let t=this.localeService.t(w[e.operator]).replace(E,e.formula1??``).replace(D,e.formula2??``);return`${this.titleStr} ${t}`}generateRuleErrorMessage(e,t){return e.operator?`${this.localeService.t(T[e.operator]).replace(E,e.formula1??``).replace(D,e.formula2??``)}`:this.localeService.t(T.NONE).replace(O,this.titleStr)}getExtraStyle(e,t,n,r,i){}getRuleFinalError(e,t){return e.showErrorMessage&&e.error?e.error:this.generateRuleErrorMessage(e,t)}isEmptyCellValue(e){return e===``||e==null}normalizeFormula(e,t,n){return{formula1:e.formula1,formula2:e.formula2}}async isValidType(e,t,n){return!0}transform(e,t,n){return e}async validatorIsEqual(e,t,n){let{formula1:r}=t,{value:i}=e;return Number.isNaN(r)?!0:i===r}async validatorIsNotEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value!==r}async validatorIsBetween(e,t,n){let{formula1:r,formula2:i}=t;if(Number.isNaN(r)||Number.isNaN(i))return!0;let a=Math.min(r,i),o=Math.max(r,i);return e.value>=a&&e.value<=o}async validatorIsNotBetween(e,t,n){let{formula1:r,formula2:i}=t;if(Number.isNaN(r)||Number.isNaN(i))return!0;let a=Math.min(r,i),o=Math.max(r,i);return e.value<a||e.value>o}async validatorIsGreaterThan(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value>r}async validatorIsGreaterThanOrEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value>=r}async validatorIsLessThan(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value<r}async validatorIsLessThanOrEqual(e,t,n){let{formula1:r}=t;return Number.isNaN(r)?!0:e.value<=r}async validator(e,n){let{value:r,unitId:i,subUnitId:a}=e,o=this.isEmptyCellValue(r),{allowBlank:s=!0,operator:c}=n;if(o)return s;let l=await this.parseFormula(n,i,a,e.row,e.column);if(!l.isFormulaValid||!await this.isValidType(e,l,n))return!1;if(!c)return!0;let u=this.transform(e,l,n);switch(c){case t.DataValidationOperator.BETWEEN:return this.validatorIsBetween(u,l,n);case t.DataValidationOperator.EQUAL:return this.validatorIsEqual(u,l,n);case t.DataValidationOperator.GREATER_THAN:return this.validatorIsGreaterThan(u,l,n);case t.DataValidationOperator.GREATER_THAN_OR_EQUAL:return this.validatorIsGreaterThanOrEqual(u,l,n);case t.DataValidationOperator.LESS_THAN:return this.validatorIsLessThan(u,l,n);case t.DataValidationOperator.LESS_THAN_OR_EQUAL:return this.validatorIsLessThanOrEqual(u,l,n);case t.DataValidationOperator.NOT_BETWEEN:return this.validatorIsNotBetween(u,l,n);case t.DataValidationOperator.NOT_EQUAL:return this.validatorIsNotEqual(u,l,n);default:throw Error(`Unknown operator.`)}}};j=d([u(0,(0,t.Inject)(t.LocaleService)),u(1,(0,t.Inject)(t.Injector))],j),e.AddDataValidationMutation=p,Object.defineProperty(e,"BaseDataValidator",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"DataValidationModel",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"DataValidationResourceController",{enumerable:!0,get:function(){return g}}),e.DataValidatorDropdownType=A,e.DataValidatorRegistryScope=b,e.DataValidatorRegistryService=x,e.FORMULA1=E,e.FORMULA2=D,e.RemoveDataValidationMutation=m,e.TWO_FORMULA_OPERATOR_COUNT=C,e.TYPE=O,Object.defineProperty(e,"UniverDataValidationPlugin",{enumerable:!0,get:function(){return S}}),e.UpdateDataValidationMutation=h,e.UpdateRuleType=a,e.getRuleOptions=i,e.getRuleSetting=r});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/data-validation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared data validation models and rule services for Univer.",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs/core": "1.
|
|
60
|
+
"@univerjs/core": "1.6.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@univerjs-infra/shared": "1.
|
|
64
|
-
"@univerjs/protocol": "1.
|
|
65
|
-
"@univerjs/sheets": "1.
|
|
63
|
+
"@univerjs-infra/shared": "1.6.0",
|
|
64
|
+
"@univerjs/protocol": "1.6.0",
|
|
65
|
+
"@univerjs/sheets": "1.6.0",
|
|
66
66
|
"rxjs": "7.8.2",
|
|
67
|
-
"tsrs": "
|
|
68
|
-
"vitest": "^5.1.
|
|
67
|
+
"tsrs": "7.1.0-beta.tsrs2",
|
|
68
|
+
"vitest": "^5.1.1"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"test": "vitest run",
|