@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.
- package/lib/cjs/index.js +76 -103
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/index.js +77 -104
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/index.css +2 -2
- package/lib/index.js +77 -104
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/locale/en-US.d.ts +0 -5
- package/lib/types/mobile-plugin.d.ts +1 -1
- package/lib/types/plugin.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +20 -20
- package/lib/types/controllers/dv-permission.controller.d.ts +0 -24
- package/lib/types/views/components/formula-input/formula-input.d.ts +0 -19
package/lib/cjs/index.js
CHANGED
|
@@ -11,12 +11,12 @@ let _univerjs_sheets_ui = require("@univerjs/sheets-ui");
|
|
|
11
11
|
let _univerjs_design = require("@univerjs/design");
|
|
12
12
|
let react = require("react");
|
|
13
13
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
let _univerjs_engine_formula = require("@univerjs/engine-formula");
|
|
14
15
|
let _univerjs_icons = require("@univerjs/icons");
|
|
15
16
|
let _univerjs_icons_svg = require("@univerjs/icons-svg");
|
|
16
|
-
let _univerjs_engine_formula = require("@univerjs/engine-formula");
|
|
17
17
|
let _univerjs_sheets_formula_ui = require("@univerjs/sheets-formula-ui");
|
|
18
18
|
|
|
19
|
-
// \0@oxc-project+runtime@0.
|
|
19
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/typeof.js
|
|
20
20
|
function _typeof(o) {
|
|
21
21
|
"@babel/helpers - typeof";
|
|
22
22
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -26,7 +26,7 @@ function _typeof(o) {
|
|
|
26
26
|
}, _typeof(o);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// \0@oxc-project+runtime@0.
|
|
29
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/toPrimitive.js
|
|
30
30
|
function toPrimitive(t, e) {
|
|
31
31
|
if ("object" != _typeof(t) || !t) return t;
|
|
32
32
|
var r;
|
|
@@ -38,13 +38,13 @@ function toPrimitive(t, e) {
|
|
|
38
38
|
return ("string" === e ? String : Number)(t);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// \0@oxc-project+runtime@0.
|
|
41
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/toPropertyKey.js
|
|
42
42
|
function toPropertyKey(t) {
|
|
43
43
|
var i = toPrimitive(t, "string");
|
|
44
44
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// \0@oxc-project+runtime@0.
|
|
47
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/defineProperty.js
|
|
48
48
|
function _defineProperty(e, r, t) {
|
|
49
49
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
50
50
|
value: t,
|
|
@@ -54,14 +54,14 @@ function _defineProperty(e, r, t) {
|
|
|
54
54
|
}) : e[r] = t, e;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
// \0@oxc-project+runtime@0.
|
|
57
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/decorateParam.js
|
|
58
58
|
function __decorateParam(paramIndex, decorator) {
|
|
59
59
|
return function(target, key) {
|
|
60
60
|
decorator(target, key, paramIndex);
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// \0@oxc-project+runtime@0.
|
|
64
|
+
// \0@oxc-project+runtime@0.160.0/helpers/esm/decorate.js
|
|
65
65
|
function __decorate(decorators, target, key, desc) {
|
|
66
66
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
67
67
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1065,7 +1065,7 @@ const menuSchema = {
|
|
|
1065
1065
|
|
|
1066
1066
|
// package.json
|
|
1067
1067
|
var name = "@univerjs/sheets-data-validation-ui";
|
|
1068
|
-
var version = "1.
|
|
1068
|
+
var version = "1.7.0-alpha.0";
|
|
1069
1069
|
|
|
1070
1070
|
// src/controllers/dv-alert.controller.ts
|
|
1071
1071
|
const ALERT_KEY = "SHEET_DATA_VALIDATION_ALERT";
|
|
@@ -1292,7 +1292,7 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
|
|
|
1292
1292
|
_initCopyPaste() {
|
|
1293
1293
|
this._sheetClipboardService.addClipboardHook({
|
|
1294
1294
|
id: _univerjs_sheets_data_validation.DATA_VALIDATION_PLUGIN_NAME,
|
|
1295
|
-
onBeforeCopy: (unitId, subUnitId, range) => this._collect(unitId, subUnitId, range),
|
|
1295
|
+
onBeforeCopy: (unitId, subUnitId, range, _copyType, discreteRange) => this._collect(unitId, subUnitId, range, discreteRange),
|
|
1296
1296
|
onPasteCells: (pasteFrom, pasteTo, data, payload) => {
|
|
1297
1297
|
if (!pasteFrom || !this._copyInfo || specialPastes.includes(payload.pasteType)) return {
|
|
1298
1298
|
redos: [],
|
|
@@ -1302,24 +1302,29 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
|
|
|
1302
1302
|
}
|
|
1303
1303
|
});
|
|
1304
1304
|
}
|
|
1305
|
-
_collect(unitId, subUnitId, range) {
|
|
1305
|
+
_collect(unitId, subUnitId, range, sourceRange) {
|
|
1306
|
+
var _getSheetCommandTarge;
|
|
1306
1307
|
const rules = /* @__PURE__ */ new Map();
|
|
1307
1308
|
this._copyInfo = {
|
|
1308
1309
|
unitId,
|
|
1309
1310
|
subUnitId,
|
|
1310
1311
|
rules
|
|
1311
1312
|
};
|
|
1312
|
-
const discreteRange = this._injector.invoke((accessor) => {
|
|
1313
|
+
const discreteRange = sourceRange ?? this._injector.invoke((accessor) => {
|
|
1313
1314
|
return (0, _univerjs_sheets.rangeToDiscreteRange)(range, accessor, unitId, subUnitId);
|
|
1314
1315
|
});
|
|
1315
1316
|
if (!discreteRange) return;
|
|
1316
|
-
const
|
|
1317
|
+
const worksheet = (_getSheetCommandTarge = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, {
|
|
1318
|
+
unitId,
|
|
1319
|
+
subUnitId
|
|
1320
|
+
})) === null || _getSheetCommandTarge === void 0 ? void 0 : _getSheetCommandTarge.worksheet;
|
|
1321
|
+
const { projectRange } = (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([discreteRange], worksheet);
|
|
1317
1322
|
this._sheetDataValidationModel.getRules(unitId, subUnitId).forEach((rule) => {
|
|
1318
1323
|
const projectedRanges = rule.ranges.flatMap((ruleRange) => {
|
|
1319
1324
|
const projected = projectRange(ruleRange);
|
|
1320
1325
|
return projected ? [projected] : [];
|
|
1321
1326
|
});
|
|
1322
|
-
if (projectedRanges.length) rules.set(rule.uid, projectedRanges
|
|
1327
|
+
if (projectedRanges.length) rules.set(rule.uid, projectedRanges);
|
|
1323
1328
|
});
|
|
1324
1329
|
}
|
|
1325
1330
|
_generateMutations(pasteFrom, pasteTo, payload) {
|
|
@@ -1331,10 +1336,11 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
|
|
|
1331
1336
|
const { unitId: copyUnitId, subUnitId: copySubUnitId, range: copyRange } = pasteFrom;
|
|
1332
1337
|
const { unitId: pastedUnitId, subUnitId: pastedSubUnitId, range: pastedRange } = pasteTo;
|
|
1333
1338
|
const { copyType = _univerjs_sheets_ui.COPY_TYPE.COPY } = payload;
|
|
1334
|
-
|
|
1339
|
+
const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, {
|
|
1335
1340
|
unitId: pastedUnitId,
|
|
1336
1341
|
subUnitId: pastedSubUnitId
|
|
1337
|
-
})
|
|
1342
|
+
});
|
|
1343
|
+
if (!target) return {
|
|
1338
1344
|
redos: [],
|
|
1339
1345
|
undos: []
|
|
1340
1346
|
};
|
|
@@ -1346,62 +1352,69 @@ let DataValidationCopyPasteController = class DataValidationCopyPasteController
|
|
|
1346
1352
|
};
|
|
1347
1353
|
}
|
|
1348
1354
|
const sourceVirtualRange = (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([copyRange]).ranges[0];
|
|
1349
|
-
const targetVirtualization = (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([pastedRange]);
|
|
1355
|
+
const targetVirtualization = (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([pastedRange], target.worksheet);
|
|
1350
1356
|
const targetVirtualRange = targetVirtualization.ranges[0];
|
|
1351
1357
|
const repeatRange = (0, _univerjs_sheets_ui.getRepeatRange)(sourceVirtualRange, targetVirtualRange, true);
|
|
1352
1358
|
const clearTargetRanges = targetVirtualization.mapRange(targetVirtualRange);
|
|
1353
1359
|
const getTargetRanges = (sourceRanges) => repeatRange.flatMap(({ startRange }) => sourceRanges.flatMap((sourceRange) => targetVirtualization.mapRange(_univerjs_core.Rectangle.moveOffset(sourceRange, startRange.startColumn, startRange.startRow))));
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1360
|
+
const sameSheet = pastedUnitId === copyUnitId && pastedSubUnitId === copySubUnitId;
|
|
1361
|
+
const ruleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(pastedUnitId, pastedSubUnitId).clone();
|
|
1362
|
+
const additionRules = /* @__PURE__ */ new Map();
|
|
1363
|
+
const additions = [{
|
|
1364
|
+
id: "",
|
|
1365
|
+
ranges: clearTargetRanges
|
|
1366
|
+
}];
|
|
1367
|
+
const lexer = this._injector.get(_univerjs_engine_formula.LexerTreeBuilder);
|
|
1368
|
+
const registry = this._injector.get(_univerjs_data_validation.DataValidatorRegistryService);
|
|
1369
|
+
copyInfo.rules.forEach((ranges, ruleId) => {
|
|
1370
|
+
var _registry$getValidato;
|
|
1371
|
+
const source = this._sheetDataValidationModel.getRuleById(copyUnitId, copySubUnitId, ruleId);
|
|
1372
|
+
const targetRanges = _univerjs_core.Rectangle.sort(getTargetRanges(ranges));
|
|
1373
|
+
if (!source || !targetRanges.length) return;
|
|
1374
|
+
const list = source.type === _univerjs_core.DataValidationType.LIST || source.type === _univerjs_core.DataValidationType.LIST_MULTIPLE;
|
|
1375
|
+
const x = targetRanges[0].startColumn - source.ranges[0].startColumn;
|
|
1376
|
+
const y = targetRanges[0].startRow - source.ranges[0].startRow;
|
|
1377
|
+
const offset = (formula) => formula && (0, _univerjs_core.isFormulaString)(formula) ? lexer.moveFormulaRefOffset(formula, x, y) : formula;
|
|
1378
|
+
const translate = list || ((_registry$getValidato = registry.getValidatorItem(source.type)) === null || _registry$getValidato === void 0 ? void 0 : _registry$getValidato.offsetFormulaByRange);
|
|
1379
|
+
const formula1 = translate ? offset(source.formula1) : source.formula1;
|
|
1380
|
+
const formula2 = translate ? offset(source.formula2) : source.formula2;
|
|
1381
|
+
if (sameSheet && !(list && formula1 !== source.formula1)) {
|
|
1368
1382
|
additions.push({
|
|
1369
|
-
id:
|
|
1370
|
-
ranges:
|
|
1383
|
+
id: ruleId,
|
|
1384
|
+
ranges: targetRanges
|
|
1371
1385
|
});
|
|
1372
|
-
|
|
1373
|
-
ruleMatrix.addRangeRules(additions);
|
|
1374
|
-
const { redoMutations, undoMutations } = (0, _univerjs_sheets_data_validation.getDataValidationDiffMutations)(pastedUnitId, pastedSubUnitId, ruleMatrix.diffWithAddition(this._sheetDataValidationModel.getRules(pastedUnitId, pastedSubUnitId), additionRules.values()), this._injector, "patched", false);
|
|
1375
|
-
if (copyType === _univerjs_sheets_ui.COPY_TYPE.CUT) {
|
|
1376
|
-
const copySheetRuleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyUnitId, copySubUnitId).clone();
|
|
1377
|
-
copySheetRuleMatrix.addRangeRules([{
|
|
1378
|
-
id: "",
|
|
1379
|
-
ranges: (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([copyRange]).mapRange(sourceVirtualRange)
|
|
1380
|
-
}]);
|
|
1381
|
-
const { redoMutations: cutRedos, undoMutations: cutUndos } = (0, _univerjs_sheets_data_validation.getDataValidationDiffMutations)(copyUnitId, copySubUnitId, copySheetRuleMatrix.diff(this._sheetDataValidationModel.getRules(copyUnitId, copySubUnitId)), this._injector, "patched", false);
|
|
1382
|
-
redoMutations.push(...cutRedos);
|
|
1383
|
-
undoMutations.push(...cutUndos);
|
|
1386
|
+
return;
|
|
1384
1387
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1388
|
+
let id = `${copySubUnitId}-${ruleId}`;
|
|
1389
|
+
if (this._sheetDataValidationModel.getRuleById(pastedUnitId, pastedSubUnitId, id)) id = (0, _univerjs_core.generateRandomId)();
|
|
1390
|
+
additionRules.set(id, {
|
|
1391
|
+
...source,
|
|
1392
|
+
uid: id,
|
|
1393
|
+
ranges: targetRanges,
|
|
1394
|
+
formula1,
|
|
1395
|
+
formula2
|
|
1396
|
+
});
|
|
1397
|
+
additions.push({
|
|
1395
1398
|
id,
|
|
1396
|
-
ranges:
|
|
1397
|
-
})
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1399
|
+
ranges: targetRanges
|
|
1400
|
+
});
|
|
1401
|
+
});
|
|
1402
|
+
ruleMatrix.addRangeRules(additions);
|
|
1403
|
+
const { redoMutations, undoMutations } = (0, _univerjs_sheets_data_validation.getDataValidationDiffMutations)(pastedUnitId, pastedSubUnitId, ruleMatrix.diffWithAddition(this._sheetDataValidationModel.getRules(pastedUnitId, pastedSubUnitId), additionRules.values()).filter((diff) => !payload.movesCells || diff.type === "add"), this._injector, "patched", false);
|
|
1404
|
+
if (copyType === _univerjs_sheets_ui.COPY_TYPE.CUT && !payload.movesCells) {
|
|
1405
|
+
const copySheetRuleMatrix = this._sheetDataValidationModel.getRuleObjectMatrix(copyUnitId, copySubUnitId).clone();
|
|
1406
|
+
copySheetRuleMatrix.addRangeRules([{
|
|
1407
|
+
id: "",
|
|
1408
|
+
ranges: (0, _univerjs_sheets_ui.virtualizeDiscreteRanges)([copyRange]).mapRange(sourceVirtualRange)
|
|
1409
|
+
}]);
|
|
1410
|
+
const { redoMutations: cutRedos, undoMutations: cutUndos } = (0, _univerjs_sheets_data_validation.getDataValidationDiffMutations)(copyUnitId, copySubUnitId, copySheetRuleMatrix.diff(this._sheetDataValidationModel.getRules(copyUnitId, copySubUnitId)), this._injector, "patched", false);
|
|
1411
|
+
redoMutations.push(...cutRedos);
|
|
1412
|
+
undoMutations.push(...cutUndos);
|
|
1404
1413
|
}
|
|
1414
|
+
return {
|
|
1415
|
+
redos: redoMutations,
|
|
1416
|
+
undos: undoMutations
|
|
1417
|
+
};
|
|
1405
1418
|
}
|
|
1406
1419
|
};
|
|
1407
1420
|
DataValidationCopyPasteController = __decorate([
|
|
@@ -1411,42 +1424,6 @@ DataValidationCopyPasteController = __decorate([
|
|
|
1411
1424
|
__decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_core.IUniverInstanceService))
|
|
1412
1425
|
], DataValidationCopyPasteController);
|
|
1413
1426
|
|
|
1414
|
-
// src/controllers/dv-permission.controller.ts
|
|
1415
|
-
let DataValidationPermissionController = class DataValidationPermissionController extends _univerjs_core.Disposable {
|
|
1416
|
-
constructor(_localeService, _commandService, _sheetPermissionCheckController) {
|
|
1417
|
-
super();
|
|
1418
|
-
this._localeService = _localeService;
|
|
1419
|
-
this._commandService = _commandService;
|
|
1420
|
-
this._sheetPermissionCheckController = _sheetPermissionCheckController;
|
|
1421
|
-
this._commandExecutedListener();
|
|
1422
|
-
}
|
|
1423
|
-
_commandExecutedListener() {
|
|
1424
|
-
this.disposeWithMe(this._commandService.beforeCommandExecuted((command) => {
|
|
1425
|
-
if (command.id === _univerjs_sheets_data_validation.AddSheetDataValidationCommand.id) {
|
|
1426
|
-
const { unitId, subUnitId, rule: { ranges } } = command.params;
|
|
1427
|
-
if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1428
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
1429
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
|
|
1430
|
-
worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission]
|
|
1431
|
-
}, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-data-validation-ui.permission.dialog.setStyleErr"));
|
|
1432
|
-
}
|
|
1433
|
-
if (command.id === _univerjs_sheets_data_validation.UpdateSheetDataValidationRangeCommand.id) {
|
|
1434
|
-
const { unitId, subUnitId, ranges } = command.params;
|
|
1435
|
-
if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1436
|
-
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
1437
|
-
rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
|
|
1438
|
-
worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission]
|
|
1439
|
-
}, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-data-validation-ui.permission.dialog.setStyleErr"));
|
|
1440
|
-
}
|
|
1441
|
-
}));
|
|
1442
|
-
}
|
|
1443
|
-
};
|
|
1444
|
-
DataValidationPermissionController = __decorate([
|
|
1445
|
-
__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
|
|
1446
|
-
__decorateParam(1, _univerjs_core.ICommandService),
|
|
1447
|
-
__decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetPermissionCheckController))
|
|
1448
|
-
], DataValidationPermissionController);
|
|
1449
|
-
|
|
1450
1427
|
// src/controllers/dv-rerender.controller.ts
|
|
1451
1428
|
let SheetsDataValidationReRenderController = class SheetsDataValidationReRenderController extends _univerjs_core.Disposable {
|
|
1452
1429
|
constructor(_context, _sheetDataValidationModel, _sheetSkeletonManagerService) {
|
|
@@ -2825,7 +2802,6 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
|
|
|
2825
2802
|
[DataValidationAlertController],
|
|
2826
2803
|
[DataValidationAutoFillController],
|
|
2827
2804
|
[SheetsDataValidationMobileRenderController],
|
|
2828
|
-
[DataValidationPermissionController],
|
|
2829
2805
|
[DataValidationCopyPasteController],
|
|
2830
2806
|
[SheetsDataValidationUIController]
|
|
2831
2807
|
].forEach((dep) => {
|
|
@@ -2842,7 +2818,6 @@ let UniverSheetsDataValidationMobileUIPlugin = class UniverSheetsDataValidationM
|
|
|
2842
2818
|
}
|
|
2843
2819
|
onReady() {
|
|
2844
2820
|
this._injector.get(DataValidationCopyPasteController);
|
|
2845
|
-
this._injector.get(DataValidationPermissionController);
|
|
2846
2821
|
this._injector.get(_univerjs_engine_render.IRenderManagerService).registerRenderModule(_univerjs_core.UniverInstanceType.UNIVER_SHEET, [SheetsDataValidationReRenderController]);
|
|
2847
2822
|
}
|
|
2848
2823
|
onRendered() {
|
|
@@ -3864,7 +3839,7 @@ function ListFormulaInput(props) {
|
|
|
3864
3839
|
}, item.id),
|
|
3865
3840
|
idKey: "id"
|
|
3866
3841
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
3867
|
-
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-
|
|
3842
|
+
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",
|
|
3868
3843
|
onClick: handleAdd,
|
|
3869
3844
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.IncreaseIcon, { className: "univer-mr-1" }), localeService.t("sheets-data-validation-ui.list.add")]
|
|
3870
3845
|
})] })
|
|
@@ -3946,7 +3921,6 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
|
|
|
3946
3921
|
[DataValidationAlertController],
|
|
3947
3922
|
[DataValidationAutoFillController],
|
|
3948
3923
|
[SheetsDataValidationRenderController],
|
|
3949
|
-
[DataValidationPermissionController],
|
|
3950
3924
|
[DataValidationCopyPasteController],
|
|
3951
3925
|
[DataValidationRejectInputController],
|
|
3952
3926
|
[SheetsDataValidationUIController]
|
|
@@ -3968,7 +3942,6 @@ let UniverSheetsDataValidationUIPlugin = class UniverSheetsDataValidationUIPlugi
|
|
|
3968
3942
|
}
|
|
3969
3943
|
onReady() {
|
|
3970
3944
|
this._injector.get(DataValidationCopyPasteController);
|
|
3971
|
-
this._injector.get(DataValidationPermissionController);
|
|
3972
3945
|
this._injector.get(DataValidationRejectInputController);
|
|
3973
3946
|
this._injector.get(DataValidationAlertController);
|
|
3974
3947
|
this._injector.get(_univerjs_engine_render.IRenderManagerService).registerRenderModule(_univerjs_core.UniverInstanceType.UNIVER_SHEET, [SheetsDataValidationReRenderController]);
|
package/lib/cjs/locale/ar-SA.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/ca-ES.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/de-DE.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/en-US.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/es-ES.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/fa-IR.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/fr-FR.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/id-ID.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/it-IT.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/ja-JP.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/ko-KR.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/pl-PL.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/pt-BR.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/sk-SK.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/zh-CN.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/zh-HK.js
CHANGED
|
@@ -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
|
module.exports = locale;
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -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
|
module.exports = locale;
|