@univerjs/sheets 1.0.4 → 1.1.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 +80 -40
- package/lib/cjs/index.js +105 -47
- package/lib/es/facade.js +76 -36
- package/lib/es/index.js +80 -24
- package/lib/facade.js +76 -36
- package/lib/index.js +80 -24
- package/lib/types/commands/commands/set-workbook-calculation-settings.command.d.ts +18 -0
- package/lib/types/commands/mutations/set-workbook-calculation-settings.mutation.d.ts +21 -0
- package/lib/types/config/config.d.ts +8 -0
- package/lib/types/facade/f-range.d.ts +2 -1
- package/lib/types/facade/f-workbook.d.ts +31 -1
- package/lib/types/index.d.ts +3 -0
- package/lib/types/services/permission/workbook-permission/util.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
package/lib/cjs/facade.js
CHANGED
|
@@ -24,7 +24,7 @@ let _univerjs_protocol = require("@univerjs/protocol");
|
|
|
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
26
|
//#endregion
|
|
27
|
-
//#region \0@oxc-project+runtime@0.
|
|
27
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
28
28
|
function _typeof(o) {
|
|
29
29
|
"@babel/helpers - typeof";
|
|
30
30
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -35,7 +35,7 @@ function _typeof(o) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
//#endregion
|
|
38
|
-
//#region \0@oxc-project+runtime@0.
|
|
38
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
39
39
|
function toPrimitive(t, r) {
|
|
40
40
|
if ("object" != _typeof(t) || !t) return t;
|
|
41
41
|
var e = t[Symbol.toPrimitive];
|
|
@@ -48,14 +48,14 @@ function toPrimitive(t, r) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
//#endregion
|
|
51
|
-
//#region \0@oxc-project+runtime@0.
|
|
51
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
52
52
|
function toPropertyKey(t) {
|
|
53
53
|
var i = toPrimitive(t, "string");
|
|
54
54
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
//#endregion
|
|
58
|
-
//#region \0@oxc-project+runtime@0.
|
|
58
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
59
59
|
function _defineProperty(e, r, t) {
|
|
60
60
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
61
61
|
value: t,
|
|
@@ -66,7 +66,7 @@ function _defineProperty(e, r, t) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region \0@oxc-project+runtime@0.
|
|
69
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
70
70
|
function __decorateParam(paramIndex, decorator) {
|
|
71
71
|
return function(target, key) {
|
|
72
72
|
decorator(target, key, paramIndex);
|
|
@@ -74,7 +74,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
//#endregion
|
|
77
|
-
//#region \0@oxc-project+runtime@0.
|
|
77
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
78
78
|
function __decorate(decorators, target, key, desc) {
|
|
79
79
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
80
80
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6546,6 +6546,7 @@ let FRange = _FRange = class FRange extends _univerjs_core_facade.FBaseInitialab
|
|
|
6546
6546
|
* Returns a copy of the range expanded `Direction.UP` and `Direction.DOWN` if the specified dimension is `Dimension.ROWS`, or `Direction.NEXT` and `Direction.PREVIOUS` if the dimension is `Dimension.COLUMNS`.
|
|
6547
6547
|
* The expansion of the range is based on detecting data next to the range that is organized like a table.
|
|
6548
6548
|
* The expanded range covers all adjacent cells with data in them along the specified dimension including the table boundaries.
|
|
6549
|
+
* Cells connected only diagonally do not cause the range to expand.
|
|
6549
6550
|
* If the original range is surrounded by empty cells along the specified dimension, the range itself is returned.
|
|
6550
6551
|
* @param {Dimension} [dimension] - The dimension along which to expand the range. If not provided, the range will be expanded in both dimensions.
|
|
6551
6552
|
* @returns {FRange} The range's data region or a range covering each column or each row spanned by the original range.
|
|
@@ -6566,7 +6567,7 @@ let FRange = _FRange = class FRange extends _univerjs_core_facade.FBaseInitialab
|
|
|
6566
6567
|
* fWorksheet.getRange('D3').setValue(100);
|
|
6567
6568
|
* fWorksheet.getRange('C4').setValue(100);
|
|
6568
6569
|
*
|
|
6569
|
-
* // Get C3 data region along the rows dimension, the range will be C2:
|
|
6570
|
+
* // Get C3 data region along the rows dimension, the range will be C2:C4
|
|
6570
6571
|
* const range = fWorksheet.getRange('C3').getDataRegion(univerAPI.Enum.Dimension.ROWS);
|
|
6571
6572
|
* console.log(range.getA1Notation()); // C2:C4
|
|
6572
6573
|
*
|
|
@@ -6580,41 +6581,43 @@ let FRange = _FRange = class FRange extends _univerjs_core_facade.FBaseInitialab
|
|
|
6580
6581
|
* ```
|
|
6581
6582
|
*/
|
|
6582
6583
|
getDataRegion(dimension) {
|
|
6583
|
-
|
|
6584
|
+
let { startRow, startColumn, endRow, endColumn } = this._range;
|
|
6584
6585
|
const maxRows = this._worksheet.getMaxRows();
|
|
6585
6586
|
const maxColumns = this._worksheet.getMaxColumns();
|
|
6586
6587
|
const cellMatrix = this._worksheet.getCellMatrix();
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
let
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6588
|
+
const rowHasData = (row) => {
|
|
6589
|
+
for (let c = startColumn; c <= endColumn; c++) if (!(0, _univerjs_core.isNullCell)(cellMatrix.getValue(row, c))) return true;
|
|
6590
|
+
return false;
|
|
6591
|
+
};
|
|
6592
|
+
const columnHasData = (column) => {
|
|
6593
|
+
for (let r = startRow; r <= endRow; r++) if (!(0, _univerjs_core.isNullCell)(cellMatrix.getValue(r, column))) return true;
|
|
6594
|
+
return false;
|
|
6595
|
+
};
|
|
6596
|
+
let expanded = true;
|
|
6597
|
+
while (expanded) {
|
|
6598
|
+
expanded = false;
|
|
6599
|
+
while (dimension !== _univerjs_core.Dimension.COLUMNS && startRow > 0 && rowHasData(startRow - 1)) {
|
|
6600
|
+
startRow--;
|
|
6601
|
+
expanded = true;
|
|
6598
6602
|
}
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6603
|
+
while (dimension !== _univerjs_core.Dimension.COLUMNS && endRow < maxRows - 1 && rowHasData(endRow + 1)) {
|
|
6604
|
+
endRow++;
|
|
6605
|
+
expanded = true;
|
|
6606
|
+
}
|
|
6607
|
+
while (dimension !== _univerjs_core.Dimension.ROWS && startColumn > 0 && columnHasData(startColumn - 1)) {
|
|
6608
|
+
startColumn--;
|
|
6609
|
+
expanded = true;
|
|
6610
|
+
}
|
|
6611
|
+
while (dimension !== _univerjs_core.Dimension.ROWS && endColumn < maxColumns - 1 && columnHasData(endColumn + 1)) {
|
|
6612
|
+
endColumn++;
|
|
6613
|
+
expanded = true;
|
|
6609
6614
|
}
|
|
6610
|
-
if (leftColumnHasValue) newStartColumn = startColumn - 1;
|
|
6611
|
-
if (rightColumnHasValue) newEndColumn = endColumn + 1;
|
|
6612
6615
|
}
|
|
6613
6616
|
return this._injector.createInstance(_FRange, this._workbook, this._worksheet, {
|
|
6614
|
-
startRow
|
|
6615
|
-
startColumn
|
|
6616
|
-
endRow
|
|
6617
|
-
endColumn
|
|
6617
|
+
startRow,
|
|
6618
|
+
startColumn,
|
|
6619
|
+
endRow,
|
|
6620
|
+
endColumn
|
|
6618
6621
|
});
|
|
6619
6622
|
}
|
|
6620
6623
|
/**
|
|
@@ -8111,6 +8114,43 @@ let FWorkbook = class FWorkbook extends _univerjs_core_facade.FBaseInitialable {
|
|
|
8111
8114
|
removeStyles(styleKeys) {
|
|
8112
8115
|
this._workbook.removeStyles(styleKeys);
|
|
8113
8116
|
}
|
|
8117
|
+
/**
|
|
8118
|
+
* Get the workbook's iterative calculation settings.
|
|
8119
|
+
* Missing or invalid settings use the defaults: iteration disabled, 100 iterations and a maximum change of 0.001.
|
|
8120
|
+
* @returns {IWorkbookCalculationSettings} A copy of the normalized workbook calculation settings.
|
|
8121
|
+
* @example
|
|
8122
|
+
* ```ts
|
|
8123
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
8124
|
+
* const settings = fWorkbook.getCalculationSettings();
|
|
8125
|
+
* console.log(settings.iterativeCalculation, settings.maxIterations, settings.maxChange);
|
|
8126
|
+
* ```
|
|
8127
|
+
*/
|
|
8128
|
+
getCalculationSettings() {
|
|
8129
|
+
return this._workbook.getCalculationSettings();
|
|
8130
|
+
}
|
|
8131
|
+
/**
|
|
8132
|
+
* Set iterative calculation settings for the entire workbook through an undoable command.
|
|
8133
|
+
* @param {IWorkbookCalculationSettings} settings The complete calculation settings.
|
|
8134
|
+
* Set `iterativeCalculation` to enable or disable iterative evaluation of circular references.
|
|
8135
|
+
* `maxIterations` must be an integer from 1 to 32767, and `maxChange` must be a finite positive number.
|
|
8136
|
+
* @returns {boolean} Whether the settings command succeeded. Returns false if the workbook cannot be edited or found.
|
|
8137
|
+
* @example
|
|
8138
|
+
* ```ts
|
|
8139
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
8140
|
+
* const success = fWorkbook.setCalculationSettings({
|
|
8141
|
+
* iterativeCalculation: true,
|
|
8142
|
+
* maxIterations: 100,
|
|
8143
|
+
* maxChange: 0.001,
|
|
8144
|
+
* });
|
|
8145
|
+
* console.log('Calculation settings updated:', success);
|
|
8146
|
+
* ```
|
|
8147
|
+
*/
|
|
8148
|
+
setCalculationSettings(settings) {
|
|
8149
|
+
return this._commandService.syncExecuteCommand(_univerjs_sheets.SetWorkbookCalculationSettingsCommand.id, {
|
|
8150
|
+
unitId: this.id,
|
|
8151
|
+
settings
|
|
8152
|
+
});
|
|
8153
|
+
}
|
|
8114
8154
|
};
|
|
8115
8155
|
FWorkbook = __decorate([
|
|
8116
8156
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
@@ -8591,13 +8631,13 @@ var FSheetsEventNameMixin = class extends _univerjs_core_facade.FEventName {
|
|
|
8591
8631
|
_univerjs_core_facade.FEventName.extend(FSheetsEventNameMixin);
|
|
8592
8632
|
|
|
8593
8633
|
//#endregion
|
|
8594
|
-
Object.defineProperty(exports,
|
|
8634
|
+
Object.defineProperty(exports, "FRange", {
|
|
8595
8635
|
enumerable: true,
|
|
8596
8636
|
get: function () {
|
|
8597
8637
|
return FRange;
|
|
8598
8638
|
}
|
|
8599
8639
|
});
|
|
8600
|
-
Object.defineProperty(exports,
|
|
8640
|
+
Object.defineProperty(exports, "FSelection", {
|
|
8601
8641
|
enumerable: true,
|
|
8602
8642
|
get: function () {
|
|
8603
8643
|
return FSelection;
|
|
@@ -8605,19 +8645,19 @@ Object.defineProperty(exports, 'FSelection', {
|
|
|
8605
8645
|
});
|
|
8606
8646
|
exports.FSheetsEnumMixin = FSheetsEnumMixin;
|
|
8607
8647
|
exports.FSheetsEventNameMixin = FSheetsEventNameMixin;
|
|
8608
|
-
Object.defineProperty(exports,
|
|
8648
|
+
Object.defineProperty(exports, "FWorkbook", {
|
|
8609
8649
|
enumerable: true,
|
|
8610
8650
|
get: function () {
|
|
8611
8651
|
return FWorkbook;
|
|
8612
8652
|
}
|
|
8613
8653
|
});
|
|
8614
|
-
Object.defineProperty(exports,
|
|
8654
|
+
Object.defineProperty(exports, "FWorkbookPermission", {
|
|
8615
8655
|
enumerable: true,
|
|
8616
8656
|
get: function () {
|
|
8617
8657
|
return FWorkbookPermission;
|
|
8618
8658
|
}
|
|
8619
8659
|
});
|
|
8620
|
-
Object.defineProperty(exports,
|
|
8660
|
+
Object.defineProperty(exports, "FWorksheet", {
|
|
8621
8661
|
enumerable: true,
|
|
8622
8662
|
get: function () {
|
|
8623
8663
|
return FWorksheet;
|
package/lib/cjs/index.js
CHANGED
|
@@ -219,7 +219,7 @@ const RangeThemeInterceptorId = "sheet.interceptor.range-theme-id";
|
|
|
219
219
|
const IgnoreRangeThemeInterceptorKey = "sheet.interceptor.ignore-range-theme";
|
|
220
220
|
|
|
221
221
|
//#endregion
|
|
222
|
-
//#region \0@oxc-project+runtime@0.
|
|
222
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
223
223
|
function _typeof(o) {
|
|
224
224
|
"@babel/helpers - typeof";
|
|
225
225
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -230,7 +230,7 @@ function _typeof(o) {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
//#endregion
|
|
233
|
-
//#region \0@oxc-project+runtime@0.
|
|
233
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
234
234
|
function toPrimitive(t, r) {
|
|
235
235
|
if ("object" != _typeof(t) || !t) return t;
|
|
236
236
|
var e = t[Symbol.toPrimitive];
|
|
@@ -243,14 +243,14 @@ function toPrimitive(t, r) {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
//#endregion
|
|
246
|
-
//#region \0@oxc-project+runtime@0.
|
|
246
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
247
247
|
function toPropertyKey(t) {
|
|
248
248
|
var i = toPrimitive(t, "string");
|
|
249
249
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
//#endregion
|
|
253
|
-
//#region \0@oxc-project+runtime@0.
|
|
253
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
254
254
|
function _defineProperty(e, r, t) {
|
|
255
255
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
256
256
|
value: t,
|
|
@@ -261,7 +261,7 @@ function _defineProperty(e, r, t) {
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
//#endregion
|
|
264
|
-
//#region \0@oxc-project+runtime@0.
|
|
264
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
265
265
|
function __decorateParam(paramIndex, decorator) {
|
|
266
266
|
return function(target, key) {
|
|
267
267
|
decorator(target, key, paramIndex);
|
|
@@ -269,7 +269,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
//#endregion
|
|
272
|
-
//#region \0@oxc-project+runtime@0.
|
|
272
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
273
273
|
function __decorate(decorators, target, key, desc) {
|
|
274
274
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
275
275
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -14721,6 +14721,72 @@ const SetTabColorCommand = {
|
|
|
14721
14721
|
}
|
|
14722
14722
|
};
|
|
14723
14723
|
|
|
14724
|
+
//#endregion
|
|
14725
|
+
//#region src/services/permission/permission-point/workbook/editable.ts
|
|
14726
|
+
var WorkbookEditablePermission = class {
|
|
14727
|
+
constructor(unitId) {
|
|
14728
|
+
this.unitId = unitId;
|
|
14729
|
+
_defineProperty(this, "id", void 0);
|
|
14730
|
+
_defineProperty(this, "value", true);
|
|
14731
|
+
_defineProperty(this, "type", _univerjs_protocol.UnitObject.Workbook);
|
|
14732
|
+
_defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
14733
|
+
_defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
14734
|
+
this.unitId = unitId;
|
|
14735
|
+
this.id = `${this.type}.${_univerjs_protocol.UnitAction.Edit}_${unitId}`;
|
|
14736
|
+
}
|
|
14737
|
+
};
|
|
14738
|
+
|
|
14739
|
+
//#endregion
|
|
14740
|
+
//#region src/commands/mutations/set-workbook-calculation-settings.mutation.ts
|
|
14741
|
+
const SetWorkbookCalculationSettingsMutation = {
|
|
14742
|
+
id: "sheet.mutation.set-workbook-calculation-settings",
|
|
14743
|
+
type: _univerjs_core.CommandType.MUTATION,
|
|
14744
|
+
handler: (accessor, params) => {
|
|
14745
|
+
const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getUnit(params.unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
14746
|
+
if (!workbook) return false;
|
|
14747
|
+
workbook.setCalculationSettings(params.settings);
|
|
14748
|
+
return true;
|
|
14749
|
+
}
|
|
14750
|
+
};
|
|
14751
|
+
|
|
14752
|
+
//#endregion
|
|
14753
|
+
//#region src/commands/commands/set-workbook-calculation-settings.command.ts
|
|
14754
|
+
const SetWorkbookCalculationSettingsCommand = {
|
|
14755
|
+
id: "sheet.command.set-workbook-calculation-settings",
|
|
14756
|
+
type: _univerjs_core.CommandType.COMMAND,
|
|
14757
|
+
handler: (accessor, params) => {
|
|
14758
|
+
if (!params) return false;
|
|
14759
|
+
const target = getSheetCommandTargetWorkbook(accessor.get(_univerjs_core.IUniverInstanceService), params);
|
|
14760
|
+
if (!target) return false;
|
|
14761
|
+
const permission = accessor.get(_univerjs_core.IPermissionService).getPermissionPoint(new WorkbookEditablePermission(params.unitId).id);
|
|
14762
|
+
if (permission && !permission.value) return false;
|
|
14763
|
+
const undoParams = {
|
|
14764
|
+
unitId: params.unitId,
|
|
14765
|
+
settings: target.workbook.getCalculationSettings()
|
|
14766
|
+
};
|
|
14767
|
+
const redoParams = {
|
|
14768
|
+
unitId: params.unitId,
|
|
14769
|
+
settings: (0, _univerjs_core.normalizeWorkbookCalculationSettings)(params.settings)
|
|
14770
|
+
};
|
|
14771
|
+
if (undoParams.settings.iterativeCalculation === redoParams.settings.iterativeCalculation && undoParams.settings.maxIterations === redoParams.settings.maxIterations && undoParams.settings.maxChange === redoParams.settings.maxChange) return true;
|
|
14772
|
+
if (accessor.get(_univerjs_core.ICommandService).syncExecuteCommand(SetWorkbookCalculationSettingsMutation.id, redoParams)) {
|
|
14773
|
+
accessor.get(_univerjs_core.IUndoRedoService).pushUndoRedo({
|
|
14774
|
+
unitID: params.unitId,
|
|
14775
|
+
undoMutations: [{
|
|
14776
|
+
id: SetWorkbookCalculationSettingsMutation.id,
|
|
14777
|
+
params: undoParams
|
|
14778
|
+
}],
|
|
14779
|
+
redoMutations: [{
|
|
14780
|
+
id: SetWorkbookCalculationSettingsMutation.id,
|
|
14781
|
+
params: redoParams
|
|
14782
|
+
}]
|
|
14783
|
+
});
|
|
14784
|
+
return true;
|
|
14785
|
+
}
|
|
14786
|
+
return false;
|
|
14787
|
+
}
|
|
14788
|
+
};
|
|
14789
|
+
|
|
14724
14790
|
//#endregion
|
|
14725
14791
|
//#region src/commands/mutations/set-workbook-name.mutation.ts
|
|
14726
14792
|
const SetWorkbookNameMutation = {
|
|
@@ -15594,21 +15660,6 @@ var WorkbookDuplicatePermission = class {
|
|
|
15594
15660
|
}
|
|
15595
15661
|
};
|
|
15596
15662
|
|
|
15597
|
-
//#endregion
|
|
15598
|
-
//#region src/services/permission/permission-point/workbook/editable.ts
|
|
15599
|
-
var WorkbookEditablePermission = class {
|
|
15600
|
-
constructor(unitId) {
|
|
15601
|
-
this.unitId = unitId;
|
|
15602
|
-
_defineProperty(this, "id", void 0);
|
|
15603
|
-
_defineProperty(this, "value", true);
|
|
15604
|
-
_defineProperty(this, "type", _univerjs_protocol.UnitObject.Workbook);
|
|
15605
|
-
_defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
15606
|
-
_defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
15607
|
-
this.unitId = unitId;
|
|
15608
|
-
this.id = `${this.type}.${_univerjs_protocol.UnitAction.Edit}_${unitId}`;
|
|
15609
|
-
}
|
|
15610
|
-
};
|
|
15611
|
-
|
|
15612
15663
|
//#endregion
|
|
15613
15664
|
//#region src/services/permission/permission-point/workbook/export.ts
|
|
15614
15665
|
var WorkbookExportPermission = class {
|
|
@@ -19519,7 +19570,7 @@ RangeProtectionCache = __decorate([
|
|
|
19519
19570
|
//#endregion
|
|
19520
19571
|
//#region package.json
|
|
19521
19572
|
var name = "@univerjs/sheets";
|
|
19522
|
-
var version = "1.0
|
|
19573
|
+
var version = "1.1.0";
|
|
19523
19574
|
|
|
19524
19575
|
//#endregion
|
|
19525
19576
|
//#region src/controllers/active-worksheet.controller.ts
|
|
@@ -19649,6 +19700,7 @@ let BasicWorksheetController = class BasicWorksheetController extends _univerjs_
|
|
|
19649
19700
|
RemoveWorksheetMergeMutation,
|
|
19650
19701
|
RemoveNumfmtMutation,
|
|
19651
19702
|
AddWorksheetMergeMutation,
|
|
19703
|
+
SetWorkbookCalculationSettingsMutation,
|
|
19652
19704
|
SetWorkbookNameMutation,
|
|
19653
19705
|
SetWorksheetNameMutation,
|
|
19654
19706
|
SetNumfmtMutation,
|
|
@@ -19742,6 +19794,7 @@ let BasicWorksheetController = class BasicWorksheetController extends _univerjs_
|
|
|
19742
19794
|
SetTextRotationCommand,
|
|
19743
19795
|
SetTextWrapCommand,
|
|
19744
19796
|
SetVerticalTextAlignCommand,
|
|
19797
|
+
SetWorkbookCalculationSettingsCommand,
|
|
19745
19798
|
SetWorkbookNameCommand,
|
|
19746
19799
|
SetWorksheetActivateCommand,
|
|
19747
19800
|
SetWorksheetActiveOperation,
|
|
@@ -20866,6 +20919,9 @@ let UniverSheetsPlugin = class UniverSheetsPlugin extends _univerjs_core.Plugin
|
|
|
20866
20919
|
}
|
|
20867
20920
|
_initConfig() {
|
|
20868
20921
|
var _this$_config, _this$_config2, _this$_config3;
|
|
20922
|
+
const textLineGap = this._config.textLineGap ?? 0;
|
|
20923
|
+
if (!Number.isFinite(textLineGap) || textLineGap < 0) throw new RangeError("textLineGap must be a finite, non-negative number.");
|
|
20924
|
+
this._configService.setConfig(_univerjs_core.SHEET_TEXT_LINE_GAP, textLineGap);
|
|
20869
20925
|
if ((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.onlyRegisterFormulaRelatedMutations) this._configService.setConfig(ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY, true);
|
|
20870
20926
|
if ((_this$_config2 = this._config) === null || _this$_config2 === void 0 ? void 0 : _this$_config2.isRowStylePrecedeColumnStyle) this._configService.setConfig(_univerjs_core.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, true);
|
|
20871
20927
|
if ((_this$_config3 = this._config) === null || _this$_config3 === void 0 ? void 0 : _this$_config3.autoHeightForMergedCells) this._configService.setConfig(_univerjs_core.AUTO_HEIGHT_FOR_MERGED_CELLS, true);
|
|
@@ -21488,14 +21544,14 @@ exports.AddWorksheetProtectionMutation = AddWorksheetProtectionMutation;
|
|
|
21488
21544
|
exports.AppendRowCommand = AppendRowCommand;
|
|
21489
21545
|
exports.AutoClearContentCommand = AutoClearContentCommand;
|
|
21490
21546
|
exports.AutoFillCommand = AutoFillCommand;
|
|
21491
|
-
Object.defineProperty(exports,
|
|
21547
|
+
Object.defineProperty(exports, "AutoFillController", {
|
|
21492
21548
|
enumerable: true,
|
|
21493
21549
|
get: function () {
|
|
21494
21550
|
return AutoFillController;
|
|
21495
21551
|
}
|
|
21496
21552
|
});
|
|
21497
21553
|
exports.AutoFillRules = AutoFillRules;
|
|
21498
|
-
Object.defineProperty(exports,
|
|
21554
|
+
Object.defineProperty(exports, "AutoFillService", {
|
|
21499
21555
|
enumerable: true,
|
|
21500
21556
|
get: function () {
|
|
21501
21557
|
return AutoFillService;
|
|
@@ -21506,7 +21562,7 @@ exports.BEFORE_CELL_EDIT = BEFORE_CELL_EDIT;
|
|
|
21506
21562
|
exports.BorderStyleManagerService = BorderStyleManagerService;
|
|
21507
21563
|
exports.COMMAND_LISTENER_SKELETON_CHANGE = COMMAND_LISTENER_SKELETON_CHANGE;
|
|
21508
21564
|
exports.COMMAND_LISTENER_VALUE_CHANGE = COMMAND_LISTENER_VALUE_CHANGE;
|
|
21509
|
-
Object.defineProperty(exports,
|
|
21565
|
+
Object.defineProperty(exports, "CalculateResultApplyController", {
|
|
21510
21566
|
enumerable: true,
|
|
21511
21567
|
get: function () {
|
|
21512
21568
|
return CalculateResultApplyController;
|
|
@@ -21520,7 +21576,7 @@ exports.ClearSelectionFormatCommand = ClearSelectionFormatCommand;
|
|
|
21520
21576
|
exports.CopySheetCommand = CopySheetCommand;
|
|
21521
21577
|
exports.CopyWorksheetEndMutation = CopyWorksheetEndMutation;
|
|
21522
21578
|
exports.DISABLE_NORMAL_SELECTIONS = DISABLE_NORMAL_SELECTIONS;
|
|
21523
|
-
Object.defineProperty(exports,
|
|
21579
|
+
Object.defineProperty(exports, "DefinedNameDataController", {
|
|
21524
21580
|
enumerable: true,
|
|
21525
21581
|
get: function () {
|
|
21526
21582
|
return DefinedNameDataController;
|
|
@@ -21576,7 +21632,7 @@ exports.MAX_CELL_PER_SHEET_KEY = MAX_CELL_PER_SHEET_KEY;
|
|
|
21576
21632
|
exports.MERGE_CELL_INTERCEPTOR_CHECK = MERGE_CELL_INTERCEPTOR_CHECK;
|
|
21577
21633
|
exports.MarkDirtyFilterChangeMutation = MarkDirtyFilterChangeMutation;
|
|
21578
21634
|
exports.MarkDirtyRowAutoHeightOperation = MarkDirtyRowAutoHeightOperation;
|
|
21579
|
-
Object.defineProperty(exports,
|
|
21635
|
+
Object.defineProperty(exports, "MergeCellController", {
|
|
21580
21636
|
enumerable: true,
|
|
21581
21637
|
get: function () {
|
|
21582
21638
|
return MergeCellController;
|
|
@@ -21590,7 +21646,7 @@ exports.MoveRangeMutation = MoveRangeMutation;
|
|
|
21590
21646
|
exports.MoveRowsCommand = MoveRowsCommand;
|
|
21591
21647
|
exports.MoveRowsMutation = MoveRowsMutation;
|
|
21592
21648
|
exports.MoveRowsMutationUndoFactory = MoveRowsMutationUndoFactory;
|
|
21593
|
-
Object.defineProperty(exports,
|
|
21649
|
+
Object.defineProperty(exports, "NumfmtService", {
|
|
21594
21650
|
enumerable: true,
|
|
21595
21651
|
get: function () {
|
|
21596
21652
|
return NumfmtService;
|
|
@@ -21600,7 +21656,7 @@ exports.OperatorType = OperatorType;
|
|
|
21600
21656
|
exports.PermissionPointsDefinitions = PermissionPointsDefinitions;
|
|
21601
21657
|
exports.REF_SELECTIONS_ENABLED = REF_SELECTIONS_ENABLED;
|
|
21602
21658
|
exports.RangeMergeUtil = RangeMergeUtil;
|
|
21603
|
-
Object.defineProperty(exports,
|
|
21659
|
+
Object.defineProperty(exports, "RangeProtectionCache", {
|
|
21604
21660
|
enumerable: true,
|
|
21605
21661
|
get: function () {
|
|
21606
21662
|
return RangeProtectionCache;
|
|
@@ -21610,33 +21666,33 @@ exports.RangeProtectionPermissionDeleteProtectionPoint = RangeProtectionPermissi
|
|
|
21610
21666
|
exports.RangeProtectionPermissionEditPoint = RangeProtectionPermissionEditPoint;
|
|
21611
21667
|
exports.RangeProtectionPermissionManageCollaPoint = RangeProtectionPermissionManageCollaPoint;
|
|
21612
21668
|
exports.RangeProtectionPermissionViewPoint = RangeProtectionPermissionViewPoint;
|
|
21613
|
-
Object.defineProperty(exports,
|
|
21669
|
+
Object.defineProperty(exports, "RangeProtectionRefRangeService", {
|
|
21614
21670
|
enumerable: true,
|
|
21615
21671
|
get: function () {
|
|
21616
21672
|
return RangeProtectionRefRangeService;
|
|
21617
21673
|
}
|
|
21618
21674
|
});
|
|
21619
|
-
Object.defineProperty(exports,
|
|
21675
|
+
Object.defineProperty(exports, "RangeProtectionRenderModel", {
|
|
21620
21676
|
enumerable: true,
|
|
21621
21677
|
get: function () {
|
|
21622
21678
|
return RangeProtectionRenderModel;
|
|
21623
21679
|
}
|
|
21624
21680
|
});
|
|
21625
21681
|
exports.RangeProtectionRuleModel = RangeProtectionRuleModel;
|
|
21626
|
-
Object.defineProperty(exports,
|
|
21682
|
+
Object.defineProperty(exports, "RangeProtectionService", {
|
|
21627
21683
|
enumerable: true,
|
|
21628
21684
|
get: function () {
|
|
21629
21685
|
return RangeProtectionService;
|
|
21630
21686
|
}
|
|
21631
21687
|
});
|
|
21632
21688
|
exports.RangeThemeStyle = RangeThemeStyle;
|
|
21633
|
-
Object.defineProperty(exports,
|
|
21689
|
+
Object.defineProperty(exports, "RefRangeService", {
|
|
21634
21690
|
enumerable: true,
|
|
21635
21691
|
get: function () {
|
|
21636
21692
|
return RefRangeService;
|
|
21637
21693
|
}
|
|
21638
21694
|
});
|
|
21639
|
-
Object.defineProperty(exports,
|
|
21695
|
+
Object.defineProperty(exports, "RefSelectionsService", {
|
|
21640
21696
|
enumerable: true,
|
|
21641
21697
|
get: function () {
|
|
21642
21698
|
return RefSelectionsService;
|
|
@@ -21728,6 +21784,8 @@ exports.SetTextRotationCommand = SetTextRotationCommand;
|
|
|
21728
21784
|
exports.SetTextWrapCommand = SetTextWrapCommand;
|
|
21729
21785
|
exports.SetUnderlineCommand = SetUnderlineCommand;
|
|
21730
21786
|
exports.SetVerticalTextAlignCommand = SetVerticalTextAlignCommand;
|
|
21787
|
+
exports.SetWorkbookCalculationSettingsCommand = SetWorkbookCalculationSettingsCommand;
|
|
21788
|
+
exports.SetWorkbookCalculationSettingsMutation = SetWorkbookCalculationSettingsMutation;
|
|
21731
21789
|
exports.SetWorkbookNameCommand = SetWorkbookNameCommand;
|
|
21732
21790
|
exports.SetWorkbookNameMutation = SetWorkbookNameMutation;
|
|
21733
21791
|
exports.SetWorksheetActivateCommand = SetWorksheetActivateCommand;
|
|
@@ -21768,57 +21826,57 @@ exports.SetWorksheetRowIsAutoHeightMutationFactory = SetWorksheetRowIsAutoHeight
|
|
|
21768
21826
|
exports.SetWorksheetShowCommand = SetWorksheetShowCommand;
|
|
21769
21827
|
exports.SheetCopyDownCommand = SheetCopyDownCommand;
|
|
21770
21828
|
exports.SheetCopyRightCommand = SheetCopyRightCommand;
|
|
21771
|
-
Object.defineProperty(exports,
|
|
21829
|
+
Object.defineProperty(exports, "SheetInterceptorService", {
|
|
21772
21830
|
enumerable: true,
|
|
21773
21831
|
get: function () {
|
|
21774
21832
|
return SheetInterceptorService;
|
|
21775
21833
|
}
|
|
21776
21834
|
});
|
|
21777
|
-
Object.defineProperty(exports,
|
|
21835
|
+
Object.defineProperty(exports, "SheetLazyExecuteScheduleService", {
|
|
21778
21836
|
enumerable: true,
|
|
21779
21837
|
get: function () {
|
|
21780
21838
|
return SheetLazyExecuteScheduleService;
|
|
21781
21839
|
}
|
|
21782
21840
|
});
|
|
21783
|
-
Object.defineProperty(exports,
|
|
21841
|
+
Object.defineProperty(exports, "SheetPermissionCheckController", {
|
|
21784
21842
|
enumerable: true,
|
|
21785
21843
|
get: function () {
|
|
21786
21844
|
return SheetPermissionCheckController;
|
|
21787
21845
|
}
|
|
21788
21846
|
});
|
|
21789
|
-
Object.defineProperty(exports,
|
|
21847
|
+
Object.defineProperty(exports, "SheetPermissionInitController", {
|
|
21790
21848
|
enumerable: true,
|
|
21791
21849
|
get: function () {
|
|
21792
21850
|
return SheetPermissionInitController;
|
|
21793
21851
|
}
|
|
21794
21852
|
});
|
|
21795
|
-
Object.defineProperty(exports,
|
|
21853
|
+
Object.defineProperty(exports, "SheetRangeThemeModel", {
|
|
21796
21854
|
enumerable: true,
|
|
21797
21855
|
get: function () {
|
|
21798
21856
|
return SheetRangeThemeModel;
|
|
21799
21857
|
}
|
|
21800
21858
|
});
|
|
21801
|
-
Object.defineProperty(exports,
|
|
21859
|
+
Object.defineProperty(exports, "SheetRangeThemeService", {
|
|
21802
21860
|
enumerable: true,
|
|
21803
21861
|
get: function () {
|
|
21804
21862
|
return SheetRangeThemeService;
|
|
21805
21863
|
}
|
|
21806
21864
|
});
|
|
21807
21865
|
exports.SheetSkeletonChangeType = SheetSkeletonChangeType;
|
|
21808
|
-
Object.defineProperty(exports,
|
|
21866
|
+
Object.defineProperty(exports, "SheetSkeletonService", {
|
|
21809
21867
|
enumerable: true,
|
|
21810
21868
|
get: function () {
|
|
21811
21869
|
return SheetSkeletonService;
|
|
21812
21870
|
}
|
|
21813
21871
|
});
|
|
21814
21872
|
exports.SheetValueChangeType = SheetValueChangeType;
|
|
21815
|
-
Object.defineProperty(exports,
|
|
21873
|
+
Object.defineProperty(exports, "SheetsFreezeSyncController", {
|
|
21816
21874
|
enumerable: true,
|
|
21817
21875
|
get: function () {
|
|
21818
21876
|
return SheetsFreezeSyncController;
|
|
21819
21877
|
}
|
|
21820
21878
|
});
|
|
21821
|
-
Object.defineProperty(exports,
|
|
21879
|
+
Object.defineProperty(exports, "SheetsSelectionsService", {
|
|
21822
21880
|
enumerable: true,
|
|
21823
21881
|
get: function () {
|
|
21824
21882
|
return SheetsSelectionsService;
|
|
@@ -21830,7 +21888,7 @@ exports.TextToNumberCommand = TextToNumberCommand;
|
|
|
21830
21888
|
exports.ToggleCellCheckboxCommand = ToggleCellCheckboxCommand;
|
|
21831
21889
|
exports.ToggleGridlinesCommand = ToggleGridlinesCommand;
|
|
21832
21890
|
exports.ToggleGridlinesMutation = ToggleGridlinesMutation;
|
|
21833
|
-
Object.defineProperty(exports,
|
|
21891
|
+
Object.defineProperty(exports, "UniverSheetsPlugin", {
|
|
21834
21892
|
enumerable: true,
|
|
21835
21893
|
get: function () {
|
|
21836
21894
|
return UniverSheetsPlugin;
|
|
@@ -21856,7 +21914,7 @@ exports.WorkbookInsertColumnPermission = WorkbookInsertColumnPermission;
|
|
|
21856
21914
|
exports.WorkbookInsertRowPermission = WorkbookInsertRowPermission;
|
|
21857
21915
|
exports.WorkbookManageCollaboratorPermission = WorkbookManageCollaboratorPermission;
|
|
21858
21916
|
exports.WorkbookMoveSheetPermission = WorkbookMoveSheetPermission;
|
|
21859
|
-
Object.defineProperty(exports,
|
|
21917
|
+
Object.defineProperty(exports, "WorkbookPermissionService", {
|
|
21860
21918
|
enumerable: true,
|
|
21861
21919
|
get: function () {
|
|
21862
21920
|
return WorkbookPermissionService;
|
|
@@ -21880,7 +21938,7 @@ exports.WorksheetInsertColumnPermission = WorksheetInsertColumnPermission;
|
|
|
21880
21938
|
exports.WorksheetInsertHyperlinkPermission = WorksheetInsertHyperlinkPermission;
|
|
21881
21939
|
exports.WorksheetInsertRowPermission = WorksheetInsertRowPermission;
|
|
21882
21940
|
exports.WorksheetManageCollaboratorPermission = WorksheetManageCollaboratorPermission;
|
|
21883
|
-
Object.defineProperty(exports,
|
|
21941
|
+
Object.defineProperty(exports, "WorksheetPermissionService", {
|
|
21884
21942
|
enumerable: true,
|
|
21885
21943
|
get: function () {
|
|
21886
21944
|
return WorksheetPermissionService;
|
|
@@ -21897,7 +21955,7 @@ exports.WorksheetSetColumnStylePermission = WorksheetSetColumnStylePermission;
|
|
|
21897
21955
|
exports.WorksheetSetRowStylePermission = WorksheetSetRowStylePermission;
|
|
21898
21956
|
exports.WorksheetSortPermission = WorksheetSortPermission;
|
|
21899
21957
|
exports.WorksheetViewPermission = WorksheetViewPermission;
|
|
21900
|
-
Object.defineProperty(exports,
|
|
21958
|
+
Object.defineProperty(exports, "ZebraCrossingCacheController", {
|
|
21901
21959
|
enumerable: true,
|
|
21902
21960
|
get: function () {
|
|
21903
21961
|
return ZebraCrossingCacheController;
|