@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
46 lines (45 loc) • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unsuspendAllInList = exports.suspendAllInList = exports.changeIsSuspendInList = void 0;
/**
* Updates IsSuspended in a list of adaptable objects
*
* @param abObjectToChange object to suspend
* @param list list of ab objects
*/
function changeIsSuspendInList(abObjectToChange, list, IsSuspended) {
return list.map((abObject) => {
if (!abObject.IsReadOnly && abObject?.Uuid === abObjectToChange?.Uuid) {
return {
...abObject,
IsSuspended: IsSuspended,
};
}
return abObject;
});
}
exports.changeIsSuspendInList = changeIsSuspendInList;
function suspendAllInList(list) {
return list.map((abObject) => {
if (!abObject.IsReadOnly) {
return {
...abObject,
IsSuspended: true,
};
}
return abObject;
});
}
exports.suspendAllInList = suspendAllInList;
function unsuspendAllInList(list) {
return list.map((abObject) => {
if (!abObject.IsReadOnly) {
return {
...abObject,
IsSuspended: false,
};
}
return abObject;
});
}
exports.unsuspendAllInList = unsuspendAllInList;