@univerjs/sheets-data-validation-ui 1.6.1 → 1.7.0-alpha.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 (87) hide show
  1. package/lib/cjs/index.js +76 -103
  2. package/lib/cjs/locale/ar-SA.js +1 -2
  3. package/lib/cjs/locale/ca-ES.js +1 -2
  4. package/lib/cjs/locale/de-DE.js +1 -2
  5. package/lib/cjs/locale/en-US.js +1 -2
  6. package/lib/cjs/locale/es-ES.js +1 -2
  7. package/lib/cjs/locale/fa-IR.js +1 -2
  8. package/lib/cjs/locale/fr-FR.js +1 -2
  9. package/lib/cjs/locale/id-ID.js +1 -2
  10. package/lib/cjs/locale/it-IT.js +1 -2
  11. package/lib/cjs/locale/ja-JP.js +1 -2
  12. package/lib/cjs/locale/ko-KR.js +1 -2
  13. package/lib/cjs/locale/pl-PL.js +1 -2
  14. package/lib/cjs/locale/pt-BR.js +1 -2
  15. package/lib/cjs/locale/ru-RU.js +1 -2
  16. package/lib/cjs/locale/sk-SK.js +1 -2
  17. package/lib/cjs/locale/vi-VN.js +1 -2
  18. package/lib/cjs/locale/zh-CN.js +1 -2
  19. package/lib/cjs/locale/zh-HK.js +1 -2
  20. package/lib/cjs/locale/zh-TW.js +1 -2
  21. package/lib/es/index.js +77 -104
  22. package/lib/es/locale/ar-SA.js +1 -2
  23. package/lib/es/locale/ca-ES.js +1 -2
  24. package/lib/es/locale/de-DE.js +1 -2
  25. package/lib/es/locale/en-US.js +1 -2
  26. package/lib/es/locale/es-ES.js +1 -2
  27. package/lib/es/locale/fa-IR.js +1 -2
  28. package/lib/es/locale/fr-FR.js +1 -2
  29. package/lib/es/locale/id-ID.js +1 -2
  30. package/lib/es/locale/it-IT.js +1 -2
  31. package/lib/es/locale/ja-JP.js +1 -2
  32. package/lib/es/locale/ko-KR.js +1 -2
  33. package/lib/es/locale/pl-PL.js +1 -2
  34. package/lib/es/locale/pt-BR.js +1 -2
  35. package/lib/es/locale/ru-RU.js +1 -2
  36. package/lib/es/locale/sk-SK.js +1 -2
  37. package/lib/es/locale/vi-VN.js +1 -2
  38. package/lib/es/locale/zh-CN.js +1 -2
  39. package/lib/es/locale/zh-HK.js +1 -2
  40. package/lib/es/locale/zh-TW.js +1 -2
  41. package/lib/index.css +2 -2
  42. package/lib/index.js +77 -104
  43. package/lib/locale/ar-SA.js +1 -2
  44. package/lib/locale/ca-ES.js +1 -2
  45. package/lib/locale/de-DE.js +1 -2
  46. package/lib/locale/en-US.js +1 -2
  47. package/lib/locale/es-ES.js +1 -2
  48. package/lib/locale/fa-IR.js +1 -2
  49. package/lib/locale/fr-FR.js +1 -2
  50. package/lib/locale/id-ID.js +1 -2
  51. package/lib/locale/it-IT.js +1 -2
  52. package/lib/locale/ja-JP.js +1 -2
  53. package/lib/locale/ko-KR.js +1 -2
  54. package/lib/locale/pl-PL.js +1 -2
  55. package/lib/locale/pt-BR.js +1 -2
  56. package/lib/locale/ru-RU.js +1 -2
  57. package/lib/locale/sk-SK.js +1 -2
  58. package/lib/locale/vi-VN.js +1 -2
  59. package/lib/locale/zh-CN.js +1 -2
  60. package/lib/locale/zh-HK.js +1 -2
  61. package/lib/locale/zh-TW.js +1 -2
  62. package/lib/types/locale/en-US.d.ts +0 -5
  63. package/lib/types/mobile-plugin.d.ts +1 -1
  64. package/lib/types/plugin.d.ts +1 -1
  65. package/lib/umd/index.js +1 -1
  66. package/lib/umd/locale/ar-SA.js +1 -1
  67. package/lib/umd/locale/ca-ES.js +1 -1
  68. package/lib/umd/locale/de-DE.js +1 -1
  69. package/lib/umd/locale/en-US.js +1 -1
  70. package/lib/umd/locale/es-ES.js +1 -1
  71. package/lib/umd/locale/fa-IR.js +1 -1
  72. package/lib/umd/locale/fr-FR.js +1 -1
  73. package/lib/umd/locale/id-ID.js +1 -1
  74. package/lib/umd/locale/it-IT.js +1 -1
  75. package/lib/umd/locale/ja-JP.js +1 -1
  76. package/lib/umd/locale/ko-KR.js +1 -1
  77. package/lib/umd/locale/pl-PL.js +1 -1
  78. package/lib/umd/locale/pt-BR.js +1 -1
  79. package/lib/umd/locale/ru-RU.js +1 -1
  80. package/lib/umd/locale/sk-SK.js +1 -1
  81. package/lib/umd/locale/vi-VN.js +1 -1
  82. package/lib/umd/locale/zh-CN.js +1 -1
  83. package/lib/umd/locale/zh-HK.js +1 -1
  84. package/lib/umd/locale/zh-TW.js +1 -1
  85. package/package.json +20 -20
  86. package/lib/types/controllers/dv-permission.controller.d.ts +0 -24
  87. package/lib/types/views/components/formula-input/formula-input.d.ts +0 -19
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CanceledError, CellValueType, ColorKit, CommandType, DEFAULT_STYLES, DataValidationErrorStyle, DataValidationRenderMode, DataValidationStatus, DataValidationType, DateSystem, DependentOn, Disposable, DisposableCollection, HorizontalAlign, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, LocaleService, Optional, Plugin, Rectangle, RedoCommand, RxDisposable, ThemeService, UndoCommand, UniverInstanceType, VerticalAlign, WrapStrategy, bufferDebounceTime, dateKit, debounce, excelDateTimePartsToSerial, excelSerialToDateTimeParts, generateRandomId, getIntersectRange, isFormulaString, isUnitRangesEqual, merge, numfmt, sequenceExecute, shallowEqual, toDisposable } from "@univerjs/core";
2
2
  import { DataValidationModel, DataValidatorDropdownType, DataValidatorRegistryScope, DataValidatorRegistryService, TWO_FORMULA_OPERATOR_COUNT, UniverDataValidationPlugin, getRuleOptions, getRuleSetting } from "@univerjs/data-validation";
