This commit is contained in:
sriramphanib committed 2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 files changed
+1153349

No files matched your search

@@ -0,0 +1,698 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Common;
(function (Common) {
class Download extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.requestId = 0;
this.actionsWhileCreatingNewFile = [];
}
downloadDocumentFile(FileId, documentGroup, documnetfilename, savetype, documentContainer) {
if (documentGroup == "Word") {
this.fileCacheHelper.loadJsFile("platform/analytics/components/chartviewer/chartviewer.js", () => __awaiter(this, void 0, void 0, function* () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then((response) => {
var result = response.result;
var fileName = result.FileTitle;
var filetype = result.FileType;
documentContainer.save(fileName, savetype);
});
}));
}
else if (documentGroup == "Excel") {
let instance = document.getElementById('DocumentViewer').ej2_instances[0];
instance.saveAsJson().then((res) => {
this.dataForJson = res;
var JSONData = JSON.stringify(this.dataForJson.jsonObject.Workbook);
var sheetIndex = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().ssObj.activeSheetIndex;
this.data = {
FileId: FileId,
SaveTypeID: savetype,
SheetIndex: sheetIndex,
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(this.data).then((response) => {
this.fileCacheHelper.loadJsFile("tenants/themes/compact/components/notifications/notification.js", () => __awaiter(this, void 0, void 0, function* () {
var path = encodeURIComponent(response.result);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(path);
}));
});
});
}
}
saveDocumentFile(FileId, documentGroup, documentContainer, args, sheetBaseIns) {
return __awaiter(this, void 0, void 0, function* () {
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'inline-block';
if (document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")) {
document.getElementsByClassName("biz-ss-saveicon")[0].style.display = 'none';
document.getElementsByClassName("biz-ss-cloudloading")[0].style.display = 'inline-block';
}
if (documentGroup == "Word") {
this.data = {
Content: documentContainer.serialize(),
FileId: FileId
};
yield Unibase.Apps.Collaboration.DocumentManager.Instance().saveWord(this.data).then((response) => {
var result = response;
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().editDetails();
});
}
else if (documentGroup == "Excel") {
this.ssAutoSave(args, sheetBaseIns, true);
}
setTimeout(function () {
return __awaiter(this, void 0, void 0, function* () {
if (document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")) {
document.getElementsByClassName("biz-ss-saveicon")[0].style.display = 'inline-block';
document.getElementsByClassName("biz-ss-cloudloading")[0].style.display = 'none';
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'none';
}
});
}, 1000);
});
}
getCellWithRowAndColByRange(range, sheet) {
let idx = ej.spreadsheet.getIndexesFromAddress(range);
return { SheetIndex: this.baseIns.ssObj.biz.getSheetIndexByname(sheet.name), row: idx[0], cell: idx[1], cellInfo: this.baseIns.ssObj.biz.getCell(idx[0], idx[1], sheet) };
}
ssAutoSave(args, base, saveversion, callback) {
if (base.permissionLevel !== Unibase.Apps.Collaboration.Enums.Share.Viewer) {
this.requestId++;
let refId;
let action = args.action;
let data;
this.baseIns = base;
let indexes = base.ssObj.biz.getIndexes();
let sheet = base.ssObj.biz.getActiveSheet();
let sheetIdx = base.getSheetIndex();
let saveType = "cell";
let isCreateNewFile = false;
let changedValue = [];
let isCut = false;
console.log("Save start " + action + " " + Date());
if (args.action == "resize") {
(args.eventArgs.isCol) ? action = "colResize" : action = "rowResize";
}
;
(args.eventArgs) && (args.eventArgs.modelType) && (args.eventArgs.modelType == "Sheet" && action == "insert") && (action = "insertSheet");
(args.action == "delete") && (args.eventArgs.modelType == "Row") && (action = "deleteRow");
(args.action == "delete") && (args.eventArgs.modelType == "Column") && (action = "deleteCol");
if (args.action == "insertshiftright" || args.action == "deleteshiftleft") {
action = "shiftright&left";
}
if (args.action == "insertshiftdown" || args.action == "deleteshiftup") {
action = "shiftup&down";
}
if (args.action != "import" && args.action != "gotoSheet" && !this.baseIns.isCreatingNewFile) {
!(base.FileId) && (isCreateNewFile = true, this.baseIns.isCreatingNewFile = true, refId = Unibase.Themes.Providers.DetailHelper.recordId);
switch (action) {
case "cellSave":
indexes = this.baseIns.getIndexesFromAddress(args.eventArgs.address.split("!")[1]);
changedValue = [{ Row: indexes[0], Cell: indexes[3], CellInfo: sheet.rows[indexes[0]].cells[indexes[3]] }];
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
};
break;
case "format":
case "validation":
case "shortcuts":
case "autofill":
case "removeDuplicates":
case "trim":
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
(obj.CellInfo) && (obj.CellInfo.validation) && (obj.CellInfo.validation.inCellDropDown == null) && (obj.CellInfo.validation.inCellDropDown = false);
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
modelType: (args.eventArgs) ? args.eventArgs.modelType : null,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "insertImage":
case "deleteChart":
case "cellDelete":
case "insertChart":
case "multipleCells":
setTimeout(() => {
(action == "deleteChart") && (indexes = base.getIndexesFromAddress(args.eventArgs.range.split("!")[1]));
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
(action == "deleteChart") && (cellInfo.chart) && (cellInfo.chart.pop(cellInfo.chart.find(x => x.id = args.eventArgs.id))) && (cellInfo.chart.length == 0) && (cellInfo.chart = null);
(obj.CellInfo) && (obj.CellInfo.validation) && (obj.CellInfo.validation.inCellDropDown == null) && (obj.CellInfo.validation.inCellDropDown = false);
if (action == "insertImage") {
cellInfo.image.forEach(image => {
image.left = parseInt(image.left);
image.height = parseInt(image.height);
image.top = parseInt(image.top);
image.width = parseInt(image.width);
});
}
else if (action == "cellDelete" && cellInfo && cellInfo.image && cellInfo.image[0] && cellInfo.image.findIndex(x => x.id.startsWith("biz_image_in_cell")) !== -1) {
let index = cellInfo.image.findIndex(x => x.id.startsWith("biz_image_in_cell"));
cellInfo.image.splice(index, 1);
}
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
saveversions: saveversion,
autosavetype: saveType,
modelType: (args.eventArgs) ? args.eventArgs.modelType : null,
requestId: this.requestId,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 10);
break;
case "imageRefresh":
data = {
changedvalues: args.changedValues,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "insert":
saveType = "addRowsAndColumn";
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheet.index,
autosavetype: saveType,
modelType: args.eventArgs.modelType,
saveversions: saveversion,
requestId: this.requestId,
RowIndex: args.eventArgs.index,
InsertType: args.eventArgs.insertType,
};
break;
case "moveSheet":
saveType = "moveSheet";
data = {
FileId: base.FileId,
sheetIndex: sheet.index,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Indexes: [args.sheetIndexes.pop(), args.position],
};
break;
case "deleteRow":
saveType = "deleteRow";
data = {
Indexes: [args.eventArgs.startIndex, args.eventArgs.endIndex - args.eventArgs.startIndex + 1],
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
saveversions: saveversion,
sheetIndex: sheetIdx,
autosavetype: saveType,
requestId: this.requestId,
};
break;
case "deleteCol":
saveType = "deleteColumn";
var usedrangeindex = [];
var usedrange = this.baseIns.ssObj.getActiveSheet().usedRange;
usedrangeindex.push(usedrange.colIndex);
usedrangeindex.push(usedrange.rowIndex);
data = {
Indexes: [args.eventArgs.startIndex, args.eventArgs.endIndex - args.eventArgs.startIndex + 1],
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
RowIndex: args.eventArgs.index,
};
break;
case "shiftright&left":
saveType = "shiftright&left";
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Action: args.action,
UsedRange: usedrangeindex,
};
break;
case "shiftup&down":
setTimeout(() => {
saveType = "shiftup&down";
var usedrangeindex = [];
var usedrange = this.baseIns.ssObj.getActiveSheet().usedRange;
usedrangeindex.push(usedrange.rowIndex);
usedrangeindex.push(usedrange.colIndex);
data = {
Indexes: this.baseIns.ssObj.biz.getIndexes(),
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
Action: args.action,
UsedRange: usedrangeindex,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 0);
break;
case "headers":
saveType = "headers";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
showHeader: args.eventArgs.isShow,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "gridLines":
saveType = "gridlines";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
showGridlines: args.eventArgs.isShow,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "freezePanes":
saveType = "freezepanes";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: args.eventArgs.sheetIdx,
freezeRow: args.eventArgs.row,
freezeColumn: args.eventArgs.column,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "insertCell":
saveType = "selectedRows";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
sheetIndex: sheetIdx,
autosavetype: saveType,
rowInfo: sheet.rows[indexes[0]],
indexes: indexes,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "conditionalFormat":
saveType = "conditionalFormat";
changedValue = [{ Row: indexes[0], Cell: indexes[3], ConditionalFormat: sheet.conditionalFormats }];
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "clipboard":
if (args.eventArgs && args.eventArgs.copiedInfo && args.eventArgs.copiedInfo.isCut == true) {
isCut = true;
var cutSheetIndex = base.ssObj.biz.getSheetIndexByname(args.eventArgs.copiedRange.split("!")[0]);
var cutCellIndexes = base.swapRange(ej.spreadsheet.getIndexesFromAddress(args.eventArgs.copiedRange.split("!")[1]));
}
for (var i = indexes[0]; i <= indexes[2]; i++) {
for (var j = indexes[1]; j <= indexes[3]; j++) {
var cellInfo = ej.spreadsheet.getCell(i, j, sheet);
let obj = { Row: i, cell: j, CellInfo: cellInfo };
changedValue.push(obj);
}
}
data = {
changedvalues: changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: args.eventArgs.pasteSheetIndex,
autosavetype: saveType,
cutSheetIndex: cutSheetIndex,
cutCellIndexes: cutCellIndexes,
isCut: isCut,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "cellDrag":
data = {
changedvalues: args.changedValue,
iscreatenewfile: isCreateNewFile,
FileId: base.FileId,
sheetIndex: sheetIdx,
autosavetype: saveType,
cutSheetIndex: sheetIdx,
cutCellIndexes: args.cutCellIdxs,
isCut: true,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "newspreadsheet":
saveType = "newspreadsheet";
data = {
FileId: 0,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
};
break;
case "replaceAll":
case "replace":
saveType = "replaceAll";
if (action == "replaceAll") {
args.eventArgs.addressCollection.forEach((e) => {
let sheet = this.baseIns.ssObj.biz.getSheetByName(e.split("!")[0]);
changedValue.push(this.getCellWithRowAndColByRange(e.split("!")[1], sheet));
});
}
else {
let sheet = this.baseIns.ssObj.biz.getSheetByName(args.eventArgs.address.split("!")[0]);
changedValue.push(this.getCellWithRowAndColByRange(args.eventArgs.address.split("!")[1], sheet));
}
data = {
changedvalues: changedValue,
FileId: base.FileId,
sheetIndex: args.eventArgs.pasteSheetIndex,
autosavetype: saveType,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "insertSheet":
let sheetIndex = args.eventArgs.index;
sheet = base.ssObj.sheets[sheetIndex];
saveType = "insertsheet";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheet: sheet,
sheetIndex: sheetIndex,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "removeSheet":
saveType = "removeSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
sheetIndex: args.sheetIndex,
saveversions: saveversion,
requestId: this.requestId,
};
break;
case "applyFilter":
saveType = "applyFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
filter: args.collection,
requestId: this.requestId,
};
break;
case "removeFilter":
saveType = "removeFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
sheetIndex: args.sheetIndex,
requestId: this.requestId,
};
break;
case "updateFilter":
saveType = "updateFilter";
data = {
FileId: base.FileId,
autosavetype: saveType,
filter: args.collection,
requestId: this.requestId,
sheetIndex: sheetIdx,
};
break;
case "renameSheet":
saveType = "renameSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
SheetIndex: sheetIdx,
SheetName: args.eventArgs.value,
requestId: this.requestId,
};
break;
case 'destroy':
var contId = $("._bizgaze_popup_container:visible").attr("id");
$('#' + contId).modal('hide');
$('#' + contId).remove();
window.close();
break;
case "copytonewspreadsheet":
saveType = "newwbsheets";
let currentSheet = base.ssObj.workbookSaveModule.getStringifyObject(base.ssObj.sheets[sheetIdx]);
let sheetName = base.FileName;
data = {
FileId: 0,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheet: currentSheet,
requestId: this.requestId,
saveversions: saveversion,
sheetName: sheetName,
};
break;
case "colResize":
setTimeout(() => {
saveType = "colResize";
if (args.eventArgs.index && !args.indexes)
args['indexes'] = [0, args.eventArgs.index, 0, args.eventArgs.index];
else if (!(args.indexes && args.eventArgs.index))
args['indexes'] = this.baseIns.ssObj.biz.getIndexes();
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheetIndex: sheetIdx,
requestId: this.requestId,
width: parseInt(args.eventArgs.width),
saveversions: saveversion,
indexes: args.indexes,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 100);
break;
case "rowResize":
setTimeout(() => {
saveType = "rowResize";
if (args.eventArgs.index && !args.indexes)
args['indexes'] = [args.eventArgs.index, 0, args.eventArgs.index, 0];
else if (!(args.indexes && args.eventArgs.index))
args['indexes'] = this.baseIns.ssObj.biz.getIndexes();
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
sheetIndex: sheetIdx,
requestId: this.requestId,
height: parseInt(args.eventArgs.height),
indexes: args.indexes,
saveversions: saveversion,
};
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data);
}, 100);
break;
case "imageincell":
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: sheetIdx,
saveversions: saveversion,
changedvalues: args.changedValues,
};
break;
case "createNewSpreadsheet":
isCreateNewFile = true;
saveType = "createNewSpreadsheet";
data = {
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetname: document.getElementsByClassName("biz-ss-filename")[0].value
};
break;
case "headerResize":
saveType = "headerResize";
data = {
FileId: base.FileId,
iscreatenewfile: isCreateNewFile,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: sheetIdx,
saveversions: saveversion,
multipleheaderresize: args.resizedHeaders
};
break;
case "duplicateSheet":
saveType = "duplicateSheet";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
sheetIndex: args.sheetIndex,
saveversions: saveversion,
};
break;
case "deleteImage":
saveType = "deleteImage";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
imageId: args.id,
imageSource: args.src,
};
break;
case "resizeToAutoFitColumn":
saveType = "resizeToAutoFitColumn";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: args.eventArgs.selectedRange,
ColumnWidth: args.eventArgs.columns,
};
break;
case "resizeToAutoFitRow":
saveType = "resizeToAutoFitRow";
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: args.eventArgs.selectedRange,
RowHeight: args.eventArgs.rows,
};
break;
case "wrap":
saveType = "wrap";
let indxs = ej.spreadsheet.getIndexesFromAddress(args.eventArgs.address.split("!")[1]);
data = {
FileId: base.FileId,
autosavetype: saveType,
requestId: this.requestId,
saveversions: saveversion,
sheetIndex: sheetIdx,
indexes: indxs,
wrap: args.eventArgs.wrap,
};
break;
}
(isCreateNewFile) && (data["folderId"] = this.baseIns.folderId);
(data) && Unibase.Apps.Collaboration.DocumentManager.Instance().ssAutoSave(data).then((response) => {
this.baseIns.editDetails();
console.log("Save end " + action + " " + Date());
if (action === "insertSheet" || action === "removeSheet") {
Unibase.Apps.Collaboration.DocumentManager.Instance().getCustomJsonData(base.FileId).then((res) => {
base.customresult = res.result.tabcolors;
});
}
else if (response.message == "New spreadsheet has been created" && action !== "copytonewspreadsheet") {
this.baseIns.FileId = response.result.FileId;
this.baseIns.fileurl = response.result.FileUrl;
this.baseIns.FileName = response.result.FileTitle;
this.baseIns.isCreatingNewFile = false;
for (var i = 0; i < this.actionsWhileCreatingNewFile.length; i++) {
this.ssAutoSave(this.actionsWhileCreatingNewFile[i], this.baseIns, true);
}
}
else if ((action === "copytonewspreadsheet" && response.message === "New spreadsheet has been created")) {
if (callback != null) {
callback();
}
}
});
}
else {
this.actionsWhileCreatingNewFile.push(args);
}
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Download();
}
return this.instance;
}
}
Common.Download = Download;
})(Common = Components.Common || (Components.Common = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"download.js","sourceRoot":"","sources":["download.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAU,OAAO,CAmtBhB;AAntBD,WAAU,OAAO;IACb,IAAiB,IAAI,CAgtBpB;IAhtBD,WAAiB,IAAI;QACj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;gCACrC,IAAI,YAAY,GAAG,EAAE,CAAC;gCACtB,IAAI,KAAK,GAAG,KAAK,CAAC;gCAClB,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC;gCACnD,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE;oCAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC;iCAAE;gCAAA,CAAC;gCACvG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,OAAO,IAAI,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,CAAC;gCAC1I,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC;gCAC3F,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,QAAQ,CLine truncated
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{constructor(){super(...arguments);this.requestId=0;this.actionsWhileCreatingNewFile=[]}downloadDocumentFile(t,i,r,u,f){if(i=="Word")this.fileCacheHelper.loadJsFile("platform/analytics/components/chartviewer/chartviewer.js",()=>__awaiter(this,void 0,void 0,function*(){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(n=>{var t=n.result,i=t.FileTitle,r=t.FileType;f.save(i,u)})}));else if(i=="Excel"){let i=document.getElementById("DocumentViewer").ej2_instances[0];i.saveAsJson().then(i=>{this.dataForJson=i;var f=JSON.stringify(this.dataForJson.jsonObject.Workbook),r=n.Apps.Collaboration.Components.Sheets.Base.Instance().ssObj.activeSheetIndex;this.data={FileId:t,SaveTypeID:u,SheetIndex:r};n.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(this.data).then(t=>{this.fileCacheHelper.loadJsFile("tenants/themes/compact/components/notifications/notification.js",()=>__awaiter(this,void 0,void 0,function*(){var i=encodeURIComponent(t.result);n.Themes.Compact.Components.Notification.Instance().Downloadfile(i)}))})})}}saveDocumentFile(t,i,r,u,f){return __awaiter(this,void 0,void 0,function*(){document.getElementsByClassName("biz-ss-saving")[0].style.display="inline-block";document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")&&(document.getElementsByClassName("biz-ss-saveicon")[0].style.display="none",document.getElementsByClassName("biz-ss-cloudloading")[0].style.display="inline-block");i=="Word"?(this.data={Content:r.serialize(),FileId:t},yield n.Apps.Collaboration.DocumentManager.Instance().saveWord(this.data).then(t=>{var i=t;n.Apps.Collaboration.Components.DocEditor.Base.Instance().editDetails()})):i=="Excel"&&this.ssAutoSave(u,f,!0);setTimeout(function(){return __awaiter(this,void 0,void 0,function*(){document.getElementsByClassName("biz-ss-saveicon")[0].classList.contains("biz-ss-cloudsave")&&(document.getElementsByClassName("biz-ss-saveicon")[0].style.display="inline-block",document.getElementsByClassName("biz-ss-cloudloading")[0].style.display="none",document.getElementsByClassName("biz-ss-saving")[0].style.display="none")})},1e3)})}getCellWithRowAndColByRange(n,t){let i=ej.spreadsheet.getIndexesFromAddress(n);return{SheetIndex:this.baseIns.ssObj.biz.getSheetIndexByname(t.name),row:i[0],cell:i[1],cellInfo:this.baseIns.ssObj.biz.getCell(i[0],i[1],t)}}ssAutoSave(t,i,r,u){var s,h,l,a,f,e,o,c;if(i.permissionLevel!==n.Apps.Collaboration.Enums.Share.Viewer){this.requestId++;let tt,k=t.action,y;this.baseIns=i;let b=i.ssObj.biz.getIndexes(),g=i.ssObj.biz.getActiveSheet(),w=i.getSheetIndex(),v="cell",p=!1,d=[],nt=!1;if(console.log("Save start "+k+" "+Date()),t.action=="resize"&&(k=t.eventArgs.isCol?"colResize":"rowResize"),t.eventArgs&&t.eventArgs.modelType&&t.eventArgs.modelType=="Sheet"&&k=="insert"&&(k="insertSheet"),t.action=="delete"&&t.eventArgs.modelType=="Row"&&(k="deleteRow"),t.action=="delete"&&t.eventArgs.modelType=="Column"&&(k="deleteCol"),(t.action=="insertshiftright"||t.action=="deleteshiftleft")&&(k="shiftright&left"),(t.action=="insertshiftdown"||t.action=="deleteshiftup")&&(k="shiftup&down"),t.action=="import"||t.action=="gotoSheet"||this.baseIns.isCreatingNewFile)this.actionsWhileCreatingNewFile.push(t);else{i.FileId||(p=!0,this.baseIns.isCreatingNewFile=!0,tt=n.Themes.Providers.DetailHelper.recordId);switch(k){case"cellSave":b=this.baseIns.getIndexesFromAddress(t.eventArgs.address.split("!")[1]);d=[{Row:b[0],Cell:b[3],CellInfo:g.rows[b[0]].cells[b[3]]}];y={changedvalues:d,iscreatenewfile:p,FileId:i.FileId,sheetIndex:w,autosavetype:v,requestId:this.requestId};break;case"format":case"validation":case"shortcuts":case"autofill":case"removeDuplicates":case"trim":for(f=b[0];f<=b[2];f++)for(e=b[1];e<=b[3];e++){o=ej.spreadsheet.getCell(f,e,g);let n={Row:f,cell:e,CellInfo:o};n.CellInfo&&n.CellInfo.validation&&n.CellInfo.validation.inCellDropDown==null&&(n.CellInfo.validation.inCellDropDown=!1);d.push(n)}y={changedvalues:d,iscreatenewfile:p,FileId:i.FileId,sheetIndex:w,autosavetype:v,modelType:t.eventArgs?t.eventArgs.modelType:null,requestId:this.requestId,saveversions:r};break;case"insertImage":case"deleteChart":case"cellDelete":case"insertChart":case"multipleCells":setTimeout(()=>{var f,e,u;for(k=="deleteChart"&&(b=i.getIndexesFromAddress(t.eventArgs.range.split("!")[1])),f=b[0];f<=b[2];f++)for(e=b[1];e<=b[3];e++){u=ej.spreadsheet.getCell(f,e,g);let n={Row:f,cell:e,CellInfo:u};if(k=="deleteChart"&&u.chart&&u.chart.pop(u.chart.find(n=>n.id=t.eventArgs.id)Line truncated
Whitespace-only changes.
@@ -0,0 +1 @@
{"version":3,"file":"import.js","sourceRoot":"","sources":["import.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Common;
(function (Common) {
class Util {
createElement(tagName, attType, attValue) {
let ele = document.createElement(tagName);
ele.setAttribute(attType, attValue);
return ele;
}
appendChildren(parent, classIndex, ...eleArray) {
let parentTag = document.getElementsByClassName(parent)[classIndex];
for (let i = 0; i < eleArray.length; i++) {
parentTag.appendChild(eleArray[i]);
}
}
addAttributes(htmlElement, attrJson) {
for (var attr in attrJson) {
htmlElement.setAttribute(attr, attrJson[attr]);
}
}
getCellValues(cellInfo) {
var val = {};
cellInfo.value && (val["value"] = cellInfo.value.toString().trim());
cellInfo.formula && (val["formula"] = cellInfo.formula);
cellInfo.format ? (val["format"] = cellInfo.format) : (val["format"] = "General");
cellInfo.hyperlink && (val["hyperlink"] = cellInfo.hyperlink);
return val;
}
colorHash(str) {
var sum = 0;
for (var i in str) {
sum += str.charCodeAt(i);
}
let r = ~~(('0.' + Math.sin(sum + 1).toString().substr(6)) * 256);
let g = ~~(('0.' + Math.sin(sum + 2).toString().substr(6)) * 256);
let b = ~~(('0.' + Math.sin(sum + 3).toString().substr(6)) * 256);
let rgb = "rgb(" + r + ", " + g + ", " + b + ")";
let hex = "#";
hex += ("00" + r.toString(16)).substr(-2, 2).toUpperCase();
hex += ("00" + g.toString(16)).substr(-2, 2).toUpperCase();
hex += ("00" + b.toString(16)).substr(-2, 2).toUpperCase();
return {
r: r,
g: g,
b: b,
rgb: rgb,
hex: hex
};
}
makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() *
charactersLength));
}
return result;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Util();
}
return this.instance;
}
}
Common.Util = Util;
})(Common = Components.Common || (Components.Common = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA0FhB;AA1FD,WAAU,OAAO;IACb,IAAiB,IAAI,CAuFpB;IAvFD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAqF7B;QArFD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAmF1B;YAnFD,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CAiFtB;gBAjFD,WAAiB,MAAM;oBACnB,MAAa,IAAI;wBAEb,aAAa,CAAC,OAAe,EAAE,OAAe,EAAE,QAAgB;4BAC5D,IAAI,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;4BAC1C,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;4BACpC,OAAO,GAAG,CAAC;wBACf,CAAC;wBAGD,cAAc,CAAC,MAAc,EAAE,UAAkB,EAAE,GAAG,QAAuB;4BACzE,IAAI,SAAS,GAAG,QAAQ,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC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GAAG,EAAE,GAAG;6BACb,CAAC;wBACN,CAAC;wBAGD,MAAM,CAAC,MAAM;4BACT,IAAI,MAAM,GAAG,EAAE,CAAC;4BAChB,IAAI,UAAU,GAAG,gEAAgE,CAAC;4BAClF,IAAI,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC;4BACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;gCAC7B,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;oCAChD,gBAAgB,CAAC,CAAC,CAAC;6BAC1B;4BACD,OAAO,MAAM,CAAC;wBAClB,CAAC;wBAGD,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;gCAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;6BAC9B;4BACD,OAAO,IAAI,CAAC,QAAQ,CAAC;wBACzB,CAAC;qBAEJ;oBA/EY,WAAI,OA+EhB,CAAA;gBACL,CAAC,EAjFgB,MAAM,GAAN,iBAAM,KAAN,iBAAM,QAiFtB;YACL,CAAC,EAnFgB,UAAU,GAAV,wBAAU,KAAV,wBAAU,QAmF1B;QACL,CAAC,EArFgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAqF7B;IACL,CAAC,EAvFgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAuFpB;AAEL,CAAC,EA1FS,OAAO,KAAP,OAAO,QA0FhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{createElement(n,t,i){let r=document.createElement(n);return r.setAttribute(t,i),r}appendChildren(n,t,...i){let r=document.getElementsByClassName(n)[t];for(let n=0;n<i.length;n++)r.appendChild(i[n])}addAttributes(n,t){for(var i in t)n.setAttribute(i,t[i])}getCellValues(n){var t={};return n.value&&(t.value=n.value.toString().trim()),n.formula&&(t.formula=n.formula),t.format=n.format?n.format:"General",n.hyperlink&&(t.hyperlink=n.hyperlink),t}colorHash(n){var t=0;for(var e in n)t+=n.charCodeAt(e);let r=~~(("0."+Math.sin(t+1).toString().substr(6))*256),u=~~(("0."+Math.sin(t+2).toString().substr(6))*256),f=~~(("0."+Math.sin(t+3).toString().substr(6))*256),o="rgb("+r+", "+u+", "+f+")",i="#";return i+=("00"+r.toString(16)).substr(-2,2).toUpperCase(),i+=("00"+u.toString(16)).substr(-2,2).toUpperCase(),i+=("00"+f.toString(16)).substr(-2,2).toUpperCase(),{r:r,g:u,b:f,rgb:o,hex:i}}makeid(n){for(var t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",u=i.length,r=0;r<n;r++)t+=i.charAt(Math.floor(Math.random()*u));return t}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.Util=t})(t=n.Common||(n.Common={}))})(t=n.Components||(n.Components={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,187 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class DocConnector {
constructor() {
this.methods = {
connectedUsers: function (FileUsers, DocumentGroup) {
console.log('connectedUsers is Connected !');
if (DocumentGroup == 'Excel') {
setTimeout(() => { Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(FileUsers); }, 1000);
}
else if (DocumentGroup == 'Word') {
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(FileUsers);
}
},
FileDisconnect: function (user, DocumentGroup) {
if (DocumentGroup == 'Excel') {
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(user);
}
else if (DocumentGroup == 'Word') {
Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(user);
}
}
};
DocConnector._isRegistered = false;
}
init(fileid, documentgroup) {
this.connection = Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url());
var fileId = parseInt(fileid);
this.start(fileId, documentgroup);
}
closeDoc() {
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().stop();
}
ChangeDoc(username, args) {
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("ChangeDoc", username, JSON.stringify(args));
}
getClientMethods() {
return [
{ MethodName: "connectedUsers", Method: this.methods.connectedUsers },
{ MethodName: "filedisconnect", Method: this.methods.FileDisconnect },
];
}
registerClientMethods() {
let _methods = this.getClientMethods();
if (_methods)
for (var i = 0; i < _methods.length; i++) {
this.connection.register(_methods[i].MethodName, _methods[i].Method);
}
}
connectedUsers(FileUsers) {
let ssObj = Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile;
let stCls = Unibase.Apps.Collaboration.Components.Sheets;
ssObj.signalrData = FileUsers;
var args = JSON.parse(FileUsers);
}
start(fileId, documentgroup) {
return __awaiter(this, void 0, void 0, function* () {
this.registerClientMethods();
try {
if (!DocConnector._isRegistered) {
DocConnector._isRegistered = true;
this.connection.register("changedocument", function (docData) {
let ssObj = Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile;
let stCls = Unibase.Apps.Collaboration.Components.Sheets;
ssObj.signalrData = docData;
var args = JSON.parse(docData);
try {
if (args.origin === 'biz') {
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex = args.sheetIndex;
switch (args.action) {
case 'trim':
stCls.Ribbon.Instance().processTrim(args.range);
break;
case 'removeDuplicates':
stCls.Dialogue.Instance().removeDuplicate(args.range, args.header, args.colSelected);
break;
case 'autofill':
stCls.Autofill.Instance().applyAutofill(args.options, args.direction);
break;
case 'formatpaint':
stCls.FormatPainter.Instance().applyFormatPaint(args.srcRange, args.destRange, args.srcSheetIndex);
break;
case 'splittext':
stCls.FormatPainter.Instance().applySplitText(args.range, args.stValues);
break;
case 'shiftrows':
stCls.FormatPainter.Instance().applyShiftRows(args.dropIdx, args.rngIndexes, args.direction, false);
break;
case 'shiftcols':
stCls.FormatPainter.Instance().applyShiftCols(args.dropIdx, args.rngIndexes, args.direction, false);
break;
case 'deleteshiftup':
stCls.FormatPainter.Instance().applyDeleteShiftUp(args.range);
break;
case 'deleteshiftleft':
stCls.FormatPainter.Instance().applyDeleteShiftLeft(args.range);
break;
case 'insertshiftdown':
stCls.FormatPainter.Instance().applyInsertShiftDown(args.range);
break;
case 'insertshiftright':
stCls.FormatPainter.Instance().applyInsertShiftRight(args.range);
break;
case 'shiftcells':
stCls.FormatPainter.Instance().applyShiftCells(args.rowIdx, args.colIdx, args.ranges);
break;
case 'spellcheck':
stCls.SpellChecker.Instance().applySpellValue(args.rowIdx, args.colIdx, args.value);
break;
case 'selection':
stCls.FormatPainter.Instance().applyUserSelection(args.range, args.userName);
break;
case 'undoredo':
stCls.Base.Instance().performBizUndoRedo(args);
break;
case 'insertimage':
stCls.Base.Instance().actionInsertImage(args);
break;
case 'colorchange':
stCls.Base.Instance().sheetColorRender();
break;
case 'resize':
stCls.Base.Instance().adjustRowsAndColumnWidth(args);
break;
case 'importReplace':
location.reload();
break;
}
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex = -1;
}
else {
Unibase.Apps.Collaboration.Components.Documents.Instance()._openedfile.updateAction(JSON.parse(docData));
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();
}
}
catch (e) {
}
});
}
this.connection.connect(function () {
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let UnibaseId = identity.unibaseId;
let FileId = fileId;
let FirstName = identity.name;
let SessionId = identity.sessionId;
let TenantId = identity.tenantId;
console.log("connection started");
Unibase.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("Connect", FileId, UnibaseId, FirstName, documentgroup, SessionId, TenantId).catch(function (err) {
return console.error(err.toString());
});
});
}
catch (err) {
console.log(err);
setTimeout(this.start, 5000);
}
});
}
;
static Instance() {
if (this.instance === undefined) {
this.instance = new DocConnector();
}
return this.instance;
}
}
Components.DocConnector = DocConnector;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"docconnector.js","sourceRoot":"","sources":["docconnector.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAU,OAAO,CAwMhB;AAxMD,WAAU,OAAO;IACb,IAAiB,IAAI,CAsMpB;IAtMD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAoM7B;QApMD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAkM1B;YAlMD,WAAiB,UAAU;gBACvB,MAAa,YAAY;oBAoLrB;wBA1JQ,YAAO,GAAG;4BACd,cAAc,EAAE,UAAU,SAAc,EAAE,aAAqB;gCAC3D,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;gCAC7C,IAAI,aAAa,IAAI,OAAO,EAAE;oCAC1B,UAAU,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAC,IA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I,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;wDACtF,MAAM;oDACV,KAAK,YAAY;wDACb,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;wDACpF,MAAM;oDACV,KAAK,WAAW;wDACZ,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CLine truncated
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(i){class r{constructor(){this.methods={connectedUsers:function(t,i){console.log("connectedUsers is Connected !");i=="Excel"?setTimeout(()=>{n.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(t)},1e3):i=="Word"&&n.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(t)},FileDisconnect:function(t,i){i=="Excel"?n.Apps.Collaboration.Components.Sheets.Base.Instance().activeUsers(t):i=="Word"&&n.Apps.Collaboration.Components.DocEditor.Base.Instance().activeUsers(t)}};r._isRegistered=!1}init(n,i){this.connection=t.Hubs.UniDocHub.Instance(_appsettings.dochub_url());var r=parseInt(n);this.start(r,i)}closeDoc(){n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().stop()}ChangeDoc(t,i){n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("ChangeDoc",t,JSON.stringify(i))}getClientMethods(){return[{MethodName:"connectedUsers",Method:this.methods.connectedUsers},{MethodName:"filedisconnect",Method:this.methods.FileDisconnect},]}registerClientMethods(){let n=this.getClientMethods();if(n)for(var t=0;t<n.length;t++)this.connection.register(n[t].MethodName,n[t].Method)}connectedUsers(t){let i=n.Apps.Collaboration.Components.Documents.Instance()._openedfile,r=n.Apps.Collaboration.Components.Sheets;i.signalrData=t;var u=JSON.parse(t)}start(t,i){return __awaiter(this,void 0,void 0,function*(){this.registerClientMethods();try{r._isRegistered||(r._isRegistered=!0,this.connection.register("changedocument",function(t){let u=n.Apps.Collaboration.Components.Documents.Instance()._openedfile,r=n.Apps.Collaboration.Components.Sheets;u.signalrData=t;var i=JSON.parse(t);try{if(i.origin==="biz"){n.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex=i.sheetIndex;switch(i.action){case"trim":r.Ribbon.Instance().processTrim(i.range);break;case"removeDuplicates":r.Dialogue.Instance().removeDuplicate(i.range,i.header,i.colSelected);break;case"autofill":r.Autofill.Instance().applyAutofill(i.options,i.direction);break;case"formatpaint":r.FormatPainter.Instance().applyFormatPaint(i.srcRange,i.destRange,i.srcSheetIndex);break;case"splittext":r.FormatPainter.Instance().applySplitText(i.range,i.stValues);break;case"shiftrows":r.FormatPainter.Instance().applyShiftRows(i.dropIdx,i.rngIndexes,i.direction,!1);break;case"shiftcols":r.FormatPainter.Instance().applyShiftCols(i.dropIdx,i.rngIndexes,i.direction,!1);break;case"deleteshiftup":r.FormatPainter.Instance().applyDeleteShiftUp(i.range);break;case"deleteshiftleft":r.FormatPainter.Instance().applyDeleteShiftLeft(i.range);break;case"insertshiftdown":r.FormatPainter.Instance().applyInsertShiftDown(i.range);break;case"insertshiftright":r.FormatPainter.Instance().applyInsertShiftRight(i.range);break;case"shiftcells":r.FormatPainter.Instance().applyShiftCells(i.rowIdx,i.colIdx,i.ranges);break;case"spellcheck":r.SpellChecker.Instance().applySpellValue(i.rowIdx,i.colIdx,i.value);break;case"selection":r.FormatPainter.Instance().applyUserSelection(i.range,i.userName);break;case"undoredo":r.Base.Instance().performBizUndoRedo(i);break;case"insertimage":r.Base.Instance().actionInsertImage(i);break;case"colorchange":r.Base.Instance().sheetColorRender();break;case"resize":r.Base.Instance().adjustRowsAndColumnWidth(i);break;case"importReplace":location.reload()}n.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails();n.Apps.Collaboration.Components.Documents.Instance()._openedfile.biz.sheetIndex=-1}else n.Apps.Collaboration.Components.Documents.Instance()._openedfile.updateAction(JSON.parse(t)),n.Apps.Collaboration.Components.Sheets.Base.Instance().editDetails()}catch(f){}}));this.connection.connect(function(){let r=n.Platform.Membership.Infos.Identity.getCurrentUser(),u=r.unibaseId,f=t,e=r.name,o=r.sessionId,s=r.tenantId;console.log("connection started");n.Apps.Collaboration.Hubs.UniDocHub.Instance(_appsettings.dochub_url()).getConnection().invoke("Connect",f,u,e,i,o,s).catch(function(n){return console.error(n.toString())})})}catch(u){console.log(u);setTimeout(this.start,5e3)}})}static Instance(){return this.instance===undefined&&(this.instance=new r),this.instance}}i.DocConnector=r})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,529 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let DocEditor;
(function (DocEditor) {
class Base {
init(response, res, callback) {
this.result = response.result;
this.documentGroup = this.result.DocumentGroup;
this.filedata = res.result;
this.FileName = response.result.FileTitle;
this.FileId = response.result.FileId;
this.sourceFileId = response.result.SourceFileId;
this.Priority = response.result.Priority;
this.lastEditedTime = response.result.LastUpdateTime;
this.timePeriod = response.result.TimePeriod;
this.username = response.result.LastUpdateByName;
this.Priority = response.result.Priority;
this.newUpload = response.result.NewUpload;
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.NewDocument = response.result.NewDocument;
this.render();
if (callback != null) {
callback();
}
}
unwireBootStrapKeyEvent() {
let popup = document.body.getElementsByClassName('_bizgaze_popup_container');
let events = $._data($(popup)[0], "events");
if (events && events.keydown) {
$(popup).off('keydown.dismiss.bs.modal', events.keydown[0].handler);
}
}
render() {
this.renderPopup();
this.updateProps();
this.renderMenuBar();
this.refreshHeight();
this.wordDocumentRender();
this.ribbon.init(this.wordDocumentObj, this.result);
this.priorityRender();
this.initSetInterval();
this.eventListeners();
this.unwireBootStrapKeyEvent();
if (!this.NewDocument) {
this.connectHub(this.FileId, this.documentGroup);
}
}
connectHub(fileId, documentgroup) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js"], function () {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().init(fileId, documentgroup);
});
}
priorityRender() {
if (this.Priority) {
$(".biz_doc_star_icon_" + this.FileId).removeClass("fa-star-o");
$(".biz_doc_star_icon_" + this.FileId).addClass("fa-star");
$(".biz_doc_star_icon_" + this.FileId).removeClass("text-light");
$(".biz_doc_star_icon_" + this.FileId).css("color", "orange");
}
}
eventListeners() {
try {
document.body.addEventListener("keydown", this.keyDown.bind(this));
document.body.addEventListener("mousedown", this.mouseDown.bind(this));
document.getElementsByClassName("biz-doc-starred")[0].addEventListener('click', (event) => {
});
document.getElementsByClassName("biz-doc-filename")[0].addEventListener('focusout', (event) => {
this.fileNameChange();
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("keydown", (ele) => {
if (ele.keyCode == 122) {
event.preventDefault();
this.openFullscreen(this.container);
}
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("keyup", (ele) => {
this.editorkeyUp(ele);
});
(document.getElementsByClassName('e-de-text-target')[0].contentWindow.document).addEventListener("mousedown", (ele) => {
this.editorMouseDown(ele);
});
this.container.addEventListener("fullscreenchange", () => {
this.fullscreenHandler(this.container);
});
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeOpen", this.cmenuBfOpen.bind(this));
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeItemRender", this.cmenuBfItemRndr.bind(this));
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("select", this.cmenuSelect.bind(this));
}
catch (e) {
}
}
keyDown(ele) {
if (ele.keyCode == 122) {
event.preventDefault();
setTimeout(() => { this.openFullscreen(this.container); }, 0);
}
if (ele.target.classList.contains("biz-doc-fileshare-btn")) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('apps/collaboration/components/unicloud.js', () => {
Unibase.Apps.Collaboration.Components.UniCloud.Instance().share(this.sourceFileId, "File", 0);
});
}
}
editorkeyUp(e) {
this.updateUndoRedo();
}
updateUndoRedo() {
let undoOverley = document.getElementById("DocumentViewer_toolbar_undo").parentElement.classList.contains("e-overlay");
let redoOverley = document.getElementById("DocumentViewer_toolbar_redo").parentElement.classList.contains("e-overlay");
let undobtn = document.getElementsByClassName("biz-doc-undo")[0];
let redobtn = document.getElementsByClassName("biz-doc-redo")[0];
this.enableOrDisableIcon(undoOverley, undobtn);
this.enableOrDisableIcon(redoOverley, redobtn);
}
editorMouseDown(e) {
let undo = e.target.closest(".biz-doc-undo");
let redo = e.target.closest(".biz-doc-redo");
(undo) && document.getElementById("DocumentViewer_toolbar_undo").click();
(redo) && document.getElementById("DocumentViewer_toolbar_redo").click();
this.updateUndoRedo();
}
mouseDown(e) {
if (e.target.id == "biz_doc_undobtn" || e.target.classList.contains("biz-doc-undo-icon")) {
document.getElementById("DocumentViewer_toolbar_undo").click();
}
else if (e.target.id == "biz_doc_redobtn" || e.target.classList.contains("biz-doc-redo-icon")) {
document.getElementById("DocumentViewer_toolbar_redo").click();
}
this.updateUndoRedo();
}
enableOrDisableIcon(undoOverley, btn) {
if (undoOverley) {
if (!btn.classList.contains("e-disabled"))
btn.classList.add("e-disabled");
}
else {
if (btn.classList.contains("e-disabled"))
btn.classList.remove("e-disabled");
}
}
openFullscreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
}
else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
}
fullscreenHandler(container) {
setTimeout(() => {
if (document.fullscreenElement) {
this.fullscreenChange(container);
}
else {
this.fullscreenChange(container);
}
}, 100);
}
fullscreenChange(ele) {
let ribbonHeight = this.ribbonElem.offsetHeight;
let toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;
let footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
var totalHeight = window.innerHeight - ribbonHeight - toolbarHeight - footerHeight;
this.element.parentElement.style.height = totalHeight + 'px';
this.wordDocumentObj.height = totalHeight + 'px';
}
wordDocumentRender() {
var instance = this;
this.wordDocumentObj = new ej.documenteditor.DocumentEditorContainer({
height: "100%",
enableEditor: true,
enableEditorHistory: true,
enableSelection: true,
enableSearch: true,
created: () => {
setTimeout(() => {
let updateTextPositionFn = this.wordDocumentObj.documentEditor.selectionModule.updateTextPosition.bind(this.wordDocumentObj.documentEditor.selectionModule);
this.wordDocumentObj.documentEditor.selectionModule.updateTextPosition = (a1, a2) => {
updateTextPositionFn(a1, a2);
let result = this.wordDocumentObj.documentEditor.selectionModule.updateTextPositionIn(a1, undefined, 0, a2, false);
this.formatInfo = result;
return result;
};
}, 800);
},
});
setInterval(() => {
var instance = this;
if (instance.contentChanged) {
this.onlineStatus = (window.navigator.onLine ? 'on' : 'off') + 'line';
window.addEventListener('online', () => document.getElementsByClassName('biz-ss-cloudsave')[0].style.display = 'inline-block');
window.addEventListener('online', () => document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "none");
window.addEventListener('offline', () => document.getElementsByClassName('biz-ss-cloudsave')[0].style.display = 'none');
window.addEventListener('offline', () => document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "inline-block");
if (this.onlineStatus == "online") {
Unibase.Apps.Collaboration.Components.Common.Download.Instance().saveDocumentFile(instance.FileId, instance.documentGroup, instance.documentContainer).then(function () {
});
}
instance.contentChanged = false;
}
}, 3000);
this.wordDocumentObj.appendTo('.DocumentViewer');
(this.filedata) && this.wordDocumentObj.documentEditor.open(this.filedata);
this.wordDocumentObj.documentEditor.enableSfdtExport = true;
this.wordDocumentObj.documentEditor.enableWordExport = true;
this.wordDocumentObj.documentEditor.enableTextExport = true;
this.wordDocumentObj.documentEditor.enableSelection = true;
this.wordDocumentObj.documentEditor.enableEditor = true;
this.wordDocumentObj.documentEditor.isReadOnly = false;
this.wordDocumentObj.documentEditor.enableLocalPaste = false;
var xyz = $("#DocumentViewer_editor")[0];
this.documentContainer = xyz.ej2_instances[0];
}
cmenuBfOpen(args) {
let cmenuModule = this.wordDocumentObj.documentEditor.contextMenuModule;
let items = this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.items;
if (items.find(x => x.id == this.wordDocumentObj.element.id + "_cmenu_delete") == undefined) {
items.splice(5, 0, {
text: "Delete", iconCss: "e-icons MT_Delete", id: this.wordDocumentObj.element.id + "_cmenu_delete"
});
items.push({ text: "Clear Formatting", iconCss: "e-icons MT_ClearFormat", id: this.wordDocumentObj.element.id + "_cmenu_clear_formatting" });
}
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.items = items;
this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.dataBind();
cmenuModule.showHideElements(cmenuModule.documentHelper.selection);
}
cmenuBfItemRndr(e) {
if (e.item.id == this.wordDocumentObj.element.id + "_cmenu_delete") {
let selectedText = this.wordDocumentObj.documentEditor.editor.selection.text;
if (selectedText.length == 0) {
e.element.classList.add("e-disabled");
}
}
}
cmenuSelect(args) {
if (args.item.id == this.wordDocumentObj.element.id + "_cmenu_delete") {
this.wordDocumentObj.documentEditor.editor.delete();
}
else if (args.item.id == this.wordDocumentObj.element.id + "_cmenu_clear_formatting") {
this.wordDocumentObj.documentEditor.editor.clearFormatting();
}
}
updateProps() {
this.element = document.getElementById('DocumentViewer');
this.fileName = this.result.FileName + "." + this.result.FileType;
this.ribbon = Unibase.Apps.Collaboration.Components.DocEditor.Ribbon.Instance();
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
}
refreshHeight() {
var toolbarHeight = this.element.parentElement.previousElementSibling.offsetHeight;
var rootHeight = this.element.parentElement.parentElement.offsetHeight;
var rbnHeight = document.body.getElementsByClassName('biz-doc-ribbon')[0].offsetHeight;
this.element.parentElement.style.height = (rootHeight - rbnHeight - toolbarHeight) + 'px';
}
initSetInterval() {
if (this.timePeriod === "Minutes" || this.timePeriod === "Minute") {
this.intr = setInterval(() => {
this.lastEditedTime = this.lastEditedTime + 1;
this.username = this.username;
this.timePeriod = this.timePeriod;
if (this.lastEditedTime != 1) {
if (this.lastEditedTime >= 59 && this.timePeriod === "Minutes") {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
});
}
else {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
}
}
}, 60000);
}
else if (this.timePeriod === "Hour" || this.timePeriod === "Hours") {
this.intrhour = setInterval(() => {
this.lastEditedTime = this.lastEditedTime + 1;
this.username = this.username;
this.timePeriod = this.timePeriod;
if (this.lastEditedTime >= 23 && this.timePeriod === "Hours") {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
});
}
else {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
if (this.unibaseusername === this.username) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago by " + this.username;
}
}
}, 3600000);
}
}
fileNameChange() {
var tempfilename = $(".biz-doc-filename").val();
var data = {
FileTitle: tempfilename,
FileId: this.FileId
};
Unibase.Apps.Collaboration.DocumentManager.Instance().renameFileTitle(data);
}
activeUsers(FileUsers) {
var connecteduser = [];
for (var v in FileUsers) {
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let unibaseId = identity.unibaseId;
if (unibaseId != FileUsers[v].unibaseId) {
connecteduser.push(FileUsers[v].firstName);
}
}
this.connecteduserfirstName = connecteduser;
console.log(this.connecteduserfirstName);
this.showActiveUsers(FileUsers);
return this.connecteduserfirstName;
}
showActiveUsers(FileUsers) {
var onlineusername = document.getElementsByClassName("biz-doc-onlineusersintials")[0];
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
let unibaseId = identity.unibaseId;
var connectedUsersFirstChar = [];
for (var user in this.connecteduserfirstName) {
connectedUsersFirstChar.push(this.connecteduserfirstName[user].trim().charAt(0));
}
var element = document.getElementById('biz-doc-connected_users_container');
if (typeof (element) != 'undefined' && element != null) {
element.remove();
}
let html = "";
let html1 = `<div id="biz-doc-connected_users_container"></div>`;
$(".biz-doc-onlineusersintials").append(html1);
let usersHtml = '', randomColor;
let colorPalette = ['#6640b2', '#3a55b1', '#0092ee', '#00acf0', '#1ebccd', '#009b84', '#22af47', '#88c241', '#d0d962', '#fde335', '#ffbf36', '#ff9528', '#ff6028', '#7a5449', '#c1993f', '#9e9e9e', '#5e7d8a', '#324148', '#f5f5f6', '#f95851', '#ef3975', '#b642b5', '#7a59bc', '#536bbb', '#21a0f0', '#21b7f2'];
for (let i = 0; i < this.connecteduserfirstName.length; i++) {
randomColor = colorPalette[Math.floor(Math.random() * colorPalette.length)];
html = `<div id="biz-doc-connecteduser-` + unibaseId + `" class="d-flex flex-row border rounded-circle w-35p h-35p biz-doc-users-` + i + `" style="margin-right:-8px; background-color:` + randomColor + `">
<div id="biz-doc-connecteduser_` + unibaseId + `" class="biz-doc-connectedusersfirstletter m-auto" data-toggle="popover" data-placement="top" title = "` + this.connecteduserfirstName[i] + `">` + connectedUsersFirstChar[i] + `</div></div>`;
if (i <= 5) {
$("#biz-doc-connected_users_container").append(html);
}
usersHtml += '<a class="dropdown-item d-flex flex-row align-items-center p-1 my-1" href="javascript:void(0)"><div class="biz-doc-connectedusersfirstletter border mr-2 px-2 rounded-circle text-white" style="background-color:#' + randomColor + '" title = "' + this.connecteduserfirstName[i] + '">' + connectedUsersFirstChar[i] + '</div><span class="font-13 font-weight-500">' + FileUsers[i].firstName + '</span></a>';
if (i > 5) {
$("#biz-doc-connected_users_container").children().last().remove();
$("#biz-doc-connected_users_container").append('<div class="users-dropdown"><a href="javascript:void(0);" class="d-flex flex-row border rounded-circle w-35p h-35p text-dark biz-doc-users-' + i + '" role="button" id="biz-doc-connecteduser-' + unibaseId + '" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style=" background-color:lightgray;margin-right:-8px"><span class="m-auto font-14 font-weight-500"><span class="font-12 text-muted"><i class="la la-plus"></i></span>' + [i - 4] + '</span></a><div class="dropdown-menu z-index-10 position-absolute bg-white h-275p scroll-bar" aria-labelledby="biz-doc-connecteduser-' + unibaseId + '"></div>');
$('.users-dropdown .dropdown-menu').append(usersHtml);
}
}
}
renderPopup() {
Unibase.Apps.Collaboration.Components.Documents.Instance().loadForm(0, this.FileId, 0, null, this.documentGroup);
}
renderMenuBar() {
let containers = document.body.getElementsByClassName('_bizgaze_popup_container');
this.container = containers[containers.length - 1];
this.container.insertBefore(this.util.createElement("div", 'class', 'biz-doc-ribbon'), document.body.getElementsByClassName('_bizgaze_popup_container')[0].firstElementChild);
this.util.appendChildren('biz-doc-ribbon', 0, this.util.createElement("div", 'class', 'biz-doc-docxlogo'), this.util.createElement("div", 'class', 'biz-doc-tooolbar'), this.util.createElement("div", 'class', 'biz-doc-userdetails'));
this.util.appendChildren('biz-doc-docxlogo', 0, this.util.createElement("img", 'class', 'biz-doc-logo'));
this.util.appendChildren('biz-doc-tooolbar', 0, this.util.createElement("div", 'class', 'biz-doc-fileinfo'), this.util.createElement("div", 'class', 'biz-doc-fileshare-wrapper'), this.util.createElement("div", 'class', 'biz-doc-onlineusers'), this.util.createElement("div", 'class', 'biz-doc-toolbarmenu'));
this.util.appendChildren('biz-doc-fileinfo', 0, this.util.createElement("input", 'class', 'biz-doc-filename'), this.util.createElement('div', 'class', 'biz-doc-starred'), this.util.createElement('div', 'class', 'biz-ss-autosave'));
this.util.appendChildren('biz-doc-starred', 0, this.util.createElement("span", 'id', 'biz-doc-star'), this.util.createElement("i", 'class', 'fa fa-star-o text-light font-7 biz_doc_star_icon_' + this.FileId));
this.util.appendChildren('biz-ss-autosave', 0, this.util.createElement("img", 'class', 'biz-ss-saveicon biz-ss-cloudsave'), this.util.createElement("img", 'class', 'biz-ss-saveicon biz-ss-cloudoff'), this.util.createElement("div", 'class', 'biz-ss-cloudloading e-icons'), this.util.createElement('div', 'class', 'biz-ss-saving'));
this.util.appendChildren('biz-doc-fileshare-wrapper', 0, this.util.createElement("div", 'class', 'biz-doc-fileshare'));
this.util.appendChildren('biz-doc-onlineusers', 0, this.util.createElement("div", 'class', 'biz-doc-onlineusersintials d-flex flex-row text-white mx-35 pull-right'));
this.util.appendChildren('biz-doc-fileshare', 0, this.util.createElement("button", 'class', 'biz-doc-fileshare-btn'));
this.util.appendChildren('biz-doc-userdetails', 0, this.util.createElement("div", 'class', 'biz-doc-userinitial'));
this.util.appendChildren('biz-doc-toolbarmenu', 0, this.util.createElement("ul", 'id', 'menu'), this.util.createElement("input", 'class', 'biz-doc-lastedited'));
document.getElementsByClassName("biz-doc-ribbon")[0].after(this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar e-toolbar'));
this.util.appendChildren('biz-doc-bottomtoolbar', 0, this.util.createElement("div", 'class', 'biz-doc-toolbar-wrapper'));
this.util.appendChildren('biz-doc-toolbar-wrapper', 0, this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-undoredo e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-text e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-paragraph e-toolbar-items'), this.util.createElement("div", 'class', 'biz-doc-bottomtoolbar-indent e-toolbar-items'));
this.userInitial = document.getElementsByClassName("biz-doc-userinitial")[0];
let identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
if (!identity.photoUrl) {
this.userInitial.textContent += identity.name.trim().slice(0, 1);
this.userInitial.classList.add('biz-doc-initial-text');
}
else {
this.userInitial.classList.add('biz-doc-initial-img');
this.userInitial.style.backgroundImage = "url(" + identity.photoUrl + ")";
}
document.getElementsByClassName("biz-doc-logo")[0].setAttribute('src', 'imgs/BizgazeDocsIcon.svg');
document.getElementsByClassName("biz-ss-cloudsave")[0].setAttribute('src', 'imgs/cloud-computing.svg');
document.getElementsByClassName("biz-ss-cloudoff")[0].setAttribute('src', 'imgs/cloud-off.svg');
document.getElementsByClassName("biz-ss-cloudoff")[0].style.display = "none";
let attributes = {
'value': this.FileName,
'type': 'text'
};
document.getElementsByClassName("biz-doc-fileshare-btn")[0].style.backgroundColor = "#049503";
var shareBtn = new ej.buttons.Button({ cssClass: `e-primary`, content: `Share`, iconCss: 'biz-doc-fileshare-icon icon-doc-lockopen' });
shareBtn.appendTo(".biz-doc-fileshare-btn");
document.getElementsByClassName("biz-doc-userinitial")[0].setAttribute("title", identity.name.trim());
let color = this.util.colorHash(identity.name.trim());
document.getElementsByClassName("biz-doc-userinitial")[0].style.backgroundColor = color.hex;
if (!this.newUpload) {
debugger;
if (this.lastEditedTime != 0) {
if (this.unibaseusername === this.username) {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made ' + this.lastEditedTime + ' ' + this.timePeriod + ' ago',
'type': 'span'
});
}
else {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made ' + this.lastEditedTime + ' ' + this.timePeriod + ' ago by ' + this.username,
'type': 'span'
});
}
}
else {
if (this.unibaseusername === this.username) {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made seconds ago ',
'type': 'span'
});
}
else {
let htmlelementlastedited = document.getElementsByClassName('biz-doc-lastedited')[0];
this.util.addAttributes(htmlelementlastedited, {
'value': 'last edit was made seconds ago by ' + this.username,
'type': 'span'
});
}
}
}
let htmlelement = document.getElementsByClassName('biz-doc-filename')[0];
this.util.addAttributes(htmlelement, attributes);
let attributesforautosave = {
'type': 'text'
};
let htmlelementforautosave = document.getElementsByClassName('biz-ss-saving')[0];
this.util.addAttributes(htmlelementforautosave, attributesforautosave);
document.getElementsByClassName('biz-ss-saving')[0].style.display = 'none';
document.getElementsByClassName('biz-doc-lastedited')[0].setAttribute('disabled', "");
document.getElementsByClassName('biz-ss-saving')[0].innerText = 'Saving...';
this.ribbonElem = document.body.getElementsByClassName('biz-doc-ribbon')[0];
}
editDetails() {
if (this.FileId != 0) {
Unibase.Apps.Collaboration.DocumentManager.Instance().lastEdit(this.FileId).then((response) => {
this.identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
this.unibaseusername = this.identity.name.trim();
this.lastEditedTime = response.result.Lastedittime;
this.username = response.result.LastUpdatedByName;
this.timePeriod = response.result.TimePeriod;
if (this.unibaseusername === this.username && this.lastEditedTime === 0) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made seconds ago";
}
else if (this.unibaseusername === this.username && this.lastEditedTime !== 0) {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made " + this.lastEditedTime + " " + this.timePeriod + " ago";
}
else {
let element = (document.getElementsByClassName('biz-doc-lastedited')[0]);
element.value = "last edit was made seconds ago by " + this.username;
}
});
}
clearInterval(this.intr);
clearInterval(this.intrhour);
this.initSetInterval();
}
convertDocsToPdfDownload(FileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().ConvertDocstoPdfDownload(FileId).then((response) => {
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(response.result);
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Base();
}
return this.instance;
}
}
DocEditor.Base = Base;
})(DocEditor = Components.DocEditor || (Components.DocEditor = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA+pBhB;AA/pBD,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kBAAkB,EAAE,GAAG,EAAE;oCACrD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gCAE3C,CAAC,CAAC,CAAC;gCACH,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gCACrI,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gCAC/I,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;6BACpI;4BAAC,OAAO,CAAC,EAAE;6BACX;wBACL,CAAC;wBACD,OAAO,CAAC,GAAG;4BACP,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,EAAE;gCACpB,KAAK,CAAC,cAAc,EAAE,CAAC;gCACvB,UAAU,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;6BAChE;4BAED,IAAK,GAAG,CAAC,Line truncated
+2
View File
@@ -0,0 +1,2 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{init(t,i,r){this.result=t.result;this.documentGroup=this.result.DocumentGroup;this.filedata=i.result;this.FileName=t.result.FileTitle;this.FileId=t.result.FileId;this.sourceFileId=t.result.SourceFileId;this.Priority=t.result.Priority;this.lastEditedTime=t.result.LastUpdateTime;this.timePeriod=t.result.TimePeriod;this.username=t.result.LastUpdateByName;this.Priority=t.result.Priority;this.newUpload=t.result.NewUpload;this.identity=n.Platform.Membership.Infos.Identity.getCurrentUser();this.unibaseusername=this.identity.name.trim();this.NewDocument=t.result.NewDocument;this.render();r!=null&&r()}unwireBootStrapKeyEvent(){let t=document.body.getElementsByClassName("_bizgaze_popup_container"),n=$._data($(t)[0],"events");n&&n.keydown&&$(t).off("keydown.dismiss.bs.modal",n.keydown[0].handler)}render(){this.renderPopup();this.updateProps();this.renderMenuBar();this.refreshHeight();this.wordDocumentRender();this.ribbon.init(this.wordDocumentObj,this.result);this.priorityRender();this.initSetInterval();this.eventListeners();this.unwireBootStrapKeyEvent();this.NewDocument||this.connectHub(this.FileId,this.documentGroup)}connectHub(t,i){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/collaboration/components/docconnector.js","apps/collaboration/components/unidochub.js"],function(){n.Apps.Collaboration.Components.DocConnector.Instance().init(t,i)})}priorityRender(){this.Priority&&($(".biz_doc_star_icon_"+this.FileId).removeClass("fa-star-o"),$(".biz_doc_star_icon_"+this.FileId).addClass("fa-star"),$(".biz_doc_star_icon_"+this.FileId).removeClass("text-light"),$(".biz_doc_star_icon_"+this.FileId).css("color","orange"))}eventListeners(){try{document.body.addEventListener("keydown",this.keyDown.bind(this));document.body.addEventListener("mousedown",this.mouseDown.bind(this));document.getElementsByClassName("biz-doc-starred")[0].addEventListener("click",()=>{n.Apps.Collaboration.Components.UniCloud.Instance().priority(this.FileId,"file","doc",0)});document.getElementsByClassName("biz-doc-filename")[0].addEventListener("focusout",()=>{this.fileNameChange()});document.getElementsByClassName("e-de-text-target")[0].contentWindow.document.addEventListener("keydown",n=>{n.keyCode==122&&(event.preventDefault(),this.openFullscreen(this.container))});document.getElementsByClassName("e-de-text-target")[0].contentWindow.document.addEventListener("keyup",n=>{this.editorkeyUp(n)});document.getElementsByClassName("e-de-text-target")[0].contentWindow.document.addEventListener("mousedown",n=>{this.editorMouseDown(n)});this.container.addEventListener("fullscreenchange",()=>{this.fullscreenHandler(this.container)});this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeOpen",this.cmenuBfOpen.bind(this));this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("beforeItemRender",this.cmenuBfItemRndr.bind(this));this.wordDocumentObj.documentEditor.contextMenuModule.contextMenuInstance.addEventListener("select",this.cmenuSelect.bind(this))}catch(t){}}keyDown(t){t.keyCode==122&&(event.preventDefault(),setTimeout(()=>{this.openFullscreen(this.container)},0));t.target.classList.contains("biz-doc-fileshare-btn")&&n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/unicloud.js",()=>{n.Apps.Collaboration.Components.UniCloud.Instance().share(this.sourceFileId,"File",0)})}editorkeyUp(){this.updateUndoRedo()}updateUndoRedo(){let n=document.getElementById("DocumentViewer_toolbar_undo").parentElement.classList.contains("e-overlay"),t=document.getElementById("DocumentViewer_toolbar_redo").parentElement.classList.contains("e-overlay"),i=document.getElementsByClassName("biz-doc-undo")[0],r=document.getElementsByClassName("biz-doc-redo")[0];this.enableOrDisableIcon(n,i);this.enableOrDisableIcon(t,r)}editorMouseDown(n){let t=n.target.closest(".biz-doc-undo"),i=n.target.closest(".biz-doc-redo");t&&document.getElementById("DocumentViewer_toolbar_undo").click();i&&document.getElementById("DocumentViewer_toolbar_redo").click();this.updateUndoRedo()}mouseDown(n){n.target.id=="biz_doc_undobtn"||n.target.classList.contains("biz-doc-undo-icon")?document.getElementById("DocumentViewer_toolbar_undo").click():(n.target.id=="biz_doc_redobtn"||n.target.classList.contains("biz-doc-redo-icon"))&&document.getElementById("DocumentViewer_toolbar_redo").click();this.updateUndoRedo()}enableOrDisableIcon(n,t){n?t.classList.contains("e-disabled")||t.classList.add("e-disabled"):t.classList.contains("e-disabled")&&t.classList.remove("e-disabled")}openFullscreen(n){n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.msRequestFullscreen&&n.msRequestFullscreen()}fullscreenHandler(n){setTimeout(()=>{document.fullscreenElement?this.fullscreenChange(n):this.fullscreenChange(n)},100)}fullscreenChange(){let t=tLine truncated
<div id="biz-doc-connecteduser_`+i+`" class="biz-doc-connectedusersfirstletter m-auto" data-toggle="popover" data-placement="top" title = "`+this.connecteduserfirstName[n]+`">`+r[n]+`</div></div>`,n<=5&&$("#biz-doc-connected_users_container").append(o),s+='<a class="dropdown-item d-flex flex-row align-items-center p-1 my-1" href="javascript:void(0)"><div class="biz-doc-connectedusersfirstletter border mr-2 px-2 rounded-circle text-white" style="background-color:#'+f+'" title = "'+this.connecteduserfirstName[n]+'">'+r[n]+'<\/div><span class="font-13 font-weight-500">'+t[n].firstName+"<\/span><\/a>",n>5&&($("#biz-doc-connected_users_container").children().last().remove(),$("#biz-doc-connected_users_container").append('<div class="users-dropdown"><a href="javascript:void(0);" class="d-flex flex-row border rounded-circle w-35p h-35p text-dark biz-doc-users-'+n+'" role="button" id="biz-doc-connecteduser-'+i+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style=" background-color:lightgray;margin-right:-8px"><span class="m-auto font-14 font-weight-500"><span class="font-12 text-muted"><i class="la la-plus"><\/i><\/span>'+[n-4]+'<\/span><\/a><div class="dropdown-menu z-index-10 position-absolute bg-white h-275p scroll-bar" aria-labelledby="biz-doc-connecteduser-'+i+'"><\/div>'),$(".users-dropdown .dropdown-menu").append(s))}renderPopup(){n.Apps.Collaboration.Components.Documents.Instance().loadForm(0,this.FileId,0,null,this.documentGroup)}renderMenuBar(){let i=document.body.getElementsByClassName("_bizgaze_popup_container");this.container=i[i.length-1];this.container.insertBefore(this.util.createElement("div","class","biz-doc-ribbon"),document.body.getElementsByClassName("_bizgaze_popup_container")[0].firstElementChild);this.util.appendChildren("biz-doc-ribbon",0,this.util.createElement("div","class","biz-doc-docxlogo"),this.util.createElement("div","class","biz-doc-tooolbar"),this.util.createElement("div","class","biz-doc-userdetails"));this.util.appendChildren("biz-doc-docxlogo",0,this.util.createElement("img","class","biz-doc-logo"));this.util.appendChildren("biz-doc-tooolbar",0,this.util.createElement("div","class","biz-doc-fileinfo"),this.util.createElement("div","class","biz-doc-fileshare-wrapper"),this.util.createElement("div","class","biz-doc-onlineusers"),this.util.createElement("div","class","biz-doc-toolbarmenu"));this.util.appendChildren("biz-doc-fileinfo",0,this.util.createElement("input","class","biz-doc-filename"),this.util.createElement("div","class","biz-doc-starred"),this.util.createElement("div","class","biz-ss-autosave"));this.util.appendChildren("biz-doc-starred",0,this.util.createElement("span","id","biz-doc-star"),this.util.createElement("i","class","fa fa-star-o text-light font-7 biz_doc_star_icon_"+this.FileId));this.util.appendChildren("biz-ss-autosave",0,this.util.createElement("img","class","biz-ss-saveicon biz-ss-cloudsave"),this.util.createElement("img","class","biz-ss-saveicon biz-ss-cloudoff"),this.util.createElement("div","class","biz-ss-cloudloading e-icons"),this.util.createElement("div","class","biz-ss-saving"));this.util.appendChildren("biz-doc-fileshare-wrapper",0,this.util.createElement("div","class","biz-doc-fileshare"));this.util.appendChildren("biz-doc-onlineusers",0,this.util.createElement("div","class","biz-doc-onlineusersintials d-flex flex-row text-white mx-35 pull-right"));this.util.appendChildren("biz-doc-fileshare",0,this.util.createElement("button","class","biz-doc-fileshare-btn"));this.util.appendChildren("biz-doc-userdetails",0,this.util.createElement("div","class","biz-doc-userinitial"));this.util.appendChildren("biz-doc-toolbarmenu",0,this.util.createElement("ul","id","menu"),this.util.createElement("input","class","biz-doc-lastedited"));document.getElementsByClassName("biz-doc-ribbon")[0].after(this.util.createElement("div","class","biz-doc-bottomtoolbar e-toolbar"));this.util.appendChildren("biz-doc-bottomtoolbar",0,this.util.createElement("div","class","biz-doc-toolbar-wrapper"));this.util.appendChildren("biz-doc-toolbar-wrapper",0,this.util.createElement("div","class","biz-doc-bottomtoolbar-undoredo e-toolbar-items"),this.util.createElement("div","class","biz-doc-bottomtoolbar-text e-toolbar-items"),this.util.createElement("div","class","biz-doc-bottomtoolbar-paragraph e-toolbar-items"),this.util.createElement("div","class","biz-doc-bottomtoolbar-indent e-toolbar-items"));this.userInitial=document.getElementsByClassName("biz-doc-userinitial")[0];let t=n.Platform.Membership.Infos.Identity.getCurrentUser();t.photoUrl?(this.userInitial.classList.add("biz-doc-initial-img"),this.userInitial.style.backgroundImage="url("+t.photoUrl+")"):(this.userInitial.textContent+=t.name.trim().slice(0,1),this.userInitial.classList.add("biz-doc-initial-text"));document.getElementsByClassName("biz-doc-logo")[0].setAttribute("src","imgs/BizgazeDocsIcon.svg");document.getElementsByClassName("biz-ss-cloudsave")[0].seLine truncated
@@ -0,0 +1,832 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let DocEditor;
(function (DocEditor) {
class Ribbon {
init(docobj, result) {
this.FileName = result.FileName;
this.FileId = result.FileId;
this.documentGroup = result.DocumentGroup;
this.wordDocumentObj = docobj;
this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
this.fileDownload = Unibase.Apps.Collaboration.Components.Common.Download.Instance();
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
this.render();
}
render() {
this.wordDocumentMenubar(this.FileId, this.documentGroup, this.FileName);
this.appendToolbarElements();
this.createResponsiveToolbar();
this.updateProp();
}
updateProp() {
this.fontSize = document.getElementById("DocumentViewer_editor_font_properties_fontSize").ej2_instances[0];
}
setFontSize(size) {
this.wordDocumentObj.textProperties.text.isRetrieving = false;
this.fontSize.value = size;
}
wordDocumentMenubar(FileId, documentGroup, FileName) {
var instance = this;
var menuItems = [
{
text: 'File',
items: [
{ text: 'New', iconCss: 'e-icons add-new' },
{ text: 'Open', iconCss: 'e-icons e-open' },
{ text: 'Make a copy', iconCss: 'e-icons biz_make_a_copy' },
{
text: 'Download', iconCss: 'e-icons e-save',
items: [
{ text: 'Microsoft Word Document (.docx)', iconCss: 'e-icons' },
{ text: 'Portable Document Format (.pdf)', iconCss: 'e-icons Pdf_Export' },
{ text: 'Text Document (.txt)', iconCss: 'e-icons' }
]
},
{ text: 'Close', iconCss: 'e-icons cross-close' },
]
},
{
text: 'Edit',
items: [
{ text: 'Undo', iconCss: 'e-icons biz-doc-undo-icon' },
{ text: 'Redo', iconCss: 'e-icons biz-doc-redo-icon' },
{ separator: true },
{ text: 'Cut', iconCss: 'e-icons biz-doc-cut-icon' },
{ text: 'Copy', iconCss: 'e-icons biz-doc-copy-icon' },
{ text: 'Paste', iconCss: 'e-icons biz-doc-paste-icon' },
{
text: 'Special paste', iconCss: 'e-icons biz-doc-paste-icon', items: [
{ text: "Keep source formatting", iconCss: 'e-icons MT_PasteStyle' },
{ text: "Match destination formatting", iconCss: 'e-icons M_MergeFormatting' },
{ text: "Text only", iconCss: 'e-icons MT_PasteTextonly' },
]
},
{ separator: true },
{ text: 'Delete', iconCss: 'e-icons MT_Delete' },
{ text: 'Select all', iconCss: 'e-icons MT_SelectAll' },
{ text: 'Search', iconCss: 'e-icons MT_Search' },
]
},
{
text: 'View',
items: [
{ text: 'Page Setup', iconCss: 'e-icons M_PageSetup' },
{ text: 'Page Number', iconCss: 'e-icons M_PageNumber' },
{
text: 'Mode', iconCss: 'e-icons MT_Preview',
items: [
{ text: 'Editing', iconCss: 'e-icons biz_edit_icon' },
{ text: 'View only', iconCss: 'e-icons MT_Preview' },
]
},
{
text: 'Break', iconCss: 'e-icons M_Break',
items: [
{ text: 'Page Break', iconCss: 'e-icons M_PageBreak' },
{ text: 'Section Break', iconCss: 'e-icons M_SectionBreak' },
]
},
{ separator: true },
{ text: 'Full screen', iconCss: 'e-icons biz-enterfullscreen' },
]
},
{
text: 'Insert',
items: [
{ text: 'Header', iconCss: 'e-icons M_Header' },
{ text: 'Footer', iconCss: 'e-icons M_Footer' },
{ separator: true },
{ text: 'Image', iconCss: 'e-icons B_Image' },
{ text: 'Table', iconCss: 'e-icons table-02' },
{ text: 'Link', iconCss: 'e-icons e-Hyperlink' },
{ text: 'Bookmark', iconCss: 'e-icons M_Bookmark' },
{ text: 'Table Of Contents', iconCss: 'e-icons M_TableOfContent' },
{ separator: true },
{ text: 'Footnote', iconCss: 'e-icons M_Footnote' },
{ text: 'Endnote', iconCss: 'e-icons M_Endnote' },
]
},
{
text: 'Format',
items: [
{
text: 'Text', iconCss: 'e-icons ',
items: [
{ text: 'Bold', iconCss: 'e-icons ' },
{ text: 'Italic', iconCss: 'e-icons ' },
{ text: 'Underline', iconCss: 'e-icons ' },
{ text: 'Strikethrough', iconCss: 'e-icons ' },
{ text: 'Superscript', iconCss: 'e-icons ' },
{ text: 'Subscript', iconCss: 'e-icons ' },
]
},
{
text: 'Font size', iconCss: 'e-icons ',
items: [
{ text: '8', iconCss: 'e-icons ' },
{ text: '9', iconCss: 'e-icons ' },
{ text: '10', iconCss: 'e-icons ' },
{ text: '11', iconCss: 'e-icons ' },
{ text: '12', iconCss: 'e-icons ' },
{ text: '14', iconCss: 'e-icons ' },
{ text: '16', iconCss: 'e-icons ' },
{ text: '18', iconCss: 'e-icons ' },
{ text: '20', iconCss: 'e-icons ' },
{ text: '22', iconCss: 'e-icons ' },
{ text: '24', iconCss: 'e-icons ' },
{ text: '26', iconCss: 'e-icons ' },
{ text: '28', iconCss: 'e-icons ' },
{ text: '36', iconCss: 'e-icons ' },
{ text: '48', iconCss: 'e-icons ' },
{ text: '72', iconCss: 'e-icons ' },
{ text: '96', iconCss: 'e-icons ' },
]
},
{
text: 'Paragraph styles', iconCss: 'e-icons ',
items: [
{ text: 'Normal', iconCss: 'e-icons ' },
{ text: 'Heading 1', iconCss: 'e-icons ' },
{ text: 'Heading 2', iconCss: 'e-icons ' },
{ text: 'Heading 3', iconCss: 'e-icons ' },
{ text: 'Heading 4', iconCss: 'e-icons ' },
{ text: 'Heading 5', iconCss: 'e-icons ' },
{ text: 'Heading 6', iconCss: 'e-icons ' },
]
},
{
text: 'Align & indent', iconCss: 'e-icons ',
items: [
{ text: 'Left', iconCss: 'e-icons ' },
{ text: 'Center', iconCss: 'e-icons ' },
{ text: 'Right', iconCss: 'e-icons ' },
{ text: 'Justified', iconCss: 'e-icons ' },
{ separator: true },
{ text: 'Increase indent', iconCss: 'e-icons ' },
{ text: 'Decrease indent', iconCss: 'e-icons ' },
]
},
{
text: 'Line spacing', iconCss: 'e-icons ',
items: [
{ text: 'Single' },
{ text: '1.15' },
{ text: '1.5' },
{ text: 'Double' },
]
},
{
text: 'Bulletes & numbering', iconCss: 'e-icons ', items: [
{
text: 'Bullets',
items: [
{ text: 'None' },
{ text: 'Bullet dot' },
{ text: 'Bullet circle' },
{ text: 'Bullet square' },
{ text: 'Bullet flower' },
{ text: 'Bullet arrow' },
{ text: 'Bullet tick' },
]
},
{
text: 'Numbering', items: [
{ text: 'No numbering' },
{ text: 'Numbers' },
{ text: 'Lower case' },
{ text: 'Upper case' },
{ text: 'roman' },
{ text: 'roman two' },
]
},
]
},
{ separator: true },
{ text: 'Clear formatting', iconCss: 'e-icons ' },
]
},
{
text: 'Tools',
items: [
{ text: 'Comments', iconCss: 'e-icons AddComment' },
{ text: 'Track Changes', iconCss: 'e-icons M_TrackChanges' },
{ text: 'Local ClipBoard', iconCss: 'e-icons MT_Paste' },
{ text: 'Restrict Editing', iconCss: 'e-icons M_Lock', items: [{ text: "Read Only" }, { text: "Protections" }] },
]
},
{
text: 'Add-ons',
items: [
{
text: 'Form Fields', iconCss: 'e-icons M_FormField', items: [{ text: "Text Form", iconCss: 'e-icons M_Textform' },
{ text: "Check Box", iconCss: 'e-icons M_CheckBox' }, { text: "Drop-Down", iconCss: 'e-icons M_Dropdown' }]
},
{ text: 'Update Fields', iconCss: 'e-icons M_UpdateField' },
]
}
];
if (!this.wordDocumentMenubarObj) {
let menubaritems = ["File", "Edit", "View", "Insert", "Format", "Tools", "Add-ons"];
this.wordDocumentMenubarObj = new ej.navigations.Menu({
cssClass: 'biz-doc-menu',
showItemOnClick: true,
beforeItemRender: (e) => {
let popupitems = ["Text", "Font size", "Paragraph styles", "Align & indent", "Line spacing",
"Bullets & numbering", "Bold", "Italic", "Underline", "Strikethrough", "Superscript",
"Subscript", "Normal", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Heading 5",
"Heading 6", "8", "9", "10", "11", "12", "16", "14", "18", "20", "22", "24", "26", "48", "28", "36", "72", "96"];
if (popupitems.includes(e.item.text)) {
if (this.docBase.formatInfo && this.docBase.formatInfo.element && this.docBase.formatInfo.element.characterFormat) {
(this.docBase.formatInfo.element.characterFormat.bold) && (e.item.text == "Bold") && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.italic) && (e.item.text == "Italic") && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.baselineAlignment == e.item.text) && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Underline") && (this.docBase.formatInfo.element.characterFormat.underline == "Single") && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Strikethrough") && (this.docBase.formatInfo.element.characterFormat.strikethrough == "SingleStrike") && (this.addOrRemoveSelectIcon(e));
(e.item.text == "Text") && ((this.docBase.formatInfo.element.characterFormat.bold) || (this.docBase.formatInfo.element.characterFormat.italic) ||
(this.docBase.formatInfo.element.characterFormat.baselineAlignment == e.item.text) ||
(this.docBase.formatInfo.element.characterFormat.underline == "Single") ||
(this.docBase.formatInfo.element.characterFormat.strikethrough == "SingleStrike")) && (this.addOrRemoveSelectIcon(e));
(this.docBase.formatInfo.element.characterFormat.fontSize == e.item.text) && (this.addOrRemoveSelectIcon(e));
if (this.docBase.formatInfo.element.characterFormat.baseCharStyle) {
((this.docBase.formatInfo.element.characterFormat.baseCharStyle.name).slice(0, -5) == e.item.text) && (this.addOrRemoveSelectIcon(e));
}
else {
(e.item.text == "Normal") && (this.addOrRemoveSelectIcon(e));
}
(e.item.text == "Paragraph styles") && (this.addOrRemoveSelectIcon(e));
var fontsizes = ["8", "9", "10", "11", "12", "16", "14", "18", "20", "22", "24", "26", "48", "28", "36", "72", "96"];
(e.item.text == "Font size") && (fontsizes.includes(this.docBase.formatInfo.element.characterFormat.fontSize.toString())) && (this.addOrRemoveSelectIcon(e));
}
}
},
beforeClose: e => {
if (menubaritems.indexOf(e.parentItem.text) > -1) {
this.wordDocumentMenubarObj.showItemOnClick = true;
}
},
beforeOpen: (e) => {
if (menubaritems.indexOf(e.parentItem.text) > -1) {
this.wordDocumentMenubarObj.showItemOnClick = false;
}
let editItems = ["Undo", "Redo", "Paste", "Special paste"];
if (e.items.find(x => x.text == "Undo") != null) {
let undoOverley = document.getElementById("DocumentViewer_toolbar_undo").parentElement.classList.contains("e-overlay");
if (undoOverley) {
this.wordDocumentMenubarObj.enableItems(["Undo"], false);
}
}
if (e.items.find(x => x.text == "Redo") != null) {
let redoOverley = document.getElementById("DocumentViewer_toolbar_redo").parentElement.classList.contains("e-overlay");
if (redoOverley) {
this.wordDocumentMenubarObj.enableItems(["Redo"], false);
}
}
},
select: (e) => {
var lineHeight = document.getElementById("DocumentViewer_editor_font_properties_lineHeight").ej2_instances[0];
var bullets = document.getElementById("DocumentViewer_editor_font_properties_bullet_dropdownbtn").ej2_instances[0];
console.log(e);
switch (e.item.text) {
case "New":
this.processNewWord();
break;
case "Microsoft Word Document (.docx)":
this.fileDownload.downloadDocumentFile(FileId, documentGroup, FileName, 'Docx', instance.docBase.documentContainer);
break;
case "Portable Document Format (.pdf)":
this.docBase.convertDocsToPdfDownload(FileId);
break;
case "Text Document (.txt)":
this.fileDownload.downloadDocumentFile(FileId, documentGroup, FileName, 'Txt', instance.docBase.documentContainer);
break;
case "Open":
this.renderOpenNewDialogue();
break;
case "Close":
this.closePopup();
break;
case "Undo":
document.getElementById("DocumentViewer_toolbar_undo").click();
break;
case "Redo":
document.getElementById("DocumentViewer_toolbar_redo").click();
break;
case "Cut":
this.docBase.wordDocumentObj.documentEditor.editor.cut();
break;
case "Copy":
this.docBase.wordDocumentObj.documentEditor.selection.copy();
break;
case "Paste":
this.docBase.wordDocumentObj.documentEditor.editor.paste();
break;
case "Match destination formatting":
this.closePopup();
break;
case "Text only":
this.closePopup();
break;
case "Keep source formatting":
this.closePopup();
break;
case "Delete":
this.docBase.wordDocumentObj.documentEditor.editor.delete();
break;
case "Select all":
this.docBase.wordDocumentObj.documentEditor.selection.selectAll();
break;
case "Search":
this.docBase.wordDocumentObj.documentEditor.showOptionsPane();
break;
case "View only":
this.docBase.wordDocumentObj.documentEditor.isReadOnly = true;
break;
case "Editing":
this.docBase.wordDocumentObj.documentEditor.isReadOnly = false;
break;
case "Header":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_header" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Footer":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_footer" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Setup":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_page_setup" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Number":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_page_number" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Page Break":
this.wordDocumentObj.toolbarModule.container.documentEditor.editorModule.insertPageBreak();
break;
case "Section Break":
this.wordDocumentObj.toolbarModule.container.documentEditor.editorModule.insertSectionBreak();
break;
case "Footnote":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_footnote" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Endnote":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_endnote" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Full screen":
Unibase.Apps.Collaboration.Components.Fullscreen.Instance().refreshWordDocumentHeight(this.wordDocumentObj);
break;
case "Image":
this.wordDocumentObj.toolbarModule.imagePicker.value = "";
this.wordDocumentObj.toolbarModule.imagePicker.click();
setTimeout(() => { this.wordDocumentObj.toolbarModule.documentEditor.focusIn(); }, 30);
break;
case "Table":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_table" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Link":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_link" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Bookmark":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_bookmark" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Table Of Contents":
this.wordDocumentObj.documentEditor.showDialog('TableOfContents');
break;
case "Bold":
document.getElementById("DocumentViewer_editor_font_properties_bold").click();
break;
case "Italic":
document.getElementById("DocumentViewer_editor_font_properties_italic").click();
break;
case "Underline":
document.getElementById("DocumentViewer_editor_font_properties_underline").click();
break;
case "Strikethrough":
document.getElementById("DocumentViewer_editor_font_properties_strikethrough").click();
break;
case "Superscript":
document.getElementById("DocumentViewer_editor_font_properties_superscript").click();
break;
case "Subscript":
document.getElementById("DocumentViewer_editor_font_properties_subscript").click();
break;
case "Clear formatting":
document.getElementById("DocumentViewer_editor_font_properties_clearFormat").click();
break;
case "Left":
document.getElementById("DocumentViewer_editor_font_properties_leftIndent").click();
break;
case "Center":
document.getElementById("DocumentViewer_editor_font_properties_centerIndent").click();
break;
case "Right":
document.getElementById("DocumentViewer_editor_font_properties_rightIndent").click();
break;
case "Justified":
document.getElementById("DocumentViewer_editor_font_properties_justify").click();
break;
case "Increase indent":
document.getElementById("DocumentViewer_editor_font_properties_increaseIndent").click();
break;
case "Decrease indent":
document.getElementById("DocumentViewer_editor_font_properties_decreaseIndent").click();
break;
case "Single":
lineHeight.trigger('select', { item: lineHeight.items[0] });
break;
case "1.15":
lineHeight.trigger('select', { item: lineHeight.items[1] });
break;
case "1.5":
lineHeight.trigger('select', { item: lineHeight.items[2] });
break;
case "Double":
lineHeight.trigger('select', { item: lineHeight.items[3] });
break;
case "None":
this.wordDocumentObj.textProperties.paragraph.numberedNoneClick();
break;
case "Bullet dot":
this.wordDocumentObj.textProperties.paragraph.bulletDotClick();
break;
case "Bullet circle":
this.wordDocumentObj.textProperties.paragraph.bulletCircleClick();
break;
case "Bullet square":
this.wordDocumentObj.textProperties.paragraph.bulletSquareClick();
break;
case "Bullet flower":
this.wordDocumentObj.textProperties.paragraph.bulletFlowerClick();
break;
case "Bullet arrow":
this.wordDocumentObj.textProperties.paragraph.bulletArrowClick();
break;
case "Bullet tick":
this.wordDocumentObj.textProperties.paragraph.bulletTickClick();
break;
case "Numbers":
this.wordDocumentObj.textProperties.paragraph.numberedNumberDotClick();
break;
case "Lower case":
this.wordDocumentObj.textProperties.paragraph.numberedLowLetterClick();
break;
case "Upper case":
this.wordDocumentObj.textProperties.paragraph.numberedUpLetterClick();
break;
case "roman":
this.wordDocumentObj.textProperties.paragraph.numberedLowRomanClick();
break;
case "roman two":
this.wordDocumentObj.textProperties.paragraph.numberedUpRomanClick();
break;
case "No numbering":
this.wordDocumentObj.textProperties.paragraph.numberedNoneClick();
break;
case "Normal":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Normal', true);
break;
case "Heading 1":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 1', true);
break;
case "Heading 2":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 2', true);
break;
case "Heading 3":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 3', true);
break;
case "Heading 4":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 4', true);
break;
case "Heading 5":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 5', true);
break;
case "Heading 6":
this.wordDocumentObj.documentEditor.editorModule.applyStyle('Heading 6', true);
break;
case "8":
this.setFontSize('8');
break;
case "9":
this.setFontSize('9');
break;
case "10":
this.setFontSize('10');
break;
case "11":
this.setFontSize('11');
break;
case "12":
this.setFontSize('12');
break;
case "14":
this.setFontSize('14');
break;
case "16":
this.setFontSize('16');
break;
case "18":
this.setFontSize('18');
break;
case "20":
this.setFontSize('20');
break;
case "22":
this.setFontSize('22');
break;
case "24":
this.setFontSize('24');
break;
case "36":
this.setFontSize('36');
break;
case "Find":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_find" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Comments":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_comment" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Track Changes":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_track" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Local ClipBoard":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_use_local_clipboard" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
case "Read Only":
var ele = $('li[aria-label="Read Only"]').children('span').toggleClass('Selection');
const value = 12;
this.wordDocumentObj.toolbarModule.toggleEditing();
break;
case "Protections":
this.wordDocumentObj.toolbarModule.documentEditor.documentHelper.restrictEditingPane.showHideRestrictPane(true);
break;
case "Text Form":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('Text');
break;
case "Check Box":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('CheckBox');
break;
case "Drop-Down":
this.wordDocumentObj.toolbarModule.documentEditor.editor.insertFormField('DropDown');
break;
case "Update Fields":
this.wordDocumentObj.toolbarModule.clickHandler({ item: { id: this.wordDocumentObj.element.id + "_toolbar_update_fields" }, name: "clicked", originalEvent: { target: this.wordDocumentObj.element } });
break;
}
},
items: menuItems,
}, '#menu');
}
}
addOrRemoveSelectIcon(ele) {
if (!ele.element.firstElementChild.classList.contains("biz-ss-selecticon")) {
ele.element.firstElementChild.classList.add("biz-ss-selecticon");
}
}
processNewWord() {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/common/util.js", () => {
let urlStr = Unibase.Apps.Collaboration.Components.Common.Util.Instance().makeid(40);
window.open(window.origin + "#/documents/" + urlStr + "/newword/0");
});
}
renderOpenNewDialogue() {
this.OpenSelectButton = new ej.buttons.Button({ cssClass: `e-flat` });
this.OpenCancelButton = new ej.buttons.Button({ cssClass: `e-flat` });
var elem = document.getElementById("opendocfile");
if (elem == null) {
this.docOpenDialougObj = new ej.popups.Dialog({
isModal: true,
header: 'Open File',
content: `<div id='tabobjforopendoc'></div>`,
target: document.getElementById("container"),
width: '470px',
height: '330px',
animationSettings: { effect: 'Zoom' },
cssClass: "biz-doc-importopen-dialog"
});
this.docOpenDialougObj.appendTo('#dialog');
var tabObjForOpen = new ej.navigations.Tab({
items: [{
header: { 'text': 'Upload' },
content: `<div id="opendocfile-wrapper">
<h2 style="color: #ccc">Drag a file...</h2>
<label id='opendocfilelable'>
select file from device
<br>
<input type="file" name="" id="opendocfile" accept=".doc, .docx, .txt , .rtf" placeholder="select a file from your device" >
</label>
<div id="filename"></div>
</div>
</div>
<button id='opendocfile-select-btn' class='e-disabled'>select</button>
<button id='opendocfile-cancel-btn'>cancel</button>`
}]
});
tabObjForOpen.appendTo('#tabobjforopendoc');
}
else {
this.docOpenDialougObj.show();
}
this.importOpenDialogcreated();
}
importOpenDialogcreated() {
document.getElementById('opendocfile-select-btn').setAttribute("disabled", 'true');
document.getElementById('opendocfile-select-btn').addEventListener('click', () => {
this.openWordDocument();
this.docOpenDialougObj.hide();
});
document.getElementById('opendocfile-cancel-btn').addEventListener('click', () => {
this.docOpenDialougObj.hide();
document.getElementById('opendocfile-select-btn').classList.add('e-disabled');
document.getElementById('filename').innerHTML = "";
this.importedFile.value = null;
if (this.docOpenDialougObj) {
this.docOpenDialougObj.destroy();
}
});
this.OpenSelectButton.appendTo('#opendocfile-select-btn');
this.OpenCancelButton.appendTo('#opendocfile-cancel-btn');
document.body.addEventListener('dragover', (e) => {
e.preventDefault();
});
document.getElementsByClassName('biz-doc-importopen-dialog')[0].addEventListener('dragover', (e) => {
e.preventDefault();
});
document.getElementsByClassName('biz-doc-importopen-dialog')[0].addEventListener("drop", (e) => {
e.preventDefault();
document.getElementById('opendocfile').files = e.dataTransfer.files;
var ele = { target: { files: e.dataTransfer.files } };
this.fileSelected(ele);
});
document.getElementById('opendocfile').addEventListener('change', (e) => {
debugger;
this.fileSelected(e);
});
}
fileSelected(e) {
document.getElementById('opendocfile-select-btn').removeAttribute('disabled');
document.getElementById('opendocfile-select-btn').classList.remove('e-disabled');
this.importedFile = document.getElementById('opendocfile');
document.getElementById('filename').innerHTML = this.importedFile.files[0].name;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/core/helpers/file/filehelper.js', () => {
Unibase.Platform.Helpers.FileHelper.Instance().getBase64(e).then((response) => {
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.length != 0) {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var refId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
if (refId != 0 && refId != null && refId != undefined) {
}
}
var fileobject = {
filedata: response.FileData,
filename: response.FileName,
filetype: response.FileType,
RefId: refId,
FileId: this.FileId,
};
this.documentOpenFileData = fileobject;
});
});
}
openWordDocument() {
Unibase.Apps.Collaboration.DocumentManager.Instance().importCreateSpreadSheet(this.documentOpenFileData).then((response) => {
var result = response.result;
});
}
closePopup() {
if (!this.docBase.NewDocument) {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();
}
window.close();
}
appendToolbarElements() {
let sideBarElementsText = [];
let sideBarElementsIndent = [];
let sideBarElementsParagraph = [];
var idsText = ['DocumentViewer_editor_font_properties_fontFamilyDiv', 'DocumentViewer_editor_font_properties_fontSizeDiv', 'DocumentViewer_editor_font_properties_leftDiv',
'DocumentViewer_editor_font_properties_rightDiv'];
let idsParagraph = ['DocumentViewer_editor_font_properties_color', 'DocumentViewer_editor_font_properties_styleDiv'];
var idsIndent = ['DocumentViewer_editor_font_properties_leftIndent', 'DocumentViewer_editor_font_properties_centerIndent', 'DocumentViewer_editor_font_properties_rightIndent', 'DocumentViewer_editor_font_properties_justify',
'DocumentViewer_editor_font_properties_decreaseIndent', 'DocumentViewer_editor_font_properties_increaseIndent', 'DocumentViewer_editor_font_properties_lineHeight',
'DocumentViewer_editor_font_properties_listDropDiv'];
idsText.forEach(element => {
sideBarElementsText.push(document.getElementById(element));
});
idsIndent.forEach(element => {
sideBarElementsIndent.push(document.getElementById(element));
});
idsParagraph.forEach(element => {
sideBarElementsParagraph.push(document.getElementById(element));
});
sideBarElementsText.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-text', 0, element);
});
sideBarElementsIndent.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-indent', 0, element);
});
sideBarElementsParagraph.forEach(element => {
this.util.appendChildren('biz-doc-bottomtoolbar-paragraph', 0, element);
});
this.docBase.bottomtoolbartext = document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0];
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-undo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-undo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-undo-icon e-btn-icon'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-redo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-redo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-redo-icon e-btn-icon'));
document.getElementsByClassName("biz-doc-undo")[0].id = "biz_doc_undobtn";
document.getElementsByClassName("biz-doc-redo")[0].id = "biz_doc_redobtn";
this.docBase.bottomtoolbartext.insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0].childNodes[0]);
this.docBase.bottomtoolbartext.insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-text')[0].childNodes[2]);
document.getElementsByClassName('biz-doc-bottomtoolbar-indent')[0].insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementsByClassName('biz-doc-bottomtoolbar-indent')[0].childNodes[0]);
document.getElementById('biz_doc_undobtn').insertBefore(this.util.createElement('div', 'class', 'biz-doc-toobarspace'), document.getElementById('biz_doc_undobtn').childNodes[0]);
document.getElementById('DocumentViewer_editor_font_properties_increaseIndent').after(this.util.createElement('div', 'class', 'biz-doc-toobarspace'));
document.getElementById('DocumentViewer_editor_font_properties_clearFormat').after(this.util.createElement('div', 'class', 'biz-doc-toobarspace'));
document.getElementById('DocumentViewer_editor_font_properties_fontSizeDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_rightDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_styleDiv').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_lineHeight').after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
document.getElementById('DocumentViewer_editor_font_properties_color').getElementsByClassName("e-colorpicker-wrapper")[0].after(this.util.createElement('div', 'class', 'e-toolbar-item e-separator biz-doc-seperator'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-undo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-undo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-undo-icon e-btn-icon'));
this.util.appendChildren('biz-doc-bottomtoolbar-undoredo', 0, this.util.createElement("button", 'class', 'biz-doc-redo e-disabled e-btn e-lib'));
this.util.appendChildren('biz-doc-redo', 0, this.util.createElement("span", 'class', 'e-icons e-icon-left biz-doc-redo-icon e-btn-icon'));
this.docBase.toolbarWidth = document.querySelector('.biz-doc-bottomtoolbar-undoredo').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-text').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-paragraph').getBoundingClientRect().width + document.querySelector('.biz-doc-bottomtoolbar-indent').getBoundingClientRect().width;
}
createResponsiveToolbar() {
var instance = this;
document.getElementsByClassName('biz-doc-bottomtoolbar')[0].insertBefore(this.util.createElement('div', 'class', 'leftarrow-wrapper'), document.getElementsByClassName('biz-doc-bottomtoolbar')[0].childNodes[0]);
document.getElementsByClassName('biz-doc-bottomtoolbar')[0].appendChild(this.util.createElement('div', 'class', 'rightarrow-wrapper'));
document.getElementsByClassName('leftarrow-wrapper')[0].appendChild(this.util.createElement('button', 'id', 'leftarrow-btn'));
document.getElementsByClassName('rightarrow-wrapper')[0].appendChild(this.util.createElement('button', 'id', 'rightarrow-btn'));
this.docBase.rightArrowBtn = document.getElementById('rightarrow-btn');
this.docBase.leftArrowBtn = document.getElementById('leftarrow-btn');
this.docBase.leftArrowWrapper = document.getElementsByClassName('leftarrow-wrapper')[0];
this.docBase.rightArrowWrapper = document.getElementsByClassName('rightarrow-wrapper')[0];
this.docBase.toolbarWrapper = document.getElementsByClassName('biz-doc-toolbar-wrapper')[0];
this.docBase.rightArrowBtn.classList.add('e-icons');
this.docBase.rightArrowBtn.classList.add('biz_right_arrow');
this.docBase.leftArrowBtn.classList.add('e-icons');
this.docBase.leftArrowBtn.classList.add('biz_left_arrow');
this.docBase.leftArrowBtn.classList.add('e-disabled');
this.docBase.leftArrowWrapper.style.display = 'none';
this.docBase.rightArrowWrapper.style.display = 'none';
this.setToolbarWidth();
this.docBase.rightArrowBtn.addEventListener('click', () => {
this.docBase.toolbarWrapper.scrollBy({
top: 0,
left: 300,
behavior: "smooth"
});
this.docBase.leftArrowBtn.classList.remove('e-disabled');
});
this.docBase.leftArrowBtn.addEventListener('click', () => {
this.docBase.toolbarWrapper.scrollBy({
top: 0,
left: -300,
behavior: "smooth"
});
this.docBase.rightArrowBtn.classList.remove('e-disabled');
});
this.docBase.toolbarWrapper.addEventListener('scroll', () => {
if (this.docBase.toolbarWrapper.scrollWidth - this.docBase.toolbarWrapper.scrollLeft - this.docBase.toolbarWrapper.clientWidth < 1) {
this.docBase.rightArrowBtn.classList.add("e-disabled");
}
else if (this.docBase.toolbarWrapper.scrollLeft == 0) {
this.docBase.leftArrowBtn.classList.add("e-disabled");
}
});
window.addEventListener('resize', () => {
this.setToolbarWidth();
});
}
setDisplay(value) {
this.docBase.leftArrowWrapper.style.display = value;
this.docBase.rightArrowWrapper.style.display = value;
}
getBtnsWidth() {
return document.getElementsByClassName('leftarrow-wrapper')[0].getBoundingClientRect().width + document.getElementsByClassName('rightarrow-wrapper')[0].getBoundingClientRect().width;
}
setToolbarWidth() {
if (window.innerWidth <= this.docBase.toolbarWidth + this.getBtnsWidth()) {
this.setDisplay('');
this.docBase.toolbarWrapper.style.width = 'calc(100% - 72px)';
}
else {
this.setDisplay('none');
this.docBase.toolbarWrapper.style.width = this.docBase.toolbarWidth + 3 + 'px';
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Ribbon();
}
return this.instance;
}
}
DocEditor.Ribbon = Ribbon;
})(DocEditor = Components.DocEditor || (Components.DocEditor = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"ribbon.js","sourceRoot":"","sources":["ribbon.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CAk+BhB;AAl+BD,WAAU,OAAO;IACb,IAAiB,IAAI,CAg+BpB;IAh+BD,WAAiB,IAAI;QACjB,IAAiB,aA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UAAU,EAAE;gDAC5C,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE;6CAE7C;yCACJ;wCACD;4CACI,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU;4CACtC,KAAK,EAAE;gDACH,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE;gDAClC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE;gDAClC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;gDACnC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,UAAULine truncated
+13
View File
@@ -0,0 +1,13 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{init(t,i){this.FileName=i.FileName;this.FileId=i.FileId;this.documentGroup=i.DocumentGroup;this.wordDocumentObj=t;this.docBase=n.Apps.Collaboration.Components.DocEditor.Base.Instance();this.fileDownload=n.Apps.Collaboration.Components.Common.Download.Instance();this.util=n.Apps.Collaboration.Components.Common.Util.Instance();this.render()}render(){this.wordDocumentMenubar(this.FileId,this.documentGroup,this.FileName);this.appendToolbarElements();this.createResponsiveToolbar();this.updateProp()}updateProp(){this.fontSize=document.getElementById("DocumentViewer_editor_font_properties_fontSize").ej2_instances[0]}setFontSize(n){this.wordDocumentObj.textProperties.text.isRetrieving=!1;this.fontSize.value=n}wordDocumentMenubar(t,i,r){var u=this,f=[{text:"File",items:[{text:"New",iconCss:"e-icons add-new"},{text:"Open",iconCss:"e-icons e-open"},{text:"Make a copy",iconCss:"e-icons biz_make_a_copy"},{text:"Download",iconCss:"e-icons e-save",items:[{text:"Microsoft Word Document (.docx)",iconCss:"e-icons"},{text:"Portable Document Format (.pdf)",iconCss:"e-icons Pdf_Export"},{text:"Text Document (.txt)",iconCss:"e-icons"}]},{text:"Close",iconCss:"e-icons cross-close"},]},{text:"Edit",items:[{text:"Undo",iconCss:"e-icons biz-doc-undo-icon"},{text:"Redo",iconCss:"e-icons biz-doc-redo-icon"},{separator:!0},{text:"Cut",iconCss:"e-icons biz-doc-cut-icon"},{text:"Copy",iconCss:"e-icons biz-doc-copy-icon"},{text:"Paste",iconCss:"e-icons biz-doc-paste-icon"},{text:"Special paste",iconCss:"e-icons biz-doc-paste-icon",items:[{text:"Keep source formatting",iconCss:"e-icons MT_PasteStyle"},{text:"Match destination formatting",iconCss:"e-icons M_MergeFormatting"},{text:"Text only",iconCss:"e-icons MT_PasteTextonly"},]},{separator:!0},{text:"Delete",iconCss:"e-icons MT_Delete"},{text:"Select all",iconCss:"e-icons MT_SelectAll"},{text:"Search",iconCss:"e-icons MT_Search"},]},{text:"View",items:[{text:"Page Setup",iconCss:"e-icons M_PageSetup"},{text:"Page Number",iconCss:"e-icons M_PageNumber"},{text:"Mode",iconCss:"e-icons MT_Preview",items:[{text:"Editing",iconCss:"e-icons biz_edit_icon"},{text:"View only",iconCss:"e-icons MT_Preview"},]},{text:"Break",iconCss:"e-icons M_Break",items:[{text:"Page Break",iconCss:"e-icons M_PageBreak"},{text:"Section Break",iconCss:"e-icons M_SectionBreak"},]},{separator:!0},{text:"Full screen",iconCss:"e-icons biz-enterfullscreen"},]},{text:"Insert",items:[{text:"Header",iconCss:"e-icons M_Header"},{text:"Footer",iconCss:"e-icons M_Footer"},{separator:!0},{text:"Image",iconCss:"e-icons B_Image"},{text:"Table",iconCss:"e-icons table-02"},{text:"Link",iconCss:"e-icons e-Hyperlink"},{text:"Bookmark",iconCss:"e-icons M_Bookmark"},{text:"Table Of Contents",iconCss:"e-icons M_TableOfContent"},{separator:!0},{text:"Footnote",iconCss:"e-icons M_Footnote"},{text:"Endnote",iconCss:"e-icons M_Endnote"},]},{text:"Format",items:[{text:"Text",iconCss:"e-icons ",items:[{text:"Bold",iconCss:"e-icons "},{text:"Italic",iconCss:"e-icons "},{text:"Underline",iconCss:"e-icons "},{text:"Strikethrough",iconCss:"e-icons "},{text:"Superscript",iconCss:"e-icons "},{text:"Subscript",iconCss:"e-icons "},]},{text:"Font size",iconCss:"e-icons ",items:[{text:"8",iconCss:"e-icons "},{text:"9",iconCss:"e-icons "},{text:"10",iconCss:"e-icons "},{text:"11",iconCss:"e-icons "},{text:"12",iconCss:"e-icons "},{text:"14",iconCss:"e-icons "},{text:"16",iconCss:"e-icons "},{text:"18",iconCss:"e-icons "},{text:"20",iconCss:"e-icons "},{text:"22",iconCss:"e-icons "},{text:"24",iconCss:"e-icons "},{text:"26",iconCss:"e-icons "},{text:"28",iconCss:"e-icons "},{text:"36",iconCss:"e-icons "},{text:"48",iconCss:"e-icons "},{text:"72",iconCss:"e-icons "},{text:"96",iconCss:"e-icons "},]},{text:"Paragraph styles",iconCss:"e-icons ",items:[{text:"Normal",iconCss:"e-icons "},{text:"Heading 1",iconCss:"e-icons "},{text:"Heading 2",iconCss:"e-icons "},{text:"Heading 3",iconCss:"e-icons "},{text:"Heading 4",iconCss:"e-icons "},{text:"Heading 5",iconCss:"e-icons "},{text:"Heading 6",iconCss:"e-icons "},]},{text:"Align & indent",iconCss:"e-icons ",items:[{text:"Left",iconCss:"e-icons "},{text:"Center",iconCss:"e-icons "},{text:"Right",iconCss:"e-icons "},{text:"Justified",iconCss:"e-icons "},{separator:!0},{text:"Increase indent",iconCss:"e-icons "},{text:"Decrease indent",iconCss:"e-icons "},]},{text:"Line spacing",iconCss:"e-icons ",items:[{text:"Single"},{text:"1.15"},{text:"1.5"},{text:"Double"},]},{text:"Bulletes & numbering",iconCss:"e-icons ",items:[{text:"Bullets",items:[{text:"None"},{text:"Bullet dot"},{text:"Bullet circle"},{text:"Bullet square"},{text:"Bullet flower"},{text:"Bullet arrow"},{text:"Bullet tick"},]},{text:"Numbering",items:[{text:"No numbering"},{text:"Numbers"},{text:"Lower case"},{text:"Upper case"},{text:"roman"},{text:"roman two"},]},]},{separator:!0},{text:"Clear formatting",iconCss:"e-icons "},]},{text:"Tools",itLine truncated
<h2 style="color: #ccc">Drag a file...</h2>
<label id='opendocfilelable'>
select file from device
<br>
<input type="file" name="" id="opendocfile" accept=".doc, .docx, .txt , .rtf" placeholder="select a file from your device" >
</label>
<div id="filename"></div>
</div>
</div>
<button id='opendocfile-select-btn' class='e-disabled'>select</button>
<button id='opendocfile-cancel-btn'>cancel</button>`}]}),t.appendTo("#tabobjforopendoc")):this.docOpenDialougObj.show();this.importOpenDialogcreated()}importOpenDialogcreated(){document.getElementById("opendocfile-select-btn").setAttribute("disabled","true");document.getElementById("opendocfile-select-btn").addEventListener("click",()=>{this.openWordDocument(),this.docOpenDialougObj.hide()});document.getElementById("opendocfile-cancel-btn").addEventListener("click",()=>{this.docOpenDialougObj.hide(),document.getElementById("opendocfile-select-btn").classList.add("e-disabled"),document.getElementById("filename").innerHTML="",this.importedFile.value=null,this.docOpenDialougObj&&this.docOpenDialougObj.destroy()});this.OpenSelectButton.appendTo("#opendocfile-select-btn");this.OpenCancelButton.appendTo("#opendocfile-cancel-btn");document.body.addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-doc-importopen-dialog")[0].addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-doc-importopen-dialog")[0].addEventListener("drop",n=>{n.preventDefault();document.getElementById("opendocfile").files=n.dataTransfer.files;var t={target:{files:n.dataTransfer.files}};this.fileSelected(t)});document.getElementById("opendocfile").addEventListener("change",n=>{this.fileSelected(n)})}fileSelected(t){document.getElementById("opendocfile-select-btn").removeAttribute("disabled");document.getElementById("opendocfile-select-btn").classList.remove("e-disabled");this.importedFile=document.getElementById("opendocfile");document.getElementById("filename").innerHTML=this.importedFile.files[0].name;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/file/filehelper.js",()=>{n.Platform.Helpers.FileHelper.Instance().getBase64(t).then(t=>{var r,i,u;n.Themes.Providers.Detail_Settings.Instance().InputParameters.length!=0&&(r=n.Themes.Providers.DetailHelper.installedAppId,i=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_recordid").Value),i!=0&&i!=null&&i!=undefined);u={filedata:t.FileData,filename:t.FileName,filetype:t.FileType,RefId:i,FileId:this.FileId};this.documentOpenFileData=u})})}openWordDocument(){n.Apps.Collaboration.DocumentManager.Instance().importCreateSpreadSheet(this.documentOpenFileData).then(n=>{var t=n.result})}closePopup(){this.docBase.NewDocument||n.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();window.close()}appendToolbarElements(){var r,u;let n=[],t=[],i=[];r=["DocumentViewer_editor_font_properties_fontFamilyDiv","DocumentViewer_editor_font_properties_fontSizeDiv","DocumentViewer_editor_font_properties_leftDiv","DocumentViewer_editor_font_properties_rightDiv"];u=["DocumentViewer_editor_font_properties_leftIndent","DocumentViewer_editor_font_properties_centerIndent","DocumentViewer_editor_font_properties_rightIndent","DocumentViewer_editor_font_properties_justify","DocumentViewer_editor_font_properties_decreaseIndent","DocumentViewer_editor_font_properties_increaseIndent","DocumentViewer_editor_font_properties_lineHeight","DocumentViewer_editor_font_properties_listDropDiv"];r.forEach(t=>{n.push(document.getElementById(t))});u.forEach(n=>{t.push(document.getElementById(n))});["DocumentViewer_editor_font_properties_color","DocumentViewer_editor_font_properties_styleDiv"].forEach(n=>{i.push(document.getElementById(n))});n.forEach(n=>{this.util.appendChildren("biz-doc-bottomtoolbar-text",0,n)});t.forEach(n=>{this.util.appendChildren("biz-doc-bottomtoolbar-indent",0,n)});i.forEach(n=>{this.util.appendChildren("biz-doc-bottomtoolbar-paragraph",0,n)});this.docBase.bottomtoolbartext=document.getElementsByClassName("biz-doc-bottomtoolbar-text")[0];this.util.appendChildren("biz-doc-bottomtoolbar-undoredo",0,this.util.createElement("button","class","biz-doc-undo e-disabled e-btn e-lib"));this.util.appendChildren("biz-doc-undo",0,this.util.createElement("span","class","e-icons e-icon-left biz-doc-undo-icon e-btn-icon"));this.util.appendChildren("biz-doc-bottomtoolbar-undoredo",0,this.util.createElement("button","class","biz-doc-redo e-disabled e-btn e-lib"));this.util.appendChildren("biz-doc-redo",0,this.util.createElement("span","class","e-icons e-icon-left biz-doc-redo-icon e-btn-icon"));document.getElementsByClassName("biz-doc-undo")[0].id="biz_doc_undobtn";document.getElementsByClassName("biz-doc-redo")[0].id="biz_doc_redobtn";this.docBase.bottomtoolbartext.insertBefore(this.util.createElement("div","class","biz-doc-toobarspace"),document.getElementsByClassName("biz-doc-bottomtoolbar-text")[0].childNodes[0]);this.docBase.bottomtoolbartext.insertBefore(this.util.createElement("div","class","biz-doc-toobarspace"),document.getElementsByClassName("biz-doc-bottomtoolbar-text")[0].childNodes[2]);document.getElementsByClassName("biz-doc-bottomtoolbar-indent")[0].insertBefore(this.util.createElement("div","class","biz-doc-toobarspace")Line truncated
@@ -0,0 +1,229 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class Documents extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.ej2Source = {
Excel: ['libs/syncfusion/excel/ej2-excel.min.js'],
Pdf: ['libs/syncfusion/pdf/ej2-pdf.min.js'],
Word: ['libs/syncfusion/word/ej2-word.min.js'],
};
}
jsFiles() {
return ["apps/collaboration/managers/documentmanager.js"];
}
cssFiles() {
return [];
}
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
var instance = this;
instance.navigationHelper.popup(Pk_Value, '', Unibase.Apps.Collaboration.Components.Documents.Instance(), function (container) {
var documentGroup = ElementId;
if (Callback != null) {
Callback();
}
}, Unibase.Platform.Helpers.Size.ExtraLarge);
}
html(id, containerid) {
var html = `<div><div id="DocumentViewer" style="width: 100%;height: 100%" class="DocumentViewer"></div></div>
<div id="dialog-container">
<div id="dialog"></div>
<div id="see-document-status"></div>
<div id="dlgContent" class="dialogContent"></div>
</div><div id="importfile-container"></div>
<div id="copydocument-container"> </div><div id="spreadsheettrim-container">
<div id="removeduplicates"></div><div id="biz-ss-menubar-fullscreendialog"></div><div id="biz-ss-resizetofit-dialog"></div></div>`;
return html;
}
load(formId, containerid, callback) {
var instance = this;
instance._containerid = containerid;
}
convertDocsToPdfDownload(documentFileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().ConvertDocstoPdfDownload(documentFileId).then(function (response) {
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(response.result);
});
}
previewSpreadSheet(fileurl, userid) {
let docManger = Unibase.Apps.Collaboration.DocumentManager.Instance();
docManger.getDocumentFileInfo(fileurl).then((response) => {
docManger.getJsonData(response.result.FileId).then((res) => {
docManger.getCustomJsonData(response.result.FileId).then((customresponse) => {
Unibase.Apps.Collaboration.Components.Documents.Instance()._documentId = response.result.FileId;
Unibase.Apps.Collaboration.Components.DocConnector.Instance().init(response.result.FileId, response.result.DocumentGroup);
this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/sheets/formatpainter.js", "apps/collaboration/components/unicloud.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/autofill.js", "apps/collaboration/components/sheets/ribbon.js", "apps/collaboration/components/sheets/dialogue.js", "apps/collaboration/components/sheets/base.js", 'apps/collaboration/components/common/download.js', 'apps/collaboration/enums/enum.js'], () => {
let sheets = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
console.log(response);
if (res.result != null && res.result != "") {
sheets.init(response, res, customresponse);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
}
else {
}
});
});
});
});
}
;
previewWordDocument(Fileurl) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(Fileurl).then((response) => {
Unibase.Apps.Collaboration.DocumentManager.Instance().getJsonData(response.result.FileId).then((res) => {
this.fileCacheHelper.loadJsFiles(['apps/collaboration/components/doceditor/base.js', 'platform/core/helpers/file/filehelper.js', 'apps/collaboration/components/sheets/base.js', 'apps/collaboration/components/unicloud.js', 'apps/collaboration/components/doceditor/ribbon.js', 'apps/collaboration/components/common/download.js'], () => {
let bizDoc = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
bizDoc.init(response, res);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
});
}
previewPdf(FileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then((response) => {
this.fileCacheHelper.loadJsFiles(['apps/collaboration/components/pdfviewer/base.js'], () => {
let bizPfd = Unibase.Apps.Collaboration.Components.PdfViewer.Base.Instance();
bizPfd.init(response);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
previewImage(documentFileId) {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(documentFileId).then(function (response) {
var result = response.result;
var fileName = result.DocumentFileName + "." + result.FileType;
var byteCharacters = atob(result.FileData);
var byteNumbers = new Array(byteCharacters.length);
for (var i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
var file = new Blob([byteArray], { type: result.DocumentGroup + '/' + result.FileType + ';base64' });
var fileURL = URL.createObjectURL(file);
window.open(fileURL, fileName, "width=600,height=600,scrollbars=yes");
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
}
previewDocument(documentFileId, documentGroup, userid) {
this.documentfileid = documentFileId;
this.documentGroup = documentGroup;
$(".unibase_modal_backdrop").removeAttr('style');
$(".preloader-it").fadeIn();
this.fileCacheHelper.loadJsFiles(["apps/collaboration/managers/documentmanager.js", "apps/collaboration/managers/filemanager.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js", "apps/collaboration/components/common/util.js", 'libs/syncfusion/ej2.min.js', 'apps/collaboration/components/fullscreen.js'], () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
if (documentGroup == "Image") {
this.previewImage(documentFileId);
}
else if (documentGroup == "Excel") {
this.previewSpreadSheet(documentFileId, userid);
}
else if (documentGroup == "Word") {
this.previewWordDocument(documentFileId);
}
else if (documentGroup == "Pdf") {
this.previewPdf(documentFileId);
}
});
});
}
downloadDocument(FileId, documentGroup) {
if (documentGroup == "Excel") {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
var data = {
FileId: FileId
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(data).then(function (response) {
var filepath = response.result;
filepath = encodeURIComponent(filepath);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(filepath);
});
});
}
else if (documentGroup == "Word") {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then(function (response) {
var filepath = response.result.DocumentFilePath;
filepath = encodeURIComponent(filepath);
Unibase.Themes.Compact.Components.Notification.Instance().Downloadfile(filepath);
});
});
}
else {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js", function () {
Unibase.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(FileId).then(function (response) {
var a = document.createElement("a");
a.href = "data:" + response.result.FileType + ";base64," + response.result.FileData;
a.download = response.result.FileTitle + "." + response.result.FileType;
a.click();
});
});
}
}
deleteDocumentFile(DocumentFileId) {
bootbox.confirm("Do you want to Delete this File ?", function (result) {
if (result == true) {
Unibase.Platform.Files.Managers.FileManager.Instance().deleteDocumentFile(DocumentFileId).then(function (response) {
MessageHelper.Instance().showSuccess("Document File Deleted Successfully.", "");
var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id");
var idetailObj = detailobj;
detailobj.loadPortlets(idetailObj);
});
}
});
}
newWordDoc(callback) {
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
this.fileCacheHelper.loadJsFiles(this.ej2Source["Word"].concat(["apps/collaboration/managers/documentmanager.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/docconnector.js", "apps/collaboration/components/unidochub.js", "apps/collaboration/components/common/util.js", 'apps/collaboration/components/fullscreen.js', 'apps/collaboration/components/sheets/base.js', 'apps/collaboration/components/doceditor/base.js', 'apps/collaboration/components/doceditor/ribbon.js', 'apps/collaboration/components/common/download.js', 'apps/collaboration/enums/enum.js']), () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
var response = {
result: { FileTitle: "Untitled Document", NewDocument: true, NewUpload: true }
};
var res = { result: "" };
let bizDoc = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
bizDoc.init(response, res, callback);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
newExcel(type, callback) {
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/sheets/formatpainter.js", "apps/collaboration/components/unicloud.js", "apps/collaboration/components/docconnector.js", 'libs/syncfusion/ej2.min.js', "apps/collaboration/components/fullscreen.js", "apps/collaboration/components/sheets/spellcheck.js", "apps/collaboration/components/sheets/autofill.js", "apps/collaboration/components/sheets/ribbon.js", "apps/collaboration/components/sheets/dialogue.js", "apps/collaboration/components/sheets/base.js", 'apps/collaboration/components/common/download.js', 'apps/collaboration/components/common/util.js', 'apps/collaboration/enums/enum.js'], () => {
this.fileCacheHelper.loadCssFiles(['libs/syncfusion/material.css', 'libs/syncfusion/custom-css.css', 'libs/syncfusion/docx.css', 'libs/syncfusion/spreadsheet-custom.css', 'libs/syncfusion/pdf.css'], () => {
var folderId;
var res = { result: "" };
var customres = { result: "" };
var response = { result: { FileTitle: "Untitled Spreadsheet", NewDocument: true, NewUpload: true, folderId: folderId } };
if (type != 0 && type != undefined) {
folderId = parseInt(atob(type));
}
else {
folderId = 0;
}
var sheets = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
sheets.init(response, res, customres, callback);
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Documents();
}
return this.instance;
}
}
Components.Documents = Documents;
class sfdtexport {
}
Components.sfdtexport = sfdtexport;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"documents.js","sourceRoot":"","sources":["documents.ts"],"names":[],"mappings":"AAeA,IAAU,OAAO,CA4ThB;AA5TD,WAAU,OAAO;IACb,IAAiB,IAAI,CA0TpB;IA1TD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAwT7B;QAxTD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAsT1B;YAtTD,WAAiB,UAAU;gBACvB,MAAa,SAAU,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAAlE;;wBAqCI,cAAS,GAAG;4BAER,KAAK,EAAE,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CAAC;6BACjD;4BACD,IAAI,SAAS,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;4BAC5C,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,aAAa,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;4BACrG,IAAI,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;4BACxC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,qCAAqC,CAAC,CAAC;4BACtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC;wBACvE,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,eAAe,CAAC,cAAc,EAAE,aAAa,EAAC,MAAM;wBAChD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;wBACrC,IAAI,CAAC,aAAa,GAAG,aLine truncated
+8
View File
@@ -0,0 +1,8 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{constructor(){super(...arguments);this.ej2Source={Excel:["libs/syncfusion/excel/ej2-excel.min.js"],Pdf:["libs/syncfusion/pdf/ej2-pdf.min.js"],Word:["libs/syncfusion/word/ej2-word.min.js"]}}jsFiles(){return["apps/collaboration/managers/documentmanager.js"]}cssFiles(){return[]}loadForm(t,i,r,u,f){var e=this;e.navigationHelper.popup(i,"",n.Apps.Collaboration.Components.Documents.Instance(),function(){var n=f;u!=null&&u()},n.Platform.Helpers.Size.ExtraLarge)}html(){return`<div><div id="DocumentViewer" style="width: 100%;height: 100%" class="DocumentViewer"></div></div>
<div id="dialog-container">
<div id="dialog"></div>
<div id="see-document-status"></div>
<div id="dlgContent" class="dialogContent"></div>
</div><div id="importfile-container"></div>
<div id="copydocument-container"> </div><div id="spreadsheettrim-container">
<div id="removeduplicates"></div><div id="biz-ss-menubar-fullscreendialog"></div><div id="biz-ss-resizetofit-dialog"></div></div>`}load(n,t){var i=this;i._containerid=t}convertDocsToPdfDownload(t){n.Apps.Collaboration.DocumentManager.Instance().ConvertDocstoPdfDownload(t).then(function(t){n.Themes.Compact.Components.Notification.Instance().Downloadfile(t.result)})}previewSpreadSheet(t){let i=n.Apps.Collaboration.DocumentManager.Instance();i.getDocumentFileInfo(t).then(t=>{i.getJsonData(t.result.FileId).then(r=>{i.getCustomJsonData(t.result.FileId).then(i=>{n.Apps.Collaboration.Components.Documents.Instance()._documentId=t.result.FileId,n.Apps.Collaboration.Components.DocConnector.Instance().init(t.result.FileId,t.result.DocumentGroup),this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/sheets/formatpainter.js","apps/collaboration/components/unicloud.js","apps/collaboration/components/sheets/spellcheck.js","apps/collaboration/components/sheets/spellcheck.js","apps/collaboration/components/sheets/autofill.js","apps/collaboration/components/sheets/ribbon.js","apps/collaboration/components/sheets/dialogue.js","apps/collaboration/components/sheets/base.js","apps/collaboration/components/common/download.js","apps/collaboration/enums/enum.js"],()=>{let u=n.Apps.Collaboration.Components.Sheets.Base.Instance();console.log(t);r.result!=null&&r.result!=""&&(u.init(t,r,i),n.Platform.Helpers.NavigationHelper.Instance().hideLoading())})})})})}previewWordDocument(t){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(t=>{n.Apps.Collaboration.DocumentManager.Instance().getJsonData(t.result.FileId).then(i=>{this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/doceditor/base.js","platform/core/helpers/file/filehelper.js","apps/collaboration/components/sheets/base.js","apps/collaboration/components/unicloud.js","apps/collaboration/components/doceditor/ribbon.js","apps/collaboration/components/common/download.js"],()=>{let r=n.Apps.Collaboration.Components.DocEditor.Base.Instance();r.init(t,i);n.Platform.Helpers.NavigationHelper.Instance().hideLoading()})})})}previewPdf(t){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(t=>{this.fileCacheHelper.loadJsFiles(["apps/collaboration/components/pdfviewer/base.js"],()=>{let i=n.Apps.Collaboration.Components.PdfViewer.Base.Instance();i.init(t);n.Platform.Helpers.NavigationHelper.Instance().hideLoading()})})}previewImage(t){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(function(t){for(var i=t.result,e=i.DocumentFileName+"."+i.FileType,u=atob(i.FileData),f=new Array(u.length),r=0;r<u.length;r++)f[r]=u.charCodeAt(r);var o=new Uint8Array(f),s=new Blob([o],{type:i.DocumentGroup+"/"+i.FileType+";base64"}),h=URL.createObjectURL(s);window.open(h,e,"width=600,height=600,scrollbars=yes");n.Platform.Helpers.NavigationHelper.Instance().hideLoading()})}previewDocument(n,t,i){this.documentfileid=n;this.documentGroup=t;$(".unibase_modal_backdrop").removeAttr("style");$(".preloader-it").fadeIn();this.fileCacheHelper.loadJsFiles(["apps/collaboration/managers/documentmanager.js","apps/collaboration/managers/filemanager.js","apps/collaboration/components/sheets/spellcheck.js","apps/collaboration/components/docconnector.js","apps/collaboration/components/unidochub.js","apps/collaboration/components/common/util.js","libs/syncfusion/ej2.min.js","apps/collaboration/components/fullscreen.js"],()=>{this.fileCacheHelper.loadCssFiles(["libs/syncfusion/material.css","libs/syncfusion/custom-css.css","libs/syncfusion/docx.css","libs/syncfusion/spreadsheet-custom.css","libs/syncfusion/pdf.css"],()=>{t=="Image"?this.previewImage(n):t=="Excel"?this.previewSpreadSheet(n,i):t=="Word"?this.previewWordDocument(n):t=="Pdf"&&this.previewPdf(n)})})}downloadDocument(t,i){i=="Excel"?n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js",function(){var i={FileId:t};n.Apps.Collaboration.DocumentManager.Instance().spreadSheetDownload(i).then(function(t){var i=t.result;i=encodeURIComponent(i);n.Themes.Compact.Components.Notification.Instance().Downloadfile(i)})}):i=="Word"?n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js",function(){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(function(t){var i=t.result.DocumentFilePath;i=encodeURIComponent(i);n.Themes.Compact.Components.Notification.Instance().Downloadfile(i)})}):n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js",function(){n.Apps.Collaboration.DocumentManager.Instance().getDocumentFileInfo(t).then(function(n){var t=document.createElement("a");t.href="data:"+n.result.FileType+";base64,"+n.result.FileData;t.download=n.result.FileTitle+"."+n.result.FileType;t.click()})})}deleteDocumentFile(t){bootbox.confirm("Do you want to Delete this File ?",function(i){i==Line truncated
@@ -0,0 +1,89 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
class Fullscreen {
constructor() {
this.ssMenuBarFullScreen = false;
this.isDocFullscreen = false;
}
refreshWordDocumentHeight(docObj) {
this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance();
let fullscreenElement = docObj.element;
this.wordDocRibbon = document.getElementsByClassName('biz-doc-ribbon')[0];
this.wordDocToolbar = document.getElementsByClassName('biz-doc-bottomtoolbar')[0];
this.wordDocFooter = fullscreenElement.parentElement.nextElementSibling;
this.wordDocFooter.style.display = "none";
this.wordDocRibbon.style.display = 'none';
this.wordDocToolbar.style.display = 'none';
docObj.height = window.innerHeight + 'px';
document.getElementsByClassName('e-de-text-target')[0].contentWindow.document.addEventListener("keyup", (e) => {
this.refreshDocumentHeightProps(fullscreenElement);
event.preventDefault();
this.exitFullscreenEsc(e, docObj);
if (e.keyCode == 122) {
if (!this.isDocFullscreen) {
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
this.isDocFullscreen = true;
}
else {
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
this.isDocFullscreen = false;
}
}
});
document.body.addEventListener("keyup", (e) => {
this.exitFullscreenEsc(e, this.docBase.wordDocumentObj);
});
}
refreshDocumentHeightProps(fullscreenElement) {
this.ribbonHeight = document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight;
this.toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;
this.footerHeight = fullscreenElement.parentElement.nextElementSibling.offsetHeight;
}
exitFullscreenEsc(e, docObj) {
if (e.keyCode == 27) {
this.refreshDocumentHeightProps(docObj.element);
this.wordDocRibbon.style.display = '';
this.wordDocToolbar.style.display = '';
this.wordDocFooter.style.display = "";
this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight;
docObj.height = this.totalHeight + 'px';
}
}
refreshSpreadsheetHeight(ssObj) {
this.sheetBase = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance();
this.dialog = Unibase.Apps.Collaboration.Components.Sheets.Dialogue.Instance();
this.ssMenuBarFullScreen = true;
let fullscreenElement = ssObj.element;
let sheetPannelElement = document.getElementById("DocumentViewer_sheet_panel");
fullscreenElement.parentElement.nextElementSibling.style.display = "none";
fullscreenElement.parentElement.previousElementSibling.style.display = "none";
document.getElementById('DocumentViewer_ribbon').style.display = 'none';
var footerHeight = sheetPannelElement.nextElementSibling.offsetHeight;
var headerHeight = sheetPannelElement.previousElementSibling.offsetHeight;
sheetPannelElement.style.height = window.innerHeight - footerHeight - headerHeight + "px";
this.dialog.renderMenubarFullscreenDialog();
}
inintEvents() {
}
removeEvetns() {
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Fullscreen();
}
return this.instance;
}
}
Components.Fullscreen = Fullscreen;
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"fullscreen.js","sourceRoot":"","sources":["fullscreen.ts"],"names":[],"mappings":"A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AK,CAAC,OAAO,GAAG,MAAM,CAAC;wBAC/F,QAAQ,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;wBAGxE,IAAI,YAAY,GAAI,kBAAkB,CAAC,kBAAkC,CAAC,YAAY,CAAC;wBACvF,IAAI,YAAY,GAAI,kBAAkB,CAAC,sBAAsC,CAAC,YAAY,CAAC;wBAC3F,kBAAkB,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,IAAI,CAAC;wBAE1F,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC;oBAChD,CAAC;oBAKD,WAAW;oBAGX,CAAC;oBAED,YAAY;oBAEZ,CAAC;oBAID,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;yBACpC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBAEJ;gBAjIY,qBAAU,aAiItB,CAAA;YACL,CAAC,EAnIgB,UAAU,GAAV,wBAAU,KAAV,wBAAU,QAmI1B;QACL,CAAC,EArIgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAqI7B;IACL,CAAC,EAvIgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAuIpB;AACL,CAAC,EAzIS,OAAO,KAAP,OAAO,QAyIhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.ssMenuBarFullScreen=!1;this.isDocFullscreen=!1}refreshWordDocumentHeight(t){this.docBase=n.Apps.Collaboration.Components.DocEditor.Base.Instance();let i=t.element;this.wordDocRibbon=document.getElementsByClassName("biz-doc-ribbon")[0];this.wordDocToolbar=document.getElementsByClassName("biz-doc-bottomtoolbar")[0];this.wordDocFooter=i.parentElement.nextElementSibling;this.wordDocFooter.style.display="none";this.wordDocRibbon.style.display="none";this.wordDocToolbar.style.display="none";t.height=window.innerHeight+"px";document.getElementsByClassName("e-de-text-target")[0].contentWindow.document.addEventListener("keyup",n=>{this.refreshDocumentHeightProps(i),event.preventDefault(),this.exitFullscreenEsc(n,t),n.keyCode==122&&(this.isDocFullscreen?(this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px",this.isDocFullscreen=!1):(this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px",this.isDocFullscreen=!0))});document.body.addEventListener("keyup",n=>{this.exitFullscreenEsc(n,this.docBase.wordDocumentObj)})}refreshDocumentHeightProps(n){this.ribbonHeight=document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight;this.toolbarHeight=document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight;this.footerHeight=n.parentElement.nextElementSibling.offsetHeight}exitFullscreenEsc(n,t){n.keyCode==27&&(this.refreshDocumentHeightProps(t.element),this.wordDocRibbon.style.display="",this.wordDocToolbar.style.display="",this.wordDocFooter.style.display="",this.totalHeight=window.innerHeight-this.ribbonHeight-this.toolbarHeight-this.footerHeight,t.height=this.totalHeight+"px")}refreshSpreadsheetHeight(t){this.sheetBase=n.Apps.Collaboration.Components.Sheets.Base.Instance();this.dialog=n.Apps.Collaboration.Components.Sheets.Dialogue.Instance();this.ssMenuBarFullScreen=!0;let r=t.element,i=document.getElementById("DocumentViewer_sheet_panel");r.parentElement.nextElementSibling.style.display="none";r.parentElement.previousElementSibling.style.display="none";document.getElementById("DocumentViewer_ribbon").style.display="none";var u=i.nextElementSibling.offsetHeight,f=i.previousElementSibling.offsetHeight;i.style.height=window.innerHeight-u-f+"px";this.dialog.renderMenubarFullscreenDialog()}inintEvents(){}removeEvetns(){}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Fullscreen=i})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,157 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let PdfViewer;
(function (PdfViewer) {
class Base {
constructor() {
this.isFullscreen = false;
}
init(response) {
this.result = response.result;
this.documentGroup = this.result.DocumentGroup;
this.documentFileName = this.result.DocumentFileName;
this.documentFileId = this.result.DocumentFileId;
this.filePath = this.result.DocumentFilePath;
this.render();
}
unwireBootStrapKeyEvent() {
let popup = document.body.getElementsByClassName('_bizgaze_popup_container');
let events = $._data($(popup)[0], "events");
if (events && events.keydown) {
$(popup).off('keydown.dismiss.bs.modal', events.keydown[0].handler);
}
}
render() {
this.renderPopup();
this.renderMenuBar();
this.renderPdf();
this.updateProps();
this.refreshHeight();
this.addEventListeners();
this.unwireBootStrapKeyEvent();
}
addEventListeners() {
this.fullscreenBtn.addEventListener('click', () => {
this.openFullscreen();
});
this.popupElement.addEventListener('fullscreenchange', () => {
setTimeout(() => {
this.setHeigthOnFullscreenChange();
}, 0);
if (this.isFullscreen) {
this.fullscreenBtn.classList.remove('biz-enterfullscreen');
this.fullscreenBtn.classList.add('biz-exitfullscreen');
this.isFullscreen = true;
}
else {
this.fullscreenBtn.classList.remove('biz-exitfullscreen');
this.fullscreenBtn.classList.add('biz-enterfullscreen');
this.isFullscreen = false;
}
;
});
document.addEventListener('fullscreenchange', () => {
this.setHeigthOnFullscreenChange();
});
window.addEventListener('keyup', (e) => {
if (e.keyCode == 122) {
e.preventDefault();
this.openFullscreen();
this.setHeigthOnFullscreenChange();
}
});
this.exitPdf.addEventListener('click', () => {
this.closePopup();
});
}
openFullscreen() {
let elem = this.popupElement;
if (!this.isFullscreen) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
}
else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
this.isFullscreen = true;
}
else {
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
this.isFullscreen = false;
}
}
setHeigthOnFullscreenChange() {
var footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
this.element.parentElement.style.height = window.innerHeight - footerHeight + 'px';
this.pdfViewer.height = '100%';
}
renderPdf() {
this.pdfViewer = new ej.pdfviewer.PdfViewer({
created: this.pdfCreated.bind(this),
documentPath: this.filePath,
serviceUrl: 'http://localhost:3088/pdfviewer'
});
ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation);
this.pdfViewer.appendTo('#DocumentViewer');
}
updateProps() {
this.popupElement = document.getElementsByClassName('_bizgaze_popup_container')[0];
this.element = document.getElementById('DocumentViewer');
this.fullscreenBtn = document.getElementsByClassName('biz-pdf-fullscreen-btn')[0];
this.exitPdf = document.getElementsByClassName('biz-pdf-exitpdf-btn')[0];
}
pdfCreated() {
var util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
document.getElementById("DocumentViewer_zoomDropDownContainer").after(util.createElement('div', 'class', 'biz-pdf-fullscreen'));
util.appendChildren('biz-pdf-fullscreen', 0, util.createElement('button', 'class', 'e-icons biz-pdf-fullscreen-btn biz-enterfullscreen'));
document.getElementById("DocumentViewer_downloadContainer").after(util.createElement('div', 'class', 'biz-pdf-exitpdf'));
util.appendChildren('biz-pdf-exitpdf', 0, util.createElement('button', 'class', 'e-icons biz-pdf-exitpdf-btn'));
}
actionComplete() {
}
closePopup() {
Unibase.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();
var contId = $("._bizgaze_popup_container:visible").attr("id");
$('#' + contId).modal('hide');
$('#' + contId).remove();
}
refreshHeight() {
var footerHeight = this.element.parentElement.nextElementSibling.offsetHeight;
var rootHeight = this.element.parentElement.parentElement.offsetHeight;
this.element.parentElement.style.height = (rootHeight - footerHeight) + 'px';
}
renderPopup() {
Unibase.Apps.Collaboration.Components.Documents.Instance().loadForm(0, this.documentFileId, 0, null, this.documentGroup);
}
renderMenuBar() {
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Base();
}
return this.instance;
}
}
PdfViewer.Base = Base;
})(PdfViewer = Components.PdfViewer || (Components.PdfViewer = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA8MhB;AA9MD,WAAU,OAAO;IACb,IAAiB,IAAI,CA4MpB;IA5MD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA0M7B;QA1MD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAwM1B;YAxMD,WAAiB,UAAU;gBACvB,IAAiB,SAAS,CAsMzB;gBAtMD,WAAiB,SAAS;oBACtB,MAAa,IAAI;wBAAjB;4BAaI,iBAAY,GAAY,KAAK,CAAC;wBAuLlC,CAAC;wBApLG,IAAI,CAAC,QAAa;4BACd,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;4BAC9B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;4BAE/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;4BACrD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;4BACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;4BAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;wBAClB,CAAC;wBAED,uBAAuB;4BACnB,IAAI,KAAK,GAAgB,QA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G,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;4BAC9B,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;wBAE7B,CAAC;wBLine truncated
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.isFullscreen=!1}init(n){this.result=n.result;this.documentGroup=this.result.DocumentGroup;this.documentFileName=this.result.DocumentFileName;this.documentFileId=this.result.DocumentFileId;this.filePath=this.result.DocumentFilePath;this.render()}unwireBootStrapKeyEvent(){let t=document.body.getElementsByClassName("_bizgaze_popup_container"),n=$._data($(t)[0],"events");n&&n.keydown&&$(t).off("keydown.dismiss.bs.modal",n.keydown[0].handler)}render(){this.renderPopup();this.renderMenuBar();this.renderPdf();this.updateProps();this.refreshHeight();this.addEventListeners();this.unwireBootStrapKeyEvent()}addEventListeners(){this.fullscreenBtn.addEventListener("click",()=>{this.openFullscreen()});this.popupElement.addEventListener("fullscreenchange",()=>{setTimeout(()=>{this.setHeigthOnFullscreenChange()},0),this.isFullscreen?(this.fullscreenBtn.classList.remove("biz-enterfullscreen"),this.fullscreenBtn.classList.add("biz-exitfullscreen"),this.isFullscreen=!0):(this.fullscreenBtn.classList.remove("biz-exitfullscreen"),this.fullscreenBtn.classList.add("biz-enterfullscreen"),this.isFullscreen=!1)});document.addEventListener("fullscreenchange",()=>{this.setHeigthOnFullscreenChange()});window.addEventListener("keyup",n=>{n.keyCode==122&&(n.preventDefault(),this.openFullscreen(),this.setHeigthOnFullscreenChange())});this.exitPdf.addEventListener("click",()=>{this.closePopup()})}openFullscreen(){let n=this.popupElement;this.isFullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),this.isFullscreen=!1):(n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.msRequestFullscreen&&n.msRequestFullscreen(),this.isFullscreen=!0)}setHeigthOnFullscreenChange(){var n=this.element.parentElement.nextElementSibling.offsetHeight;this.element.parentElement.style.height=window.innerHeight-n+"px";this.pdfViewer.height="100%"}renderPdf(){this.pdfViewer=new ej.pdfviewer.PdfViewer({created:this.pdfCreated.bind(this),documentPath:this.filePath,serviceUrl:"http://localhost:3088/pdfviewer"});ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection,ej.pdfviewer.TextSearch,ej.pdfviewer.Print,ej.pdfviewer.Navigation);this.pdfViewer.appendTo("#DocumentViewer")}updateProps(){this.popupElement=document.getElementsByClassName("_bizgaze_popup_container")[0];this.element=document.getElementById("DocumentViewer");this.fullscreenBtn=document.getElementsByClassName("biz-pdf-fullscreen-btn")[0];this.exitPdf=document.getElementsByClassName("biz-pdf-exitpdf-btn")[0]}pdfCreated(){var t=n.Apps.Collaboration.Components.Common.Util.Instance();document.getElementById("DocumentViewer_zoomDropDownContainer").after(t.createElement("div","class","biz-pdf-fullscreen"));t.appendChildren("biz-pdf-fullscreen",0,t.createElement("button","class","e-icons biz-pdf-fullscreen-btn biz-enterfullscreen"));document.getElementById("DocumentViewer_downloadContainer").after(t.createElement("div","class","biz-pdf-exitpdf"));t.appendChildren("biz-pdf-exitpdf",0,t.createElement("button","class","e-icons biz-pdf-exitpdf-btn"))}actionComplete(){}closePopup(){n.Apps.Collaboration.Components.DocConnector.Instance().closeDoc();var t=$("._bizgaze_popup_container:visible").attr("id");$("#"+t).modal("hide");$("#"+t).remove()}refreshHeight(){var n=this.element.parentElement.nextElementSibling.offsetHeight,t=this.element.parentElement.parentElement.offsetHeight;this.element.parentElement.style.height=t-n+"px"}renderPopup(){n.Apps.Collaboration.Components.Documents.Instance().loadForm(0,this.documentFileId,0,null,this.documentGroup)}renderMenuBar(){}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Base=i})(i=t.PdfViewer||(t.PdfViewer={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,15 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Requests;
(function (Requests) {
class File {
}
Requests.File = File;
})(Requests = Collaboration.Requests || (Collaboration.Requests = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"file.js","sourceRoot":"","sources":["file.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkBhB;AAlBD,WAAU,OAAO;IACb,IAAiB,IAAI,CAgBpB;IAhBD,WAAiB,IAAI;QACjB,IAAkB,aAAa,CAc9B;QAdD,WAAkB,aAAa;YAC3B,IAAiB,QAAQ,CAYxB;YAZD,WAAiB,QAAQ;gBAGrB,MAAa,IAAI;iBAOhB;gBAPY,aAAI,OAOhB,CAAA;YAEL,CAAC,EAZgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAYxB;QACL,CAAC,EAdiB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAc9B;IACL,CAAC,EAhBgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAgBpB;AACL,CAAC,EAlBS,OAAO,KAAP,OAAO,QAkBhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.File=t})(t=n.Requests||(n.Requests={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,538 @@
.biz-share-modal.modal {
overflow-y: auto !important;
}
.biz-share-modal .modal-dialog {
max-width: 640px;
}
.biz-share-modal .modal-content {
max-width: 100%;
max-height: 100%;
}
.biz-share-accordion .share-text-dark {
color: #202124;
}
.biz-share-accordion .card {
border: 0;
border-radius: 10px !important;
}
.biz-share-accordion .card .card-header {
display: flex;
justify-content: center;
padding: 20px 24px 15px 24px;
border: 0;
}
.biz-share-accordion .card .card-header > a {
padding-bottom: 0;
background-color: #fff;
color: #202124;
padding: 0rem 0rem 0.75rem 0rem;
font-weight: 400;
}
.biz-share-accordion .card .card-header > a::before,
.biz-share-accordion .card .card-header > a.collapsed:before {
content: '';
}
.biz-share-accordion .card .card-header .header-icon-wrapper {
display: flex;
align-items: center;
}
.biz-share-accordion .card .card-header .header-icon-wrapper .btn {
border-radius: 50% !important;
margin-right: 10px;
cursor: default;
}
.biz-share-accordion .card .header-icon-wrapper .notifyBackBtn {
cursor: pointer !important;
}
.biz-share-accordion .card .collapse-btn[data-expanded='true'] {
cursor: default;
}
.biz-share-accordion .card .card-header .header-title {
font-size: 22px;
}
.biz-share-accordion .card .card-header .shared-users {
padding: 9px 0 4px;
display: block;
color: #5f6368;
font-size: 14px;
}
.biz-share-accordion .card .card-header.activestate .shared-users {
display: none;
}
.biz-share-accordion .card .card-header > a.collapsed .shared-users {
display: block;
}
.biz-share-accordion .card .card-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.biz-share-accordion .add-people-wrapper {
padding: 15px 24px 0px 24px;
}
.biz-share-accordion .people-select2-wrapper {
width: 100%;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple {
border: none;
border-bottom: 1px solid #000 !important;
border-radius: 6px 6px 0 0 !important;
background-color: #f8f9fa;
padding: 0 .75em;
min-height: 3em;
display: flex;
align-items: center;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .people-select2-wrapper .select2-selection--multiple .select2-selection__rendered {
padding: 0 .125em 0 .25em;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-search__field {
margin-top: 0px;
}
.biz-share-accordion .people-select2-wrapper .select2-search__field {
margin-top: 0px;
}
.biz-share-accordion .people-select2-wrapper .select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
background: #f1f3f4;
border-bottom: 2px solid #1a73e8 !important;
}
#select2-user_select2-results {
padding-top: 4px;
padding-bottom: 4px;
}
#select2-user_select2-results .select2-results__option--highlighted[aria-selected] {
background-color: #f5f5f5 !important;
color: #202124 !important;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice {
font-size: 14px;
background-color: #fff;
color: #5f6368;
border: 1px solid #dadce0;
border-radius: 16px;
padding-left: 10px;
padding-right: 5px;
margin: 4px;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice:hover, .biz-share-accordion .people-select2-wrapper .select2-selection__rendered .select2-selection__choice:hover .select2-selection__choice__remove {
color: #000;
}
.biz-share-accordion .people-select2-wrapper .select2-selection__choice .select2-selection__choice__remove {
color: #5f6368;
font-size: 18px;
font-weight: 600;
margin-left: 6px;
float: right;
opacity: 1;
padding-top: 0px;
height: 0;
position: relative;
top: -4px;
}
.biz-share-accordion .shared-people-list {
max-height: 33vh;
overflow-x: auto;
margin-top: 8px;
padding: 1px 0px 1px 20px;
}
.biz-share-accordion .people-list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px 8px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
}
.biz-share-accordion .people-list-item:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .user-role-wrapper {
padding-right: 20px;
}
.biz-share-accordion .user-detail-wrapper {
display: flex;
align-items: center;
}
.biz-share-accordion .user-role-wrapper .dropdown-toggle {
background-color: transparent;
font-weight: 500;
color: #5f6368;
font-size: 14px;
}
.biz-share-accordion .user-role-wrapper .dropdown-toggle:hover {
background-color: #ecedee;
font-weight: 500;
color: #202124;
}
.biz-share-accordion .user-role-wrapper .dropdown-item {
padding: 8px 40px;
color: #202124;
position: relative;
}
.biz-share-accordion .user-role-wrapper .dropdown-item .dropdown-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #1a73e8;
font-size: 20px;
}
.biz-share-accordion .user-role-wrapper .dropdown-item .temp-span {
display: block;
font-size: 14px;
color: rgba(0, 0, 0, 0.54);
}
.biz-share-accordion .user-role-wrapper .owner-span {
padding: 0.25rem 0.7rem;
color: rgba(60, 64, 67, 0.38);
font-style: italic;
font-weight: 500;
font-size: 14px;
}
.biz-share-accordion .user-name-email-wrapper .user-name {
font-weight: 500;
color: #202124;
}
.biz-share-accordion .card-footer {
padding: 8px 24px;
}
.biz-share-accordion .card-footer .btn {
padding: 5px 24px 5px 24px;
}
.biz-share-accordion .card-footer .feedback-link {
font-size: 12px;
text-decoration: underline;
color: #1a73e8;
}
.biz-share-accordion .card-footer .feedback-link:hover {
background-color: #f6fafe;
}
.biz-share-accordion .people-notification-area {
margin: 0 24px;
}
.biz-share-accordion .shared-file-btn {
display: flex;
align-items: center;
cursor: pointer;
margin-bottom: 8px;
padding-left: 10px;
padding-right: 10px;
max-width: 100%;
background-color: #fff;
border: 1px #dadce0 solid;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #3c4043;
height: 32px;
border-radius: 16px;
font-size: 14px;
font-weight: 500;
letter-spacing: .25px;
outline: none;
}
.biz-share-accordion .shared-file-btn .file-icon {
height: 20px;
width: 20px;
}
.biz-share-accordion .shared-file-btn .file-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-left: 10px;
}
.biz-share-accordion .message-textarea {
height: 96px;
max-height: 30vh;
width: 100%;
position: relative;
margin-bottom: 14px;
background-color: #f1f3f4;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
flex-shrink: 1;
font-size: 16px;
font-weight: 400;
letter-spacing: .1px;
line-height: 24px;
border: none;
outline: none;
overflow-y: visible;
overflow-x: hidden;
padding: 16px;
resize: none;
white-space: pre-wrap;
word-wrap: break-word;
z-index: 1;
}
.biz-share-accordion .message-textarea:hover {
background-color: #f1f3f4;
}
.biz-share-accordion .message-textarea:after {
background: none repeat scroll 0 0 transparent;
bottom: 0;
content: "";
display: block;
height: 2px;
left: 50%;
position: absolute;
background-color: #1a73e8;
transition: width 0.3s ease 0s, left 0.3s ease 0s;
width: 0;
}
.biz-share-accordion .message-textarea:focus:after {
width: 100%;
left: 0;
}
.biz-share-accordion .custom-share-checkbox {
display: inline-block;
padding: 10px 0px;
}
.biz-share-accordion .custom-share-checkbox input {
padding: 0;
height: initial;
width: initial;
margin-bottom: 0;
display: none;
cursor: pointer;
}
.biz-share-accordion .custom-share-checkbox label {
display: flex;
align-items: center;
position: relative;
cursor: pointer;
margin-bottom: 0px;
font-size: 14px;
color: rgba(0,0,0,0.87);
}
.biz-share-accordion .custom-share-checkbox label:before {
content: '';
-webkit-appearance: none;
background-color: #1a73e8;
border: 2px solid #1a73e8;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);
width: 18px;
height: 18px;
display: inline-block;
position: relative;
vertical-align: middle;
cursor: pointer;
margin-right: 10px;
}
.biz-share-accordion .custom-share-checkbox input:checked + label:after {
content: '';
display: block;
position: absolute;
top: 2px;
left: 6px;
width: 6px;
height: 14px;
border: solid #fff;
border-width: 0 2px 2px 0;
transform: rotate( 45deg);
}
.biz-share-accordion .custom-share-checkbox.unchecked label:before {
background-color: unset;
border-color: #5f6368;
}
.biz-share-accordion .user-owner {
padding-right: 20px;
}
.biz-share-accordion .external-dropdown {
position: relative
}
.biz-share-accordion .external-dropdown .dropdown, .biz-share-accordion .external-dropdown .dropup {
position: static;
}
.biz-share-accordion .external-dropdown .dropdown-menu {
left: 95%;
margin-top: 0;
}
.biz-share-accordion .permissionsMenu {
margin-top: 40px;
}
#select2-user_select2-results .select2-results__option[aria-selected=true] {
display: none;
}
.biz-share-accordion .activestate .btn-icon,
.biz-share-accordion .activestate a.bg-secondary:hover,
.biz-share-accordion .activestate button.bg-secondary:hover {
background-color: rgb(0, 109, 119) !important;
color: rgb(255, 255, 255) !important;
border-color: rgb(0, 109, 119) !important;
}
.biz-share-accordion .card-header .bg-secondary:hover {
background-color: #9e9e9e !important;
}
.biz-share-accordion .external-dropdown .avatar.avatar-sm {
width: 2.25rem;
height: 2.25rem;
}
.collapse-getlink .search-wrapper, #ul_link {
padding: 0 24px 20px 24px;
}
#txt_link {
height: 36px;
}
#txt_link:focus {
outline: none;
}
#collapse_getlink .people-list-item:hover .btn-icon {
background-color: #fff !important;
}
.biz-share-modal {
z-index: 1060;
}
#discardModal {
z-index: 1060;
}
.biz-share-accordion .people-select2-wrapper .select2-search input:active {
background-color: #f1f3f4 !important;
}
#collapseGetLinkBtn .get_link_icon {
transform: scaleX(-1);
}
#get-link-card .copy-link-btn:hover {
background-color: #EAF4FF;
}
.get-link-card-loader {
width: 98%;
margin: 0 auto;
border: 0 solid transparent;
position: relative;
padding: 1px;
border-radius: 10px;
}
.get-link-card-loader:before {
content: '';
background-color: lightgray;
position: absolute;
top: 0;
right: 0;
bottom: -2px;
left: 0;
border-radius: 10px;
}
.get-link-card-loader .get-link-card-loaderBar {
position: absolute;
padding: 2px;
top: 0;
right: 100%;
bottom: 0;
left: 0;
background: #298DFF;
width: 0;
animation: borealisBar 1s linear infinite;
}
@keyframes borealisBar {
0% {
left: 0%;
right: 100%;
width: 0%;
}
10% {
left: 0%;
right: 50%;
width: 50%;
}
90% {
right: 0%;
left: 50%;
width: 50%;
}
100% {
left: 100%;
right: 0%;
width: 0%;
}
}
@@ -0,0 +1,846 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class Autofill {
constructor() {
this.hederText = {};
this.colType = { String: "string", Number: "number", Custom: "custom", Formula: "formula", Time: "time", LongDate: "longdate", ShortDate: "shortdate", Scientific: "scientific", Fraction: "fraction", Text: "text", General: "general", Accounting: "accounting", Currency: "currency", Percentage: "percentage", Date: "date", DateTime: "datetime" };
this.customList = [
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
];
this.UC = {
uniqueOBracket: String.fromCharCode(129),
uniqueCBracket: String.fromCharCode(130),
uniqueCSeparator: String.fromCharCode(131),
uniqueCOperator: String.fromCharCode(132),
uniquePOperator: String.fromCharCode(133),
uniqueSOperator: String.fromCharCode(134),
uniqueMOperator: String.fromCharCode(135),
uniqueDOperator: String.fromCharCode(136),
uniqueModOperator: String.fromCharCode(137),
uniqueConcateOperator: String.fromCharCode(138),
uniqueEqualOperator: String.fromCharCode(139),
uniqueExpOperator: String.fromCharCode(140),
uniqueGTOperator: String.fromCharCode(141),
uniqueLTOperator: String.fromCharCode(142)
};
}
init(base) {
this.base = base;
this.ssObj = base.ssObj;
this.initProp();
}
initProp() {
this.beforeSelectFn = this.beforeSelect.bind(this);
this.base.ssObj.addEventListener("beforeSelect", this.beforeSelectFn);
this.selectFn = this.selected.bind(this);
this.base.ssObj.addEventListener("select", this.selectFn);
this.actionCompleteFn = this.updateAutofill.bind(this);
this.base.ssObj.addEventListener("actionComplete", this.actionCompleteFn);
this.createdFn = this.created.bind(this);
this.base.ssObj.addEventListener("created", this.createdFn);
this.dataBoundFn = this.dataBound.bind(this);
this.base.ssObj.addEventListener("dataBound", this.dataBoundFn);
this.cellEditFn = this.cellEdit.bind(this);
this.base.ssObj.addEventListener("cellEditing", this.cellEditFn);
this.cellSaveFn = this.cellSave.bind(this);
this.base.ssObj.addEventListener("cellSave", this.cellSaveFn);
this.base.ssObj.on("activeSheetChanged", this.updateAutofill, this);
this.base.ssObj.on("mouseDown", this.mouseDown, this);
}
destroy() {
this.base.ssObj.removeEventListener("beforeSelect", this.beforeSelectFn);
this.base.ssObj.removeEventListener("select", this.selectFn);
this.base.ssObj.removeEventListener("actionComplete", this.actionCompleteFn);
this.base.ssObj.removeEventListener("created", this.createdFn);
this.base.ssObj.removeEventListener("dataBound", this.dataBoundFn);
this.base.ssObj.removeEventListener("cellEditing", this.cellEditFn);
this.base.ssObj.removeEventListener("cellSave", this.cellSaveFn);
this.base.ssObj.off("activeSheetChanged", this.updateAutofill);
this.base.ssObj.on("mouseDown", this.mouseDown, this);
ej.base.EventHandler.remove(this.base.ssObj.element, 'mouseup', this.mouseUp);
ej.base.EventHandler.remove(this.base.ssObj.element, 'keydown', this.keypress);
ej.base.EventHandler.remove(this.base.ssObj.element, 'dblclick', this.dblClick);
}
cellEdit() {
this.hideAutofill();
}
cellSave() {
this.updateAutofill();
}
dataBound() {
this.updateAutofill();
}
createBorders() {
if (!this.base.ssObj.element.getElementsByClassName('biz-af-bdr')[0]) {
let content = this.base.ssObj.element.getElementsByClassName('e-sheet-content')[0];
this.bdrAF = content.appendChild(ej.base.createElement('div', { className: 'biz-af-bdr' }));
}
}
hideBorders() {
if (this.bdrAF) {
this.bdrAF.style.display = 'none';
}
}
showBorders() {
if (this.bdrAF) {
this.bdrAF.style.display = '';
}
}
updateBorderDirection(hideDirecton) {
this.bdrAF.style.borderRightWidth = '1px';
this.bdrAF.style.borderLeftWidth = '1px';
this.bdrAF.style.borderTopWidth = '1px';
this.bdrAF.style.borderBottomWidth = '1px';
this.bdrAF.style["border" + hideDirecton + "Width"] = '0px';
}
mouseDown(e) {
if (e.target.classList.contains('biz-autofill')) {
this.isDrag = true;
ej.base.EventHandler.add(this.base.ssObj.element, 'mousemove', this.mouseMoveHandler, this);
this.x = e.clientX;
this.y = e.clientY;
this.indexes = this.base.ssObj.biz.getIndexes();
this.createBorders();
let sel = this.base.ssObj.element.getElementsByClassName('e-selection')[0];
let activecell = this.base.ssObj.element.getElementsByClassName('e-active-cell')[0];
this.selection = sel.classList.contains('e-hide') ? activecell : sel;
this.selOffset = this.selection.getBoundingClientRect();
this.parentOffset = this.selection.offsetParent.getBoundingClientRect();
this.left = parseInt(this.selection.style.left);
this.top = parseInt(this.selection.style.top);
}
}
mouseUp(e) {
this.isDrag = false;
ej.base.EventHandler.remove(this.base.ssObj.element, 'mousemove', this.mouseMoveHandler);
if (this.direction != undefined) {
this.autoFill();
}
this.direction = undefined;
this.hideBorders();
this.isDragged = false;
this.prevTarget = undefined;
}
createAutofill() {
if (!this.base.ssObj.element.getElementsByClassName('biz-autofill')[0]) {
this.element = document.createElement('div');
this.element.classList.add('biz-autofill');
let content = this.base.ssObj.element.getElementsByClassName('e-sheet-content')[0];
content && content.appendChild(this.element);
}
this.element.classList.remove('biz-hide');
}
updateAutofill() {
if (!this.base.ssObj.isEdit) {
this.positionAutofill();
}
else {
this.hideAutofill();
}
}
dblClick() {
setTimeout(() => {
this.hideAutofill();
}, 1);
}
positionAutofill() {
setTimeout(() => {
this.createAutofill();
let selection = this.base.ssObj.element.getElementsByClassName('e-selection')[0];
let activecell = this.base.ssObj.element.getElementsByClassName('e-active-cell')[0];
if (selection && !selection.classList.contains('e-hide')) {
activecell = selection;
}
(this.element && activecell) && (this.element.style.top = parseInt(activecell.style.top) + parseInt(activecell.style.height) - 6 + 'px');
(this.element && activecell) && (this.element.style.left = parseInt(activecell.style.left) + parseInt(activecell.style.width) + -5 + 'px');
}, 10);
}
hideAutofill() {
let ele = this.base.ssObj.element.getElementsByClassName('biz-autofill')[0];
if (ele) {
ele.classList.add('biz-hide');
}
}
mouseMoveHandler(e) {
e.preventDefault();
let x = e.clientX;
let y = e.clientY;
if (e.target === this.prevTarget) {
return;
}
let tr = ej.base.closest(e.target, 'tr');
let td = ej.base.closest(e.target, '.e-cell');
if (!this.isDragged) {
this.showBorders();
}
this.isDragged = true;
if (!tr || !td) {
return;
}
let colIdx = parseInt(td.getAttribute('aria-colindex')) - 1;
let rowIdx = parseInt(tr.getAttribute('aria-rowindex')) - 1;
if (this.indexes[0] <= rowIdx && this.indexes[2] >= rowIdx && this.indexes[1] <= colIdx && this.indexes[3] >= colIdx) {
this.hideBorders();
return;
}
let tdOffset = td.getBoundingClientRect();
let px = 'px';
this.showBorders();
let sheet = this.base.ssObj.biz.getActiveSheet();
let freezeRow = this.base.ssObj.frozenRowCount(sheet);
let freezeCol = this.base.ssObj.frozenColCount(sheet);
let left;
let width;
let top;
let height;
switch (true) {
case this.indexes[3] < colIdx && this.indexes[0] - rowIdx < colIdx - this.indexes[3] && rowIdx - this.indexes[2] < colIdx - this.indexes[3]:
this.direction = "right";
left = this.left + this.selOffset.width;
width = ej.spreadsheet.getCellPosition(sheet, [rowIdx - 1, colIdx + 1], freezeRow, freezeCol).left - (this.left + this.selOffset.width);
this.updateBorderDirection('Left');
this.bdrAF.style.top = this.top + px;
this.bdrAF.style.left = left + px;
this.bdrAF.style.height = this.selOffset.height + px;
this.bdrAF.style.width = width + px;
this.fIndexes = [this.indexes[0], this.indexes[3] + 1, this.indexes[2], colIdx];
this.startCell = { rowIndex: this.indexes[0], colIndex: this.indexes[1] };
this.endCell = { rowIndex: this.indexes[2], colIndex: colIdx };
break;
case this.indexes[1] > colIdx && this.indexes[0] - rowIdx <= this.indexes[1] - colIdx && rowIdx - this.indexes[2] < this.indexes[1] - colIdx:
this.direction = "left";
left = ej.spreadsheet.getCellPosition(sheet, [rowIdx - 1, colIdx], freezeRow, freezeCol).left;
width = this.left - left;
this.updateBorderDirection('Right');
this.bdrAF.style.top = this.top + px;
this.bdrAF.style.left = left + px;
this.bdrAF.style.height = this.selOffset.height + px;
this.bdrAF.style.width = width + px;
this.fIndexes = [this.indexes[0], colIdx, this.indexes[2], this.indexes[3] - 1];
this.startCell = { rowIndex: this.indexes[0], colIndex: colIdx };
this.endCell = { rowIndex: this.indexes[2], colIndex: this.indexes[3] };
break;
case this.indexes[0] > rowIdx:
this.direction = "up";
top = ej.spreadsheet.getCellPosition(sheet, [rowIdx, colIdx - 1], freezeRow, freezeCol).top;
height = this.top - top;
this.updateBorderDirection('Bottom');
this.bdrAF.style.top = top + px;
this.bdrAF.style.left = this.left + px;
this.bdrAF.style.height = height + px;
this.bdrAF.style.width = this.selOffset.width + px;
this.fIndexes = [rowIdx, this.indexes[1], this.indexes[0] - 1, this.indexes[3]];
this.startCell = { rowIndex: rowIdx, colIndex: this.indexes[1] };
this.endCell = { rowIndex: this.indexes[2], colIndex: this.indexes[3] };
break;
case this.indexes[2] < rowIdx:
this.direction = "down";
top = this.top + this.selOffset.height;
height = ej.spreadsheet.getCellPosition(sheet, [rowIdx + 1, colIdx - 1], freezeRow, freezeCol).top - (this.top + this.selOffset.height);
this.updateBorderDirection('Top');
this.bdrAF.style.top = top + px;
this.bdrAF.style.left = this.left + px;
this.bdrAF.style.height = height + px;
this.bdrAF.style.width = this.selOffset.width + px;
this.fIndexes = [this.indexes[2] + 1, this.indexes[1], rowIdx, this.indexes[3]];
this.startCell = { rowIndex: this.indexes[0], colIndex: this.indexes[1] };
this.endCell = { rowIndex: rowIdx, colIndex: this.indexes[3] };
break;
default:
this.direction = undefined;
break;
}
this.prevTarget = e.target;
this.drawAutoFill(e);
}
drawAutoFill(e) {
}
selected(e) {
this.range = e.range;
this.updateAutofill();
}
beforeSelect(e) {
if (this.isDrag) {
e.cancel = true;
}
this.hideAutofill();
}
created() {
ej.base.EventHandler.add(this.base.ssObj.element, 'mouseup', this.mouseUp, this);
ej.base.EventHandler.add(this.base.ssObj.element, 'keydown', this.keypress, this);
ej.base.EventHandler.add(this.base.ssObj.element, 'dblclick', this.dblClick, this);
}
keypress() {
this.updateAutofill();
}
autoFill() {
let options = {};
let sheetIdx = this.base.getSheetIndex();
options.sheetIdx = sheetIdx;
options.dataRange = this.indexes;
options.fillRange = this.fIndexes;
this.base.ssObj.updateUndoRedoCollection({ name: 'bizAction', args: { action: 'autofill', options: options, direction: this.direction, oldCells: this.base.getCellsFromIndexes(options.fillRange) } });
this.applyValues(options);
this.base.ssObj.selectRange(this.base.generateHeaderText(this.startCell.colIndex + 1) + (this.startCell.rowIndex + 1) + ':' + this.base.generateHeaderText(this.endCell.colIndex + 1) + (this.endCell.rowIndex + 1));
let args = { action: "autofill" };
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave(args, this.base, true);
this.updateAutofill();
}
applyAutofill(options, direction) {
this.direction = direction;
this.applyValues(options);
this.direction = undefined;
}
applyValues(options) {
let pos = { Down: 'down', Up: 'up', Left: 'left', Right: 'right' };
let val, plen, patterns, patrn, pRanges, patrnRange, fillRange, cellObjs, data, temp, dlen, j, k, l, tlen, tot, hasRef, format, formats, cells, clen, cellIdx, cellProps, i = 0, dataObj = {};
let drSR = options.dataRange[0];
let drSC = options.dataRange[1];
let drER = options.dataRange[2];
let drEC = options.dataRange[3];
let frSR = options.fillRange[0];
let frSC = options.fillRange[1];
let frER = options.fillRange[2];
let frEC = options.fillRange[3];
let isVFill = [pos.Down, pos.Up].indexOf(this.direction) > -1;
let isRFill = [pos.Up, pos.Left].indexOf(this.direction) > -1;
let sheet = this.base.ssObj.biz.getActiveSheet();
let len = isVFill ? drEC - drSC : drER - drSR;
while (i <= len) {
pRanges = this.updateFillValues(isVFill, drSR, drSC, drER, drEC, frSR, frSC, frER, frEC, i);
patrnRange = pRanges.patrnRange;
fillRange = pRanges.fillRange;
patterns = this.createPattern(patrnRange, { isRFill: isRFill, isVFill: isVFill });
cellObjs = this.getData(patrnRange);
data = this.getRawData(cellObjs);
dlen = data.length;
if (!patterns)
return;
plen = patterns.length;
cells = this.getSelectedRange({ rowIndex: fillRange[0], colIndex: fillRange[1] }, { rowIndex: fillRange[2], colIndex: fillRange[3] });
clen = cells.length;
if (isRFill) {
cells = cells.reverse();
patterns = patterns.reverse();
patterns = this.ensurePattern(patterns);
cellObjs = cellObjs.reverse();
data = data.reverse();
}
j = 0;
while (j < clen) {
dataObj = {};
cellIdx = cells[j];
patrn = patterns[j % plen];
if (this.isNumber(patrn))
patrn = patterns[patrn];
switch (patrn.type) {
case this.colType.Number:
val = this.round(patrn.regVal.a + (patrn.regVal.b * patrn.i), 5);
if (isRFill)
patrn.i--;
else
patrn.i++;
break;
case this.colType.String:
val = patrn.val[patrn.i % patrn.val.length];
patrn.i++;
break;
case this.colType.Formula:
hasRef = false;
val = "=";
k = 0;
tlen = patrn.val.length;
while (k < tlen) {
temp = patrn.val[k];
if (this.isObject(temp)) {
hasRef = true;
tot = this.round(temp.a + (temp.b * patrn.i), 0);
if (tot < 1)
val += "#REF!";
else
val += isVFill ? temp.c + (temp.b ? tot : '$' + tot) : (temp.b ? this.base.generateHeaderText(tot) : '$' + this.base.generateHeaderText(tot)) + temp.c;
}
else
val += temp;
k++;
}
if (hasRef && isRFill)
patrn.i--;
else
patrn.i++;
break;
case this.colType.Custom:
val = this.round(patrn.regVal.a + (patrn.regVal.b * patrn.i), 0);
if (val < 0)
val = (val % patrn.len) + patrn.len;
if (val >= patrn.len)
val = val % patrn.len;
val = patrn.val[val];
if (isRFill)
patrn.i--;
else
patrn.i++;
break;
}
l = j % dlen;
let cell = ej.spreadsheet.getCell(cellIdx.rowIndex, cellIdx.colIndex, sheet);
if (cellObjs[l]) {
cell = this.formObjFromValues(cellObjs[l], ['style', 'format', 'wrap', 'isLocked', 'validation', 'hyperlink',]);
cell['value'] = val;
}
else {
cell = {};
}
this.base.ssObj.biz.setCell(cellIdx.rowIndex, cellIdx.colIndex, sheet, cell);
if (cell.validation && cell.validation.isHighlighted) {
this.base.ssObj.addInvalidHighlight(this.base.generateHeaderText(cellIdx.colIndex + 1) + (cellIdx.rowIndex + 1));
}
j++;
}
i++;
}
let args = { options: options, direction: this.direction, action: 'autofill', origin: 'biz', sheetIndex: this.base.getSheetIndex() };
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
formObjFromValues(cellObj, props) {
let obj = {};
for (let i = 0; i < props.length; i++) {
if (cellObj[props[i]]) {
obj[props[i]] = cellObj[props[i]];
}
}
return obj;
}
updateFillValues(isVFill, drSR, drSC, drER, drEC, frSR, frSC, frER, frEC, i) {
let pStart, pEnd, fStart, fEnd, patrnRange, fillRange;
if (isVFill) {
pStart = { rowIndex: drSR, colIndex: drSC + i };
pEnd = { rowIndex: drER, colIndex: drSC + i };
fStart = { rowIndex: frSR, colIndex: frSC + i };
fEnd = { rowIndex: frER, colIndex: frSC + i };
}
else {
pStart = { rowIndex: drSR + i, colIndex: drSC };
pEnd = { rowIndex: drSR + i, colIndex: drEC };
fStart = { rowIndex: frSR + i, colIndex: frSC };
fEnd = { rowIndex: frSR + i, colIndex: frEC };
}
patrnRange = [pStart.rowIndex, pStart.colIndex, pEnd.rowIndex, pEnd.colIndex];
fillRange = [fStart.rowIndex, fStart.colIndex, fEnd.rowIndex, fEnd.colIndex];
return { patrnRange: patrnRange, fillRange: fillRange };
}
createPattern(range, options) {
let j, idx, temp, regVal, custColl, lCaseColl, lCaseVal, isLCase, diff, len, i = 0, pattern = [];
let patrns = this.createDataPattern(range);
let plen = patrns.length;
let patrn;
if (patrns) {
while (i < plen) {
patrn = patrns[i];
switch (patrn.type) {
case this.colType.Number:
idx = pattern.length;
len = patrn.val.length;
diff = options.isRFill ? -1 : len;
if (len === 1)
patrn.val.push(patrn.val[0] + 1);
regVal = this.getPredictionValue(patrn.val);
temp = { regVal: regVal, type: patrn.type, i: diff };
pattern.push(temp);
j = 1;
while (j < len) {
pattern.push(idx);
j++;
}
break;
case this.colType.String:
idx = pattern.length;
temp = { val: patrn.val, type: patrn.type, i: 0 };
pattern.push(temp);
j = 1;
len = patrn.val.length;
while (j < len) {
pattern.push(idx);
j++;
}
break;
case this.colType.Formula:
len = patrn.val.length;
patrn = this.createFormulaPattern(patrn.val, options);
diff = options.isRFill ? -1 : len;
if (patrn.isInPattern) {
idx = pattern.length;
temp = { val: patrn.val, type: this.colType.Formula, i: diff };
pattern.push(temp);
j = 1;
while (j < len) {
pattern.push(idx);
j++;
}
}
else {
j = 0;
diff = options.isRFill ? -1 : 1;
while (j < len) {
pattern.push({ val: patrn.val[j], type: this.colType.Formula, i: diff });
j++;
}
}
break;
}
i++;
}
return pattern;
}
}
createDataPattern(range) {
let val, type, i = 0;
let obj = {};
let patrn = [];
let cellObjs;
cellObjs = this.getData(range);
let data = this.getRawData(cellObjs);
let dlen = data.length;
if (dlen) {
while (i < dlen) {
val = data[i];
type = this.getType(val);
if (i === 0)
obj = { val: [val], type: type };
else if (type === obj.type)
obj.val.push(val);
else {
patrn.push(obj);
obj = { val: [val], type: type };
}
i++;
}
patrn.push(obj);
return patrn;
}
}
createFormulaPattern(data, options) {
let patrn, j, temp, isInPatrn, patrns = [], i = 0, len = data.length, cRfrType;
while (i < len) {
patrns.push(this.parseFormula(data[i]));
i++;
}
isInPatrn = this.isInPattern(patrns, options.isVFill);
if (isInPatrn) {
patrn = patrns[0];
i = patrn.length;
while (i--) {
temp = patrn[i];
cRfrType = this.isCellReference(temp);
if (cRfrType && (cRfrType !== "absolute"))
patrn[i] = this.getCellRefPrediction(temp, options, null, cRfrType);
}
return { isInPattern: isInPatrn, val: patrn };
}
else {
i = 0;
while (i < len) {
patrn = patrns[i];
j = patrn.length;
while (j--) {
temp = patrn[j];
cRfrType = this.isCellReference(temp);
if (cRfrType && (cRfrType !== "absolute"))
patrns[i][j] = this.getCellRefPrediction(temp, options, len, cRfrType);
}
i++;
}
return { isInPattern: isInPatrn, val: patrns };
}
}
parseFormula(formula) {
var temp, str, len, i = 0, arr = [];
formula = this.markSpecialChar(formula.replace("=", ""));
formula = formula.split(/\(|\)|=|\^|>|<|,|:|\+|-|\*|\/|%|&/g);
len = formula.length;
while (i < len) {
temp = formula[i];
if (!temp) {
i++;
continue;
}
if (temp.length === 1)
arr.push(this.isUniqueChar(temp) ? this.getUniqueCharVal(temp) : temp);
else {
str = temp[0];
if (temp.indexOf('!') > 0) {
if (this.isUniqueChar(str)) {
arr.push(this.getUniqueCharVal(str));
temp = temp.substr(1);
}
str = temp.indexOf('!') + 1;
arr.push(temp.substr(0, str));
arr.push(temp.substr(str));
}
else if (this.isUniqueChar(str)) {
arr.push(this.getUniqueCharVal(str));
arr.push(temp.substr(1));
}
else
arr.push(temp);
}
i++;
}
return arr;
}
getUniqueCharVal(str) {
switch (str) {
case this.UC.uniqueOBracket:
return "(";
case this.UC.uniqueCBracket:
return ")";
case this.UC.uniqueCSeparator:
return ",";
case this.UC.uniqueCOperator:
return ':';
case this.UC.uniquePOperator:
return "+";
case this.UC.uniqueSOperator:
return "-";
case this.UC.uniqueMOperator:
return "*";
case this.UC.uniqueDOperator:
return "/";
case this.UC.uniqueModOperator:
return "%";
case this.UC.uniqueConcateOperator:
return "&";
case this.UC.uniqueEqualOperator:
return "=";
case this.UC.uniqueExpOperator:
return "^";
case this.UC.uniqueGTOperator:
return ">";
case this.UC.uniqueLTOperator:
return "<";
}
return "";
}
isUniqueChar(str) {
var code = str.charCodeAt(str);
return code >= 129 && code <= 142;
}
markSpecialChar(formula) {
formula = formula.replace(/\(/g, "(" + this.UC.uniqueOBracket).replace(/\)/g, ")" + this.UC.uniqueCBracket);
formula = formula.replace(/,/g, "," + this.UC.uniqueCSeparator).replace(/:/g, ":" + this.UC.uniqueCOperator);
formula = formula.replace(/\+/g, "+" + this.UC.uniquePOperator).replace(/-/g, "-" + this.UC.uniqueSOperator);
formula = formula.replace(/\*/g, "*" + this.UC.uniqueMOperator).replace(/\//g, "/" + this.UC.uniqueDOperator);
formula = formula.replace(/&/g, "&" + this.UC.uniqueConcateOperator);
formula = formula.replace(/=/g, "=" + this.UC.uniqueEqualOperator);
formula = formula.replace(/\^/g, "^" + this.UC.uniqueExpOperator);
formula = formula.replace(/>/g, ">" + this.UC.uniqueGTOperator).replace(/</g, "<" + this.UC.uniqueLTOperator);
return formula.replace(/%/g, "%" + this.UC.uniqueModOperator);
}
isInPattern(patrn, isVFill) {
var oldPatrn, olen, newPatrn, nlen, oldStr, newStr, oldInt, newInt, eStr = "", i = 0, j = 1, plen = patrn.length, nregx = new RegExp("[0-9$]", "g"), aregx = new RegExp("[a-z$]", "gi");
if (plen === 1)
return false;
while (j < plen) {
oldPatrn = patrn[i];
newPatrn = patrn[j];
olen = oldPatrn.length;
nlen = newPatrn.length;
if (olen !== nlen)
return false;
else {
while (olen--) {
oldStr = oldPatrn[olen];
newStr = newPatrn[olen];
if (this.isCellReference(oldStr) === this.isCellReference(newStr)) {
if (isVFill) {
oldInt = Number(oldStr.replace(aregx, eStr));
newInt = Number(newStr.replace(aregx, eStr));
}
else {
oldInt = this.generateColCount(oldStr.replace(nregx, eStr));
newInt = this.generateColCount(newStr.replace(nregx, eStr));
}
if (oldInt !== newInt - 1)
return false;
}
else if (oldStr !== newStr)
return false;
}
}
i++;
j++;
}
return true;
}
generateColCount(text) {
var colCount = 0;
text = text.split('').reverse().join('');
for (var i = text.length - 1; i >= 0; i--) {
colCount += (text[i].charCodeAt(text[i]) - 64) * (Math.pow(26, i));
}
return colCount;
}
getData(range) {
let sheet = this.base.ssObj.biz.getActiveSheet();
let data = [];
let obj;
let newRange = this.base.swapRange(range);
for (let i = newRange[0]; i <= newRange[2]; i++) {
for (let j = newRange[1]; j <= newRange[3]; j++) {
obj = sheet.rows[i] ? sheet.rows[i].cells[j] : undefined;
data.push(obj);
}
}
return data;
}
getRawData(arr) {
let len = arr.length;
let newArr = [];
for (let i = 0; i < len; i++) {
if (!arr[i] || !arr[i].value || arr[i].value.length === 0) {
newArr.push('');
}
else if (arr[i].formula) {
newArr.push(arr[i].formula);
}
else if (arr[i].value) {
newArr.push(arr[i].value);
}
}
return newArr;
}
isCellReference(text) {
return /^[a-z]{1,3}\d{1,7}$/gi.test(text) ? "relative" : (/^\$[a-z]{1,3}\$\d{1,7}$/gi.test(text) ? "absolute" : (/^((\$[a-z]{1,3})\d{1,7}|[a-z]{1,3}(\$\d{1,7}))$/gi.test(text) ? "mixed" : false));
}
getCellRefPrediction(text, options, length, rfrType) {
text = text.toUpperCase();
var eStr = "", aRegx = new RegExp("[a-z$]", "gi"), nRegx = new RegExp("[0-9$]", "g"), str = options.isVFill ? text.replace(nRegx, eStr) : text.replace(aRegx, eStr);
let temp = options.isVFill ? Number(text.replace(aRegx, eStr)) : this.generateColCount(text.replace(nRegx, eStr)), arr = [temp], isColAbslt = text[0] === '$';
if (length && length !== 1)
arr.push(temp + length);
else
arr.push(temp + 1);
temp = this.getPredictionValue(arr);
if (rfrType && (rfrType === "mixed")) {
if (isColAbslt === options.isVFill)
str = '$' + str;
else
temp.b = 0;
}
temp.c = str;
return temp;
}
getType(val) {
let type1;
let type = this.isCustomType(val);
if (type)
type1 = type;
else if (this.isFormula(val))
type1 = this.colType.Formula;
else if (this.isNumber(val))
type1 = this.colType.Number;
return type1 || this.colType.String;
}
isCustomType(val) {
val = val + "";
val = val.toLowerCase();
let i = this.customList.length;
while (i--) {
if (this.toArrayLowerCase(this.customList[i].slice(0)).indexOf(val) > -1)
return this.colType.Custom + i;
}
return false;
}
toArrayLowerCase(args) {
for (let i = 0; i < args.length; i++)
args[i] = args[i].toString().toLowerCase();
return args;
}
isFormula(formula) {
let obrackets, cbrackets;
if (formula) {
if (!formula.toString().indexOf("=") && formula.length > 1) {
obrackets = formula.split("(").length - 1;
cbrackets = formula.split(")").length - 1;
return obrackets === cbrackets;
}
}
return false;
}
isNumber(val) {
return val - parseFloat(val) >= 0;
}
round(val, digits) {
let str = val + 'e' + digits;
let str1 = 'e-' + digits;
return Number(Math.round(str) + str1);
}
getPredictionValue(args) {
let i = 0, sumx = 0, sumy = 0, sumxy = 0, sumxx = 0, n = args.length;
while (i < n) {
sumx = sumx + i;
sumy = sumy + Number(args[i]);
sumxy = sumxy + (i * Number(args[i]));
sumxx = sumxx + (i * i);
i++;
}
let a = this.round(((sumy * sumxx) - (sumx * sumxy)) / ((n * sumxx) - (sumx * sumx)), 5), b = this.round(((n * sumxy) - (sumx * sumy)) / ((n * sumxx) - (sumx * sumx)), 5);
return { a: a, b: b };
}
ensurePattern(patterns) {
let patrn, idx = -1, i = patterns.length;
while (i--) {
patrn = patterns[i];
if (this.isObject(patrn)) {
idx = i;
if (patrn.type === this.colType.String)
patrn.val = patrn.val.reverse();
}
else
patterns[i] = idx;
}
return patterns;
}
isObject(obj) {
if (typeof obj !== "object")
return false;
return Object.prototype.toString.call(obj) === "[object Object]";
}
getSelectedRange(startcell, endcell) {
let i, j, k, l, arr = [], range = this.base.swapRange([startcell.rowIndex, startcell.colIndex, endcell.rowIndex, endcell.colIndex]);
i = range[0], j = range[2];
while (i <= j) {
k = range[1];
l = range[3];
while (k <= l) {
arr.push({ rowIndex: i, colIndex: k });
k++;
}
i++;
}
return arr;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Autofill();
}
return this.instance;
}
}
Sheets.Autofill = Autofill;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"autofill.js","sourceRoot":"","sources":["autofill.ts"],"names":[],"mappings":"AAcA,IAAU,OAAO,CA46BhB;AA56BD,WAAU,OAAO;IACb,IAAiB,IAAI,CAy6BpB;IAz6BD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAu6B7B;QAv6BD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAq6B1B;YAr6BD,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CAm6BtB;gBAn6BD,WAAiB,MAAM;oBACnB,MAAa,QAAQ;wBAArB;4BAwBW,cAAS,GAAW,EAAE,CAAC;4BAKvB,YAAO,GAA0R,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE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C,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAgB,CAAC;gCAC/G,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAC3B,EAAU,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,CAACLine truncated
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.hederText={};this.colType={String:"string",Number:"number",Custom:"custom",Formula:"formula",Time:"time",LongDate:"longdate",ShortDate:"shortdate",Scientific:"scientific",Fraction:"fraction",Text:"text",General:"general",Accounting:"accounting",Currency:"currency",Percentage:"percentage",Date:"date",DateTime:"datetime"};this.customList=[["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["January","February","March","April","May","June","July","August","September","October","November","December"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]];this.UC={uniqueOBracket:String.fromCharCode(129),uniqueCBracket:String.fromCharCode(130),uniqueCSeparator:String.fromCharCode(131),uniqueCOperator:String.fromCharCode(132),uniquePOperator:String.fromCharCode(133),uniqueSOperator:String.fromCharCode(134),uniqueMOperator:String.fromCharCode(135),uniqueDOperator:String.fromCharCode(136),uniqueModOperator:String.fromCharCode(137),uniqueConcateOperator:String.fromCharCode(138),uniqueEqualOperator:String.fromCharCode(139),uniqueExpOperator:String.fromCharCode(140),uniqueGTOperator:String.fromCharCode(141),uniqueLTOperator:String.fromCharCode(142)}}init(n){this.base=n;this.ssObj=n.ssObj;this.initProp()}initProp(){this.beforeSelectFn=this.beforeSelect.bind(this);this.base.ssObj.addEventListener("beforeSelect",this.beforeSelectFn);this.selectFn=this.selected.bind(this);this.base.ssObj.addEventListener("select",this.selectFn);this.actionCompleteFn=this.updateAutofill.bind(this);this.base.ssObj.addEventListener("actionComplete",this.actionCompleteFn);this.createdFn=this.created.bind(this);this.base.ssObj.addEventListener("created",this.createdFn);this.dataBoundFn=this.dataBound.bind(this);this.base.ssObj.addEventListener("dataBound",this.dataBoundFn);this.cellEditFn=this.cellEdit.bind(this);this.base.ssObj.addEventListener("cellEditing",this.cellEditFn);this.cellSaveFn=this.cellSave.bind(this);this.base.ssObj.addEventListener("cellSave",this.cellSaveFn);this.base.ssObj.on("activeSheetChanged",this.updateAutofill,this);this.base.ssObj.on("mouseDown",this.mouseDown,this)}destroy(){this.base.ssObj.removeEventListener("beforeSelect",this.beforeSelectFn);this.base.ssObj.removeEventListener("select",this.selectFn);this.base.ssObj.removeEventListener("actionComplete",this.actionCompleteFn);this.base.ssObj.removeEventListener("created",this.createdFn);this.base.ssObj.removeEventListener("dataBound",this.dataBoundFn);this.base.ssObj.removeEventListener("cellEditing",this.cellEditFn);this.base.ssObj.removeEventListener("cellSave",this.cellSaveFn);this.base.ssObj.off("activeSheetChanged",this.updateAutofill);this.base.ssObj.on("mouseDown",this.mouseDown,this);ej.base.EventHandler.remove(this.base.ssObj.element,"mouseup",this.mouseUp);ej.base.EventHandler.remove(this.base.ssObj.element,"keydown",this.keypress);ej.base.EventHandler.remove(this.base.ssObj.element,"dblclick",this.dblClick)}cellEdit(){this.hideAutofill()}cellSave(){this.updateAutofill()}dataBound(){this.updateAutofill()}createBorders(){if(!this.base.ssObj.element.getElementsByClassName("biz-af-bdr")[0]){let n=this.base.ssObj.element.getElementsByClassName("e-sheet-content")[0];this.bdrAF=n.appendChild(ej.base.createElement("div",{className:"biz-af-bdr"}))}}hideBorders(){this.bdrAF&&(this.bdrAF.style.display="none")}showBorders(){this.bdrAF&&(this.bdrAF.style.display="")}updateBorderDirection(n){this.bdrAF.style.borderRightWidth="1px";this.bdrAF.style.borderLeftWidth="1px";this.bdrAF.style.borderTopWidth="1px";this.bdrAF.style.borderBottomWidth="1px";this.bdrAF.style["border"+n+"Width"]="0px"}mouseDown(n){if(n.target.classList.contains("biz-autofill")){this.isDrag=!0;ej.base.EventHandler.add(this.base.ssObj.element,"mousemove",this.mouseMoveHandler,this);this.x=n.clientX;this.y=n.clientY;this.indexes=this.base.ssObj.biz.getIndexes();this.createBorders();let t=this.base.ssObj.element.getElementsByClassName("e-selection")[0],i=this.base.ssObj.element.getElementsByClassName("e-active-cell")[0];this.selection=t.classList.contains("e-hide")?i:t;this.selOffset=this.selection.getBoundingClientRect();this.parentOffset=this.selection.offsetParent.getBoundingClientRect();this.left=parseInt(this.selection.style.left);this.top=parseInt(this.selection.style.top)}}mouseUp(){this.isDrag=!1;ej.base.EventHandler.remove(this.base.ssObj.element,"mousemove",this.mouseMoveHandler);this.direction!=undefined&&this.autoFill();this.direction=undefined;this.hideBorders();this.isDragged=!1;this.prevTarget=undefined}createAutofill(){if(!this.base.ssObj.element.getElementsByClassName("biz-autofill")[0]){this.element=document.createElement("div");this.element.classList.add("biz-autofill");let n=this.base.ssObj.element.getElementsByClassName("e-sheet-content")[0];n&&n.appendChild(this.elemenLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":";;;;;;;;;AAIA,IAAU,OAAO,CAmtIhB;AAntID,WAAU,OAAO;IACb,IAAiB,IAAI,CAgtIpB;IAhtID,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA8sI7B;QA9sID,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CA4sI1B;YA5sID,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CA0sItB;gBA1sID,WAAiB,MAAM;oBACnB,MAAa,IAAI;wBAAjB;4BA4BI,eAAU,GAAY,KAAK,CAAC;4BAO5B,eAAU,GAAQ,IAAI,IAAI,EAAE,CAAC;4BAC7B,mBAAc,GAAW,CAAC,CAAC;4BAE3B,WAAM,GAAY,KAAK,CAAC;4BAWxB,gBAAW,GAAY,KAAK,CAAC;4BAI7B,qBAAgB,GAAQ,EAAE,CAAC;4BAE3B,cAA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AAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;oCAC1G,IAAI,CAAS,CAAC;oCACd,IAAI,CAAS,CAAC;oCACd,IAAI,CAAS,CAAA;oCACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wCACzC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CALine truncated
+6
View File
@@ -0,0 +1,6 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.isViewOnly=!1;this.editedTime=new Date;this.lastEditedTime=0;this.f2Edit=!1;this.showFormula=!1;this.fontFamilyRecent=[];this.isFormula=!1;this.isResizing=!1;this.rowwidthcount=0;this.isNewSheet=!1;this.reqCount=0;this.isInitial=!0;this.clicks=0;this.autofillDrag=!1;this.checkedIndexes=[];this.selectedIndexes=[null,null,null,null];this.isCtrlA=!1;this.isCreatingNewFile=!1;this.isDriveImport=!1;this.openJSON=!1}init(t,i,r,u){this.result=t.result;this.documentGroup=this.result.DocumentGroup;this.customresult=r.result;this.filedata=i.result;this.FileName=t.result.FileTitle;this.FileId=t.result.FileId;this.permissionLevel=t.result.UserPermission;this.lastEditedTime=t.result.LastUpdateTime;this.timePeriod=t.result.TimePeriod;this.username=t.result.LastUpdateByName;this.folderId=t.result.folderId;this.fileurl=t.result.FileUrl;this.Priority=t.result.Priority;this.newUpload=t.result.NewUpload;this.NewDocument=t.result.NewDocument;this.identity=n.Platform.Membership.Infos.Identity.getCurrentUser();this.unibaseusername=this.identity.name;this.hederText={};this.mouseDownHandlers=[];this.keyDownHandlers=[];this.render();u!=null&&u()}clickHandler(n){n.target.getAttribute("id")=="importdata-cancel-bt";n.target.getAttribute("id")=="importdata-select-btn"}removeListeners(){}unwireBootStrapKeyEvent(){let t=document.body.getElementsByClassName("_bizgaze_popup_container"),n=$._data($(t)[0],"events");n&&n.keydown&&$(t).off("keydown.dismiss.bs.modal",n.keydown[0].handler);n&&n.click&&n.click.filter(n=>n).forEach(n=>{$(t).off("click.dismiss.bs.modal",n.handler)})}clearFindReplace(){this.ssObj.element.querySelector(".e-find-dlg")||this.ssObj.element.querySelector(".e-findtool-dlg")||(this.ssObj.ribbonModule.findValue="",this.ssObj.findAndReplaceModule.shortValue="")}fullScreenHandler(){setTimeout(()=>{this.setHeightOnFullScreenChange()},0)}processSheetRender(){this.updateProps();this.renderMenuBar();this.refreshHeight();this.ssRender();this.ribbon.init(this.result);this.permissionLevel&&this.permissionLevel==n.Apps.Collaboration.Enums.Share.Viewer&&setTimeout(()=>{this.setViewonly(),this.ssObj.dataBind()},0);this.unwireBootStrapKeyEvent();this.priorityRender();this.eventListners();this.colourpicker()}connectHub(t,i){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/collaboration/components/docconnector.js","apps/collaboration/components/unidochub.js"],function(){n.Apps.Collaboration.Components.DocConnector.Instance().init(t,i)})}sheetColorRender(){this.NewDocument||n.Apps.Collaboration.DocumentManager.Instance().getCustomJsonData(this.FileId).then(n=>{var i=n.result.tabcolors,r,u,f,t;for(this.sheets=this.ssObj.element.querySelector(".e-sheet-tab").querySelectorAll(".e-toolbar-item"),this.sheetsName=this.ssObj.element.querySelector(".e-sheet-tab .e-active").querySelector(".e-tab-text"),t=0;t<this.sheets.length;t++)i.sheets[t].TabColor!==null&&i.sheets[t].TabColor!==undefined&&i.sheets[t].TabColor.Name!=="0"&&i.sheets[t].TabColor.Name!==null&&i.sheets[t].TabColor.Name!==undefined&&(r=i.sheets[t].TabColor.R==null||i.sheets[t].TabColor.R==""?0:i.sheets[t].TabColor.R,u=i.sheets[t].TabColor.G==null||i.sheets[t].TabColor.G==""?0:i.sheets[t].TabColor.G,f=i.sheets[t].TabColor.B==null||i.sheets[t].TabColor.B==""?0:i.sheets[t].TabColor.B,document.getElementById(this.sheets[t].id).style.borderBottom="4px solid rgb("+r+","+u+","+f+")",document.getElementById(this.sheets[t].id).firstElementChild.style.height="100%");document.getElementsByClassName("e-indicator e-ignore")[1].style.display="none"});document.getElementsByClassName("e-indicator e-ignore")[1].style.display="none"}sheetColorChange(t){var r=this.ssObj.activeSheetIndex,i,u,f;r!=null&&(i=[],t!="0"?(i=this.hexToRgb(t),u="#"+t):(i.push(0),i.push(0),i.push(0),u=t),f={FileId:this.FileId,TabColor:i,SheetIndex:r,SheetHexCode:u},n.Apps.Collaboration.DocumentManager.Instance().saveSheetColor(f).then(u=>{t!=0?(document.getElementById(this.sheets[r].id).style.borderBottom="4px solid rgb("+i[0]+","+i[1]+","+i[2]+")",document.getElementById(this.sheets[r].id).firstElementChild.style.height="100%"):document.getElementById(this.sheets[r].id).style.borderBottom="none";document.getElementsByClassName("e-indicator e-ignore")[1].style.display="none";this.customresult=u.result.tabcolor;this.editDetails();let f={origin:"biz",action:"colorchange",sheetIndex:this.getSheetIndex()};n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(f)}))}hexToRgb(n){var t=n.match(/.{1,2}/g);return[parseInt(t[0],16),parseInt(t[1],16),parseILine truncated
<div id="biz-ss-connecteduser_`+i+`" class="biz-ss-connectedusersfirstletter m-auto" data-toggle="popover" data-placement="top" title = "`+this.connecteduserfirstName[n]+`">`+r[n]+`</div></div>`,n<=5&&$("#biz-ss-connected_users_container").append(o),s+='<a class="dropdown-item d-flex flex-row align-items-center p-1 my-1" href="javascript:void(0)"><div class="biz-ss-connectedusersfirstletter border mr-2 px-2 rounded-circle text-white" style="background-color:#'+f+'" title = "'+this.connecteduserfirstName[n]+'">'+r[n]+'<\/div><span class="font-13 font-weight-500">'+t[n].firstName+"<\/span><\/a>",n>5&&($("#biz-ss-connected_users_container").children().last().remove(),$("#biz-ss-connected_users_container").append('<div class="users-dropdown"><a href="javascript:void(0);" class="d-flex flex-row border rounded-circle w-35p h-35p text-dark biz-ss-users-'+n+'" role="button" id="biz-ss-connecteduser-'+i+'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style=" background-color:lightgray;margin-right:-8px"><span class="m-auto font-14 font-weight-500"><span class="font-12 text-muted"><i class="la la-plus"><\/i><\/span>'+[n-4]+'<\/span><\/a><div class="dropdown-menu z-index-10 position-absolute bg-white h-275p scroll-bar" aria-labelledby="biz-ss-connecteduser-'+i+'"><\/div>'),$(".users-dropdown .dropdown-menu").append(s))}fontFamilyBfOpen(n){if(n.element.parentElement.classList.remove("e-font-family"),this.fontFamilyRecent.length){let n=this.ssObj.ribbonModule.getFontFamilyItems();delete n[5].iconCss;let i=this.ssObj.biz.getActiveSheet(),r=ej.spreadsheet.getIndexesFromAddress(i.activeCell),t=ej.spreadsheet.getCell(r[0],r[1],i),u=t&&t.style&&t.style.fontFamily||"Calibri";for(let t=0;t<n.length;t++)n[t].text===u&&(n[t].iconCss="e-icons e-selected-icon");let f=this.fontFamilyRecent.concat([{separator:!0}]).concat(n);this.fontFamilyObj.items=f;this.fontFamilyObj.dataBind()}}fontFamilyBfRender(n){n.element.style.fontFamily=n.item.text}fontFamilySelect(n){this.fontFamilyRecent=this.fontFamilyRecent.filter(t=>t.text!==n.item.text);this.fontFamilyRecent.unshift({text:n.item.text});this.fontFamilyRecent.length>5&&this.fontFamilyRecent.pop()}wireEvents(){this.permissionLevel!==n.Apps.Collaboration.Enums.Share.Viewer&&(document.body.addEventListener("mousedown",this.mouseDown.bind(this)),document.body.addEventListener("mouseup",this.mouseUp.bind(this)),document.body.querySelector(".DocumentViewer").addEventListener("keyup",this.keyUp.bind(this)),document.body.addEventListener("dblclick",this.bodyDblClick.bind(this)),document.body.querySelector(".DocumentViewer").addEventListener("keydown",this.keyDown.bind(this)));window.addEventListener("keydown",this.windowKeydown.bind(this));document.body.addEventListener("mouseup",this.viewOnlyMouseUp.bind(this));document.body.addEventListener("mousedown",this.viewOnlyMouseDown.bind(this));document.body.querySelector(".DocumentViewer").addEventListener("keydown",this.viewOnlyKeyDown.bind(this))}unwireEvents(){document.body.removeEventListener("mousedown",this.mouseDown.bind(this));document.body.removeEventListener("mousedown",this.mouseDown.bind(this));document.body.removeEventListener("mouseup",this.mouseUp.bind(this));document.body.querySelector(".DocumentViewer").removeEventListener("keydown",this.keyDown.bind(this));document.body.querySelector(".DocumentViewer").removeEventListener("keyup",this.keyUp.bind(this));document.body.removeEventListener("mouseup",this.viewOnlyMouseUp.bind(this));document.body.removeEventListener("mousedown",this.viewOnlyMouseDown.bind(this));document.body.querySelector(".DocumentViewer").removeEventListener("keydown",this.viewOnlyKeyDown.bind(this));document.body.removeEventListener("dblclick",this.bodyDblClick.bind(this));window.removeEventListener("keydown",this.windowKeydown.bind(this))}eventListners(){document.getElementsByClassName("biz-ss-cloudsave")[0].addEventListener("click",()=>{n.Apps.Collaboration.Components.Sheets.Ribbon.Instance().renderCloudSavedDialogue()});document.getElementsByClassName("biz-ss-cloudloading")[0].addEventListener("click",()=>{n.Apps.Collaboration.Components.Sheets.Ribbon.Instance().renderCloudSavingDialogue()});document.getElementsByClassName("biz-ss-filename")[0].addEventListener("focusout",()=>{this.FileId?this.fileNameChange():this.download.ssAutoSave({action:"createNewSpreadsheet",eventArgs:{}},this,!1)});document.getElementsByClassName("biz-ss-starred")[0].addEventListener("click",()=>{n.Apps.Collaboration.Components.UniCloud.Instance().priority(this.FileId,"file","ss",0)});this.ssObj.enableContextMenu&&this.ssObj.contextMenuModule.contextMenuInstance.addEventListener("beforeItemRender",n=>{var t=this.ssObj.biz.getIndexes();let u=this.ssObj.biz.getActiveSheet();if(n.item.text=="UnHide Rows"){var f=t[0],e=t[2],i=u.rows;i=i.slice(f,e+1);i.filter({hidden:n}=>n==!0).length==1&&(n.element.innerHTML="UnHide Row")}if(n.item.text=="UnHide Columns"){var o=t[1],s=t[3],r=uLine truncated
<p>you can only view this document. To make changes, ask the owner for edit access</p>
</div>`,width:"240px",height:"135px",buttons:[{click:this.processAccessDailog.bind(this),buttonModel:{content:"Request Edit Access",isPrimary:!0}}],position:{X:12,Y:95},cssClass:"biz-ss-viewonly-dialog"}),this.viewOnlyDialog.appendTo("#dialog"))})}getElem(){var n=document.createElement("button");n.setAttribute("id","biz-ss-viewonly-btn");let t=new ej.buttons.Button;return t.appendTo(n),n.innerHTML="View Only",n}initialLoad(){let n=this.ssObj.ribbonModule.getRibbonItems.bind(this.ssObj.ribbonModule);this.ssObj.ribbonModule.getRibbonItems=()=>{let t=n(),i=t[0].content,r={template:this.getElem(),cssClass:"biz-ss-viewonly-wrapper",id:this.ssObj.element.id+"_viewonly",tooltipText:"View Only"};return i.splice(t[0].content.length,0,r),t}}performBizUndoRedo(t,i){let u=this.ssObj.undoredoModule,r;if(r=i?t.isUndo?u.undoCollection.pop():u.redoCollection.pop():t.isUndo?u.undoCollection[u.undoCollection.length-1]:u.redoCollection[u.redoCollection.length-1],r&&r.action=="resize"){var f=r;r=[];r.args=f}if(r&&r.args){switch(r.args.action){case"autofill":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.setCellObjects(r.args.options.fillRange,n)}else this.autofill.applyAutofill(r.args.options,r.args.direction);break;case"formatpaint":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.setCellObjects(r.args.options.destIndexes,n)}else this.formatpainter.applyFormatPaint(r.args.options.srcRange,r.args.options.destRange,r.args.options.srcSheetIndex);break;case"trim":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.setCellObjects(r.args.range,n)}else this.ribbon.processTrim(r.args.range);break;case"removeDuplicates":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.setCellObjects(r.args.options.indexes,n)}else this.dialogue.removeDuplicate(r.args.options.range,r.args.options.header,r.args.options.colSelected);break;case"splittext":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.setCellObjects(r.args.range,n,r.args.stValues)}else this.formatpainter.applySplitText(r.args.range,r.args.stValues);break;case"shiftcells":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.dragCells)),t=JSON.parse(JSON.stringify(r.args.dropCells));this.setCellObjects(r.args.options.ranges,n);this.setCellObjects(r.args.options.dropRange,t)}else{let n=JSON.parse(JSON.stringify(r.args.dragCells));this.setCellObjects(r.args.options.ranges,[]);this.setCellObjects(r.args.options.dropRange,n)}break;case"deleteshiftup":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.formatpainter.applyInsertShiftDown(r.args.range,r);this.setCellObjects(r.args.indexes,n)}else this.formatpainter.applyDeleteShiftUp(r.args.range,r);break;case"deleteshiftleft":if(t.isUndo){let n=JSON.parse(JSON.stringify(r.args.oldCells));this.formatpainter.applyInsertShiftRight(r.args.range);this.setCellObjects(r.args.indexes,n)}else this.formatpainter.applyDeleteShiftLeft(r.args.range);break;case"insertshiftdown":t.isUndo?this.formatpainter.applyDeleteShiftUp(r.args.range,r):this.formatpainter.applyInsertShiftDown(r.args.range,r);break;case"insertshiftright":t.isUndo?this.formatpainter.applyDeleteShiftLeft(r.args.range):this.formatpainter.applyInsertShiftRight(r.args.range);break;case"shortcuts":if(t.isUndo){let n=[...r.args.oldCells];this.setCellObjects(r.args.options.range,n)}else this.shortcuts(r.args.options);break;case"bizImageInCell":if(t.isUndo){let n=r.args.oldCells;n?"":n={};let t=r.args.options.indexes;this.setCellObjects(t,[n]);this.download.ssAutoSave({action:"imageincell",changedValues:[{row:t[0],cell:t[1],cellinfo:n}]},this,!0)}else this.actionInsertImage(r.args.options);break;case"resize":if(t.isUndo){let n;r.args.eventArgs.type==="Column"&&(n={args:{undo:!0,eventArgs:{index:r.args.eventArgs.index,width:r.args.eventArgs.oldSize,sheetIdx:r.args.eventArgs.sheetIdx,oldWidth:r.args.eventArgs.newSize,range:r.args.eventArgs.range},action:"resize",name:"actionComplete"}});r.args.eventArgs.type==="Row"&&(n={args:{undo:!0,eventArgs:{index:r.args.eventArgs.index,height:r.args.eventArgs.oldSize,sheetIdx:r.args.eventArgs.sheetIdx,oldHeight:r.args.eventArgs.newSize,range:r.args.eventArgs.range},action:"resize",name:"actionComplete"}});this.adjustRowsAndColumnWidth(n.args)}else this.adjustRowsAndColumnWidth(r.args);break;case"spell":if(t.isUndo){let n=[...r.args.oldCells];this.setCellObjects(r.args.options.indexes,n)}else this.adjustRowsAndColumnWidth(r.args)}let e={origin:"biz",action:"undoredo",sheetIndex:this.getSheetIndex(),isUndo:t.isUndo};i||n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(e)}}addFormatsToToolbar(){let n=this.ssObj.ribbonModule.getRibbonItems.bind(this.ssObj.ribbonModule);this.ssObj.ribbonModule.getRibbonItems=()=>{let t=n(),i=t[0].content,r=[{prefixIcon:"icon-ss-currency",cssClass:"biz-ss-currencyformat",id:this.ssObj.element.id+"_currencyformat",tooltipText:"Format as currency"},{prefixIcon:"icon-Line truncated
<textarea id="requestaccess-textarea"> </textarea>
</div>`,width:"400px",buttons:[{click:this.hideRequestAccess.bind(this),buttonModel:{content:"cancel"}},{click:this.hideRequestAccess.bind(this),buttonModel:{content:"send",isPrimary:!0}}],cssClass:"biz-ss-requestaccess-dialog",target:this.container,isModal:!0});this.requestAccessObj.appendTo("#dialog");var n=new ej.inputs.TextBox({placeholder:"Enter your message",floatLabelType:"Auto",rows:4});n.appendTo("#requestaccess-textarea");n.element.setAttribute("rows","4")}hideRequestAccess(){this.requestAccessObj.hide();this.requestAccessObj.destroy()}lettersToNumber(n){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZ",t,i,u=0;for(t=0,i=n.length-1;t<n.length;t+=1,i-=1)u+=Math.pow(r.length,i)*(r.indexOf(n[t])+1);return u}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Base=i})(i=t.Sheets||(t.Sheets={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,489 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class Dialogue {
constructor() {
this.hederText = {};
this.hasHeader = false;
}
init(base) {
this.base = base;
this.base.mouseDownHandlers.push(this.mouseDown.bind(this));
this.util = Unibase.Apps.Collaboration.Components.Common.Util.Instance();
}
mouseDown(e) {
if (this.rdDailouge) {
let cbox = ej.base.closest(e.target, '.e-checkbox-wrapper');
if (cbox) {
let tickicon = cbox.firstElementChild;
tickicon.classList.contains('e-check') ? tickicon.classList.remove('e-check') : tickicon.classList.add('e-check');
if (cbox.classList.contains('rd-selectAll')) {
var cboxes = this.rdDailouge.element.querySelector('#rd-checkboxes-container').querySelectorAll('.e-frame');
if (cbox.firstElementChild.classList.contains('e-check')) {
cbox.firstElementChild.classList.remove('e-stop');
cboxes.forEach((e) => { e.classList.add('e-check'); });
document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled");
document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled");
}
else {
cbox.firstElementChild.classList.add('e-stop');
cboxes.forEach((e) => { e.classList.remove('e-check'); });
document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled");
document.getElementsByClassName("rd-btn")[0].setAttribute("disabled", "true");
}
}
if (cbox.classList.contains('rd-colCheckbox')) {
var cboxes = this.rdDailouge.element.querySelector('#rd-checkboxes').querySelectorAll('.e-frame');
var eCheckCount = this.rdDailouge.element.querySelector('#rd-checkboxes').querySelectorAll('.e-check').length;
eCheckCount === 0 ? (document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),
document.getElementsByClassName("rd-btn")[0].setAttribute("disabled", "true")) :
(document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled"),
document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled"));
eCheckCount < cboxes.length ?
(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-check"),
document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-stop")) :
(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-check"),
document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-stop"));
}
}
}
}
removeDuplicate(range, header, colSelected) {
this.obj = {};
let sheet = this.base.ssObj.biz.getActiveSheet();
this.rngIndexes = this.base.getIndexesFromAddress(range);
this.hasHeader = header;
(header) ? this.rowStartCell = this.rngIndexes[0] + 1 : this.rowStartCell = this.rngIndexes[0];
this.columnStartCell = this.rngIndexes[1];
this.rowEndCell = this.rngIndexes[2];
this.columnEndCell = this.rngIndexes[3];
this.selected = colSelected;
for (let i = this.rowStartCell; i <= this.rowEndCell; i++) {
let wholeRow = [];
for (let j = this.columnStartCell; j <= this.columnEndCell; j++) {
if (this.selected[j] == undefined) {
var isColChecked = document.querySelector("#rd-checkboxes").querySelector('div[value="' + j + '"]').firstElementChild.classList.contains('e-check');
this.selected[j] = isColChecked;
}
if (!this.selected[j]) {
continue;
}
let cellInfo = ej.spreadsheet.getCell(i, j, sheet);
if (!cellInfo) {
wholeRow.push(null);
}
else {
wholeRow.push(this.util.getCellValues(cellInfo));
}
if (cellInfo) {
this.base.ssObj.biz.setCell(i, j, sheet, {});
delete sheet.rows[i].cells[j];
}
}
if (wholeRow) {
this.addToObj(JSON.stringify(wholeRow));
}
}
var k = 0;
var cellValue;
var keys = Object.keys(this.obj);
for (let i = this.rowStartCell; i <= this.rowEndCell; i++) {
var row;
(keys[k]) ? row = JSON.parse(keys[k]) : row = undefined;
var l = 0;
for (let j = this.columnStartCell; j <= this.columnEndCell; j++) {
if (!this.selected[j]) {
continue;
}
(row) ? cellValue = row[l] : cellValue = undefined;
if (cellValue) {
if (!(cellValue.value === undefined)) {
this.base.ssObj.biz.setCell(i, j, sheet, cellValue);
}
}
l++;
}
k++;
}
var duplicateCount = this.selectedRow - Object.keys(this.obj).length;
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({ action: 'removeDuplicates' }, this.base, true);
if (this.base.getSheetIndex() >= 0) {
if (!this.hasHeader) {
this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell + 1) + (this.rowStartCell + 1) + ":" + this.base.generateHeaderText(this.columnEndCell + 1) + (this.rowEndCell - duplicateCount + 1));
}
else {
this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell + 1) + (this.rowStartCell) + ":" + this.base.generateHeaderText(this.columnEndCell + 1) + (this.rowEndCell - duplicateCount + 2));
}
}
this.rdDailouge.destroy();
}
RDshowUniqueDailog() {
var keys = Object.keys(this.obj);
var duplicateCount;
this.hasHeader ? duplicateCount = this.selectedRow - keys.length - 1 : duplicateCount = this.selectedRow - keys.length;
if (duplicateCount == 0) {
var duplicateValuesText = "No duplicate rows were found.";
}
else if (duplicateCount == 1) {
var duplicateValuesText = "1 duplicate row were found and removed.";
}
else {
var duplicateValuesText = `${duplicateCount} duplicate rows were found and removed.`;
}
if (keys.length == 1) {
var uniqueValuesText = `1 unique row remains.`;
}
else {
var uniqueValuesText = `${keys.length} unique rows remains.`;
}
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>
<div id='rd-duplicatevaluetxt'></div>
<br/>
<div id='rd-uniquevaluetxt'></div>
</div>`,
width: '470px',
height: '180px',
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}]
});
this.rdDailouge.appendTo("#removeduplicates");
document.getElementById("rd-duplicatevaluetxt").append(duplicateValuesText);
document.getElementById("rd-uniquevaluetxt").append(uniqueValuesText);
}
;
addToObj(param) {
if (!this.obj[param]) {
this.obj[param] = 1;
}
}
renderDuplicateDailouge() {
this.range = this.base.ssObj.biz.getRange();
this.rngIndexes = this.base.getIndexesFromAddress(this.range);
this.selectedCol = this.rngIndexes[3] - this.rngIndexes[1] + 1;
this.selectedRow = this.rngIndexes[2] - this.rngIndexes[0] + 1;
this.rowStartCell = this.rngIndexes[0];
this.columnStartCell = this.rngIndexes[1];
this.rowEndCell = this.rngIndexes[2];
this.columnEndCell = this.rngIndexes[3];
if (!(this.rowStartCell - this.rowEndCell == 0 && this.columnStartCell - this.columnEndCell == 0)) {
if (this.selectedCol > 1 && this.selectedRow > 1) {
var selectedcolrowtext = `${this.selectedCol} columns and ${this.selectedRow} rows selected`;
}
else if (this.selectedCol > 1 && this.selectedRow == 1) {
var selectedcolrowtext = `${this.selectedCol} columns and ${this.selectedRow} row selected`;
}
else if (this.selectedCol == 1 && this.selectedRow > 1) {
var selectedcolrowtext = `${this.selectedCol} column and ${this.selectedRow} rows selected`;
}
var checkboxes = [];
if (this.selectedCol > 0) {
for (let i = this.columnStartCell; i <= this.columnEndCell; i++) {
var colName = this.base.generateHeaderText(i + 1);
var cbox = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: true, label: 'Columns ' + colName, cssClass: 'rd-colCheckbox' });
cbox.setAttribute('value', i);
checkboxes.push(cbox);
}
}
var elem = document.getElementById("removedup-container");
if (!elem) {
var hasHeader = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: false, cssClass: 'rd-hasHeader' });
var selectAll = ej.buttons.createCheckBox(this.base.ssObj.createElement, false, { checked: true, label: 'Select all', cssClass: 'rd-selectAll' });
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>
<div id='rd-selectedColumns-container'>
<div id="rd-selectedColumns-title-data"></div>
<div id="rd-hasHeader-checkbox"></div>
<span id="rd-hasHeader-content">Data has header row</span>
</div>
<div id="rd-selectedColumns-info-wrapper">
<div id="rd-selectedColumns-info-analyze">Select Columns to analyze</div>
<div id="rd-checkboxes-container">
<div id="rd-selectAll"> </div>
<div id="rd-checkboxes"></div>
</div></div>
</div>`,
showCloseIcon: false,
created: () => {
document.getElementById("rd-hasHeader-checkbox").appendChild(hasHeader);
document.getElementById("rd-selectAll").appendChild(selectAll);
document.getElementById("rd-selectedColumns-title-data").append(selectedcolrowtext);
checkboxes.forEach(element => {
document.getElementById("rd-checkboxes").appendChild(element);
});
setTimeout(() => {
if (document.getElementById("rd-checkboxes-container").offsetHeight < 250) {
document.getElementById("rd-checkboxes-container").style.overflowY = 'hidden';
}
else {
document.getElementById("rd-checkboxes").style.overflowY = "";
}
}, 0);
},
open: () => {
},
width: '350px',
height: 'auto',
closeOnEscape: false,
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Cancel' }
},
{
click: this.processDup.bind(this),
buttonModel: { content: 'Remove Duplicates', isPrimary: true, cssClass: "rd-btn" }
}],
});
this.rdDailouge.appendTo("#removeduplicates");
}
else {
document.getElementById("rd-selectedColumns-title-data").innerHTML = "";
document.getElementById("rd-selectedColumns-title-data").innerHTML = selectedcolrowtext;
this.rdDailouge.show();
}
}
else {
this.rdDailouge = new ej.popups.Dialog({
isModal: true,
header: 'Remove Duplicates',
content: `<div id='removedup-container'>Please select a range of cells containing values.</div>`,
width: '470px',
height: '130px',
created: () => {
document.getElementById("removeduplicates_dialog-content").style.overflowY = 'hidden';
},
buttons: [{
click: this.hideRdDailouge.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}]
});
this.rdDailouge.appendTo("#removeduplicates");
}
}
hideRdDailouge() {
this.rdDailouge.element.removeEventListener("mousedown", (e) => { });
this.rdDailouge.hide();
this.rdDailouge.destroy();
}
processDup() {
let header = false;
if (document.getElementsByClassName("rd-hasHeader")[0].firstElementChild.classList.contains("e-check")) {
header = true;
}
let range = this.base.ssObj.biz.getRange();
let indexes = this.base.ssObj.biz.getIndexes();
let args = { range: range, indexes: indexes, sheetIndex: this.base.getSheetIndex(), header: header, action: 'removeDuplicates', origin: 'biz' };
this.base.ssObj.updateUndoRedoCollection({ name: 'bizAction', args: { action: 'removeDuplicates', options: args, oldCells: this.base.getCellsFromIndexes(indexes) } });
this.removeDuplicate(range, header, {});
this.base.removeCopyIndicator();
args['colSelected'] = this.selected;
this.RDshowUniqueDailog();
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
renderMenubarFullscreenDialog() {
if (!this.menubarFullscreenDialogObj) {
this.menubarFullscreenDialogObj = new ej.popups.Dialog({
content: `<div id='menubar-fullscreen-container'>
<div id='menubar-fullscreenf11-message'>
Press <span class= "menubar-esc">Esc</span> to exit full screen <span class="biz-ss-menubarfullscreen-dismiss"> Dismiss </span></div>
</div>`,
width: '470px',
height: '45px',
position: { X: 'center', Y: 14 },
animationSettings: { effect: 'None' },
closeOnEscape: true,
cssClass: "biz-ss-menubar-fullscreen",
Close: this.hideSsMenubarFullscreenDialog.bind(this),
});
this.menubarFullscreenDialogObj.appendTo("#biz-ss-menubar-fullscreendialog");
}
else {
this.menubarFullscreenDialogObj.show();
}
}
hideSsMenubarFullscreenDialog() {
this.menubarFullscreenDialogObj.destroy();
if (document.getElementById("menubar-fullscreen-container"))
document.getElementById("menubar-fullscreen-container").parentElement.remove();
setTimeout(() => {
this.menubarFullscreenDialogObj = null;
}, 1000);
}
renderResizeDialog() {
let sheet = this.base.ssObj.biz.getActiveSheet();
let indexes = this.base.ssObj.biz.getIndexes();
let isRowsSelected = this.base.ssObj.biz.isRowsSelected(indexes);
let row = (indexes[2] - indexes[0] + 1);
let col = (indexes[3] - indexes[1] + 1);
let heading = "";
let radio1Text = "";
let inputValue;
if (isRowsSelected) {
if (row == 1)
heading = "Resize row " + (indexes[0] + 1);
else
heading = "Resize rows " + (indexes[0] + 1) + " - " + (indexes[2] + 1);
radio1Text = "Specify row height in pixels: (Default 18)";
inputValue = sheet.rows[indexes[0]] && sheet.rows[indexes[0]].height || 18.5;
}
else {
if (col == 1)
heading = "Resize column " + (this.base.generateHeaderText(indexes[0] + 1));
else
heading = "Resize columns " + this.base.generateHeaderText(indexes[1] + 1) + " - " + this.base.generateHeaderText(indexes[3] + 1);
radio1Text = "Specify column width in pixels: (Default 64)";
inputValue = sheet.columns[indexes[1]] && sheet.columns[indexes[1]].width || 64;
}
if (inputValue == undefined)
inputValue = '';
this.radiobutton = new ej.buttons.RadioButton({ label: radio1Text, name: 'resizetofit', checked: true, value: "resizeroworcol" });
this.resizeDialogObj = new ej.popups.Dialog({
content: `<div id='resize-dialog-container'>
<div id='resize-dialog-content'>
<ul>
<li><input type="radio" id="header-checkbox"></li>
<div class="e-input-group resize-input-div">
<input class="e-input" name='input' type="text" value="${inputValue}" id="resize-input" />
</div>
<li><input type="radio" id="resizetofit-checkbox"></li>
</ul>
</div>
</div>`,
width: '470px',
height: 'auto',
header: heading,
animationSettings: { effect: 'None' },
showCloseIcon: true,
closeOnEscape: true,
target: document.body.querySelectorAll('._bizgaze_popup_container')[document.body.querySelectorAll('._bizgaze_popup_container').length - 1],
created: this.resizeDialogCreated.bind(this),
cssClass: "biz-ss-resizetofit",
buttons: [
{
click: this.hideResizeDialog.bind(this),
buttonModel: { content: 'Cancel' }
},
{
click: this.processResize.bind(this),
buttonModel: { content: 'Ok', isPrimary: true }
}
],
Close: this.hideResizeDialog.bind(this),
});
this.resizeDialogObj.appendTo("#biz-ss-resizetofit-dialog");
}
resizeDialogCreated() {
this.radiobutton.appendTo('#header-checkbox');
this.radiobutton = new ej.buttons.RadioButton({ label: 'Resize to fit', name: 'resizetofit', value: "resizetofit" });
this.radiobutton.appendTo('#resizetofit-checkbox');
document.getElementsByClassName("biz-ss-resizetofit")[0].style.maxHeight = "";
}
hideResizeDialog() {
if (this.resizeDialogObj) {
this.resizeDialogObj.destroy();
setTimeout(() => {
this.resizeDialogObj = null;
});
}
}
processResize() {
return __awaiter(this, void 0, void 0, function* () {
let range = this.base.ssObj.biz.getRange();
let resizedHeaders = [];
let changedValues = [];
let resizeValue = Number(document.getElementById("resize-input").value);
let ranges = range.split(" ");
for (var i = 0; i < ranges.length; i++) {
let currentIndexes = this.base.swapRange(ej.spreadsheet.getIndexesFromAddress(ranges[i]));
yield this.resizeHeaders(currentIndexes, resizeValue, ranges[i]).then((response) => {
changedValues = changedValues.concat(response.changedValues);
resizedHeaders = resizedHeaders.concat(response.resizedHeaders);
});
}
this.hideResizeDialog();
this.base.focusDocumentViewer();
(changedValues.length > 0) && this.base.download.ssAutoSave({ action: "imageincell", changedValues: changedValues }, this.base, true);
(resizedHeaders.length > 0) && this.base.download.ssAutoSave({ action: "headerResize", resizedHeaders: resizedHeaders }, this.base, true);
});
}
resizeHeaders(indexes, resizeValue, range) {
return __awaiter(this, void 0, void 0, function* () {
let resizedHeaders = [];
let changedValues = [];
let sheetIdx = this.base.getSheetIndex();
let isRowsSelected = this.base.ssObj.biz.isRowsSelected(indexes);
let selectedRadio = document.querySelector('input[name="resizetofit"]:checked').value;
if (selectedRadio == "resizeroworcol") {
if (isRowsSelected) {
for (var i = indexes[0]; i <= indexes[2]; i++) {
yield this.setRowHeight(resizeValue, i);
resizedHeaders.push({ rowIndex: i, height: resizeValue, sheetIndex: sheetIdx, resizeType: "row" });
}
changedValues = changedValues.concat(this.base.setRowIncellImageSize(range));
}
else {
for (var i = indexes[1]; i <= indexes[3]; i++) {
yield this.setColWidth(resizeValue, i);
resizedHeaders.push({ colIndex: i, width: resizeValue, sheetIndex: sheetIdx, resizeType: "col" });
}
changedValues = changedValues.concat(this.base.setColumnIncellImageSize(range));
}
}
else {
this.base.ssObj.autoFit(range);
if (isRowsSelected)
changedValues = changedValues.concat(this.base.setRowIncellImageSize(range));
else
changedValues = changedValues.concat(this.base.setColumnIncellImageSize(range));
}
return {
changedValues: changedValues, resizedHeaders: resizedHeaders
};
});
}
setRowHeight(resizeValue, rowIdx) {
return __awaiter(this, void 0, void 0, function* () {
yield this.base.ssObj.setRowHeight(resizeValue + "px", rowIdx);
});
}
setColWidth(resizeValue, colIdx) {
return __awaiter(this, void 0, void 0, function* () {
yield this.base.ssObj.setColWidth(resizeValue + "px", colIdx);
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new Dialogue();
}
return this.instance;
}
}
Sheets.Dialogue = Dialogue;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"dialogue.js","sourceRoot":"","sources":["dialogue.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAU,OAAO,CAykBhB;AAzkBD,WAAU,OAAO;IACb,IAAiB,IAAI,CAukBpB;IAvkBD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAqkB7B;QArkBD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAmkB1B;YAnkBD,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CAikBtB;gBAjkBD,WAAiB,MAAM;oBACnB,MAAa,QAAQ;wBAArB;4BAGI,cAAS,GAAG,EAAE,CAAC;4BAUf,cAAS,GAAG,KAAK,CAAC;wBAkjBtB,CAAC;wBAxiBG,IAAI,CAAC,IAAS;4BACV,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;4BACjB,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,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,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;qCACpD;oCACD,IAAI,QAAQ,EAAE;wCACV,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;wCAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qCACjC;iCACJ;gCACD,IAAI,QAAQ,EAAE;oCACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;iCAC3C;6BLine truncated
+31
View File
@@ -0,0 +1,31 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.hederText={};this.hasHeader=!1}init(t){this.base=t;this.base.mouseDownHandlers.push(this.mouseDown.bind(this));this.util=n.Apps.Collaboration.Components.Common.Util.Instance()}mouseDown(n){var t,i;if(this.rdDailouge){let r=ej.base.closest(n.target,".e-checkbox-wrapper");if(r){let n=r.firstElementChild;n.classList.contains("e-check")?n.classList.remove("e-check"):n.classList.add("e-check");r.classList.contains("rd-selectAll")&&(t=this.rdDailouge.element.querySelector("#rd-checkboxes-container").querySelectorAll(".e-frame"),r.firstElementChild.classList.contains("e-check")?(r.firstElementChild.classList.remove("e-stop"),t.forEach(n=>{n.classList.add("e-check")}),document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled"),document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled")):(r.firstElementChild.classList.add("e-stop"),t.forEach(n=>{n.classList.remove("e-check")}),document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),document.getElementsByClassName("rd-btn")[0].setAttribute("disabled","true")));r.classList.contains("rd-colCheckbox")&&(t=this.rdDailouge.element.querySelector("#rd-checkboxes").querySelectorAll(".e-frame"),i=this.rdDailouge.element.querySelector("#rd-checkboxes").querySelectorAll(".e-check").length,i===0?(document.getElementsByClassName("rd-btn")[0].classList.add("e-disabled"),document.getElementsByClassName("rd-btn")[0].setAttribute("disabled","true")):(document.getElementsByClassName("rd-btn")[0].removeAttribute("disabled"),document.getElementsByClassName("rd-btn")[0].classList.remove("e-disabled")),i<t.length?(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-check"),document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-stop")):(document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.add("e-check"),document.getElementsByClassName("rd-selectAll")[0].firstElementChild.classList.remove("e-stop")))}}}removeDuplicate(t,i,r){var l,e,u,s,o,h,c;this.obj={};let f=this.base.ssObj.biz.getActiveSheet();this.rngIndexes=this.base.getIndexesFromAddress(t);this.hasHeader=i;this.rowStartCell=i?this.rngIndexes[0]+1:this.rngIndexes[0];this.columnStartCell=this.rngIndexes[1];this.rowEndCell=this.rngIndexes[2];this.columnEndCell=this.rngIndexes[3];this.selected=r;for(let n=this.rowStartCell;n<=this.rowEndCell;n++){let t=[];for(let i=this.columnStartCell;i<=this.columnEndCell;i++)if(this.selected[i]==undefined&&(l=document.querySelector("#rd-checkboxes").querySelector('div[value="'+i+'"]').firstElementChild.classList.contains("e-check"),this.selected[i]=l),this.selected[i]){let r=ej.spreadsheet.getCell(n,i,f);r?t.push(this.util.getCellValues(r)):t.push(null);r&&(this.base.ssObj.biz.setCell(n,i,f,{}),delete f.rows[n].cells[i])}t&&this.addToObj(JSON.stringify(t))}e=0;s=Object.keys(this.obj);for(let n=this.rowStartCell;n<=this.rowEndCell;n++){o=s[e]?JSON.parse(s[e]):undefined;h=0;for(let t=this.columnStartCell;t<=this.columnEndCell;t++)this.selected[t]&&(u=o?o[h]:undefined,u&&(u.value===undefined||this.base.ssObj.biz.setCell(n,t,f,u)),h++);e++}c=this.selectedRow-Object.keys(this.obj).length;n.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({action:"removeDuplicates"},this.base,!0);this.base.getSheetIndex()>=0&&(this.hasHeader?this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell+1)+this.rowStartCell+":"+this.base.generateHeaderText(this.columnEndCell+1)+(this.rowEndCell-c+2)):this.base.ssObj.selectRange(this.base.generateHeaderText(this.columnStartCell+1)+(this.rowStartCell+1)+":"+this.base.generateHeaderText(this.columnEndCell+1)+(this.rowEndCell-c+1)));this.rdDailouge.destroy()}RDshowUniqueDailog(){var n=Object.keys(this.obj),t,i,r;t=this.hasHeader?this.selectedRow-n.length-1:this.selectedRow-n.length;i=t==0?"No duplicate rows were found.":t==1?"1 duplicate row were found and removed.":`${t} duplicate rows were found and removed.`;r=n.length==1?`1 unique row remains.`:`${n.length} unique rows remains.`;this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>
<div id='rd-duplicatevaluetxt'></div>
<br/>
<div id='rd-uniquevaluetxt'></div>
</div>`,width:"470px",height:"180px",buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}]});this.rdDailouge.appendTo("#removeduplicates");document.getElementById("rd-duplicatevaluetxt").append(i);document.getElementById("rd-uniquevaluetxt").append(r)}addToObj(n){this.obj[n]||(this.obj[n]=1)}renderDuplicateDailouge(){var n,t,r,i,u,f,e;if(this.range=this.base.ssObj.biz.getRange(),this.rngIndexes=this.base.getIndexesFromAddress(this.range),this.selectedCol=this.rngIndexes[3]-this.rngIndexes[1]+1,this.selectedRow=this.rngIndexes[2]-this.rngIndexes[0]+1,this.rowStartCell=this.rngIndexes[0],this.columnStartCell=this.rngIndexes[1],this.rowEndCell=this.rngIndexes[2],this.columnEndCell=this.rngIndexes[3],this.rowStartCell-this.rowEndCell==0&&this.columnStartCell-this.columnEndCell==0)this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>Please select a range of cells containing values.</div>`,width:"470px",height:"130px",created:()=>{document.getElementById("removeduplicates_dialog-content").style.overflowY="hidden"},buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}]}),this.rdDailouge.appendTo("#removeduplicates");else{if(this.selectedCol>1&&this.selectedRow>1?n=`${this.selectedCol} columns and ${this.selectedRow} rows selected`:this.selectedCol>1&&this.selectedRow==1?n=`${this.selectedCol} columns and ${this.selectedRow} row selected`:this.selectedCol==1&&this.selectedRow>1&&(n=`${this.selectedCol} column and ${this.selectedRow} rows selected`),t=[],this.selectedCol>0)for(let n=this.columnStartCell;n<=this.columnEndCell;n++)r=this.base.generateHeaderText(n+1),i=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!0,label:"Columns "+r,cssClass:"rd-colCheckbox"}),i.setAttribute("value",n),t.push(i);u=document.getElementById("removedup-container");u?(document.getElementById("rd-selectedColumns-title-data").innerHTML="",document.getElementById("rd-selectedColumns-title-data").innerHTML=n,this.rdDailouge.show()):(f=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!1,cssClass:"rd-hasHeader"}),e=ej.buttons.createCheckBox(this.base.ssObj.createElement,!1,{checked:!0,label:"Select all",cssClass:"rd-selectAll"}),this.rdDailouge=new ej.popups.Dialog({isModal:!0,header:"Remove Duplicates",content:`<div id='removedup-container'>
<div id='rd-selectedColumns-container'>
<div id="rd-selectedColumns-title-data"></div>
<div id="rd-hasHeader-checkbox"></div>
<span id="rd-hasHeader-content">Data has header row</span>
</div>
<div id="rd-selectedColumns-info-wrapper">
<div id="rd-selectedColumns-info-analyze">Select Columns to analyze</div>
<div id="rd-checkboxes-container">
<div id="rd-selectAll"> </div>
<div id="rd-checkboxes"></div>
</div></div>
</div>`,showCloseIcon:!1,created:()=>{document.getElementById("rd-hasHeader-checkbox").appendChild(f),document.getElementById("rd-selectAll").appendChild(e),document.getElementById("rd-selectedColumns-title-data").append(n),t.forEach(n=>{document.getElementById("rd-checkboxes").appendChild(n)}),setTimeout(()=>{document.getElementById("rd-checkboxes-container").offsetHeight<250?document.getElementById("rd-checkboxes-container").style.overflowY="hidden":document.getElementById("rd-checkboxes").style.overflowY=""},0)},open:()=>{},width:"350px",height:"auto",closeOnEscape:!1,buttons:[{click:this.hideRdDailouge.bind(this),buttonModel:{content:"Cancel"}},{click:this.processDup.bind(this),buttonModel:{content:"Remove Duplicates",isPrimary:!0,cssClass:"rd-btn"}}]}),this.rdDailouge.appendTo("#removeduplicates"))}}hideRdDailouge(){this.rdDailouge.element.removeEventListener("mousedown",()=>{});this.rdDailouge.hide();this.rdDailouge.destroy()}processDup(){let t=!1;document.getElementsByClassName("rd-hasHeader")[0].firstElementChild.classList.contains("e-check")&&(t=!0);let r=this.base.ssObj.biz.getRange(),u=this.base.ssObj.biz.getIndexes(),i={range:r,indexes:u,sheetIndex:this.base.getSheetIndex(),header:t,action:"removeDuplicates",origin:"biz"};this.base.ssObj.updateUndoRedoCollection({name:"bizAction",args:{action:"removeDuplicates",options:i,oldCells:this.base.getCellsFromIndexes(u)}});this.removeDuplicate(r,t,{});this.base.removeCopyIndicator();i.colSelected=this.selected;this.RDshowUniqueDailog();n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(i)}renderMenubarFullscreenDialog(){this.menubarFullscreenDialogObj?this.menubarFullscreenDialogObj.show():(this.menubarFullscreenDialogObj=new ej.popups.Dialog({content:`<div id='menubar-fullscreen-container'>
<div id='menubar-fullscreenf11-message'>
Press <span class= "menubar-esc">Esc</span> to exit full screen <span class="biz-ss-menubarfullscreen-dismiss"> Dismiss </span></div>
</div>`,width:"470px",height:"45px",position:{X:"center",Y:14},animationSettings:{effect:"None"},closeOnEscape:!0,cssClass:"biz-ss-menubar-fullscreen",Close:this.hideSsMenubarFullscreenDialog.bind(this)}),this.menubarFullscreenDialogObj.appendTo("#biz-ss-menubar-fullscreendialog"))}hideSsMenubarFullscreenDialog(){this.menubarFullscreenDialogObj.destroy();document.getElementById("menubar-fullscreen-container")&&document.getElementById("menubar-fullscreen-container").parentElement.remove();setTimeout(()=>{this.menubarFullscreenDialogObj=null},1e3)}renderResizeDialog(){let i=this.base.ssObj.biz.getActiveSheet(),n=this.base.ssObj.biz.getIndexes(),f=this.base.ssObj.biz.isRowsSelected(n),e=n[2]-n[0]+1,o=n[3]-n[1]+1,r="",u="",t;f?(r=e==1?"Resize row "+(n[0]+1):"Resize rows "+(n[0]+1)+" - "+(n[2]+1),u="Specify row height in pixels: (Default 18)",t=i.rows[n[0]]&&i.rows[n[0]].height||18.5):(r=o==1?"Resize column "+this.base.generateHeaderText(n[0]+1):"Resize columns "+this.base.generateHeaderText(n[1]+1)+" - "+this.base.generateHeaderText(n[3]+1),u="Specify column width in pixels: (Default 64)",t=i.columns[n[1]]&&i.columns[n[1]].width||64);t==undefined&&(t="");this.radiobutton=new ej.buttons.RadioButton({label:u,name:"resizetofit",checked:!0,value:"resizeroworcol"});this.resizeDialogObj=new ej.popups.Dialog({content:`<div id='resize-dialog-container'>
<div id='resize-dialog-content'>
<ul>
<li><input type="radio" id="header-checkbox"></li>
<div class="e-input-group resize-input-div">
<input class="e-input" name='input' type="text" value="${t}" id="resize-input" />
</div>
<li><input type="radio" id="resizetofit-checkbox"></li>
</ul>
</div>
</div>`,width:"470px",height:"auto",header:r,animationSettings:{effect:"None"},showCloseIcon:!0,closeOnEscape:!0,target:document.body.querySelectorAll("._bizgaze_popup_container")[document.body.querySelectorAll("._bizgaze_popup_container").length-1],created:this.resizeDialogCreated.bind(this),cssClass:"biz-ss-resizetofit",buttons:[{click:this.hideResizeDialog.bind(this),buttonModel:{content:"Cancel"}},{click:this.processResize.bind(this),buttonModel:{content:"Ok",isPrimary:!0}}],Close:this.hideResizeDialog.bind(this)});this.resizeDialogObj.appendTo("#biz-ss-resizetofit-dialog")}resizeDialogCreated(){this.radiobutton.appendTo("#header-checkbox");this.radiobutton=new ej.buttons.RadioButton({label:"Resize to fit",name:"resizetofit",value:"resizetofit"});this.radiobutton.appendTo("#resizetofit-checkbox");document.getElementsByClassName("biz-ss-resizetofit")[0].style.maxHeight=""}hideResizeDialog(){this.resizeDialogObj&&(this.resizeDialogObj.destroy(),setTimeout(()=>{this.resizeDialogObj=null}))}processResize(){return __awaiter(this,void 0,void 0,function*(){let u=this.base.ssObj.biz.getRange(),n=[],t=[],f=Number(document.getElementById("resize-input").value),r=u.split(" ");for(var i=0;i<r.length;i++){let u=this.base.swapRange(ej.spreadsheet.getIndexesFromAddress(r[i]));yield this.resizeHeaders(u,f,r[i]).then(i=>{t=t.concat(i.changedValues),n=n.concat(i.resizedHeaders)})}this.hideResizeDialog();this.base.focusDocumentViewer();t.length>0&&this.base.download.ssAutoSave({action:"imageincell",changedValues:t},this.base,!0);n.length>0&&this.base.download.ssAutoSave({action:"headerResize",resizedHeaders:n},this.base,!0)})}resizeHeaders(n,t,i){return __awaiter(this,void 0,void 0,function*(){var r;let f=[],u=[],e=this.base.getSheetIndex(),o=this.base.ssObj.biz.isRowsSelected(n),s=document.querySelector('input[name="resizetofit"]:checked').value;if(s=="resizeroworcol")if(o){for(r=n[0];r<=n[2];r++)yield this.setRowHeight(t,r),f.push({rowIndex:r,height:t,sheetIndex:e,resizeType:"row"});u=u.concat(this.base.setRowIncellImageSize(i))}else{for(r=n[1];r<=n[3];r++)yield this.setColWidth(t,r),f.push({colIndex:r,width:t,sheetIndex:e,resizeType:"col"});u=u.concat(this.base.setColumnIncellImageSize(i))}else this.base.ssObj.autoFit(i),u=o?u.concat(this.base.setRowIncellImageSize(i)):u.concat(this.base.setColumnIncellImageSize(i));return{changedValues:u,resizedHeaders:f}})}setRowHeight(n,t){return __awaiter(this,void 0,void 0,function*(){yield this.base.ssObj.setRowHeight(n+"px",t)})}setColWidth(n,t){return __awaiter(this,void 0,void 0,function*(){yield this.base.ssObj.setColWidth(n+"px",t)})}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Dialogue=i})(i=t.Sheets||(t.Sheets={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
{"version":3,"file":"formatpainter.js","sourceRoot":"","sources":["formatpainter.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAmyEhB;AAnyED,WAAU,OAAO;IACb,IAAiB,IAAI,CAgyEpB;IAhyED,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA8xE7B;QA9xED,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CA4xE1B;YA5xED,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CA0xEtB;gBA1xED,WAAiB,MAAM;oBACnB,MAAa,aAAa;wBAA1B;4BAYW,cAAS,GAAW,EAAE,CAAC;4BAsBvB,WAAM,GAAY,KAAK,CAAC;4BAIxB,aAAQ,GAAY,KAAK,CAAC;4BAC1B,iBAAY,GAAY,KAAK,CAAC;4BAC9B,gBAAW,GAAY,KAAK,CAAC;4BAC7B,eAAU,GAAY,KAAK,CAAC;4BAE5B,SAAI,GAAW,CAAC,CAAC,CAAC;4BAClB,WAAM,GAAY,KAAK,CAAC;4BAExB,eAAU,GAAY,KAAK,CAAC;4BAC5B,kBAAa,GAAY,KAAK,CAAC;4BAE/B,eAAU,GAAY,KAAK,CAAC;wBAsuEvC,CAAC;wBAvtEG,IAAI,CAAC,IAAS;4BACV,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;4BACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;4BACxB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC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,qBAAqB,CALine truncated
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.hederText={};this.isDrag=!1;this.isScroll=!1;this.isLeftScroll=!1;this.isTopScroll=!1;this.isVertical=!1;this.side=-1;this.isEdit=!1;this.isCellDrag=!1;this.isCellDragged=!1;this.isCellEdit=!1}init(t){this.base=t;this.ssObj=t.ssObj;this.util=n.Apps.Collaboration.Components.Common.Util.Instance();this.initProp()}initProp(){this.selectFn=this.selected.bind(this);this.ssObj.addEventListener("select",this.selectFn);this.createdFn=this.created.bind(this);this.ssObj.addEventListener("created",this.createdFn);this.initialLoadFn=this.initialLoad.bind(this);this.ssObj.on("initialLoad",this.initialLoadFn);this.ssObj.on("activeSheetChanged",this.activeSheetChanged,this);this.ssObj.on("mouseDown",this.mouseDown,this)}destroy(){this.ssObj.removeEventListener("select",this.selectFn);this.ssObj.removeEventListener("created",this.createdFn);this.ssObj.off("initialLoad",this.initialLoadFn);this.ssObj.off("activeSheetChanged",this.activeSheetChanged);this.ssObj.off("mouseDown",this.mouseDown);ej.base.EventHandler.remove(this.ssObj.element,"mousemove",this.mouseMoveHandler);ej.base.EventHandler.remove(this.ssObj.element,"mouseup",this.mouseUp)}activeSheetChanged(){this.isClicked&&(this.hideFPBdr(),setTimeout(()=>{this.activesheet===this.ssObj.biz.getActiveSheet()&&this.updateFPBdr()},650),setTimeout(()=>{this.ssObj.element.querySelector("#"+this.ssObj.element.id+"_formatpainter").classList.add("biz-fp-color")},50))}createFPBdr(){if(!this.ssObj.element.getElementsByClassName("biz-fp")[0]){this.element=document.createElement("div");this.element.classList.add("biz-fp");this.element.appendChild(ej.base.createElement("div",{className:"e-top"}));this.element.appendChild(ej.base.createElement("div",{className:"e-bottom"}));this.element.appendChild(ej.base.createElement("div",{className:"e-left"}));this.element.appendChild(ej.base.createElement("div",{className:"e-right"}));let n=this.ssObj.element.getElementsByClassName("e-sheet-content")[0];n.appendChild(this.element)}this.element.classList.remove("biz-hide")}updateFPBdr(){if(this.isClicked){this.createFPBdr();let t=this.ssObj.element.getElementsByClassName("e-selection")[0],r=this.ssObj.element.getElementsByClassName("e-active-cell")[0],n=t.classList.contains("e-hide")?r:t,i=n.getBoundingClientRect();this.element.style.top=n.style.top;this.element.style.left=n.style.left;this.element.style.width=i.width+"px";this.element.style.height=i.height+"px"}}hideFPBdr(){let n=this.ssObj.element.getElementsByClassName("biz-fp")[0];n&&n.classList.add("biz-hide")}mouseDown(n){let t=ej.base.closest(n.target,".biz-icon-painter");if(t&&(this.isClicked=!0,this.ssObj.element.querySelector("#"+this.ssObj.element.id+"_formatpainter").classList.add("biz-fp-color"),this.updateFPBdr()),this.splitDlgObj&&!this.splitDlgObj.isDestroyed){let t=ej.base.closest(n.target,".e-checkbox-wrapper");if(t){let i=!0,n=t.firstElementChild;n.classList.contains("e-check")?n.classList.remove("e-check"):n.classList.add("e-check");t.classList.contains("biz-st-other")&&(this.inputObj.enabled=n.classList.contains("e-check"),this.inputObj.value&&this.inputObj.value.length&&(i=!1));i&&this.refreshST()}}this.mdown(n);this.mdown2(n)}initialLoad(){let n=this.ssObj.ribbonModule.getRibbonItems.bind(this.ssObj.ribbonModule);this.ssObj.ribbonModule.getRibbonItems=()=>{let i=n(),r=i[0].content,t={id:this.ssObj.element.id+"_formatpainter",prefixIcon:"biz-icon-painter",tooltipText:"Format Painter"};return r.splice(6,0,t),t={template:this.getRotationElem(),id:this.ssObj.element.id+"_text_rotation",tooltipText:"Text rotation"},r.splice(27,0,t),i}}isSingleCellSel(n){return n[0]===n[2]&&n[1]===n[3]?!0:!1}applyFormatPaint(n,t,i){let o=this.ssObj.sheets[i];this.formatIndexes=this.base.getIndexesFromAddress(t);this.rangeIndexes=this.base.getIndexesFromAddress(n);let u=-1,r=-1,f=this.ssObj.biz.getActiveSheet(),e=[];for(let n=this.rangeIndexes[0];n<=this.rangeIndexes[2];n++){let t=[];for(let i=this.rangeIndexes[1];i<=this.rangeIndexes[3];i++){let r=ej.base.extend({},ej.spreadsheet.getCell(n,i,f));t.push(r)}e.push(t)}if(this.isSingleCellSel(this.formatIndexes)){u=this.formatIndexes[0]-1;r=this.formatIndexes[1]-1;for(let n=this.rangeIndexes[0];n<=this.rangeIndexes[2];n++){u++;r=this.formatIndexes[1]-1;let n=e.shift();for(let t=this.rangeIndexes[1];t<=this.rangeIndexes[3];t++){r++;let i=n.shift(),t=ej.spreadsheet.getCell(u,r,f)||{};this.copyValues(i,t,["style","format","hyperlink","wrap"]);this.ssObj.biz.setCell(u,r,f,t)}}this.ssObj.selectRange(this.base.generateHeaderText(this.formatIndexes[1]+1)+(this.formatIndexes[0]+1)+":"+this.base.generateHeaderText(r+1)+(u+1))}else{let n=0,t=0;for(let i=this.formatIndexes[0];i<=this.formatIndexes[2];i++){n===e.length&&(n=0);t=0;for(let r=this.formatIndexes[1];r<=this.formatIndexes[3];r++){t===e[n].length&&(t=0);let o=e[n][t],u=ej.spreadsheet.getCell(i,r,f)||{};this.copyValues(o,u,["Line truncated
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
{"version":3,"file":"ribbon.js","sourceRoot":"","sources":["ribbon.ts"],"names":[],"mappings":"AAEA,IAAU,OAAO,CAsuEhB;AAtuED,WAAU,OAAO;IACb,IAAiB,IAAI,CAmuEpB;IAnuED,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAiuE7B;QAjuED,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CA+tE1B;YA/tED,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CA6tEtB;gBA7tED,WAAiB,MAAM;oBACnB,MAAa,MAAM;wBAAnB;4BASI,cAAS,GAAG,EAAE,CAAC;4BA6Bf,gBAAW,GAAY,KAAK,CAAC;wBAorEjC,CAAC;wBA5qEU,IAAI,CAAC,MAAM;4BAEd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;4BACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,SA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C,MAAM,CAAC;oCACzD,OAAO,EAAE,KAAK;oCACd,OAAO,EAAE;;;;;;;;;sDASS;oCAClB,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC;oCAC5C,KAAK,EAAE,OAAO;oCACd,MAAM,EAAE,MAAM;oCACd,iBAAiB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;oCACrC,QAAQ,EAAE,+BAA+B;oCACzC,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;iCAC9B,CAAC,CAAC;gCACH,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;6BACpDLine truncated
+75
View File
@@ -0,0 +1,75 @@
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.hederText={};this.imageInCell=!1}init(t){this.result=t;this.FileName=this.result.FileTitle;this.FileId=this.result.FileId;this.documentGroup=this.result.DocumentGroup;this.documentId=this.result.DocumentId;this.filepath=this.result.TempFilePath;this.fileDownload=n.Apps.Collaboration.Components.Common.Download.Instance();this.base=n.Apps.Collaboration.Components.Sheets.Base.Instance();this.dialogue=n.Apps.Collaboration.Components.Sheets.Dialogue.Instance();this.spreadsheetMenuBar(this.FileId,this.documentGroup,this.FileName);this.dialogue.init(this.base)}addListeners(){}destroy(){}removeListeners(){}renderOpenNewDialogue(){var n,t;this.importOpenSelectButton=new ej.buttons.Button({cssClass:`e-flat`});this.importOpenCancelButton=new ej.buttons.Button({cssClass:`e-flat`});n=document.getElementById("importopenfile");n==null?(this.ssImportOpenDialougObj=new ej.popups.Dialog({isModal:!0,header:"Open File",content:`<div id='tabobjforopen'></div>`,target:document.getElementById("container"),width:"470px",height:"330px",animationSettings:{effect:"Zoom"},cssClass:"biz-ss-importopen-dialog"}),this.ssImportOpenDialougObj.appendTo("#dialog"),t=new ej.navigations.Tab({items:[{header:{text:"Upload"},content:`<div id="importopenfile-wrapper">
<h2 style="color: #ccc">Drag a file...</h2>
<label id='importopenfilelable'>
select file from device
<br>
<input type="file" name="" id="importopenfile" accept=".xlsx, .xls, .csv" placeholder="select a file from your device" >
</label>
<div id="filename"></div>
</div>
</div>
<button id='importopenfile-select-btn' class='e-disabled'>select</button>
<button id='importopenfile-cancel-btn'>cancel</button>`},{header:{text:"Drive"},content:""},{header:{text:"Recent"},content:""}]}),t.appendTo("#tabobjforopen")):this.ssImportOpenDialougObj.show();this.importOpenDialogcreated()}renderImportDialogue(n){var t,i;this.importSelectButton=new ej.buttons.Button({cssClass:`e-flat`});this.importCancelButton=new ej.buttons.Button({cssClass:`e-flat`});t=document.getElementById("tabobj");let r=window.innerHeight-200,u=window.innerWidth-600;t==null?(this.ssImportDialougObj=new ej.popups.Dialog({isModal:!0,header:"Import File",content:`<div id='tabobj'></div>`,target:document.getElementById("container"),width:u+"px",height:r+"px",animationSettings:{effect:"Zoom"},cssClass:"biz-ss-import-dialog"}),this.ssImportDialougObj.appendTo("#dialog"),i=new ej.navigations.Tab({selected:this.tabSelected.bind(this),items:[{header:{text:"Upload"},content:`<div id="importfile-wrapper">
<h2 style="color: #ccc">Drag a file...</h2>
<label id='importfilelable'>
select file from device
<br>
<input type="file" name="" id="importfile" accept=".xlsx, .xls, .csv" placeholder="select a file from your device" >
</label>
<div id="filename"></div>
</div>
</div>
<button id='importfile-upload-select-btn' class='e-disabled'>select</button>
<button id='importfile-upload-cancel-btn'>cancel</button>`},{header:{text:"Drive"},content:n},{header:{text:"Recent"},content:""}]}),i.appendTo("#tabobj")):this.ssImportDialougObj.show();this.importDialogcreated()}renderCloudSavedDialogue(){var n=document.getElementById("biz-ss-cloudsave-container");n==null?(this.ssCloudSavedDialougObj=new ej.popups.Dialog({isModal:!1,content:`<div id="biz-ss-cloudsave-container" style="max-width: 420px;min-width: 320px;padding: 10px;border-radius: 10px;display: block;border: 1px solid;" >
<div id="biz-ss-cloudsave-container-title" style = "font-size: 15px;border-color: green;color: green;background-color: #e6f4ea;min-height: 40px;padding: 10px;" >
<img class="biz-ss-cloudsave-container-img" src="imgs/cloud-computing.svg" >
All changes saved to Drive
</div>
<div id="biz-ss-cloudsave-container-body" style = "padding: 10px;font-size: 10px;">
Every change you make is automatically saved to Drive.
</div>
</div>`,target:document.getElementById("container"),width:"340px",height:"95px",animationSettings:{effect:"Zoom"},cssClass:"biz-ss-cloudsave-container",position:{X:260,Y:34}}),this.ssCloudSavedDialougObj.appendTo("#dialog")):this.ssCloudSavedDialougObj.show();document.getElementById("dialog_dialog-content").style.padding="0px";document.getElementById("dialog_dialog-content").style.borderRadius="10px"}renderCloudSavingDialogue(){var n=document.getElementById("biz-ss-cloudloading-container");n==null?(this.ssCloudSavingDialougObj=new ej.popups.Dialog({isModal:!1,content:`<div id="biz-ss-cloudloading-container" style="max-width: 420px;min-width: 320px;padding: 10px;border-radius: 10px;display: block;border: 1px solid;" >
<div id="biz-ss-cloudloading-container-title" style = "font-size: 15px;border-color: green;color: green;background-color: #e6f4ea;min-height: 40px;padding: 10px;" >
<div class="biz-ss-cloudloading-container-img e-icons">
</div>
Saving...
</div>
<div id="biz-ss-cloudloading-container-body" style = "padding: 10px;font-size: 10px;">
Every change you make is automatically saved to Drive.
</div>
</div>`,target:document.getElementById("container"),width:"340px",height:"95px",animationSettings:{effect:"Zoom"},cssClass:"biz-ss-cloudloading-container",position:{X:260,Y:34}}),this.ssCloudSavingDialougObj.appendTo("#dialog")):this.ssCloudSavingDialougObj.show();document.getElementById("dialog_dialog-content").style.padding="0px";document.getElementById("dialog_dialog-content").style.borderRadius="10px"}tabSelected(n){if(n.selectedItem.firstElementChild.firstElementChild.textContent=="Drive"){this.importSelectButton.appendTo("#importfile-drive-select-btn");this.importCancelButton.appendTo("#importfile-drive-cancel-btn");let n=document.getElementsByClassName("biz-ss-import-dialog")[0].offsetHeight;document.getElementsByClassName("biz_drive_list")[0].style.height=n-165+"px"}}openSpreadSheetDocument(){n.Apps.Collaboration.DocumentManager.Instance().importCreateSpreadSheet(this.spreadsheetImportedFileData).then(n=>{var t=n.result;this.ssImportOpenDialougObj.hide()})}importSpreadSheetDocument(){n.Apps.Collaboration.DocumentManager.Instance().importCreateSpreadSheet(this.spreadsheetImportedFileData).then(n=>{var t=n.result,i=this._url+t+"/Excel/0";document.getElementById("sucessfullmessage").style.display="inline-block";document.getElementById("importcreatenewdocument").setAttribute("href",i)})}importReplaceSpreadSheet(){n.Apps.Collaboration.DocumentManager.Instance().importReplaceSpreadSheet(this.spreadsheetImportedReplaceFileData).then(n=>{this.base.ssObj.destroy();this.base.filedata=JSON.parse(n.result[0]);this.base.customresult=JSON.parse(n.result[1]);this.base.unwireEvents();this.base.unwireBootStrapKeyEvent();this.base.ssRender();this.ssImprotedFileDailogueObj.hide();this.importedFile.value=null;this.base.bizSignalr({action:"importReplace",origin:"biz"})})}insertSheet(){n.Apps.Collaboration.DocumentManager.Instance().insertNewSpreadsheet(this.spreadsheetImportedFileData).then(n=>{let i=n.result[0],t=JSON.parse(i).Workbook.sheets;this.base.ssObj.saveAsJson().then(n=>{let r=n.jsonObject,i=r.Workbook.sheets,u=[];for(let n=0;n<i.length;n++)u.push(i[n].name);for(let n=0;n<t.length;n++){let i=t[n].name;t[n].name=this.generateSheetName(u,i)}i=i.concat(t);r.Workbook.sheets=i;this.base.removeSheetIndexProp(r.Workbook);this.base.ssObj.openFromJson({file:r})});this.ssImprotedFileDailogueObj.hide()})}documentCopy(){var n={FileId:this.FileId,FileName:this.FileName};this.copyDocumentDataDailog(n)}copyDocumentDataDailog(t){var r=new ej.buttons.Button({cssClass:`e-flat`,content:"OK"}),u=new ej.buttons.Button({cssClass:`e-flat`,content:"Cancel"}),i;let f=new ej.inputs.TextBox({placeholder:"Enter Document Name",floatLabelType:"Auto"});this._url=window.location.origin+"/#/documents/";i=document.getElementById("copyobj");i==null?(this.copyDocumentDailogue=new ej.popups.Dialog({isModal:!0,header:"Copy Document",content:`<div id='copyobj'><div id='copy-document-container'>
<div id='copy-document-div'>
<div class='row'>
<div class='col-md-12'>
<input id='copydocument-textbox' type='text' value='Copy Of `+t.FileName+`'/>
</div></div>
<div id='sucessfullmessagecopy' style="display:none">File imported successfully. <a id="spreadsheetopennowcopy" target="_blank">Open now »</a></div>
</div></div>
<br><br>
<br>
<button id="copy-document-ok-btn" class="pull-right"></button>
<button id="copy-document-close-btn" class="pull-right"></button>
</div>`,target:document.getElementById("container"),placeholder:"Please Enter File Name",popupHeight:"100px",width:"350px",height:"250px",animationSettings:{effect:"Zoom"}}),this.copyDocumentDailogue.appendTo("#copydocument-container"),r.appendTo("#copy-document-ok-btn"),u.appendTo("#copy-document-close-btn"),f.appendTo("#copydocument-textbox"),this.copyDocumentDailogue.show(),document.getElementById("copy-document-ok-btn").addEventListener("click",()=>{var t=this.FileId,i=$("#copydocument-textbox").val(),r={FileId:t,FileTitle:i};n.Apps.Collaboration.FileManager.Instance().copyFile(r).then(n=>{var t=n.result;this.copyDocumentDailogue.destroy()})}),document.getElementById("copy-document-close-btn").addEventListener("click",()=>{this.copyDocumentDailogue.hide()})):this.copyDocumentDailogue.show()}spreadSheetTrim(){let t=this.base.ssObj.biz.getIndexes();this.base.ssObj.updateUndoRedoCollection({name:"bizAction",args:{action:"trim",range:t,oldCells:this.base.getCellsFromIndexes(t)}});let i=this.processTrim(t);this.setSpreadsheettrimDialouge(i);let r={range:t,action:"trim",origin:"biz",sheetIndex:this.base.getSheetIndex()};n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(r)}processTrim(n){for(var f,i,t,r=this.base.ssObj.biz.getActiveSheet(),o=n[0],s=n[1],h=n[2],c=n[3],e=0,u=o;u<=h;u++)if(r.rows[u])for(f=s;f<=c;f++)if(i={rowindex:u,cellindex:f},t=ej.spreadsheet.getCell(i.rowindex,i.cellindex,r),t&&t.value!=null)if(t.value.indexOf(" ")>=0)t.value=t.value.replace(/\s+/g," "),t.value=t.value.trim(),this.base.ssObj.biz.setCell(i.rowindex,i.cellindex,r,t),e++;else if(t.value.indexOf(" ")==0)t.value=t.value.trim(),this.base.ssObj.biz.setCell(i.rowindex,i.cellindex,r,t),e++;else continue;else continue;return e}setSpreadsheettrimDialouge(t){var i=0,r,u;i!=t&&(i=t);r="";i>1?r=`Trimmed whitespace from the `+i+` selected cells.`:i==1?r=`Trimmed whitespace from the `+i+` selected cell.`:i==0&&(r=`No selected cells had whitespace trimmed.`);u=document.getElementById("trimobj");u==null?(this.spreadhsheetTrimDialog=new ej.popups.Dialog({isModal:!0,content:`<div id='trimobj'><div id="trimdialoguebox1"><p id="trimpara">`+r+`</p>
<button id='spreadsheettrimedok' class='btn btn-secondary btn-sm pull-right'>Ok</button></div>`,target:document.getElementById("container"),width:"500px",height:"100px",animationSettings:{effect:"Zoom"}}),this.spreadhsheetTrimDialog.appendTo("#spreadsheettrim-container"),document.getElementById("spreadsheettrimedok").addEventListener("click",()=>{this.spreadhsheetTrimDialog.hide()})):(document.getElementById("trimpara").innerHTML="",document.getElementById("trimpara").innerHTML=r,this.spreadhsheetTrimDialog.show());i!=0&&n.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({action:"trim",eventArgs:{}},this.base,!0)}generateSheetName(n,t){if(n.indexOf(t)<0)return t;let i=1;while(n.indexOf(t+" ("+i+")")>-1)i++;return t+" ("+i+")"}importOpenDialogcreated(){document.getElementById("importopenfile-select-btn").setAttribute("disabled","true");document.getElementById("importopenfile-select-btn").addEventListener("click",()=>{this.openSpreadSheetDocument(),this.ssImportOpenDialougObj.destroy()});document.getElementById("importopenfile-cancel-btn").addEventListener("click",()=>{this.ssImportOpenDialougObj.hide(),document.getElementById("importopenfile-select-btn").classList.add("e-disabled"),document.getElementById("filename").innerHTML="",this.importedFile&&(this.importedFile.value=null),this.ssImportOpenDialougObj&&(this.ssImportOpenDialougObj.destroy(),this.ssImportOpenDialougObj=null)});this.importOpenSelectButton.appendTo("#importopenfile-select-btn");this.importOpenCancelButton.appendTo("#importopenfile-cancel-btn");document.body.addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-ss-importopen-dialog")[0].addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-ss-importopen-dialog")[0].addEventListener("drop",n=>{n.preventDefault();document.getElementById("importopenfile").files=n.dataTransfer.files;var t={target:{files:n.dataTransfer.files}};this.openFileSelected(t)});document.getElementById("importopenfile").addEventListener("change",n=>{this.openFileSelected(n)})}importDialogcreated(){document.getElementById("importfile-upload-select-btn").setAttribute("disabled","true");let n=document.getElementById("importfile-wrapper");n.style.height=window.innerHeight-375+"px";n.style.width=window.innerWidth-635+"px";document.getElementById("importfile-upload-select-btn").addEventListener("click",()=>{this.ssImportDialougObj.hide(),this.ssimportedFileDataDailog(),document.getElementById("filename").innerHTML="",document.getElementById("importedfilename").innerHTML=this.importedFile.files[0].name});document.getElementById("importfile-upload-cancel-btn").addEventListener("click",()=>{this.ssImportDialougObj.hide(),document.getElementById("importfile-upload-select-btn").classList.add("e-disabled"),document.getElementById("filename").innerHTML="",this.importedFile&&this.importedFile.value&&(this.importedFile.value=null),this.ssImportDialougObj&&(this.ssImportDialougObj.destroy(),this.ssImportDialougObj=null)});this.importSelectButton.appendTo("#importfile-upload-select-btn");this.importCancelButton.appendTo("#importfile-upload-cancel-btn");document.body.addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-ss-import-dialog")[0].addEventListener("dragover",n=>{n.preventDefault()});document.getElementsByClassName("biz-ss-import-dialog")[0].addEventListener("drop",n=>{n.preventDefault();document.getElementById("importfile").files=n.dataTransfer.files;var t={target:{files:n.dataTransfer.files}};this.fileSelected(t)});document.getElementById("importfile").addEventListener("change",n=>{this.fileSelected(n)});document.getElementsByClassName("biz-ss-import-dialog")[0].style.maxHeight=""}getAll(t){let i=``;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",()=>{n.Apps.Collaboration.FileManager.Instance().getAll(t).then(t=>{let r=t.result.Folders,u=``;for(let n=0;n<r.length;n++){var o=r[n].FolderName;r[n].FolderName=r[n].Title;r[n].FolderName==null&&(r[n].FolderName=o);u+=`<li class="list-group-item copyto_list copyto_folder" id="li_folder_`+r[n].FolderId+`" style="border: none;cursor:pointer;font-size:14px;"><a onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().getFolderItems(`+r[n].FolderId+`,'`+r[n].FolderName+`',`+!0+`)"><i class="fa fa-folder mr-15 text-light"></i> `+r[n].FolderName+`<i class="fa fa-angle-right pull-right"></i></a></li>`}let f=``,e=t.result.Files;for(let n=0;n<e.length;n++)f+=`<li class="list-group-item copyto_list copyto_file " id="li_file_`+e[n].FileId+`" style="border: none;cursor:pointer;font-size:14px;" onselect="this.style.background='#e5e5e5'"> <a onclick=""><div class="d-flex flex-row " > <img src="/tenants/default/documenttypes/sheet.svg" data-dynamic="1" data-loaded="0" alt = "filetype" onerror = "ReloadImage(event)" class="w-25p h-25p img-fluid mr-10" > <span class="teLine truncated
<ul class="list-group" id="biz_drive_foldersList">`+u+` </ul>
<ul class="list-group" id="biz_drive_filesList">`+f+`</ul>
<div id="div_createfolder" class="hidden row"><i class="fa fa-arrow-left col-sm-1 mt-10" id="back_create"
onclick=" Unibase.Apps.Collaboration.Components.UniCloud.Instance().getAll(`+n.Apps.Collaboration.Components.UniCloud.Instance().selectedfolderid+`)"></i>
<input type="text" class="form-control col-sm-11" placeholder="Folder Name" id="createfolder"></div></div>
<div class="pull-down">
<button id='importfile-drive-select-btn' class='e-disabled'>select</button>
<button id='importfile-drive-cancel-btn'>cancel</button></div>`,this.renderImportDialogue(i))})})}getFolderList(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",()=>{n.Apps.Collaboration.FileManager.Instance().getFolders().then(n=>{let t=n.result;var i=``;for(let n=0;n<=t.length;n++)i+=`<li class="list-group-item" id="li_folder_`+t[n].FolderId+`"><a onclick="Unibase.Apps.Collaboration.Components.old_unicloud.Instance().getFolderItems(`+t[n].FolderId+`,'`+t[n].FolderName+`')"><input class="hidden" id="hdn_folder_`+t[n].FolderId+`" value="`+t[n].FolderId+`"><i class="fa fa-folder mr-15 text-light"></i>`+t[n].FolderName+`<i class="fa fa-angle-right pull-right"></i></a></li>`;return i})})}getFilesList(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().getFiles(0).then(n=>{var e=n.result.Parentid,i=n.result.Folders,r,u,t,f;r=`<a href="javascript:void(0);" onclick="Unibase.Apps.Collaboration.Components.old_unicloud.Instance().getAll(`+e+",true"+`)"> `+ +` ></a>`;$("#folder_breadcrumb").append(r);for(let n=0;n<i.length;n++)u=`<li class="list-group-item" id="li_childfolder_`+i[n].FolderId+`" style="border: none;cursor:pointer;font-size:14px;" onmouseover="this.style.background='#e5e5e5'" onmouseout="this.style.background='#FFF'"><a onclick=""><input class="hidden" id="hdn_childfolderid_`+i[n].FolderId+`" value="`+i[n].FolderId+`"><i class="fa fa-folder mr-15 text-light"></i> `+i[n].FolderName+`</a></li>`,$("#li_hdn_childfolders:last").after(u);t=n.result.Files;$("#ul_filesList").html(`<li class="list-group-item hidden" id="li_hdn_file"></li><li class="list-group-item hidden" id="li_hdn_childfolders"></li> `);for(let n=0;n<t.length;n++)f=`<li class="list-group-item disabled" id="li_file_`+t[n].FileId+`" style="border: none;cursor:pointer;font-size:14px;"><a onclick=""><input class="hidden" id="hdn_file_`+t[n].FileId+`" value="`+t[n].FileId+`"><input class="hidden" id="hdn_file_folderid_`+t[n].FolderId+`" value="`+t[n].FolderId+`"><div class="d-flex flex-row " > <img src="/tenants/default/documenttypes/sheet.svg" data-dynamic="1" data-loaded="0" alt = "filetype" onerror = "ReloadImage(event)" class="w-25p h-25p img-fluid mr-10" > <span class="text-truncate" > `+t[n].FileName+` </span> </div ></a></li>`,$("#li_hdn_file:last").after(f)});$("#ul_filesList").removeClass("hidden")})}getFolderItems(t,i){let r=i;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",()=>{n.Apps.Collaboration.FileManager.Instance().getFiles(t).then(n=>{let e=n.result.Parentid,o=`<ul id="breadcrumb-ul"><li id="breadcrumb-li"><a href="javascript:void(0);" onclick="Unibase.Apps.Collaboration.Components.Sheets.Ribbon.Instance().getAll(`+e+`)"> `+r+` ></a></li></ul>`;$(".biz_drive_list").empty();let t=n.result.Folders,u=``;for(let n=0;n<t.length;n++){var s=t[n].FolderName;t[n].FolderName=t[n].Title;t[n].FolderName||(t[n].FolderName=s);u+=`<li class="list-group-item copyto_list copyto_folder" id="li_folder_`+t[n].FolderId+`" style="border: none;cursor:pointer;font-size:14px;"><a onclick="Unibase.Apps.Collaboration.Components.old_unicloud.Instance().getFolderItems(`+t[n].FolderId+`,'`+t[n].FolderName+`',`+!0+`)"><i class="fa fa-folder mr-15 text-light"></i> `+t[n].FolderName+`<i class="fa fa-angle-right pull-right"></i></a></li>`}let f=``,i=n.result.Files;for(let n=0;n<i.length;n++)f+=`<li class="list-group-item copyto_list copyto_file " id="li_file_`+i[n].FileId+`" style="border: none;cursor:pointer;font-size:14px;" onselect="this.style.background='#e5e5e5'"> <a onclick=""><div class="d-flex flex-row " > <img src="/tenants/default/documenttypes/sheet.svg" data-dynamic="1" data-loaded="0" alt = "filetype" onerror = "ReloadImage(event)" class="w-25p h-25p img-fluid mr-10" > <span class="text-truncate" > `+i[n].FileTitle+` </span> </div ></a></li>`;let h=o+`<ul class="list-group" id="biz_drive_foldersList">`+u+` </ul>
<ul class="list-group" id="biz_drive_filesList">`+f+`</ul>`;$(".biz_drive_list").append(h)})})}openFileSelected(t){document.getElementById("importopenfile-select-btn").removeAttribute("disabled");document.getElementById("importopenfile-select-btn").classList.remove("e-disabled");this.importedFile=document.getElementById("importopenfile");document.getElementById("filename").innerHTML=this.importedFile.files[0].name;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/file/filehelper.js",()=>{n.Platform.Helpers.FileHelper.Instance().getBase64(t).then(t=>{var r,i,u;n.Themes.Providers.Detail_Settings.Instance().InputParameters.length!=0&&(r=n.Themes.Providers.DetailHelper.installedAppId,i=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_recordid").Value),i!=0&&i!=null&&i!=undefined);u={filedata:t.FileData,filename:t.FileName,filetype:t.FileType,RefId:i,FileId:this.FileId,Upload:!0};this.spreadsheetImportedFileData=u})})}fileSelected(t){document.getElementById("importfile-upload-select-btn").removeAttribute("disabled");document.getElementById("importfile-upload-select-btn").classList.remove("e-disabled");this.importedFile=document.getElementById("importfile");document.getElementById("filename").innerHTML=this.importedFile.files[0].name;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/core/helpers/file/filehelper.js",()=>{n.Platform.Helpers.FileHelper.Instance().getBase64(t).then(t=>{var r,i,u,f;n.Themes.Providers.Detail_Settings.Instance().InputParameters.length!=0&&(r=n.Themes.Providers.DetailHelper.installedAppId,i=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+r+"_recordid").Value),i!=0&&i!=null&&i!=undefined);u={filedata:t.FileData,filename:t.FileName,filetype:t.FileType,RefId:i,FileId:this.FileId,Upload:!0};this.spreadsheetImportedFileData=u;f={filedata:t.FileData,filename:t.FileName,filetype:t.FileType,RefId:i,FileId:this.FileId,FilePath:this.filepath,Upload:!0};this.spreadsheetImportedReplaceFileData=f})})}spreadsheetMenuBar(t,i,r){var f;let u;(function(n){n[n.Xlsx=0]="Xlsx";n[n.Xls=1]="Xls";n[n.CSV=2]="CSV";n[n.PDF=3]="PDF";n[n.ODS=4]="ODS"})(u||(u={}));this.ssMenubarObj||(f=["File","Edit","View","Insert","Format","Formulas","Data","Tools"],this.ssMenubarObj=new ej.navigations.Menu({cssClass:"biz-ss-menu",beforeClose:n=>{f.indexOf(n.parentItem.text)>-1&&(this.ssMenubarObj.showItemOnClick=!0);let t=this.base.ssObj.sheets.filter(n=>n.state=="Hidden");if(t.length>0&&n.parentItem.text==="View"){let n=[];t.forEach(t=>n.push(t.name));this.ssMenubarObj.insertBefore([{text:"dummyHiddenSheet"}],n[0],!1);this.ssMenubarObj.removeItems(n,!1)}},showItemOnClick:!0,beforeItemRender:n=>{var u,i,t,f;let r=this.base.ssObj.biz.getActiveSheet();if((r.frozenColumns!=0||r.frozenRows!=0)&&n.item.text=="Freeze panes"&&(n.element.innerHTML="Unfreeze panes"),r.showHeaders||n.item.text=="Hide headers"&&(u=n.element.firstElementChild,n.element.innerHTML=u.outerHTML+"Show Headers"),r.showGridLines||n.item.text=="Hide gridlines"&&(u=n.element.firstElementChild,n.element.innerHTML=u.outerHTML+"Show Gridlines"),n.item.text=="Formula bar"){let t=document.getElementsByClassName("e-formula-bar-panel")[0];t.style.display==""&&this.addOrRemoveSelectIcon(n)}if(i=this.base.getIndexesFromAddress(r.activeCell),t=ej.spreadsheet.getCell(i[0],i[1],r),t){n.item.text==="Bold"&&t.style&&t.style.fontWeight&&t.style.fontWeight.toLowerCase()=="bold"&&this.addOrRemoveSelectIcon(n);n.item.text==="Italic"&&t.style&&t.style.fontStyle&&t.style.fontStyle.toLowerCase()=="italic"&&this.addOrRemoveSelectIcon(n);n.item.text==="Underline"&&t.style&&t.style.textDecoration&&(t.style.textDecoration.toLowerCase()=="underline line-through"||t.style.textDecoration.toLowerCase()=="underline")&&this.addOrRemoveSelectIcon(n);n.item.text==="Strikethrough"&&t.style&&t.style.textDecoration&&(t.style.textDecoration.toLowerCase()=="underline line-through"||t.style.textDecoration.toLowerCase()=="line-through")&&this.addOrRemoveSelectIcon(n);n.item.text==="Font size"&&this.addOrRemoveSelectIcon(n);n.item.text==="Wrap text"&&t.wrap&&t.wrap==!0&&this.addOrRemoveSelectIcon(n);n.item.text==="Number formatting"&&this.addOrRemoveSelectIcon(n);n.item.text==="Align"&&this.addOrRemoveSelectIcon(n);n.item.text==="Merge cells"&&(t.rowSpan||t.colSpan)&&this.addOrRemoveSelectIcon(n);n.item.text==="Merge all"&&t.rowSpan&&t.colSpan&&this.addOrRemoveSelectIcon(n);n.item.text==="Merge vertically"&&t.rowSpan&&this.addOrRemoveSelectIcon(n);n.item.text==="Merge horizontally"&&t.colSpan&&this.addOrRemoveSelectIcon(n);n.item.text==="General"&&(t.format||this.addOrRemoveSelectIcon(n));f=["General","Number","Currency","Accounting","Short date","Long date","Time","Percentage","Fraction","Scientific","Text"];f.includes(n.item.text)&&t.format&&(n.item.text==="General"?t.format.toLowerCase()=="general"&&this.addOrRemoveSelectLine truncated
<div id='importedfilename'></div>
<div id='sucessfullmessage' style="display:none">File imported successfully. <a id="importcreatenewdocument" href="${this._url}" target="blank">Open now »</a></div>
<br><br>
<div id='import-location'>Import location</div>
<div id="import-dropdowncontainer">
<div id='import-dropdown'></div>
</div>
<br>
<button id="importdata-select-btn"></button>
<button id="importdata-cancel-btn"></button>`,target:document.getElementById("container"),width:"420px",height:"290px",animationSettings:{effect:"Zoom"}});this.ssImprotedFileDailogueObj.appendTo("#importfile-container");this.dropdownObj=new ej.dropdowns.DropDownList({dataSource:["Create new spreadsheet","insert new sheet","Replace spreadsheet"],placeholder:"Select a Import",popupHeight:"200px",width:"345px"});this.dropdownObj.appendTo("#import-dropdown");this.dropdownObj.index=0;n.appendTo("#importdata-select-btn");t.appendTo("#importdata-cancel-btn");document.getElementById("importedfilename").innerHTML=this.importedFile.files[0].name}document.getElementById("importdata-cancel-btn").addEventListener("click",()=>{this.ssImportDialougObj.hide(),document.getElementById("importfile-upload-select-btn")&&document.getElementById("importfile-upload-select-btn").classList.add("e-disabled"),this.importedFile&&(this.importedFile.value=null),document.getElementById("importedfilename").innerHTML="",document.getElementById("filename")&&(document.getElementById("filename").innerHTML=""),this.hideImportandImportFileDialog()});document.getElementById("importdata-select-btn").addEventListener("click",()=>{var t=this.documentId,n=this.dropdownObj.value;n=="Create new spreadsheet"?this.importSpreadSheetDocument():n=="insert new sheet"?(this.insertSheet(),this.hideImportandImportFileDialog()):n=="Replace spreadsheet"&&(this.importReplaceSpreadSheet(),this.hideImportandImportFileDialog())})}hideImportandImportFileDialog(){this.ssImportDialougObj&&(this.ssImportDialougObj.destroy(),this.ssImportDialougObj=null);this.ssImprotedFileDailogueObj&&(this.ssImprotedFileDailogueObj.destroy(),this.ssImprotedFileDailogueObj=null)}formula(n,t){var i=this.base.ssObj.biz.getIndexes();this.cellRowStart=i[0];this.cellColStart=i[1];this.cellRowEnd=i[2];this.cellColEnd=i[3];let r=this.cellRowEnd-this.cellRowStart,f=this.cellColEnd-this.cellColStart,u=document.getElementById("DocumentViewer_edit");if(r==0&&f==0)this.base.ssObj.startEdit(),setTimeout(()=>{this.base.ssObj.startEdit(),u.textContent="="+t+"()"},0);else if(r==0&&f>0){let n=this.base.generateHeaderText(this.cellColStart+1)+(this.cellRowStart+1)+":"+this.base.generateHeaderText(this.cellColEnd+1)+(this.cellRowEnd+1);this.base.getSheetIndex()>=0&&(this.base.ssObj.selectRange(this.base.generateHeaderText(this.cellColEnd+2)+(this.cellRowStart+1)+":"+this.base.generateHeaderText(this.cellColEnd+2)+(this.cellRowStart+1)),setTimeout(()=>{this.base.ssObj.startEdit(),u.textContent="="+t+"("+n+")"},0))}else if(r>=1){let n=this.base.generateHeaderText(this.cellColStart+1)+(this.cellRowStart+1)+":"+this.base.generateHeaderText(this.cellColEnd+1)+(this.cellRowEnd+1);this.base.ssObj.notify("initiateFormulaReference",{range:n,formulaSheetIdx:this.base.getSheetIndex()});this.base.getSheetIndex()>=0&&(this.base.ssObj.selectRange(this.base.generateHeaderText(this.cellColStart+1)+(this.cellRowEnd+2)+":"+this.base.generateHeaderText(this.cellColStart+1)+(this.cellRowEnd+2)),setTimeout(()=>{this.base.ssObj.startEdit(),u.textContent="="+t+"("+n+")"},0))}setTimeout(()=>{var i=this.base.ssObj.element.querySelector("#"+this.base.ssObj.element.id+"_edit"),t;let n=document.createRange();t=window.getSelection();n.setStart(i.childNodes[0],i.innerHTML.length-1);n.collapse(!0);t.removeAllRanges();t.addRange(n);this.base.ssObj.isEdit=!0},200)}getFormulaBtnDdb(){var t=new ej.splitbuttons.DropDownButton({cssClass:"biz-ss-formula-ddb",iconCss:"e-icons biz-ss-formulaicon",items:[{text:"SUM",items:[{iconCss:"e-icons e-selected-icon",id:"_1px"},{id:"_2px"},{id:"_3px"},{id:"_dashed"},{id:"_dotted"},{id:"_double"}]},{text:"AVERAGE"},{text:"COUNT"},{text:"MAX"},{text:"MIN"},{separator:!0},{text:"ABS"},{text:"AND"},{text:"AVERAGE"},{text:"AVERAGEA"},{text:"AVERAGEIF"},{text:"AVERAGEIFS"},{text:"CEILING"},{text:"CHOOSE"},{text:"CONCAT"},{text:"CONCATENATE"},{text:"COUNT"},{text:"COUNTA"},{text:"COUNTIF"},{text:"COUNTIFS"},{text:"DATE"},{text:"DAY"},{text:"DAYS"},{text:"EXP"},{text:"FIND"},{text:"FLOOR"},{text:"GEOMEAN"},{text:"IF"},{text:"IFERROR"},{text:"IFS"},{text:"INDEX"},{text:"INT"},{text:"INTERCEPT"},{text:"ISNUMBER"},{text:"LN"},{text:"LOG"},{text:"MATCH"},{text:"MAX"},{text:"MIN"},{text:"OR"},{text:"POWER"},{text:"PRODUCT"},{text:"RADIANS"},{text:"RAND"},{text:"RANDBETWEEN"},{text:"ROUND"},{text:"ROUNDUP"},{text:"SLOPE"},{text:"SORT"},{text:"SUBTOTAL"},{text:"SUM"},{text:"SUMIF"},{text:"SUMIFS"},{text:"SUMPRODUCT"},{text:"TEXT"},{text:"TODAY"},{text:"TRUNC"}],select:n=>{let t=this.base.ssObj.biz.getActiveSheet();switch(n.item.text){case n.item.text:this.formula(t,n.item.text)}},beforeOpen:n=>{n.items[0].text==="SUM"&&(ej.base.closest(n.element,".biz-ss-formula-ddb").style.maxHeight="450px",ej.base.closest(n.element,".biz-ss-formula-ddb").style.overflowY="scroll")}});return t.appendTo(n.Apps.Collaboration.Components.Common.Util.Instance().createElement("button","class","biz-ss-formula-wrLine truncated
@@ -0,0 +1,210 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Components;
(function (Components) {
let Sheets;
(function (Sheets) {
class SpellChecker {
constructor() {
this.dic = {};
this.hederText = {};
}
init(base) {
this.base = base;
this.ssObj = this.base.ssObj;
}
processWords() {
this.dic = {};
this.words = '';
let sheet = this.ssObj.biz.getActiveSheet();
let rngIndexes = this.base.getIndexesFromAddress(sheet.selectedRange);
for (let i = rngIndexes[0]; i <= rngIndexes[2]; i++) {
if (!this.ssObj.biz.isRowAvailable(i, sheet)) {
continue;
}
for (let j = rngIndexes[1]; j <= rngIndexes[3]; j++) {
let cellObj = ej.spreadsheet.getCell(i, j, sheet);
if (cellObj && cellObj.value && typeof cellObj.value !== 'number') {
let value = cellObj.value.toString();
let temp = value.split(' ');
let values = [];
for (let k = 0; k < temp.length; k++) {
let val = temp[k];
if (!this.dic[val]) {
this.dic[val.trim()] = [{ rowIndex: i, colIndex: j }];
values.push(val.trim());
}
else {
this.dic[val.trim()].push({ rowIndex: i, colIndex: j });
}
}
values.length && (this.words = this.words + ' ' + values.toString().replaceAll(',', ' '));
}
}
}
this.splitWords = this.words.trim().split(' ').reverse();
this.requestServer();
}
requestServer() {
var data = {
LanguageID: 1033,
TexttoCheck: this.words.trim(),
CheckSpelling: true,
CheckSuggestion: true,
AddWord: false,
};
Unibase.Apps.Collaboration.DocumentManager.Instance().spellCheck(data).then((res) => { this.successCallback(res); });
}
successCallback(result) {
this.ssObj.allowEditing = false;
for (var i = 0; i < result.length; i++) {
result[i] = JSON.parse(result[i]);
}
this.result = result.reverse();
ej.popups.hideSpinner(this.dlgObj.element);
this.dlgObj.content = `<div>
<span class="biz-sc-info"></span>
<div style="padding-top: 10px">
<input class="biz-sc-value" type="text"/>
<input type="text" class='biz-sc-sugg'/>
</div>
<div style="padding-top: 10px">
<button type="text" class='biz-sc-change'>Change</button>
<button type="text" class='biz-sc-ignore'>Ignore</button>
</div>
</div>`;
this.dlgObj.dataBind();
this.dlgObj.element.querySelector('.e-footer-content').classList.add('biz-hide');
this.infoElem = this.dlgObj.element.querySelector('.biz-sc-info');
this.textObj = new ej.inputs.TextBox({}, this.dlgObj.element.querySelector('.biz-sc-value'));
this.ddSug = new ej.dropdowns.DropDownList({
dataSource: [], select: (e) => {
this.textObj.value = e.itemData.value;
}
}, this.dlgObj.element.querySelector('.biz-sc-sugg'));
let items = [
{
text: 'Change all',
}
];
this.spanElem = this.dlgObj.element.querySelector('.biz-sc-info');
this.ddChange = new ej.splitbuttons.SplitButton({ items: items, click: (e) => { this.change(); }, select: (e) => { this.changeAll(); } }, this.dlgObj.element.querySelector('.biz-sc-change'));
items = [
{
text: 'Ignore all',
}
];
this.ddIgnore = new ej.splitbuttons.SplitButton({ items: items, click: (e) => { this.ignore(); }, select: (e) => { this.ignoreAll(); } }, this.dlgObj.element.querySelector('.biz-sc-ignore'));
this.moveNext();
}
convertAsItemModel(items) {
for (let i = 0; i < items.length; i++) {
items[i] = { text: items[i] };
}
}
moveNext(skipPop) {
if (!this.splitWords.length) {
this.dlgObj.content = 'No spelling errors';
this.dlgObj.height = '95px';
this.dlgObj.dataBind();
this.dlgObj.element.querySelector('.e-footer-content').classList.remove('biz-hide');
this.ssObj.allowEditing = true;
setTimeout(() => {
this.destroySpellDialog();
}, 3000);
return;
}
if (!skipPop) {
this.value = this.splitWords.pop();
this.spellObj = this.result.pop();
this.spanElem.innerHTML = "Change <b>" + this.value + "</b> to:";
}
let addr = this.dic[this.value];
if (this.spellObj['Suggestions'] && this.spellObj['Suggestions'].length && addr.length) {
this.ssObj.selectRange(this.base.generateHeaderText(addr[0].colIndex + 1) + (addr[0].rowIndex + 1));
this.ddSug.dataSource = this.spellObj['Suggestions'];
this.ddSug.value = this.spellObj['Suggestions'][0];
this.textObj.value = this.spellObj['Suggestions'][0];
}
else {
delete this.dic[this.value];
this.moveNext();
}
}
change() {
let addr = this.dic[this.value];
let sheet = this.ssObj.biz.getActiveSheet();
let cellObj = ej.spreadsheet.getCell(addr[0].rowIndex, addr[0].colIndex, sheet);
let value = cellObj.value === this.value ? this.textObj.value : cellObj.value.replace(this.value, this.textObj.value);
let args = { rowIdx: addr[0].rowIndex, colIdx: addr[0].colIndex, value: value, action: 'spellcheck', origin: 'biz', sheetIndex: this.base.getSheetIndex() };
this.applySpellValue(addr[0].rowIndex, addr[0].colIndex, value);
this.ignore();
Unibase.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(args);
}
applySpellValue(rowIdx, colIdx, value) {
let sheet = this.ssObj.biz.getActiveSheet();
let cellObj = ej.spreadsheet.getCell(rowIdx, colIdx, sheet);
cellObj.value = value;
this.ssObj.biz.setCell(rowIdx, colIdx, sheet, cellObj);
Unibase.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({ action: "cellSave", eventArgs: { address: "sheet!" + this.base.ssObj.biz.getRange() } }, this.base, true);
}
changeAll() {
let len = this.dic[this.value].length;
for (let i = 0; i < len; i++) {
this.change();
}
}
ignore() {
this.dic[this.value].shift();
this.moveNext(true);
}
ignoreAll() {
delete this.dic[this.value];
this.moveNext();
}
renderSpellDialog() {
let div = this.ssObj.element.querySelector('.biz-spelldlg') || ej.base.createElement('div', { className: 'biz-spelldlg' });
this.ssObj.element.querySelector('.e-sheet-panel').appendChild(div);
this.dlgObj = new ej.popups.Dialog({
target: this.ssObj.element.querySelector('.e-sheet-panel'),
content: '',
width: '350px',
height: '170px',
position: { X: 'right', Y: 'top' },
animationSettings: { effect: 'None' },
showCloseIcon: false,
buttons: [{
click: this.destroySpellDialog.bind(this),
buttonModel: { content: 'Close' }
}],
open: () => {
ej.popups.createSpinner({ target: this.dlgObj.element });
ej.popups.showSpinner(this.dlgObj.element);
},
});
this.dlgObj.appendTo(div);
this.processWords();
}
destroySpellDialog() {
this.ddSug.destroy();
this.ddChange.destroy();
this.ddIgnore.destroy();
this.dlgObj.destroy();
}
static Instance() {
if (this.instance === undefined) {
this.instance = new SpellChecker();
}
return this.instance;
}
}
Sheets.SpellChecker = SpellChecker;
})(Sheets = Components.Sheets || (Components.Sheets = {}));
})(Components = Collaboration.Components || (Collaboration.Components = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"spellcheck.js","sourceRoot":"","sources":["spellcheck.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CA4OhB;AA5OD,WAAU,OAAO;IACb,IAAiB,IAAI,CA0OpB;IA1OD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAwO7B;QAxOD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CAsO1B;YAtOD,WAAiB,UAAU;gBACvB,IAAiB,MAAM,CAoOtB;gBApOD,WAAiB,MAAM;oBACnB,MAAa,YAAY;wBAAzB;4BAIW,QAAG,GAAW,EAAE,CAAC;4BAKjB,cAAS,GAAQ,EAAE,CAAC;wBAyN/B,CAAC;wBAhNG,IAAI,CAAC,IAAS;4BACV,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;4BACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;wBACjC,CAAC;wBAED,YAAY;4BACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;4BACd,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;4BAChB,IAAI,KAAK,GAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;4BACjD,IAAI,UAAU,GAAa,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;4BAEhF,KAAK,IAAI,CAAC,GAAW,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gCACzD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE;oCAC1C,SAAS;iCACZ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this.dic={};this.hederText={}}init(n){this.base=n;this.ssObj=this.base.ssObj}processWords(){this.dic={};this.words="";let t=this.ssObj.biz.getActiveSheet(),n=this.base.getIndexesFromAddress(t.selectedRange);for(let i=n[0];i<=n[2];i++)if(this.ssObj.biz.isRowAvailable(i,t))for(let r=n[1];r<=n[3];r++){let n=ej.spreadsheet.getCell(i,r,t);if(n&&n.value&&typeof n.value!="number"){let f=n.value.toString(),u=f.split(" "),t=[];for(let n=0;n<u.length;n++){let f=u[n];this.dic[f]?this.dic[f.trim()].push({rowIndex:i,colIndex:r}):(this.dic[f.trim()]=[{rowIndex:i,colIndex:r}],t.push(f.trim()))}t.length&&(this.words=this.words+" "+t.toString().replaceAll(","," "))}}this.splitWords=this.words.trim().split(" ").reverse();this.requestServer()}requestServer(){var t={LanguageID:1033,TexttoCheck:this.words.trim(),CheckSpelling:!0,CheckSuggestion:!0,AddWord:!1};n.Apps.Collaboration.DocumentManager.Instance().spellCheck(t).then(n=>{this.successCallback(n)})}successCallback(n){this.ssObj.allowEditing=!1;for(var t=0;t<n.length;t++)n[t]=JSON.parse(n[t]);this.result=n.reverse();ej.popups.hideSpinner(this.dlgObj.element);this.dlgObj.content=`<div>
<span class="biz-sc-info"></span>
<div style="padding-top: 10px">
<input class="biz-sc-value" type="text"/>
<input type="text" class='biz-sc-sugg'/>
</div>
<div style="padding-top: 10px">
<button type="text" class='biz-sc-change'>Change</button>
<button type="text" class='biz-sc-ignore'>Ignore</button>
</div>
</div>`;this.dlgObj.dataBind();this.dlgObj.element.querySelector(".e-footer-content").classList.add("biz-hide");this.infoElem=this.dlgObj.element.querySelector(".biz-sc-info");this.textObj=new ej.inputs.TextBox({},this.dlgObj.element.querySelector(".biz-sc-value"));this.ddSug=new ej.dropdowns.DropDownList({dataSource:[],select:n=>{this.textObj.value=n.itemData.value}},this.dlgObj.element.querySelector(".biz-sc-sugg"));let i=[{text:"Change all"}];this.spanElem=this.dlgObj.element.querySelector(".biz-sc-info");this.ddChange=new ej.splitbuttons.SplitButton({items:i,click:()=>{this.change()},select:()=>{this.changeAll()}},this.dlgObj.element.querySelector(".biz-sc-change"));i=[{text:"Ignore all"}];this.ddIgnore=new ej.splitbuttons.SplitButton({items:i,click:()=>{this.ignore()},select:()=>{this.ignoreAll()}},this.dlgObj.element.querySelector(".biz-sc-ignore"));this.moveNext()}convertAsItemModel(n){for(let t=0;t<n.length;t++)n[t]={text:n[t]}}moveNext(n){if(!this.splitWords.length){this.dlgObj.content="No spelling errors";this.dlgObj.height="95px";this.dlgObj.dataBind();this.dlgObj.element.querySelector(".e-footer-content").classList.remove("biz-hide");this.ssObj.allowEditing=!0;setTimeout(()=>{this.destroySpellDialog()},3e3);return}n||(this.value=this.splitWords.pop(),this.spellObj=this.result.pop(),this.spanElem.innerHTML="Change <b>"+this.value+"<\/b> to:");let t=this.dic[this.value];this.spellObj.Suggestions&&this.spellObj.Suggestions.length&&t.length?(this.ssObj.selectRange(this.base.generateHeaderText(t[0].colIndex+1)+(t[0].rowIndex+1)),this.ddSug.dataSource=this.spellObj.Suggestions,this.ddSug.value=this.spellObj.Suggestions[0],this.textObj.value=this.spellObj.Suggestions[0]):(delete this.dic[this.value],this.moveNext())}change(){let t=this.dic[this.value],u=this.ssObj.biz.getActiveSheet(),i=ej.spreadsheet.getCell(t[0].rowIndex,t[0].colIndex,u),r=i.value===this.value?this.textObj.value:i.value.replace(this.value,this.textObj.value),f={rowIdx:t[0].rowIndex,colIdx:t[0].colIndex,value:r,action:"spellcheck",origin:"biz",sheetIndex:this.base.getSheetIndex()};this.applySpellValue(t[0].rowIndex,t[0].colIndex,r);this.ignore();n.Apps.Collaboration.Components.Sheets.Base.Instance().bizSignalr(f)}applySpellValue(t,i,r){let u=this.ssObj.biz.getActiveSheet(),f=ej.spreadsheet.getCell(t,i,u);f.value=r;this.ssObj.biz.setCell(t,i,u,f);n.Apps.Collaboration.Components.Common.Download.Instance().ssAutoSave({action:"cellSave",eventArgs:{address:"sheet!"+this.base.ssObj.biz.getRange()}},this.base,!0)}changeAll(){let n=this.dic[this.value].length;for(let t=0;t<n;t++)this.change()}ignore(){this.dic[this.value].shift();this.moveNext(!0)}ignoreAll(){delete this.dic[this.value];this.moveNext()}renderSpellDialog(){let n=this.ssObj.element.querySelector(".biz-spelldlg")||ej.base.createElement("div",{className:"biz-spelldlg"});this.ssObj.element.querySelector(".e-sheet-panel").appendChild(n);this.dlgObj=new ej.popups.Dialog({target:this.ssObj.element.querySelector(".e-sheet-panel"),content:"",width:"350px",height:"170px",position:{X:"right",Y:"top"},animationSettings:{effect:"None"},showCloseIcon:!1,buttons:[{click:this.destroySpellDialog.bind(this),buttonModel:{content:"Close"}}],open:()=>{ej.popups.createSpinner({target:this.dlgObj.element}),ej.popups.showSpinner(this.dlgObj.element)}});this.dlgObj.appendTo(n);this.processWords()}destroySpellDialog(){this.ddSug.destroy();this.ddChange.destroy();this.ddIgnore.destroy();this.dlgObj.destroy()}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.SpellChecker=i})(i=t.Sheets||(t.Sheets={}))})(i=t.Components||(t.Components={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"unicloud.js","sourceRoot":"","sources":["unicloud.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAU,OAAO,CAi9DhB;AAj9DD,WAAU,OAAO;IACb,IAAiB,IAAI,CA88DpB;IA98DD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA48D7B;QA58DD,WAAiB,aAAa;YAC1B,IAAiB,UAAU,CA08D1B;YA18DD,WAAiB,UAAU;gBACvB,MAAa,QAAQ;oBAArB;wBAII,qBAAgB,GAAQ,CAAC,CAAC;wBAE1B,yBAAoB,GAAW,CAAC,CAAC;wBAGjC,2BAAsB,GAAe,EAAE,CAAC;wBACxC,aAAQ,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,K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Q,EAAE,EAAE;gCAClF,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;oCACzB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;iCAC9H;4BACL,CAAC,CAAC,CAAC;wBAEP,CAAC,CAAC,CAAC;oBACP,CAAC;oBAuBD,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,aAAa;wBAEpC,IAAK,QAAmB,CAAC,WAAW,EAAE,IAAI,MAAM,EAAE;4BAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,4CAA4C,EAAE;gCACzG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,Line truncated
+281
View File
@@ -0,0 +1,281 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.selectedfolderid=0;this.copyToSelectedFileId=0;this.changedUserPermissions=[];this.mimeType={txt:"text/plain",pdf:"application/pdf",zip:"application/zip",doc:"application/vnd.ms-word",docx:"application/vnd.ms-word",xls:"application/vnd.ms-excel",xlsx:"application/ vnd.openxmlformatsofficedocument.spreadsheetml.sheet",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",csv:"text/csv",mp3:"audio/mpeg3",mp4:"video/mp4",mpeg:"video/mpeg",svg:"image/svg+xml",xml:"application/xml",ods:"application/vnd.oasis.opendocument.spreadsheet"}}init(){}jsFiles(){return["apps/collaboration/managers/documentmanager.js","apps/collaboration/managers/filemanager.js","apps/collaboration/enums/enum.js","apps/collaboration/components/unicloud.js"]}loadlist(t,i,r,u){i.toLowerCase()=="folder"&&n.Platform.Helpers.NavigationHelper.Instance().loadDetail(t,r,null);i=="File"&&n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/components/documents.js",function(){n.Apps.Collaboration.Components.Documents.Instance().previewDocument(t,u,0)})}filepreview(n){n="Https://115.248.56.12:3001/loleaflet/d0edfeabb/loleaflet.html?file_path=file://"+n;let t=n;window.open(t)}filedownload_new(t){var r=this,i=0,u=n.Themes.Providers.DetailHelper.installedAppId;t==0?(i=Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+u+"_documentfileid").Value),t=i):i=0;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().downloadfile(t).then(n=>{n.result!=null&&n.result.FileData!=null&&n.result.FileData!=""&&r.downloadBase64File(n.result.FileData,n.result.DocumentFileName,n.result.FileType)})})}downloadBase64File(n,t,i){var u=this,f=u.mimeType[i];const e=`data:${f};base64,${n}`,r=document.createElement("a");document.body.appendChild(r);r.href=e;r.target="_self";r.download=t+"."+i;r.click()}deletefile(t,i){var r=this;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){return __awaiter(this,void 0,void 0,function*(){yield n.Apps.Collaboration.FileManager.Instance().deleteFILE(t).then(()=>{n.Themes.Compact.Components.Nav.Instance().loadList(i)})})})}deletefolder(t,i){var r=this;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){return __awaiter(this,void 0,void 0,function*(){yield n.Apps.Collaboration.FileManager.Instance().deletefolder(t).then(()=>{n.Themes.Compact.Components.Nav.Instance().loadList(i)})})})}unitemplatelist(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/analytics/components/reportviewer/_reportviewer.js",function(){n.Platform.Analytics.Components.ReportViewer.Instance().report_ViewAllByUniqueId("Bizgaze_Platform_Analytics_Reports_Drive_Templates",null,null,null)})})}unitemplatesheet(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/analytics/components/reportviewer/_reportviewer.js",function(){n.Platform.Analytics.Components.ReportViewer.Instance().report_ViewAllByUniqueId("Bizgaze_Platform_Analytics_Reports_Drive_sheettemplates",null,null,null)})})}blankdoc(t){var i=n.Themes.Providers.DetailHelper.installedAppId,r=0;r=i==0?0:Number(n.Themes.Providers.Detail_Settings.Instance().InputParameters.find(n=>n.Key=="hf_"+i+"_folderid").Value);n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().createnewsheet(t,r).then(n=>{if(n.result!=null){var t="https://115.248.56.12:3001/loleaflet/d0edfeabb/loleaflet.html?file_path=file://"+n.result.FilePath;let i=t;window.open(i)}else alert(n.message)})})}movefiles(t,i,r){const u=this;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){u.appendMoveCard(r,!1,t)})}moveFolders(t,i,r){const u=this;u.sourcefolderid=t;n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){u.appendMoveCard(r,!0,i)})}appendMoveCard(t,i,r){const s=this;let e=0,f=$(`#fileDropdown_${t}`);i&&(f=$(`#folderDropdown_${t}`),e=r);const h=f.attr("style"),c=`<div class="card mb-0 w-400p movable-card" id="moveFoldersCard_${t}" style="${h}"><d Line truncated
<div class="modal fade" id="rename_`+n+`" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content rounded-10">
<div class="modal-header" style="border-style: dashed;">
<h5 class="modal-title ">Rename</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true" class="badge badge-soft-danger font-20 rounded-circle pb-2 px-2">×</span> </button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<div id="error_mesg"><span id="renamemodal_errormessage"></span></div>
<input type="text" class="form-control" id="listscreenrename_`+n+`"></div>
</div>
<div class="text-center">
<button class="btn btn-secondary px-4 py-1 black-white font-weight-500 pull-left ml-25 md-10" data-dismiss="modal" type="button">Close</button>
<button type="submit" id="btn_filerename_`+n+`" class="btn btn-primary px-4 py-1 text-white font-weight-500 pull-right mr-25 mb-10"onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().rename(`+n+`,'`+i+`',`+r+`)">Rename</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>`;$("#_bizgaze_modal").append(u);$("#listscreenrename_"+n).val(t);$("#rename_"+n).modal()}rename(t,i,r){if($("#listscreenrename_"+t).val()=="")MessageHelper.Instance().showError("Please Enter Filename","renamemodal_errormessage");else{var u={Id:t,Title:$("#listscreenrename_"+t).val(),Type:i};n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/documentmanager.js",function(){n.Apps.Collaboration.DocumentManager.Instance().renameFileTitle(u).then(function(i){i.errors==null?(MessageHelper.Instance().showSuccess("File Renamed Successfully","Unibase_ValidationSummary"),$("#rename_"+t).modal("hide"),n.Platform.Helpers.NavigationHelper.Instance().loadList(r,null)):MessageHelper.Instance().showError(i.errors[0].toString(),"renamemodal_errormessage")})})}}getLink(t,i){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().getFileUrl(t,i).then(function(n){var t=_appsettings.server_url()+n.result;let i=`<div class="settings-modal-container">
<div class="modal fade" id="div_getlink" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content rounded-10">
<div class="modal-header" style="border-style: dashed;">
<h5 class="modal-title ">Get Link</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true" class="badge badge-soft-danger font-20 rounded-circle pb-2 px-2">×</span> </button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<input type="text" class="form-control" readonly id="filegetlink" value="`+t+`"> </div>
</div>
<div class="text-center">
<button class="btn btn-secondary px-4 py-1 black-white font-weight-500 pull-left ml-25 md-10" type="button" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().copyUrl()">Copy</button>
<button type="submit" id="btn_done" class="btn btn-primary px-4 py-1 text-white font-weight-500 pull-right mr-25 mb-10" >Done</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>`;$("#_bizgaze_modal").append(i);$("#div_getlink").modal();$("#btn_done").click(function(){$("#div_getlink").modal("hide")})})})}copyUrl(){var t=$("#filegetlink"),n=$("<input>");$("body").append(n);n.val($(t).val()).select();document.execCommand("copy");n.remove();MessageHelper.Instance().showSuccess("Link Copied","Unibase_ValidationSummary")}createFolder(){$("#ul_filesList").addClass("hidden");$("#ul_foldersList").addClass("hidden");$("#div_createfolder").removeClass("hidden");$("#btn_savefolder").removeClass("hidden");$("#btn_createfolder").addClass("hidden");$("#btn_move").addClass("disabled")}saveFolder(t){(t==null||t==undefined)&&(t=$("#createfolder").val());var i={folderid:0,foldername:t,parentid:n.Apps.Collaboration.Components.UniCloud.Instance().selectedfolderid};n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().createFolder(i).then(function(){setTimeout(()=>{var t=n.Apps.Collaboration.Components.UniCloud.Instance().selectedfolderid},1e3)})})}share(t,i,r){var e=this,f,u;t==this.fileId?this.fileId=t:this.selectedfolderid=t;f=$("#hdn_shareid_"+t).val();n.Platform.Helpers.FileCacheHelper.Instance().loadCssFiles(["apps/collaboration/components/share.css","libs/select2/css/select2.css"],null);n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["libs/select2/js/select2.min.js","apps/collaboration/managers/filemanager.js","apps/collaboration/managers/documentmanager.js","apps/collaboration/enums/enum.js"],()=>{n.Apps.Collaboration.FileManager.Instance().getLinkInfo(t).then(t=>{u=t.result,console.log(u),n.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption(u.PermissionLevel,u.Restriction)});let o=n.Platform.Membership.Infos.Identity.getCurrentUser(),s=`<div class="biz-share-modal modal fade" id="bizShareModal" tabindex="-1" role="dialog" aria-labelledby="bizShareModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" id="bizShareModalDialog" role="document">
<div class="modal-content bg-transparent shadow-none" id="ShareModalOverlay">
<div class="accordion biz-share-accordion">
<div class="card" id="shareWithPeopleCard">
<div class="card-header activestate">
<a role="button" href="javascript:;" data-expanded="true" class="collapse-btn pa-0" id="collapseShareBtn">
<div class="d-flex justify-content-between align-items-center">
<div class="header-icon-wrapper">
<button class="btn btn-icon btn-sm activestate" id="sharePeopleHeaderBtn">
<span class="btn-icon-wrap"><i class="las la-user-plus font-18"></i><i class="las la-arrow-left font-18 d-none"></i></span>
</button>
<span class="header-title">Share with people and groups</span>
</div>
<div class="cursor-pointer">
<i class="fa fa-cog font-25 " id="shareSettings" style="display: none;"></i>
</div>
</div>
<div class="shared-users text-truncate font-weight-500 w-80" id="sharedusers"></div>
</a>
</div>
<div id="collapese_share" class="collapse show">
<div class="card-body pa-0">
<div class="add-people-wrapper pt-0">
<div class="d-flex align-items-center">
<div id="div_users" class="people-select2-wrapper">
<input type="hidden" id="hdnselect2" value="0" placeholder="Add people and groups">
<select id="user_select2" class="value-control select2 type-control select2_users form-control text-control" multiple="multiple" style="width:100%;" data-regularexp="" data-validatemsg="" data-textformpropertyid=""><option>Select</option></select>
</div>
<div class="h-50p hidden ml-10" id="headereditorbtn" data-permissionLevel="`+n.Apps.Collaboration.Enums.Share.Editor+`">
<div class="user-role-wrapper h-100 p-0" >
<div class="btn-group dropdown bg-light h-100 rounded">
<button type="button" class="btn btn-sm dropdown-toggle py-2 permissionsBtn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().showHidePermissionDropdown(event)">
Editor
</button>
<div class="dropdown-menu permissionsMenu">
<a class="dropdown-item" value="`+n.Apps.Collaboration.Enums.Share.Viewer+`" href="#" class="tenantviewerPermission" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('`+n.Apps.Collaboration.Enums.Share.Viewer+`',0,event)"><span>Viewer</span></a>
<a class="dropdown-item" value="`+n.Apps.Collaboration.Enums.Share.Commentor+` href="#" class="tenantcommentorPermission" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('`+n.Apps.Collaboration.Enums.Share.Commentor+`',0,event)"><span>Commentor</span></a>
<a class="dropdown-item" value="`+n.Apps.Collaboration.Enums.Share.Editor+` href="#" class="tenanteditorPermission" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('`+n.Apps.Collaboration.Enums.Share.Editor+`',0,event)"><i class="dropdown-icon las la-check"></i><span>Editor</span></a>
</div>
</div>
</div>
</div>
</div>
<select class="form-control custom-select ml-10 d-none" id="share_permissionlevel"><option value="`+n.Apps.Collaboration.Enums.Share.Viewer+`">Viewer</option><option value="`+n.Apps.Collaboration.Enums.Share.Editor+`" >Editor</option></select>
</div>
<div class="people-notification-area hidden" id="peopleNotificationArea"><div class="custom-share-checkbox" id="notifyCheckbox">
<input type="checkbox" class="custom-control-input" id="notify_check" checked>
<label class="notify-label" for="notify_check"><span>Notify people</span></label>
</div>
<textarea class="message-textarea" placeholder="Message" id="share_message"></textarea><div id="sharedFileDiv" class="hidden"><button id="div_share_filename" class="shared-file-btn"></button>
</div></div>
<div class="external-dropdown">
<ul class="shared-people-list dropdown-menu-scrollbar" id="ul_shared_people_list" >
</ul>
</div>
</div>
<div class="card-footer">
<a href="#" class="feedback-link">Send Feedback to Bizgaze</a>
<div class="d-flex align-items-center">
<span class="mr-3 d-none" id="permissionsSavePending"><i>Pending changes</i></span>
<button class="btn btn-primary done-btn" id="doneBtn" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().saveShareUsers(`+t+`,`+f+`,`+0x5af574056d8b+`,'`+i+`')">Done</button>
</div>
<div class="share-actions-btn-group hidden" id="shareActionsBtnGroup"><button class="btn btn-outline-danger cancel-btn mr-10" id="sharedActionsCancelBtn">Cancel</button><button class="btn btn-primary save-btn " id="sharedActionsSaveBtn" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().saveShareUsers(`+t+`,`+f+`,`+r+`,'`+i+`')">Send</button></div>
</div>
</div>
</div>
<div class="card mt-15" id="get-link-card">
<div class="get-link-card-loader hidden">
<div class="get-link-card-loaderBar"></div>
</div>
<div class="card-header pb-20" >
<a role="button" href="javascript:;" data-expanded="false" class="collapse-btn pb-0" id="collapseGetLinkBtn">
<div class="header-icon-wrapper">
<button class="btn btn-icon btn-sm bg-secondary text-white">
<span class="btn-icon-wrap"><i class="fa fa-link font-18 get_link_icon"></i></span>
</button>
<span class="header-title">Get link</span>
</div>
<div class="d-flex" >
<div class="shared-users font-weight-500 w-90 d-flex flex-column" ><span id="collapsePermissionDesc">Restricted Only people added can open with this link</span> <span class="text-blue">Change</span></div>
<input type="text" class="add-search-box bg-light p-0 rounded border-0 " id="hidden_txt_link" readOnly style='opacity:0;width:1px;'/>
<button onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().copyLinkText('#hidden_txt_link')" class="copy-link-btn w-15 ml-2 h-100 p-2 btn btn-white font-14 font-weight-500 text-blue" id="collapsecopybtn">Copy link</button>
</div>
</a>
</div>
<div id="collapse_getlink" class="collapse collapse-getlink">
<div class="card-body pa-0">
<div class="search-wrapper d-flex">
<input type="text" class="add-search-box w-85 bg-light p-0 rounded border-0 px-2 text-truncate" id="txt_link" readOnly/>
<button onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().copyLinkText('#txt_link')" class="copy-link-btn w-15 ml-2 p-0 btn btn-white font-14 font-weight-500 text-blue" >Copy link</button>
</div>
<ul id="ul_link" class="pr-0 pl-15">
<li class="col-sm-12 row border-0 pr-4 pl-0 m-0 align-items-center people-list-item" id="li_link_restrictions">
<div class="user-role-wrapper col-sm-10 p-0">
<div class="btn btn-icon btn-icon-circle ml-2 rounded-circle bg-light"><span class="btn-icon-wrap" id="filePermssionIcon"><i class="fa fa-users" ></i></span></div>
<div class="btn-group dropdown flex-column align-items-start">
<button type="button" class="btn btn-sm dropdown-toggle permissionsBtn pl-1" id="FilePermissionbutton" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().showHidePermissionDropdown(event)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Restricted
</button>
<span class="font-14 pl-1 text-dark" id="FilePermissionDescription">Only people added can open with this link</span>
<div class="dropdown-menu permissionsMenu">
<a class="dropdown-item" id="permissionRestricted" value=1 href="#" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('0','`+n.Apps.Collaboration.Enums.Share.Ristrict+`')"><i class="dropdown-icon las la-check"></i><span>Restricted</span></a>
<a class="dropdown-item" id="permissionOrganization" value=2 href="#" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('0','`+n.Apps.Collaboration.Enums.Share.TenantId+`')"><span> `+o.name+`</span></a>
<a class="dropdown-item" id="permissionAnyoneWithLink" value=3 href="#" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('0','`+n.Apps.Collaboration.Enums.Share.AnyoneWithLink+`')"><span>Anyone with Link</span></a>
</div>
</div>
</div>
<div class="user-role-wrapper col-sm-2 pull-right d-none" id="getLinkUserPermissions">
<div class="btn-group dropdown">
<button type="button" class="btn btn-sm dropdown-toggle permissionsBtn" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().showHidePermissionDropdown(event)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Viewer
</button>
<div class="dropdown-menu permissionsMenu">
<a class="dropdown-item" href="#" class="tenantviewerPermission" href="#" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('`+n.Apps.Collaboration.Enums.Share.Viewer+`','0',event)"><i class="dropdown-icon las la-check"></i><span>Viewer</span></a>
<a class="dropdown-item" href="#" class="tenanteditorPermission" href="#" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeFilePermissionOption('`+n.Apps.Collaboration.Enums.Share.Editor+`','0',event)"><span>Editor</span></a>
</div>
</div>
</div>
</li>
</li>
</ul>
</div>
<div class="card-footer">
<a href="#" class="feedback-link">Send Feedback to Bizgaze</a>
<button class="btn btn-primary done-btn" id="getLinkDoneBtn">Done</button>
</div>
</div>
</div>
<div class="card d-none" id="shareSettingsCard">
<div class="card-header">
<a role="button" href="javascript:;" data-expanded="true" class="collapse-btn pa-0" id="collapseShareBtn">
<div class="d-flex justify-content-between align-items-center">
<div class="header-icon-wrapper">
<button class="btn btn-icon" id="sharePeopleSettingsBtn">
<span class="btn-icon-wrap cursor-pointer"></i><i class="las la-arrow-left font-25"></i></span>
</button>
<span class="header-title">Share with people settings</span>
</div>
</div>
</a>
</div>
<div class="share-people-settings mx-30 mb-30 p-0" id="sharePeopleSettings">
<div class="custom-share-checkbox p-0" id="shareSettingsContainer1">
<input type="checkbox" class="sharePeopleSettingCheckbox" id="sharePeopleSetting1" name="sharePeopleSetting1"
value="Editors can change permissions and share" checked>
<label for="sharePeopleSetting1" class="mb-3"> Editors can change permissions and share</label>
</div>
<div class="custom-share-checkbox p-0" id="shareSettingsContainer2">
<input type="checkbox" class="sharePeopleSettingCheckbox" id="sharePeopleSetting2" name="sharePeopleSetting2"
value="Viewers and commenters can see the option to download, print, and copy" checked>
<label for="sharePeopleSetting2"> Viewers and commenters can see the option to download, print, and copy</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Discard Modal -->
<div class="modal fade" id="discardModal" tabindex="-1" role="dialog" aria-labelledby="discardModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
<div class="modal-content ">l
<div class="modal-header border-0">
<h6 class="modal-title" id="exampleModalLongTitle">Discard unsaved changes?</h6>
</div>
<div class="modal-footer border-0">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="DiscardModalBtn">Discard</button>
</div>
</div>
</div>
</div>`;$("#_bizgaze_modal").append(s);$(".modal-backdrop.show").addClass("d-none");$("#bizShareModal").modal({backdrop:"static",keyboard:!1});$(".modal-backdrop").css("z-index","1050");$("#bizShareModal").on("shown.bs.modal",function(){n.Apps.Collaboration.Components.UniCloud.instance.loadUsers();n.Apps.Collaboration.FileManager.Instance().getFileUrl(t,i).then(function(n){let t=_appsettings.server_url()+n.result;$("#txt_link,#hidden_txt_link").attr("value",t)})});$("#user_select2").find("option").remove();n.Apps.Collaboration.Components.UniCloud.instance.loadUsers();n.Apps.Collaboration.Components.UniCloud.instance.getShareusers(t,i);$("#user_select2").change(function(){var n=$(this).find("option:selected").length;n>0?($("#notify_check").is(":checked")||$("#notify_check").trigger("click"),$("#div_users").addClass("pr-0"),$("#headereditorbtn").removeClass("hidden"),$("#peopleNotificationArea,#sharedFileDiv,#shareActionsBtnGroup").removeClass("hidden"),$("#ul_shared_people_list,#doneBtn,#get-link-card").addClass("hidden"),$("#sharePeopleHeaderBtn").addClass("notifyBackBtn"),$("#sharedActionsCancelBtn").addClass("notifyBackBtn"),$("#sharePeopleHeaderBtn").find(".la-user-plus").addClass("d-none"),$("#sharePeopleHeaderBtn").find(".la-arrow-left").removeClass("d-none")):($("#div_users").removeClass("pr-0"),$("#headereditorbtn").addClass("hidden"),$("#peopleNotificationArea,#sharedFileDiv,#shareActionsBtnGroup").addClass("hidden"),$("#ul_shared_people_list,#doneBtn,#get-link-card").removeClass("hidden"),$("#sharePeopleHeaderBtn").removeClass("notifyBackBtn"),$("#sharePeopleHeaderBtn").find(".la-arrow-left").addClass("d-none"),$("#sharePeopleHeaderBtn").find(".la-user-plus").removeClass("d-none"))});$("#notify_check").change(function(){$(this).is(":checked")?($("#share_message").removeClass("d-none"),$("#notifyCheckbox").removeClass("unchecked")):($("#share_message").addClass("d-none"),$("#notifyCheckbox").addClass("unchecked"))});$("#sharePeopleHeaderBtn,#sharedActionsCancelBtn").click(function(){$(this).hasClass("notifyBackBtn")&&($("#peopleNotificationArea,#sharedFileDiv,#shareActionsBtnGroup").addClass("hidden"),$("#ul_shared_people_list,#doneBtn,#get-link-card").removeClass("hidden"),$("#user_select2").empty().trigger("change"),$(this).removeClass("notifyBackBtn"),$(this).find(".la-arrow-left").addClass("d-none"),$(this).find(".la-user-plus").removeClass("d-none"))});$("#collapseGetLinkBtn,#collapseShareBtn").click(function(){$(this).attr("data-expanded")=="false"&&($(this).attr("id")=="collapseShareBtn"?($("#collapse_getlink").collapse("hide"),$("#collapese_share").collapse("show"),$("#collapseGetLinkBtn").attr("data-expanded","false"),$(this).attr("data-expanded","true"),$("#collapsecopybtn").parent().removeClass("d-none"),$("#collapsecopybtn").parent().addClass("d-flex")):($("#collapese_share").collapse("hide"),$("#collapse_getlink").collapse("show"),$("#collapseShareBtn").attr("data-expanded","false"),$(this).attr("data-expanded","true"),$("#collapsecopybtn").parent().removeClass("d-flex"),$("#collapsecopybtn").parent().addClass("d-none")))});$("#doneBtn,#sharedActionsSaveBtn,#getLinkDoneBtn").click(function(){$("#bizShareModal").modal("hide")});$("#DiscardModalBtn").click(function(){$("#bizShareModal").modal("hide");$("#discardModal").modal("hide")});$("#bizShareModal").click(function(){var n=$("#user_select2").find("option:selected").length;let t=$("#permissionsSavePending").is(":visible"),i=parseInt($("#ul_shared_people_list").attr("data-sharedUsersLength")),r=$("#ul_shared_people_list li").length;n>0||t||i!=r-1?($("#bizShareModal").css("z-index","1050"),$("#discardModal").modal("show")):$("#bizShareModal").modal("hide")});$("#bizShareModalDialog").click(function(n){n.stopPropagation();$("#bizShareModalDialog").find(".dropdown-menu").removeClass("show")});$("#bizShareModal").on("hidden.bs.modal",function(){$("#_bizgaze_modal").html("")});$("#discardModal").on("hidden.bs.modal",function(){$("#bizShareModal").css("z-index","")});$("#shareSettings").click(function(){$("#shareSettingsCard").removeClass("d-none");$("#get-link-card,#shareWithPeopleCard").addClass("d-none")});$("#sharePeopleSettingsBtn").click(function(){$("#shareSettingsCard").addClass("d-none");$("#get-link-card,#shareWithPeopleCard").removeClass("d-none")});$(".sharePeopleSettingCheckbox").change(function(){$(this).is(":checked")?$(this).parent().removeClass("unchecked"):$(this).parent().addClass("unchecked")});$("#ul_shared_people_list").on("resize scroll",function(){var n=$(".dropdown-menu.show"),t;if(n.length>0){t=parseInt(n.attr("data-topPos"))-$(this).scrollTop();n.css("top",t);let i=n.parents(".people-list-item"),r=e.isInViewport(i);r||n.removeClass("show")}});$("#get-link-card").click(function(){$("#shareWithPeopleCard").find(".card-header").hasClass("activestate")||($("#shareWithPeopleCard").find(".btn-icon").removeClass("btn-primary"),$("#shareWithPeopleCard").find(".btn-icon").addClass("bg-secondary text-white"))});$("#collapsecLine truncated
<div class="user-detail-wrapper d-flex align-items-center">
<div class="avatar avatar-sm mr-10">
<span class="avatar-text avatar-text-inv-danger rounded-circle">
<span class="initial-wrap"><span>`+o+`</span></span>
</span>
</div>
<div class="user-name-email-wrapper">
<input type="hidden" id="hdn_shareuserid" value="`+f[e].ShareUserId+`">
<input type="hidden" id="hdn_userid" value="`+f[e].UserId+`">
<p class="user-name" id="user-name_`+f[e].ShareUserId+`">
`+f[e].UserName+`
</p>
<p class="user-email">
`+h+`
</p>
</div>
</div>
<div class="user-role-wrapper">
<div class="btn-group dropdown">
<button type="button" class="btn btn-sm dropdown-toggle permissionsBtn" id="btn_permissionlevel_`+f[e].ShareUserId+`" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().showHidePermissionDropdown(event)" data-toggle="dropdown" data-value='2' data-permissionLevel=${f[e].PermissionLevel} aria-haspopup="true" aria-expanded="false">
`+n.Apps.Collaboration.Enums.Share[f[e].PermissionLevel]+`
</button>
<div class="dropdown-menu permissionMenu">
<a class="dropdown-item" href="#" value=1 onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeUserPermissionbutton(`+f[e].ShareUserId+`,`+1+`)"><span id="permissionlevel_1_`+f[e].ShareUserId+`">Viewer</span></a>
<a class="dropdown-item" href="#" value=2 onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().changeUserPermissionbutton(`+f[e].ShareUserId+`,`+2+`)"><span id="permissionlevel_2_`+f[e].ShareUserId+`">Editor</span></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" id="remove_user" onclick="Unibase.Apps.Collaboration.Components.UniCloud.Instance().removeshareuser(`+f[e].ShareUserId+`,`+t+`,'`+i+`')" >Remove</a>
</div>
</div>
</div>
</li>`,f[e].IsOwner){let n=`<li class="people-list-item">
<div class="user-detail-wrapper">
<div class="avatar avatar-sm mr-10">
<span class="avatar-text avatar-text-inv-danger rounded-circle">
<span class="initial-wrap"><span>`+o+`</span></span>
</span>
</div>
<div class="user-name-email-wrapper">
<p class="user-name">
`+f[e].UserName+`
</p>
<p class="user-email">
`+f[e].UserEmail+`
</p>
</div>
</div>
<div class="user-owner"><span class="text-secondary font-italic font-weight-500">Owner</span></div>
</li>`;$("#ul_shared_people_list").prepend(n)}else $("#ul_shared_people_list").append(c);$("#user_select2").val();f[e].PermissionLevel==1&&($("#permissionlevel_1_"+f[e].ShareUserId).append(`<i class="dropdown-icon las la-check"></i>`),$("#btn_permissionlevel_"+f[e].ShareUserId).text("Viewer"));f[e].PermissionLevel==2&&($("#permissionlevel_2_"+f[e].ShareUserId).append(`<i class="dropdown-icon las la-check"></i>`),$("#btn_permissionlevel_"+f[e].ShareUserId).text("Editor"))}$("#sharedusers").text(r);i=="file"&&n.Apps.Collaboration.FileManager.Instance().getFile(t).then(n=>{var t=n.result.FileTitle,i=n.result.FileIcon,r=`<img src="`+i+`" class="file-icon"><small id="div_share_filename" class="font-14 font-weight-600 file-text">`+t+`</small>`;$("#div_share_filename").append(r)})})})}loadUsers(){var t=n.Platform.Membership.Infos.Identity.getCurrentUser(),i=_appsettings.server_url()+"/apis/v4/bizgaze/crm/contacts/getallemployeesauto/";$("#user_select2").select2({placeholder:"Add people and groups",tags:!0,ajax:{url:function(n){var u=i,r=n.term;return r==undefined||r==""?u+"term/"+r+"/authtoken/"+t.sessionId:u+"term/"+r+"/authtoken/"+t.sessionId},dataType:"json",delay:250,data:function(n){return{term:n.term,type:"GET"}},beforeSend:function(n){t!==undefined&&t!==null&&(n.setRequestHeader("Authorization","Basic "+t.sessionId),n.setRequestHeader("geoposition",t.latd+":"+t.lgId))},processResults:function(n){return{results:jQuery.map(JSON.parse(n.result),function(n){return{id:n.Value,text:n.SelectText}})}}},templateResult:function(n){return n.text},templateSelection:function(n){return n.text}})}updateShareUsers(){}saveShareUsers(t,i,r,u){var o,s,a,v,e,y;o=0;s=0;u=="file"&&(o=t);u=="folder"&&(s=t);let f=[],h=[];var c=$("#user_select2").val(),p=$("#notify_check").is(":checked"),w=$("#share_message").val().toString();let l=Number($("#headereditorbtn").attr("data-permissionlevel"));console.log($(this));let b=$(this);if(c.toString().indexOf(",")>-1?f=c.toString().split(","):(e={shareuserid:0,shareid:i,userid:0,emailaddress:$("#user_select2").text(),permissionlevel:l,installedappid:r},h[0]=e),f!=null)for(let n=0;n<f.length;n++)a=0,v="",c[n].indexOf("@")>-1?v=f[n]:a=f[n],e={shareuserid:0,shareid:i,userid:Number(a),emailaddress:v,permissionlevel:l,installedappid:r},h[n]=e;y={shareid:i,fileid:Number(o),filetypeid:0,permission:l,folderid:s,installedappid:r,message:w,isnotify:p,shareusers:h};n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().share(y).then(n=>{n.result!=null&&MessageHelper.Instance().showSuccess("File Shared Successfully","Unibase_ValidationSummary")})})}camelize(n){return n.replace(/\W+(.)/g,function(n,t){return t.toUpperCase()})}changeUserPermissionbutton(t,i){var r=this;let u=parseInt($("#btn_permissionlevel_"+t).attr("data-permissionlevel")),f=n.Apps.Collaboration.Enums.Share[u],e=n.Apps.Collaboration.Enums.Share[i],o=parseInt($("#ul_shared_people_list").attr("data-sharedUsersLength")),s=$("#ul_shared_people_list li").length;if(f!=e||o!=s-1){$("#permissionsSavePending").removeClass("d-none");$("#btn_permissionlevel_"+t).addClass("permissionLevelChanged");let u=r.changedUserPermissions.length,n=0;if(u>0)for(let i=0;i<u;i++)r.changedUserPermissions[i].shareuserid==t&&n++;n||(r.changedUserPermissions.push({shareuserid:t,permission:i}),console.log(r.changedUserPermissions),n=0)}else{$("#btn_permissionlevel_"+t).removeClass("permissionLevelChanged");$("#ul_shared_people_list").find(".permissionLevelChanged").length<=0&&$("#permissionsSavePending").addClass("d-none");let n=r.changedUserPermissions.length;n>0&&(r.changedUserPermissions=r.changedUserPermissions.filter(function(n){return!(n.shareuserid==t&&n.permission!=i)}))}i==1&&($("#permissionlevel_2_"+t).find(".dropdown-icon").removeClass("las la-check"),$("#permissionlevel_1_"+t).append(`<i class="dropdown-icon las la-check"></i>`),$("#btn_permissionlevel_"+t).text("Viewer"),$("#headereditorbtn").attr("data-permissionLevel",`${n.Apps.Collaboration.Enums.Share.Viewer}`));i==2&&($("#permissionlevel_1_"+t).find(".dropdown-icon").removeClass("las la-check"),$("#permissionlevel_2_"+t).append(`<i class="dropdown-icon las la-check"></i>`),$("#btn_permissionlevel_"+t).text("Editor"),$("#headereditorbtn").attr("data-permissionLevel",`${n.Apps.Collaboration.Enums.Share.Editor}`))}removeshareuser(t,i,r){n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().removeshareuser(t).then(()=>{n.Apps.Collaboration.Components.UniCloud.Instance().getShareusers(i,r)})})}getUrl(t,i){var r="";return n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/collaboration/managers/filemanager.js",function(){n.Apps.Collaboration.FileManager.Instance().getFileUrl(t,i).then(function(n){r=_appsettings.server_url()+n.result;$("#txt_link").val(r)})}),r}loadFileUrLine truncated
@@ -0,0 +1,41 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Hubs;
(function (Hubs) {
class UniDocHub {
constructor(huburl) {
this.huburl = huburl;
this.connection = new window['signalR'].HubConnectionBuilder()
.withUrl(this.huburl).withAutomaticReconnect()
.build();
}
getConnection() {
return this.connection;
}
connect(callback) {
this.getConnection().start().then(function () {
callback();
});
}
register(eventname, actionmethod) {
this.getConnection().on(eventname, actionmethod);
}
invoke(methodname, params) {
this.getConnection().invoke(methodname, params);
}
static Instance(huburl) {
if (this.instance === undefined) {
this.instance = new UniDocHub(huburl);
}
return this.instance;
}
}
Hubs.UniDocHub = UniDocHub;
})(Hubs = Collaboration.Hubs || (Collaboration.Hubs = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"unidochub.js","sourceRoot":"","sources":["unidochub.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAkDhB;AAlDD,WAAU,OAAO;IACb,IAAiB,IAAI,CAgDpB;IAhDD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CA8C7B;QA9CD,WAAiB,aAAa;YAC1B,IAAiB,IAAI,CA4CpB;YA5CD,WAAiB,IAAI;gBACjB,MAAa,SAAS;oBAIlB,YAAY,MAAc;wBACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;wBACrB,IAAI,CAAC,UAAU,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,oBAAoB,EAAE;6BACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,sBAAsB,EAAE;6BAC7C,KAAK,EAAE,CAAC;oBACjB,CAAC;oBAED,aAAa;wBAKT,OAAO,IAAI,CAAC,UAAU,CAAC;oBAC3B,CAAC;oBAED,OAAO,CAAC,QAAkB;wBACtB,IAAI,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;4BAC9B,QAAQ,EAAE,CAAC;wBACf,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,QAAQ,CAAC,SAAiB,EAAE,YAAsB;wBAE9C,IAAI,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;oBACrD,CAAC;oBAED,MAAM,CAAC,UAAkB,EAAE,MAAuB;wBAC9C,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;oBACnD,CAAC;oBAID,MAAM,CAAC,QAAQ,CAAC,MAAc;wBAC1B,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;yBACzC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA1CY,cAAS,YA0CrB,CAAA;YACL,CAAC,EA5CgB,IAAI,GAAJ,kBAAI,KAAJ,kBAAI,QA4CpB;QACL,CAAC,EA9CgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QA8C7B;IACL,CAAC,EAhDgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAgDpB;AACL,CAAC,EAlDS,OAAO,KAAP,OAAO,QAkDhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{constructor(n){this.huburl=n;this.connection=(new window.signalR.HubConnectionBuilder).withUrl(this.huburl).withAutomaticReconnect().build()}getConnection(){return this.connection}connect(n){this.getConnection().start().then(function(){n()})}register(n,t){this.getConnection().on(n,t)}invoke(n,t){this.getConnection().invoke(n,t)}static Instance(n){return this.instance===undefined&&(this.instance=new t(n)),this.instance}}n.UniDocHub=t})(t=n.Hubs||(n.Hubs={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,127 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Controls;
(function (Controls) {
class UserSelect2 extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.data = [];
}
init(formpropertyid, prop, callback) {
var instance = UserSelect2.Instance();
var container = $(".select2_" + prop.FormPropertyId);
Unibase.Apps.Collaboration.Controls.UserSelect2.Instance().loadControlSettings(container, null).then(function () {
if (callback != null)
callback();
});
}
loadControl(containerid, prop) {
var instance = this;
var IsTagSelect = false;
var text;
debugger;
if (prop.ControlJsonText != "" && prop.ControlJsonText != null && prop.ControlJsonText != undefined) {
var text = JSON.parse(prop.ControlJsonText);
if (text["IsTagSelect"] == true) {
IsTagSelect = true;
}
}
var html = '<div id="div_' + prop.DocPropertyName + '" class="floating-label-form-group-with-value floating-validate" style="border-bottom:0;"><label for= "lbl" id = "lbl_' + prop.DocPropertyName + '" >' + prop.LabelName + '<span class="text-danger hide " id="spnIsRequired_' + prop.DocPropertyName + '"> *</span></label >' +
'<input type="hidden" id="hdnselect2_' + prop.FormPropertyId + '" class="" value="0">' +
'<select id="select2_' + prop.FormPropertyId + '" class="value-control select2_' + prop.FormPropertyId + ' type-control select2_' + prop.DocPropertyName + ' form-control text-control " multiple="multiple" data-isdynamic="' + prop.IsDefault + '" data-istagselect="' + IsTagSelect + '" style="width:100%;" data-propdoctypename="' + prop.DocTypeName + '" data-propertyid="' + prop.DocPropertyId + '" data-propertyname="' + prop.DocPropertyName + '" data-formpropertyid="' + prop.FormPropertyId + '" data-regularexp="" data-validatemsg="" data-textformpropertyid=""><option>Select</option></select>' +
'</div>';
$("#" + containerid).html(html);
}
loadControlSettings(Container, Parameters) {
return __awaiter(this, void 0, void 0, function* () {
var ColumnName = "0";
var Value = "0";
var DocPropertyId = Container.data('propertyid');
var DocPropertyName = Container.data('propertyname');
var FormPropertyId = Container.data('formpropertyid');
if (Parameters != null && Parameters != "") {
ColumnName = Parameters.map(function (item) { return item.ColumnName; }).toString();
Value = Parameters.map(function (item) { return item.Value + "|"; }).toString();
}
var userinfo = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/membership/getallusers';
var data = UserSelect2.instance.data.find(x => x.formpropertyid == FormPropertyId);
$(".select2_" + FormPropertyId).select2({
tags: true,
multiple: true,
allowClear: false,
data: UserSelect2.instance.data,
placeholder: 'Select',
ajax: {
url: function (request) {
var reqUrl = url;
var term = request.term;
if (term == undefined || term == "")
reqUrl = reqUrl + "/term/" + term + "/authtoken/" + userinfo.sessionId;
else
reqUrl = reqUrl + "/term/" + term + "/authtoken/" + userinfo.sessionId;
return reqUrl;
},
contentType: 'application/json',
type: "GET",
delay: 250,
data: function (params) {
var query = {
term: params.term,
type: 'GET'
};
return query;
},
beforeSend: function (xhr) {
if (userinfo !== undefined && userinfo !== null) {
xhr.setRequestHeader("Authorization", "Basic " + userinfo.sessionId);
xhr.setRequestHeader('geoposition', userinfo.latd + ':' + userinfo.lgId);
}
},
processResults: function (data, params) {
return {
results: jQuery.map(JSON.parse(data.result), function (item) {
return {
id: item.Value,
text: item.DisplayText
};
})
};
}
},
templateResult: function (item) { debugger; return item.text; },
templateSelection: function (item) { return item.text; },
});
});
}
loadPropertySettings(propertysettings, formpropertyid) {
return ``;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
return ``;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new UserSelect2();
}
return this.instance;
}
}
Controls.UserSelect2 = UserSelect2;
})(Controls = Collaboration.Controls || (Collaboration.Controls = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"userselect2.component.js","sourceRoot":"","sources":["userselect2.component.ts"],"names":[],"mappings":";;;;;;;;;AAGA,IAAU,OAAO,CA2HhB;AA3HD,WAAU,OAAO;IACb,IAAiB,IAAI,CAyHpB;IAzHD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAuH7B;QAvHD,WAAiB,aAAa;YAC1B,IAAiB,QAAQ,CAqHxB;YArHD,WAAiB,QAAQ;gBACrB,MAAa,WAAY,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAA5D;;wBACI,SAAI,GAAG,EAAE,CAAC;oBAkHd,CAAC;oBAhHG,IAAI,CAAC,cAAsB,EAAE,IAAgB,EAAE,QAAQ;wBACnD,IAAI,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;wBACtC,IAAI,SAAS,GAAG,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;wBACrD,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;4BACjG,IAAI,QAAQ,IAAI,IAAI;gCAChB,QAAQ,EAAE,CAAC;wBACnB,CAAC,CAAC,CAAC;oBACP,CAAC;oBACD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IAAI,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gCAC/D,iBAAiB,EAAE,UAAU,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;6BAC3D,CAAC,CAAC;wBACP,CAAC;qBAAA;oBAED,oBAAoB,CAAC,gBAA0C,EAAE,cAAsB;wBACnF,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,eAAe;wBACxD,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;yBACrC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAnHY,oBAAW,cAmHvB,CAAA;YACL,CAAC,EArHgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAqHxB;QACL,CAAC,EAvHgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAuH7B;IACL,CAAC,EAzHgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAyHpB;AACL,CAAC,EA3HS,OAAO,KAAP,OAAO,QA2HhB"}
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{constructor(){super(...arguments);this.data=[]}init(t,r,u){var e=i.Instance(),f=$(".select2_"+r.FormPropertyId);n.Apps.Collaboration.Controls.UserSelect2.Instance().loadControlSettings(f,null).then(function(){u!=null&&u()})}loadControl(n,t){var f=this,i=!1,r,u;t.ControlJsonText!=""&&t.ControlJsonText!=null&&t.ControlJsonText!=undefined&&(r=JSON.parse(t.ControlJsonText),r.IsTagSelect==!0&&(i=!0));u='<div id="div_'+t.DocPropertyName+'" class="floating-label-form-group-with-value floating-validate" style="border-bottom:0;"><label for= "lbl" id = "lbl_'+t.DocPropertyName+'" >'+t.LabelName+'<span class="text-danger hide " id="spnIsRequired_'+t.DocPropertyName+'"> *<\/span><\/label ><input type="hidden" id="hdnselect2_'+t.FormPropertyId+'" class="" value="0"><select id="select2_'+t.FormPropertyId+'" class="value-control select2_'+t.FormPropertyId+" type-control select2_"+t.DocPropertyName+' form-control text-control " multiple="multiple" data-isdynamic="'+t.IsDefault+'" data-istagselect="'+i+'" style="width:100%;" data-propdoctypename="'+t.DocTypeName+'" data-propertyid="'+t.DocPropertyId+'" data-propertyname="'+t.DocPropertyName+'" data-formpropertyid="'+t.FormPropertyId+'" data-regularexp="" data-validatemsg="" data-textformpropertyid=""><option>Select<\/option><\/select><\/div>';$("#"+n).html(u)}loadControlSettings(t,r){return __awaiter(this,void 0,void 0,function*(){var e="0",o="0",h=t.data("propertyid"),c=t.data("propertyname"),f=t.data("formpropertyid");r!=null&&r!=""&&(e=r.map(function(n){return n.ColumnName}).toString(),o=r.map(function(n){return n.Value+"|"}).toString());var u=n.Platform.Membership.Infos.Identity.getCurrentUser(),s=_appsettings.server_url()+"/apis/v4/unibase/platform/membership/getallusers",l=i.instance.data.find(n=>n.formpropertyid==f);$(".select2_"+f).select2({tags:!0,multiple:!0,allowClear:!1,data:i.instance.data,placeholder:"Select",ajax:{url:function(n){var i=s,t=n.term;return t==undefined||t==""?i+"/term/"+t+"/authtoken/"+u.sessionId:i+"/term/"+t+"/authtoken/"+u.sessionId},contentType:"application/json",type:"GET",delay:250,data:function(n){return{term:n.term,type:"GET"}},beforeSend:function(n){u!==undefined&&u!==null&&(n.setRequestHeader("Authorization","Basic "+u.sessionId),n.setRequestHeader("geoposition",u.latd+":"+u.lgId))},processResults:function(n){return{results:jQuery.map(JSON.parse(n.result),function(n){return{id:n.Value,text:n.DisplayText}})}}},templateResult:function(n){return n.text},templateSelection:function(n){return n.text}})})}loadPropertySettings(){return``}bindEditFormDetails(){return``}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.UserSelect2=i})(i=t.Controls||(t.Controls={}))})(i=t.Collaboration||(t.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,38 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Controls;
(function (Controls) {
class userselect2_settings {
loadSettingHtml() {
return ``;
}
bindControlData(controldatajson) {
return "";
}
SaveControlData(controldatajson) {
return "";
}
loadControlPropertiesHtml(Container) {
return "";
}
bindPropertySettings(prop) {
return "";
}
savePropertySettings(prop) {
return "";
}
static Instance() {
if (this._instance === undefined)
this._instance = new userselect2_settings();
return this._instance;
}
}
Controls.userselect2_settings = userselect2_settings;
})(Controls = Collaboration.Controls || (Collaboration.Controls = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
@@ -0,0 +1 @@
{"version":3,"file":"userselect2.settings.js","sourceRoot":"","sources":["userselect2.settings.ts"],"names":[],"mappings":"AAIA,IAAU,OAAO,CA0ChB;AA1CD,WAAU,OAAO;IACb,IAAiB,IAAI,CAwCpB;IAxCD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAsC7B;QAtCD,WAAiB,aAAa;YAC1B,IAAiB,QAAQ,CAoCxB;YApCD,WAAiB,QAAQ;gBACrB,MAAa,oBAAoB;oBAC7B,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAS/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,OAAO,EAAE,CAAC;oBACd,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;wBAChD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBAlCY,6BAAoB,uBAkChC,CAAA;YACL,CAAC,EApCgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAoCxB;QACL,CAAC,EAtCgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAsC7B;IACL,CAAC,EAxCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAwCpB;AACL,CAAC,EA1CS,OAAO,KAAP,OAAO,QA0ChB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return""}bindPropertySettings(){return""}savePropertySettings(){return""}static Instance(){return this._instance===undefined&&(this._instance=new t),this._instance}}n.userselect2_settings=t})(t=n.Controls||(n.Controls={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
+23
View File
@@ -0,0 +1,23 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Enums;
(function (Enums) {
let Share;
(function (Share) {
Share[Share["Viewer"] = 1] = "Viewer";
Share[Share["Editor"] = 2] = "Editor";
Share[Share["Commentor"] = 3] = "Commentor";
Share[Share["Ristrict"] = 4] = "Ristrict";
Share[Share["AnyoneWithLink"] = 5] = "AnyoneWithLink";
Share[Share["TenantId"] = 6] = "TenantId";
Share[Share["NotAllowed"] = 7] = "NotAllowed";
})(Share = Enums.Share || (Enums.Share = {}));
;
})(Enums = Collaboration.Enums || (Collaboration.Enums = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"enum.js","sourceRoot":"","sources":["enum.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAUhB;AAVD,WAAU,OAAO;IACb,IAAiB,IAAI,CAQpB;IARD,WAAiB,IAAI;QACjB,IAAiB,aAAa,CAM7B;QAND,WAAiB,aAAa;YAC1B,IAAiB,KAAK,CAIrB;YAJD,WAAiB,KAAK;gBAClB,IAAY,KAEX;gBAFD,WAAY,KAAK;oBACb,qCAAU,CAAA;oBAAE,qCAAM,CAAA;oBAAE,2CAAS,CAAA;oBAAE,yCAAQ,CAAA;oBAAE,qDAAc,CAAA;oBAAE,yCAAQ,CAAA;oBAAE,6CAAU,CAAA;gBACjF,CAAC,EAFW,KAAK,GAAL,WAAK,KAAL,WAAK,QAEhB;gBAAA,CAAC;YACN,CAAC,EAJgB,KAAK,GAAL,mBAAK,KAAL,mBAAK,QAIrB;QACL,CAAC,EANgB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAM7B;IACL,CAAC,EARgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAQpB;AACL,CAAC,EAVS,OAAO,KAAP,OAAO,QAUhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){n[n.Viewer=1]="Viewer";n[n.Editor=2]="Editor";n[n.Commentor=3]="Commentor";n[n.Ristrict=4]="Ristrict";n[n.AnyoneWithLink=5]="AnyoneWithLink";n[n.TenantId=6]="TenantId";n[n.NotAllowed=7]="NotAllowed"})(t=n.Share||(n.Share={}))})(t=n.Enums||(n.Enums={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,287 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
class DocumentManager extends Unibase.Platform.Core.BaseManager {
getDocumentFileInfo(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getdocumentfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getjsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
toJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/tojsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
spreadSheetDownload(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveWord(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/saveword';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/savespreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
ConvertDocstoPdfDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadpdffromword/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocumentBase64FileDownload(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/getebase64documentfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
importCreateSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/createnewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
importReplaceSpreadSheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/replacespreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
insertNewSpreadsheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/insertnewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
copyOfCurrentDocument(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copyspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
renameFileTitle(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/replacefiletitle';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
spellCheck(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'https://plugins.spellcheck.bizgaze.com/api/documenteditor/SpellCheck';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response !== null)
response = JSON.parse(response);
return response;
});
});
}
ssAutoSave(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/spreadsheetautosave';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
CopySheetInToExistingWorkbook(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/copysheetintoexistingworkbook/';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
CopySheetToNewSpreadsheet(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copysheettonewspreadsheet';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
lastEdit(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getversiondetails/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
rollBackFileData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/restorejsondatatofiledata/id/' + Id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
ConvertSpreadsheettoOdsDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/downloadodsfromExcel/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getPermissionLevel(fileId, uid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getpermissionlevel/id/' + fileId + "/uid/" + uid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getCustomJsonData(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getcustomjsondata/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveSheetColor(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savesheetcolor';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(JSON.parse(response.result));
return response;
});
});
}
updateSheetColorIndex(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/updatesheetindex';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(JSON.parse(response.result));
return response;
});
});
}
getRecentViews(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = '/apis/v4/collaboration/unicloud/files/getrecentviews/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getLinkInfo(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new DocumentManager();
}
return this.instance;
}
}
Collaboration.DocumentManager = DocumentManager;
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unib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,CAAC,MAAM,CAAC,CAAC;4BAClD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,eAAe,CAAC,IAAS;;wBAC3B,MAAM,GAAG,GAAG,uDAAuD,CAAC;wBACpE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;gCACxB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BAClD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,UAAU,CAAC,IAAS;;wBACtB,MAAM,GAAG,GAAG,sEAAsE,CAAC;wBAEnF,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACvE,IAAI,QAAQ,KAAK,IAAI;gCACjB,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;4BACpC,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,UAAU,CAAC,IAAS;;wBACtB,MAAM,GAAG,GAAG,2DAA2D,CAAC;wBACxE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BACvE,IAAI,QAAQ,CAAC,MAAM,KALine truncated
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseManager{getDocumentFileInfo(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/getdocumentfile/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getJsonData(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/getjsondata/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}toJsonData(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/tojsondata/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}spreadSheetDownload(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/downloadspreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}saveWord(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("/apis/v4/collaboration/unicloud/files/saveword",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}saveSpreadSheet(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("/apis/v4/collaboration/unicloud/files/savespreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}ConvertDocstoPdfDownload(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/downloadpdffromword/id/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getDocumentBase64FileDownload(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/files/getebase64documentfile/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}importCreateSpreadSheet(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/createnewspreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}importReplaceSpreadSheet(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/replacespreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}insertNewSpreadsheet(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/insertnewspreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}copyOfCurrentDocument(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/copyspreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}renameFileTitle(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/replacefiletitle",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}spellCheck(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("https://plugins.spellcheck.bizgaze.com/api/documenteditor/SpellCheck",n).then(function(n){return n!==null&&(n=JSON.parse(n)),n})})}ssAutoSave(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("/apis/v4/collaboration/unicloud/files/spreadsheetautosave",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}CopySheetInToExistingWorkbook(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("/apis/v4/collaboration/unicloud/files/copysheetintoexistingworkbook/",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}CopySheetToNewSpreadsheet(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/copysheettonewspreadsheet",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}lastEdit(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/getversiondetails/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSLine truncated
@@ -0,0 +1,368 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
class FileManager extends Unibase.Platform.Core.BaseManager {
downloadfile(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/downloadfile/DocumentFileId/' + id;
return yield this.dataHelper().getAsync(url).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
downloadfolder(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/downloadfolder/id/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deleteFILE(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/deletefiles/DocumentFileId/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deletefolder(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/deletefolder/folderid/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
debugger;
if (id == null) {
id = 0;
}
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
createnewsheet(templateid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/file/createnewfile/templateid/' + templateid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, templateid).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
movefiles(fileid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Filedid: fileid,
folderid: folderid
};
const url = 'apis/v4/collaboration/unicloud/file/movefiles/fileid/' + fileid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
movefolders(sourcefolderid, folderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/file/movefolders/sourcefolderid/' + sourcefolderid + '/folderid/' + folderid;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
GetFolderList(id) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/getfolderlist/folderId/' + id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
createfolder(Id, foldername) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Filedid: Id,
foldername: foldername
};
const url = 'apis/v4/collaboration/unicloud/folder/createfolder/folderid/' + Id + '/foldername/' + foldername;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getfileprovider(id, fileproviderid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/getFileProvider/documentfileid/' + id + '/fileproviderid/' + fileproviderid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
uploadfilesbyproviders(providerid, documentfileid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
var data = {
Providerid: providerid,
Documentfileid: documentfileid,
};
const url = 'apis/v4/collaboration/unicloud/folder/uploadfilesbyproviders/providerid/' + providerid + '/documentfileid/' + documentfileid;
debugger;
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
refreshApps() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/refreshfileproviders/np';
return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
alert(response.message);
return response;
});
});
}
getFolder(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolder/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFile(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/file/getfile/id/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
copyFile(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/copyfile';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileUrl(Id, type) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getlink/id/' + Id + '/type/' + type;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
folderDownload(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/downloadfolder/id/' + id;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFolders() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolders';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getAll(parentid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getAll/parentid/' + parentid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFiles(folderId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfolderItems/folderid/' + folderId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFilesByParent(parentId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/getfoldersbyparent/parentid/' + parentId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileByUrl(Url) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getfilebyurl/Url/' + Url;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getShareUsers(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/getshareusers/fileid/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
share(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/share';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
updatepermission(data) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/folder/saveshareusers';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
return response;
});
});
}
removeshareuser(shareuserid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/folder/removeshareuser/shareuserid/' + shareuserid;
return yield this.dataHelper().postAsync(url, shareuserid).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getUsers(userid) {
return __awaiter(this, void 0, void 0, function* () {
debugger;
const url = 'apis/v4/collaboration/unicloud/files/getshareusersbyfileid/fileid/' + userid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
savelinkpermission(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savelinkpermission/';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
getLinkInfo(fileid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
updateLink(data) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/collaboration/unicloud/files/savelinkpermission';
return yield this.dataHelper().postAsync(url, data).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getFileProvidersAutoComplete() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/files/getfileprovidersAutoComplete';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
static Instance() {
if (this.instance === undefined) {
this.instance = new FileManager();
}
return this.instance;
}
}
Collaboration.FileManager = FileManager;
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"filemanager.js","sourceRoot":"","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C,IAAI,CAAC,UAAU,QAAQ;4BAChE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;gCACxB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BAClD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBACK,gBAAgB,CAAC,QAAgB;;wBACnC,MAAM,GAAG,GAAG,oEAAoE,GAAG,QAAQ,CAAC;wBAC5F,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BAChE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;gCACxB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BAClD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC;iBAAA;gBAEK,YAAY,CAAC,GAAW;;wBAC1B,MAAM,GAAG,GAAG,wDAAwD,GAAG,GAAG,CAAC;wBAC3E,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;4BAChE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;gCACxB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BAClD,OAAO,QAAQ,CAAC;wBACpB,Line truncated
+1
View File
@@ -0,0 +1 @@
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseManager{downloadfile(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/downloadfile/DocumentFileId/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}deleteFILE(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/files/deletefiles/DocumentFileId/"+n;return yield this.dataHelper().postAsync(t,n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}deletefolder(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/folder/deletefolder/folderid/"+n;return yield this.dataHelper().postAsync(t,n).then(function(t){return n==null&&(n=0),t.result!==null&&(t.result=JSON.parse(t.result)),t})})}createnewsheet(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/collaboration/unicloud/file/createnewfile/templateid/"+n+"/folderid/"+t;return yield this.dataHelper().postAsync(i,n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}movefiles(n,t){return __awaiter(this,void 0,void 0,function*(){var i={Filedid:n,folderid:t};const r="apis/v4/collaboration/unicloud/file/movefiles/fileid/"+n+"/folderid/"+t;return yield this.dataHelper().postAsync(r,i).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}movefolders(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/collaboration/unicloud/file/movefolders/sourcefolderid/"+n+"/folderid/"+t;return yield this.dataHelper().postAsync(i,null).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}GetFolderList(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/folder/getfolderlist/folderId/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getSearchedFolders(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/collaboration/unicloud/folder/getsearchedfolders/folderName/"+n+"/folderid/"+t;return yield this.dataHelper().getAsync(i).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}createfolder(n,t){return __awaiter(this,void 0,void 0,function*(){var i={Filedid:n,foldername:t};const r="apis/v4/collaboration/unicloud/folder/createfolder/folderid/"+n+"/foldername/"+t;return yield this.dataHelper().postAsync(r,i).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}refreshApps(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/files/refreshfileproviders/np","{}").then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),alert(n.message),n})})}getFolder(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/folder/getfolder/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getFile(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/file/getfile/id/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}copyFile(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/collaboration/unicloud/files/copyfile",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getFileUrl(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/collaboration/unicloud/files/getlink/id/"+n+"/type/"+t;return yield this.dataHelper().getAsync(i).then(function(n){return n.result!==null&&(n.result=n.result),n})})}folderDownload(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/folder/downloadfolder/id/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getFolders(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().getAsync("apis/v4/collaboration/unicloud/folder/getfolders").then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getAll(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/collaboration/unicloud/folder/getAll/parentid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getFiles(n){return __awaiter(this,void 0,void 0,functioLine truncated
@@ -0,0 +1,18 @@
var Unibase;
(function (Unibase) {
let Apps;
(function (Apps) {
let Collaboration;
(function (Collaboration) {
let Requests;
(function (Requests) {
class Share {
}
Requests.Share = Share;
class ShareUsers {
}
Requests.ShareUsers = ShareUsers;
})(Requests = Collaboration.Requests || (Collaboration.Requests = {}));
})(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
})(Apps = Unibase.Apps || (Unibase.Apps = {}));
})(Unibase || (Unibase = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"share.js","sourceRoot":"","sources":["share.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CA6BhB;AA7BD,WAAU,OAAO;IACb,IAAiB,IAAI,CA2BpB;IA3BD,WAAiB,IAAI;QACjB,IAAkB,aAAa,CAyB9B;QAzBD,WAAkB,aAAa;YAC3B,IAAiB,QAAQ,CAuBxB;YAvBD,WAAiB,QAAQ;gBAGrB,MAAa,KAAK;iBAWjB;gBAXY,cAAK,QAWjB,CAAA;gBACD,MAAa,UAAU;iBAOtB;gBAPY,mBAAU,aAOtB,CAAA;YACL,CAAC,EAvBgB,QAAQ,GAAR,sBAAQ,KAAR,sBAAQ,QAuBxB;QACL,CAAC,EAzBiB,aAAa,GAAb,kBAAa,KAAb,kBAAa,QAyB9B;IACL,CAAC,EA3BgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QA2BpB;AACL,CAAC,EA7BS,OAAO,KAAP,OAAO,QA6BhB"}
+1
View File
@@ -0,0 +1 @@
var Unibase;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{}n.Share=t;class i{}n.ShareUsers=i})(t=n.Requests||(n.Requests={}))})(t=n.Collaboration||(n.Collaboration={}))})(t=n.Apps||(n.Apps={}))})(Unibase||(Unibase={}));