@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.
- package/lib/cjs/facade.js +3 -66
- package/lib/cjs/index.js +206 -163
- package/lib/cjs/locale/ar-SA.js +139 -0
- package/lib/cjs/locale/ca-ES.js +139 -0
- package/lib/cjs/locale/de-DE.js +139 -0
- package/lib/cjs/locale/en-US.js +154 -0
- package/lib/cjs/locale/es-ES.js +139 -0
- package/lib/cjs/locale/fa-IR.js +139 -0
- package/lib/cjs/locale/fr-FR.js +139 -0
- package/lib/cjs/locale/id-ID.js +139 -0
- package/lib/cjs/locale/it-IT.js +139 -0
- package/lib/cjs/locale/ja-JP.js +139 -0
- package/lib/cjs/locale/ko-KR.js +139 -0
- package/lib/cjs/locale/pl-PL.js +139 -0
- package/lib/cjs/locale/pt-BR.js +139 -0
- package/lib/cjs/locale/ru-RU.js +139 -0
- package/lib/cjs/locale/sk-SK.js +139 -0
- package/lib/cjs/locale/vi-VN.js +139 -0
- package/lib/cjs/locale/zh-CN.js +139 -0
- package/lib/cjs/locale/zh-HK.js +139 -0
- package/lib/cjs/locale/zh-TW.js +139 -0
- package/lib/es/facade.js +4 -67
- package/lib/es/index.js +204 -159
- package/lib/es/locale/ar-SA.js +138 -0
- package/lib/es/locale/ca-ES.js +138 -0
- package/lib/es/locale/de-DE.js +138 -0
- package/lib/es/locale/en-US.js +153 -0
- package/lib/es/locale/es-ES.js +138 -0
- package/lib/es/locale/fa-IR.js +138 -0
- package/lib/es/locale/fr-FR.js +138 -0
- package/lib/es/locale/id-ID.js +138 -0
- package/lib/es/locale/it-IT.js +138 -0
- package/lib/es/locale/ja-JP.js +138 -0
- package/lib/es/locale/ko-KR.js +138 -0
- package/lib/es/locale/pl-PL.js +138 -0
- package/lib/es/locale/pt-BR.js +138 -0
- package/lib/es/locale/ru-RU.js +138 -0
- package/lib/es/locale/sk-SK.js +138 -0
- package/lib/es/locale/vi-VN.js +138 -0
- package/lib/es/locale/zh-CN.js +138 -0
- package/lib/es/locale/zh-HK.js +138 -0
- package/lib/es/locale/zh-TW.js +138 -0
- package/lib/facade.js +4 -67
- package/lib/index.js +204 -159
- package/lib/locale/ar-SA.js +138 -0
- package/lib/locale/ca-ES.js +138 -0
- package/lib/locale/de-DE.js +138 -0
- package/lib/locale/en-US.js +153 -0
- package/lib/locale/es-ES.js +138 -0
- package/lib/locale/fa-IR.js +138 -0
- package/lib/locale/fr-FR.js +138 -0
- package/lib/locale/id-ID.js +138 -0
- package/lib/locale/it-IT.js +138 -0
- package/lib/locale/ja-JP.js +138 -0
- package/lib/locale/ko-KR.js +138 -0
- package/lib/locale/pl-PL.js +138 -0
- package/lib/locale/pt-BR.js +138 -0
- package/lib/locale/ru-RU.js +138 -0
- package/lib/locale/sk-SK.js +138 -0
- package/lib/locale/vi-VN.js +138 -0
- package/lib/locale/zh-CN.js +138 -0
- package/lib/locale/zh-HK.js +138 -0
- package/lib/locale/zh-TW.js +138 -0
- package/lib/types/facade/f-workbook.d.ts +1 -43
- package/lib/types/facade/f-worksheet.d.ts +0 -5
- package/lib/types/index.d.ts +6 -6
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/ca-ES.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +156 -0
- package/lib/types/locale/es-ES.d.ts +18 -0
- package/lib/types/locale/fa-IR.d.ts +18 -0
- package/lib/types/locale/fr-FR.d.ts +18 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/ja-JP.d.ts +18 -0
- package/lib/types/locale/ko-KR.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/ru-RU.d.ts +18 -0
- package/lib/types/locale/sk-SK.d.ts +18 -0
- package/lib/types/locale/vi-VN.d.ts +18 -0
- package/lib/types/locale/zh-CN.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/locale/zh-TW.d.ts +18 -0
- package/lib/types/types/const/operator-text-map.d.ts +2 -1
- package/lib/types/validators/any-validator.d.ts +2 -2
- package/lib/types/validators/base-sheet-validator.d.ts +26 -0
- package/lib/types/validators/checkbox-validator.d.ts +2 -2
- package/lib/types/validators/custom-validator.d.ts +2 -2
- package/lib/types/validators/date-validator.d.ts +2 -2
- package/lib/types/validators/decimal-validator.d.ts +2 -2
- package/lib/types/validators/list-validator.d.ts +2 -2
- package/lib/types/validators/text-length-validator.d.ts +2 -2
- package/lib/types/validators/util.d.ts +0 -2
- package/lib/types/validators/whole-validator.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +13 -8
- package/LICENSE +0 -176
- /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 =
|
|
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.
|
|
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);
|