3
- import { AUTO_FILL_APPLY_TYPE, AutoFillTools, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetRangeValuesCommand, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, UniverSheetsPlugin, VALIDATE_CELL, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, deserializeListOptions, getSheetCommandTarget, rangeToDiscreteRange, serializeListOptions } from "@univerjs/sheets";
3
+ import { AUTO_FILL_APPLY_TYPE, AutoFillTools, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetRangeValuesCommand, SetWorksheetActiveOperation, SheetInterceptorService, SheetsSelectionsService, UniverSheetsPlugin, VALIDATE_CELL, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, deserializeListOptions, getSheetCommandTarget, rangeToDiscreteRange, serializeListOptions } from "@univerjs/sheets";
4
4
  import { ComponentManager, IDialogService, IMenuManagerService, ISidebarService, IconManager, KeyCode, MenuItemType, RibbonDataGroup, RibbonInsertGroup, UniverMobileUIPlugin, getMenuHiddenObservable, useDependency, useEvent, useObservable, useSidebarClick } from "@univerjs/ui";
5
5
  import { BehaviorSubject, Subject, auditTime, bufferTime, debounceTime, defer, distinctUntilChanged, filter, map, noop, of, startWith, switchMap, takeUntil, tap } from "rxjs";
6
6
  import { CURSOR_TYPE, CheckboxShape, DeviceInputEventType, DocSimpleSkeleton, FontCache, IRenderManagerService, Rect, Shape, Text, Transform, UniverRenderEnginePlugin, fixLineWidthByScale, getCurrentTypeOfRenderer, getFontStyleString } from "@univerjs/engine-render";
