UNPKG

@adaptabletools/adaptable-cjs

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

45 lines (44 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.changeIsSuspendInList = changeIsSuspendInList; exports.suspendAllInList = suspendAllInList; exports.unsuspendAllInList = unsuspendAllInList; /** * 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; }); } function suspendAllInList(list) { return list.map((abObject) => { if (!abObject.IsReadOnly) { return { ...abObject, IsSuspended: true, }; } return abObject; }); } function unsuspendAllInList(list) { return list.map((abObject) => { if (!abObject.IsReadOnly) { return { ...abObject, IsSuspended: false, }; } return abObject; }); }