@univerjs/data-validation 1.3.1 → 1.5.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/README.md +5 -5
- package/lib/cjs/index.js +24 -42
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/index.js +24 -42
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/index.js +24 -42
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/services/data-validator-registry.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/es/locale/en-US.js
CHANGED
package/lib/es/locale/es-ES.js
CHANGED
package/lib/es/locale/fa-IR.js
CHANGED
package/lib/es/locale/fr-FR.js
CHANGED
package/lib/es/locale/id-ID.js
CHANGED
package/lib/es/locale/it-IT.js
CHANGED
package/lib/es/locale/ja-JP.js
CHANGED
package/lib/es/locale/ko-KR.js
CHANGED
package/lib/es/locale/pl-PL.js
CHANGED
package/lib/es/locale/pt-BR.js
CHANGED
package/lib/es/locale/ru-RU.js
CHANGED
package/lib/es/locale/sk-SK.js
CHANGED
package/lib/es/locale/vi-VN.js
CHANGED
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-HK.js
CHANGED
package/lib/es/locale/zh-TW.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandType, DataValidationOperator, Disposable, ICommandService, IConfigService, ILogService, IResourceManagerService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, Tools, UniverInstanceType, merge, toDisposable } from "@univerjs/core";
|
|
2
2
|
import { BehaviorSubject, Subject, debounceTime } from "rxjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/common/util.ts
|
|
5
5
|
function getRuleSetting(rule) {
|
|
6
6
|
return {
|
|
7
7
|
type: rule.type,
|
|
@@ -27,8 +27,7 @@ function getRuleOptions(rule) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
//#region src/types/enum/update-rule-type.ts
|
|
30
|
+
// src/types/enum/update-rule-type.ts
|
|
32
31
|
/**
|
|
33
32
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
34
33
|
*
|
|
@@ -52,8 +51,7 @@ let UpdateRuleType = /* @__PURE__ */ function(UpdateRuleType) {
|
|
|
52
51
|
return UpdateRuleType;
|
|
53
52
|
}({});
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
54
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
|
|
57
55
|
function _typeof(o) {
|
|
58
56
|
"@babel/helpers - typeof";
|
|
59
57
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -63,28 +61,25 @@ function _typeof(o) {
|
|
|
63
61
|
}, _typeof(o);
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
function toPrimitive(t, r) {
|
|
64
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
65
|
+
function toPrimitive(t, e) {
|
|
69
66
|
if ("object" != _typeof(t) || !t) return t;
|
|
70
|
-
var
|
|
71
|
-
if (void 0 !==
|
|
72
|
-
var i =
|
|
67
|
+
var r;
|
|
68
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
69
|
+
var i = r.call(t, e || "default");
|
|
73
70
|
if ("object" != _typeof(i)) return i;
|
|
74
71
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
75
72
|
}
|
|
76
|
-
return ("string" ===
|
|
73
|
+
return ("string" === e ? String : Number)(t);
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
76
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
81
77
|
function toPropertyKey(t) {
|
|
82
78
|
var i = toPrimitive(t, "string");
|
|
83
79
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
84
80
|
}
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
82
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
88
83
|
function _defineProperty(e, r, t) {
|
|
89
84
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
90
85
|
value: t,
|
|
@@ -94,16 +89,14 @@ function _defineProperty(e, r, t) {
|
|
|
94
89
|
}) : e[r] = t, e;
|
|
95
90
|
}
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
92
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
99
93
|
function __decorateParam(paramIndex, decorator) {
|
|
100
94
|
return function(target, key) {
|
|
101
95
|
decorator(target, key, paramIndex);
|
|
102
96
|
};
|
|
103
97
|
}
|
|
104
98
|
|
|
105
|
-
|
|
106
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
99
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
107
100
|
function __decorate(decorators, target, key, desc) {
|
|
108
101
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
109
102
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -111,8 +104,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
111
104
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
112
105
|
}
|
|
113
106
|
|
|
114
|
-
|
|
115
|
-
//#region src/models/data-validation-model.ts
|
|
107
|
+
// src/models/data-validation-model.ts
|
|
116
108
|
let DataValidationModel = class DataValidationModel extends Disposable {
|
|
117
109
|
constructor(_logService) {
|
|
118
110
|
super();
|
|
@@ -265,8 +257,7 @@ let DataValidationModel = class DataValidationModel extends Disposable {
|
|
|
265
257
|
};
|
|
266
258
|
DataValidationModel = __decorate([__decorateParam(0, ILogService)], DataValidationModel);
|
|
267
259
|
|
|
268
|
-
|
|
269
|
-
//#region src/commands/mutations/data-validation.mutation.ts
|
|
260
|
+
// src/commands/mutations/data-validation.mutation.ts
|
|
270
261
|
const AddDataValidationMutation = {
|
|
271
262
|
type: CommandType.MUTATION,
|
|
272
263
|
id: "data-validation.mutation.addRule",
|
|
@@ -302,8 +293,7 @@ const UpdateDataValidationMutation = {
|
|
|
302
293
|
}
|
|
303
294
|
};
|
|
304
295
|
|
|
305
|
-
|
|
306
|
-
//#region src/controllers/dv-resource.controller.ts
|
|
296
|
+
// src/controllers/dv-resource.controller.ts
|
|
307
297
|
const DATA_VALIDATION_PLUGIN_NAME = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
308
298
|
let DataValidationResourceController = class DataValidationResourceController extends Disposable {
|
|
309
299
|
constructor(_resourceManagerService, _univerInstanceService, _dataValidationModel) {
|
|
@@ -357,13 +347,11 @@ DataValidationResourceController = __decorate([
|
|
|
357
347
|
__decorateParam(2, Inject(DataValidationModel))
|
|
358
348
|
], DataValidationResourceController);
|
|
359
349
|
|
|
360
|
-
|
|
361
|
-
//#region package.json
|
|
350
|
+
// package.json
|
|
362
351
|
var name = "@univerjs/data-validation";
|
|
363
|
-
var version = "1.
|
|
352
|
+
var version = "1.5.0";
|
|
364
353
|
|
|
365
|
-
|
|
366
|
-
//#region src/config/config.ts
|
|
354
|
+
// src/config/config.ts
|
|
367
355
|
/**
|
|
368
356
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
369
357
|
*
|
|
@@ -383,8 +371,7 @@ const DATA_VALIDATION_PLUGIN_CONFIG_KEY = "data-validation.config";
|
|
|
383
371
|
const configSymbol = Symbol(DATA_VALIDATION_PLUGIN_CONFIG_KEY);
|
|
384
372
|
const defaultPluginConfig = {};
|
|
385
373
|
|
|
386
|
-
|
|
387
|
-
//#region src/services/data-validator-registry.service.ts
|
|
374
|
+
// src/services/data-validator-registry.service.ts
|
|
388
375
|
let DataValidatorRegistryScope = /* @__PURE__ */ function(DataValidatorRegistryScope) {
|
|
389
376
|
DataValidatorRegistryScope["SHEET"] = "sheet";
|
|
390
377
|
return DataValidatorRegistryScope;
|
|
@@ -435,8 +422,7 @@ var DataValidatorRegistryService = class {
|
|
|
435
422
|
}
|
|
436
423
|
};
|
|
437
424
|
|
|
438
|
-
|
|
439
|
-
//#region src/plugin.ts
|
|
425
|
+
// src/plugin.ts
|
|
440
426
|
let UniverDataValidationPlugin = class UniverDataValidationPlugin extends Plugin {
|
|
441
427
|
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
442
428
|
super();
|
|
@@ -475,8 +461,7 @@ UniverDataValidationPlugin = __decorate([
|
|
|
475
461
|
__decorateParam(3, IConfigService)
|
|
476
462
|
], UniverDataValidationPlugin);
|
|
477
463
|
|
|
478
|
-
|
|
479
|
-
//#region src/types/const/two-formula-operators.ts
|
|
464
|
+
// src/types/const/two-formula-operators.ts
|
|
480
465
|
/**
|
|
481
466
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
482
467
|
*
|
|
@@ -494,8 +479,7 @@ UniverDataValidationPlugin = __decorate([
|
|
|
494
479
|
*/
|
|
495
480
|
const TWO_FORMULA_OPERATOR_COUNT = [DataValidationOperator.BETWEEN, DataValidationOperator.NOT_BETWEEN];
|
|
496
481
|
|
|
497
|
-
|
|
498
|
-
//#region src/types/const/operator-text-map.ts
|
|
482
|
+
// src/types/const/operator-text-map.ts
|
|
499
483
|
/**
|
|
500
484
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
501
485
|
*
|
|
@@ -544,8 +528,7 @@ const OperatorErrorTitleMap = {
|
|
|
544
528
|
NONE: "data-validation.errorMsg.legal"
|
|
545
529
|
};
|
|
546
530
|
|
|
547
|
-
|
|
548
|
-
//#region src/validators/base-data-validator.ts
|
|
531
|
+
// src/validators/base-data-validator.ts
|
|
549
532
|
const FORMULA1 = "{FORMULA1}";
|
|
550
533
|
const FORMULA2 = "{FORMULA2}";
|
|
551
534
|
const TYPE = "{TYPE}";
|
|
@@ -686,5 +669,4 @@ let BaseDataValidator = class BaseDataValidator {
|
|
|
686
669
|
};
|
|
687
670
|
BaseDataValidator = __decorate([__decorateParam(0, Inject(LocaleService)), __decorateParam(1, Inject(Injector))], BaseDataValidator);
|
|
688
671
|
|
|
689
|
-
//#endregion
|
|
690
672
|
export { AddDataValidationMutation, BaseDataValidator, DataValidationModel, DataValidationResourceController, DataValidatorDropdownType, DataValidatorRegistryScope, DataValidatorRegistryService, FORMULA1, FORMULA2, RemoveDataValidationMutation, TWO_FORMULA_OPERATOR_COUNT, TYPE, UniverDataValidationPlugin, UpdateDataValidationMutation, UpdateRuleType, getRuleOptions, getRuleSetting };
|
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
package/lib/locale/pt-BR.js
CHANGED
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/sk-SK.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -27,7 +27,7 @@ export declare class DataValidatorRegistryService {
|
|
|
27
27
|
validatorsChange$: import("rxjs").Observable<void>;
|
|
28
28
|
private _addValidatorToScope;
|
|
29
29
|
private _removeValidatorFromScope;
|
|
30
|
-
register(validator: BaseDataValidator): import("@
|
|
30
|
+
register(validator: BaseDataValidator): import("@univerjs/core").IDisposable;
|
|
31
31
|
getValidatorItem(id: string): BaseDataValidator | undefined;
|
|
32
32
|
getValidatorsByScope(scope: string): BaseDataValidator[] | undefined;
|
|
33
33
|
}
|