@@ -10,12 +10,12 @@ import { AutoHeightController, COPY_TYPE, CellAlertManagerService, CellAlertType
10
10
  import { ActionRow, Button, Checkbox, DraggableList, Dropdown as Dropdown$1, FormLayout, Input, Radio, RadioGroup, Select, Separator, borderClassName, clsx } from "@univerjs/design";
11
11
  import { createElement, useEffect, useMemo, useRef, useState } from "react";
12
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import { LexerTreeBuilder, deserializeRangeWithSheet, serializeRange } from "@univerjs/engine-formula";
13
14
  import { CheckboxIcon, DataValidationIcon, DatePickerIcon, DeleteIcon, DropdownListIcon, GripVerticalIcon, IncreaseIcon, MoreDownIcon, MoreUpIcon } from "@univerjs/icons";
14
15
  import { drawCanvasIcon } from "@univerjs/icons-svg";
15
- import { deserializeRangeWithSheet, serializeRange } from "@univerjs/engine-formula";
16
16
  import { FormulaEditor, RangeSelector } from "@univerjs/sheets-formula-ui";
17
17
 
18
- // \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
18
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/typeof.js
19
19
  function _typeof(o) {
20
20
  "@babel/helpers - typeof";
21
21
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -25,7 +25,7 @@ function _typeof(o) {
25
25
  }, _typeof(o);
26
26
  }
27
27
 
28
- // \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
28
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/toPrimitive.js
29
29
  function toPrimitive(t, e) {
30
30
  if ("object" != _typeof(t) || !t) return t;
31
31
  var r;
@@ -37,13 +37,13 @@ function toPrimitive(t, e) {
37
37
  return ("string" === e ? String : Number)(t);
38
38
  }
39
39
 
40
- // \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
40
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/toPropertyKey.js
41
41
  function toPropertyKey(t) {
42
42
  var i = toPrimitive(t, "string");
43
43
  return "symbol" == _typeof(i) ? i : i + "";
44
44
  }
45
45
 
46
- // \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
46
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/defineProperty.js
47
47
  function _defineProperty(e, r, t) {
48
48
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
49
49
  value: t,
@@ -53,14 +53,14 @@ function _defineProperty(e, r, t) {
53
53
  }) : e[r] = t, e;
54
54
  }
55
55
 
56
- // \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
56
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/decorateParam.js
57
57
  function __decorateParam(paramIndex, decorator) {
58
58
  return function(target, key) {
59
59
  decorator(target, key, paramIndex);
60
60
  };
61
61
  }
62
62
 
63
- // \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
63
+ // \0@oxc-project+runtime@0.160.0/helpers/esm/decorate.js
64
64
  function __decorate(decorators, target, key, desc) {
65
65
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
66
66
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1064,7 +1064,7 @@ const menuSchema = {
1064
1064
 
1065
1065
  // package.json
1066
1066
  var name = "@univerjs/sheets-data-validation-ui";
1067
- var version = "1.6.1";
1067
+ var version = "1.7.0-alpha.0";
1068
1068
 
1069
1069
  // src/controllers/dv-alert.controller.ts
1070
1070
  const ALERT_KEY = "SHEET_DATA_VALIDATION_ALERT";
@@ -1291,7 +1291,7 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
1291
1291
  _initCopyPaste() {
1292
1292
  this._sheetClipboardService.addClipboardHook({
1293
1293
  id: DATA_VALIDATION_PLUGIN_NAME,
1294
- onBeforeCopy: (unitId, subUnitId, range) => this._collect(unitId, subUnitId, range),
1294
+ onBeforeCopy: (unitId, subUnitId, range, _copyType, discreteRange) => this._collect(unitId, subUnitId, range, discreteRange),
1295
1295
  onPasteCells: (pasteFrom, pasteTo, data, payload) => {
1296
1296
  if (!pasteFrom || !this._copyInfo || specialPastes.includes(payload.pasteType)) return {
1297
1297
  redos: [],
@@ -1301,24 +1301,29 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
1301
1301
  }
1302
1302
  });
1303
1303
  }
1304
- _collect(unitId, subUnitId, range) {
1304
+ _collect(unitId, subUnitId, range, sourceRange) {
1305
+ var _getSheetCommandTarge;
1305
1306
  const rules = /* @__PURE__ */ new Map();
1306
1307
  this._copyInfo = {
1307
1308
  unitId,
1308
1309
  subUnitId,
1309
1310
  rules
1310
1311
  };
1311
- const discreteRange = this._injector.invoke((accessor) => {
1312
+ const discreteRange = sourceRange ?? this._injector.invoke((accessor) => {
1312
1313
  return rangeToDiscreteRange(range, accessor, unitId, subUnitId);
1313
1314
  });
1314
1315
  if (!discreteRange) return;
1315
- const { projectRange } = virtualizeDiscreteRanges([discreteRange]);
1316
+ const worksheet = (_getSheetCommandTarge = getSheetCommandTarget(this._univerInstanceService, {
1317
+ unitId,
1318
+ subUnitId
1319
+ })) === null || _getSheetCommandTarge === void 0 ? void 0 : _getSheetCommandTarge.worksheet;
1320
+ const { projectRange } = virtualizeDiscreteRanges([discreteRange], worksheet);
1316
1321
  this._sheetDataValidationModel.getRules(unitId, subUnitId).forEach((rule) => {
1317
1322
  const projectedRanges = rule.ranges.flatMap((ruleRange) => {
1318
1323
  const projected = projectRange(ruleRange);
1319
1324
  return projected ? [projected] : [];
1320
1325
  });
1321
- if (projectedRanges.length) rules.set(rule.uid, projectedRanges.length > 1 ? Rectangle.mergeRanges(projectedRanges) : projectedRanges);
1326
+ if (projectedRanges.length) rules.set(rule.uid, projectedRanges);
1322
1327
  });
1323
1328
  }
1324
1329
  _generateMutations(pasteFrom, pasteTo, payload) {
@@ -1330,10 +1335,11 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
1330
1335
  const { unitId: copyUnitId, subUnitId: copySubUnitId, range: copyRange } = pasteFrom;
1331
1336
  const { unitId: pastedUnitId, subUnitId: pastedSubUnitId, range: pastedRange } = pasteTo;
1332
1337
  const { copyType = COPY_TYPE.COPY } = payload;
1333
- if (!getSheetCommandTarget(this._univerInstanceService, {
1338
+ const target = getSheetCommandTarget(this._univerInstanceService, {
1334
1339
  unitId: pastedUnitId,
1335
1340
  subUnitId: pastedSubUnitId
1336
- })) return {
1341
+ });
1342
+ if (!target) return {
1337
1343
  redos: [],
1338
1344
  undos: []
1339
1345
  };
@@ -1345,62 +1351,69 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
1345
1351
  };
1346
1352
  }
1347
1353
  const sourceVirtualRange = virtualizeDiscreteRanges([copyRange]).ranges[0];
1348
- const targetVirtualization = virtualizeDiscreteRanges([pastedRange]);
1354
+ const targetVirtualization = virtualizeDiscreteRanges([pastedRange], target.worksheet);
1349
1355
  const targetVirtualRange = targetVirtualization.ranges[0];
1350
1356
  const repeatRange = getRepeatRange(sourceVirtualRange, targetVirtualRange, true);
1351
1357
  const clearTargetRanges = targetVirtualization.mapRange(targetVirtualRange);
1352
1358
  const getTargetRanges = (sourceRanges) => repeatRange.flatMap(({ startRange }) => sourceRanges.flatMap((sourceRange) => targetVirtualization.mapRange(Rectangle.moveOffset(sourceRange, startRange.startColumn, startRange.startRow))));
1353
- if (pastedUnitId !== copyUnitId || pastedSubUnitId !== copySubUnitId) {
1354
- const ruleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(pastedUnitId, pastedSubUnitId).clone();
1355
- const additionRules = /* @__PURE__ */ new Map();
1356
- const additions = [{
1357
- id: "",
1358
- ranges: clearTargetRanges
1359
- }];
1360
- copyInfo.rules.forEach((ranges, ruleId) => {
1361
- const transformedRuleId = `${copySubUnitId}-${ruleId}`;
1362
- const oldRule = this._sheetDataValidationModel.getRuleById(copyUnitId, copySubUnitId, ruleId);
1363
- if (!this._sheetDataValidationModel.getRuleById(pastedUnitId, pastedSubUnitId, transformedRuleId) && oldRule) additionRules.set(transformedRuleId, {
1364
- ...oldRule,
1365
- uid: transformedRuleId
1366
- });
1359
+ const sameSheet = pastedUnitId === copyUnitId && pastedSubUnitId === copySubUnitId;
1360
+ const ruleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(pastedUnitId, pastedSubUnitId).clone();
1361
+ const additionRules = /* @__PURE__ */ new Map();
1362
+ const additions = [{
1363
+ id: "",
1364
+ ranges: clearTargetRanges
1365
+ }];
1366
+ const lexer = this._injector.get(LexerTreeBuilder);
1367
+ const registry = this._injector.get(DataValidatorRegistryService);
1368
+ copyInfo.rules.forEach((ranges, ruleId) => {
1369
+ var _registry$getValidato;
1370
+ const source = this._sheetDataValidationModel.getRuleById(copyUnitId, copySubUnitId, ruleId);
1371
+ const targetRanges = Rectangle.sort(getTargetRanges(ranges));
1372
+ if (!source || !targetRanges.length) return;
1373
+ const list = source.type === DataValidationType.LIST || source.type === DataValidationType.LIST_MULTIPLE;
1374
+ const x = targetRanges[0].startColumn - source.ranges[0].startColumn;
1375
+ const y = targetRanges[0].startRow - source.ranges[0].startRow;
1376
+ const offset = (formula) => formula && isFormulaString(formula) ? lexer.moveFormulaRefOffset(formula, x, y) : formula;
1377
+ const translate = list || ((_registry$getValidato = registry.getValidatorItem(source.type)) === null || _registry$getValidato === void 0 ? void 0 : _registry$getValidato.offsetFormulaByRange);
1378
+ const formula1 = translate ? offset(source.formula1) : source.formula1;
1379
+ const formula2 = translate ? offset(source.formula2) : source.formula2;
1380
+ if (sameSheet && !(list && formula1 !== source.formula1)) {
1367
1381
  additions.push({
1368
- id: transformedRuleId,
1369
- ranges: getTargetRanges(ranges)
1382
+ id: ruleId,
1383
+ ranges: targetRanges
1370
1384
  });
1371
- });
1372
- ruleMatrix.addRangeRules(additions);
1373
- const { redoMutations, undoMutations } = getDataValidationDiffMutations(pastedUnitId, pastedSubUnitId, ruleMatrix.diffWithAddition(this._sheetDataValidationModel.getRules(pastedUnitId, pastedSubUnitId), additionRules.values()), this._injector, "patched", false);
1374
- if (copyType === COPY_TYPE.CUT) {
1375
- const copySheetRuleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyUnitId, copySubUnitId).clone();
1376
- copySheetRuleMatrix.addRangeRules([{
1377
- id: "",
1378
- ranges: virtualizeDiscreteRanges([copyRange]).mapRange(sourceVirtualRange)
1379
- }]);
1380
- const { redoMutations: cutRedos, undoMutations: cutUndos } = getDataValidationDiffMutations(copyUnitId, copySubUnitId, copySheetRuleMatrix.diff(this._sheetDataValidationModel.getRules(copyUnitId, copySubUnitId)), this._injector, "patched", false);
1381
- redoMutations.push(...cutRedos);
1382
- undoMutations.push(...cutUndos);
1385
+ return;
1383
1386
  }
1384
- return {
1385
- redos: redoMutations,
1386
- undos: undoMutations
1387
- };
1388
- } else {
1389
- const ruleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyUnitId, copySubUnitId).clone();
1390
- const additions = [{
1391
- id: "",
1392
- ranges: clearTargetRanges
1393
- }, ...Array.from(copyInfo.rules, ([id, ranges]) => ({
1387
+ let id = `${copySubUnitId}-${ruleId}`;
1388
+ if (this._sheetDataValidationModel.getRuleById(pastedUnitId, pastedSubUnitId, id)) id = generateRandomId();
1389
+ additionRules.set(id, {
1390
+ ...source,
1391
+ uid: id,
1392
+ ranges: targetRanges,
1393
+ formula1,
1394
+ formula2
1395
+ });
1396
+ additions.push({
1394
1397
  id,
1395
- ranges: getTargetRanges(ranges)
1396
- }))];
1397
- ruleMatrix.addRangeRules(additions);
1398
- const { redoMutations, undoMutations } = getDataValidationDiffMutations(pastedUnitId, pastedSubUnitId, ruleMatrix.diff(this._sheetDataValidationModel.getRules(copyUnitId, copySubUnitId)), this._injector, "patched", false);
1399
- return {
1400
- redos: redoMutations,
1401
- undos: undoMutations
1402
- };
1398
+ ranges: targetRanges
1399
+ });
1400
+ });
1401
+ ruleMatrix.addRangeRules(additions);
1402
+ const { redoMutations, undoMutations } = getDataValidationDiffMutations(pastedUnitId, pastedSubUnitId, ruleMatrix.diffWithAddition(this._sheetDataValidationModel.getRules(pastedUnitId, pastedSubUnitId), additionRules.values()).filter((diff) => !payload.movesCells || diff.type === "add"), this._injector, "patched", false);
1403
+ if (copyType === COPY_TYPE.CUT && !payload.movesCells) {
1404
+ const copySheetRuleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyUnitId, copySubUnitId).clone();
1405
+ copySheetRuleMatrix.addRangeRules([{
1406
+ id: "",
1407
+ ranges: virtualizeDiscreteRanges([copyRange]).mapRange(sourceVirtualRange)
1408
+ }]);
1409
+ const { redoMutations: cutRedos, undoMutations: cutUndos } = getDataValidationDiffMutations(copyUnitId, copySubUnitId, copySheetRuleMatrix.diff(this._sheetDataValidationModel.getRules(copyUnitId, copySubUnitId)), this._injector, "patched", false);
1410
+ redoMutations.push(...cutRedos);
1411
+ undoMutations.push(...cutUndos);
1403
1412
  }
1413
+ return {
1414
+ redos: redoMutations,
1415
+ undos: undoMutations
1416
+ };
1404
1417
  }
1405
1418
  };
1406
1419
  DataValidationCopyPasteController = __decorate([
@@ -1410,42 +1423,6 @@ DataValidationCopyPasteController = __decorate([
1410
1423
  __decorateParam(3, Inject(IUniverInstanceService))
1411
1424
  ], DataValidationCopyPasteController);
1412
1425
 
1413
- // src/controllers/dv-permission.controller.ts
1414
- let DataValidationPermissionController = class DataValidationPermissionController extends Disposable {
1415
- constructor(_localeService, _commandService, _sheetPermissionCheckController) {
1416
- super();
1417
- this._localeService = _localeService;
1418
- this._commandService = _commandService;
1419
- this._sheetPermissionCheckController = _sheetPermissionCheckController;
1420
- this._commandExecutedListener();
1421
- }
1422
- _commandExecutedListener() {
1423
- this.disposeWithMe(this._commandService.beforeCommandExecuted((command) => {
1424
- if (command.id === AddSheetDataValidationCommand.id) {
1425
- const { unitId, subUnitId, rule: { ranges } } = command.params;
1426
- if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
1427
- workbookTypes: [WorkbookEditablePermission],
1428
- rangeTypes: [RangeProtectionPermissionEditPoint],
1429
- worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission]
1430
- }, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-data-validation-ui.permission.dialog.setStyleErr"));
1431
- }
1432
- if (command.id === UpdateSheetDataValidationRangeCommand.id) {
1433
- const { unitId, subUnitId, ranges } = command.params;
1434
- if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
1435
- workbookTypes: [WorkbookEditablePermission],
1436
- rangeTypes: [RangeProtectionPermissionEditPoint],
1437
- worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission]
1438
- }, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-data-validation-ui.permission.dialog.setStyleErr"));
1439
- }
1440
- }));
1441
- }
1442
- };
1443
- DataValidationPermissionController = __decorate([
1444
- __decorateParam(0, Inject(LocaleService)),
1445
- __decorateParam(1, ICommandService),
1446
- __decorateParam(2, Inject(SheetPermissionCheckController))
1447
- ], DataValidationPermissionController);
1448
-
1449
1426
  // src/controllers/dv-rerender.controller.ts
1450
1427
  let SheetsDataValidationReRenderController = class SheetsDataValidationReRenderController extends Disposable {
1451
1428
  constructor(_context, _sheetDataValidationModel, _sheetSkeletonManagerService) {
@@ -2824,7 +2801,6 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
2824
2801
  [DataValidationAlertController],
2825
2802
  [DataValidationAutoFillController],
2826
2803
  [SheetsDataValidationMobileRenderController],
2827
- [DataValidationPermissionController],
2828
2804
  [DataValidationCopyPasteController],
2829
2805
  [SheetsDataValidationUIController]
2830
2806
  ].forEach((dep) => {
@@ -2841,7 +2817,6 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
2841
2817
  }
2842
2818
  onReady() {
2843
2819
  this._injector.get(DataValidationCopyPasteController);
2844
- this._injector.get(DataValidationPermissionController);
2845
2820
  this._injector.get(IRenderManagerService).registerRenderModule(UniverInstanceType.UNIVER_SHEET, [SheetsDataValidationReRenderController]);
2846
2821
  }
2847
2822
  onRendered() {
@@ -3863,7 +3838,7 @@ function ListFormulaInput(props) {
3863
3838
  }, item.id),
3864
3839
  idKey: "id"
3865
3840
  }), /* @__PURE__ */ jsxs("a", {
3866
- className: "univer-flex univer-w-fit univer-cursor-pointer univer-flex-row univer-items-center univer-rounded univer-p-1 univer-px-2 univer-text-sm univer-text-primary-600 hover:univer-bg-primary-50 dark:!univer-text-primary-500 dark:hover:!univer-bg-gray-800",
3841
+ className: "univer-flex univer-w-fit univer-cursor-pointer univer-flex-row univer-items-center univer-rounded univer-p-1 univer-px-2 univer-text-sm univer-text-primary-600 hover:univer-bg-primary-50 dark:!univer-text-primary-100 dark:hover:!univer-bg-gray-800",
3867
3842
  onClick: handleAdd,
3868
3843
  children: [/* @__PURE__ */ jsx(IncreaseIcon, { className: "univer-mr-1" }), localeService.t("sheets-data-validation-ui.list.add")]
3869
3844
  })] })
