@univerjs/sheets-data-validation 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +11 -22
- package/lib/cjs/index.js +44 -87
- 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/facade.js +11 -22
- package/lib/es/index.js +44 -87
- 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/facade.js +11 -22
- package/lib/index.js +44 -87
- 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/validators/decimal-validator.d.ts +1 -1
- package/lib/types/validators/text-length-validator.d.ts +1 -1
- package/lib/types/validators/whole-validator.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Subject, bufferWhen, filter, skip } from "rxjs";
|
|
|
6
6
|
import { UnitAction } from "@univerjs/protocol";
|
|
7
7
|
import { FormulaRefRangeService, UniverSheetsFormulaPlugin } from "@univerjs/sheets-formula";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/utils/range.ts
|
|
10
10
|
function getRangeInWorksheet(range, worksheet) {
|
|
11
11
|
const maxRows = worksheet.getMaxRows();
|
|
12
12
|
const maxColumns = worksheet.getMaxColumns();
|
|
@@ -34,8 +34,7 @@ function getRangesInWorksheet(ranges, worksheet) {
|
|
|
34
34
|
return effectiveRanges;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
37
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
39
38
|
function _typeof(o) {
|
|
40
39
|
"@babel/helpers - typeof";
|
|
41
40
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -45,8 +44,7 @@ function _typeof(o) {
|
|
|
45
44
|
}, _typeof(o);
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
47
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
50
48
|
function toPrimitive(t, r) {
|
|
51
49
|
if ("object" != _typeof(t) || !t) return t;
|
|
52
50
|
var e = t[Symbol.toPrimitive];
|
|
@@ -58,15 +56,13 @@ function toPrimitive(t, r) {
|
|
|
58
56
|
return ("string" === r ? String : Number)(t);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
59
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
63
60
|
function toPropertyKey(t) {
|
|
64
61
|
var i = toPrimitive(t, "string");
|
|
65
62
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
66
63
|
}
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
65
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
70
66
|
function _defineProperty(e, r, t) {
|
|
71
67
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
72
68
|
value: t,
|
|
@@ -76,16 +72,14 @@ function _defineProperty(e, r, t) {
|
|
|
76
72
|
}) : e[r] = t, e;
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
|
|
80
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
75
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
81
76
|
function __decorateParam(paramIndex, decorator) {
|
|
82
77
|
return function(target, key) {
|
|
83
78
|
decorator(target, key, paramIndex);
|
|
84
79
|
};
|
|
85
80
|
}
|
|
86
81
|
|
|
87
|
-
|
|
88
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
82
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
89
83
|
function __decorate(decorators, target, key, desc) {
|
|
90
84
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
91
85
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -93,8 +87,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
93
87
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
94
88
|
}
|
|
95
89
|
|
|
96
|
-
|
|
97
|
-
//#region src/services/dv-cache.service.ts
|
|
90
|
+
// src/services/dv-cache.service.ts
|
|
98
91
|
let DataValidationCacheService = class DataValidationCacheService extends Disposable {
|
|
99
92
|
constructor(_commandService, _univerInstanceService, _sheetDataValidationModel) {
|
|
100
93
|
super();
|
|
@@ -204,8 +197,7 @@ DataValidationCacheService = __decorate([
|
|
|
204
197
|
__decorateParam(2, Inject(DataValidationModel))
|
|
205
198
|
], DataValidationCacheService);
|
|
206
199
|
|
|
207
|
-
|
|
208
|
-
//#region src/utils/formula.ts
|
|
200
|
+
// src/utils/formula.ts
|
|
209
201
|
function getFormulaResult(result) {
|
|
210
202
|
var _result$;
|
|
211
203
|
return result === null || result === void 0 || (_result$ = result[0]) === null || _result$ === void 0 || (_result$ = _result$[0]) === null || _result$ === void 0 ? void 0 : _result$.v;
|
|
@@ -225,8 +217,7 @@ function shouldOffsetFormulaByRange(type, validatorRegistryService) {
|
|
|
225
217
|
return (validator === null || validator === void 0 ? void 0 : validator.offsetFormulaByRange) ?? false;
|
|
226
218
|
}
|
|
227
219
|
|
|
228
|
-
|
|
229
|
-
//#region src/services/dv-custom-formula.service.ts
|
|
220
|
+
// src/services/dv-custom-formula.service.ts
|
|
230
221
|
let DataValidationCustomFormulaService = class DataValidationCustomFormulaService extends Disposable {
|
|
231
222
|
constructor(_instanceSrv, _registerOtherFormulaService, _dataValidationModel, _dataValidationCacheService, _validatorRegistryService) {
|
|
232
223
|
super();
|
|
@@ -417,8 +408,7 @@ DataValidationCustomFormulaService = __decorate([
|
|
|
417
408
|
__decorateParam(4, Inject(DataValidatorRegistryService))
|
|
418
409
|
], DataValidationCustomFormulaService);
|
|
419
410
|
|
|
420
|
-
|
|
421
|
-
//#region src/utils/get-cell-data-origin.ts
|
|
411
|
+
// src/utils/get-cell-data-origin.ts
|
|
422
412
|
function getCellValueOrigin(cell) {
|
|
423
413
|
return getOriginCellValue(cell);
|
|
424
414
|
}
|
|
@@ -426,8 +416,7 @@ function getStringCellValue(cell) {
|
|
|
426
416
|
return String(getCellValueOrigin(cell) ?? "");
|
|
427
417
|
}
|
|
428
418
|
|
|
429
|
-
|
|
430
|
-
//#region src/services/dv-list-cache.service.ts
|
|
419
|
+
// src/services/dv-list-cache.service.ts
|
|
431
420
|
let DataValidationListCacheService = class DataValidationListCacheService extends Disposable {
|
|
432
421
|
constructor(_injector, _dataValidationModel) {
|
|
433
422
|
super();
|
|
@@ -541,8 +530,7 @@ let DataValidationListCacheService = class DataValidationListCacheService extend
|
|
|
541
530
|
};
|
|
542
531
|
DataValidationListCacheService = __decorate([__decorateParam(0, Inject(Injector)), __decorateParam(1, Inject(DataValidationModel))], DataValidationListCacheService);
|
|
543
532
|
|
|
544
|
-
|
|
545
|
-
//#region src/services/dv-formula.service.ts
|
|
533
|
+
// src/services/dv-formula.service.ts
|
|
546
534
|
let DataValidationFormulaService = class DataValidationFormulaService extends Disposable {
|
|
547
535
|
constructor(_instanceService, _registerOtherFormulaService, _dataValidationCacheService, _dataValidationModel, _validatorRegistryService, _listCacheService) {
|
|
548
536
|
super();
|
|
@@ -651,8 +639,7 @@ DataValidationFormulaService = __decorate([
|
|
|
651
639
|
__decorateParam(5, Inject(DataValidationListCacheService))
|
|
652
640
|
], DataValidationFormulaService);
|
|
653
641
|
|
|
654
|
-
|
|
655
|
-
//#region src/models/rule-matrix.ts
|
|
642
|
+
// src/models/rule-matrix.ts
|
|
656
643
|
var RuleMatrix = class RuleMatrix {
|
|
657
644
|
constructor(value, _unitId, _subUnitId, _univerInstanceService, _disableTree = false) {
|
|
658
645
|
this._unitId = _unitId;
|
|
@@ -821,8 +808,7 @@ var RuleMatrix = class RuleMatrix {
|
|
|
821
808
|
}
|
|
822
809
|
};
|
|
823
810
|
|
|
824
|
-
|
|
825
|
-
//#region src/models/sheet-data-validation-model.ts
|
|
811
|
+
// src/models/sheet-data-validation-model.ts
|
|
826
812
|
let SheetDataValidationModel = class SheetDataValidationModel extends Disposable {
|
|
827
813
|
constructor(_dataValidationModel, _univerInstanceService, _dataValidatorRegistryService, _dataValidationCacheService, _dataValidationFormulaService, _dataValidationCustomFormulaService, _commandService) {
|
|
828
814
|
super();
|
|
@@ -1020,8 +1006,7 @@ SheetDataValidationModel = __decorate([
|
|
|
1020
1006
|
__decorateParam(6, ICommandService)
|
|
1021
1007
|
], SheetDataValidationModel);
|
|
1022
1008
|
|
|
1023
|
-
|
|
1024
|
-
//#region src/types/const/operator-text-map.ts
|
|
1009
|
+
// src/types/const/operator-text-map.ts
|
|
1025
1010
|
/**
|
|
1026
1011
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1027
1012
|
*
|
|
@@ -1080,8 +1065,7 @@ const TextLengthErrorTitleMap = {
|
|
|
1080
1065
|
[DataValidationOperator.NOT_EQUAL]: "sheets-data-validation.textLength.errorMsg.notEqual"
|
|
1081
1066
|
};
|
|
1082
1067
|
|
|
1083
|
-
|
|
1084
|
-
//#region src/validators/base-sheet-validator.ts
|
|
1068
|
+
// src/validators/base-sheet-validator.ts
|
|
1085
1069
|
const FORMULA1$1 = "{FORMULA1}";
|
|
1086
1070
|
const FORMULA2$1 = "{FORMULA2}";
|
|
1087
1071
|
const TYPE = "{TYPE}";
|
|
@@ -1100,8 +1084,7 @@ var BaseSheetValidator = class extends BaseDataValidator {
|
|
|
1100
1084
|
}
|
|
1101
1085
|
};
|
|
1102
1086
|
|
|
1103
|
-
|
|
1104
|
-
//#region src/validators/checkbox-validator.ts
|
|
1087
|
+
// src/validators/checkbox-validator.ts
|
|
1105
1088
|
const CHECKBOX_FORMULA_1 = 1;
|
|
1106
1089
|
const CHECKBOX_FORMULA_2 = 0;
|
|
1107
1090
|
function getFailMessage(formula, localeService) {
|
|
@@ -1191,8 +1174,7 @@ var CheckboxValidator = class extends BaseSheetValidator {
|
|
|
1191
1174
|
}
|
|
1192
1175
|
};
|
|
1193
1176
|
|
|
1194
|
-
|
|
1195
|
-
//#region src/common/date-text-map.ts
|
|
1177
|
+
// src/common/date-text-map.ts
|
|
1196
1178
|
/**
|
|
1197
1179
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1198
1180
|
*
|
|
@@ -1251,8 +1233,7 @@ const DateOperatorErrorTitleMap = {
|
|
|
1251
1233
|
NONE: "sheets-data-validation.date.errorMsg.legal"
|
|
1252
1234
|
};
|
|
1253
1235
|
|
|
1254
|
-
|
|
1255
|
-
//#region src/types/const/two-formula-operators.ts
|
|
1236
|
+
// src/types/const/two-formula-operators.ts
|
|
1256
1237
|
/**
|
|
1257
1238
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1258
1239
|
*
|
|
@@ -1270,8 +1251,7 @@ const DateOperatorErrorTitleMap = {
|
|
|
1270
1251
|
*/
|
|
1271
1252
|
const TWO_FORMULA_OPERATOR_COUNT = [DataValidationOperator.BETWEEN, DataValidationOperator.NOT_BETWEEN];
|
|
1272
1253
|
|
|
1273
|
-
|
|
1274
|
-
//#region src/validators/const.ts
|
|
1254
|
+
// src/validators/const.ts
|
|
1275
1255
|
/**
|
|
1276
1256
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1277
1257
|
*
|
|
@@ -1290,8 +1270,7 @@ const TWO_FORMULA_OPERATOR_COUNT = [DataValidationOperator.BETWEEN, DataValidati
|
|
|
1290
1270
|
const FORMULA1 = "{FORMULA1}";
|
|
1291
1271
|
const FORMULA2 = "{FORMULA2}";
|
|
1292
1272
|
|
|
1293
|
-
|
|
1294
|
-
//#region src/validators/util.ts
|
|
1273
|
+
// src/validators/util.ts
|
|
1295
1274
|
function getDataValidationCellValue(cellData) {
|
|
1296
1275
|
const cellValue = getCellValueOrigin(cellData);
|
|
1297
1276
|
if (cellValue === void 0 || cellValue === null) return "";
|
|
@@ -1309,8 +1288,7 @@ function getTransformedFormula(lexerTreeBuilder, rule, position) {
|
|
|
1309
1288
|
};
|
|
1310
1289
|
}
|
|
1311
1290
|
|
|
1312
|
-
|
|
1313
|
-
//#region src/validators/date-validator.ts
|
|
1291
|
+
// src/validators/date-validator.ts
|
|
1314
1292
|
const transformDate2SerialNumber = (value, options = {}) => {
|
|
1315
1293
|
var _numfmt$parseDate;
|
|
1316
1294
|
if (value === void 0 || value === null || typeof value === "boolean") return;
|
|
@@ -1428,8 +1406,7 @@ var DateValidator = class extends BaseSheetValidator {
|
|
|
1428
1406
|
}
|
|
1429
1407
|
};
|
|
1430
1408
|
|
|
1431
|
-
|
|
1432
|
-
//#region src/validators/decimal-validator.ts
|
|
1409
|
+
// src/validators/decimal-validator.ts
|
|
1433
1410
|
function getCellValueNumber(cellValue) {
|
|
1434
1411
|
return +cellValue;
|
|
1435
1412
|
}
|
|
@@ -1506,8 +1483,7 @@ var DecimalValidator = class extends BaseSheetValidator {
|
|
|
1506
1483
|
}
|
|
1507
1484
|
};
|
|
1508
1485
|
|
|
1509
|
-
|
|
1510
|
-
//#region src/validators/list-validator.ts
|
|
1486
|
+
// src/validators/list-validator.ts
|
|
1511
1487
|
function getRuleFormulaResultSet(result) {
|
|
1512
1488
|
if (!result) return [];
|
|
1513
1489
|
const resultSet = /* @__PURE__ */ new Set();
|
|
@@ -1653,8 +1629,7 @@ var ListValidator = class extends BaseSheetValidator {
|
|
|
1653
1629
|
}
|
|
1654
1630
|
};
|
|
1655
1631
|
|
|
1656
|
-
|
|
1657
|
-
//#region src/validators/text-length-validator.ts
|
|
1632
|
+
// src/validators/text-length-validator.ts
|
|
1658
1633
|
var TextLengthValidator = class extends BaseSheetValidator {
|
|
1659
1634
|
constructor(..._args) {
|
|
1660
1635
|
super(..._args);
|
|
@@ -1727,8 +1702,7 @@ var TextLengthValidator = class extends BaseSheetValidator {
|
|
|
1727
1702
|
}
|
|
1728
1703
|
};
|
|
1729
1704
|
|
|
1730
|
-
|
|
1731
|
-
//#region src/commands/commands/data-validation.command.ts
|
|
1705
|
+
// src/commands/commands/data-validation.command.ts
|
|
1732
1706
|
function isBlankCell(cellData) {
|
|
1733
1707
|
var _cellData$p$body;
|
|
1734
1708
|
if (!cellData) return true;
|
|
@@ -2284,8 +2258,7 @@ const RemoveSheetDataValidationCommand = {
|
|
|
2284
2258
|
}
|
|
2285
2259
|
};
|
|
2286
2260
|
|
|
2287
|
-
|
|
2288
|
-
//#region src/common/const.ts
|
|
2261
|
+
// src/common/const.ts
|
|
2289
2262
|
/**
|
|
2290
2263
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2291
2264
|
*
|
|
@@ -2303,8 +2276,7 @@ const RemoveSheetDataValidationCommand = {
|
|
|
2303
2276
|
*/
|
|
2304
2277
|
const DATA_VALIDATION_PLUGIN_NAME = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
2305
2278
|
|
|
2306
|
-
|
|
2307
|
-
//#region src/controllers/dv-formula.controller.ts
|
|
2279
|
+
// src/controllers/dv-formula.controller.ts
|
|
2308
2280
|
let DataValidationFormulaController = class DataValidationFormulaController extends Disposable {
|
|
2309
2281
|
constructor(_univerInstanceService, _permissionService, _lexerTreeBuilder) {
|
|
2310
2282
|
super();
|
|
@@ -2348,13 +2320,11 @@ DataValidationFormulaController = __decorate([
|
|
|
2348
2320
|
__decorateParam(2, Inject(LexerTreeBuilder))
|
|
2349
2321
|
], DataValidationFormulaController);
|
|
2350
2322
|
|
|
2351
|
-
|
|
2352
|
-
//#region package.json
|
|
2323
|
+
// package.json
|
|
2353
2324
|
var name = "@univerjs/sheets-data-validation";
|
|
2354
|
-
var version = "1.
|
|
2325
|
+
var version = "1.4.0";
|
|
2355
2326
|
|
|
2356
|
-
|
|
2357
|
-
//#region src/config/config.ts
|
|
2327
|
+
// src/config/config.ts
|
|
2358
2328
|
/**
|
|
2359
2329
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2360
2330
|
*
|
|
@@ -2374,8 +2344,7 @@ const SHEETS_DATA_VALIDATION_PLUGIN_CONFIG_KEY = "sheets-data-validation.config"
|
|
|
2374
2344
|
const configSymbol = Symbol(SHEETS_DATA_VALIDATION_PLUGIN_CONFIG_KEY);
|
|
2375
2345
|
const defaultPluginConfig = {};
|
|
2376
2346
|
|
|
2377
|
-
|
|
2378
|
-
//#region src/controllers/dv-formula-ref-range.controller.ts
|
|
2347
|
+
// src/controllers/dv-formula-ref-range.controller.ts
|
|
2379
2348
|
let DataValidationFormulaRefRangeController = class DataValidationFormulaRefRangeController extends Disposable {
|
|
2380
2349
|
constructor(_dataValidationModel, _formulaRefRangeService, _validatorRegistryService) {
|
|
2381
2350
|
super();
|
|
@@ -2529,8 +2498,7 @@ DataValidationFormulaRefRangeController = __decorate([
|
|
|
2529
2498
|
__decorateParam(2, Inject(DataValidatorRegistryService))
|
|
2530
2499
|
], DataValidationFormulaRefRangeController);
|
|
2531
2500
|
|
|
2532
|
-
|
|
2533
|
-
//#region src/controllers/dv-ref-range.controller.ts
|
|
2501
|
+
// src/controllers/dv-ref-range.controller.ts
|
|
2534
2502
|
let DataValidationRefRangeController = class DataValidationRefRangeController extends Disposable {
|
|
2535
2503
|
constructor(_dataValidationModel, _injector, _refRangeService, _dataValidationFormulaService, _formulaRefRangeService, _validatorRegistryService) {
|
|
2536
2504
|
super();
|
|
@@ -2726,8 +2694,7 @@ DataValidationRefRangeController = __decorate([
|
|
|
2726
2694
|
__decorateParam(5, Inject(DataValidatorRegistryService))
|
|
2727
2695
|
], DataValidationRefRangeController);
|
|
2728
2696
|
|
|
2729
|
-
|
|
2730
|
-
//#region src/controllers/dv-sheet.controller.ts
|
|
2697
|
+
// src/controllers/dv-sheet.controller.ts
|
|
2731
2698
|
let SheetDataValidationSheetController = class SheetDataValidationSheetController extends Disposable {
|
|
2732
2699
|
constructor(_sheetInterceptorService, _univerInstanceService, _sheetDataValidationModel) {
|
|
2733
2700
|
super();
|
|
@@ -2830,8 +2797,7 @@ SheetDataValidationSheetController = __decorate([
|
|
|
2830
2797
|
__decorateParam(2, Inject(SheetDataValidationModel))
|
|
2831
2798
|
], SheetDataValidationSheetController);
|
|
2832
2799
|
|
|
2833
|
-
|
|
2834
|
-
//#region src/validators/any-validator.ts
|
|
2800
|
+
// src/validators/any-validator.ts
|
|
2835
2801
|
var AnyValidator = class extends BaseSheetValidator {
|
|
2836
2802
|
constructor(..._args) {
|
|
2837
2803
|
super(..._args);
|
|
@@ -2860,8 +2826,7 @@ var AnyValidator = class extends BaseSheetValidator {
|
|
|
2860
2826
|
}
|
|
2861
2827
|
};
|
|
2862
2828
|
|
|
2863
|
-
|
|
2864
|
-
//#region src/validators/custom-validator.ts
|
|
2829
|
+
// src/validators/custom-validator.ts
|
|
2865
2830
|
var CustomFormulaValidator = class extends BaseSheetValidator {
|
|
2866
2831
|
constructor(..._args) {
|
|
2867
2832
|
super(..._args);
|
|
@@ -2911,8 +2876,7 @@ var CustomFormulaValidator = class extends BaseSheetValidator {
|
|
|
2911
2876
|
}
|
|
2912
2877
|
};
|
|
2913
2878
|
|
|
2914
|
-
|
|
2915
|
-
//#region src/validators/list-multiple-validator.ts
|
|
2879
|
+
// src/validators/list-multiple-validator.ts
|
|
2916
2880
|
/**
|
|
2917
2881
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2918
2882
|
*
|
|
@@ -2940,8 +2904,7 @@ var ListMultipleValidator = class extends ListValidator {
|
|
|
2940
2904
|
}
|
|
2941
2905
|
};
|
|
2942
2906
|
|
|
2943
|
-
|
|
2944
|
-
//#region src/validators/whole-validator.ts
|
|
2907
|
+
// src/validators/whole-validator.ts
|
|
2945
2908
|
var WholeValidator = class extends BaseSheetValidator {
|
|
2946
2909
|
constructor(..._args) {
|
|
2947
2910
|
super(..._args);
|
|
@@ -3018,8 +2981,7 @@ var WholeValidator = class extends BaseSheetValidator {
|
|
|
3018
2981
|
}
|
|
3019
2982
|
};
|
|
3020
2983
|
|
|
3021
|
-
|
|
3022
|
-
//#region src/controllers/dv.controller.ts
|
|
2984
|
+
// src/controllers/dv.controller.ts
|
|
3023
2985
|
let DataValidationController = class DataValidationController extends RxDisposable {
|
|
3024
2986
|
constructor(_univerInstanceService, _dataValidatorRegistryService, _injector, _selectionManagerService, _sheetInterceptorService, _sheetDataValidationModel) {
|
|
3025
2987
|
super();
|
|
@@ -3087,8 +3049,7 @@ DataValidationController = __decorate([
|
|
|
3087
3049
|
__decorateParam(5, Inject(SheetDataValidationModel))
|
|
3088
3050
|
], DataValidationController);
|
|
3089
3051
|
|
|
3090
|
-
|
|
3091
|
-
//#region src/services/dv-validator.service.ts
|
|
3052
|
+
// src/services/dv-validator.service.ts
|
|
3092
3053
|
let SheetsDataValidationValidatorService = class SheetsDataValidationValidatorService extends Disposable {
|
|
3093
3054
|
constructor(_univerInstanceService, _sheetDataValidationModel, _dataValidationCacheService, _lifecycleService) {
|
|
3094
3055
|
super();
|
|
@@ -3253,8 +3214,7 @@ SheetsDataValidationValidatorService = __decorate([
|
|
|
3253
3214
|
__decorateParam(3, Inject(LifecycleService))
|
|
3254
3215
|
], SheetsDataValidationValidatorService);
|
|
3255
3216
|
|
|
3256
|
-
|
|
3257
|
-
//#region src/plugin.ts
|
|
3217
|
+
// src/plugin.ts
|
|
3258
3218
|
let UniverSheetsDataValidationPlugin = class UniverSheetsDataValidationPlugin extends Plugin {
|
|
3259
3219
|
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
3260
3220
|
super();
|
|
@@ -3316,8 +3276,7 @@ UniverSheetsDataValidationPlugin = __decorate([
|
|
|
3316
3276
|
__decorateParam(3, IConfigService)
|
|
3317
3277
|
], UniverSheetsDataValidationPlugin);
|
|
3318
3278
|
|
|
3319
|
-
|
|
3320
|
-
//#region src/utils/create.ts
|
|
3279
|
+
// src/utils/create.ts
|
|
3321
3280
|
function createDefaultNewRule(accessor) {
|
|
3322
3281
|
const currentRanges = accessor.get(SheetsSelectionsService).getCurrentSelections().map((s) => s.range);
|
|
3323
3282
|
return {
|
|
@@ -3334,12 +3293,10 @@ function createDefaultNewRule(accessor) {
|
|
|
3334
3293
|
};
|
|
3335
3294
|
}
|
|
3336
3295
|
|
|
3337
|
-
|
|
3338
|
-
//#region src/index.ts
|
|
3296
|
+
// src/index.ts
|
|
3339
3297
|
const CUSTOM_FORMULA_INPUT_NAME = "sheets-data-validation.custom-formula-input";
|
|
3340
3298
|
const BASE_FORMULA_INPUT_NAME = "sheets-data-validation.formula-input";
|
|
3341
3299
|
const LIST_FORMULA_INPUT_NAME = "sheets-data-validation.list-formula-input";
|
|
3342
3300
|
const CHECKBOX_FORMULA_INPUT_NAME = "sheets-data-validation.checkbox-formula-input";
|
|
3343
3301
|
|
|
3344
|
-
//#endregion
|
|
3345
3302
|
export { AddSheetDataValidationCommand, BASE_FORMULA_INPUT_NAME, CHECKBOX_FORMULA_1, CHECKBOX_FORMULA_2, CHECKBOX_FORMULA_INPUT_NAME, CUSTOM_FORMULA_INPUT_NAME, CheckboxValidator, ClearRangeDataValidationCommand, DATA_VALIDATION_PLUGIN_NAME, DataValidationCacheService, DataValidationCustomFormulaService, DataValidationFormulaController, DataValidationFormulaService, DataValidationListCacheService, DateValidator, LIST_FORMULA_INPUT_NAME, ListMultipleValidator, ListValidator, RemoveSheetAllDataValidationCommand, RemoveSheetDataValidationCommand, SheetDataValidationModel, SheetsDataValidationValidatorService, UniverSheetsDataValidationPlugin, UpdateSheetDataValidationOptionsCommand, UpdateSheetDataValidationRangeCommand, UpdateSheetDataValidationSettingCommand, createDefaultNewRule, getCellValueNumber, getCellValueOrigin, getDataValidationCellValue, getDataValidationDiffMutations, getFormulaCellData, getFormulaResult, getRangesInWorksheet, getTransformedFormula, isLegalFormulaResult, transformCheckboxValue };
|
package/lib/locale/ar-SA.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ar-SA.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "بين",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/ca-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ca-ES.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "entre",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/de-DE.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/de-DE.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "zwischen",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/es-ES.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "entre",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fa-IR.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "بین",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "entre",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/id-ID.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/id-ID.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "antara",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/it-IT.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/it-IT.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "tra",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/ja-JP.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ja-JP.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "次の値の間",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/ko-KR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ko-KR.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "사이",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/pl-PL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pl-PL.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "między",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/pt-BR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pt-BR.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "entre",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "между",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/sk-SK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/sk-SK.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "medzi",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/vi-VN.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "Giữa",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-CN.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "介于",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-HK.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "介於",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/zh-TW.ts
|
|
2
2
|
const locale = { "sheets-data-validation": {
|
|
3
3
|
operators: {
|
|
4
4
|
between: "介於",
|
|
@@ -114,5 +114,4 @@ const locale = { "sheets-data-validation": {
|
|
|
114
114
|
}
|
|
115
115
|
} };
|
|
116
116
|
|
|
117
|
-
//#endregion
|
|
118
117
|
export { locale as default };
|
|
@@ -30,7 +30,6 @@ export declare class DecimalValidator extends BaseSheetValidator {
|
|
|
30
30
|
private _isFormulaOrNumber;
|
|
31
31
|
isValidType(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
32
32
|
transform(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): {
|
|
33
|
-
value: number;
|
|
34
33
|
interceptValue: Nullable<CellValue>;
|
|
35
34
|
row: number;
|
|
36
35
|
column: number;
|
|
@@ -39,6 +38,7 @@ export declare class DecimalValidator extends BaseSheetValidator {
|
|
|
39
38
|
worksheet: import("@univerjs/core").Worksheet;
|
|
40
39
|
workbook: import("@univerjs/core").Workbook;
|
|
41
40
|
t: Nullable<import("@univerjs/protocol").CellValueType>;
|
|
41
|
+
value: number;
|
|
42
42
|
};
|
|
43
43
|
private _parseNumber;
|
|
44
44
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string, row: number, column: number): Promise<IFormulaResult>;
|