@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/cjs/facade.js
CHANGED
|
@@ -7,7 +7,7 @@ let _univerjs_engine_formula = require("@univerjs/engine-formula");
|
|
|
7
7
|
let _univerjs_sheets = require("@univerjs/sheets");
|
|
8
8
|
let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
11
11
|
function _typeof(o) {
|
|
12
12
|
"@babel/helpers - typeof";
|
|
13
13
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -17,8 +17,7 @@ function _typeof(o) {
|
|
|
17
17
|
}, _typeof(o);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
20
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
22
21
|
function toPrimitive(t, r) {
|
|
23
22
|
if ("object" != _typeof(t) || !t) return t;
|
|
24
23
|
var e = t[Symbol.toPrimitive];
|
|
@@ -30,15 +29,13 @@ function toPrimitive(t, r) {
|
|
|
30
29
|
return ("string" === r ? String : Number)(t);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
32
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
35
33
|
function toPropertyKey(t) {
|
|
36
34
|
var i = toPrimitive(t, "string");
|
|
37
35
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
38
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
42
39
|
function _defineProperty(e, r, t) {
|
|
43
40
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
44
41
|
value: t,
|
|
@@ -48,8 +45,7 @@ function _defineProperty(e, r, t) {
|
|
|
48
45
|
}) : e[r] = t, e;
|
|
49
46
|
}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
//#region src/facade/f-data-validation-builder.ts
|
|
48
|
+
// src/facade/f-data-validation-builder.ts
|
|
53
49
|
/**
|
|
54
50
|
* Builder for data validation rules. use {@link FUniver} `univerAPI.newDataValidation()` to create a new builder.
|
|
55
51
|
* @example
|
|
@@ -954,8 +950,7 @@ var FDataValidationBuilder = class FDataValidationBuilder {
|
|
|
954
950
|
}
|
|
955
951
|
};
|
|
956
952
|
|
|
957
|
-
|
|
958
|
-
//#region src/facade/f-data-validation.ts
|
|
953
|
+
// src/facade/f-data-validation.ts
|
|
959
954
|
/**
|
|
960
955
|
* @hideconstructor
|
|
961
956
|
*/
|
|
@@ -1319,8 +1314,7 @@ var FDataValidation = class {
|
|
|
1319
1314
|
}
|
|
1320
1315
|
};
|
|
1321
1316
|
|
|
1322
|
-
|
|
1323
|
-
//#region src/facade/f-range.ts
|
|
1317
|
+
// src/facade/f-range.ts
|
|
1324
1318
|
/**
|
|
1325
1319
|
* @ignore
|
|
1326
1320
|
*/
|
|
@@ -1401,8 +1395,7 @@ var FRangeSheetsDataValidationMixin = class extends _univerjs_sheets_facade.FRan
|
|
|
1401
1395
|
};
|
|
1402
1396
|
_univerjs_sheets_facade.FRange.extend(FRangeSheetsDataValidationMixin);
|
|
1403
1397
|
|
|
1404
|
-
|
|
1405
|
-
//#region src/facade/f-univer.ts
|
|
1398
|
+
// src/facade/f-univer.ts
|
|
1406
1399
|
var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniver {
|
|
1407
1400
|
newDataValidation() {
|
|
1408
1401
|
return new FDataValidationBuilder();
|
|
@@ -1570,8 +1563,7 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
|
|
|
1570
1563
|
};
|
|
1571
1564
|
_univerjs_core_facade.FUniver.extend(FUniverSheetsDataValidationMixin);
|
|
1572
1565
|
|
|
1573
|
-
|
|
1574
|
-
//#region src/facade/f-workbook.ts
|
|
1566
|
+
// src/facade/f-workbook.ts
|
|
1575
1567
|
/**
|
|
1576
1568
|
* @ignore
|
|
1577
1569
|
*/
|
|
@@ -1641,8 +1633,7 @@ var FWorkbookSheetsDataValidationMixin = class extends _univerjs_sheets_facade.F
|
|
|
1641
1633
|
};
|
|
1642
1634
|
_univerjs_sheets_facade.FWorkbook.extend(FWorkbookSheetsDataValidationMixin);
|
|
1643
1635
|
|
|
1644
|
-
|
|
1645
|
-
//#region src/facade/f-worksheet.ts
|
|
1636
|
+
// src/facade/f-worksheet.ts
|
|
1646
1637
|
/**
|
|
1647
1638
|
* @ignore
|
|
1648
1639
|
*/
|
|
@@ -1709,8 +1700,7 @@ var FWorksheetDataValidationMixin = class extends _univerjs_sheets_facade.FWorks
|
|
|
1709
1700
|
};
|
|
1710
1701
|
_univerjs_sheets_facade.FWorksheet.extend(FWorksheetDataValidationMixin);
|
|
1711
1702
|
|
|
1712
|
-
|
|
1713
|
-
//#region src/facade/f-event.ts
|
|
1703
|
+
// src/facade/f-event.ts
|
|
1714
1704
|
/**
|
|
1715
1705
|
* @ignore
|
|
1716
1706
|
*/
|
|
@@ -1742,6 +1732,5 @@ var FSheetsDataValidationEventNameMixin = class extends _univerjs_core_facade.FE
|
|
|
1742
1732
|
};
|
|
1743
1733
|
_univerjs_core_facade.FEventName.extend(FSheetsDataValidationEventNameMixin);
|
|
1744
1734
|
|
|
1745
|
-
//#endregion
|
|
1746
1735
|
exports.FDataValidation = FDataValidation;
|
|
1747
1736
|
exports.FDataValidationBuilder = FDataValidationBuilder;
|
package/lib/cjs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ let rxjs = require("rxjs");
|
|
|
7
7
|
let _univerjs_protocol = require("@univerjs/protocol");
|
|
8
8
|
let _univerjs_sheets_formula = require("@univerjs/sheets-formula");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/utils/range.ts
|
|
11
11
|
function getRangeInWorksheet(range, worksheet) {
|
|
12
12
|
const maxRows = worksheet.getMaxRows();
|
|
13
13
|
const maxColumns = worksheet.getMaxColumns();
|
|
@@ -35,8 +35,7 @@ function getRangesInWorksheet(ranges, worksheet) {
|
|
|
35
35
|
return effectiveRanges;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
38
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
40
39
|
function _typeof(o) {
|
|
41
40
|
"@babel/helpers - typeof";
|
|
42
41
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -46,8 +45,7 @@ function _typeof(o) {
|
|
|
46
45
|
}, _typeof(o);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
48
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
51
49
|
function toPrimitive(t, r) {
|
|
52
50
|
if ("object" != _typeof(t) || !t) return t;
|
|
53
51
|
var e = t[Symbol.toPrimitive];
|
|
@@ -59,15 +57,13 @@ function toPrimitive(t, r) {
|
|
|
59
57
|
return ("string" === r ? String : Number)(t);
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
60
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
64
61
|
function toPropertyKey(t) {
|
|
65
62
|
var i = toPrimitive(t, "string");
|
|
66
63
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
67
64
|
}
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
66
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
71
67
|
function _defineProperty(e, r, t) {
|
|
72
68
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
73
69
|
value: t,
|
|
@@ -77,16 +73,14 @@ function _defineProperty(e, r, t) {
|
|
|
77
73
|
}) : e[r] = t, e;
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
76
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
82
77
|
function __decorateParam(paramIndex, decorator) {
|
|
83
78
|
return function(target, key) {
|
|
84
79
|
decorator(target, key, paramIndex);
|
|
85
80
|
};
|
|
86
81
|
}
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
83
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
90
84
|
function __decorate(decorators, target, key, desc) {
|
|
91
85
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
92
86
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -94,8 +88,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
94
88
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
95
89
|
}
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
//#region src/services/dv-cache.service.ts
|
|
91
|
+
// src/services/dv-cache.service.ts
|
|
99
92
|
let DataValidationCacheService = class DataValidationCacheService extends _univerjs_core.Disposable {
|
|
100
93
|
constructor(_commandService, _univerInstanceService, _sheetDataValidationModel) {
|
|
101
94
|
super();
|
|
@@ -205,8 +198,7 @@ DataValidationCacheService = __decorate([
|
|
|
205
198
|
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidationModel))
|
|
206
199
|
], DataValidationCacheService);
|
|
207
200
|
|
|
208
|
-
|
|
209
|
-
//#region src/utils/formula.ts
|
|
201
|
+
// src/utils/formula.ts
|
|
210
202
|
function getFormulaResult(result) {
|
|
211
203
|
var _result$;
|
|
212
204
|
return result === null || result === void 0 || (_result$ = result[0]) === null || _result$ === void 0 || (_result$ = _result$[0]) === null || _result$ === void 0 ? void 0 : _result$.v;
|
|
@@ -226,8 +218,7 @@ function shouldOffsetFormulaByRange(type, validatorRegistryService) {
|
|
|
226
218
|
return (validator === null || validator === void 0 ? void 0 : validator.offsetFormulaByRange) ?? false;
|
|
227
219
|
}
|
|
228
220
|
|
|
229
|
-
|
|
230
|
-
//#region src/services/dv-custom-formula.service.ts
|
|
221
|
+
// src/services/dv-custom-formula.service.ts
|
|
231
222
|
let DataValidationCustomFormulaService = class DataValidationCustomFormulaService extends _univerjs_core.Disposable {
|
|
232
223
|
constructor(_instanceSrv, _registerOtherFormulaService, _dataValidationModel, _dataValidationCacheService, _validatorRegistryService) {
|
|
233
224
|
super();
|
|
@@ -418,8 +409,7 @@ DataValidationCustomFormulaService = __decorate([
|
|
|
418
409
|
__decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidatorRegistryService))
|
|
419
410
|
], DataValidationCustomFormulaService);
|
|
420
411
|
|
|
421
|
-
|
|
422
|
-
//#region src/utils/get-cell-data-origin.ts
|
|
412
|
+
// src/utils/get-cell-data-origin.ts
|
|
423
413
|
function getCellValueOrigin(cell) {
|
|
424
414
|
return (0, _univerjs_core.getOriginCellValue)(cell);
|
|
425
415
|
}
|
|
@@ -427,8 +417,7 @@ function getStringCellValue(cell) {
|
|
|
427
417
|
return String(getCellValueOrigin(cell) ?? "");
|
|
428
418
|
}
|
|
429
419
|
|
|
430
|
-
|
|
431
|
-
//#region src/services/dv-list-cache.service.ts
|
|
420
|
+
// src/services/dv-list-cache.service.ts
|
|
432
421
|
let DataValidationListCacheService = class DataValidationListCacheService extends _univerjs_core.Disposable {
|
|
433
422
|
constructor(_injector, _dataValidationModel) {
|
|
434
423
|
super();
|
|
@@ -542,8 +531,7 @@ let DataValidationListCacheService = class DataValidationListCacheService extend
|
|
|
542
531
|
};
|
|
543
532
|
DataValidationListCacheService = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidationModel))], DataValidationListCacheService);
|
|
544
533
|
|
|
545
|
-
|
|
546
|
-
//#region src/services/dv-formula.service.ts
|
|
534
|
+
// src/services/dv-formula.service.ts
|
|
547
535
|
let DataValidationFormulaService = class DataValidationFormulaService extends _univerjs_core.Disposable {
|
|
548
536
|
constructor(_instanceService, _registerOtherFormulaService, _dataValidationCacheService, _dataValidationModel, _validatorRegistryService, _listCacheService) {
|
|
549
537
|
super();
|
|
@@ -652,8 +640,7 @@ DataValidationFormulaService = __decorate([
|
|
|
652
640
|
__decorateParam(5, (0, _univerjs_core.Inject)(DataValidationListCacheService))
|
|
653
641
|
], DataValidationFormulaService);
|
|
654
642
|
|
|
655
|
-
|
|
656
|
-
//#region src/models/rule-matrix.ts
|
|
643
|
+
// src/models/rule-matrix.ts
|
|
657
644
|
var RuleMatrix = class RuleMatrix {
|
|
658
645
|
constructor(value, _unitId, _subUnitId, _univerInstanceService, _disableTree = false) {
|
|
659
646
|
this._unitId = _unitId;
|
|
@@ -822,8 +809,7 @@ var RuleMatrix = class RuleMatrix {
|
|
|
822
809
|
}
|
|
823
810
|
};
|
|
824
811
|
|
|
825
|
-
|
|
826
|
-
//#region src/models/sheet-data-validation-model.ts
|
|
812
|
+
// src/models/sheet-data-validation-model.ts
|
|
827
813
|
let SheetDataValidationModel = class SheetDataValidationModel extends _univerjs_core.Disposable {
|
|
828
814
|
constructor(_dataValidationModel, _univerInstanceService, _dataValidatorRegistryService, _dataValidationCacheService, _dataValidationFormulaService, _dataValidationCustomFormulaService, _commandService) {
|
|
829
815
|
super();
|
|
@@ -1021,8 +1007,7 @@ SheetDataValidationModel = __decorate([
|
|
|
1021
1007
|
__decorateParam(6, _univerjs_core.ICommandService)
|
|
1022
1008
|
], SheetDataValidationModel);
|
|
1023
1009
|
|
|
1024
|
-
|
|
1025
|
-
//#region src/types/const/operator-text-map.ts
|
|
1010
|
+
// src/types/const/operator-text-map.ts
|
|
1026
1011
|
/**
|
|
1027
1012
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1028
1013
|
*
|
|
@@ -1081,8 +1066,7 @@ const TextLengthErrorTitleMap = {
|
|
|
1081
1066
|
[_univerjs_core.DataValidationOperator.NOT_EQUAL]: "sheets-data-validation.textLength.errorMsg.notEqual"
|
|
1082
1067
|
};
|
|
1083
1068
|
|
|
1084
|
-
|
|
1085
|
-
//#region src/validators/base-sheet-validator.ts
|
|
1069
|
+
// src/validators/base-sheet-validator.ts
|
|
1086
1070
|
const FORMULA1$1 = "{FORMULA1}";
|
|
1087
1071
|
const FORMULA2$1 = "{FORMULA2}";
|
|
1088
1072
|
const TYPE = "{TYPE}";
|
|
@@ -1101,8 +1085,7 @@ var BaseSheetValidator = class extends _univerjs_data_validation.BaseDataValidat
|
|
|
1101
1085
|
}
|
|
1102
1086
|
};
|
|
1103
1087
|
|
|
1104
|
-
|
|
1105
|
-
//#region src/validators/checkbox-validator.ts
|
|
1088
|
+
// src/validators/checkbox-validator.ts
|
|
1106
1089
|
const CHECKBOX_FORMULA_1 = 1;
|
|
1107
1090
|
const CHECKBOX_FORMULA_2 = 0;
|
|
1108
1091
|
function getFailMessage(formula, localeService) {
|
|
@@ -1192,8 +1175,7 @@ var CheckboxValidator = class extends BaseSheetValidator {
|
|
|
1192
1175
|
}
|
|
1193
1176
|
};
|
|
1194
1177
|
|
|
1195
|
-
|
|
1196
|
-
//#region src/common/date-text-map.ts
|
|
1178
|
+
// src/common/date-text-map.ts
|
|
1197
1179
|
/**
|
|
1198
1180
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1199
1181
|
*
|
|
@@ -1252,8 +1234,7 @@ const DateOperatorErrorTitleMap = {
|
|
|
1252
1234
|
NONE: "sheets-data-validation.date.errorMsg.legal"
|
|
1253
1235
|
};
|
|
1254
1236
|
|
|
1255
|
-
|
|
1256
|
-
//#region src/types/const/two-formula-operators.ts
|
|
1237
|
+
// src/types/const/two-formula-operators.ts
|
|
1257
1238
|
/**
|
|
1258
1239
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1259
1240
|
*
|
|
@@ -1271,8 +1252,7 @@ const DateOperatorErrorTitleMap = {
|
|
|
1271
1252
|
*/
|
|
1272
1253
|
const TWO_FORMULA_OPERATOR_COUNT = [_univerjs_core.DataValidationOperator.BETWEEN, _univerjs_core.DataValidationOperator.NOT_BETWEEN];
|
|
1273
1254
|
|
|
1274
|
-
|
|
1275
|
-
//#region src/validators/const.ts
|
|
1255
|
+
// src/validators/const.ts
|
|
1276
1256
|
/**
|
|
1277
1257
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1278
1258
|
*
|
|
@@ -1291,8 +1271,7 @@ const TWO_FORMULA_OPERATOR_COUNT = [_univerjs_core.DataValidationOperator.BETWEE
|
|
|
1291
1271
|
const FORMULA1 = "{FORMULA1}";
|
|
1292
1272
|
const FORMULA2 = "{FORMULA2}";
|
|
1293
1273
|
|
|
1294
|
-
|
|
1295
|
-
//#region src/validators/util.ts
|
|
1274
|
+
// src/validators/util.ts
|
|
1296
1275
|
function getDataValidationCellValue(cellData) {
|
|
1297
1276
|
const cellValue = getCellValueOrigin(cellData);
|
|
1298
1277
|
if (cellValue === void 0 || cellValue === null) return "";
|
|
@@ -1310,8 +1289,7 @@ function getTransformedFormula(lexerTreeBuilder, rule, position) {
|
|
|
1310
1289
|
};
|
|
1311
1290
|
}
|
|
1312
1291
|
|
|
1313
|
-
|
|
1314
|
-
//#region src/validators/date-validator.ts
|
|
1292
|
+
// src/validators/date-validator.ts
|
|
1315
1293
|
const transformDate2SerialNumber = (value, options = {}) => {
|
|
1316
1294
|
var _numfmt$parseDate;
|
|
1317
1295
|
if (value === void 0 || value === null || typeof value === "boolean") return;
|
|
@@ -1429,8 +1407,7 @@ var DateValidator = class extends BaseSheetValidator {
|
|
|
1429
1407
|
}
|
|
1430
1408
|
};
|
|
1431
1409
|
|
|
1432
|
-
|
|
1433
|
-
//#region src/validators/decimal-validator.ts
|
|
1410
|
+
// src/validators/decimal-validator.ts
|
|
1434
1411
|
function getCellValueNumber(cellValue) {
|
|
1435
1412
|
return +cellValue;
|
|
1436
1413
|
}
|
|
@@ -1507,8 +1484,7 @@ var DecimalValidator = class extends BaseSheetValidator {
|
|
|
1507
1484
|
}
|
|
1508
1485
|
};
|
|
1509
1486
|
|
|
1510
|
-
|
|
1511
|
-
//#region src/validators/list-validator.ts
|
|
1487
|
+
// src/validators/list-validator.ts
|
|
1512
1488
|
function getRuleFormulaResultSet(result) {
|
|
1513
1489
|
if (!result) return [];
|
|
1514
1490
|
const resultSet = /* @__PURE__ */ new Set();
|
|
@@ -1654,8 +1630,7 @@ var ListValidator = class extends BaseSheetValidator {
|
|
|
1654
1630
|
}
|
|
1655
1631
|
};
|
|
1656
1632
|
|
|
1657
|
-
|
|
1658
|
-
//#region src/validators/text-length-validator.ts
|
|
1633
|
+
// src/validators/text-length-validator.ts
|
|
1659
1634
|
var TextLengthValidator = class extends BaseSheetValidator {
|
|
1660
1635
|
constructor(..._args) {
|
|
1661
1636
|
super(..._args);
|
|
@@ -1728,8 +1703,7 @@ var TextLengthValidator = class extends BaseSheetValidator {
|
|
|
1728
1703
|
}
|
|
1729
1704
|
};
|
|
1730
1705
|
|
|
1731
|
-
|
|
1732
|
-
//#region src/commands/commands/data-validation.command.ts
|
|
1706
|
+
// src/commands/commands/data-validation.command.ts
|
|
1733
1707
|
function isBlankCell(cellData) {
|
|
1734
1708
|
var _cellData$p$body;
|
|
1735
1709
|
if (!cellData) return true;
|
|
@@ -2285,8 +2259,7 @@ const RemoveSheetDataValidationCommand = {
|
|
|
2285
2259
|
}
|
|
2286
2260
|
};
|
|
2287
2261
|
|
|
2288
|
-
|
|
2289
|
-
//#region src/common/const.ts
|
|
2262
|
+
// src/common/const.ts
|
|
2290
2263
|
/**
|
|
2291
2264
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2292
2265
|
*
|
|
@@ -2304,8 +2277,7 @@ const RemoveSheetDataValidationCommand = {
|
|
|
2304
2277
|
*/
|
|
2305
2278
|
const DATA_VALIDATION_PLUGIN_NAME = "SHEET_DATA_VALIDATION_PLUGIN";
|
|
2306
2279
|
|
|
2307
|
-
|
|
2308
|
-
//#region src/controllers/dv-formula.controller.ts
|
|
2280
|
+
// src/controllers/dv-formula.controller.ts
|
|
2309
2281
|
let DataValidationFormulaController = class DataValidationFormulaController extends _univerjs_core.Disposable {
|
|
2310
2282
|
constructor(_univerInstanceService, _permissionService, _lexerTreeBuilder) {
|
|
2311
2283
|
super();
|
|
@@ -2349,13 +2321,11 @@ DataValidationFormulaController = __decorate([
|
|
|
2349
2321
|
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_engine_formula.LexerTreeBuilder))
|
|
2350
2322
|
], DataValidationFormulaController);
|
|
2351
2323
|
|
|
2352
|
-
|
|
2353
|
-
//#region package.json
|
|
2324
|
+
// package.json
|
|
2354
2325
|
var name = "@univerjs/sheets-data-validation";
|
|
2355
|
-
var version = "1.
|
|
2326
|
+
var version = "1.4.0";
|
|
2356
2327
|
|
|
2357
|
-
|
|
2358
|
-
//#region src/config/config.ts
|
|
2328
|
+
// src/config/config.ts
|
|
2359
2329
|
/**
|
|
2360
2330
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2361
2331
|
*
|
|
@@ -2375,8 +2345,7 @@ const SHEETS_DATA_VALIDATION_PLUGIN_CONFIG_KEY = "sheets-data-validation.config"
|
|
|
2375
2345
|
const configSymbol = Symbol(SHEETS_DATA_VALIDATION_PLUGIN_CONFIG_KEY);
|
|
2376
2346
|
const defaultPluginConfig = {};
|
|
2377
2347
|
|
|
2378
|
-
|
|
2379
|
-
//#region src/controllers/dv-formula-ref-range.controller.ts
|
|
2348
|
+
// src/controllers/dv-formula-ref-range.controller.ts
|
|
2380
2349
|
let DataValidationFormulaRefRangeController = class DataValidationFormulaRefRangeController extends _univerjs_core.Disposable {
|
|
2381
2350
|
constructor(_dataValidationModel, _formulaRefRangeService, _validatorRegistryService) {
|
|
2382
2351
|
super();
|
|
@@ -2530,8 +2499,7 @@ DataValidationFormulaRefRangeController = __decorate([
|
|
|
2530
2499
|
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidatorRegistryService))
|
|
2531
2500
|
], DataValidationFormulaRefRangeController);
|
|
2532
2501
|
|
|
2533
|
-
|
|
2534
|
-
//#region src/controllers/dv-ref-range.controller.ts
|
|
2502
|
+
// src/controllers/dv-ref-range.controller.ts
|
|
2535
2503
|
let DataValidationRefRangeController = class DataValidationRefRangeController extends _univerjs_core.Disposable {
|
|
2536
2504
|
constructor(_dataValidationModel, _injector, _refRangeService, _dataValidationFormulaService, _formulaRefRangeService, _validatorRegistryService) {
|
|
2537
2505
|
super();
|
|
@@ -2727,8 +2695,7 @@ DataValidationRefRangeController = __decorate([
|
|
|
2727
2695
|
__decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_data_validation.DataValidatorRegistryService))
|
|
2728
2696
|
], DataValidationRefRangeController);
|
|
2729
2697
|
|
|
2730
|
-
|
|
2731
|
-
//#region src/controllers/dv-sheet.controller.ts
|
|
2698
|
+
// src/controllers/dv-sheet.controller.ts
|
|
2732
2699
|
let SheetDataValidationSheetController = class SheetDataValidationSheetController extends _univerjs_core.Disposable {
|
|
2733
2700
|
constructor(_sheetInterceptorService, _univerInstanceService, _sheetDataValidationModel) {
|
|
2734
2701
|
super();
|
|
@@ -2831,8 +2798,7 @@ SheetDataValidationSheetController = __decorate([
|
|
|
2831
2798
|
__decorateParam(2, (0, _univerjs_core.Inject)(SheetDataValidationModel))
|
|
2832
2799
|
], SheetDataValidationSheetController);
|
|
2833
2800
|
|
|
2834
|
-
|
|
2835
|
-
//#region src/validators/any-validator.ts
|
|
2801
|
+
// src/validators/any-validator.ts
|
|
2836
2802
|
var AnyValidator = class extends BaseSheetValidator {
|
|
2837
2803
|
constructor(..._args) {
|
|
2838
2804
|
super(..._args);
|
|
@@ -2861,8 +2827,7 @@ var AnyValidator = class extends BaseSheetValidator {
|
|
|
2861
2827
|
}
|
|
2862
2828
|
};
|
|
2863
2829
|
|
|
2864
|
-
|
|
2865
|
-
//#region src/validators/custom-validator.ts
|
|
2830
|
+
// src/validators/custom-validator.ts
|
|
2866
2831
|
var CustomFormulaValidator = class extends BaseSheetValidator {
|
|
2867
2832
|
constructor(..._args) {
|
|
2868
2833
|
super(..._args);
|
|
@@ -2912,8 +2877,7 @@ var CustomFormulaValidator = class extends BaseSheetValidator {
|
|
|
2912
2877
|
}
|
|
2913
2878
|
};
|
|
2914
2879
|
|
|
2915
|
-
|
|
2916
|
-
//#region src/validators/list-multiple-validator.ts
|
|
2880
|
+
// src/validators/list-multiple-validator.ts
|
|
2917
2881
|
/**
|
|
2918
2882
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
2919
2883
|
*
|
|
@@ -2941,8 +2905,7 @@ var ListMultipleValidator = class extends ListValidator {
|
|
|
2941
2905
|
}
|
|
2942
2906
|
};
|
|
2943
2907
|
|
|
2944
|
-
|
|
2945
|
-
//#region src/validators/whole-validator.ts
|
|
2908
|
+
// src/validators/whole-validator.ts
|
|
2946
2909
|
var WholeValidator = class extends BaseSheetValidator {
|
|
2947
2910
|
constructor(..._args) {
|
|
2948
2911
|
super(..._args);
|
|
@@ -3019,8 +2982,7 @@ var WholeValidator = class extends BaseSheetValidator {
|
|
|
3019
2982
|
}
|
|
3020
2983
|
};
|
|
3021
2984
|
|
|
3022
|
-
|
|
3023
|
-
//#region src/controllers/dv.controller.ts
|
|
2985
|
+
// src/controllers/dv.controller.ts
|
|
3024
2986
|
let DataValidationController = class DataValidationController extends _univerjs_core.RxDisposable {
|
|
3025
2987
|
constructor(_univerInstanceService, _dataValidatorRegistryService, _injector, _selectionManagerService, _sheetInterceptorService, _sheetDataValidationModel) {
|
|
3026
2988
|
super();
|
|
@@ -3088,8 +3050,7 @@ DataValidationController = __decorate([
|
|
|
3088
3050
|
__decorateParam(5, (0, _univerjs_core.Inject)(SheetDataValidationModel))
|
|
3089
3051
|
], DataValidationController);
|
|
3090
3052
|
|
|
3091
|
-
|
|
3092
|
-
//#region src/services/dv-validator.service.ts
|
|
3053
|
+
// src/services/dv-validator.service.ts
|
|
3093
3054
|
let SheetsDataValidationValidatorService = class SheetsDataValidationValidatorService extends _univerjs_core.Disposable {
|
|
3094
3055
|
constructor(_univerInstanceService, _sheetDataValidationModel, _dataValidationCacheService, _lifecycleService) {
|
|
3095
3056
|
super();
|
|
@@ -3254,8 +3215,7 @@ SheetsDataValidationValidatorService = __decorate([
|
|
|
3254
3215
|
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_core.LifecycleService))
|
|
3255
3216
|
], SheetsDataValidationValidatorService);
|
|
3256
3217
|
|
|
3257
|
-
|
|
3258
|
-
//#region src/plugin.ts
|
|
3218
|
+
// src/plugin.ts
|
|
3259
3219
|
let UniverSheetsDataValidationPlugin = class UniverSheetsDataValidationPlugin extends _univerjs_core.Plugin {
|
|
3260
3220
|
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
3261
3221
|
super();
|
|
@@ -3317,8 +3277,7 @@ UniverSheetsDataValidationPlugin = __decorate([
|
|
|
3317
3277
|
__decorateParam(3, _univerjs_core.IConfigService)
|
|
3318
3278
|
], UniverSheetsDataValidationPlugin);
|
|
3319
3279
|
|
|
3320
|
-
|
|
3321
|
-
//#region src/utils/create.ts
|
|
3280
|
+
// src/utils/create.ts
|
|
3322
3281
|
function createDefaultNewRule(accessor) {
|
|
3323
3282
|
const currentRanges = accessor.get(_univerjs_sheets.SheetsSelectionsService).getCurrentSelections().map((s) => s.range);
|
|
3324
3283
|
return {
|
|
@@ -3335,14 +3294,12 @@ function createDefaultNewRule(accessor) {
|
|
|
3335
3294
|
};
|
|
3336
3295
|
}
|
|
3337
3296
|
|
|
3338
|
-
|
|
3339
|
-
//#region src/index.ts
|
|
3297
|
+
// src/index.ts
|
|
3340
3298
|
const CUSTOM_FORMULA_INPUT_NAME = "sheets-data-validation.custom-formula-input";
|
|
3341
3299
|
const BASE_FORMULA_INPUT_NAME = "sheets-data-validation.formula-input";
|
|
3342
3300
|
const LIST_FORMULA_INPUT_NAME = "sheets-data-validation.list-formula-input";
|
|
3343
3301
|
const CHECKBOX_FORMULA_INPUT_NAME = "sheets-data-validation.checkbox-formula-input";
|
|
3344
3302
|
|
|
3345
|
-
//#endregion
|
|
3346
3303
|
exports.AddSheetDataValidationCommand = AddSheetDataValidationCommand;
|
|
3347
3304
|
exports.BASE_FORMULA_INPUT_NAME = BASE_FORMULA_INPUT_NAME;
|
|
3348
3305
|
exports.CHECKBOX_FORMULA_1 = CHECKBOX_FORMULA_1;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/locale/en-US.js
CHANGED
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|
package/lib/cjs/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
|
module.exports = locale;
|