@@ -3945,7 +3920,6 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
3945
3920
  [DataValidationAlertController],
3946
3921
  [DataValidationAutoFillController],
3947
3922
  [SheetsDataValidationRenderController],
3948
- [DataValidationPermissionController],
3949
3923
  [DataValidationCopyPasteController],
3950
3924
  [DataValidationRejectInputController],
3951
3925
  [SheetsDataValidationUIController]
@@ -3967,7 +3941,6 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
3967
3941
  }
3968
3942
  onReady() {
3969
3943
  this._injector.get(DataValidationCopyPasteController);
3970
- this._injector.get(DataValidationPermissionController);
3971
3944
  this._injector.get(DataValidationRejectInputController);
3972
3945
  this._injector.get(DataValidationAlertController);
3973
3946
  this._injector.get(IRenderManagerService).registerRenderModule(UniverInstanceType.UNIVER_SHEET, [SheetsDataValidationReRenderController]);
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "نص عادي",
69
69
  label: "نمط العرض"
70
70
  },
71
- showTime: { label: "إظهار منتقي الوقت" },
72
- permission: { dialog: { setStyleErr: "النطاق محمي، وليس لديك الإذن بتعيين الأنماط. لتعيين الأنماط، يُرجى التواصل مع المنشئ." } }
71
+ showTime: { label: "إظهار منتقي الوقت" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Text pla",
69
69
  label: "Estil de visualització"
70
70
  },
