@univerjs/sheets 1.0.3 → 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 +148 -62
- package/lib/es/facade.js +76 -36
- package/lib/es/index.js +123 -39
- package/lib/facade.js +76 -36
- package/lib/index.js +123 -39
- package/lib/types/commands/commands/set-style.command.d.ts +2 -2
- package/lib/types/commands/commands/set-workbook-calculation-settings.command.d.ts +18 -0
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +3 -1
- 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/controllers/calculate-result-apply.controller.d.ts +1 -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/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);
|
|
@@ -1649,7 +1649,7 @@ const MoveRangeMutation = {
|
|
|
1649
1649
|
handler: (accessor, params) => {
|
|
1650
1650
|
const { from, to } = params;
|
|
1651
1651
|
if (!from || !to) return false;
|
|
1652
|
-
const workbook = accessor.get(_univerjs_core.IUniverInstanceService).
|
|
1652
|
+
const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getUnit(params.unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
1653
1653
|
if (!workbook) return false;
|
|
1654
1654
|
const fromWorksheet = workbook.getSheetBySheetId(params.from.subUnitId);
|
|
1655
1655
|
const toWorksheet = workbook.getSheetBySheetId(params.to.subUnitId);
|
|
@@ -2320,7 +2320,9 @@ function prepareSetRangeValuesMutation(cells, styles, params) {
|
|
|
2320
2320
|
const before = new _univerjs_core.ObjectMatrix();
|
|
2321
2321
|
const after = new _univerjs_core.ObjectMatrix();
|
|
2322
2322
|
new _univerjs_core.ObjectMatrix(_univerjs_core.Tools.deepClone(params.cellValue)).forValue((row, column, value) => {
|
|
2323
|
+
var _params$sourceFormula;
|
|
2323
2324
|
const original = _univerjs_core.Tools.deepClone(cells.getValue(row, column) ?? null);
|
|
2325
|
+
if (isStaleFormulaResult(original, (_params$sourceFormula = params.sourceFormulaData) === null || _params$sourceFormula === void 0 || (_params$sourceFormula = _params$sourceFormula[row]) === null || _params$sourceFormula === void 0 ? void 0 : _params$sourceFormula[column])) return;
|
|
2324
2326
|
before.setValue(row, column, original);
|
|
2325
2327
|
const next = value ? mergeCellData(value, _univerjs_core.Tools.deepClone(original ?? {}), detachedStyles, !!params.isOverrideStyle) : null;
|
|
2326
2328
|
after.setValue(row, column, next && !_univerjs_core.Tools.isEmptyObject(next) ? next : null);
|
|
@@ -2370,7 +2372,7 @@ const SetRangeValuesMutation = {
|
|
|
2370
2372
|
id: "sheet.mutation.set-range-values",
|
|
2371
2373
|
type: _univerjs_core.CommandType.MUTATION,
|
|
2372
2374
|
handler: (accessor, params) => {
|
|
2373
|
-
const { cellValue, subUnitId, unitId, isOverrideStyle } = params;
|
|
2375
|
+
const { cellValue, subUnitId, unitId, isOverrideStyle, sourceFormulaData } = params;
|
|
2374
2376
|
const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getUnit(unitId);
|
|
2375
2377
|
if (!workbook) return false;
|
|
2376
2378
|
const worksheet = workbook.getSheetBySheetId(subUnitId);
|
|
@@ -2378,6 +2380,8 @@ const SetRangeValuesMutation = {
|
|
|
2378
2380
|
const cellMatrix = worksheet.getCellMatrix();
|
|
2379
2381
|
const styles = workbook.getStyles();
|
|
2380
2382
|
new _univerjs_core.ObjectMatrix(cellValue).forValue((row, col, newVal) => {
|
|
2383
|
+
var _sourceFormulaData$ro;
|
|
2384
|
+
if (isStaleFormulaResult(cellMatrix.getValue(row, col), sourceFormulaData === null || sourceFormulaData === void 0 || (_sourceFormulaData$ro = sourceFormulaData[row]) === null || _sourceFormulaData$ro === void 0 ? void 0 : _sourceFormulaData$ro[col])) return;
|
|
2381
2385
|
if (!newVal) cellMatrix.realDeleteValue(row, col);
|
|
2382
2386
|
else {
|
|
2383
2387
|
let oldVal = cellMatrix.getValue(row, col) || {};
|
|
@@ -2389,6 +2393,9 @@ const SetRangeValuesMutation = {
|
|
|
2389
2393
|
return true;
|
|
2390
2394
|
}
|
|
2391
2395
|
};
|
|
2396
|
+
function isStaleFormulaResult(cell, source) {
|
|
2397
|
+
return source != null && (source.f !== ((cell === null || cell === void 0 ? void 0 : cell.f) ?? "") || source.si !== ((cell === null || cell === void 0 ? void 0 : cell.si) ?? void 0));
|
|
2398
|
+
}
|
|
2392
2399
|
const overwriteCellPropertiesSet = /* @__PURE__ */ new Set([
|
|
2393
2400
|
"f",
|
|
2394
2401
|
"p",
|
|
@@ -10349,6 +10356,27 @@ const AFFECT_LAYOUT_STYLES = [
|
|
|
10349
10356
|
"tr",
|
|
10350
10357
|
"tb"
|
|
10351
10358
|
];
|
|
10359
|
+
function createStyleCellValue(worksheet, ranges, style) {
|
|
10360
|
+
const cellValue = new _univerjs_core.ObjectMatrix();
|
|
10361
|
+
const iterator = createRangeIteratorWithSkipFilteredRows(worksheet);
|
|
10362
|
+
if (_univerjs_core.Tools.isArray(style.value)) for (let i = 0; i < ranges.length; i++) iterator.forOperableEach(ranges[i], (r, c, range) => {
|
|
10363
|
+
cellValue.setValue(r, c, { s: { [style.type]: style.value[r - range.startRow][c - range.startColumn] } });
|
|
10364
|
+
});
|
|
10365
|
+
else {
|
|
10366
|
+
const styleObj = { s: { [style.type]: style.value } };
|
|
10367
|
+
for (let i = 0; i < ranges.length; i++) iterator.forOperableEach(ranges[i], (r, c) => cellValue.setValue(r, c, styleObj));
|
|
10368
|
+
}
|
|
10369
|
+
if (style.type === "tb" || style.type === "stf") cellValue.forValue((row, column, cell) => {
|
|
10370
|
+
var _worksheet$getCompose;
|
|
10371
|
+
const cellStyle = cell.s;
|
|
10372
|
+
if (cellStyle.tb === _univerjs_core.WrapStrategy.WRAP) cellStyle.stf = _univerjs_core.BooleanNumber.FALSE;
|
|
10373
|
+
else if (cellStyle.stf === _univerjs_core.BooleanNumber.TRUE && ((_worksheet$getCompose = worksheet.getComposedCellStyle(row, column)) === null || _worksheet$getCompose === void 0 ? void 0 : _worksheet$getCompose.tb) === _univerjs_core.WrapStrategy.WRAP) cellValue.setValue(row, column, { s: {
|
|
10374
|
+
...cellStyle,
|
|
10375
|
+
tb: _univerjs_core.WrapStrategy.UNSPECIFIED
|
|
10376
|
+
} });
|
|
10377
|
+
});
|
|
10378
|
+
return cellValue;
|
|
10379
|
+
}
|
|
10352
10380
|
/**
|
|
10353
10381
|
* The command to set cell style.
|
|
10354
10382
|
* Set style to a bunch of ranges.
|
|
@@ -10368,19 +10396,10 @@ const SetStyleCommand = {
|
|
|
10368
10396
|
const selectionManagerService = accessor.get(SheetsSelectionsService);
|
|
10369
10397
|
const ranges = range ? [range] : (_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range);
|
|
10370
10398
|
if (!(ranges === null || ranges === void 0 ? void 0 : ranges.length)) return false;
|
|
10371
|
-
const cellValue = new _univerjs_core.ObjectMatrix();
|
|
10372
|
-
const iterator = createRangeIteratorWithSkipFilteredRows(worksheet);
|
|
10373
|
-
if (_univerjs_core.Tools.isArray(style.value)) for (let i = 0; i < ranges.length; i++) iterator.forOperableEach(ranges[i], (r, c, range) => {
|
|
10374
|
-
cellValue.setValue(r, c, { s: { [style.type]: style.value[r - range.startRow][c - range.startColumn] } });
|
|
10375
|
-
});
|
|
10376
|
-
else for (let i = 0; i < ranges.length; i++) {
|
|
10377
|
-
const styleObj = { s: { [style.type]: style.value } };
|
|
10378
|
-
iterator.forOperableEach(ranges[i], (r, c) => cellValue.setValue(r, c, styleObj));
|
|
10379
|
-
}
|
|
10380
10399
|
const setRangeValuesMutationParams = {
|
|
10381
10400
|
subUnitId,
|
|
10382
10401
|
unitId,
|
|
10383
|
-
cellValue:
|
|
10402
|
+
cellValue: createStyleCellValue(worksheet, ranges, style).getMatrix()
|
|
10384
10403
|
};
|
|
10385
10404
|
const skeleton = accessor.get(SheetSkeletonService).getSkeleton(unitId, subUnitId);
|
|
10386
10405
|
const undoSetRangeValuesMutationParams = SetRangeValuesUndoMutationFactory(accessor, setRangeValuesMutationParams);
|
|
@@ -14702,6 +14721,72 @@ const SetTabColorCommand = {
|
|
|
14702
14721
|
}
|
|
14703
14722
|
};
|
|
14704
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
|
+
|
|
14705
14790
|
//#endregion
|
|
14706
14791
|
//#region src/commands/mutations/set-workbook-name.mutation.ts
|
|
14707
14792
|
const SetWorkbookNameMutation = {
|
|
@@ -15575,21 +15660,6 @@ var WorkbookDuplicatePermission = class {
|
|
|
15575
15660
|
}
|
|
15576
15661
|
};
|
|
15577
15662
|
|
|
15578
|
-
//#endregion
|
|
15579
|
-
//#region src/services/permission/permission-point/workbook/editable.ts
|
|
15580
|
-
var WorkbookEditablePermission = class {
|
|
15581
|
-
constructor(unitId) {
|
|
15582
|
-
this.unitId = unitId;
|
|
15583
|
-
_defineProperty(this, "id", void 0);
|
|
15584
|
-
_defineProperty(this, "value", true);
|
|
15585
|
-
_defineProperty(this, "type", _univerjs_protocol.UnitObject.Workbook);
|
|
15586
|
-
_defineProperty(this, "status", _univerjs_core.PermissionStatus.INIT);
|
|
15587
|
-
_defineProperty(this, "subType", _univerjs_protocol.UnitAction.Edit);
|
|
15588
|
-
this.unitId = unitId;
|
|
15589
|
-
this.id = `${this.type}.${_univerjs_protocol.UnitAction.Edit}_${unitId}`;
|
|
15590
|
-
}
|
|
15591
|
-
};
|
|
15592
|
-
|
|
15593
15663
|
//#endregion
|
|
15594
15664
|
//#region src/services/permission/permission-point/workbook/export.ts
|
|
15595
15665
|
var WorkbookExportPermission = class {
|
|
@@ -17808,7 +17878,7 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17808
17878
|
_initialize() {
|
|
17809
17879
|
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
17810
17880
|
if (command.id !== _univerjs_engine_formula.SetFormulaCalculationResultMutation.id) return;
|
|
17811
|
-
const { unitData } = command.params;
|
|
17881
|
+
const { unitData, sourceFormulaData } = command.params;
|
|
17812
17882
|
const unitIds = Object.keys(unitData);
|
|
17813
17883
|
const redoMutationsInfo = [];
|
|
17814
17884
|
for (let i = 0; i < unitIds.length; i++) {
|
|
@@ -17819,6 +17889,7 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17819
17889
|
if (sheetData == null) continue;
|
|
17820
17890
|
const sheetIds = Object.keys(sheetData);
|
|
17821
17891
|
for (let j = 0; j < sheetIds.length; j++) {
|
|
17892
|
+
var _sourceFormulaData$un;
|
|
17822
17893
|
const sheetId = sheetIds[j];
|
|
17823
17894
|
const cellData = sheetData[sheetId];
|
|
17824
17895
|
if (cellData == null) continue;
|
|
@@ -17826,7 +17897,8 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17826
17897
|
const setRangeValuesMutation = {
|
|
17827
17898
|
subUnitId: sheetId,
|
|
17828
17899
|
unitId,
|
|
17829
|
-
cellValue: this._getMergedCellData(unitId, sheetId, cellData)
|
|
17900
|
+
cellValue: this._getMergedCellData(unitId, sheetId, cellData, sourceFormulaData),
|
|
17901
|
+
sourceFormulaData: sourceFormulaData === null || sourceFormulaData === void 0 || (_sourceFormulaData$un = sourceFormulaData[unitId]) === null || _sourceFormulaData$un === void 0 ? void 0 : _sourceFormulaData$un[sheetId]
|
|
17830
17902
|
};
|
|
17831
17903
|
redoMutationsInfo.push({
|
|
17832
17904
|
id: SetRangeValuesMutation.id,
|
|
@@ -17846,16 +17918,23 @@ let CalculateResultApplyController = class CalculateResultApplyController extend
|
|
|
17846
17918
|
* @param unitId
|
|
17847
17919
|
* @param sheetId
|
|
17848
17920
|
* @param cellData
|
|
17921
|
+
* @param sourceFormulaData Formula identities captured before scalar evaluation.
|
|
17849
17922
|
* @returns Calculated cell data merged with number formats.
|
|
17850
17923
|
*/
|
|
17851
|
-
_getMergedCellData(unitId, sheetId, cellData) {
|
|
17924
|
+
_getMergedCellData(unitId, sheetId, cellData, sourceFormulaData) {
|
|
17852
17925
|
const workbook = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
17853
17926
|
const styles = workbook === null || workbook === void 0 ? void 0 : workbook.getStyles();
|
|
17854
17927
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(sheetId);
|
|
17855
17928
|
const oldCellDataMatrix = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellMatrix();
|
|
17856
17929
|
const cellDataMatrix = new _univerjs_core.ObjectMatrix(cellData);
|
|
17857
17930
|
cellDataMatrix.forValue((row, col, cell) => {
|
|
17931
|
+
var _sourceFormulaData$un2;
|
|
17858
17932
|
const oldCell = oldCellDataMatrix === null || oldCellDataMatrix === void 0 ? void 0 : oldCellDataMatrix.getValue(row, col);
|
|
17933
|
+
const sourceFormula = sourceFormulaData === null || sourceFormulaData === void 0 || (_sourceFormulaData$un2 = sourceFormulaData[unitId]) === null || _sourceFormulaData$un2 === void 0 || (_sourceFormulaData$un2 = _sourceFormulaData$un2[sheetId]) === null || _sourceFormulaData$un2 === void 0 || (_sourceFormulaData$un2 = _sourceFormulaData$un2[row]) === null || _sourceFormulaData$un2 === void 0 ? void 0 : _sourceFormulaData$un2[col];
|
|
17934
|
+
if (sourceFormula != null && (sourceFormula.f !== ((oldCell === null || oldCell === void 0 ? void 0 : oldCell.f) ?? "") || sourceFormula.si !== ((oldCell === null || oldCell === void 0 ? void 0 : oldCell.si) ?? void 0))) {
|
|
17935
|
+
cellDataMatrix.realDeleteValue(row, col);
|
|
17936
|
+
return;
|
|
17937
|
+
}
|
|
17859
17938
|
const newCell = (0, _univerjs_engine_formula.handleNumfmtInCell)(oldCell, cell, styles);
|
|
17860
17939
|
cellDataMatrix.setValue(row, col, newCell);
|
|
17861
17940
|
});
|
|
@@ -19491,7 +19570,7 @@ RangeProtectionCache = __decorate([
|
|
|
19491
19570
|
//#endregion
|
|
19492
19571
|
//#region package.json
|
|
19493
19572
|
var name = "@univerjs/sheets";
|
|
19494
|
-
var version = "1.0
|
|
19573
|
+
var version = "1.1.0";
|
|
19495
19574
|
|
|
19496
19575
|
//#endregion
|
|
19497
19576
|
//#region src/controllers/active-worksheet.controller.ts
|
|
@@ -19621,6 +19700,7 @@ let BasicWorksheetController = class BasicWorksheetController extends _univerjs_
|
|
|
19621
19700
|
RemoveWorksheetMergeMutation,
|
|
19622
19701
|
RemoveNumfmtMutation,
|
|
19623
19702
|
AddWorksheetMergeMutation,
|
|
19703
|
+
SetWorkbookCalculationSettingsMutation,
|
|
19624
19704
|
SetWorkbookNameMutation,
|
|
19625
19705
|
SetWorksheetNameMutation,
|
|
19626
19706
|
SetNumfmtMutation,
|
|
@@ -19714,6 +19794,7 @@ let BasicWorksheetController = class BasicWorksheetController extends _univerjs_
|
|
|
19714
19794
|
SetTextRotationCommand,
|
|
19715
19795
|
SetTextWrapCommand,
|
|
19716
19796
|
SetVerticalTextAlignCommand,
|
|
19797
|
+
SetWorkbookCalculationSettingsCommand,
|
|
19717
19798
|
SetWorkbookNameCommand,
|
|
19718
19799
|
SetWorksheetActivateCommand,
|
|
19719
19800
|
SetWorksheetActiveOperation,
|
|
@@ -20838,6 +20919,9 @@ let UniverSheetsPlugin = class UniverSheetsPlugin extends _univerjs_core.Plugin
|
|
|
20838
20919
|
}
|
|
20839
20920
|
_initConfig() {
|
|
20840
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);
|
|
20841
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);
|
|
20842
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);
|
|
20843
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);
|
|
@@ -21460,14 +21544,14 @@ exports.AddWorksheetProtectionMutation = AddWorksheetProtectionMutation;
|
|
|
21460
21544
|
exports.AppendRowCommand = AppendRowCommand;
|
|
21461
21545
|
exports.AutoClearContentCommand = AutoClearContentCommand;
|
|
21462
21546
|
exports.AutoFillCommand = AutoFillCommand;
|
|
21463
|
-
Object.defineProperty(exports,
|
|
21547
|
+
Object.defineProperty(exports, "AutoFillController", {
|
|
21464
21548
|
enumerable: true,
|
|
21465
21549
|
get: function () {
|
|
21466
21550
|
return AutoFillController;
|
|
21467
21551
|
}
|
|
21468
21552
|
});
|
|
21469
21553
|
exports.AutoFillRules = AutoFillRules;
|
|
21470
|
-
Object.defineProperty(exports,
|
|
21554
|
+
Object.defineProperty(exports, "AutoFillService", {
|
|
21471
21555
|
enumerable: true,
|
|
21472
21556
|
get: function () {
|
|
21473
21557
|
return AutoFillService;
|
|
@@ -21478,7 +21562,7 @@ exports.BEFORE_CELL_EDIT = BEFORE_CELL_EDIT;
|
|
|
21478
21562
|
exports.BorderStyleManagerService = BorderStyleManagerService;
|
|
21479
21563
|
exports.COMMAND_LISTENER_SKELETON_CHANGE = COMMAND_LISTENER_SKELETON_CHANGE;
|
|
21480
21564
|
exports.COMMAND_LISTENER_VALUE_CHANGE = COMMAND_LISTENER_VALUE_CHANGE;
|
|
21481
|
-
Object.defineProperty(exports,
|
|
21565
|
+
Object.defineProperty(exports, "CalculateResultApplyController", {
|
|
21482
21566
|
enumerable: true,
|
|
21483
21567
|
get: function () {
|
|
21484
21568
|
return CalculateResultApplyController;
|
|
@@ -21492,7 +21576,7 @@ exports.ClearSelectionFormatCommand = ClearSelectionFormatCommand;
|
|
|
21492
21576
|
exports.CopySheetCommand = CopySheetCommand;
|
|
21493
21577
|
exports.CopyWorksheetEndMutation = CopyWorksheetEndMutation;
|
|
21494
21578
|
exports.DISABLE_NORMAL_SELECTIONS = DISABLE_NORMAL_SELECTIONS;
|
|
21495
|
-
Object.defineProperty(exports,
|
|
21579
|
+
Object.defineProperty(exports, "DefinedNameDataController", {
|
|
21496
21580
|
enumerable: true,
|
|
21497
21581
|
get: function () {
|
|
21498
21582
|
return DefinedNameDataController;
|
|
@@ -21548,7 +21632,7 @@ exports.MAX_CELL_PER_SHEET_KEY = MAX_CELL_PER_SHEET_KEY;
|
|
|
21548
21632
|
exports.MERGE_CELL_INTERCEPTOR_CHECK = MERGE_CELL_INTERCEPTOR_CHECK;
|
|
21549
21633
|
exports.MarkDirtyFilterChangeMutation = MarkDirtyFilterChangeMutation;
|
|
21550
21634
|
exports.MarkDirtyRowAutoHeightOperation = MarkDirtyRowAutoHeightOperation;
|
|
21551
|
-
Object.defineProperty(exports,
|
|
21635
|
+
Object.defineProperty(exports, "MergeCellController", {
|
|
21552
21636
|
enumerable: true,
|
|
21553
21637
|
get: function () {
|
|
21554
21638
|
return MergeCellController;
|
|
@@ -21562,7 +21646,7 @@ exports.MoveRangeMutation = MoveRangeMutation;
|
|
|
21562
21646
|
exports.MoveRowsCommand = MoveRowsCommand;
|
|
21563
21647
|
exports.MoveRowsMutation = MoveRowsMutation;
|
|
21564
21648
|
exports.MoveRowsMutationUndoFactory = MoveRowsMutationUndoFactory;
|
|
21565
|
-
Object.defineProperty(exports,
|
|
21649
|
+
Object.defineProperty(exports, "NumfmtService", {
|
|
21566
21650
|
enumerable: true,
|
|
21567
21651
|
get: function () {
|
|
21568
21652
|
return NumfmtService;
|
|
@@ -21572,7 +21656,7 @@ exports.OperatorType = OperatorType;
|
|
|
21572
21656
|
exports.PermissionPointsDefinitions = PermissionPointsDefinitions;
|
|
21573
21657
|
exports.REF_SELECTIONS_ENABLED = REF_SELECTIONS_ENABLED;
|
|
21574
21658
|
exports.RangeMergeUtil = RangeMergeUtil;
|
|
21575
|
-
Object.defineProperty(exports,
|
|
21659
|
+
Object.defineProperty(exports, "RangeProtectionCache", {
|
|
21576
21660
|
enumerable: true,
|
|
21577
21661
|
get: function () {
|
|
21578
21662
|
return RangeProtectionCache;
|
|
@@ -21582,33 +21666,33 @@ exports.RangeProtectionPermissionDeleteProtectionPoint = RangeProtectionPermissi
|
|
|
21582
21666
|
exports.RangeProtectionPermissionEditPoint = RangeProtectionPermissionEditPoint;
|
|
21583
21667
|
exports.RangeProtectionPermissionManageCollaPoint = RangeProtectionPermissionManageCollaPoint;
|
|
21584
21668
|
exports.RangeProtectionPermissionViewPoint = RangeProtectionPermissionViewPoint;
|
|
21585
|
-
Object.defineProperty(exports,
|
|
21669
|
+
Object.defineProperty(exports, "RangeProtectionRefRangeService", {
|
|
21586
21670
|
enumerable: true,
|
|
21587
21671
|
get: function () {
|
|
21588
21672
|
return RangeProtectionRefRangeService;
|
|
21589
21673
|
}
|
|
21590
21674
|
});
|
|
21591
|
-
Object.defineProperty(exports,
|
|
21675
|
+
Object.defineProperty(exports, "RangeProtectionRenderModel", {
|
|
21592
21676
|
enumerable: true,
|
|
21593
21677
|
get: function () {
|
|
21594
21678
|
return RangeProtectionRenderModel;
|
|
21595
21679
|
}
|
|
21596
21680
|
});
|
|
21597
21681
|
exports.RangeProtectionRuleModel = RangeProtectionRuleModel;
|
|
21598
|
-
Object.defineProperty(exports,
|
|
21682
|
+
Object.defineProperty(exports, "RangeProtectionService", {
|
|
21599
21683
|
enumerable: true,
|
|
21600
21684
|
get: function () {
|
|
21601
21685
|
return RangeProtectionService;
|
|
21602
21686
|
}
|
|
21603
21687
|
});
|
|
21604
21688
|
exports.RangeThemeStyle = RangeThemeStyle;
|
|
21605
|
-
Object.defineProperty(exports,
|
|
21689
|
+
Object.defineProperty(exports, "RefRangeService", {
|
|
21606
21690
|
enumerable: true,
|
|
21607
21691
|
get: function () {
|
|
21608
21692
|
return RefRangeService;
|
|
21609
21693
|
}
|
|
21610
21694
|
});
|
|
21611
|
-
Object.defineProperty(exports,
|
|
21695
|
+
Object.defineProperty(exports, "RefSelectionsService", {
|
|
21612
21696
|
enumerable: true,
|
|
21613
21697
|
get: function () {
|
|
21614
21698
|
return RefSelectionsService;
|
|
@@ -21700,6 +21784,8 @@ exports.SetTextRotationCommand = SetTextRotationCommand;
|
|
|
21700
21784
|
exports.SetTextWrapCommand = SetTextWrapCommand;
|
|
21701
21785
|
exports.SetUnderlineCommand = SetUnderlineCommand;
|
|
21702
21786
|
exports.SetVerticalTextAlignCommand = SetVerticalTextAlignCommand;
|
|
21787
|
+
exports.SetWorkbookCalculationSettingsCommand = SetWorkbookCalculationSettingsCommand;
|
|
21788
|
+
exports.SetWorkbookCalculationSettingsMutation = SetWorkbookCalculationSettingsMutation;
|
|
21703
21789
|
exports.SetWorkbookNameCommand = SetWorkbookNameCommand;
|
|
21704
21790
|
exports.SetWorkbookNameMutation = SetWorkbookNameMutation;
|
|
21705
21791
|
exports.SetWorksheetActivateCommand = SetWorksheetActivateCommand;
|
|
@@ -21740,57 +21826,57 @@ exports.SetWorksheetRowIsAutoHeightMutationFactory = SetWorksheetRowIsAutoHeight
|
|
|
21740
21826
|
exports.SetWorksheetShowCommand = SetWorksheetShowCommand;
|
|
21741
21827
|
exports.SheetCopyDownCommand = SheetCopyDownCommand;
|
|
21742
21828
|
exports.SheetCopyRightCommand = SheetCopyRightCommand;
|
|
21743
|
-
Object.defineProperty(exports,
|
|
21829
|
+
Object.defineProperty(exports, "SheetInterceptorService", {
|
|
21744
21830
|
enumerable: true,
|
|
21745
21831
|
get: function () {
|
|
21746
21832
|
return SheetInterceptorService;
|
|
21747
21833
|
}
|
|
21748
21834
|
});
|
|
21749
|
-
Object.defineProperty(exports,
|
|
21835
|
+
Object.defineProperty(exports, "SheetLazyExecuteScheduleService", {
|
|
21750
21836
|
enumerable: true,
|
|
21751
21837
|
get: function () {
|
|
21752
21838
|
return SheetLazyExecuteScheduleService;
|
|
21753
21839
|
}
|
|
21754
21840
|
});
|
|
21755
|
-
Object.defineProperty(exports,
|
|
21841
|
+
Object.defineProperty(exports, "SheetPermissionCheckController", {
|
|
21756
21842
|
enumerable: true,
|
|
21757
21843
|
get: function () {
|
|
21758
21844
|
return SheetPermissionCheckController;
|
|
21759
21845
|
}
|
|
21760
21846
|
});
|
|
21761
|
-
Object.defineProperty(exports,
|
|
21847
|
+
Object.defineProperty(exports, "SheetPermissionInitController", {
|
|
21762
21848
|
enumerable: true,
|
|
21763
21849
|
get: function () {
|
|
21764
21850
|
return SheetPermissionInitController;
|
|
21765
21851
|
}
|
|
21766
21852
|
});
|
|
21767
|
-
Object.defineProperty(exports,
|
|
21853
|
+
Object.defineProperty(exports, "SheetRangeThemeModel", {
|
|
21768
21854
|
enumerable: true,
|
|
21769
21855
|
get: function () {
|
|
21770
21856
|
return SheetRangeThemeModel;
|
|
21771
21857
|
}
|
|
21772
21858
|
});
|
|
21773
|
-
Object.defineProperty(exports,
|
|
21859
|
+
Object.defineProperty(exports, "SheetRangeThemeService", {
|
|
21774
21860
|
enumerable: true,
|
|
21775
21861
|
get: function () {
|
|
21776
21862
|
return SheetRangeThemeService;
|
|
21777
21863
|
}
|
|
21778
21864
|
});
|
|
21779
21865
|
exports.SheetSkeletonChangeType = SheetSkeletonChangeType;
|
|
21780
|
-
Object.defineProperty(exports,
|
|
21866
|
+
Object.defineProperty(exports, "SheetSkeletonService", {
|
|
21781
21867
|
enumerable: true,
|
|
21782
21868
|
get: function () {
|
|
21783
21869
|
return SheetSkeletonService;
|
|
21784
21870
|
}
|
|
21785
21871
|
});
|
|
21786
21872
|
exports.SheetValueChangeType = SheetValueChangeType;
|
|
21787
|
-
Object.defineProperty(exports,
|
|
21873
|
+
Object.defineProperty(exports, "SheetsFreezeSyncController", {
|
|
21788
21874
|
enumerable: true,
|
|
21789
21875
|
get: function () {
|
|
21790
21876
|
return SheetsFreezeSyncController;
|
|
21791
21877
|
}
|
|
21792
21878
|
});
|
|
21793
|
-
Object.defineProperty(exports,
|
|
21879
|
+
Object.defineProperty(exports, "SheetsSelectionsService", {
|
|
21794
21880
|
enumerable: true,
|
|
21795
21881
|
get: function () {
|
|
21796
21882
|
return SheetsSelectionsService;
|
|
@@ -21802,7 +21888,7 @@ exports.TextToNumberCommand = TextToNumberCommand;
|
|
|
21802
21888
|
exports.ToggleCellCheckboxCommand = ToggleCellCheckboxCommand;
|
|
21803
21889
|
exports.ToggleGridlinesCommand = ToggleGridlinesCommand;
|
|
21804
21890
|
exports.ToggleGridlinesMutation = ToggleGridlinesMutation;
|
|
21805
|
-
Object.defineProperty(exports,
|
|
21891
|
+
Object.defineProperty(exports, "UniverSheetsPlugin", {
|
|
21806
21892
|
enumerable: true,
|
|
21807
21893
|
get: function () {
|
|
21808
21894
|
return UniverSheetsPlugin;
|
|
@@ -21828,7 +21914,7 @@ exports.WorkbookInsertColumnPermission = WorkbookInsertColumnPermission;
|
|
|
21828
21914
|
exports.WorkbookInsertRowPermission = WorkbookInsertRowPermission;
|
|
21829
21915
|
exports.WorkbookManageCollaboratorPermission = WorkbookManageCollaboratorPermission;
|
|
21830
21916
|
exports.WorkbookMoveSheetPermission = WorkbookMoveSheetPermission;
|
|
21831
|
-
Object.defineProperty(exports,
|
|
21917
|
+
Object.defineProperty(exports, "WorkbookPermissionService", {
|
|
21832
21918
|
enumerable: true,
|
|
21833
21919
|
get: function () {
|
|
21834
21920
|
return WorkbookPermissionService;
|
|
@@ -21852,7 +21938,7 @@ exports.WorksheetInsertColumnPermission = WorksheetInsertColumnPermission;
|
|
|
21852
21938
|
exports.WorksheetInsertHyperlinkPermission = WorksheetInsertHyperlinkPermission;
|
|
21853
21939
|
exports.WorksheetInsertRowPermission = WorksheetInsertRowPermission;
|
|
21854
21940
|
exports.WorksheetManageCollaboratorPermission = WorksheetManageCollaboratorPermission;
|
|
21855
|
-
Object.defineProperty(exports,
|
|
21941
|
+
Object.defineProperty(exports, "WorksheetPermissionService", {
|
|
21856
21942
|
enumerable: true,
|
|
21857
21943
|
get: function () {
|
|
21858
21944
|
return WorksheetPermissionService;
|
|
@@ -21869,7 +21955,7 @@ exports.WorksheetSetColumnStylePermission = WorksheetSetColumnStylePermission;
|
|
|
21869
21955
|
exports.WorksheetSetRowStylePermission = WorksheetSetRowStylePermission;
|
|
21870
21956
|
exports.WorksheetSortPermission = WorksheetSortPermission;
|
|
21871
21957
|
exports.WorksheetViewPermission = WorksheetViewPermission;
|
|
21872
|
-
Object.defineProperty(exports,
|
|
21958
|
+
Object.defineProperty(exports, "ZebraCrossingCacheController", {
|
|
21873
21959
|
enumerable: true,
|
|
21874
21960
|
get: function () {
|
|
21875
21961
|
return ZebraCrossingCacheController;
|