UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

41 lines (38 loc) 1.31 kB
/** * DevExtreme (cjs/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/ */ "use strict"; exports.normalizeBoundaryValue = normalizeBoundaryValue; exports.normalizeRowsInfo = normalizeRowsInfo; var _type = require("../../../core/utils/type"); function normalizeBoundaryValue(value) { if ((0, _type.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) })) })) }