71
- showTime: { label: "Mostra el selector d’hora" },
72
- permission: { dialog: { setStyleErr: "L'interval està protegit i no teniu permís per establir estils. Per establir estils, contacteu amb el creador." } }
71
+ showTime: { label: "Mostra el selector d’hora" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Reiner Text",
69
69
  label: "Anzeigestil"
70
70
  },
71
- showTime: { label: "Zeitauswahl anzeigen" },
72
- permission: { dialog: { setStyleErr: "Der Bereich ist geschützt und Sie haben keine Berechtigung, Stile festzulegen. Um Stile festzulegen, wenden Sie sich bitte an den Ersteller." } }
71
+ showTime: { label: "Zeitauswahl anzeigen" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -83,8 +83,7 @@ const locale = { "sheets-data-validation-ui": {
83
83
  text: "Plain text",
84
84
  label: "Display style"
85
85
  },
86
- showTime: { label: "Show TimePicker" },
87
- permission: { dialog: { setStyleErr: "The range is protected, and you do not have permission to set styles. To set styles, please contact the creator." } }
86
+ showTime: { label: "Show TimePicker" }
88
87
  } };
89
88
 
90
89
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Texto plano",
69
69
  label: "Estilo de visualización"
70
70
  },
71
- showTime: { label: "Mostrar selector de hora" },
72
- permission: { dialog: { setStyleErr: "El rango está protegido y no tienes permiso para establecer estilos. Para establecer estilos, contacta al creador." } }
71
+ showTime: { label: "Mostrar selector de hora" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "متن ساده",
69
69
  label: "سبک نمایش"
70
70
  },
