@univerjs/sheets-data-validation 0.23.0 → 0.24.0-insiders.20260527-b1d726f

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 (120) hide show
  1. package/lib/cjs/facade.js +3 -66
  2. package/lib/cjs/index.js +206 -163
  3. package/lib/cjs/locale/ar-SA.js +139 -0
  4. package/lib/cjs/locale/ca-ES.js +139 -0
  5. package/lib/cjs/locale/de-DE.js +139 -0
  6. package/lib/cjs/locale/en-US.js +154 -0
  7. package/lib/cjs/locale/es-ES.js +139 -0
  8. package/lib/cjs/locale/fa-IR.js +139 -0
  9. package/lib/cjs/locale/fr-FR.js +139 -0
  10. package/lib/cjs/locale/id-ID.js +139 -0
  11. package/lib/cjs/locale/it-IT.js +139 -0
  12. package/lib/cjs/locale/ja-JP.js +139 -0
  13. package/lib/cjs/locale/ko-KR.js +139 -0
  14. package/lib/cjs/locale/pl-PL.js +139 -0
  15. package/lib/cjs/locale/pt-BR.js +139 -0
  16. package/lib/cjs/locale/ru-RU.js +139 -0
  17. package/lib/cjs/locale/sk-SK.js +139 -0
  18. package/lib/cjs/locale/vi-VN.js +139 -0
  19. package/lib/cjs/locale/zh-CN.js +139 -0
  20. package/lib/cjs/locale/zh-HK.js +139 -0
  21. package/lib/cjs/locale/zh-TW.js +139 -0
  22. package/lib/es/facade.js +4 -67
  23. package/lib/es/index.js +204 -159
  24. package/lib/es/locale/ar-SA.js +138 -0
  25. package/lib/es/locale/ca-ES.js +138 -0
  26. package/lib/es/locale/de-DE.js +138 -0
  27. package/lib/es/locale/en-US.js +153 -0
  28. package/lib/es/locale/es-ES.js +138 -0
  29. package/lib/es/locale/fa-IR.js +138 -0
  30. package/lib/es/locale/fr-FR.js +138 -0
  31. package/lib/es/locale/id-ID.js +138 -0
  32. package/lib/es/locale/it-IT.js +138 -0
  33. package/lib/es/locale/ja-JP.js +138 -0
  34. package/lib/es/locale/ko-KR.js +138 -0
  35. package/lib/es/locale/pl-PL.js +138 -0
  36. package/lib/es/locale/pt-BR.js +138 -0
  37. package/lib/es/locale/ru-RU.js +138 -0
  38. package/lib/es/locale/sk-SK.js +138 -0
  39. package/lib/es/locale/vi-VN.js +138 -0
  40. package/lib/es/locale/zh-CN.js +138 -0
  41. package/lib/es/locale/zh-HK.js +138 -0
  42. package/lib/es/locale/zh-TW.js +138 -0
  43. package/lib/facade.js +4 -67
  44. package/lib/index.js +204 -159
  45. package/lib/locale/ar-SA.js +138 -0
  46. package/lib/locale/ca-ES.js +138 -0
  47. package/lib/locale/de-DE.js +138 -0
  48. package/lib/locale/en-US.js +153 -0
  49. package/lib/locale/es-ES.js +138 -0
  50. package/lib/locale/fa-IR.js +138 -0
  51. package/lib/locale/fr-FR.js +138 -0
  52. package/lib/locale/id-ID.js +138 -0
  53. package/lib/locale/it-IT.js +138 -0
  54. package/lib/locale/ja-JP.js +138 -0
  55. package/lib/locale/ko-KR.js +138 -0
  56. package/lib/locale/pl-PL.js +138 -0
  57. package/lib/locale/pt-BR.js +138 -0
  58. package/lib/locale/ru-RU.js +138 -0
  59. package/lib/locale/sk-SK.js +138 -0
  60. package/lib/locale/vi-VN.js +138 -0
  61. package/lib/locale/zh-CN.js +138 -0
  62. package/lib/locale/zh-HK.js +138 -0
  63. package/lib/locale/zh-TW.js +138 -0
  64. package/lib/types/facade/f-workbook.d.ts +1 -43
  65. package/lib/types/facade/f-worksheet.d.ts +0 -5
  66. package/lib/types/index.d.ts +6 -6
  67. package/lib/types/locale/ar-SA.d.ts +18 -0
  68. package/lib/types/locale/ca-ES.d.ts +18 -0
  69. package/lib/types/locale/de-DE.d.ts +18 -0
  70. package/lib/types/locale/en-US.d.ts +156 -0
  71. package/lib/types/locale/es-ES.d.ts +18 -0
  72. package/lib/types/locale/fa-IR.d.ts +18 -0
  73. package/lib/types/locale/fr-FR.d.ts +18 -0
  74. package/lib/types/locale/id-ID.d.ts +18 -0
  75. package/lib/types/locale/it-IT.d.ts +18 -0
  76. package/lib/types/locale/ja-JP.d.ts +18 -0
  77. package/lib/types/locale/ko-KR.d.ts +18 -0
  78. package/lib/types/locale/pl-PL.d.ts +18 -0
  79. package/lib/types/locale/pt-BR.d.ts +18 -0
  80. package/lib/types/locale/ru-RU.d.ts +18 -0
  81. package/lib/types/locale/sk-SK.d.ts +18 -0
  82. package/lib/types/locale/vi-VN.d.ts +18 -0
  83. package/lib/types/locale/zh-CN.d.ts +18 -0
  84. package/lib/types/locale/zh-HK.d.ts +18 -0
  85. package/lib/types/locale/zh-TW.d.ts +18 -0
  86. package/lib/types/types/const/operator-text-map.d.ts +2 -1
  87. package/lib/types/validators/any-validator.d.ts +2 -2
  88. package/lib/types/validators/base-sheet-validator.d.ts +26 -0
  89. package/lib/types/validators/checkbox-validator.d.ts +2 -2
  90. package/lib/types/validators/custom-validator.d.ts +2 -2
  91. package/lib/types/validators/date-validator.d.ts +2 -2
  92. package/lib/types/validators/decimal-validator.d.ts +2 -2
  93. package/lib/types/validators/list-validator.d.ts +2 -2
  94. package/lib/types/validators/text-length-validator.d.ts +2 -2
  95. package/lib/types/validators/util.d.ts +0 -2
  96. package/lib/types/validators/whole-validator.d.ts +2 -2
  97. package/lib/umd/facade.js +1 -1
  98. package/lib/umd/index.js +1 -1
  99. package/lib/umd/locale/ar-SA.js +1 -0
  100. package/lib/umd/locale/ca-ES.js +1 -0
  101. package/lib/umd/locale/de-DE.js +1 -0
  102. package/lib/umd/locale/en-US.js +1 -0
  103. package/lib/umd/locale/es-ES.js +1 -0
  104. package/lib/umd/locale/fa-IR.js +1 -0
  105. package/lib/umd/locale/fr-FR.js +1 -0
  106. package/lib/umd/locale/id-ID.js +1 -0
  107. package/lib/umd/locale/it-IT.js +1 -0
  108. package/lib/umd/locale/ja-JP.js +1 -0
  109. package/lib/umd/locale/ko-KR.js +1 -0
  110. package/lib/umd/locale/pl-PL.js +1 -0
  111. package/lib/umd/locale/pt-BR.js +1 -0
  112. package/lib/umd/locale/ru-RU.js +1 -0
  113. package/lib/umd/locale/sk-SK.js +1 -0
  114. package/lib/umd/locale/vi-VN.js +1 -0
  115. package/lib/umd/locale/zh-CN.js +1 -0
  116. package/lib/umd/locale/zh-HK.js +1 -0
  117. package/lib/umd/locale/zh-TW.js +1 -0
  118. package/package.json +13 -8
  119. package/LICENSE +0 -176
  120. /package/lib/types/services/{dv-validator-service.d.ts → dv-validator.service.d.ts} +0 -0
