devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
44 lines (41 loc) • 1.25 kB
JavaScript
/**
* DevExtreme (esm/exporter/jspdf/common/normalizeOptions.js)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
isNumeric
} from "../../../core/utils/type";
function normalizeBoundaryValue(value) {
if (isNumeric(value)) {
return {
top: value,
right: value,
bottom: value,
left: value
}
}
return {
top: (null === value || void 0 === value ? void 0 : value.top) ?? 0,
right: (null === value || void 0 === value ? void 0 : value.right) ?? 0,
bottom: (null === value || void 0 === value ? void 0 : value.bottom) ?? 0,
left: (null === value || void 0 === value ? void 0 : value.left) ?? 0
}
}
function normalizeRowsInfo(rowsInfo) {
rowsInfo.forEach((row => {
row.cells.forEach((_ref => {
let {
pdfCell: pdfCell
} = _ref;
pdfCell.padding = normalizeBoundaryValue(pdfCell.padding)
}))
}))
}
export {
normalizeRowsInfo,
normalizeBoundaryValue
};