@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.
Files changed (74) hide show
  1. package/README.md +6 -5
  2. package/lib/cjs/facade.js +16 -27
  3. package/lib/cjs/index.js +216 -221
  4. package/lib/cjs/locale/ar-SA.js +1 -2
  5. package/lib/cjs/locale/ca-ES.js +1 -2
  6. package/lib/cjs/locale/de-DE.js +1 -2
  7. package/lib/cjs/locale/en-US.js +1 -2
  8. package/lib/cjs/locale/es-ES.js +1 -2
  9. package/lib/cjs/locale/fa-IR.js +1 -2
  10. package/lib/cjs/locale/fr-FR.js +1 -2
  11. package/lib/cjs/locale/id-ID.js +1 -2
  12. package/lib/cjs/locale/it-IT.js +1 -2
  13. package/lib/cjs/locale/ja-JP.js +1 -2
  14. package/lib/cjs/locale/ko-KR.js +1 -2
  15. package/lib/cjs/locale/pl-PL.js +1 -2
  16. package/lib/cjs/locale/pt-BR.js +1 -2
  17. package/lib/cjs/locale/ru-RU.js +1 -2
  18. package/lib/cjs/locale/sk-SK.js +1 -2
  19. package/lib/cjs/locale/vi-VN.js +1 -2
  20. package/lib/cjs/locale/zh-CN.js +1 -2
  21. package/lib/cjs/locale/zh-HK.js +1 -2
  22. package/lib/cjs/locale/zh-TW.js +1 -2
  23. package/lib/es/facade.js +16 -27
  24. package/lib/es/index.js +216 -221
  25. package/lib/es/locale/ar-SA.js +1 -2
  26. package/lib/es/locale/ca-ES.js +1 -2
  27. package/lib/es/locale/de-DE.js +1 -2
  28. package/lib/es/locale/en-US.js +1 -2
  29. package/lib/es/locale/es-ES.js +1 -2
  30. package/lib/es/locale/fa-IR.js +1 -2
  31. package/lib/es/locale/fr-FR.js +1 -2
  32. package/lib/es/locale/id-ID.js +1 -2
  33. package/lib/es/locale/it-IT.js +1 -2
  34. package/lib/es/locale/ja-JP.js +1 -2
  35. package/lib/es/locale/ko-KR.js +1 -2
  36. package/lib/es/locale/pl-PL.js +1 -2
  37. package/lib/es/locale/pt-BR.js +1 -2
  38. package/lib/es/locale/ru-RU.js +1 -2
  39. package/lib/es/locale/sk-SK.js +1 -2
  40. package/lib/es/locale/vi-VN.js +1 -2
  41. package/lib/es/locale/zh-CN.js +1 -2
  42. package/lib/es/locale/zh-HK.js +1 -2
  43. package/lib/es/locale/zh-TW.js +1 -2
  44. package/lib/facade.js +16 -27
  45. package/lib/index.js +216 -221
  46. package/lib/locale/ar-SA.js +1 -2
  47. package/lib/locale/ca-ES.js +1 -2
  48. package/lib/locale/de-DE.js +1 -2
  49. package/lib/locale/en-US.js +1 -2
  50. package/lib/locale/es-ES.js +1 -2
  51. package/lib/locale/fa-IR.js +1 -2
  52. package/lib/locale/fr-FR.js +1 -2
  53. package/lib/locale/id-ID.js +1 -2
  54. package/lib/locale/it-IT.js +1 -2
  55. package/lib/locale/ja-JP.js +1 -2
  56. package/lib/locale/ko-KR.js +1 -2
  57. package/lib/locale/pl-PL.js +1 -2
  58. package/lib/locale/pt-BR.js +1 -2
  59. package/lib/locale/ru-RU.js +1 -2
  60. package/lib/locale/sk-SK.js +1 -2
  61. package/lib/locale/vi-VN.js +1 -2
  62. package/lib/locale/zh-CN.js +1 -2
  63. package/lib/locale/zh-HK.js +1 -2
  64. package/lib/locale/zh-TW.js +1 -2
  65. package/lib/types/facade/f-range.d.ts +5 -1
  66. package/lib/types/models/rule-matrix.d.ts +13 -0
  67. package/lib/types/services/dv-formula.service.d.ts +7 -3
  68. package/lib/types/services/dv-list-cache.service.d.ts +4 -3
  69. package/lib/types/validators/decimal-validator.d.ts +1 -1
  70. package/lib/types/validators/text-length-validator.d.ts +1 -1
  71. package/lib/types/validators/whole-validator.d.ts +1 -1
  72. package/lib/umd/facade.js +1 -1
  73. package/lib/umd/index.js +1 -1
  74. 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
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
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
- //#endregion
21
- //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
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 e = t[Symbol.toPrimitive];
25
- if (void 0 !== e) {
26
- var i = e.call(t, r || "default");
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" === r ? String : Number)(t);
29
+ return ("string" === e ? String : Number)(t);
31
30
  }
32
31
 
33
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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
- //#endregion
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;