Skip to content

Commit

Permalink
[all] Develop merged
Browse files Browse the repository at this point in the history
  • Loading branch information
ansaraidarbek committed Sep 20, 2024
2 parents bf62bb3 + 74c858f commit 41820af
Show file tree
Hide file tree
Showing 190 changed files with 41,724 additions and 37,579 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/common_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14
- name: Use Node.js 20
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 20
- name: Run unit tests
run: |
npm install -g grunt-cli node-qunit-puppeteer
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14
- name: Use Node.js 20
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 20
- name: Run unit tests
run: |
npm install -g grunt-cli node-qunit-puppeteer
Expand Down
14 changes: 0 additions & 14 deletions cell/Local/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ var c_oAscError = Asc.c_oAscError;
var asc = window["Asc"];
var spreadsheet_api = asc['spreadsheet_api'];

spreadsheet_api.prototype._onNeedParams = function(data, opt_isPassword)
{
var type;
var options;
if (opt_isPassword) {
type = Asc.c_oAscAdvancedOptionsID.DRM;
} else {
type = Asc.c_oAscAdvancedOptionsID.CSV;
var cp = JSON.parse("{\"codepage\":46,\"delimiter\":1}");
cp['encodings'] = AscCommon.getEncodingParams();
options = new AscCommon.asc_CAdvancedOptions(cp);
}
this.handlers.trigger("asc_onAdvancedOptions", type, options);
};
spreadsheet_api.prototype.asc_addImageDrawingObject = function(urls, imgProp, token)
{
var ws = this.wb.getWorksheet();
Expand Down
99 changes: 79 additions & 20 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,21 +1334,29 @@ var editor;
'encodings': AscCommon.getEncodingParams()
};
if (data && typeof Blob !== 'undefined' && typeof FileReader !== 'undefined') {
AscCommon.loadFileContent(data, function(httpRequest) {
if (httpRequest && httpRequest.response) {
let data = httpRequest.response;
var dataUint = new Uint8Array(data);
var bom = AscCommon.getEncodingByBOM(dataUint);
if (AscCommon.c_oAscCodePageNone !== bom.encoding) {
cp['codepage'] = bom.encoding;
data = dataUint.subarray(bom.size);
}
cp['data'] = data;
t.handlers.trigger("asc_onAdvancedOptions", c_oAscAdvancedOptionsID.CSV, new AscCommon.asc_CAdvancedOptions(cp));
function applyBuffer(dataUint) {
var bom = AscCommon.getEncodingByBOM(dataUint);
if (AscCommon.c_oAscCodePageNone !== bom.encoding) {
cp['codepage'] = bom.encoding;
cp['data'] = dataUint.subarray(bom.size);
} else {
t.handlers.trigger("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.Critical);
cp['data'] = dataUint;
}
}, "arraybuffer");
}
if (data.buffer) {
applyBuffer(data);
t.handlers.trigger("asc_onAdvancedOptions", c_oAscAdvancedOptionsID.CSV, new AscCommon.asc_CAdvancedOptions(cp));
} else {
AscCommon.loadFileContent(data, function(httpRequest) {
if (httpRequest && httpRequest.response) {
let data = httpRequest.response;
applyBuffer(new Uint8Array(data));
t.handlers.trigger("asc_onAdvancedOptions", c_oAscAdvancedOptionsID.CSV, new AscCommon.asc_CAdvancedOptions(cp));
} else {
t.handlers.trigger("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.Critical);
}
}, "arraybuffer");
}
} else {
t.handlers.trigger("asc_onAdvancedOptions", c_oAscAdvancedOptionsID.CSV, new AscCommon.asc_CAdvancedOptions(cp));
}
Expand Down Expand Up @@ -3383,10 +3391,6 @@ var editor;
if (undefined !== window["AscDesktopEditor"]) {
window["AscDesktopEditor"]["OnSave"]();
}
if (t.disconnectOnSave) {
t.CoAuthoringApi.disconnect(t.disconnectOnSave.code, t.disconnectOnSave.reason);
t.disconnectOnSave = null;
}

if (t.canUnlockDocument) {
t._unlockDocument();
Expand Down Expand Up @@ -4517,7 +4521,7 @@ var editor;
oSmartArt.setWorksheet(oWSModel);
oSmartArt.addToDrawingObjects(undefined, AscCommon.c_oAscCellAnchorType.cellanchorTwoCell);
oSmartArt.checkDrawingBaseCoords();
oSmartArt.fitFontSize();
oSmartArt.generateDrawingPart();
oController.checkChartTextSelection();
oController.resetSelection();
oSmartArt.select(oController, 0);
Expand Down Expand Up @@ -6504,7 +6508,7 @@ var editor;
};

spreadsheet_api.prototype.getGraphicController = function () {
var ws = this.wb.getWorksheet();
var ws = this.wb && this.wb.getWorksheet();
return ws && ws.objectRender && ws.objectRender.controller;
};

Expand Down Expand Up @@ -9460,11 +9464,64 @@ var editor;
}
};

spreadsheet_api.prototype.asc_SetSmoothScrolling = function(val) {
let wb = this.wb;
if (!wb) {
return;
}
return wb.setSmoothScrolling(val);
};

spreadsheet_api.prototype.asc_GetSmoothScrolling = function() {
let wb = this.wb;
if (!wb) {
return;
}
return wb.getSmoothScrolling();
};

spreadsheet_api.prototype.getCustomProperties = function() {
let oWBModel = this.wbModel;
if(!oWBModel)
return null;
return oWBModel.CustomProperties;
};


spreadsheet_api.prototype.addCustomProperty = function(name, type, value) {
let oCustomProperties = this.getCustomProperties();
if(!oCustomProperties) return;

this.checkObjectsLock([oCustomProperties.Id], function(bNoLock) {
if(bNoLock) {
AscCommon.History.Create_NewPoint();
oCustomProperties.AddProperty(name, type, value);
}
});
};

spreadsheet_api.prototype.modifyCustomProperty = function(idx, name, type, value) {
let oCustomProperties = this.getCustomProperties();
if(!oCustomProperties) return;

this.checkObjectsLock([oCustomProperties.Id], function(bNoLock) {
if(bNoLock) {
AscCommon.History.Create_NewPoint();
oCustomProperties.ModifyProperty(idx, name, type, value);
}
});
};


spreadsheet_api.prototype.removeCustomProperty = function(idx) {
let oCustomProperties = this.getCustomProperties();
if(!oCustomProperties) return;
this.checkObjectsLock([oCustomProperties.Id], function(bNoLock) {
if(bNoLock) {
AscCommon.History.Create_NewPoint();
oCustomProperties.RemoveProperty(idx);
}
});
};
/*
* Export
* -----------------------------------------------------------------------------
Expand Down Expand Up @@ -10062,6 +10119,8 @@ var editor;
prot["asc_getOpeningDocumentsList"]= prot.asc_getOpeningDocumentsList;
prot["asc_isSupportCopySheetsBetweenBooks"]= prot.asc_isSupportCopySheetsBetweenBooks;

prot["asc_SetSmoothScrolling"]= prot.asc_SetSmoothScrolling;
prot["asc_GetSmoothScrolling"]= prot.asc_GetSmoothScrolling;



Expand Down
22 changes: 21 additions & 1 deletion cell/apiBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@
* @see office-js-api/Examples/Enumerations/PasteSpecialOperation.js
*/

/**
* Specifies how to shift cells to replace deleted cells.
* @typedef {("up" | "left")} DeleteShiftDirection
* @see office-js-api/Examples/Enumerations/DeleteShiftDirection.js
*/

/**
* Class representing a base class for the color types.
* @constructor
Expand Down Expand Up @@ -10469,7 +10475,7 @@
* Deletes the Range object.
* @memberof ApiRange
* @typeofeditors ["CSE"]
* @param {?string} shift - Specifies how to shift cells to replace the deleted cells ("up", "left").
* @param {?DeleteShiftDirection} shift - Specifies how to shift cells to replace the deleted cells.
* @see office-js-api/Examples/{Editor}/ApiRange/Methods/Delete.js
*/
ApiRange.prototype.Delete = function (shift) {
Expand Down Expand Up @@ -16999,6 +17005,7 @@
ApiWorksheetFunction.prototype["CHIDIST"] = ApiWorksheetFunction.prototype.CHIDIST;
ApiWorksheetFunction.prototype["CHIINV"] = ApiWorksheetFunction.prototype.CHIINV;
ApiWorksheetFunction.prototype["CONFIDENCE"] = ApiWorksheetFunction.prototype.CONFIDENCE;
ApiWorksheetFunction.prototype["CHITEST"] = ApiWorksheetFunction.prototype.CHITEST;
ApiWorksheetFunction.prototype["COUNT"] = ApiWorksheetFunction.prototype.COUNT;
ApiWorksheetFunction.prototype["COUNTA"] = ApiWorksheetFunction.prototype.COUNTA;
ApiWorksheetFunction.prototype["COUNTBLANK"] = ApiWorksheetFunction.prototype.COUNTBLANK;
Expand Down Expand Up @@ -17309,7 +17316,10 @@
ApiWorksheetFunction.prototype["BETA_DIST"] = ApiWorksheetFunction.prototype.BETA_DIST;
ApiWorksheetFunction.prototype["BETA_INV"] = ApiWorksheetFunction.prototype.BETA_INV;
ApiWorksheetFunction.prototype["BINOM_DIST"] = ApiWorksheetFunction.prototype.BINOM_DIST;
ApiWorksheetFunction.prototype["BINOM_DIST_RANGE"]= ApiWorksheetFunction.prototype.BINOM_DIST_RANGE;
ApiWorksheetFunction.prototype["BINOM_INV"] = ApiWorksheetFunction.prototype.BINOM_INV;
ApiWorksheetFunction.prototype["CHISQ_DIST"] = ApiWorksheetFunction.prototype.CHISQ_DIST;
ApiWorksheetFunction.prototype["CHISQ_DIST_RT"] = ApiWorksheetFunction.prototype.CHISQ_DIST_RT;
ApiWorksheetFunction.prototype["CHISQ_INV"] = ApiWorksheetFunction.prototype.CHISQ_INV;
ApiWorksheetFunction.prototype["CHISQ_INV_RT"] = ApiWorksheetFunction.prototype.CHISQ_INV_RT;
ApiWorksheetFunction.prototype["CONFIDENCE_NORM"] = ApiWorksheetFunction.prototype.CONFIDENCE_NORM;
Expand Down Expand Up @@ -17356,6 +17366,16 @@
ApiWorksheetFunction.prototype["FLOOR_MATH"] = ApiWorksheetFunction.prototype.FLOOR_MATH;
ApiWorksheetFunction.prototype["ISO_CEILING"] = ApiWorksheetFunction.prototype.ISO_CEILING;
ApiWorksheetFunction.prototype["ERROR_TYPE"] = ApiWorksheetFunction.prototype.ERROR_TYPE;
ApiWorksheetFunction.prototype["FORECAST_ETS_CONFINT"] = ApiWorksheetFunction.prototype.FORECAST_ETS_CONFINT;
ApiWorksheetFunction.prototype["FORECAST_ETS_SEASONALITY"] = ApiWorksheetFunction.prototype.FORECAST_ETS_SEASONALITY;
ApiWorksheetFunction.prototype["FORECAST_ETS_STAT"] = ApiWorksheetFunction.prototype.FORECAST_ETS_STAT;
ApiWorksheetFunction.prototype["F_DIST_RT"] = ApiWorksheetFunction.prototype.F_DIST_RT;
ApiWorksheetFunction.prototype["F_INV_RT"] = ApiWorksheetFunction.prototype.F_INV_RT;
ApiWorksheetFunction.prototype["NORM_S_DIST"] = ApiWorksheetFunction.prototype.NORM_S_DIST;
ApiWorksheetFunction.prototype["NORM_S_INV"] = ApiWorksheetFunction.prototype.NORM_S_INV;
ApiWorksheetFunction.prototype["T_DIST_2T"] = ApiWorksheetFunction.prototype.T_DIST_2T;
ApiWorksheetFunction.prototype["T_DIST_RT"] = ApiWorksheetFunction.prototype.T_DIST_RT;
ApiWorksheetFunction.prototype["T_INV_2T"] = ApiWorksheetFunction.prototype.T_INV_2T;


ApiPivotTable.prototype["AddDataField"] = ApiPivotTable.prototype.AddDataField;
Expand Down
14 changes: 14 additions & 0 deletions cell/model/DrawingObjects/Format/GroupPrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,18 @@ CGroupShape.prototype.recalculate = function()
this.worksheet.contentChanges.Refresh();
}
};
CGroupShape.prototype.checkDrawingPartWithHistory = function() {
for (let i = 0; i < this.spTree.length; i++) {
if (this.spTree[i].checkDrawingPartWithHistory) {
this.spTree[i].checkDrawingPartWithHistory();
}
}
};
CGroupShape.prototype.generateLocalDrawingPart = function() {
for (let i = 0; i < this.spTree.length; i++) {
if (this.spTree[i].generateLocalDrawingPart) {
this.spTree[i].generateLocalDrawingPart();
}
}
};
})(window);
5 changes: 5 additions & 0 deletions cell/model/DrawingObjects/Format/ShapePrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,11 @@ CShape.prototype.Get_Worksheet = function()
{
return this.worksheet;
};
CShape.prototype.checkDrawingPartWithHistory = function () {
if (this.isObjectInSmartArt()) {
return this.group.group.checkDrawingPartWithHistory(this);
}
};



Expand Down
Loading

0 comments on commit 41820af

Please sign in to comment.