@univerjs/sheets-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 +6 -5
- package/lib/cjs/facade.js +16 -27
- package/lib/cjs/index.js +216 -221
- 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 +16 -27
- package/lib/es/index.js +216 -221
- 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 +16 -27
- package/lib/index.js +216 -221
- 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/facade/f-range.d.ts +5 -1
- package/lib/types/models/rule-matrix.d.ts +13 -0
- package/lib/types/services/dv-formula.service.d.ts +7 -3
- package/lib/types/services/dv-list-cache.service.d.ts +4 -3
- 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/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Package Overview
|
|
10
10
|
|
|
11
|
-
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
-
| --- | --- | :---: | :---: | :---: |
|
|
13
|
-
| `@univerjs/sheets-data-validation` | `UniverSheetsDataValidation` | No | Yes | Yes |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/sheets-data-validation` | `UniverSheetsDataValidation` | No | Yes | Yes | No |
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -20,10 +20,10 @@ pnpm add @univerjs/sheets-data-validation
|
|
|
20
20
|
npm install @univerjs/sheets-data-validation
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
-
|
|
25
23
|
## Usage
|
|
26
24
|
|
|
25
|
+
Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
|
|
26
|
+
|
|
27
27
|
```ts
|
|
28
28
|
import { LocaleType, mergeLocales, Univer } from '@univerjs/core';
|
|
29
29
|
import { UniverSheetsDataValidationPlugin } from '@univerjs/sheets-data-validation';
|
|
@@ -42,6 +42,7 @@ univer.registerPlugin(UniverSheetsDataValidationPlugin);
|
|
|
42
42
|
## Integration Notes
|
|
43
43
|
|
|
44
44
|
Use this package with `@univerjs/sheets-data-validation-ui` when users need validation dialogs, dropdowns, and error UI.
|
|
45
|
+
- Import `@univerjs/sheets-data-validation/facade` when using this package through Univer Facade APIs.
|
|
45
46
|
|
|
46
47
|
## Resources
|
|
47
48
|
|
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.157.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,28 +17,25 @@ function _typeof(o) {
|
|
|
17
17
|
}, _typeof(o);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function toPrimitive(t, r) {
|
|
20
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
21
|
+
function toPrimitive(t, e) {
|
|
23
22
|
if ("object" != _typeof(t) || !t) return t;
|
|
24
|
-
var
|
|
25
|
-
if (void 0 !==
|
|
26
|
-
var i =
|
|
23
|
+
var r;
|
|
24
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
25
|
+
var i = r.call(t, e || "default");
|
|
27
26
|
if ("object" != _typeof(i)) return i;
|
|
28
27
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
29
28
|
}
|
|
30
|
-
return ("string" ===
|
|
29
|
+
return ("string" === e ? 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.157.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.157.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;
|