@praxisui/core 9.0.0-beta.47 → 9.0.0-beta.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-07-08T03:07:40.937Z",
3
+ "generatedAt": "2026-07-08T13:50:56.661Z",
4
4
  "packageName": "@praxisui/core",
5
- "packageVersion": "9.0.0-beta.47",
5
+ "packageVersion": "9.0.0-beta.48",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 4,
@@ -11782,9 +11782,10 @@ function serializePraxisCollectionToJson(request) {
11782
11782
  function serializePraxisCollectionToExcel(request, policy = PRAXIS_DEFAULT_EXPORT_SECURITY_POLICY) {
11783
11783
  const fields = resolvePraxisExportFields(request);
11784
11784
  const items = applyPraxisExportLimit(resolvePraxisCollectionExportItems(request), request.maxRows);
11785
+ const typedCells = request.formatOptions?.excel?.typedCells === true;
11785
11786
  const rows = [];
11786
11787
  if (request.includeHeaders !== false) {
11787
- rows.push(fields.map((field) => escapePraxisExportCell(field.label ?? field.key, policy)));
11788
+ rows.push(fields.map((field) => createPraxisExcelCell(field.label ?? field.key, false, policy)));
11788
11789
  }
11789
11790
  for (const item of items) {
11790
11791
  rows.push(fields.map((field) => {
@@ -11794,7 +11795,7 @@ function serializePraxisCollectionToExcel(request, policy = PRAXIS_DEFAULT_EXPOR
11794
11795
  const formattedValue = request.applyFormatting !== false && field.formatter
11795
11796
  ? field.formatter(rawValue, item)
11796
11797
  : rawValue;
11797
- return escapePraxisExportCell(formattedValue, policy);
11798
+ return createPraxisExcelCell(formattedValue, typedCells, policy);
11798
11799
  }));
11799
11800
  }
11800
11801
  const sheetName = normalizePraxisExcelSheetName(request.formatOptions?.excel?.sheetName);
@@ -11907,6 +11908,10 @@ function startsWithPraxisFormula(text, formulaPrefixes) {
11907
11908
  }
11908
11909
  function buildPraxisExcelWorksheet(rows, options) {
11909
11910
  const columnWidths = options.autoFitColumns ? computePraxisExcelColumnWidths(rows) : [];
11911
+ const maxColumns = Math.max(0, ...rows.map((row) => row.length));
11912
+ const dimension = rows.length && maxColumns
11913
+ ? `<dimension ref="A1:${praxisExcelColumnName(maxColumns)}${rows.length}"/>`
11914
+ : '';
11910
11915
  const cols = columnWidths.length
11911
11916
  ? `<cols>${columnWidths.map((width, index) => `<col min="${index + 1}" max="${index + 1}" width="${width}" customWidth="1"/>`).join('')}</cols>`
11912
11917
  : '';
@@ -11914,14 +11919,15 @@ function buildPraxisExcelWorksheet(rows, options) {
11914
11919
  ? '<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>'
11915
11920
  : '';
11916
11921
  const sheetData = rows.map((row, rowIndex) => {
11917
- const cells = row.map((value, columnIndex) => {
11922
+ const cells = row.map((cell, columnIndex) => {
11918
11923
  const reference = `${praxisExcelColumnName(columnIndex + 1)}${rowIndex + 1}`;
11919
- return `<c r="${reference}" t="inlineStr"><is><t>${escapePraxisExcelXml(value)}</t></is></c>`;
11924
+ return serializePraxisExcelCell(reference, cell);
11920
11925
  }).join('');
11921
11926
  return `<row r="${rowIndex + 1}">${cells}</row>`;
11922
11927
  }).join('');
11923
11928
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>${[
11924
11929
  '<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">',
11930
+ dimension,
11925
11931
  sheetViews,
11926
11932
  cols,
11927
11933
  `<sheetData>${sheetData}</sheetData>`,
@@ -11931,13 +11937,44 @@ function buildPraxisExcelWorksheet(rows, options) {
11931
11937
  function computePraxisExcelColumnWidths(rows) {
11932
11938
  const widths = [];
11933
11939
  for (const row of rows) {
11934
- row.forEach((value, index) => {
11935
- const visualLength = Math.min(String(value ?? '').length + 2, 60);
11940
+ row.forEach((cell, index) => {
11941
+ const visualLength = Math.min(String(cell.widthValue ?? '').length + 2, 60);
11936
11942
  widths[index] = Math.max(widths[index] ?? 10, visualLength);
11937
11943
  });
11938
11944
  }
11939
11945
  return widths;
11940
11946
  }
11947
+ function createPraxisExcelCell(value, typedCells, policy) {
11948
+ if (typedCells && typeof value === 'number' && Number.isFinite(value)) {
11949
+ return {
11950
+ kind: 'number',
11951
+ value: String(value),
11952
+ widthValue: String(value),
11953
+ };
11954
+ }
11955
+ if (typedCells && typeof value === 'boolean') {
11956
+ return {
11957
+ kind: 'boolean',
11958
+ value: value ? '1' : '0',
11959
+ widthValue: value ? 'TRUE' : 'FALSE',
11960
+ };
11961
+ }
11962
+ const text = escapePraxisExportCell(value, policy);
11963
+ return {
11964
+ kind: 'string',
11965
+ value: text,
11966
+ widthValue: text,
11967
+ };
11968
+ }
11969
+ function serializePraxisExcelCell(reference, cell) {
11970
+ if (cell.kind === 'number') {
11971
+ return `<c r="${reference}"><v>${escapePraxisExcelXml(cell.value)}</v></c>`;
11972
+ }
11973
+ if (cell.kind === 'boolean') {
11974
+ return `<c r="${reference}" t="b"><v>${cell.value}</v></c>`;
11975
+ }
11976
+ return `<c r="${reference}" t="inlineStr"><is><t>${escapePraxisExcelXml(cell.value)}</t></is></c>`;
11977
+ }
11941
11978
  function normalizePraxisExcelSheetName(value) {
11942
11979
  const candidate = (value || 'Export')
11943
11980
  .replace(/[\[\]:*?/\\]/g, ' ')
@@ -11957,6 +11994,7 @@ function praxisExcelColumnName(columnNumber) {
11957
11994
  }
11958
11995
  function escapePraxisExcelXml(value) {
11959
11996
  return String(value ?? '')
11997
+ .replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, '')
11960
11998
  .replace(/&/g, '&amp;')
11961
11999
  .replace(/</g, '&lt;')
11962
12000
  .replace(/>/g, '&gt;')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/core",
3
- "version": "9.0.0-beta.47",
3
+ "version": "9.0.0-beta.48",
4
4
  "description": "Core library for Praxis UI Workspace: types, tokens, services and utilities shared across @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -2974,6 +2974,8 @@ interface GeneralExportConfig {
2974
2974
  interface ExcelExportConfig {
2975
2975
  /** Nome da planilha */
2976
2976
  sheetName: string;
2977
+ /** Exibir ação local para exportar a página atual com colunas visíveis */
2978
+ visibleCurrentPage?: boolean;
2977
2979
  /** Incluir fórmulas nas células */
2978
2980
  includeFormulas: boolean;
2979
2981
  /** Congelar linha de cabeçalho */