71
- showTime: { label: "نمایش انتخاب زمان" },
72
- permission: { dialog: { setStyleErr: "محدوده محافظت شده است و شما مجوز تنظیم سبک‌ها را ندارید. برای تنظیم سبک‌ها، لطفا با سازنده تماس بگیرید." } }
71
+ showTime: { label: "نمایش انتخاب زمان" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Texte brut",
69
69
  label: "Style d'affichage"
70
70
  },
71
- showTime: { label: "Afficher le sélecteur de temps" },
72
- permission: { dialog: { setStyleErr: "La plage est protégée, et vous n'avez pas la permission de définir les styles. Pour définir les styles, veuillez contacter le créateur." } }
71
+ showTime: { label: "Afficher le sélecteur de temps" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Teks biasa",
69
69
  label: "Gaya tampilan"
70
70
  },
71
- showTime: { label: "Tampilkan TimePicker" },
72
- permission: { dialog: { setStyleErr: "Rentang ini dilindungi, dan Anda tidak memiliki izin untuk mengatur gaya. Untuk mengatur gaya, silakan hubungi pembuatnya." } }
71
+ showTime: { label: "Tampilkan TimePicker" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Testo semplice",
69
69
  label: "Stile di visualizzazione"
70
70
  },
71
- showTime: { label: "Mostra TimePicker" },
72
- permission: { dialog: { setStyleErr: "L'intervallo è protetto e non hai l'autorizzazione per impostare gli stili. Per impostare gli stili, contatta il creatore." } }
71
+ showTime: { label: "Mostra TimePicker" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "プレーンテキスト",
69
69
  label: "表示スタイル"
70
70
  },
