dtable-sdk
Advanced tools
Comparing version 0.0.49 to 0.0.50
@@ -63,2 +63,13 @@ "use strict"; | ||
} | ||
}, { | ||
key: "getUserCommonInfo", | ||
value: function getUserCommonInfo(email, avatarSize) { | ||
var url = this.server + '/api/v2.1/user-common-info/' + email; | ||
var params = { | ||
avatar_size: avatarSize | ||
}; | ||
return this.req.get(url, { | ||
params: params | ||
}); | ||
} | ||
}]); | ||
@@ -65,0 +76,0 @@ |
@@ -26,2 +26,4 @@ "use strict"; | ||
function _readOnlyError(name) { throw new Error("\"" + name + "\" is read-only"); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -461,2 +463,7 @@ | ||
}, { | ||
key: "getUserCommonInfo", | ||
value: function getUserCommonInfo(email, avatar_size) { | ||
return this.dtableWebAPI.getUserCommonInfo(email, avatar_size); | ||
} | ||
}, { | ||
key: "addTable", | ||
@@ -525,10 +532,12 @@ value: function addTable(tableName) { | ||
key: "addRow", | ||
value: function addRow(tableName) { | ||
var tables = this.getTables(); | ||
var tableIndex = tables.findIndex(function (table) { | ||
return table.name === tableName; | ||
}); | ||
var rows = tables[tableIndex].rows; | ||
var rowId = rows[rows.length - 1]._id; | ||
this.dtableStore.insertRow(tableIndex, rowId, 'insert_below', undefined); | ||
value: function addRow(tableName, rowData) { | ||
var viewName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
var table = this.getTableByName(tableName); | ||
var view = null; | ||
if (viewName) { | ||
view = (_readOnlyError("view"), this.getViewByName(table, viewName)); | ||
} | ||
this.appendRow(table, rowData, view); | ||
} | ||
@@ -541,30 +550,2 @@ }, { | ||
} | ||
}, { | ||
key: "moveColumn", | ||
value: function moveColumn(selectedTable, source, target) { | ||
var tables = this.getTables(); | ||
var selectedTableIdx = tables.findIndex(function (table) { | ||
return table._id === selectedTable._id; | ||
}); | ||
if (selectedTableIdx === -1) return; | ||
var columns = selectedTable.columns; | ||
var sourceIndex = columns.findIndex(function (column) { | ||
return column.name === source; | ||
}); | ||
var targetIndex = columns.findIndex(function (column) { | ||
return column.name === target; | ||
}); | ||
var sourceColumn = columns[sourceIndex]; | ||
var targetColumn = columns[targetIndex]; | ||
var upper_column_key = sourceIndex === 0 ? null : columns[sourceIndex - 1].key; | ||
var move_position; | ||
if (sourceIndex > targetIndex) { | ||
move_position = 'move_left'; | ||
} else { | ||
move_position = 'move_right'; | ||
} | ||
this.dtableStore.moveColumn(selectedTableIdx, move_position, sourceColumn.key, targetColumn.key, upper_column_key); | ||
} | ||
}]); | ||
@@ -571,0 +552,0 @@ |
{ | ||
"name": "dtable-sdk", | ||
"version": "0.0.49", | ||
"version": "0.0.50", | ||
"description": "dtable sdk", | ||
@@ -5,0 +5,0 @@ "main": "./dist/dtable.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
382440
9536