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