UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

44 lines (41 loc) 1.26 kB
/** * DevExtreme (esm/__internal/exporter/jspdf/common/normalizeOptions.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 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 { normalizeBoundaryValue, normalizeRowsInfo };