71
- showTime: { label: "時間セレクターを表示" },
72
- permission: { dialog: { setStyleErr: "この範囲は保護されており、スタイルを変更する権限がありません。変更するには作成者に連絡してください。" } }
71
+ showTime: { label: "時間セレクターを表示" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "일반 텍스트",
69
69
  label: "표시 스타일"
70
70
  },
71
- showTime: { label: "시간 선택기 표시" },
72
- permission: { dialog: { setStyleErr: "해당 범위는 보호되어 있어 스타일 지정 권한이 없습니다. 스타일을 변경하려면 작성자에게 문의하세요." } }
71
+ showTime: { label: "시간 선택기 표시" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Zwykły tekst",
69
69
  label: "Styl wyświetlania"
70
70
  },
71
- showTime: { label: "Pokaż selektor czasu" },
72
- permission: { dialog: { setStyleErr: "Zakres jest chroniony i nie masz uprawnień do ustawiania stylów. Aby ustawić style, skontaktuj się z twórcą." } }
71
+ showTime: { label: "Pokaż selektor czasu" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Texto simples",
69
69
  label: "Estilo de exibição"
70
70
  },
71
- showTime: { label: "Mostrar seletor de hora" },
72
- permission: { dialog: { setStyleErr: "O intervalo está protegido e você não tem permissão para definir estilos. Para definir estilos, entre em contato com o criador." } }
71
+ showTime: { label: "Mostrar seletor de hora" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Обычный текст",
69
69
  label: "Стиль отображения"
70
70
  },
