@univerjs/sheets-data-validation 0.25.0-insiders.20260623-012b5a8 → 0.25.1

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/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
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.137.0/helpers/esm/typeof.js
10
+ //#region \0@oxc-project+runtime@0.133.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) {
@@ -18,7 +18,7 @@ function _typeof(o) {
18
18
  }
19
19
 
20
20
  //#endregion
21
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
21
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
22
22
  function toPrimitive(t, r) {
23
23
  if ("object" != _typeof(t) || !t) return t;
24
24
  var e = t[Symbol.toPrimitive];
@@ -31,14 +31,14 @@ function toPrimitive(t, r) {
31
31
  }
32
32
 
33
33
  //#endregion
34
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
34
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
35
35
  function toPropertyKey(t) {
36
36
  var i = toPrimitive(t, "string");
37
37
  return "symbol" == _typeof(i) ? i : i + "";
38
38
  }
39
39
 
40
40
  //#endregion
41
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
41
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
42
42
  function _defineProperty(e, r, t) {
43
43
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
44
44
  value: t,
@@ -1416,10 +1416,7 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1416
1416
  if (!injector.has(_univerjs_sheets_data_validation.SheetDataValidationModel)) return { dispose: () => {} };
1417
1417
  return injector.get(_univerjs_sheets_data_validation.SheetDataValidationModel).ruleChange$.subscribe((ruleChange) => {
1418
1418
  const { unitId, subUnitId, rule, oldRule, type } = ruleChange;
1419
- const target = this.getSheetCommandTarget({
1420
- unitId,
1421
- subUnitId
1422
- });
1419
+ const target = this.getSheetTarget(unitId, subUnitId);
1423
1420
  if (!target) return;
1424
1421
  const { workbook, worksheet } = target;
1425
1422
  const eventParams = {
@@ -1437,10 +1434,7 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1437
1434
  if (!injector.has(_univerjs_sheets_data_validation.SheetDataValidationModel)) return { dispose: () => {} };
1438
1435
  return injector.get(_univerjs_sheets_data_validation.SheetDataValidationModel).validStatusChange$.subscribe((statusChange) => {
1439
1436
  const { unitId, subUnitId, ruleId, status, row, col } = statusChange;
1440
- const target = this.getSheetCommandTarget({
1441
- unitId,
1442
- subUnitId
1443
- });
1437
+ const target = this.getSheetTarget(unitId, subUnitId);
1444
1438
  if (!target) return;
1445
1439
  const { workbook, worksheet } = target;
1446
1440
  const rule = worksheet.getDataValidation(ruleId);
@@ -1459,14 +1453,13 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1459
1453
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationAdd, () => commandService.beforeCommandExecuted((commandInfo) => {
1460
1454
  if (commandInfo.id === _univerjs_sheets_data_validation.AddSheetDataValidationCommand.id) {
1461
1455
  const params = commandInfo.params;
1462
- const target = this.getSheetCommandTarget(params);
1456
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1463
1457
  if (!target) return;
1464
1458
  const { workbook, worksheet } = target;
1465
- const { rule } = params;
1466
1459
  const eventParams = {
1467
1460
  worksheet,
1468
1461
  workbook,
1469
- rule
1462
+ rule: params.rule
1470
1463
  };
1471
1464
  this.fireEvent(this.Event.BeforeSheetDataValidationAdd, eventParams);
1472
1465
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
@@ -1475,18 +1468,17 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1475
1468
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationCriteriaUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1476
1469
  if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationSettingCommand.id) {
1477
1470
  const params = commandInfo.params;
1478
- const target = this.getSheetCommandTarget(params);
1471
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1479
1472
  if (!target) return;
1480
1473
  const { workbook, worksheet } = target;
1481
- const { ruleId, setting: newCriteria } = params;
1482
- const rule = worksheet.getDataValidation(ruleId);
1474
+ const rule = worksheet.getDataValidation(params.ruleId);
1483
1475
  if (!rule) return;
1484
1476
  const eventParams = {
1485
1477
  worksheet,
1486
1478
  workbook,
1487
1479
  rule,
1488
- ruleId,
1489
- newCriteria
1480
+ ruleId: params.ruleId,
1481
+ newCriteria: params.setting
1490
1482
  };
1491
1483
  this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, eventParams);
1492
1484
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
@@ -1495,18 +1487,17 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1495
1487
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationRangeUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1496
1488
  if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationRangeCommand.id) {
1497
1489
  const params = commandInfo.params;
1498
- const target = this.getSheetCommandTarget(params);
1490
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1499
1491
  if (!target) return;
1500
1492
  const { workbook, worksheet } = target;
1501
- const { ruleId, ranges: newRanges } = params;
1502
- const rule = worksheet.getDataValidation(ruleId);
1493
+ const rule = worksheet.getDataValidation(params.ruleId);
1503
1494
  if (!rule) return;
1504
1495
  const eventParams = {
1505
1496
  worksheet,
1506
1497
  workbook,
1507
1498
  rule,
1508
- ruleId,
1509
- newRanges
1499
+ ruleId: params.ruleId,
1500
+ newRanges: params.ranges
1510
1501
  };
1511
1502
  this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, eventParams);
1512
1503
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
@@ -1515,18 +1506,17 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1515
1506
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationOptionsUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1516
1507
  if (commandInfo.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationOptionsCommand.id) {
1517
1508
  const params = commandInfo.params;
1518
- const target = this.getSheetCommandTarget(params);
1509
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1519
1510
  if (!target) return;
1520
1511
  const { workbook, worksheet } = target;
1521
- const { ruleId, options: newOptions } = params;
1522
- const rule = worksheet.getDataValidation(ruleId);
1512
+ const rule = worksheet.getDataValidation(params.ruleId);
1523
1513
  if (!rule) return;
1524
1514
  const eventParams = {
1525
1515
  worksheet,
1526
1516
  workbook,
1527
1517
  rule,
1528
- ruleId,
1529
- newOptions
1518
+ ruleId: params.ruleId,
1519
+ newOptions: params.options
1530
1520
  };
1531
1521
  this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, eventParams);
1532
1522
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
@@ -1535,17 +1525,16 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1535
1525
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationDelete, () => commandService.beforeCommandExecuted((commandInfo) => {
1536
1526
  if (commandInfo.id === _univerjs_sheets_data_validation.RemoveSheetDataValidationCommand.id) {
1537
1527
  const params = commandInfo.params;
1538
- const target = this.getSheetCommandTarget(params);
1528
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1539
1529
  if (!target) return;
1540
1530
  const { workbook, worksheet } = target;
1541
- const { ruleId } = params;
1542
- const rule = worksheet.getDataValidation(ruleId);
1531
+ const rule = worksheet.getDataValidation(params.ruleId);
1543
1532
  if (!rule) return;
1544
1533
  const eventParams = {
1545
1534
  worksheet,
1546
1535
  workbook,
1547
1536
  rule,
1548
- ruleId
1537
+ ruleId: params.ruleId
1549
1538
  };
1550
1539
  this.fireEvent(this.Event.BeforeSheetDataValidationDelete, eventParams);
1551
1540
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
@@ -1554,7 +1543,7 @@ var FUniverSheetsDataValidationMixin = class extends _univerjs_core_facade.FUniv
1554
1543
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationDeleteAll, () => commandService.beforeCommandExecuted((commandInfo) => {
1555
1544
  if (commandInfo.id === _univerjs_sheets_data_validation.RemoveSheetAllDataValidationCommand.id) {
1556
1545
  const params = commandInfo.params;
1557
- const target = this.getSheetCommandTarget(params);
1546
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1558
1547
  if (!target) return;
1559
1548
  const { workbook, worksheet } = target;
1560
1549
  const eventParams = {
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
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
10
+ //#region \0@oxc-project+runtime@0.133.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) {
@@ -18,7 +18,7 @@ function _typeof(o) {
18
18
  }
19
19
 
20
20
  //#endregion
21
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
21
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
22
22
  function toPrimitive(t, r) {
23
23
  if ("object" != _typeof(t) || !t) return t;
24
24
  var e = t[Symbol.toPrimitive];
@@ -31,14 +31,14 @@ function toPrimitive(t, r) {
31
31
  }
32
32
 
33
33
  //#endregion
34
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
34
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
35
35
  function toPropertyKey(t) {
36
36
  var i = toPrimitive(t, "string");
37
37
  return "symbol" == _typeof(i) ? i : i + "";
38
38
  }
39
39
 
40
40
  //#endregion
41
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
41
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
42
42
  function _defineProperty(e, r, t) {
43
43
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
44
44
  value: t,
@@ -49,7 +49,7 @@ function _defineProperty(e, r, t) {
49
49
  }
50
50
 
51
51
  //#endregion
52
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
52
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
53
53
  function __decorateParam(paramIndex, decorator) {
54
54
  return function(target, key) {
55
55
  decorator(target, key, paramIndex);
@@ -57,7 +57,7 @@ function __decorateParam(paramIndex, decorator) {
57
57
  }
58
58
 
59
59
  //#endregion
60
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
60
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
61
61
  function __decorate(decorators, target, key, desc) {
62
62
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
63
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2309,7 +2309,7 @@ DataValidationFormulaController = __decorate([
2309
2309
  //#endregion
2310
2310
  //#region package.json
2311
2311
  var name = "@univerjs/sheets-data-validation";
2312
- var version = "0.25.0-insiders.20260623-012b5a8";
2312
+ var version = "0.25.1";
2313
2313
 
2314
2314
  //#endregion
2315
2315
  //#region src/config/config.ts
package/lib/es/facade.js CHANGED
@@ -6,7 +6,7 @@ import { serializeRangeToRefString } from "@univerjs/engine-formula";
6
6
  import { serializeListOptions } from "@univerjs/sheets";
7
7
  import { FEventName, FUniver } from "@univerjs/core/facade";
8
8
 
9
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
9
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
10
10
  function _typeof(o) {
11
11
  "@babel/helpers - typeof";
12
12
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -17,7 +17,7 @@ function _typeof(o) {
17
17
  }
18
18
 
19
19
  //#endregion
20
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
20
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
21
21
  function toPrimitive(t, r) {
22
22
  if ("object" != _typeof(t) || !t) return t;
23
23
  var e = t[Symbol.toPrimitive];
@@ -30,14 +30,14 @@ function toPrimitive(t, r) {
30
30
  }
31
31
 
32
32
  //#endregion
33
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
33
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
34
34
  function toPropertyKey(t) {
35
35
  var i = toPrimitive(t, "string");
36
36
  return "symbol" == _typeof(i) ? i : i + "";
37
37
  }
38
38
 
39
39
  //#endregion
40
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
40
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
41
41
  function _defineProperty(e, r, t) {
42
42
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
43
43
  value: t,
@@ -1415,10 +1415,7 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1415
1415
  if (!injector.has(SheetDataValidationModel)) return { dispose: () => {} };
1416
1416
  return injector.get(SheetDataValidationModel).ruleChange$.subscribe((ruleChange) => {
1417
1417
  const { unitId, subUnitId, rule, oldRule, type } = ruleChange;
1418
- const target = this.getSheetCommandTarget({
1419
- unitId,
1420
- subUnitId
1421
- });
1418
+ const target = this.getSheetTarget(unitId, subUnitId);
1422
1419
  if (!target) return;
1423
1420
  const { workbook, worksheet } = target;
1424
1421
  const eventParams = {
@@ -1436,10 +1433,7 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1436
1433
  if (!injector.has(SheetDataValidationModel)) return { dispose: () => {} };
1437
1434
  return injector.get(SheetDataValidationModel).validStatusChange$.subscribe((statusChange) => {
1438
1435
  const { unitId, subUnitId, ruleId, status, row, col } = statusChange;
1439
- const target = this.getSheetCommandTarget({
1440
- unitId,
1441
- subUnitId
1442
- });
1436
+ const target = this.getSheetTarget(unitId, subUnitId);
1443
1437
  if (!target) return;
1444
1438
  const { workbook, worksheet } = target;
1445
1439
  const rule = worksheet.getDataValidation(ruleId);
@@ -1458,14 +1452,13 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1458
1452
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationAdd, () => commandService.beforeCommandExecuted((commandInfo) => {
1459
1453
  if (commandInfo.id === AddSheetDataValidationCommand.id) {
1460
1454
  const params = commandInfo.params;
1461
- const target = this.getSheetCommandTarget(params);
1455
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1462
1456
  if (!target) return;
1463
1457
  const { workbook, worksheet } = target;
1464
- const { rule } = params;
1465
1458
  const eventParams = {
1466
1459
  worksheet,
1467
1460
  workbook,
1468
- rule
1461
+ rule: params.rule
1469
1462
  };
1470
1463
  this.fireEvent(this.Event.BeforeSheetDataValidationAdd, eventParams);
1471
1464
  if (eventParams.cancel) throw new CanceledError();
@@ -1474,18 +1467,17 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1474
1467
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationCriteriaUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1475
1468
  if (commandInfo.id === UpdateSheetDataValidationSettingCommand.id) {
1476
1469
  const params = commandInfo.params;
1477
- const target = this.getSheetCommandTarget(params);
1470
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1478
1471
  if (!target) return;
1479
1472
  const { workbook, worksheet } = target;
1480
- const { ruleId, setting: newCriteria } = params;
1481
- const rule = worksheet.getDataValidation(ruleId);
1473
+ const rule = worksheet.getDataValidation(params.ruleId);
1482
1474
  if (!rule) return;
1483
1475
  const eventParams = {
1484
1476
  worksheet,
1485
1477
  workbook,
1486
1478
  rule,
1487
- ruleId,
1488
- newCriteria
1479
+ ruleId: params.ruleId,
1480
+ newCriteria: params.setting
1489
1481
  };
1490
1482
  this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, eventParams);
1491
1483
  if (eventParams.cancel) throw new CanceledError();
@@ -1494,18 +1486,17 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1494
1486
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationRangeUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1495
1487
  if (commandInfo.id === UpdateSheetDataValidationRangeCommand.id) {
1496
1488
  const params = commandInfo.params;
1497
- const target = this.getSheetCommandTarget(params);
1489
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1498
1490
  if (!target) return;
1499
1491
  const { workbook, worksheet } = target;
1500
- const { ruleId, ranges: newRanges } = params;
1501
- const rule = worksheet.getDataValidation(ruleId);
1492
+ const rule = worksheet.getDataValidation(params.ruleId);
1502
1493
  if (!rule) return;
1503
1494
  const eventParams = {
1504
1495
  worksheet,
1505
1496
  workbook,
1506
1497
  rule,
1507
- ruleId,
1508
- newRanges
1498
+ ruleId: params.ruleId,
1499
+ newRanges: params.ranges
1509
1500
  };
1510
1501
  this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, eventParams);
1511
1502
  if (eventParams.cancel) throw new CanceledError();
@@ -1514,18 +1505,17 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1514
1505
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationOptionsUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
1515
1506
  if (commandInfo.id === UpdateSheetDataValidationOptionsCommand.id) {
1516
1507
  const params = commandInfo.params;
1517
- const target = this.getSheetCommandTarget(params);
1508
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1518
1509
  if (!target) return;
1519
1510
  const { workbook, worksheet } = target;
1520
- const { ruleId, options: newOptions } = params;
1521
- const rule = worksheet.getDataValidation(ruleId);
1511
+ const rule = worksheet.getDataValidation(params.ruleId);
1522
1512
  if (!rule) return;
1523
1513
  const eventParams = {
1524
1514
  worksheet,
1525
1515
  workbook,
1526
1516
  rule,
1527
- ruleId,
1528
- newOptions
1517
+ ruleId: params.ruleId,
1518
+ newOptions: params.options
1529
1519
  };
1530
1520
  this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, eventParams);
1531
1521
  if (eventParams.cancel) throw new CanceledError();
@@ -1534,17 +1524,16 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1534
1524
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationDelete, () => commandService.beforeCommandExecuted((commandInfo) => {
1535
1525
  if (commandInfo.id === RemoveSheetDataValidationCommand.id) {
1536
1526
  const params = commandInfo.params;
1537
- const target = this.getSheetCommandTarget(params);
1527
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1538
1528
  if (!target) return;
1539
1529
  const { workbook, worksheet } = target;
1540
- const { ruleId } = params;
1541
- const rule = worksheet.getDataValidation(ruleId);
1530
+ const rule = worksheet.getDataValidation(params.ruleId);
1542
1531
  if (!rule) return;
1543
1532
  const eventParams = {
1544
1533
  worksheet,
1545
1534
  workbook,
1546
1535
  rule,
1547
- ruleId
1536
+ ruleId: params.ruleId
1548
1537
  };
1549
1538
  this.fireEvent(this.Event.BeforeSheetDataValidationDelete, eventParams);
1550
1539
  if (eventParams.cancel) throw new CanceledError();
@@ -1553,7 +1542,7 @@ var FUniverSheetsDataValidationMixin = class extends FUniver {
1553
1542
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetDataValidationDeleteAll, () => commandService.beforeCommandExecuted((commandInfo) => {
1554
1543
  if (commandInfo.id === RemoveSheetAllDataValidationCommand.id) {
1555
1544
  const params = commandInfo.params;
1556
- const target = this.getSheetCommandTarget(params);
1545
+ const target = this.getSheetTarget(params.unitId, params.subUnitId);
1557
1546
  if (!target) return;
1558
1547
  const { workbook, worksheet } = target;
1559
1548
  const eventParams = {
package/lib/es/index.js CHANGED
@@ -6,7 +6,7 @@ import { Subject, bufferWhen, filter, skip } from "rxjs";
6
6
  import { UnitAction } from "@univerjs/protocol";
7
7
  import { FormulaRefRangeService, UniverSheetsFormulaPlugin } from "@univerjs/sheets-formula";
8
8
 
9
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
9
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
10
10
  function _typeof(o) {
11
11
  "@babel/helpers - typeof";
12
12
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -17,7 +17,7 @@ function _typeof(o) {
17
17
  }
18
18
 
19
19
  //#endregion
20
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
20
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
21
21
  function toPrimitive(t, r) {
22
22
  if ("object" != _typeof(t) || !t) return t;
23
23
  var e = t[Symbol.toPrimitive];
@@ -30,14 +30,14 @@ function toPrimitive(t, r) {
30
30
  }
31
31
 
32
32
  //#endregion
33
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
33
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
34
34
  function toPropertyKey(t) {
35
35
  var i = toPrimitive(t, "string");
36
36
  return "symbol" == _typeof(i) ? i : i + "";
37
37
  }
38
38
 
39
39
  //#endregion
40
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
40
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
41
41
  function _defineProperty(e, r, t) {
42
42
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
43
43
  value: t,
@@ -48,7 +48,7 @@ function _defineProperty(e, r, t) {
48
48
  }
49
49
 
50
50
  //#endregion
51
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
51
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
52
52
  function __decorateParam(paramIndex, decorator) {
53
53
  return function(target, key) {
54
54
  decorator(target, key, paramIndex);
@@ -56,7 +56,7 @@ function __decorateParam(paramIndex, decorator) {
56
56
  }
57
57
 
58
58
  //#endregion
59
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
59
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
60
60
  function __decorate(decorators, target, key, desc) {
61
61
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
62
62
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2308,7 +2308,7 @@ DataValidationFormulaController = __decorate([
2308
2308
  //#endregion
2309
2309
  //#region package.json
2310
2310
  var name = "@univerjs/sheets-data-validation";
2311
- var version = "0.25.0-insiders.20260623-012b5a8";
2311
+ var version = "0.25.1";
2312
2312
 
2313
2313
  //#endregion
2314
2314
  //#region src/config/config.ts