package/lib/cjs/facade.js CHANGED
@@ -4,8 +4,8 @@ let _univerjs_sheets_data_validation = require("@univerjs/sheets-data-validation
4
4
  let _univerjs_sheets_facade = require("@univerjs/sheets/facade");
5
5
  let _univerjs_data_validation = require("@univerjs/data-validation");
6
6
  let _univerjs_engine_formula = require("@univerjs/engine-formula");
7
+ let _univerjs_sheets = require("@univerjs/sheets");
7
8
  let _univerjs_core_facade = require("@univerjs/core/facade");
8
- let rxjs = require("rxjs");
9
9
 
10
10
  //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
11
11
  function _typeof(o) {
@@ -790,7 +790,7 @@ var FDataValidationBuilder = class FDataValidationBuilder {
790
790
  */
791
791
  requireValueInList(values, multiple, showDropdown) {
792
792
  this._rule.type = multiple ? _univerjs_core.DataValidationType.LIST_MULTIPLE : _univerjs_core.DataValidationType.LIST;
793
- this._rule.formula1 = values.join(",");
793
+ this._rule.formula1 = (0, _univerjs_sheets.serializeListOptions)(values);
794
794
  this._rule.formula2 = void 0;
795
795
  this._rule.showDropDown = showDropdown !== null && showDropdown !== void 0 ? showDropdown : true;
796
796
  return this;
@@ -1589,66 +1589,6 @@ var FWorkbookSheetsDataValidationMixin = class extends _univerjs_sheets_facade.F
1589
1589
  rule
1590
1590
  };
1591
1591
  }
1592
- onDataValidationChange(callback) {
1593
- return (0, _univerjs_core.toDisposable)(this._dataValidationModel.ruleChange$.pipe((0, rxjs.filter)((change) => change.unitId === this._workbook.getUnitId())).subscribe(callback));
1594
- }
1595
- onDataValidationStatusChange(callback) {
1596
- return (0, _univerjs_core.toDisposable)(this._dataValidationModel.validStatusChange$.pipe((0, rxjs.filter)((change) => change.unitId === this._workbook.getUnitId())).subscribe(callback));
1597
- }
1598
- onBeforeAddDataValidation(callback) {
1599
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1600
- const params = commandInfo.params;
1601
- if (commandInfo.id === _univerjs_sheets_data_validation.AddSheetDataValidationCommand.id) {
1602
- if (params.unitId !== this._workbook.getUnitId()) return;
1603
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeAddDataValidation");
1604
- }
1605
- }));
1606
- }
1607
- onBeforeUpdateDataValidationCriteria(callback) {
1608
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1609
- const params = commandInfo.params;
1610
- if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationSettingCommand.id) {
1611
- if (params.unitId !== this._workbook.getUnitId()) return;
1612
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationCriteria");
1613
- }
1614
- }));
1615
- }
1616
- onBeforeUpdateDataValidationRange(callback) {
1617
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1618
- const params = commandInfo.params;
1619
- if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationRangeCommand.id) {
1620
- if (params.unitId !== this._workbook.getUnitId()) return;
1621
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationRange");
1622
- }
1623
- }));
1624
- }
1625
- onBeforeUpdateDataValidationOptions(callback) {
1626
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1627
- const params = commandInfo.params;
1628
- if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationOptionsCommand.id) {
1629
- if (params.unitId !== this._workbook.getUnitId()) return;
1630
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationOptions");
1631
- }
1632
- }));
1633
- }
1634
- onBeforeDeleteDataValidation(callback) {
1635
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1636
- const params = commandInfo.params;
1637
- if (commandInfo.id === _univerjs_sheets_data_validation.RemoveSheetDataValidationCommand.id) {
1638
- if (params.unitId !== this._workbook.getUnitId()) return;
1639
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeDeleteDataValidation");
1640
- }
1641
- }));
1642
- }
1643
- onBeforeDeleteAllDataValidation(callback) {
1644
- return (0, _univerjs_core.toDisposable)(this._commandService.beforeCommandExecuted((commandInfo, options) => {
1645
- const params = commandInfo.params;
1646
- if (commandInfo.id === _univerjs_sheets_data_validation.RemoveSheetAllDataValidationCommand.id) {
1647
- if (params.unitId !== this._workbook.getUnitId()) return;
1648
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeDeleteAllDataValidation");
1649
- }
1650
- }));
1651
- }
1652
1592
  };
1653
1593
  _univerjs_sheets_facade.FWorkbook.extend(FWorkbookSheetsDataValidationMixin);
1654
1594
 
@@ -1661,11 +1601,8 @@ var FWorksheetDataValidationMixin = class extends _univerjs_sheets_facade.FWorks
1661
1601
  getDataValidations() {
1662
1602
  return this._injector.get(_univerjs_data_validation.DataValidationModel).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((rule) => new FDataValidation(rule, this._worksheet, this._injector));
1663
1603
  }
1664
- getValidatorStatus() {
1665
- return this._injector.get(_univerjs_sheets_data_validation.SheetsDataValidationValidatorService).validatorWorksheet(this._workbook.getUnitId(), this._worksheet.getSheetId());
1666
- }
1667
1604
  getValidatorStatusAsync() {
1668
- return this.getValidatorStatus();
1605
+ return this._injector.get(_univerjs_sheets_data_validation.SheetsDataValidationValidatorService).validatorWorksheet(this._workbook.getUnitId(), this._worksheet.getSheetId());
1669
1606
  }
1670
1607
  getDataValidation(ruleId) {
1671
1608
  const rule = this._injector.get(_univerjs_data_validation.DataValidationModel).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), ruleId);