@univerjs/sheets 1.3.0 → 1.4.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/facade.js +29 -50
- package/lib/cjs/index.js +1143 -21533
- 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/cjs/plugin-BbO0p0x9.js +22321 -0
- package/lib/cjs/worker.js +9 -0
- package/lib/es/facade.js +29 -50
- package/lib/es/index.js +719 -21110
- 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/es/plugin-ipfwehrC.js +20048 -0
- package/lib/es/worker.js +3 -0
- package/lib/facade.js +29 -50
- package/lib/index.js +719 -21110
- 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/plugin-ipfwehrC.js +20048 -0
- package/lib/types/commands/commands/move-rows-cols.command.d.ts +2 -2
- package/lib/types/commands/commands/reorder-range.command.d.ts +1 -1
- package/lib/types/commands/commands/set-border.command.d.ts +1 -1
- package/lib/types/commands/mutations/numfmt.mutation.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +3 -2
- package/lib/types/facade/f-range.d.ts +8 -6
- package/lib/types/index.d.ts +1 -1
- package/lib/types/models/range-protection.cache.d.ts +9 -9
- package/lib/types/models/range-theme-model.d.ts +1 -1
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +1 -1
- package/lib/types/services/auto-fill/tools.d.ts +6 -6
- package/lib/types/services/exclusive-range/exclusive-range.service.d.ts +1 -1
- package/lib/types/services/numfmt/type.d.ts +1 -1
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
- package/lib/types/services/ref-range/util.d.ts +15 -15
- package/lib/types/services/selections/ref-selections.service.d.ts +1 -1
- package/lib/types/services/sheet-interceptor/interceptor-const.d.ts +2 -1
- package/lib/types/worker.d.ts +16 -0
- package/lib/umd/index.js +2 -2
- package/lib/worker.js +3 -0
- package/package.json +17 -12
package/lib/es/worker.js
ADDED
package/lib/facade.js
CHANGED
|
@@ -4,7 +4,7 @@ import { AddRangeProtectionMutation, AddWorksheetProtectionMutation, AppendRowCo
|
|
|
4
4
|
import { FormulaDataModel, IDefinedNamesService, IFunctionService, ISuperTableService, deserializeRangeWithSheet, serializeRange, serializeRangeWithSheet } from "@univerjs/engine-formula";
|
|
5
5
|
import { ObjectScope, UnitAction, UnitObject, UnitRole } from "@univerjs/protocol";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/facade/const.ts
|
|
8
8
|
/**
|
|
9
9
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
10
10
|
*
|
|
@@ -22,8 +22,7 @@ import { ObjectScope, UnitAction, UnitObject, UnitRole } from "@univerjs/protoco
|
|
|
22
22
|
*/
|
|
23
23
|
const SHEETS_CUSTOM_FIELD_WARNING_MESSAGE = "[Facade]: The sheets custom field is not recommended for external use. Use it at your own risk.";
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
25
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
27
26
|
function _typeof(o) {
|
|
28
27
|
"@babel/helpers - typeof";
|
|
29
28
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -33,8 +32,7 @@ function _typeof(o) {
|
|
|
33
32
|
}, _typeof(o);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
35
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
38
36
|
function toPrimitive(t, r) {
|
|
39
37
|
if ("object" != _typeof(t) || !t) return t;
|
|
40
38
|
var e = t[Symbol.toPrimitive];
|
|
@@ -46,15 +44,13 @@ function toPrimitive(t, r) {
|
|
|
46
44
|
return ("string" === r ? String : Number)(t);
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
47
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
51
48
|
function toPropertyKey(t) {
|
|
52
49
|
var i = toPrimitive(t, "string");
|
|
53
50
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
53
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
58
54
|
function _defineProperty(e, r, t) {
|
|
59
55
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
60
56
|
value: t,
|
|
@@ -64,16 +60,14 @@ function _defineProperty(e, r, t) {
|
|
|
64
60
|
}) : e[r] = t, e;
|
|
65
61
|
}
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
63
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
69
64
|
function __decorateParam(paramIndex, decorator) {
|
|
70
65
|
return function(target, key) {
|
|
71
66
|
decorator(target, key, paramIndex);
|
|
72
67
|
};
|
|
73
68
|
}
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
70
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
77
71
|
function __decorate(decorators, target, key, desc) {
|
|
78
72
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
79
73
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -81,8 +75,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
81
75
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
82
76
|
}
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
//#region src/facade/f-defined-name.ts
|
|
78
|
+
// src/facade/f-defined-name.ts
|
|
86
79
|
/**
|
|
87
80
|
* Get defined name field name
|
|
88
81
|
* @param {string} unitId - unit id
|
|
@@ -582,8 +575,7 @@ FDefinedName = __decorate([
|
|
|
582
575
|
__decorateParam(9, IDefinedNamesService)
|
|
583
576
|
], FDefinedName);
|
|
584
577
|
|
|
585
|
-
|
|
586
|
-
//#region src/facade/f-selection.ts
|
|
578
|
+
// src/facade/f-selection.ts
|
|
587
579
|
var _FSelection;
|
|
588
580
|
let FSelection = _FSelection = class FSelection {
|
|
589
581
|
constructor(_workbook, _worksheet, _selections, _injector) {
|
|
@@ -755,8 +747,7 @@ let FSelection = _FSelection = class FSelection {
|
|
|
755
747
|
};
|
|
756
748
|
FSelection = _FSelection = __decorate([__decorateParam(3, Inject(Injector))], FSelection);
|
|
757
749
|
|
|
758
|
-
|
|
759
|
-
//#region src/facade/permission/permission-types.ts
|
|
750
|
+
// src/facade/permission/permission-types.ts
|
|
760
751
|
/**
|
|
761
752
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
762
753
|
*
|
|
@@ -895,8 +886,7 @@ let RangePermissionPoint = /* @__PURE__ */ function(RangePermissionPoint) {
|
|
|
895
886
|
return RangePermissionPoint;
|
|
896
887
|
}({});
|
|
897
888
|
|
|
898
|
-
|
|
899
|
-
//#region src/facade/permission/permission-point-map.ts
|
|
889
|
+
// src/facade/permission/permission-point-map.ts
|
|
900
890
|
/**
|
|
901
891
|
* Mapping table from Workbook permission point enum to class constructors
|
|
902
892
|
*/
|
|
@@ -959,8 +949,7 @@ const RANGE_PERMISSION_POINT_MAP = {
|
|
|
959
949
|
["RangeDeleteProtection"]: RangeProtectionPermissionDeleteProtectionPoint
|
|
960
950
|
};
|
|
961
951
|
|
|
962
|
-
|
|
963
|
-
//#region src/facade/permission/util.ts
|
|
952
|
+
// src/facade/permission/util.ts
|
|
964
953
|
function determineViewState(allowViewByOthers) {
|
|
965
954
|
if (allowViewByOthers === false) return ViewStateEnum.NoOneElseCanView;
|
|
966
955
|
return ViewStateEnum.OthersCanView;
|
|
@@ -1039,8 +1028,7 @@ async function getListRangeProtectionRules(injector, unitId, subUnitId, options)
|
|
|
1039
1028
|
}))).map(({ id, permissionId, ranges, options }) => injector.createInstance(FRangeProtectionRule, unitId, subUnitId, id, permissionId, ranges, options));
|
|
1040
1029
|
}
|
|
1041
1030
|
|
|
1042
|
-
|
|
1043
|
-
//#region src/facade/permission/f-range-protection-rule.ts
|
|
1031
|
+
// src/facade/permission/f-range-protection-rule.ts
|
|
1044
1032
|
let FRangeProtectionRule = class FRangeProtectionRule {
|
|
1045
1033
|
constructor(_unitId, _subUnitId, _ruleId, _permissionId, _ranges, _options, _injector, _permissionService, _authzIoService, _commandService, _rangeProtectionRuleModel) {
|
|
1046
1034
|
this._unitId = _unitId;
|
|
@@ -1333,8 +1321,7 @@ FRangeProtectionRule = __decorate([
|
|
|
1333
1321
|
__decorateParam(10, Inject(RangeProtectionRuleModel))
|
|
1334
1322
|
], FRangeProtectionRule);
|
|
1335
1323
|
|
|
1336
|
-
|
|
1337
|
-
//#region src/facade/permission/f-worksheet-permission.ts
|
|
1324
|
+
// src/facade/permission/f-worksheet-permission.ts
|
|
1338
1325
|
let FWorksheetPermission = class FWorksheetPermission extends FBase {
|
|
1339
1326
|
constructor(_worksheet, _injector, _permissionService, _authzIoService, _commandService, _rangeProtectionRuleModel, _worksheetProtectionPointModel, _worksheetProtectionRuleModel) {
|
|
1340
1327
|
super();
|
|
@@ -1928,8 +1915,7 @@ FWorksheetPermission = __decorate([
|
|
|
1928
1915
|
__decorateParam(7, Inject(WorksheetProtectionRuleModel))
|
|
1929
1916
|
], FWorksheetPermission);
|
|
1930
1917
|
|
|
1931
|
-
|
|
1932
|
-
//#region src/facade/utils.ts
|
|
1918
|
+
// src/facade/utils.ts
|
|
1933
1919
|
/**
|
|
1934
1920
|
* Transform the Facade API horizontal alignment to the Univer Core horizontal alignment.
|
|
1935
1921
|
* @param {FHorizontalAlignment} value - The Facade API horizontal alignment.
|
|
@@ -2013,8 +1999,7 @@ function covertToColRange(range, worksheet) {
|
|
|
2013
1999
|
};
|
|
2014
2000
|
}
|
|
2015
2001
|
|
|
2016
|
-
|
|
2017
|
-
//#region src/facade/f-worksheet.ts
|
|
2002
|
+
// src/facade/f-worksheet.ts
|
|
2018
2003
|
var _FWorksheet;
|
|
2019
2004
|
function assertValidRowInsertion(methodName, rowIndex, rowCount, howMany) {
|
|
2020
2005
|
if (!Number.isInteger(howMany) || howMany <= 0) throw new RangeError(`${methodName}(): row count ${howMany} must be a positive integer.`);
|
|
@@ -4290,8 +4275,7 @@ FWorksheet = _FWorksheet = __decorate([
|
|
|
4290
4275
|
__decorateParam(6, ICommandService)
|
|
4291
4276
|
], FWorksheet);
|
|
4292
4277
|
|
|
4293
|
-
|
|
4294
|
-
//#region src/facade/permission/f-range-permission.ts
|
|
4278
|
+
// src/facade/permission/f-range-permission.ts
|
|
4295
4279
|
let FRangePermission = class FRangePermission extends FBase {
|
|
4296
4280
|
constructor(_unitId, _subUnitId, _range, _worksheet, _injector, _authzIoService, _commandService, _rangeProtectionRuleModel) {
|
|
4297
4281
|
super();
|
|
@@ -4446,8 +4430,7 @@ FRangePermission = __decorate([
|
|
|
4446
4430
|
__decorateParam(7, Inject(RangeProtectionRuleModel))
|
|
4447
4431
|
], FRangePermission);
|
|
4448
4432
|
|
|
4449
|
-
|
|
4450
|
-
//#region src/facade/f-range.ts
|
|
4433
|
+
// src/facade/f-range.ts
|
|
4451
4434
|
var _FRange;
|
|
4452
4435
|
var _FRange2;
|
|
4453
4436
|
let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
@@ -5446,10 +5429,12 @@ let FRange = _FRange = class FRange extends FBaseInitialable {
|
|
|
5446
5429
|
* - `ICellData`: updates cell-data fields directly, for explicit control over `v` (value),
|
|
5447
5430
|
* `f` (formula), `p` (rich text), `t` (value type), and `s` (style). The object bypasses the
|
|
5448
5431
|
* formula and formatted-number parsing above: `{ v: '=SUM(A1:A2)' }` does not set a formula;
|
|
5449
|
-
* use `{ f: '=SUM(A1:A2)', v: null, p: null }` instead.
|
|
5450
|
-
*
|
|
5451
|
-
*
|
|
5452
|
-
*
|
|
5432
|
+
* use `{ f: '=SUM(A1:A2)', v: null, p: null }` instead. Writing `v` or `p` without `f` and
|
|
5433
|
+
* `si` replaces the target formula, as writing a scalar value does, and writing `f` without
|
|
5434
|
+
* `si` disassociates the cell from its previous shared formula. Rich text is still not
|
|
5435
|
+
* cleared by a value write, so pass `p: null` when replacing rich text with `v`. Use
|
|
5436
|
+
* `v: null` to clear the stored value. Supplied style properties are merged into the existing
|
|
5437
|
+
* style; `s: null` clears the style.
|
|
5453
5438
|
*
|
|
5454
5439
|
* In both modes, the stored value is converted according to its cell type. Unless an `ICellData`
|
|
5455
5440
|
* input supplies `t`, the type is inferred from the value, number format, and existing cell type.
|
|
@@ -6819,8 +6804,7 @@ FRange = _FRange = __decorate([
|
|
|
6819
6804
|
__decorateParam(6, ILogService)
|
|
6820
6805
|
], FRange);
|
|
6821
6806
|
|
|
6822
|
-
|
|
6823
|
-
//#region src/facade/permission/f-workbook-permission.ts
|
|
6807
|
+
// src/facade/permission/f-workbook-permission.ts
|
|
6824
6808
|
let FWorkbookPermission = class FWorkbookPermission extends FBase {
|
|
6825
6809
|
constructor(_unitId, _injector, _permissionService, _authzIoService) {
|
|
6826
6810
|
super();
|
|
@@ -7147,8 +7131,7 @@ FWorkbookPermission = __decorate([
|
|
|
7147
7131
|
__decorateParam(3, IAuthzIoService)
|
|
7148
7132
|
], FWorkbookPermission);
|
|
7149
7133
|
|
|
7150
|
-
|
|
7151
|
-
//#region src/facade/f-workbook.ts
|
|
7134
|
+
// src/facade/f-workbook.ts
|
|
7152
7135
|
let FWorkbook = class FWorkbook extends FBaseInitialable {
|
|
7153
7136
|
constructor(_workbook, _injector, _resourceLoaderService, _selectionManagerService, _univerInstanceService, _commandService, _permissionService, _logService, _definedNamesService) {
|
|
7154
7137
|
super(_injector);
|
|
@@ -8162,8 +8145,7 @@ FWorkbook = __decorate([
|
|
|
8162
8145
|
__decorateParam(8, IDefinedNamesService)
|
|
8163
8146
|
], FWorkbook);
|
|
8164
8147
|
|
|
8165
|
-
|
|
8166
|
-
//#region src/facade/f-univer.ts
|
|
8148
|
+
// src/facade/f-univer.ts
|
|
8167
8149
|
var FUniverSheetsMixin = class extends FUniver {
|
|
8168
8150
|
createWorkbook(data, options) {
|
|
8169
8151
|
const workbook = this._injector.get(IUniverInstanceService).createUnit(UniverInstanceType.UNIVER_SHEET, data, options);
|
|
@@ -8521,8 +8503,7 @@ var FUniverSheetsMixin = class extends FUniver {
|
|
|
8521
8503
|
};
|
|
8522
8504
|
FUniver.extend(FUniverSheetsMixin);
|
|
8523
8505
|
|
|
8524
|
-
|
|
8525
|
-
//#region src/facade/f-enum.ts
|
|
8506
|
+
// src/facade/f-enum.ts
|
|
8526
8507
|
/**
|
|
8527
8508
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
8528
8509
|
*
|
|
@@ -8563,8 +8544,7 @@ var FSheetsEnumMixin = class extends FEnum {
|
|
|
8563
8544
|
};
|
|
8564
8545
|
FEnum.extend(FSheetsEnumMixin);
|
|
8565
8546
|
|
|
8566
|
-
|
|
8567
|
-
//#region src/facade/f-event.ts
|
|
8547
|
+
// src/facade/f-event.ts
|
|
8568
8548
|
var FSheetsEventNameMixin = class extends FEventName {
|
|
8569
8549
|
get SheetCreated() {
|
|
8570
8550
|
return "SheetCreated";
|
|
@@ -8629,5 +8609,4 @@ var FSheetsEventNameMixin = class extends FEventName {
|
|
|
8629
8609
|
};
|
|
8630
8610
|
FEventName.extend(FSheetsEventNameMixin);
|
|
8631
8611
|
|
|
8632
|
-
//#endregion
|
|
8633
8612
|
export { FRange, FSelection, FSheetsEnumMixin, FSheetsEventNameMixin, FWorkbook, FWorkbookPermission, FWorksheet };
|