71
- showTime: { label: "Показать выбор времени" },
72
- permission: { dialog: { setStyleErr: "Диапазон защищен, и у вас нет разрешения на установку стилей. Для установки стилей свяжитесь с создателем." } }
71
+ showTime: { label: "Показать выбор времени" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Čistý text",
69
69
  label: "Štýl zobrazenia"
70
70
  },
71
- showTime: { label: "Zobraziť výber času" },
72
- permission: { dialog: { setStyleErr: "Rozsah je chránený a nemáte oprávnenie nastavovať štýly. Ak chcete nastavovať štýly, kontaktujte autora." } }
71
+ showTime: { label: "Zobraziť výber času" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "Văn bản thuần túy",
69
69
  label: "Hiển thị kiểu"
70
70
  },
71
- showTime: { label: "Hiển thị lựa chọn thởi gian" },
72
- permission: { dialog: { setStyleErr: "Phạm vi này đã được bảo vệ, hiện không có quyền thiết lập kiểu. Nếu cần thiết lập kiểu, vui lòng liên hệ với người tạo." } }
71
+ showTime: { label: "Hiển thị lựa chọn thởi gian" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "纯文本",
69
69
  label: "显示样式"
70
70
  },
71
- showTime: { label: "展示时间选择" },
72
- permission: { dialog: { setStyleErr: "该范围已被保护,目前无设置样式权限。如需设置样式,请联系创建者。" } }
71
+ showTime: { label: "展示时间选择" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "純文字",
69
69
  label: "顯示樣式"
70
70
  },
71
- showTime: { label: "展示時間選擇" },
72
- permission: { dialog: { setStyleErr: "該範圍已被保護,目前無設定樣式權限。如需設定樣式,請聯絡建立者。 " } }
71
+ showTime: { label: "展示時間選擇" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -68,8 +68,7 @@ const locale = { "sheets-data-validation-ui": {
68
68
  text: "純文字",
69
69
  label: "顯示樣式"
70
70
  },
71
- showTime: { label: "展示時間選擇" },
72
- permission: { dialog: { setStyleErr: "該範圍已被保護,目前無設定樣式權限。如需設定樣式,請聯絡建立者。 " } }
71
+ showTime: { label: "展示時間選擇" }
73
72
  } };
74
73
 
75
74
  export { locale as default };
@@ -94,11 +94,6 @@ declare const locale: {
94
94
  showTime: {
95
95
  label: string;
96
96
  };
97
- permission: {
98
- dialog: {
99
- setStyleErr: string;
100
- };
101
- };
102
97
  };
103
98
  };
104
99
  export default locale;
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IUniverSheetsDataValidationUIConfig } from './config/config';
17
16
  import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
17
+ import type { IUniverSheetsDataValidationUIConfig } from './config/config';
18
18
  export declare class UniverSheetsDataValidationMobileUIPlugin extends Plugin {
19
19
  private readonly _config;
20
20
  protected readonly _injector: Injector;
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IUniverSheetsDataValidationUIConfig } from './config/config';
17
16
  import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
17
+ import type { IUniverSheetsDataValidationUIConfig } from './config/config';
18
18
  export declare class UniverSheetsDataValidationUIPlugin extends Plugin {
19
19
  private readonly _config;
20
20
  protected readonly _injector: Injector;