@univerjs/data-validation 0.3.0-alpha.0 → 0.3.0-nightly.202410101606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -671
- package/lib/types/plugin.d.ts +2 -1
- package/lib/types/validators/base-data-validator.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +7 -8
- package/LICENSE +0 -176
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
1
|
import { IUniverDataValidationConfig } from './controllers/config.schema';
|
|
2
|
+
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
export declare class UniverDataValidationPlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
5
5
|
protected _injector: Injector;
|
|
@@ -9,4 +9,5 @@ export declare class UniverDataValidationPlugin extends Plugin {
|
|
|
9
9
|
static type: UniverInstanceType;
|
|
10
10
|
constructor(_config: Partial<IUniverDataValidationConfig> | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService);
|
|
11
11
|
onStarting(): void;
|
|
12
|
+
onReady(): void;
|
|
12
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellValue, IDataValidationRule, IDataValidationRuleBase, IStyleData, Nullable, Workbook, Worksheet, DataValidationOperator, Injector, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { CellValueType } from '@univerjs/protocol';
|
|
3
3
|
import { IBaseDataValidationWidget } from './base-widget';
|
|
4
4
|
export interface IValidatorCellInfo<DataType = Nullable<CellValue>> {
|
|
@@ -28,7 +28,7 @@ export declare abstract class BaseDataValidator<DataType = CellValue> {
|
|
|
28
28
|
abstract title: string;
|
|
29
29
|
abstract operators: DataValidationOperator[];
|
|
30
30
|
abstract scopes: string[] | string;
|
|
31
|
-
|
|
31
|
+
formulaInput: string | undefined;
|
|
32
32
|
canvasRender: Nullable<IBaseDataValidationWidget>;
|
|
33
33
|
dropdown: string | undefined;
|
|
34
34
|
optionsInput: string | undefined;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverDataValidation={},global.UniverCore,global.rxjs))})(this,function(exports2,core,rxjs){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c,_d;function getRuleSetting(rule){return{type:rule.type,operator:rule.operator,formula1:rule.formula1,formula2:rule.formula2,allowBlank:rule.allowBlank}}__name(getRuleSetting,"getRuleSetting");function getRuleOptions(rule){return{error:rule.error,errorStyle:rule.errorStyle,errorTitle:rule.errorTitle,imeMode:rule.imeMode,prompt:rule.prompt,promptTitle:rule.promptTitle,showDropDown:rule.showDropDown,showErrorMessage:rule.showErrorMessage,showInputMessage:rule.showInputMessage,renderMode:rule.renderMode,bizInfo:rule.bizInfo}}__name(getRuleOptions,"getRuleOptions");var UpdateRuleType=(UpdateRuleType2=>(UpdateRuleType2[UpdateRuleType2.SETTING=0]="SETTING",UpdateRuleType2[UpdateRuleType2.RANGE=1]="RANGE",UpdateRuleType2[UpdateRuleType2.OPTIONS=2]="OPTIONS",UpdateRuleType2))(UpdateRuleType||{}),__defProp$3=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__decorateClass$3=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$3(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$3(target,key,result),result},"__decorateClass$3"),__decorateParam$3=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$3");exports2.DataValidationModel=(_a=class extends core.Disposable{constructor(_logService){super();__publicField(this,"_model",new Map);__publicField(this,"_ruleChange$",new rxjs.Subject);__publicField(this,"ruleChange$",this._ruleChange$.asObservable());__publicField(this,"ruleChangeDebounce$",this.ruleChange$.pipe(rxjs.debounceTime(20)));this._logService=_logService,this.disposeWithMe({dispose:__name(()=>{this._ruleChange$.complete()},"dispose")})}_ensureMap(unitId,subUnitId){this._model.has(unitId)||this._model.set(unitId,new Map);const unitMap=this._model.get(unitId);if(unitMap.has(subUnitId))return unitMap.get(subUnitId);const map={map:new Map,list:[]};return unitMap.set(subUnitId,map),map}_addSubUnitRule(subUnit,rule,index){const{map:dataValidationMap,list:dataValidations}=subUnit,rules=(Array.isArray(rule)?rule:[rule]).filter(item=>!dataValidationMap.has(item.uid));typeof index=="number"&&index<dataValidations.length?dataValidations.splice(index,0,...rules):dataValidations.push(...rules),rules.forEach(item=>{dataValidationMap.set(item.uid,item)})}_removeSubUnitRule(subUnit,ruleId){const{map:dataValidationMap,list:dataValidations}=subUnit,index=dataValidations.findIndex(item=>item.uid===ruleId);index>-1&&(dataValidations.splice(index,1),dataValidationMap.delete(ruleId))}_updateSubUnitRule(subUnit,ruleId,payload){const{map:dataValidationMap,list:dataValidations}=subUnit,oldRule=dataValidationMap.get(ruleId),index=dataValidations.findIndex(rule2=>ruleId===rule2.uid);if(!oldRule)throw new Error(`Data validation rule is not found, ruleId: ${ruleId}.`);const rule={...oldRule};switch(payload.type){case UpdateRuleType.RANGE:{rule.ranges=payload.payload;break}case UpdateRuleType.SETTING:{Object.assign(rule,getRuleSetting(payload.payload));break}case UpdateRuleType.OPTIONS:{Object.assign(rule,getRuleOptions(payload.payload));break}}return dataValidations[index]=rule,dataValidationMap.set(ruleId,rule),rule}_addRuleSideEffect(unitId,subUnitId,rule,source){if(!this._ensureMap(unitId,subUnitId).map.get(rule.uid))return{rule,type:"add",unitId,subUnitId,source}}addRule(unitId,subUnitId,rule,source,index){try{const subUnitMap=this._ensureMap(unitId,subUnitId),effects=(Array.isArray(rule)?rule:[rule]).map(item=>this._addRuleSideEffect(unitId,subUnitId,item,source));this._addSubUnitRule(subUnitMap,rule,index),effects.forEach(effect=>{effect&&this._ruleChange$.next(effect)})}catch(error){this._logService.error(error)}}updateRule(unitId,subUnitId,ruleId,payload,source){try{const subUnitMap=this._ensureMap(unitId,subUnitId),oldRule=core.Tools.deepClone(subUnitMap.map.get(ruleId));if(!oldRule)throw new Error(`Data validation rule is not found, ruleId: ${ruleId}.`);const rule=this._updateSubUnitRule(subUnitMap,ruleId,payload);this._ruleChange$.next({rule,type:"update",unitId,subUnitId,source,updatePayload:payload,oldRule})}catch(error){this._logService.error(error)}}removeRule(unitId,subUnitId,ruleId,source){try{const map=this._ensureMap(unitId,subUnitId),oldRule=map.map.get(ruleId);oldRule&&(this._removeSubUnitRule(map,ruleId),this._ruleChange$.next({rule:oldRule,type:"remove",unitId,subUnitId,source}))}catch(error){this._logService.error(error)}}getRuleById(unitId,subUnitId,ruleId){return this._ensureMap(unitId,subUnitId).map.get(ruleId)}getRuleIndex(unitId,subUnitId,ruleId){return this._ensureMap(unitId,subUnitId).list.findIndex(rule=>rule.uid===ruleId)}getRules(unitId,subUnitId){return[...this._ensureMap(unitId,subUnitId).list]}getUnitRules(unitId){const unitMap=this._model.get(unitId);if(!unitMap)return[];const res=[];return unitMap.forEach((manager,subUnitId)=>{res.push([subUnitId,manager.list])}),res}deleteUnitRules(unitId){this._model.delete(unitId)}getSubUnitIds(unitId){var _a2,_b2;return Array.from((_b2=(_a2=this._model.get(unitId))==null?void 0:_a2.keys())!=null?_b2:[])}getAll(){return Array.from(this._model.keys()).map(unitId=>[unitId,this.getUnitRules(unitId)])}},__name(_a,"DataValidationModel"),_a),exports2.DataValidationModel=__decorateClass$3([__decorateParam$3(0,core.ILogService)],exports2.DataValidationModel);var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2");const DATA_VALIDATION_PLUGIN_NAME="SHEET_DATA_VALIDATION_PLUGIN";exports2.DataValidationResourceController=(_b=class extends core.Disposable{constructor(_resourceManagerService,_univerInstanceService,_dataValidationModel){super(),this._resourceManagerService=_resourceManagerService,this._univerInstanceService=_univerInstanceService,this._dataValidationModel=_dataValidationModel,this._initSnapshot()}_initSnapshot(){const toJson=__name(unitID=>{const map=this._dataValidationModel.getUnitRules(unitID),resultMap={};return map?(map.forEach(([key,v])=>{resultMap[key]=v}),JSON.stringify(resultMap)):""},"toJson"),parseJson=__name(json=>{if(!json)return{};try{return JSON.parse(json)}catch{return{}}},"parseJson");this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:DATA_VALIDATION_PLUGIN_NAME,businesses:[core.UniverInstanceType.UNIVER_SHEET],toJson:__name(unitID=>toJson(unitID),"toJson"),parseJson:__name(json=>parseJson(json),"parseJson"),onUnLoad:__name(unitID=>{this._dataValidationModel.deleteUnitRules(unitID)},"onUnLoad"),onLoad:__name((unitID,value)=>{Object.keys(value).forEach(subunitId=>{value[subunitId].forEach(rule=>{this._dataValidationModel.addRule(unitID,subunitId,rule,"patched")})})},"onLoad")}))}},__name(_b,"DataValidationResourceController"),_b),exports2.DataValidationResourceController=__decorateClass$2([core.OnLifecycle(core.LifecycleStages.Ready,exports2.DataValidationResourceController),__decorateParam$2(0,core.IResourceManagerService),__decorateParam$2(1,core.IUniverInstanceService),__decorateParam$2(2,core.Inject(exports2.DataValidationModel))],exports2.DataValidationResourceController);var DataValidatorRegistryScope=(DataValidatorRegistryScope2=>(DataValidatorRegistryScope2.SHEET="sheet",DataValidatorRegistryScope2))(DataValidatorRegistryScope||{});const _DataValidatorRegistryService=class _DataValidatorRegistryService{constructor(){__publicField(this,"_validatorByScopes",new Map);__publicField(this,"_validatorMap",new Map);__publicField(this,"_validatorsChange$",new rxjs.BehaviorSubject(void 0));__publicField(this,"validatorsChange$",this._validatorsChange$.asObservable())}_addValidatorToScope(validator,scope){this._validatorByScopes.has(scope)||this._validatorByScopes.set(scope,[]);const validators=this._validatorByScopes.get(scope);if(validators.findIndex(m=>m.id===validator.id)>-1)throw new Error(`Validator item with the same id ${validator.id} has already been added!`);validators.push(validator)}_removeValidatorFromScope(validator,scope){const validators=this._validatorByScopes.get(scope);if(!validators)return;const index=validators.findIndex(v=>v.id===validator.id);index>-1&&validators.splice(index,1)}register(validator){return this._validatorMap.set(validator.id,validator),Array.isArray(validator.scopes)?validator.scopes.forEach(scope=>{this._addValidatorToScope(validator,scope)}):this._addValidatorToScope(validator,validator.scopes),this._validatorsChange$.next(),core.toDisposable(()=>{this._validatorMap.delete(validator.id),Array.isArray(validator.scopes)?validator.scopes.forEach(scope=>{this._removeValidatorFromScope(validator,scope)}):this._removeValidatorFromScope(validator,validator.scopes),this._validatorsChange$.next()})}getValidatorItem(id){return this._validatorMap.get(id)}getValidatorsByScope(scope){return this._validatorByScopes.get(scope)}};__name(_DataValidatorRegistryService,"DataValidatorRegistryService");let DataValidatorRegistryService=_DataValidatorRegistryService;const AddDataValidationMutation={type:core.CommandType.MUTATION,id:"data-validation.mutation.addRule",handler(accessor,params){if(!params)return!1;const{unitId,subUnitId,rule,index,source="command"}=params;return accessor.get(exports2.DataValidationModel).addRule(unitId,subUnitId,rule,source,index),!0}},RemoveDataValidationMutation={type:core.CommandType.MUTATION,id:"data-validation.mutation.removeRule",handler(accessor,params){if(!params)return!1;const{unitId,subUnitId,ruleId,source="command"}=params,dataValidationModel=accessor.get(exports2.DataValidationModel);return Array.isArray(ruleId)?ruleId.forEach(item=>{dataValidationModel.removeRule(unitId,subUnitId,item,source)}):dataValidationModel.removeRule(unitId,subUnitId,ruleId,source),!0}},UpdateDataValidationMutation={type:core.CommandType.MUTATION,id:"data-validation.mutation.updateRule",handler(accessor,params){if(!params)return!1;const{unitId,subUnitId,ruleId,payload,source="command"}=params;return accessor.get(exports2.DataValidationModel).updateRule(unitId,subUnitId,ruleId,payload,source),!0}},AddDataValidationCommand={type:core.CommandType.COMMAND,id:"data-validation.command.addRule",async handler(accessor,params){if(accessor.get(core.ILogService).error("[Deprecated]: `AddDataValidationCommand` is deprecated, please use `AddSheetDataValidationCommand` in `@univerjs/sheets-data-validation` instead!"),!params)return!1;const{rule,unitId,subUnitId}=params,commandService=accessor.get(core.ICommandService),undoRedoService=accessor.get(core.IUndoRedoService),mutationParams={...params,rule:{...params.rule,ranges:[params.rule.range]}},redoMutations=[{id:AddDataValidationMutation.id,params:mutationParams}],undoMutations=[{id:RemoveDataValidationMutation.id,params:{unitId,subUnitId,ruleId:rule.uid}}];return undoRedoService.pushUndoRedo({unitID:unitId,redoMutations,undoMutations}),await commandService.executeCommand(AddDataValidationMutation.id,mutationParams),!0}},RemoveDataValidationCommand={type:core.CommandType.COMMAND,id:"data-validation.command.removeRule",handler(accessor,params){if(accessor.get(core.ILogService).error("[Deprecated]: `RemoveDataValidationCommand` is deprecated, please use `RemoveSheetDataValidationCommand` in `@univerjs/sheets-data-validation` instead!"),!params)return!1;const{unitId,subUnitId,ruleId}=params,commandService=accessor.get(core.ICommandService),undoRedoService=accessor.get(core.IUndoRedoService),dataValidationModel=accessor.get(exports2.DataValidationModel),redoMutations=[{id:RemoveDataValidationMutation.id,params}],undoMutations=[{id:AddDataValidationMutation.id,params:{unitId,subUnitId,rule:{...dataValidationModel.getRuleById(unitId,subUnitId,ruleId)},index:dataValidationModel.getRuleIndex(unitId,subUnitId,ruleId)}}];return undoRedoService.pushUndoRedo({undoMutations,redoMutations,unitID:params.unitId}),commandService.executeCommand(RemoveDataValidationMutation.id,params),!0}},UpdateDataValidationOptionsCommand={type:core.CommandType.COMMAND,id:"data-validation.command.updateDataValidationSetting",handler(accessor,params){if(accessor.get(core.ILogService).warn("[Deprecated]: `UpdateDataValidationOptionsCommand` is deprecated, please use `UpdateSheetDataValidationOptionsCommand` in `@univerjs/sheets-data-validation` instead!"),!params)return!1;const commandService=accessor.get(core.ICommandService),redoUndoService=accessor.get(core.IUndoRedoService),dataValidationModel=accessor.get(exports2.DataValidationModel),{unitId,subUnitId,ruleId,options}=params,rule=dataValidationModel.getRuleById(unitId,subUnitId,ruleId);if(!rule)return!1;const mutationParams={unitId,subUnitId,ruleId,payload:{type:UpdateRuleType.OPTIONS,payload:options}},redoMutations=[{id:UpdateDataValidationMutation.id,params:mutationParams}],undoMutationParams={unitId,subUnitId,ruleId,payload:{type:UpdateRuleType.OPTIONS,payload:getRuleOptions(rule)}},undoMutations=[{id:UpdateDataValidationMutation.id,params:undoMutationParams}];return redoUndoService.pushUndoRedo({unitID:unitId,redoMutations,undoMutations}),commandService.executeCommand(UpdateDataValidationMutation.id,mutationParams),!0}},UpdateDataValidationSettingCommand={type:core.CommandType.COMMAND,id:"data-validation.command.updateDataValidationOptions",handler(accessor,params){if(accessor.get(core.ILogService).error("[Deprecated]: `UpdateDataValidationSettingCommand` is deprecated, please use `UpdateSheetDataValidationSettingCommand` in `@univerjs/sheets-data-validation` instead!"),!params)return!1;const commandService=accessor.get(core.ICommandService),redoUndoService=accessor.get(core.IUndoRedoService),dataValidationModel=accessor.get(exports2.DataValidationModel),dataValidatorRegistryService=accessor.get(DataValidatorRegistryService),{unitId,subUnitId,ruleId,setting}=params,validator=dataValidatorRegistryService.getValidatorItem(setting.type);if(!validator)return!1;const rule=dataValidationModel.getRuleById(unitId,subUnitId,ruleId);if(!rule)return!1;const newRule={...rule,...setting};if(!validator.validatorFormula(newRule,unitId,subUnitId).success)return!1;const mutationParams={unitId,subUnitId,ruleId,payload:{type:UpdateRuleType.SETTING,payload:{...setting,...validator.normalizeFormula(newRule,unitId,subUnitId)}}},redoMutations=[{id:UpdateDataValidationMutation.id,params:mutationParams}],undoMutationParams={unitId,subUnitId,ruleId,payload:{type:UpdateRuleType.SETTING,payload:getRuleSetting(rule)}},undoMutations=[{id:UpdateDataValidationMutation.id,params:undoMutationParams}];return redoUndoService.pushUndoRedo({unitID:unitId,redoMutations,undoMutations}),commandService.executeCommand(UpdateDataValidationMutation.id,mutationParams),!0}},RemoveAllDataValidationCommand={type:core.CommandType.COMMAND,id:"data-validation.command.removeAll",handler(accessor,params){if(accessor.get(core.ILogService).error("[Deprecated]: `RemoveAllDataValidationCommand` is deprecated, please use `RemoveSheetAllDataValidationCommand` in `@univerjs/sheets-data-validation` instead!"),!params)return!1;const{unitId,subUnitId}=params,commandService=accessor.get(core.ICommandService),dataValidationModel=accessor.get(exports2.DataValidationModel),undoRedoService=accessor.get(core.IUndoRedoService),currentRules=[...dataValidationModel.getRules(unitId,subUnitId)],redoParams={unitId,subUnitId,ruleId:currentRules.map(rule=>rule.uid)},redoMutations=[{id:RemoveDataValidationMutation.id,params:redoParams}],undoMutations=[{id:AddDataValidationMutation.id,params:{unitId,subUnitId,rule:currentRules}}];return undoRedoService.pushUndoRedo({redoMutations,undoMutations,unitID:unitId}),commandService.executeCommand(RemoveDataValidationMutation.id,redoParams),!0}},PLUGIN_CONFIG_KEY="data-validation.config",defaultPluginConfig={};var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const PLUGIN_NAME="UNIVER_DATA_VALIDATION_PLUGIN";exports2.UniverDataValidationPlugin=(_c=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_commandService,_configService){super(),this._config=_config,this._injector=_injector,this._commandService=_commandService,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[exports2.DataValidationModel],[DataValidatorRegistryService],[exports2.DataValidationResourceController]].forEach(d=>this._injector.add(d)),[AddDataValidationCommand,RemoveAllDataValidationCommand,UpdateDataValidationOptionsCommand,UpdateDataValidationSettingCommand,RemoveDataValidationCommand,AddDataValidationMutation,UpdateDataValidationMutation,RemoveDataValidationMutation].forEach(command=>{this._commandService.registerCommand(command)})}},__name(_c,"UniverDataValidationPlugin"),__publicField(_c,"pluginName",PLUGIN_NAME),__publicField(_c,"type",core.UniverInstanceType.UNIVER_SHEET),_c),exports2.UniverDataValidationPlugin=__decorateClass$1([__decorateParam$1(1,core.Inject(core.Injector)),__decorateParam$1(2,core.ICommandService),__decorateParam$1(3,core.IConfigService)],exports2.UniverDataValidationPlugin),core.DataValidationOperator.BETWEEN+"",core.DataValidationOperator.EQUAL+"",core.DataValidationOperator.GREATER_THAN+"",core.DataValidationOperator.GREATER_THAN_OR_EQUAL+"",core.DataValidationOperator.LESS_THAN+"",core.DataValidationOperator.LESS_THAN_OR_EQUAL+"",core.DataValidationOperator.NOT_BETWEEN+"",core.DataValidationOperator.NOT_EQUAL+"";const OperatorTitleMap={[core.DataValidationOperator.BETWEEN]:"dataValidation.ruleName.between",[core.DataValidationOperator.EQUAL]:"dataValidation.ruleName.equal",[core.DataValidationOperator.GREATER_THAN]:"dataValidation.ruleName.greaterThan",[core.DataValidationOperator.GREATER_THAN_OR_EQUAL]:"dataValidation.ruleName.greaterThanOrEqual",[core.DataValidationOperator.LESS_THAN]:"dataValidation.ruleName.lessThan",[core.DataValidationOperator.LESS_THAN_OR_EQUAL]:"dataValidation.ruleName.lessThanOrEqual",[core.DataValidationOperator.NOT_BETWEEN]:"dataValidation.ruleName.notBetween",[core.DataValidationOperator.NOT_EQUAL]:"dataValidation.ruleName.notEqual"},OperatorErrorTitleMap={[core.DataValidationOperator.BETWEEN]:"dataValidation.errorMsg.between",[core.DataValidationOperator.EQUAL]:"dataValidation.errorMsg.equal",[core.DataValidationOperator.GREATER_THAN]:"dataValidation.errorMsg.greaterThan",[core.DataValidationOperator.GREATER_THAN_OR_EQUAL]:"dataValidation.errorMsg.greaterThanOrEqual",[core.DataValidationOperator.LESS_THAN]:"dataValidation.errorMsg.lessThan",[core.DataValidationOperator.LESS_THAN_OR_EQUAL]:"dataValidation.errorMsg.lessThanOrEqual",[core.DataValidationOperator.NOT_BETWEEN]:"dataValidation.errorMsg.notBetween",[core.DataValidationOperator.NOT_EQUAL]:"dataValidation.errorMsg.notEqual"},TextLengthErrorTitleMap={[core.DataValidationOperator.BETWEEN]:"dataValidation.textLength.errorMsg.between",[core.DataValidationOperator.EQUAL]:"dataValidation.textLength.errorMsg.equal",[core.DataValidationOperator.GREATER_THAN]:"dataValidation.textLength.errorMsg.greaterThan",[core.DataValidationOperator.GREATER_THAN_OR_EQUAL]:"dataValidation.textLength.errorMsg.greaterThanOrEqual",[core.DataValidationOperator.LESS_THAN]:"dataValidation.textLength.errorMsg.lessThan",[core.DataValidationOperator.LESS_THAN_OR_EQUAL]:"dataValidation.textLength.errorMsg.lessThanOrEqual",[core.DataValidationOperator.NOT_BETWEEN]:"dataValidation.textLength.errorMsg.notBetween",[core.DataValidationOperator.NOT_EQUAL]:"dataValidation.textLength.errorMsg.notEqual"},TWO_FORMULA_OPERATOR_COUNT=[core.DataValidationOperator.BETWEEN,core.DataValidationOperator.NOT_BETWEEN];var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam");const FORMULA1="{FORMULA1}",FORMULA2="{FORMULA2}",operatorNameMap={[core.DataValidationOperator.BETWEEN]:"dataValidation.operators.between",[core.DataValidationOperator.EQUAL]:"dataValidation.operators.equal",[core.DataValidationOperator.GREATER_THAN]:"dataValidation.operators.greaterThan",[core.DataValidationOperator.GREATER_THAN_OR_EQUAL]:"dataValidation.operators.greaterThanOrEqual",[core.DataValidationOperator.LESS_THAN]:"dataValidation.operators.lessThan",[core.DataValidationOperator.LESS_THAN_OR_EQUAL]:"dataValidation.operators.lessThanOrEqual",[core.DataValidationOperator.NOT_BETWEEN]:"dataValidation.operators.notBetween",[core.DataValidationOperator.NOT_EQUAL]:"dataValidation.operators.notEqual"};exports2.BaseDataValidator=(_d=class{constructor(localeService,injector){__publicField(this,"canvasRender",null);__publicField(this,"dropdown");__publicField(this,"optionsInput");__publicField(this,"skipDefaultFontRender");this.localeService=localeService,this.injector=injector}get operatorNames(){return this.operators.map(operator=>this.localeService.t(operatorNameMap[operator]))}get titleStr(){return this.localeService.t(this.title)}generateRuleName(rule){var _a2,_b2;if(!rule.operator)return this.titleStr;const ruleName=this.localeService.t(OperatorTitleMap[rule.operator]).replace(FORMULA1,(_a2=rule.formula1)!=null?_a2:"").replace(FORMULA2,(_b2=rule.formula2)!=null?_b2:"");return`${this.titleStr} ${ruleName}`}generateRuleErrorMessage(rule){var _a2,_b2;return rule.operator?`${this.localeService.t(OperatorErrorTitleMap[rule.operator]).replace(FORMULA1,(_a2=rule.formula1)!=null?_a2:"").replace(FORMULA2,(_b2=rule.formula2)!=null?_b2:"")}`:this.titleStr}getExtraStyle(rule,value,ctx){}getRuleFinalError(rule){return rule.showErrorMessage&&rule.error?rule.error:this.generateRuleErrorMessage(rule)}isEmptyCellValue(cellValue){return cellValue===""||cellValue===void 0||cellValue===null}normalizeFormula(rule,unitId,subUnitId){return{formula1:rule.formula1,formula2:rule.formula2}}async isValidType(cellInfo,formula,rule){return!0}transform(cellInfo,formula,rule){return cellInfo}async validatorIsEqual(cellInfo,formula,rule){return!0}async validatorIsNotEqual(cellInfo,formula,rule){return!0}async validatorIsBetween(cellInfo,formula,rule){return!0}async validatorIsNotBetween(cellInfo,formula,rule){return!0}async validatorIsGreaterThan(cellInfo,formula,rule){return!0}async validatorIsGreaterThanOrEqual(cellInfo,formula,rule){return!0}async validatorIsLessThan(cellInfo,formula,rule){return!0}async validatorIsLessThanOrEqual(cellInfo,formula,rule){return!0}async validator(cellInfo,rule){const{value:cellValue,unitId,subUnitId}=cellInfo,isEmpty=this.isEmptyCellValue(cellValue),{allowBlank=!0,operator}=rule;if(isEmpty)return allowBlank;const formulaInfo=await this.parseFormula(rule,unitId,subUnitId);if(!await this.isValidType(cellInfo,formulaInfo,rule))return!1;if(!core.Tools.isDefine(operator))return!0;const transformedCell=this.transform(cellInfo,formulaInfo,rule);switch(operator){case core.DataValidationOperator.BETWEEN:return this.validatorIsBetween(transformedCell,formulaInfo,rule);case core.DataValidationOperator.EQUAL:return this.validatorIsEqual(transformedCell,formulaInfo,rule);case core.DataValidationOperator.GREATER_THAN:return this.validatorIsGreaterThan(transformedCell,formulaInfo,rule);case core.DataValidationOperator.GREATER_THAN_OR_EQUAL:return this.validatorIsGreaterThanOrEqual(transformedCell,formulaInfo,rule);case core.DataValidationOperator.LESS_THAN:return this.validatorIsLessThan(transformedCell,formulaInfo,rule);case core.DataValidationOperator.LESS_THAN_OR_EQUAL:return this.validatorIsLessThanOrEqual(transformedCell,formulaInfo,rule);case core.DataValidationOperator.NOT_BETWEEN:return this.validatorIsNotBetween(transformedCell,formulaInfo,rule);case core.DataValidationOperator.NOT_EQUAL:return this.validatorIsNotEqual(transformedCell,formulaInfo,rule);default:throw new Error("Unknown operator.")}}},__name(_d,"BaseDataValidator"),_d),exports2.BaseDataValidator=__decorateClass([__decorateParam(0,core.Inject(core.LocaleService)),__decorateParam(1,core.Inject(core.Injector))],exports2.BaseDataValidator),exports2.AddDataValidationMutation=AddDataValidationMutation,exports2.DataValidatorRegistryScope=DataValidatorRegistryScope,exports2.DataValidatorRegistryService=DataValidatorRegistryService,exports2.RemoveDataValidationMutation=RemoveDataValidationMutation,exports2.TWO_FORMULA_OPERATOR_COUNT=TWO_FORMULA_OPERATOR_COUNT,exports2.TextLengthErrorTitleMap=TextLengthErrorTitleMap,exports2.UpdateDataValidationMutation=UpdateDataValidationMutation,exports2.UpdateRuleType=UpdateRuleType,exports2.getRuleOptions=getRuleOptions,exports2.getRuleSetting=getRuleSetting,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
function _0x269e(_0x55594b,_0x1bc369){const _0x3ac891=_0x3ac8();return _0x269e=function(_0x269e9b,_0x2ed44c){_0x269e9b=_0x269e9b-0x181;let _0x359667=_0x3ac891[_0x269e9b];return _0x359667;},_0x269e(_0x55594b,_0x1bc369);}function _0x3ac8(){const _0x42e11b=['filter','optionsInput','data-validation.mutation.addRule','18ODSMJA','getValidatorsByScope','injector','getRuleFinalError','ICommandService','parseJson','Data\x20validation\x20rule\x20is\x20not\x20found,\x20ruleId:\x20','_addSubUnitRule','data-validation.command.removeAll','dataValidation.ruleName.notBetween','EQUAL','registerCommand','isValidType','_removeSubUnitRule','GREATER_THAN','remove','showErrorMessage','setConfig','ranges','from','data-validation.mutation.updateRule','_univerInstanceService','1795296VJUjbO','_config','titleStr','7605103ohKVOG','formula2','formula1','stringify','patched','getRules','dataValidation.textLength.errorMsg.equal','2082GpHpGg','registerPluginResource','isDefine','formulaInput','UniverInstanceType','name','dataValidation.operators.equal','SETTING','BehaviorSubject','number','validatorIsNotEqual','isEmptyCellValue','removeRule','TextLengthErrorTitleMap','RemoveDataValidationMutation','rule','SHEET','Tools','UniverDataValidation','LESS_THAN_OR_EQUAL','_configService','UniverDataValidationPlugin','update','2263675uZuLlK','dataValidation.ruleName.equal','getRuleOptions','push','COMMAND','dataValidation.operators.lessThan','381190zzecoy','forEach','8421YIKLVm','getRuleSetting','139020lNMPqi','getRuleIndex','_initSnapshot','getSubUnitIds','Module','DataValidationResourceController','updateRule','ILogService','data-validation.config','toJson','DataValidatorRegistryScope','addRule','OPTIONS','_addValidatorToScope','dataValidation.errorMsg.notEqual','skipDefaultFontRender','Validator\x20item\x20with\x20the\x20same\x20id\x20','set','validatorIsLessThanOrEqual','_addRuleSideEffect','\x20has\x20already\x20been\x20added!','dataValidation.operators.lessThanOrEqual','NOT_EQUAL','renderMode','parse','dataValidation.textLength.errorMsg.lessThan','delete','[Deprecated]:\x20`RemoveAllDataValidationCommand`\x20is\x20deprecated,\x20please\x20use\x20`RemoveSheetAllDataValidationCommand`\x20in\x20`@univerjs/sheets-data-validation`\x20instead!','findIndex','CommandType','_commandService','normalizeFormula','dataValidation.ruleName.notEqual','data-validation.command.addRule','ruleChangeDebounce$','dataValidation.textLength.errorMsg.between','sheet','range','asObservable','replace','generateRuleName','_ruleChange$','splice','onLoad','IConfigService','type','validatorIsGreaterThanOrEqual','showDropDown','DataValidationOperator','has','payload','IResourceManagerService','success','DataValidatorRegistryService','length','register','__decorateParam$3','@univerjs/core','4UCAmDT','imeMode','_resourceManagerService','_removeValidatorFromScope','pushUndoRedo','operator','_validatorsChange$','isArray','validatorIsNotBetween','pipe','_dataValidationModel','add','dataValidation.operators.greaterThanOrEqual','executeCommand','_updateSubUnitRule','prompt','UNIVER_SHEET','uid','dataValidation.ruleName.lessThan','getRuleById','dropdown','onReady','{FORMULA2}','validatorIsLessThan','dataValidation.ruleName.greaterThan','getValidatorItem','_validatorByScopes','assign','deepClone','_model','list','command','canvasRender','validatorIsBetween','validatorFormula','Disposable','LESS_THAN','onUnLoad','dataValidation.operators.greaterThan','rxjs','99VKpVQN','LocaleService','dataValidation.errorMsg.between','defineProperty','dispose','_ensureMap','MUTATION','errorStyle','[Deprecated]:\x20`RemoveDataValidationCommand`\x20is\x20deprecated,\x20please\x20use\x20`RemoveSheetDataValidationCommand`\x20in\x20`@univerjs/sheets-data-validation`\x20instead!','DataValidationModel','_validatorMap','dataValidation.operators.notEqual','_logService','validatorIsEqual','validator','BaseDataValidator','validatorIsGreaterThan','error','getOwnPropertyDescriptor','_injector','object','unitId','Injector','RANGE','19433IljCsv','map','getUnitRules','promptTitle','Plugin','function','get','dataValidation.operators.between','operators','deleteUnitRules','__decorateParam$1','Inject','dataValidation.textLength.errorMsg.greaterThan','getExtraStyle','BETWEEN','data-validation.mutation.removeRule','scopes','operatorNames','keys','next','generateRuleErrorMessage','AddDataValidationMutation','parseFormula','errorTitle','IUndoRedoService','ruleChange$','GREATER_THAN_OR_EQUAL','__decorateParam$2','disposeWithMe','toStringTag','dataValidation.ruleName.between','localeService','data-validation.command.removeRule','NOT_BETWEEN'];_0x3ac8=function(){return _0x42e11b;};return _0x3ac8();}(function(_0x2f446f,_0x156867){const _0xa1a646=_0x269e,_0x36e8fa=_0x2f446f();while(!![]){try{const _0x3c4664=-parseInt(_0xa1a646(0x23f))/0x1*(parseInt(_0xa1a646(0x184))/0x2)+parseInt(_0xa1a646(0x1c5))/0x3*(-parseInt(_0xa1a646(0x1ff))/0x4)+-parseInt(_0xa1a646(0x1bb))/0x5+parseInt(_0xa1a646(0x1a4))/0x6*(parseInt(_0xa1a646(0x1c3))/0x7)+parseInt(_0xa1a646(0x19a))/0x8+-parseInt(_0xa1a646(0x227))/0x9*(parseInt(_0xa1a646(0x1c1))/0xa)+parseInt(_0xa1a646(0x19d))/0xb;if(_0x3c4664===_0x156867)break;else _0x36e8fa['push'](_0x36e8fa['shift']());}catch(_0x3d6f44){_0x36e8fa['push'](_0x36e8fa['shift']());}}}(_0x3ac8,0x3a949),function(_0x490692,_0x43c639){const _0xfbc1e6=_0x269e;typeof exports==_0xfbc1e6(0x23b)&&typeof module<'u'?_0x43c639(exports,require('@univerjs/core'),require(_0xfbc1e6(0x226))):typeof define==_0xfbc1e6(0x244)&&define['amd']?define(['exports',_0xfbc1e6(0x1fe),_0xfbc1e6(0x226)],_0x43c639):(_0x490692=typeof globalThis<'u'?globalThis:_0x490692||self,_0x43c639(_0x490692[_0xfbc1e6(0x1b6)]={},_0x490692['UniverCore'],_0x490692[_0xfbc1e6(0x226)]));}(this,function(_0x857236,_0x1d96fc,_0x292d2e){'use strict';const _0x15a8e0=_0x269e;var _0x448413=Object[_0x15a8e0(0x22a)],_0xf1ab96=(_0x37bf30,_0x4e67d4,_0x26cf0e)=>_0x4e67d4 in _0x37bf30?_0x448413(_0x37bf30,_0x4e67d4,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x26cf0e}):_0x37bf30[_0x4e67d4]=_0x26cf0e,_0x195885=(_0x4c7a32,_0x54426f)=>_0x448413(_0x4c7a32,_0x15a8e0(0x1a9),{'value':_0x54426f,'configurable':!0x0}),_0x2dde4f=(_0x57e082,_0x2946e2,_0x575875)=>_0xf1ab96(_0x57e082,typeof _0x2946e2!='symbol'?_0x2946e2+'':_0x2946e2,_0x575875),_0x2d1daf,_0x471aa1,_0x17407d,_0xf71c09;function _0x1ceddf(_0x46cc8d){const _0x468bff=_0x15a8e0;return{'type':_0x46cc8d['type'],'operator':_0x46cc8d[_0x468bff(0x204)],'formula1':_0x46cc8d['formula1'],'formula2':_0x46cc8d['formula2'],'allowBlank':_0x46cc8d['allowBlank']};}_0x195885(_0x1ceddf,_0x15a8e0(0x1c4));function _0x496e1d(_0x4256c8){const _0x5f3f2f=_0x15a8e0;return{'error':_0x4256c8[_0x5f3f2f(0x238)],'errorStyle':_0x4256c8[_0x5f3f2f(0x22e)],'errorTitle':_0x4256c8[_0x5f3f2f(0x256)],'imeMode':_0x4256c8[_0x5f3f2f(0x200)],'prompt':_0x4256c8[_0x5f3f2f(0x20e)],'promptTitle':_0x4256c8[_0x5f3f2f(0x242)],'showDropDown':_0x4256c8[_0x5f3f2f(0x1f4)],'showErrorMessage':_0x4256c8[_0x5f3f2f(0x194)],'showInputMessage':_0x4256c8['showInputMessage'],'renderMode':_0x4256c8[_0x5f3f2f(0x1dc)],'bizInfo':_0x4256c8['bizInfo']};}_0x195885(_0x496e1d,_0x15a8e0(0x1bd));var _0x20f3a1=(_0x55f2ea=>(_0x55f2ea[_0x55f2ea['SETTING']=0x0]=_0x15a8e0(0x1ab),_0x55f2ea[_0x55f2ea[_0x15a8e0(0x23e)]=0x1]=_0x15a8e0(0x23e),_0x55f2ea[_0x55f2ea['OPTIONS']=0x2]=_0x15a8e0(0x1d1),_0x55f2ea))(_0x20f3a1||{}),_0x158180=Object[_0x15a8e0(0x22a)],_0x5820f0=Object['getOwnPropertyDescriptor'],_0x1e40ee=_0x195885((_0x2d9579,_0x4175a7,_0x217d77,_0x38c2a2)=>{for(var _0x1fc465=_0x38c2a2>0x1?void 0x0:_0x38c2a2?_0x5820f0(_0x4175a7,_0x217d77):_0x4175a7,_0x4b63a5=_0x2d9579['length']-0x1,_0x342b76;_0x4b63a5>=0x0;_0x4b63a5--)(_0x342b76=_0x2d9579[_0x4b63a5])&&(_0x1fc465=(_0x38c2a2?_0x342b76(_0x4175a7,_0x217d77,_0x1fc465):_0x342b76(_0x1fc465))||_0x1fc465);return _0x38c2a2&&_0x1fc465&&_0x158180(_0x4175a7,_0x217d77,_0x1fc465),_0x1fc465;},'__decorateClass$3'),_0x247757=_0x195885((_0x4b03f1,_0xfa7ec4)=>(_0x5f2f69,_0x3069a3)=>_0xfa7ec4(_0x5f2f69,_0x3069a3,_0x4b03f1),_0x15a8e0(0x1fd));_0x857236[_0x15a8e0(0x230)]=(_0x2d1daf=class extends _0x1d96fc[_0x15a8e0(0x222)]{constructor(_0x160886){const _0x597b7d=_0x15a8e0;super(),_0x2dde4f(this,_0x597b7d(0x21c),new Map()),_0x2dde4f(this,'_ruleChange$',new _0x292d2e['Subject']()),_0x2dde4f(this,_0x597b7d(0x258),this[_0x597b7d(0x1ee)][_0x597b7d(0x1eb)]()),_0x2dde4f(this,_0x597b7d(0x1e7),this[_0x597b7d(0x258)][_0x597b7d(0x208)](_0x292d2e['debounceTime'](0x14))),(this['_logService']=_0x160886,this[_0x597b7d(0x25b)]({'dispose':_0x195885(()=>{const _0x2137ce=_0x597b7d;this[_0x2137ce(0x1ee)]['complete']();},_0x597b7d(0x22b))}));}[_0x15a8e0(0x22c)](_0x520e2c,_0x565bcd){const _0x4350a7=_0x15a8e0;this[_0x4350a7(0x21c)]['has'](_0x520e2c)||this['_model'][_0x4350a7(0x1d6)](_0x520e2c,new Map());const _0xa69e31=this[_0x4350a7(0x21c)]['get'](_0x520e2c);if(_0xa69e31[_0x4350a7(0x1f6)](_0x565bcd))return _0xa69e31[_0x4350a7(0x245)](_0x565bcd);const _0x5d0f5e={'map':new Map(),'list':[]};return _0xa69e31[_0x4350a7(0x1d6)](_0x565bcd,_0x5d0f5e),_0x5d0f5e;}[_0x15a8e0(0x18b)](_0x338781,_0x31551d,_0x5dd0a0){const _0x59d9b7=_0x15a8e0,{map:_0x380cc9,list:_0x4b35d9}=_0x338781,_0x28766f=(Array[_0x59d9b7(0x206)](_0x31551d)?_0x31551d:[_0x31551d])[_0x59d9b7(0x181)](_0x3ea432=>!_0x380cc9[_0x59d9b7(0x1f6)](_0x3ea432['uid']));typeof _0x5dd0a0==_0x59d9b7(0x1ad)&&_0x5dd0a0<_0x4b35d9['length']?_0x4b35d9[_0x59d9b7(0x1ef)](_0x5dd0a0,0x0,..._0x28766f):_0x4b35d9[_0x59d9b7(0x1be)](..._0x28766f),_0x28766f[_0x59d9b7(0x1c2)](_0x911251=>{const _0x55f15d=_0x59d9b7;_0x380cc9[_0x55f15d(0x1d6)](_0x911251[_0x55f15d(0x210)],_0x911251);});}[_0x15a8e0(0x191)](_0x4f73dc,_0x539992){const _0x1c4c8b=_0x15a8e0,{map:_0x775bd5,list:_0x2f52c8}=_0x4f73dc,_0x342abf=_0x2f52c8['findIndex'](_0x401b3d=>_0x401b3d[_0x1c4c8b(0x210)]===_0x539992);_0x342abf>-0x1&&(_0x2f52c8[_0x1c4c8b(0x1ef)](_0x342abf,0x1),_0x775bd5[_0x1c4c8b(0x1df)](_0x539992));}[_0x15a8e0(0x20d)](_0x233cd5,_0x1f9640,_0x54dc5d){const _0x4b3a0e=_0x15a8e0,{map:_0x58f7ab,list:_0x562193}=_0x233cd5,_0x191783=_0x58f7ab['get'](_0x1f9640),_0x52794e=_0x562193[_0x4b3a0e(0x1e1)](_0xdedff=>_0x1f9640===_0xdedff['uid']);if(!_0x191783)throw new Error(_0x4b3a0e(0x18a)+_0x1f9640+'.');const _0x177fec={..._0x191783};switch(_0x54dc5d['type']){case _0x20f3a1['RANGE']:{_0x177fec[_0x4b3a0e(0x196)]=_0x54dc5d[_0x4b3a0e(0x1f7)];break;}case _0x20f3a1[_0x4b3a0e(0x1ab)]:{Object['assign'](_0x177fec,_0x1ceddf(_0x54dc5d[_0x4b3a0e(0x1f7)]));break;}case _0x20f3a1[_0x4b3a0e(0x1d1)]:{Object[_0x4b3a0e(0x21a)](_0x177fec,_0x496e1d(_0x54dc5d['payload']));break;}}return _0x562193[_0x52794e]=_0x177fec,_0x58f7ab[_0x4b3a0e(0x1d6)](_0x1f9640,_0x177fec),_0x177fec;}[_0x15a8e0(0x1d8)](_0x55dbd4,_0x2e89c2,_0xe3a232,_0x3f72fd){const _0x12b976=_0x15a8e0;if(!this[_0x12b976(0x22c)](_0x55dbd4,_0x2e89c2)['map'][_0x12b976(0x245)](_0xe3a232['uid']))return{'rule':_0xe3a232,'type':_0x12b976(0x20a),'unitId':_0x55dbd4,'subUnitId':_0x2e89c2,'source':_0x3f72fd};}[_0x15a8e0(0x1d0)](_0x2f0533,_0x238c9f,_0x329e3e,_0x4f9f38,_0x12cc47){const _0x2b6781=_0x15a8e0;try{const _0x1a34cd=this[_0x2b6781(0x22c)](_0x2f0533,_0x238c9f),_0x374990=(Array[_0x2b6781(0x206)](_0x329e3e)?_0x329e3e:[_0x329e3e])[_0x2b6781(0x240)](_0x5993b3=>this[_0x2b6781(0x1d8)](_0x2f0533,_0x238c9f,_0x5993b3,_0x4f9f38));this[_0x2b6781(0x18b)](_0x1a34cd,_0x329e3e,_0x12cc47),_0x374990[_0x2b6781(0x1c2)](_0x14d925=>{const _0x1f7340=_0x2b6781;_0x14d925&&this['_ruleChange$'][_0x1f7340(0x252)](_0x14d925);});}catch(_0x37fd25){this[_0x2b6781(0x233)]['error'](_0x37fd25);}}[_0x15a8e0(0x1cb)](_0x2f4698,_0x22863e,_0x29f7c5,_0x2e46fc,_0x5a5d0e){const _0x3ceee2=_0x15a8e0;try{const _0x13a910=this[_0x3ceee2(0x22c)](_0x2f4698,_0x22863e),_0x2a346f=_0x1d96fc[_0x3ceee2(0x1b5)][_0x3ceee2(0x21b)](_0x13a910[_0x3ceee2(0x240)]['get'](_0x29f7c5));if(!_0x2a346f)throw new Error(_0x3ceee2(0x18a)+_0x29f7c5+'.');const _0x5a4273=this[_0x3ceee2(0x20d)](_0x13a910,_0x29f7c5,_0x2e46fc);this[_0x3ceee2(0x1ee)][_0x3ceee2(0x252)]({'rule':_0x5a4273,'type':_0x3ceee2(0x1ba),'unitId':_0x2f4698,'subUnitId':_0x22863e,'source':_0x5a5d0e,'updatePayload':_0x2e46fc,'oldRule':_0x2a346f});}catch(_0x17ce8b){this['_logService'][_0x3ceee2(0x238)](_0x17ce8b);}}['removeRule'](_0x4cfded,_0x5a792a,_0x1b90f8,_0x28c6cf){const _0x5f5bc8=_0x15a8e0;try{const _0x549504=this[_0x5f5bc8(0x22c)](_0x4cfded,_0x5a792a),_0x3a968f=_0x549504[_0x5f5bc8(0x240)][_0x5f5bc8(0x245)](_0x1b90f8);_0x3a968f&&(this['_removeSubUnitRule'](_0x549504,_0x1b90f8),this[_0x5f5bc8(0x1ee)]['next']({'rule':_0x3a968f,'type':_0x5f5bc8(0x193),'unitId':_0x4cfded,'subUnitId':_0x5a792a,'source':_0x28c6cf}));}catch(_0x21c182){this[_0x5f5bc8(0x233)][_0x5f5bc8(0x238)](_0x21c182);}}[_0x15a8e0(0x212)](_0x52142d,_0x18640b,_0x3edc74){const _0xecadd2=_0x15a8e0;return this[_0xecadd2(0x22c)](_0x52142d,_0x18640b)[_0xecadd2(0x240)][_0xecadd2(0x245)](_0x3edc74);}[_0x15a8e0(0x1c6)](_0x5aee67,_0x54327f,_0x21afd8){const _0x1fd9c9=_0x15a8e0;return this['_ensureMap'](_0x5aee67,_0x54327f)[_0x1fd9c9(0x21d)][_0x1fd9c9(0x1e1)](_0x3fa7d7=>_0x3fa7d7[_0x1fd9c9(0x210)]===_0x21afd8);}[_0x15a8e0(0x1a2)](_0x33c3e9,_0x52dcea){const _0x32e45f=_0x15a8e0;return[...this['_ensureMap'](_0x33c3e9,_0x52dcea)[_0x32e45f(0x21d)]];}[_0x15a8e0(0x241)](_0x48d665){const _0x4e872b=_0x15a8e0,_0x363d6f=this[_0x4e872b(0x21c)][_0x4e872b(0x245)](_0x48d665);if(!_0x363d6f)return[];const _0x1e1634=[];return _0x363d6f[_0x4e872b(0x1c2)]((_0xb2e795,_0x5c11e8)=>{const _0x442085=_0x4e872b;_0x1e1634['push']([_0x5c11e8,_0xb2e795[_0x442085(0x21d)]]);}),_0x1e1634;}[_0x15a8e0(0x248)](_0x3c8d27){const _0x2db4c6=_0x15a8e0;this[_0x2db4c6(0x21c)][_0x2db4c6(0x1df)](_0x3c8d27);}[_0x15a8e0(0x1c8)](_0x21fa3c){const _0x5eff04=_0x15a8e0;var _0x3aa4ae,_0x567887;return Array[_0x5eff04(0x197)]((_0x567887=(_0x3aa4ae=this['_model'][_0x5eff04(0x245)](_0x21fa3c))==null?void 0x0:_0x3aa4ae[_0x5eff04(0x251)]())!=null?_0x567887:[]);}['getAll'](){const _0x11a330=_0x15a8e0;return Array[_0x11a330(0x197)](this[_0x11a330(0x21c)][_0x11a330(0x251)]())['map'](_0x3a9436=>[_0x3a9436,this['getUnitRules'](_0x3a9436)]);}},_0x195885(_0x2d1daf,_0x15a8e0(0x230)),_0x2d1daf),_0x857236[_0x15a8e0(0x230)]=_0x1e40ee([_0x247757(0x0,_0x1d96fc['ILogService'])],_0x857236[_0x15a8e0(0x230)]);var _0x207fd1=Object[_0x15a8e0(0x22a)],_0x5d2577=Object[_0x15a8e0(0x239)],_0x30329b=_0x195885((_0x45a634,_0x57ea02,_0x569123,_0x3aaa00)=>{const _0x43cdb8=_0x15a8e0;for(var _0xb910de=_0x3aaa00>0x1?void 0x0:_0x3aaa00?_0x5d2577(_0x57ea02,_0x569123):_0x57ea02,_0x5ee397=_0x45a634[_0x43cdb8(0x1fb)]-0x1,_0x36872f;_0x5ee397>=0x0;_0x5ee397--)(_0x36872f=_0x45a634[_0x5ee397])&&(_0xb910de=(_0x3aaa00?_0x36872f(_0x57ea02,_0x569123,_0xb910de):_0x36872f(_0xb910de))||_0xb910de);return _0x3aaa00&&_0xb910de&&_0x207fd1(_0x57ea02,_0x569123,_0xb910de),_0xb910de;},'__decorateClass$2'),_0x5f4c42=_0x195885((_0x5df5a9,_0x29e4dd)=>(_0x412993,_0x2baf0f)=>_0x29e4dd(_0x412993,_0x2baf0f,_0x5df5a9),_0x15a8e0(0x25a));const _0x4daeaf='SHEET_DATA_VALIDATION_PLUGIN';_0x857236[_0x15a8e0(0x1ca)]=(_0x471aa1=class extends _0x1d96fc['Disposable']{constructor(_0x16d521,_0x1f7bc8,_0x4875a7){const _0x157157=_0x15a8e0;super(),this[_0x157157(0x201)]=_0x16d521,this[_0x157157(0x199)]=_0x1f7bc8,this[_0x157157(0x209)]=_0x4875a7,this[_0x157157(0x1c7)]();}[_0x15a8e0(0x1c7)](){const _0x28ce69=_0x15a8e0,_0x4cbdee=_0x195885(_0xc082f7=>{const _0x1c15c7=_0x269e,_0x251d02=this[_0x1c15c7(0x209)][_0x1c15c7(0x241)](_0xc082f7),_0x1bc660={};return _0x251d02?(_0x251d02[_0x1c15c7(0x1c2)](([_0x579106,_0x431530])=>{_0x1bc660[_0x579106]=_0x431530;}),JSON[_0x1c15c7(0x1a0)](_0x1bc660)):'';},_0x28ce69(0x1ce)),_0x585dee=_0x195885(_0x4645a3=>{const _0x55deee=_0x28ce69;if(!_0x4645a3)return{};try{return JSON[_0x55deee(0x1dd)](_0x4645a3);}catch{return{};}},_0x28ce69(0x189));this[_0x28ce69(0x25b)](this[_0x28ce69(0x201)][_0x28ce69(0x1a5)]({'pluginName':_0x4daeaf,'businesses':[_0x1d96fc[_0x28ce69(0x1a8)]['UNIVER_SHEET']],'toJson':_0x195885(_0x5f595d=>_0x4cbdee(_0x5f595d),'toJson'),'parseJson':_0x195885(_0x1dd269=>_0x585dee(_0x1dd269),_0x28ce69(0x189)),'onUnLoad':_0x195885(_0x4977f7=>{const _0x3b0337=_0x28ce69;this[_0x3b0337(0x209)][_0x3b0337(0x248)](_0x4977f7);},_0x28ce69(0x224)),'onLoad':_0x195885((_0x57ada0,_0x1f8bc9)=>{const _0x930eb8=_0x28ce69;Object[_0x930eb8(0x251)](_0x1f8bc9)[_0x930eb8(0x1c2)](_0x69ce51=>{_0x1f8bc9[_0x69ce51]['forEach'](_0x3a0029=>{const _0x5f49a9=_0x269e;this['_dataValidationModel'][_0x5f49a9(0x1d0)](_0x57ada0,_0x69ce51,_0x3a0029,_0x5f49a9(0x1a1));});});},_0x28ce69(0x1f0))}));}},_0x195885(_0x471aa1,_0x15a8e0(0x1ca)),_0x471aa1),_0x857236[_0x15a8e0(0x1ca)]=_0x30329b([_0x5f4c42(0x0,_0x1d96fc[_0x15a8e0(0x1f8)]),_0x5f4c42(0x1,_0x1d96fc['IUniverInstanceService']),_0x5f4c42(0x2,_0x1d96fc[_0x15a8e0(0x24a)](_0x857236['DataValidationModel']))],_0x857236['DataValidationResourceController']);var _0x61a451=(_0x1049d1=>(_0x1049d1[_0x15a8e0(0x1b4)]=_0x15a8e0(0x1e9),_0x1049d1))(_0x61a451||{});const _0x4637fb=class _0x32b244{constructor(){const _0x37e754=_0x15a8e0;_0x2dde4f(this,_0x37e754(0x219),new Map()),_0x2dde4f(this,_0x37e754(0x231),new Map()),_0x2dde4f(this,'_validatorsChange$',new _0x292d2e[(_0x37e754(0x1ac))](void 0x0)),_0x2dde4f(this,'validatorsChange$',this['_validatorsChange$'][_0x37e754(0x1eb)]());}[_0x15a8e0(0x1d2)](_0x1c7bf9,_0x224d6d){const _0x42bc7d=_0x15a8e0;this[_0x42bc7d(0x219)][_0x42bc7d(0x1f6)](_0x224d6d)||this['_validatorByScopes'][_0x42bc7d(0x1d6)](_0x224d6d,[]);const _0x245d71=this['_validatorByScopes'][_0x42bc7d(0x245)](_0x224d6d);if(_0x245d71[_0x42bc7d(0x1e1)](_0x35452c=>_0x35452c['id']===_0x1c7bf9['id'])>-0x1)throw new Error(_0x42bc7d(0x1d5)+_0x1c7bf9['id']+_0x42bc7d(0x1d9));_0x245d71[_0x42bc7d(0x1be)](_0x1c7bf9);}['_removeValidatorFromScope'](_0x469b97,_0x127971){const _0x2c0d7a=_0x15a8e0,_0x217783=this['_validatorByScopes'][_0x2c0d7a(0x245)](_0x127971);if(!_0x217783)return;const _0xddfa05=_0x217783[_0x2c0d7a(0x1e1)](_0x5439cd=>_0x5439cd['id']===_0x469b97['id']);_0xddfa05>-0x1&&_0x217783[_0x2c0d7a(0x1ef)](_0xddfa05,0x1);}[_0x15a8e0(0x1fc)](_0x1326a1){const _0x427dc5=_0x15a8e0;return this[_0x427dc5(0x231)][_0x427dc5(0x1d6)](_0x1326a1['id'],_0x1326a1),Array[_0x427dc5(0x206)](_0x1326a1[_0x427dc5(0x24f)])?_0x1326a1[_0x427dc5(0x24f)][_0x427dc5(0x1c2)](_0x3f22ad=>{this['_addValidatorToScope'](_0x1326a1,_0x3f22ad);}):this[_0x427dc5(0x1d2)](_0x1326a1,_0x1326a1[_0x427dc5(0x24f)]),this[_0x427dc5(0x205)][_0x427dc5(0x252)](),_0x1d96fc['toDisposable'](()=>{const _0x5d8096=_0x427dc5;this[_0x5d8096(0x231)]['delete'](_0x1326a1['id']),Array['isArray'](_0x1326a1['scopes'])?_0x1326a1[_0x5d8096(0x24f)][_0x5d8096(0x1c2)](_0x489046=>{const _0x241f26=_0x5d8096;this[_0x241f26(0x202)](_0x1326a1,_0x489046);}):this[_0x5d8096(0x202)](_0x1326a1,_0x1326a1[_0x5d8096(0x24f)]),this[_0x5d8096(0x205)][_0x5d8096(0x252)]();});}[_0x15a8e0(0x218)](_0x333b54){return this['_validatorMap']['get'](_0x333b54);}[_0x15a8e0(0x185)](_0x49c444){const _0x30eb39=_0x15a8e0;return this[_0x30eb39(0x219)]['get'](_0x49c444);}};_0x195885(_0x4637fb,_0x15a8e0(0x1fa));let _0x49fdb4=_0x4637fb;const _0x36ae09={'type':_0x1d96fc['CommandType']['MUTATION'],'id':_0x15a8e0(0x183),'handler'(_0x316476,_0x33a9da){const _0x470649=_0x15a8e0;if(!_0x33a9da)return!0x1;const {unitId:_0x6cb2b5,subUnitId:_0x2b1dd5,rule:_0x1ec72c,index:_0x3deb30,source:source=_0x470649(0x21e)}=_0x33a9da;return _0x316476[_0x470649(0x245)](_0x857236['DataValidationModel'])['addRule'](_0x6cb2b5,_0x2b1dd5,_0x1ec72c,source,_0x3deb30),!0x0;}},_0x5235e4={'type':_0x1d96fc[_0x15a8e0(0x1e2)][_0x15a8e0(0x22d)],'id':_0x15a8e0(0x24e),'handler'(_0x4f6c6a,_0x4ef21f){const _0x508a6f=_0x15a8e0;if(!_0x4ef21f)return!0x1;const {unitId:_0x3c90da,subUnitId:_0x53ea31,ruleId:_0x45999b,source:source=_0x508a6f(0x21e)}=_0x4ef21f,_0x3e588a=_0x4f6c6a['get'](_0x857236[_0x508a6f(0x230)]);return Array[_0x508a6f(0x206)](_0x45999b)?_0x45999b['forEach'](_0x1ed81f=>{const _0x4b68be=_0x508a6f;_0x3e588a[_0x4b68be(0x1b0)](_0x3c90da,_0x53ea31,_0x1ed81f,source);}):_0x3e588a[_0x508a6f(0x1b0)](_0x3c90da,_0x53ea31,_0x45999b,source),!0x0;}},_0xe20daa={'type':_0x1d96fc['CommandType'][_0x15a8e0(0x22d)],'id':_0x15a8e0(0x198),'handler'(_0x86b4bc,_0x57fa9b){const _0x4d6229=_0x15a8e0;if(!_0x57fa9b)return!0x1;const {unitId:_0x18b2ea,subUnitId:_0xb5d228,ruleId:_0xb3addc,payload:_0x174fc0,source:source=_0x4d6229(0x21e)}=_0x57fa9b;return _0x86b4bc[_0x4d6229(0x245)](_0x857236[_0x4d6229(0x230)])['updateRule'](_0x18b2ea,_0xb5d228,_0xb3addc,_0x174fc0,source),!0x0;}},_0x45e126={'type':_0x1d96fc[_0x15a8e0(0x1e2)]['COMMAND'],'id':_0x15a8e0(0x1e6),async 'handler'(_0x3d46b5,_0x2d15b7){const _0x3fee03=_0x15a8e0;if(_0x3d46b5[_0x3fee03(0x245)](_0x1d96fc[_0x3fee03(0x1cc)])[_0x3fee03(0x238)]('[Deprecated]:\x20`AddDataValidationCommand`\x20is\x20deprecated,\x20please\x20use\x20`AddSheetDataValidationCommand`\x20in\x20`@univerjs/sheets-data-validation`\x20instead!'),!_0x2d15b7)return!0x1;const {rule:_0x5c6133,unitId:_0x330784,subUnitId:_0x9c3d5}=_0x2d15b7,_0x452997=_0x3d46b5[_0x3fee03(0x245)](_0x1d96fc[_0x3fee03(0x188)]),_0xf08654=_0x3d46b5[_0x3fee03(0x245)](_0x1d96fc[_0x3fee03(0x257)]),_0x3ebce0={..._0x2d15b7,'rule':{..._0x2d15b7[_0x3fee03(0x1b3)],'ranges':[_0x2d15b7[_0x3fee03(0x1b3)][_0x3fee03(0x1ea)]]}},_0x1739be=[{'id':_0x36ae09['id'],'params':_0x3ebce0}],_0x1bdc86=[{'id':_0x5235e4['id'],'params':{'unitId':_0x330784,'subUnitId':_0x9c3d5,'ruleId':_0x5c6133[_0x3fee03(0x210)]}}];return _0xf08654[_0x3fee03(0x203)]({'unitID':_0x330784,'redoMutations':_0x1739be,'undoMutations':_0x1bdc86}),await _0x452997[_0x3fee03(0x20c)](_0x36ae09['id'],_0x3ebce0),!0x0;}},_0x30ecb0={'type':_0x1d96fc['CommandType']['COMMAND'],'id':_0x15a8e0(0x25f),'handler'(_0x372e3c,_0x400050){const _0x580612=_0x15a8e0;if(_0x372e3c[_0x580612(0x245)](_0x1d96fc['ILogService'])['error'](_0x580612(0x22f)),!_0x400050)return!0x1;const {unitId:_0x143d31,subUnitId:_0x155b08,ruleId:_0x8456ce}=_0x400050,_0x2c2757=_0x372e3c[_0x580612(0x245)](_0x1d96fc[_0x580612(0x188)]),_0x3b5a48=_0x372e3c[_0x580612(0x245)](_0x1d96fc[_0x580612(0x257)]),_0x5173eb=_0x372e3c['get'](_0x857236[_0x580612(0x230)]),_0x172023=[{'id':_0x5235e4['id'],'params':_0x400050}],_0x4621c2=[{'id':_0x36ae09['id'],'params':{'unitId':_0x143d31,'subUnitId':_0x155b08,'rule':{..._0x5173eb[_0x580612(0x212)](_0x143d31,_0x155b08,_0x8456ce)},'index':_0x5173eb[_0x580612(0x1c6)](_0x143d31,_0x155b08,_0x8456ce)}}];return _0x3b5a48['pushUndoRedo']({'undoMutations':_0x4621c2,'redoMutations':_0x172023,'unitID':_0x400050[_0x580612(0x23c)]}),_0x2c2757[_0x580612(0x20c)](_0x5235e4['id'],_0x400050),!0x0;}},_0x5c2d53={'type':_0x1d96fc[_0x15a8e0(0x1e2)][_0x15a8e0(0x1bf)],'id':'data-validation.command.updateDataValidationSetting','handler'(_0x5b1e57,_0x2d66cd){const _0x3947ec=_0x15a8e0;if(_0x5b1e57[_0x3947ec(0x245)](_0x1d96fc[_0x3947ec(0x1cc)])['warn']('[Deprecated]:\x20`UpdateDataValidationOptionsCommand`\x20is\x20deprecated,\x20please\x20use\x20`UpdateSheetDataValidationOptionsCommand`\x20in\x20`@univerjs/sheets-data-validation`\x20instead!'),!_0x2d66cd)return!0x1;const _0x27a570=_0x5b1e57[_0x3947ec(0x245)](_0x1d96fc[_0x3947ec(0x188)]),_0x4a97a4=_0x5b1e57['get'](_0x1d96fc[_0x3947ec(0x257)]),_0x5b38a5=_0x5b1e57[_0x3947ec(0x245)](_0x857236[_0x3947ec(0x230)]),{unitId:_0xd1823d,subUnitId:_0xb13952,ruleId:_0xd19c67,options:_0x1ca371}=_0x2d66cd,_0x4a5a54=_0x5b38a5[_0x3947ec(0x212)](_0xd1823d,_0xb13952,_0xd19c67);if(!_0x4a5a54)return!0x1;const _0x2f2365={'unitId':_0xd1823d,'subUnitId':_0xb13952,'ruleId':_0xd19c67,'payload':{'type':_0x20f3a1[_0x3947ec(0x1d1)],'payload':_0x1ca371}},_0xd880e=[{'id':_0xe20daa['id'],'params':_0x2f2365}],_0x5caf02={'unitId':_0xd1823d,'subUnitId':_0xb13952,'ruleId':_0xd19c67,'payload':{'type':_0x20f3a1[_0x3947ec(0x1d1)],'payload':_0x496e1d(_0x4a5a54)}},_0x1ec06b=[{'id':_0xe20daa['id'],'params':_0x5caf02}];return _0x4a97a4[_0x3947ec(0x203)]({'unitID':_0xd1823d,'redoMutations':_0xd880e,'undoMutations':_0x1ec06b}),_0x27a570[_0x3947ec(0x20c)](_0xe20daa['id'],_0x2f2365),!0x0;}},_0x1dc137={'type':_0x1d96fc['CommandType'][_0x15a8e0(0x1bf)],'id':'data-validation.command.updateDataValidationOptions','handler'(_0x506e61,_0x3029ab){const _0x9eae0a=_0x15a8e0;if(_0x506e61[_0x9eae0a(0x245)](_0x1d96fc['ILogService'])[_0x9eae0a(0x238)]('[Deprecated]:\x20`UpdateDataValidationSettingCommand`\x20is\x20deprecated,\x20please\x20use\x20`UpdateSheetDataValidationSettingCommand`\x20in\x20`@univerjs/sheets-data-validation`\x20instead!'),!_0x3029ab)return!0x1;const _0x369f5a=_0x506e61['get'](_0x1d96fc[_0x9eae0a(0x188)]),_0x34f70c=_0x506e61[_0x9eae0a(0x245)](_0x1d96fc[_0x9eae0a(0x257)]),_0x55739d=_0x506e61[_0x9eae0a(0x245)](_0x857236[_0x9eae0a(0x230)]),_0x3df355=_0x506e61['get'](_0x49fdb4),{unitId:_0x2aa3f8,subUnitId:_0x215ba1,ruleId:_0x3360ff,setting:_0x472bf6}=_0x3029ab,_0x4480b7=_0x3df355[_0x9eae0a(0x218)](_0x472bf6['type']);if(!_0x4480b7)return!0x1;const _0x5da999=_0x55739d[_0x9eae0a(0x212)](_0x2aa3f8,_0x215ba1,_0x3360ff);if(!_0x5da999)return!0x1;const _0x58de32={..._0x5da999,..._0x472bf6};if(!_0x4480b7[_0x9eae0a(0x221)](_0x58de32,_0x2aa3f8,_0x215ba1)[_0x9eae0a(0x1f9)])return!0x1;const _0x4f9727={'unitId':_0x2aa3f8,'subUnitId':_0x215ba1,'ruleId':_0x3360ff,'payload':{'type':_0x20f3a1[_0x9eae0a(0x1ab)],'payload':{..._0x472bf6,..._0x4480b7['normalizeFormula'](_0x58de32,_0x2aa3f8,_0x215ba1)}}},_0x5d837a=[{'id':_0xe20daa['id'],'params':_0x4f9727}],_0xa8e22b={'unitId':_0x2aa3f8,'subUnitId':_0x215ba1,'ruleId':_0x3360ff,'payload':{'type':_0x20f3a1[_0x9eae0a(0x1ab)],'payload':_0x1ceddf(_0x5da999)}},_0x5bd398=[{'id':_0xe20daa['id'],'params':_0xa8e22b}];return _0x34f70c[_0x9eae0a(0x203)]({'unitID':_0x2aa3f8,'redoMutations':_0x5d837a,'undoMutations':_0x5bd398}),_0x369f5a[_0x9eae0a(0x20c)](_0xe20daa['id'],_0x4f9727),!0x0;}},_0xd7ad1={'type':_0x1d96fc[_0x15a8e0(0x1e2)][_0x15a8e0(0x1bf)],'id':_0x15a8e0(0x18c),'handler'(_0x2911ba,_0x27bb0c){const _0x5320bf=_0x15a8e0;if(_0x2911ba[_0x5320bf(0x245)](_0x1d96fc['ILogService'])[_0x5320bf(0x238)](_0x5320bf(0x1e0)),!_0x27bb0c)return!0x1;const {unitId:_0x37c05e,subUnitId:_0x193199}=_0x27bb0c,_0x48dabd=_0x2911ba[_0x5320bf(0x245)](_0x1d96fc['ICommandService']),_0x337ee4=_0x2911ba['get'](_0x857236['DataValidationModel']),_0x5b2c00=_0x2911ba['get'](_0x1d96fc[_0x5320bf(0x257)]),_0x4ed20b=[..._0x337ee4[_0x5320bf(0x1a2)](_0x37c05e,_0x193199)],_0x45e7a0={'unitId':_0x37c05e,'subUnitId':_0x193199,'ruleId':_0x4ed20b[_0x5320bf(0x240)](_0x15e968=>_0x15e968[_0x5320bf(0x210)])},_0xfa32df=[{'id':_0x5235e4['id'],'params':_0x45e7a0}],_0x276ae0=[{'id':_0x36ae09['id'],'params':{'unitId':_0x37c05e,'subUnitId':_0x193199,'rule':_0x4ed20b}}];return _0x5b2c00[_0x5320bf(0x203)]({'redoMutations':_0xfa32df,'undoMutations':_0x276ae0,'unitID':_0x37c05e}),_0x48dabd['executeCommand'](_0x5235e4['id'],_0x45e7a0),!0x0;}},_0x4c74aa=_0x15a8e0(0x1cd),_0x10a327={};var _0x46fde5=Object[_0x15a8e0(0x22a)],_0x3b3742=Object[_0x15a8e0(0x239)],_0x241ef2=_0x195885((_0x5a9f20,_0x411f27,_0x1db7f4,_0x5e3c9c)=>{const _0x44752a=_0x15a8e0;for(var _0x5a8141=_0x5e3c9c>0x1?void 0x0:_0x5e3c9c?_0x3b3742(_0x411f27,_0x1db7f4):_0x411f27,_0x232afa=_0x5a9f20[_0x44752a(0x1fb)]-0x1,_0x355400;_0x232afa>=0x0;_0x232afa--)(_0x355400=_0x5a9f20[_0x232afa])&&(_0x5a8141=(_0x5e3c9c?_0x355400(_0x411f27,_0x1db7f4,_0x5a8141):_0x355400(_0x5a8141))||_0x5a8141);return _0x5e3c9c&&_0x5a8141&&_0x46fde5(_0x411f27,_0x1db7f4,_0x5a8141),_0x5a8141;},'__decorateClass$1'),_0x5018b8=_0x195885((_0x5e1fc9,_0x81096c)=>(_0x4d8568,_0x2a3ae0)=>_0x81096c(_0x4d8568,_0x2a3ae0,_0x5e1fc9),_0x15a8e0(0x249));const _0x3413a4='UNIVER_DATA_VALIDATION_PLUGIN';_0x857236[_0x15a8e0(0x1b9)]=(_0x17407d=class extends _0x1d96fc[_0x15a8e0(0x243)]{constructor(_0x5cd10d=_0x10a327,_0x2d6a0d,_0x451cb8,_0x47af34){const _0x41327c=_0x15a8e0;super(),this['_config']=_0x5cd10d,this[_0x41327c(0x23a)]=_0x2d6a0d,this['_commandService']=_0x451cb8,this[_0x41327c(0x1b8)]=_0x47af34;const {..._0x1d4bd0}=this[_0x41327c(0x19b)];this['_configService'][_0x41327c(0x195)](_0x4c74aa,_0x1d4bd0);}['onStarting'](){const _0x65beb8=_0x15a8e0;[[_0x857236[_0x65beb8(0x230)]],[_0x49fdb4],[_0x857236[_0x65beb8(0x1ca)]]][_0x65beb8(0x1c2)](_0x2c651e=>this[_0x65beb8(0x23a)][_0x65beb8(0x20a)](_0x2c651e)),[_0x45e126,_0xd7ad1,_0x5c2d53,_0x1dc137,_0x30ecb0,_0x36ae09,_0xe20daa,_0x5235e4][_0x65beb8(0x1c2)](_0x194f8c=>{const _0x53219a=_0x65beb8;this[_0x53219a(0x1e3)][_0x53219a(0x18f)](_0x194f8c);});}[_0x15a8e0(0x214)](){const _0x324b1f=_0x15a8e0;this[_0x324b1f(0x23a)][_0x324b1f(0x245)](_0x857236[_0x324b1f(0x1ca)]);}},_0x195885(_0x17407d,_0x15a8e0(0x1b9)),_0x2dde4f(_0x17407d,'pluginName',_0x3413a4),_0x2dde4f(_0x17407d,_0x15a8e0(0x1f2),_0x1d96fc['UniverInstanceType'][_0x15a8e0(0x20f)]),_0x17407d),_0x857236[_0x15a8e0(0x1b9)]=_0x241ef2([_0x5018b8(0x1,_0x1d96fc['Inject'](_0x1d96fc['Injector'])),_0x5018b8(0x2,_0x1d96fc[_0x15a8e0(0x188)]),_0x5018b8(0x3,_0x1d96fc[_0x15a8e0(0x1f1)])],_0x857236['UniverDataValidationPlugin']),_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x24d)]+'',_0x1d96fc[_0x15a8e0(0x1f5)]['EQUAL']+'',_0x1d96fc[_0x15a8e0(0x1f5)]['GREATER_THAN']+'',_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x259)]+'',_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x223)]+'',_0x1d96fc[_0x15a8e0(0x1f5)]['LESS_THAN_OR_EQUAL']+'',_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x260)]+'',_0x1d96fc[_0x15a8e0(0x1f5)]['NOT_EQUAL']+'';const _0x36e8be={[_0x1d96fc['DataValidationOperator']['BETWEEN']]:_0x15a8e0(0x25d),[_0x1d96fc[_0x15a8e0(0x1f5)]['EQUAL']]:_0x15a8e0(0x1bc),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x192)]]:_0x15a8e0(0x217),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x259)]]:'dataValidation.ruleName.greaterThanOrEqual',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x223)]]:_0x15a8e0(0x211),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x1b7)]]:'dataValidation.ruleName.lessThanOrEqual',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x260)]]:_0x15a8e0(0x18d),[_0x1d96fc['DataValidationOperator']['NOT_EQUAL']]:_0x15a8e0(0x1e5)},_0xe6c3d9={[_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x24d)]]:_0x15a8e0(0x229),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x18e)]]:'dataValidation.errorMsg.equal',[_0x1d96fc[_0x15a8e0(0x1f5)]['GREATER_THAN']]:'dataValidation.errorMsg.greaterThan',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x259)]]:'dataValidation.errorMsg.greaterThanOrEqual',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x223)]]:'dataValidation.errorMsg.lessThan',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x1b7)]]:'dataValidation.errorMsg.lessThanOrEqual',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x260)]]:'dataValidation.errorMsg.notBetween',[_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x1db)]]:_0x15a8e0(0x1d3)},_0xedfe71={[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x24d)]]:_0x15a8e0(0x1e8),[_0x1d96fc['DataValidationOperator']['EQUAL']]:_0x15a8e0(0x1a3),[_0x1d96fc[_0x15a8e0(0x1f5)]['GREATER_THAN']]:_0x15a8e0(0x24b),[_0x1d96fc['DataValidationOperator']['GREATER_THAN_OR_EQUAL']]:'dataValidation.textLength.errorMsg.greaterThanOrEqual',[_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x223)]]:_0x15a8e0(0x1de),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x1b7)]]:'dataValidation.textLength.errorMsg.lessThanOrEqual',[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x260)]]:'dataValidation.textLength.errorMsg.notBetween',[_0x1d96fc['DataValidationOperator'][_0x15a8e0(0x1db)]]:'dataValidation.textLength.errorMsg.notEqual'},_0x2b9ded=[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x24d)],_0x1d96fc[_0x15a8e0(0x1f5)]['NOT_BETWEEN']];var _0x4bf462=Object[_0x15a8e0(0x22a)],_0x202a5c=Object[_0x15a8e0(0x239)],_0x200231=_0x195885((_0x20f613,_0xcaaf09,_0x2958cd,_0x2eb5ef)=>{const _0x517332=_0x15a8e0;for(var _0x4e8e70=_0x2eb5ef>0x1?void 0x0:_0x2eb5ef?_0x202a5c(_0xcaaf09,_0x2958cd):_0xcaaf09,_0x5c6125=_0x20f613[_0x517332(0x1fb)]-0x1,_0x42fb7a;_0x5c6125>=0x0;_0x5c6125--)(_0x42fb7a=_0x20f613[_0x5c6125])&&(_0x4e8e70=(_0x2eb5ef?_0x42fb7a(_0xcaaf09,_0x2958cd,_0x4e8e70):_0x42fb7a(_0x4e8e70))||_0x4e8e70);return _0x2eb5ef&&_0x4e8e70&&_0x4bf462(_0xcaaf09,_0x2958cd,_0x4e8e70),_0x4e8e70;},'__decorateClass'),_0x453ce=_0x195885((_0x1175b,_0x543bd5)=>(_0x146607,_0x3b0796)=>_0x543bd5(_0x146607,_0x3b0796,_0x1175b),'__decorateParam');const _0x28b0c8='{FORMULA1}',_0x1ff72a=_0x15a8e0(0x215),_0x1a55f7={[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x24d)]]:_0x15a8e0(0x246),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x18e)]]:_0x15a8e0(0x1aa),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x192)]]:_0x15a8e0(0x225),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x259)]]:_0x15a8e0(0x20b),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x223)]]:_0x15a8e0(0x1c0),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x1b7)]]:_0x15a8e0(0x1da),[_0x1d96fc[_0x15a8e0(0x1f5)][_0x15a8e0(0x260)]]:'dataValidation.operators.notBetween',[_0x1d96fc[_0x15a8e0(0x1f5)]['NOT_EQUAL']]:_0x15a8e0(0x232)};_0x857236[_0x15a8e0(0x236)]=(_0xf71c09=class{constructor(_0xd7488c,_0xb103b9){const _0x27e590=_0x15a8e0;_0x2dde4f(this,_0x27e590(0x1a7)),_0x2dde4f(this,_0x27e590(0x21f),null),_0x2dde4f(this,_0x27e590(0x213)),_0x2dde4f(this,_0x27e590(0x182)),_0x2dde4f(this,_0x27e590(0x1d4)),(this['localeService']=_0xd7488c,this[_0x27e590(0x186)]=_0xb103b9);}get[_0x15a8e0(0x250)](){const _0x107a85=_0x15a8e0;return this[_0x107a85(0x247)]['map'](_0x2ce94e=>this[_0x107a85(0x25e)]['t'](_0x1a55f7[_0x2ce94e]));}get[_0x15a8e0(0x19c)](){const _0x5b794a=_0x15a8e0;return this[_0x5b794a(0x25e)]['t'](this['title']);}[_0x15a8e0(0x1ed)](_0x355e13){const _0x50092f=_0x15a8e0;var _0x597233,_0x5a01e0;if(!_0x355e13[_0x50092f(0x204)])return this[_0x50092f(0x19c)];const _0x4ffb9c=this[_0x50092f(0x25e)]['t'](_0x36e8be[_0x355e13['operator']])[_0x50092f(0x1ec)](_0x28b0c8,(_0x597233=_0x355e13[_0x50092f(0x19f)])!=null?_0x597233:'')[_0x50092f(0x1ec)](_0x1ff72a,(_0x5a01e0=_0x355e13[_0x50092f(0x19e)])!=null?_0x5a01e0:'');return this[_0x50092f(0x19c)]+'\x20'+_0x4ffb9c;}[_0x15a8e0(0x253)](_0x28f850){const _0x3bd5a8=_0x15a8e0;var _0x353bc5,_0x50e71f;return _0x28f850[_0x3bd5a8(0x204)]?''+this[_0x3bd5a8(0x25e)]['t'](_0xe6c3d9[_0x28f850['operator']])[_0x3bd5a8(0x1ec)](_0x28b0c8,(_0x353bc5=_0x28f850['formula1'])!=null?_0x353bc5:'')[_0x3bd5a8(0x1ec)](_0x1ff72a,(_0x50e71f=_0x28f850['formula2'])!=null?_0x50e71f:''):this['titleStr'];}[_0x15a8e0(0x24c)](_0x1d9bce,_0x505bfd,_0x90506b){}[_0x15a8e0(0x187)](_0x428881){const _0x325999=_0x15a8e0;return _0x428881['showErrorMessage']&&_0x428881['error']?_0x428881[_0x325999(0x238)]:this[_0x325999(0x253)](_0x428881);}['isEmptyCellValue'](_0x335690){return _0x335690===''||_0x335690===void 0x0||_0x335690===null;}[_0x15a8e0(0x1e4)](_0x3bc1d3,_0x4bee1e,_0x149e10){const _0x5cdf0b=_0x15a8e0;return{'formula1':_0x3bc1d3[_0x5cdf0b(0x19f)],'formula2':_0x3bc1d3[_0x5cdf0b(0x19e)]};}async[_0x15a8e0(0x190)](_0x248f1a,_0x3d0bf4,_0x21d114){return!0x0;}['transform'](_0x10d073,_0x32195f,_0x36ed13){return _0x10d073;}async[_0x15a8e0(0x234)](_0x25f3c4,_0x527568,_0x1c1246){return!0x0;}async[_0x15a8e0(0x1ae)](_0x50a050,_0x3ad4ac,_0x34c801){return!0x0;}async[_0x15a8e0(0x220)](_0x133557,_0x16b074,_0x30b52e){return!0x0;}async[_0x15a8e0(0x207)](_0x50d265,_0x158846,_0x5d6497){return!0x0;}async['validatorIsGreaterThan'](_0x5ed024,_0x23bf22,_0x3ad907){return!0x0;}async[_0x15a8e0(0x1f3)](_0x3d78e5,_0x3b8b1d,_0xde1185){return!0x0;}async['validatorIsLessThan'](_0x55cbca,_0x4781b0,_0x2d2b5e){return!0x0;}async[_0x15a8e0(0x1d7)](_0x45bbeb,_0x1c2c62,_0x4507cf){return!0x0;}async[_0x15a8e0(0x235)](_0x2ac1d3,_0x3ed332){const _0x1b59de=_0x15a8e0,{value:_0xe51cc2,unitId:_0x41134b,subUnitId:_0x48ae58}=_0x2ac1d3,_0xe16c45=this[_0x1b59de(0x1af)](_0xe51cc2),{allowBlank:allowBlank=!0x0,operator:_0x4205c0}=_0x3ed332;if(_0xe16c45)return allowBlank;const _0x282e82=await this[_0x1b59de(0x255)](_0x3ed332,_0x41134b,_0x48ae58);if(!await this[_0x1b59de(0x190)](_0x2ac1d3,_0x282e82,_0x3ed332))return!0x1;if(!_0x1d96fc['Tools'][_0x1b59de(0x1a6)](_0x4205c0))return!0x0;const _0x1b88e1=this['transform'](_0x2ac1d3,_0x282e82,_0x3ed332);switch(_0x4205c0){case _0x1d96fc[_0x1b59de(0x1f5)]['BETWEEN']:return this[_0x1b59de(0x220)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc[_0x1b59de(0x1f5)]['EQUAL']:return this[_0x1b59de(0x234)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc[_0x1b59de(0x1f5)][_0x1b59de(0x192)]:return this[_0x1b59de(0x237)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc['DataValidationOperator'][_0x1b59de(0x259)]:return this['validatorIsGreaterThanOrEqual'](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc[_0x1b59de(0x1f5)][_0x1b59de(0x223)]:return this[_0x1b59de(0x216)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc[_0x1b59de(0x1f5)][_0x1b59de(0x1b7)]:return this[_0x1b59de(0x1d7)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc[_0x1b59de(0x1f5)][_0x1b59de(0x260)]:return this[_0x1b59de(0x207)](_0x1b88e1,_0x282e82,_0x3ed332);case _0x1d96fc['DataValidationOperator'][_0x1b59de(0x1db)]:return this[_0x1b59de(0x1ae)](_0x1b88e1,_0x282e82,_0x3ed332);default:throw new Error('Unknown\x20operator.');}}},_0x195885(_0xf71c09,_0x15a8e0(0x236)),_0xf71c09),_0x857236[_0x15a8e0(0x236)]=_0x200231([_0x453ce(0x0,_0x1d96fc['Inject'](_0x1d96fc[_0x15a8e0(0x228)])),_0x453ce(0x1,_0x1d96fc[_0x15a8e0(0x24a)](_0x1d96fc[_0x15a8e0(0x23d)]))],_0x857236[_0x15a8e0(0x236)]),_0x857236[_0x15a8e0(0x254)]=_0x36ae09,_0x857236[_0x15a8e0(0x1cf)]=_0x61a451,_0x857236[_0x15a8e0(0x1fa)]=_0x49fdb4,_0x857236[_0x15a8e0(0x1b2)]=_0x5235e4,_0x857236['TWO_FORMULA_OPERATOR_COUNT']=_0x2b9ded,_0x857236[_0x15a8e0(0x1b1)]=_0xedfe71,_0x857236['UpdateDataValidationMutation']=_0xe20daa,_0x857236['UpdateRuleType']=_0x20f3a1,_0x857236[_0x15a8e0(0x1bd)]=_0x496e1d,_0x857236['getRuleSetting']=_0x1ceddf,Object[_0x15a8e0(0x22a)](_0x857236,Symbol[_0x15a8e0(0x25c)],{'value':_0x15a8e0(0x1c9)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/data-validation",
|
|
3
|
-
"version": "0.3.0-
|
|
3
|
+
"version": "0.3.0-nightly.202410101606",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Data validation library for Univer",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"rxjs": ">=7.0.0",
|
|
50
|
-
"@univerjs/core": "0.3.0-
|
|
50
|
+
"@univerjs/core": "0.3.0-nightly.202410101606"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@univerjs/protocol": "0.1.39-alpha.15",
|
|
54
|
-
"@univerjs/
|
|
55
|
-
"@univerjs/
|
|
54
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
55
|
+
"@univerjs/sheets": "0.3.0-nightly.202410101606"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"rxjs": "^7.8.1",
|
|
59
59
|
"typescript": "^5.6.2",
|
|
60
60
|
"vite": "^5.4.8",
|
|
61
61
|
"vitest": "^2.1.1",
|
|
62
|
-
"@univerjs
|
|
63
|
-
"@univerjs/
|
|
62
|
+
"@univerjs/core": "0.3.0-nightly.202410101606",
|
|
63
|
+
"@univerjs-infra/shared": "0.3.0"
|
|
64
64
|
},
|
|
65
65
|
"univerSpace": {
|
|
66
66
|
".": {
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"test": "vitest run",
|
|
81
81
|
"test:watch": "vitest",
|
|
82
82
|
"coverage": "vitest run --coverage",
|
|
83
|
-
"build": "tsc && vite build"
|
|
84
|
-
"sync:cnpm": "cnpm sync"
|
|
83
|
+
"build": "tsc && vite build"
|
|
85
84
|
}
|
|
86
85
|
}
|
package/LICENSE
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|