@motifx-community/ui 0.1.0-beta.17 → 0.1.0-beta.19
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.
- package/CHANGELOG.md +57 -0
- package/dist/components/datagrid/DataGrid.d.ts +2 -1
- package/dist/components/datagrid/grid-column.d.ts +6 -0
- package/dist/components/datagrid/model/ColumnModel.d.ts +2 -0
- package/dist/components/datagrid/model/GridModel.d.ts +4 -0
- package/dist/components/datagrid/view/ColumnStyles.d.ts +7 -3
- package/dist/components/datagrid/view/GridBody.d.ts +56 -4
- package/dist/components/form/MxForm.d.ts +3 -0
- package/dist/components/form/form-props.d.ts +7 -0
- package/dist/components/formlayout/FormLayout.d.ts +21 -6
- package/dist/components/formlayout/form-item.d.ts +4 -3
- package/dist/components/formlayout/form-layout-props.d.ts +9 -5
- package/dist/components/formlayout/form-tab.d.ts +2 -1
- package/dist/components/layout/DockPanel.d.ts +16 -6
- package/dist/components/layout/Grid.d.ts +35 -25
- package/dist/components/layout/GroupBox.d.ts +14 -4
- package/dist/components/layout/Panel.d.ts +12 -2
- package/dist/components/layout/SplitContainer.d.ts +12 -2
- package/dist/components/layout/Stack.d.ts +29 -17
- package/dist/components/layout/dock-child-props.d.ts +7 -6
- package/dist/components/layout/dock-panel-props.d.ts +3 -2
- package/dist/components/layout/grid-cell.d.ts +7 -5
- package/dist/components/layout/grid-props.d.ts +17 -12
- package/dist/components/layout/group-box-props.d.ts +3 -2
- package/dist/components/layout/panel-props.d.ts +2 -1
- package/dist/components/layout/split-container-props.d.ts +2 -1
- package/dist/components/layout/stack-child-props.d.ts +3 -2
- package/dist/components/layout/stack-props.d.ts +8 -7
- package/dist/components/tabs/Tab.d.ts +6 -0
- package/dist/components/tabs/Tabs.d.ts +5 -0
- package/dist/components/tabs/tab-props.d.ts +7 -1
- package/dist/components/tabs/tabs-props.d.ts +6 -0
- package/dist/core/responsive.d.ts +52 -0
- package/dist/excel/index.js +1 -1
- package/dist/excel/index.js.map +1 -1
- package/dist/generated/tokens.d.ts +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +836 -126
- package/dist/index.js.map +1 -1
- package/dist/parts/table/RowHeights.d.ts +23 -0
- package/dist/parts/table/ScrollGeometry.d.ts +6 -1
- package/dist/parts/table/table-sheet-column.d.ts +2 -0
- package/dist/pdf/index.js +1 -1
- package/dist/pdf/index.js.map +1 -1
- package/dist/pdf/pdf-export-options.d.ts +4 -1
- package/dist/styles.css +93 -5
- package/dist/tokens/index.d.ts +40 -0
- package/dist/tokens/index.js +20 -0
- package/dist/tokens/index.js.map +1 -1
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +1 -1
- package/docs/appmenu-api.md +1 -1
- package/docs/appmenu-programmatic.md +1 -1
- package/docs/appmenu-search.md +1 -1
- package/docs/appmenu.md +1 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +1 -1
- package/docs/bar-gauge-data.md +1 -1
- package/docs/bar-gauge-labels.md +1 -1
- package/docs/bar-gauge.md +1 -1
- package/docs/barcode.md +1 -1
- package/docs/bottomnavigation.md +1 -1
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +1 -1
- package/docs/chart-candles.md +1 -1
- package/docs/chart-funnel.md +1 -1
- package/docs/chart-heatmap.md +1 -1
- package/docs/chart-lines.md +1 -1
- package/docs/chart-live.md +1 -1
- package/docs/chart-pie.md +1 -1
- package/docs/chart-radar.md +1 -1
- package/docs/chart-ranges.md +1 -1
- package/docs/chart-references.md +1 -1
- package/docs/chart-scatter.md +1 -1
- package/docs/chart-waterfall.md +1 -1
- package/docs/chart-zoom.md +1 -1
- package/docs/chart.md +1 -1
- package/docs/chat.md +1 -1
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +1 -1
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/commands.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +1 -1
- package/docs/datagrid-api.md +3 -2
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +1 -1
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +1 -1
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +77 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/diagram-api.md +1 -1
- package/docs/diagram-commands.md +1 -1
- package/docs/diagram-connections.md +1 -1
- package/docs/diagram-custom-nodes.md +1 -1
- package/docs/diagram-designer.md +1 -1
- package/docs/diagram-editing.md +1 -1
- package/docs/diagram-flow.md +1 -1
- package/docs/diagram-keyboard.md +1 -1
- package/docs/diagram-layout.md +1 -1
- package/docs/diagram-nodes.md +1 -1
- package/docs/diagram-tables.md +1 -1
- package/docs/diagram.md +1 -1
- package/docs/display.md +1 -1
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +1 -1
- package/docs/expressioneditor.md +1 -1
- package/docs/expressions.md +1 -1
- package/docs/feedback.md +1 -1
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout-schema.md +1 -1
- package/docs/formlayout.md +52 -6
- package/docs/foundations.md +1 -1
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +1 -1
- package/docs/gauge-circular.md +1 -1
- package/docs/gauge-dashboards.md +1 -1
- package/docs/gauge-linear.md +1 -1
- package/docs/gauge-markers.md +1 -1
- package/docs/gauge-marks.md +1 -1
- package/docs/gauge-ranges.md +1 -1
- package/docs/gauge-scales.md +1 -1
- package/docs/gauge.md +1 -1
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +101 -28
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/markdown.md +1 -1
- package/docs/menus-api.md +1 -1
- package/docs/menus-context.md +1 -1
- package/docs/menus-customization.md +1 -1
- package/docs/menus-merging.md +1 -1
- package/docs/menus-programmatic.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +1 -1
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +1 -1
- package/docs/pagination.md +1 -1
- package/docs/pivotgrid-api.md +1 -1
- package/docs/pivotgrid-chart.md +1 -1
- package/docs/pivotgrid-drilldown.md +1 -1
- package/docs/pivotgrid-export.md +1 -1
- package/docs/pivotgrid-fields.md +1 -1
- package/docs/pivotgrid-keyboard.md +1 -1
- package/docs/pivotgrid-layout.md +1 -1
- package/docs/pivotgrid-panel.md +1 -1
- package/docs/pivotgrid-remote.md +1 -1
- package/docs/pivotgrid-sorting.md +1 -1
- package/docs/pivotgrid-state.md +1 -1
- package/docs/pivotgrid-summaries.md +1 -1
- package/docs/pivotgrid.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +1 -1
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/ribbonmenu-api.md +1 -1
- package/docs/ribbonmenu-commands.md +1 -1
- package/docs/ribbonmenu-customization.md +1 -1
- package/docs/ribbonmenu-display.md +1 -1
- package/docs/ribbonmenu-layouts.md +1 -1
- package/docs/ribbonmenu-programmatic.md +1 -1
- package/docs/ribbonmenu.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/shortcuteditor.md +1 -1
- package/docs/showcase-flowstudio.md +1 -1
- package/docs/showcase-home.md +1 -1
- package/docs/showcase-mail.md +1 -1
- package/docs/showcase.md +1 -1
- package/docs/signature.md +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +1 -1
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +58 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +9 -1
- package/docs/toolbar-api.md +1 -1
- package/docs/toolbar-customization.md +1 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +2 -2
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +45 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +530 -225
- package/llms.txt +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much taller than the others some rows are (a column that wraps its text), by position among the rows laid out. A
|
|
3
|
+
* row not measured yet counts as tall as every row. The sums before a position are kept in a Fenwick tree, so a row's
|
|
4
|
+
* offset is found in a few steps however many rows there are, and a new measurement changes one entry only.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RowHeights {
|
|
7
|
+
readonly size: number;
|
|
8
|
+
private readonly added;
|
|
9
|
+
private readonly summed;
|
|
10
|
+
private taller;
|
|
11
|
+
private sum;
|
|
12
|
+
constructor(size: number);
|
|
13
|
+
/** Whether any row is taller than the others. */
|
|
14
|
+
get any(): boolean;
|
|
15
|
+
/** What every row adds, together. */
|
|
16
|
+
get total(): number;
|
|
17
|
+
/** Gives a position what it adds to the height every row has (0: as tall as the others). Returns whether it changed. */
|
|
18
|
+
set(position: number, added: number): boolean;
|
|
19
|
+
/** What a position adds (0 out of range). */
|
|
20
|
+
addedAt(position: number): number;
|
|
21
|
+
/** What the positions before `position` add. */
|
|
22
|
+
before(position: number): number;
|
|
23
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtraHeights } from './ExtraHeights';
|
|
2
|
+
import type { RowHeights } from './RowHeights';
|
|
2
3
|
/**
|
|
3
4
|
* Scroll geometry of the virtual body. Browsers cap the height of an element (Firefox at about 17.9
|
|
4
5
|
* million pixels), so when the rows would be taller than `max` the spacer stays at that height and the
|
|
@@ -26,6 +27,8 @@ export declare class ScrollGeometry {
|
|
|
26
27
|
} | null;
|
|
27
28
|
/** Room after the last row (the loading indicator of infinite mode). */
|
|
28
29
|
readonly tail: number;
|
|
30
|
+
/** What rows taller than the others add, by position (a column that wraps its text). */
|
|
31
|
+
readonly rows: RowHeights | null;
|
|
29
32
|
/** Spacer height above which scrolling is scaled; well under every browser's limit. */
|
|
30
33
|
static readonly MAX_HEIGHT = 10000000;
|
|
31
34
|
constructor(
|
|
@@ -46,7 +49,9 @@ export declare class ScrollGeometry {
|
|
|
46
49
|
height: number;
|
|
47
50
|
} | null,
|
|
48
51
|
/** Room after the last row (the loading indicator of infinite mode). */
|
|
49
|
-
tail?: number
|
|
52
|
+
tail?: number,
|
|
53
|
+
/** What rows taller than the others add, by position (a column that wraps its text). */
|
|
54
|
+
rows?: RowHeights | null);
|
|
50
55
|
/** Height of all rows, and the room after them. */
|
|
51
56
|
get contentHeight(): number;
|
|
52
57
|
/** Top of row `index` in the full content. */
|
|
@@ -4,6 +4,8 @@ export interface TableSheetColumn {
|
|
|
4
4
|
/** The column's width on screen, in pixels. */
|
|
5
5
|
readonly width: number;
|
|
6
6
|
readonly align: 'start' | 'center' | 'end';
|
|
7
|
+
/** The text of its cells wraps onto more lines (a grid column's `wrap`). */
|
|
8
|
+
readonly wrap?: boolean;
|
|
7
9
|
/** The `Intl` options of its numbers, or `undefined` for a non-number column or a `format` function. */
|
|
8
10
|
readonly numberFormat?: Intl.NumberFormatOptions;
|
|
9
11
|
/** The `Intl` options of its dates, or `undefined` for a non-date column or a `format` function. */
|
package/dist/pdf/index.js
CHANGED
|
@@ -238,7 +238,7 @@ var PdfTable = class PdfTable {
|
|
|
238
238
|
bottom: pad,
|
|
239
239
|
left: pad
|
|
240
240
|
},
|
|
241
|
-
wordWrapEnabled: this.options.wordWrapEnabled ??
|
|
241
|
+
wordWrapEnabled: this.options.wordWrapEnabled ?? (rowType === "data" && !!col?.wrap)
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
/** The height of row `r`: its tallest cell of one row, then what `onRowExporting` makes of it. */
|
package/dist/pdf/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PdfExportOptions","PdfExportResult","PdfTable","exportDataGrid","options","T","Promise","reject","TypeError","component","jsPDFDocument","doc","exportSheet","text","internal","format","selectedRowsOnly","headers","groups","summaries","pageSize","onProgress","signal","loadPanel","sheet","customizeCell","customDrawCell","cell","pdfCell","gridCell","e","args","rect","cancel","draw","PdfExportResult","PdfPivotExportOptions","PdfTable","INDENT","exportPivotGrid","options","T","Promise","reject","TypeError","component","jsPDFDocument","doc","exportSheet","chartData","text","internal","format","headers","onProgress","signal","loadPanel","sheet","customizeCell","customDrawCell","indent","scaleFactor","splitColumns","cell","pdfCell","pivotCell","e","args","rect","cancel","draw"],"sources":["../../src/pdf/pdf-table.ts","../../src/pdf/export-data-grid.ts","../../src/pdf/export-pivot-grid.ts"],"sourcesContent":["import type { jsPDF } from 'jspdf';\r\nimport { sliceSheet } from '../parts/table/slice-sheet';\r\nimport type { TableSheet } from '../parts/table/table-sheet';\r\nimport type { TableSheetCell } from '../parts/table/table-sheet-cell';\r\nimport type { TableSheetRow } from '../parts/table/table-sheet-row';\r\nimport type { PdfCell } from './pdf-cell';\r\nimport type { PdfExportOptions } from './pdf-export-options';\r\nimport type { PdfExportResult } from './pdf-export-result';\r\n\r\n/** Points in a CSS pixel. */\r\nconst PX = 0.75;\r\nconst ELLIPSIS = '…';\r\n\r\ntype RowType = TableSheetRow['rowType'];\r\n\r\n/** A cell where it is drawn from, and how many columns and rows it covers; `null` for one another covers. */\r\ntype Placed<C> = { cell: PdfCell; source: C; columns: number; rows: number } | null;\r\n\r\n/** What the table reads of an export's options; its hooks get the sheet's own cells. */\r\nexport type PdfTableOptions<C> = Pick<PdfExportOptions, 'jsPDFDocument' | 'topLeft' | 'columnWidths' | 'margin' | 'indent' | 'repeatHeaders' | 'onRowExporting' | 'fitColumns' | 'wordWrapEnabled' | 'fontSize'> & {\r\n /**\r\n * Where the columns are wider than the page, draws those that fit, then the others on the next pages, each time after\r\n * the sheet's header columns again; a part across is drawn down all its pages before the next one.\r\n */\r\n splitColumns?: boolean;\r\n /** Called for every cell, before the rows are measured. */\r\n customizeCell?: (cell: C, pdfCell: PdfCell) => void;\r\n /** Called before a cell is drawn; `cancel` leaves its background and text to the hook. */\r\n customDrawCell?: (e: { readonly doc: jsPDF; readonly rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number }; readonly cell: C; readonly pdfCell: PdfCell; cancel: boolean }) => void;\r\n};\r\n\r\n/**\r\n * Draws a sheet on a jsPDF document as a table, with jsPDF's own drawing calls only: the\r\n * header rows (bands over their columns), the group rows across the row, the data rows with the\r\n * grid's text and alignment, the group footers and the totals. Rows that do not fit go on to the\r\n * next page, under the header rows again (`repeatHeaders`); with `splitColumns`, columns that do not\r\n * fit go on to the next pages, after the header columns again. Right to left, the columns run from the\r\n * right edge.\r\n */\r\nexport class PdfTable<C extends TableSheetCell> {\r\n private readonly doc: jsPDF;\r\n /** Points per unit of the document. */\r\n private readonly unit: number;\r\n private readonly rtl: boolean;\r\n private readonly lines = new WeakMap<PdfCell, string[]>();\r\n\r\n constructor(\r\n private readonly sheet: TableSheet<C>,\r\n private readonly options: PdfTableOptions<C>,\r\n ) {\r\n this.doc = options.jsPDFDocument;\r\n this.unit = this.doc.internal.scaleFactor || 1;\r\n this.rtl = sheet.rtl;\r\n }\r\n\r\n draw(): PdfExportResult {\r\n const { doc, sheet, options } = this;\r\n const parts = options.splitColumns ? this.bands() : [];\r\n if (parts.length > 1) {\r\n let result: PdfExportResult = { page: doc.getCurrentPageInfo().pageNumber, y: 0 };\r\n const side = sheet.headerColumns ?? 0;\r\n parts.forEach(([from, to], i) => {\r\n if (i > 0) doc.addPage();\r\n const given = options.columnWidths;\r\n const columnWidths = given && [...given.slice(0, side), ...given.slice(from, to)];\r\n const part = sliceSheet<C, TableSheet<C>>(sheet, sheet.headerRows, sheet.rows.length, from, to);\r\n // The parts after the first start at the top of their page.\r\n const topLeft = i > 0 ? { x: options.topLeft?.x, y: 0 } : options.topLeft;\r\n result = new PdfTable(part, { ...options, splitColumns: false, columnWidths, topLeft, fitColumns: 'shrink' }).draw();\r\n });\r\n return result;\r\n }\r\n const saved = { font: doc.getFont(), size: doc.getFontSize(), text: doc.getTextColor(), draw: doc.getDrawColor(), fill: doc.getFillColor(), line: doc.getLineWidth() };\r\n try {\r\n const pageWidth = doc.internal.pageSize.getWidth();\r\n const pageHeight = doc.internal.pageSize.getHeight();\r\n const margin = this.margin();\r\n const start = (this.rtl ? margin.right : margin.left) + (options.topLeft?.x ?? 0);\r\n const widths = this.widths(Math.max(0, pageWidth - margin.left - margin.right - (options.topLeft?.x ?? 0)));\r\n const offsets: number[] = [];\r\n widths.reduce((x, w, j) => ((offsets[j] = x), x + w), start);\r\n const grid = this.place();\r\n const heights = sheet.rows.map((_, r) => this.rowHeight(grid, r, widths));\r\n const head = sheet.headerRows;\r\n const headHeight = heights.slice(0, head).reduce((a, h) => a + h, 0);\r\n\r\n const drawRow = (r: number, y: number) => {\r\n grid[r].forEach((placed, j) => {\r\n if (!placed) return;\r\n const w = this.spanWidth(r, j, placed, widths);\r\n const x = offsets[j] + this.indentOf(r, j, placed, widths);\r\n let h = 0;\r\n for (let k = r; k < r + placed.rows && k < heights.length; k++) h += heights[k];\r\n this.drawCell(placed, this.rtl ? pageWidth - x - w : x, y, w, h);\r\n });\r\n };\r\n\r\n let y = margin.top + (options.topLeft?.y ?? 0);\r\n for (let r = 0; r < head; r++) {\r\n drawRow(r, y);\r\n y += heights[r];\r\n }\r\n // Rows that do not fit go on to the next page; one taller than a page stays where it starts.\r\n let onPage = 0;\r\n for (let r = head; r < sheet.rows.length; r++) {\r\n if (y + heights[r] > pageHeight - margin.bottom && onPage > 0) {\r\n doc.addPage();\r\n y = margin.top;\r\n onPage = 0;\r\n if (options.repeatHeaders !== false && head > 0) {\r\n for (let k = 0; k < head; k++) {\r\n drawRow(k, y);\r\n y += heights[k];\r\n }\r\n }\r\n }\r\n drawRow(r, y);\r\n y += heights[r];\r\n onPage++;\r\n }\r\n if (!sheet.rows.length) y += headHeight;\r\n return { page: doc.getCurrentPageInfo().pageNumber, y };\r\n } finally {\r\n doc.setFont(saved.font.fontName, saved.font.fontStyle);\r\n doc.setFontSize(saved.size);\r\n doc.setTextColor(saved.text);\r\n doc.setDrawColor(saved.draw);\r\n doc.setFillColor(saved.fill);\r\n doc.setLineWidth(saved.line);\r\n }\r\n }\r\n\r\n /** Points in the document's units. */\r\n private pt(value: number): number {\r\n return value / this.unit;\r\n }\r\n\r\n private margin(): { top: number; right: number; bottom: number; left: number } {\r\n const given = this.options.margin;\r\n const all = this.pt(40);\r\n if (typeof given === 'number') return { top: given, right: given, bottom: given, left: given };\r\n return { top: given?.top ?? all, right: given?.right ?? all, bottom: given?.bottom ?? all, left: given?.left ?? all };\r\n }\r\n\r\n /**\r\n * The columns of each part across a table wider than the page, from and up to: as many after the header columns as\r\n * fit beside them at their own widths, one at least.\r\n */\r\n private bands(): [number, number][] {\r\n const { doc, sheet, options } = this;\r\n const side = sheet.headerColumns ?? 0;\r\n const margin = this.margin();\r\n const room = Math.max(0, doc.internal.pageSize.getWidth() - margin.left - margin.right - (options.topLeft?.x ?? 0));\r\n const widths = sheet.columns.map((c, j) => options.columnWidths?.[j] ?? this.pt(Math.max(0, c.width) * PX));\r\n const fixed = widths.slice(0, side).reduce((a, w) => a + w, 0);\r\n const out: [number, number][] = [];\r\n let from = side;\r\n let used = fixed;\r\n for (let j = side; j < widths.length; j++) {\r\n if (j > from && used + widths[j] > room) {\r\n out.push([from, j]);\r\n from = j;\r\n used = fixed;\r\n }\r\n used += widths[j];\r\n }\r\n if (from < widths.length || !out.length) out.push([from, widths.length]);\r\n return out;\r\n }\r\n\r\n /** The columns' widths: the ones given, else the grid's, made to fit `room` as `fitColumns` says. */\r\n private widths(room: number): number[] {\r\n const { sheet, options } = this;\r\n const grid = sheet.columns.map((c) => this.pt(Math.max(0, c.width) * PX));\r\n if (options.columnWidths) return grid.map((w, j) => options.columnWidths![j] ?? w);\r\n const total = grid.reduce((a, w) => a + w, 0);\r\n const fit = options.fitColumns ?? 'shrink';\r\n if (fit === 'none' || total <= 0 || (fit === 'shrink' && total <= room)) return grid;\r\n return grid.map((w) => (w * room) / total);\r\n }\r\n\r\n /**\r\n * The cells as they are drawn: header cells merged as the sheet says (a band over its columns, a\r\n * column down the band rows), a group row's text across the empty cells after it; each one told\r\n * to `customizeCell`.\r\n */\r\n private place(): Placed<C>[][] {\r\n const { sheet, options } = this;\r\n const out: Placed<C>[][] = sheet.rows.map((row) =>\r\n row.cells.map((c, j) => ({ cell: this.baseCell(row.rowType, j, c.text, !!c.strong), source: c, columns: 1, rows: 1 })),\r\n );\r\n for (const m of sheet.merges) {\r\n const origin = out[m.row]?.[m.column];\r\n if (!origin) continue;\r\n origin.columns = m.columns;\r\n origin.rows = m.rows;\r\n for (let r = m.row; r < m.row + m.rows; r++) for (let j = m.column; j < m.column + m.columns; j++) if (r !== m.row || j !== m.column) out[r][j] = null;\r\n }\r\n sheet.rows.forEach((row, r) => {\r\n if (row.rowType !== 'group' || !out[r][0]) return;\r\n let span = 1;\r\n while (span < row.cells.length && row.cells[span].value === null && !row.cells[span].text) out[r][span++] = null;\r\n out[r][0]!.columns = span;\r\n });\r\n if (options.customizeCell) for (const row of out) for (const placed of row) if (placed) options.customizeCell(placed.source, placed.cell);\r\n return out;\r\n }\r\n\r\n /** A cell's look before `customizeCell`: the row type's font and colors (bold for a total's cell), the column's alignment. */\r\n private baseCell(rowType: RowType, j: number, text: string, strong: boolean): PdfCell {\r\n const doc = this.doc;\r\n const col = this.sheet.columns[j];\r\n const align = rowType === 'group' && j === 0 ? 'start' : (col?.align ?? 'start');\r\n const side = (end: boolean) => (end !== this.rtl ? 'right' : 'left');\r\n const pad = this.pt(5);\r\n return {\r\n text,\r\n font: { size: this.options.fontSize ?? 10, name: doc.getFont().fontName, style: (rowType === 'data' && !strong) || rowType === 'header' ? 'normal' : 'bold' },\r\n textColor: rowType === 'header' ? '#979797' : '#000000',\r\n borderColor: '#979797',\r\n borderWidth: this.pt(0.5),\r\n drawLeftBorder: true,\r\n drawRightBorder: true,\r\n drawTopBorder: true,\r\n drawBottomBorder: true,\r\n horizontalAlign: align === 'center' ? 'center' : side(align === 'end'),\r\n verticalAlign: 'middle',\r\n padding: { top: pad, right: pad, bottom: pad, left: pad },\r\n wordWrapEnabled: this.options.wordWrapEnabled ?? false,\r\n };\r\n }\r\n\r\n /** The height of row `r`: its tallest cell of one row, then what `onRowExporting` makes of it. */\r\n private rowHeight(grid: Placed<C>[][], r: number, widths: readonly number[]): number {\r\n const cells: PdfCell[] = [];\r\n let need = 0;\r\n grid[r].forEach((placed, j) => {\r\n if (!placed) return;\r\n cells.push(placed.cell);\r\n const lines = this.textLines(placed.cell, this.spanWidth(r, j, placed, widths));\r\n if (placed.rows === 1) need = Math.max(need, lines.length * this.lineHeight(placed.cell) + placed.cell.padding.top + placed.cell.padding.bottom);\r\n });\r\n if (!this.options.onRowExporting) return need;\r\n const e = { rowCells: cells, rowHeight: need };\r\n this.options.onRowExporting(e);\r\n return Math.max(need, Number(e.rowHeight) || 0);\r\n }\r\n\r\n /** How far the first cell of row `r` sits in: `indent` per group level, never past the cell. */\r\n private indentOf(r: number, j: number, placed: NonNullable<Placed<C>>, widths: readonly number[]): number {\r\n const row = this.sheet.rows[r];\r\n const indent = Math.max(0, this.options.indent ?? 0);\r\n if (j !== 0 || !indent || row.rowType === 'header' || !row.level) return 0;\r\n let w = 0;\r\n for (let k = 0; k < placed.columns && k < widths.length; k++) w += widths[k];\r\n return Math.min(w, indent * row.level);\r\n }\r\n\r\n /** The width a cell covers, less its indent. */\r\n private spanWidth(r: number, j: number, placed: NonNullable<Placed<C>>, widths: readonly number[]): number {\r\n let w = 0;\r\n for (let k = j; k < j + placed.columns && k < widths.length; k++) w += widths[k];\r\n return w - this.indentOf(r, j, placed, widths);\r\n }\r\n\r\n /** The lines of a cell's text at width `w`: wrapped, or each cut to fit with \"…\". */\r\n private textLines(cell: PdfCell, w: number): string[] {\r\n const doc = this.doc;\r\n this.useFont(cell);\r\n const room = Math.max(0, w - cell.padding.left - cell.padding.right);\r\n const out: string[] = [];\r\n for (const part of String(cell.text ?? '').split('\\n')) {\r\n if (cell.wordWrapEnabled && part) out.push(...(doc.splitTextToSize(part, room) as string[]));\r\n else out.push(this.cut(part, room));\r\n }\r\n this.lines.set(cell, out);\r\n return out;\r\n }\r\n\r\n /** The text, or as much of it as fits in `room` with \"…\" after it. */\r\n private cut(text: string, room: number): string {\r\n const doc = this.doc;\r\n if (!text || doc.getTextWidth(text) <= room) return text;\r\n let lo = 0;\r\n let hi = text.length;\r\n while (lo < hi) {\r\n const mid = Math.ceil((lo + hi) / 2);\r\n if (doc.getTextWidth(text.slice(0, mid) + ELLIPSIS) <= room) lo = mid;\r\n else hi = mid - 1;\r\n }\r\n return lo ? text.slice(0, lo).trimEnd() + ELLIPSIS : '';\r\n }\r\n\r\n private lineHeight(cell: PdfCell): number {\r\n return this.pt(cell.font.size * this.doc.getLineHeightFactor());\r\n }\r\n\r\n /** The cell's font, or the plain style of it when the document has no such style (a font added with only one). */\r\n private useFont(cell: PdfCell) {\r\n const doc = this.doc;\r\n const name = cell.font.name ?? doc.getFont().fontName;\r\n const styles = doc.getFontList()[name];\r\n const style = cell.font.style ?? 'normal';\r\n doc.setFont(name, !styles || styles.includes(style) ? style : (styles[0] ?? 'normal'));\r\n doc.setFontSize(cell.font.size);\r\n }\r\n\r\n private drawCell(placed: NonNullable<Placed<C>>, x: number, y: number, w: number, h: number) {\r\n const { doc, options } = this;\r\n const { cell, source } = placed;\r\n const rect = { x, y, w, h };\r\n const e = { doc, rect, cell: source, pdfCell: cell, cancel: false };\r\n options.customDrawCell?.(e);\r\n if (!e.cancel) {\r\n if (cell.backgroundColor) {\r\n doc.setFillColor(cell.backgroundColor);\r\n doc.rect(x, y, w, h, 'F');\r\n }\r\n this.drawText(cell, rect);\r\n }\r\n if (cell.borderWidth > 0) {\r\n doc.setDrawColor(cell.borderColor);\r\n doc.setLineWidth(cell.borderWidth);\r\n if (cell.drawTopBorder) doc.line(x, y, x + w, y);\r\n if (cell.drawBottomBorder) doc.line(x, y + h, x + w, y + h);\r\n if (cell.drawLeftBorder) doc.line(x, y, x, y + h);\r\n if (cell.drawRightBorder) doc.line(x + w, y, x + w, y + h);\r\n }\r\n }\r\n\r\n private drawText(cell: PdfCell, rect: { x: number; y: number; w: number; h: number }) {\r\n const doc = this.doc;\r\n const lines = this.lines.get(cell) ?? this.textLines(cell, rect.w);\r\n if (!lines.some((l) => l)) return;\r\n this.useFont(cell);\r\n doc.setTextColor(cell.textColor);\r\n const height = lines.length * this.lineHeight(cell);\r\n const { padding } = cell;\r\n const y = cell.verticalAlign === 'top' ? rect.y + padding.top : cell.verticalAlign === 'bottom' ? rect.y + rect.h - padding.bottom - height : rect.y + (rect.h - height) / 2;\r\n const x = cell.horizontalAlign === 'right' ? rect.x + rect.w - padding.right : cell.horizontalAlign === 'center' ? rect.x + rect.w / 2 : rect.x + padding.left;\r\n doc.text(lines, x, y, { align: cell.horizontalAlign, baseline: 'top', lineHeightFactor: doc.getLineHeightFactor() });\r\n }\r\n}\r\n","import type { PdfExportOptions } from './pdf-export-options';\r\nimport type { PdfExportResult } from './pdf-export-result';\r\nimport { PdfTable } from './pdf-table';\r\n\r\n/**\r\n * Draws a DataGrid on a jsPDF document as a table: the header rows (bands merged over their columns),\r\n * the rows in the grid's order with its filter, search and grouping (every matching row, loaded in\r\n * parts from a server), the group rows, the group footers and the totals, with the grid's text and\r\n * alignment. Columns take the grid's widths, narrowed to fit the page, and rows that do not fit continue\r\n * on the next page under repeated header rows. Only jsPDF itself is used, with no table plugin. Provide\r\n * your own jsPDF: create the document, then save it when the promise resolves.\r\n *\r\n * jsPDF's built-in fonts write Latin-1 text only. For other letters (ş, ğ, İ, Cyrillic, Greek…), add a\r\n * TrueType font that has them (`doc.addFileToVFS`, `doc.addFont`) and select it first with `doc.setFont`.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'pdf') return;\r\n * const doc = new jsPDF();\r\n * exportDataGrid({ jsPDFDocument: doc, component: e.component, selectedRowsOnly: e.selectedRowsOnly })\r\n * .then(() => doc.save('Orders.pdf'));\r\n * }}\r\n */\r\nexport function exportDataGrid<T = any>(options: PdfExportOptions<T>): Promise<PdfExportResult> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportDataGrid needs an options object.'));\r\n const { component, jsPDFDocument: doc } = options;\r\n if (!component || typeof component.exportSheet !== 'function') return Promise.reject(new TypeError('exportDataGrid: `component` must be a DataGrid.'));\r\n if (!doc || typeof doc.text !== 'function' || !doc.internal) return Promise.reject(new TypeError('exportDataGrid: `jsPDFDocument` must be a jsPDF document.'));\r\n return component.exportSheet(\r\n {\r\n format: 'pdf',\r\n selectedRowsOnly: options.selectedRowsOnly,\r\n headers: options.headers,\r\n groups: options.groups,\r\n summaries: options.summaries,\r\n pageSize: options.pageSize,\r\n onProgress: options.onProgress,\r\n signal: options.signal,\r\n loadPanel: options.loadPanel ?? true,\r\n },\r\n (sheet) => {\r\n const { customizeCell, customDrawCell } = options;\r\n return new PdfTable(sheet, {\r\n ...options,\r\n customizeCell: customizeCell && ((cell, pdfCell) => customizeCell({ gridCell: cell.gridCell, pdfCell })),\r\n customDrawCell:\r\n customDrawCell &&\r\n ((e) => {\r\n const args = { doc: e.doc, rect: e.rect, gridCell: e.cell.gridCell, pdfCell: e.pdfCell, cancel: false };\r\n customDrawCell(args);\r\n e.cancel = args.cancel;\r\n }),\r\n }).draw();\r\n },\r\n );\r\n}\r\n","import type { PdfExportResult } from './pdf-export-result';\r\nimport type { PdfPivotExportOptions } from './pdf-pivot-export-options';\r\nimport { PdfTable } from './pdf-table';\r\n\r\n/** Points a member's header is indented per level in the tree layout, by default. */\r\nconst INDENT = 10;\r\n\r\n/**\r\n * Draws a PivotGrid on a jsPDF document as a table: the rows of column headers (merged over the columns they cover) and\r\n * the corner, then a row per line of the table with its row headers (merged down the lines they cover), every open\r\n * member's (read whole where the pivot is read in parts), with the pivot's texts; totals are bold. Rows that do not fit\r\n * go on to the next page under the rows of column headers again, and columns that do not fit go on to the next pages\r\n * after the columns of row headers again. Only jsPDF itself is used, with no table plugin. Provide your own jsPDF:\r\n * create the document, then save it when the promise resolves.\r\n *\r\n * jsPDF's built-in fonts write Latin-1 text only. For other letters (ş, ğ, İ, Cyrillic, Greek…), add a TrueType font\r\n * that has them (`doc.addFileToVFS`, `doc.addFont`) and select it first with `doc.setFont`.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'pdf') return;\r\n * const doc = new jsPDF({ orientation: 'landscape' });\r\n * exportPivotGrid({ jsPDFDocument: doc, component: e.component }).then(() => doc.save('Sales.pdf'));\r\n * }}\r\n */\r\nexport function exportPivotGrid<T = any>(options: PdfPivotExportOptions<T>): Promise<PdfExportResult> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportPivotGrid needs an options object.'));\r\n const { component, jsPDFDocument: doc } = options;\r\n if (!component || typeof component.exportSheet !== 'function' || typeof component.chartData !== 'function') return Promise.reject(new TypeError('exportPivotGrid: `component` must be a PivotGrid.'));\r\n if (!doc || typeof doc.text !== 'function' || !doc.internal) return Promise.reject(new TypeError('exportPivotGrid: `jsPDFDocument` must be a jsPDF document.'));\r\n return component.exportSheet({ format: 'pdf', headers: options.headers, onProgress: options.onProgress, signal: options.signal, loadPanel: options.loadPanel ?? true }, (sheet) => {\r\n const { customizeCell, customDrawCell } = options;\r\n return new PdfTable(sheet, {\r\n ...options,\r\n indent: options.indent ?? INDENT / (doc.internal.scaleFactor || 1),\r\n splitColumns: options.splitColumns !== false,\r\n customizeCell: customizeCell && ((cell, pdfCell) => customizeCell({ pivotCell: cell.pivotCell, pdfCell })),\r\n customDrawCell:\r\n customDrawCell &&\r\n ((e) => {\r\n const args = { doc: e.doc, rect: e.rect, pivotCell: e.cell.pivotCell, pdfCell: e.pdfCell, cancel: false };\r\n customDrawCell(args);\r\n e.cancel = args.cancel;\r\n }),\r\n }).draw();\r\n });\r\n}\r\n"],"mappings":";;;;AAUA,IAAM,KAAK;AACX,IAAM,WAAW;;;;;;;;;AA4BjB,IAAa,WAAb,MAAa,SAAmC;CAO9C,YACE,OACA,SACA;EAFiB,gBAAA,MAAA,SAAA,KAAA,CAAA;EACA,gBAAA,MAAA,WAAA,KAAA,CAAA;EARnB,gBAAA,MAAA,OAAA,KAAA,CAAA;;;;GAEA;;;EACA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AAIH,SAASoB,OAAO;GACzB,GAAGjB;GACHoB,QAAQpB,QAAQoB,UAAUtB,UAAUS,IAAII,SAASU,eAAe;GAChEC,cAActB,QAAQsB,iBAAiB;GACvCJ,eAAeA,mBAAmBK,MAAMC,YAAYN,cAAc;IAAEO,WAAWF,KAAKE;IAAWD;GAAQ,CAAC;GACxGL,gBACEA,oBACEO,MAAM;IACN,MAAMC,OAAO;KAAEpB,KAAKmB,EAAEnB;KAAKqB,MAAMF,EAAEE;KAAMH,WAAWC,EAAEH,KAAKE;KAAWD,SAASE,EAAEF;KAASK,QAAQ;IAAM;IACxGV,eAAeQ,IAAI;IACnBD,EAAEG,SAASF,KAAKE;GAClB;EACJ,CAAC,CAAC,CAACC,KAAK;CACV,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["PdfExportOptions","PdfExportResult","PdfTable","exportDataGrid","options","T","Promise","reject","TypeError","component","jsPDFDocument","doc","exportSheet","text","internal","format","selectedRowsOnly","headers","groups","summaries","pageSize","onProgress","signal","loadPanel","sheet","customizeCell","customDrawCell","cell","pdfCell","gridCell","e","args","rect","cancel","draw","PdfExportResult","PdfPivotExportOptions","PdfTable","INDENT","exportPivotGrid","options","T","Promise","reject","TypeError","component","jsPDFDocument","doc","exportSheet","chartData","text","internal","format","headers","onProgress","signal","loadPanel","sheet","customizeCell","customDrawCell","indent","scaleFactor","splitColumns","cell","pdfCell","pivotCell","e","args","rect","cancel","draw"],"sources":["../../src/pdf/pdf-table.ts","../../src/pdf/export-data-grid.ts","../../src/pdf/export-pivot-grid.ts"],"sourcesContent":["import type { jsPDF } from 'jspdf';\r\nimport { sliceSheet } from '../parts/table/slice-sheet';\r\nimport type { TableSheet } from '../parts/table/table-sheet';\r\nimport type { TableSheetCell } from '../parts/table/table-sheet-cell';\r\nimport type { TableSheetRow } from '../parts/table/table-sheet-row';\r\nimport type { PdfCell } from './pdf-cell';\r\nimport type { PdfExportOptions } from './pdf-export-options';\r\nimport type { PdfExportResult } from './pdf-export-result';\r\n\r\n/** Points in a CSS pixel. */\r\nconst PX = 0.75;\r\nconst ELLIPSIS = '…';\r\n\r\ntype RowType = TableSheetRow['rowType'];\r\n\r\n/** A cell where it is drawn from, and how many columns and rows it covers; `null` for one another covers. */\r\ntype Placed<C> = { cell: PdfCell; source: C; columns: number; rows: number } | null;\r\n\r\n/** What the table reads of an export's options; its hooks get the sheet's own cells. */\r\nexport type PdfTableOptions<C> = Pick<PdfExportOptions, 'jsPDFDocument' | 'topLeft' | 'columnWidths' | 'margin' | 'indent' | 'repeatHeaders' | 'onRowExporting' | 'fitColumns' | 'wordWrapEnabled' | 'fontSize'> & {\r\n /**\r\n * Where the columns are wider than the page, draws those that fit, then the others on the next pages, each time after\r\n * the sheet's header columns again; a part across is drawn down all its pages before the next one.\r\n */\r\n splitColumns?: boolean;\r\n /** Called for every cell, before the rows are measured. */\r\n customizeCell?: (cell: C, pdfCell: PdfCell) => void;\r\n /** Called before a cell is drawn; `cancel` leaves its background and text to the hook. */\r\n customDrawCell?: (e: { readonly doc: jsPDF; readonly rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number }; readonly cell: C; readonly pdfCell: PdfCell; cancel: boolean }) => void;\r\n};\r\n\r\n/**\r\n * Draws a sheet on a jsPDF document as a table, with jsPDF's own drawing calls only: the\r\n * header rows (bands over their columns), the group rows across the row, the data rows with the\r\n * grid's text and alignment, the group footers and the totals. Rows that do not fit go on to the\r\n * next page, under the header rows again (`repeatHeaders`); with `splitColumns`, columns that do not\r\n * fit go on to the next pages, after the header columns again. Right to left, the columns run from the\r\n * right edge.\r\n */\r\nexport class PdfTable<C extends TableSheetCell> {\r\n private readonly doc: jsPDF;\r\n /** Points per unit of the document. */\r\n private readonly unit: number;\r\n private readonly rtl: boolean;\r\n private readonly lines = new WeakMap<PdfCell, string[]>();\r\n\r\n constructor(\r\n private readonly sheet: TableSheet<C>,\r\n private readonly options: PdfTableOptions<C>,\r\n ) {\r\n this.doc = options.jsPDFDocument;\r\n this.unit = this.doc.internal.scaleFactor || 1;\r\n this.rtl = sheet.rtl;\r\n }\r\n\r\n draw(): PdfExportResult {\r\n const { doc, sheet, options } = this;\r\n const parts = options.splitColumns ? this.bands() : [];\r\n if (parts.length > 1) {\r\n let result: PdfExportResult = { page: doc.getCurrentPageInfo().pageNumber, y: 0 };\r\n const side = sheet.headerColumns ?? 0;\r\n parts.forEach(([from, to], i) => {\r\n if (i > 0) doc.addPage();\r\n const given = options.columnWidths;\r\n const columnWidths = given && [...given.slice(0, side), ...given.slice(from, to)];\r\n const part = sliceSheet<C, TableSheet<C>>(sheet, sheet.headerRows, sheet.rows.length, from, to);\r\n // The parts after the first start at the top of their page.\r\n const topLeft = i > 0 ? { x: options.topLeft?.x, y: 0 } : options.topLeft;\r\n result = new PdfTable(part, { ...options, splitColumns: false, columnWidths, topLeft, fitColumns: 'shrink' }).draw();\r\n });\r\n return result;\r\n }\r\n const saved = { font: doc.getFont(), size: doc.getFontSize(), text: doc.getTextColor(), draw: doc.getDrawColor(), fill: doc.getFillColor(), line: doc.getLineWidth() };\r\n try {\r\n const pageWidth = doc.internal.pageSize.getWidth();\r\n const pageHeight = doc.internal.pageSize.getHeight();\r\n const margin = this.margin();\r\n const start = (this.rtl ? margin.right : margin.left) + (options.topLeft?.x ?? 0);\r\n const widths = this.widths(Math.max(0, pageWidth - margin.left - margin.right - (options.topLeft?.x ?? 0)));\r\n const offsets: number[] = [];\r\n widths.reduce((x, w, j) => ((offsets[j] = x), x + w), start);\r\n const grid = this.place();\r\n const heights = sheet.rows.map((_, r) => this.rowHeight(grid, r, widths));\r\n const head = sheet.headerRows;\r\n const headHeight = heights.slice(0, head).reduce((a, h) => a + h, 0);\r\n\r\n const drawRow = (r: number, y: number) => {\r\n grid[r].forEach((placed, j) => {\r\n if (!placed) return;\r\n const w = this.spanWidth(r, j, placed, widths);\r\n const x = offsets[j] + this.indentOf(r, j, placed, widths);\r\n let h = 0;\r\n for (let k = r; k < r + placed.rows && k < heights.length; k++) h += heights[k];\r\n this.drawCell(placed, this.rtl ? pageWidth - x - w : x, y, w, h);\r\n });\r\n };\r\n\r\n let y = margin.top + (options.topLeft?.y ?? 0);\r\n for (let r = 0; r < head; r++) {\r\n drawRow(r, y);\r\n y += heights[r];\r\n }\r\n // Rows that do not fit go on to the next page; one taller than a page stays where it starts.\r\n let onPage = 0;\r\n for (let r = head; r < sheet.rows.length; r++) {\r\n if (y + heights[r] > pageHeight - margin.bottom && onPage > 0) {\r\n doc.addPage();\r\n y = margin.top;\r\n onPage = 0;\r\n if (options.repeatHeaders !== false && head > 0) {\r\n for (let k = 0; k < head; k++) {\r\n drawRow(k, y);\r\n y += heights[k];\r\n }\r\n }\r\n }\r\n drawRow(r, y);\r\n y += heights[r];\r\n onPage++;\r\n }\r\n if (!sheet.rows.length) y += headHeight;\r\n return { page: doc.getCurrentPageInfo().pageNumber, y };\r\n } finally {\r\n doc.setFont(saved.font.fontName, saved.font.fontStyle);\r\n doc.setFontSize(saved.size);\r\n doc.setTextColor(saved.text);\r\n doc.setDrawColor(saved.draw);\r\n doc.setFillColor(saved.fill);\r\n doc.setLineWidth(saved.line);\r\n }\r\n }\r\n\r\n /** Points in the document's units. */\r\n private pt(value: number): number {\r\n return value / this.unit;\r\n }\r\n\r\n private margin(): { top: number; right: number; bottom: number; left: number } {\r\n const given = this.options.margin;\r\n const all = this.pt(40);\r\n if (typeof given === 'number') return { top: given, right: given, bottom: given, left: given };\r\n return { top: given?.top ?? all, right: given?.right ?? all, bottom: given?.bottom ?? all, left: given?.left ?? all };\r\n }\r\n\r\n /**\r\n * The columns of each part across a table wider than the page, from and up to: as many after the header columns as\r\n * fit beside them at their own widths, one at least.\r\n */\r\n private bands(): [number, number][] {\r\n const { doc, sheet, options } = this;\r\n const side = sheet.headerColumns ?? 0;\r\n const margin = this.margin();\r\n const room = Math.max(0, doc.internal.pageSize.getWidth() - margin.left - margin.right - (options.topLeft?.x ?? 0));\r\n const widths = sheet.columns.map((c, j) => options.columnWidths?.[j] ?? this.pt(Math.max(0, c.width) * PX));\r\n const fixed = widths.slice(0, side).reduce((a, w) => a + w, 0);\r\n const out: [number, number][] = [];\r\n let from = side;\r\n let used = fixed;\r\n for (let j = side; j < widths.length; j++) {\r\n if (j > from && used + widths[j] > room) {\r\n out.push([from, j]);\r\n from = j;\r\n used = fixed;\r\n }\r\n used += widths[j];\r\n }\r\n if (from < widths.length || !out.length) out.push([from, widths.length]);\r\n return out;\r\n }\r\n\r\n /** The columns' widths: the ones given, else the grid's, made to fit `room` as `fitColumns` says. */\r\n private widths(room: number): number[] {\r\n const { sheet, options } = this;\r\n const grid = sheet.columns.map((c) => this.pt(Math.max(0, c.width) * PX));\r\n if (options.columnWidths) return grid.map((w, j) => options.columnWidths![j] ?? w);\r\n const total = grid.reduce((a, w) => a + w, 0);\r\n const fit = options.fitColumns ?? 'shrink';\r\n if (fit === 'none' || total <= 0 || (fit === 'shrink' && total <= room)) return grid;\r\n return grid.map((w) => (w * room) / total);\r\n }\r\n\r\n /**\r\n * The cells as they are drawn: header cells merged as the sheet says (a band over its columns, a\r\n * column down the band rows), a group row's text across the empty cells after it; each one told\r\n * to `customizeCell`.\r\n */\r\n private place(): Placed<C>[][] {\r\n const { sheet, options } = this;\r\n const out: Placed<C>[][] = sheet.rows.map((row) =>\r\n row.cells.map((c, j) => ({ cell: this.baseCell(row.rowType, j, c.text, !!c.strong), source: c, columns: 1, rows: 1 })),\r\n );\r\n for (const m of sheet.merges) {\r\n const origin = out[m.row]?.[m.column];\r\n if (!origin) continue;\r\n origin.columns = m.columns;\r\n origin.rows = m.rows;\r\n for (let r = m.row; r < m.row + m.rows; r++) for (let j = m.column; j < m.column + m.columns; j++) if (r !== m.row || j !== m.column) out[r][j] = null;\r\n }\r\n sheet.rows.forEach((row, r) => {\r\n if (row.rowType !== 'group' || !out[r][0]) return;\r\n let span = 1;\r\n while (span < row.cells.length && row.cells[span].value === null && !row.cells[span].text) out[r][span++] = null;\r\n out[r][0]!.columns = span;\r\n });\r\n if (options.customizeCell) for (const row of out) for (const placed of row) if (placed) options.customizeCell(placed.source, placed.cell);\r\n return out;\r\n }\r\n\r\n /** A cell's look before `customizeCell`: the row type's font and colors (bold for a total's cell), the column's alignment. */\r\n private baseCell(rowType: RowType, j: number, text: string, strong: boolean): PdfCell {\r\n const doc = this.doc;\r\n const col = this.sheet.columns[j];\r\n const align = rowType === 'group' && j === 0 ? 'start' : (col?.align ?? 'start');\r\n const side = (end: boolean) => (end !== this.rtl ? 'right' : 'left');\r\n const pad = this.pt(5);\r\n return {\r\n text,\r\n font: { size: this.options.fontSize ?? 10, name: doc.getFont().fontName, style: (rowType === 'data' && !strong) || rowType === 'header' ? 'normal' : 'bold' },\r\n textColor: rowType === 'header' ? '#979797' : '#000000',\r\n borderColor: '#979797',\r\n borderWidth: this.pt(0.5),\r\n drawLeftBorder: true,\r\n drawRightBorder: true,\r\n drawTopBorder: true,\r\n drawBottomBorder: true,\r\n horizontalAlign: align === 'center' ? 'center' : side(align === 'end'),\r\n verticalAlign: 'middle',\r\n padding: { top: pad, right: pad, bottom: pad, left: pad },\r\n // By default the data cells of a column that wraps on screen wrap here too.\r\n wordWrapEnabled: this.options.wordWrapEnabled ?? (rowType === 'data' && !!col?.wrap),\r\n };\r\n }\r\n\r\n /** The height of row `r`: its tallest cell of one row, then what `onRowExporting` makes of it. */\r\n private rowHeight(grid: Placed<C>[][], r: number, widths: readonly number[]): number {\r\n const cells: PdfCell[] = [];\r\n let need = 0;\r\n grid[r].forEach((placed, j) => {\r\n if (!placed) return;\r\n cells.push(placed.cell);\r\n const lines = this.textLines(placed.cell, this.spanWidth(r, j, placed, widths));\r\n if (placed.rows === 1) need = Math.max(need, lines.length * this.lineHeight(placed.cell) + placed.cell.padding.top + placed.cell.padding.bottom);\r\n });\r\n if (!this.options.onRowExporting) return need;\r\n const e = { rowCells: cells, rowHeight: need };\r\n this.options.onRowExporting(e);\r\n return Math.max(need, Number(e.rowHeight) || 0);\r\n }\r\n\r\n /** How far the first cell of row `r` sits in: `indent` per group level, never past the cell. */\r\n private indentOf(r: number, j: number, placed: NonNullable<Placed<C>>, widths: readonly number[]): number {\r\n const row = this.sheet.rows[r];\r\n const indent = Math.max(0, this.options.indent ?? 0);\r\n if (j !== 0 || !indent || row.rowType === 'header' || !row.level) return 0;\r\n let w = 0;\r\n for (let k = 0; k < placed.columns && k < widths.length; k++) w += widths[k];\r\n return Math.min(w, indent * row.level);\r\n }\r\n\r\n /** The width a cell covers, less its indent. */\r\n private spanWidth(r: number, j: number, placed: NonNullable<Placed<C>>, widths: readonly number[]): number {\r\n let w = 0;\r\n for (let k = j; k < j + placed.columns && k < widths.length; k++) w += widths[k];\r\n return w - this.indentOf(r, j, placed, widths);\r\n }\r\n\r\n /** The lines of a cell's text at width `w`: wrapped, or each cut to fit with \"…\". */\r\n private textLines(cell: PdfCell, w: number): string[] {\r\n const doc = this.doc;\r\n this.useFont(cell);\r\n const room = Math.max(0, w - cell.padding.left - cell.padding.right);\r\n const out: string[] = [];\r\n for (const part of String(cell.text ?? '').split('\\n')) {\r\n if (cell.wordWrapEnabled && part) out.push(...(doc.splitTextToSize(part, room) as string[]));\r\n else out.push(this.cut(part, room));\r\n }\r\n this.lines.set(cell, out);\r\n return out;\r\n }\r\n\r\n /** The text, or as much of it as fits in `room` with \"…\" after it. */\r\n private cut(text: string, room: number): string {\r\n const doc = this.doc;\r\n if (!text || doc.getTextWidth(text) <= room) return text;\r\n let lo = 0;\r\n let hi = text.length;\r\n while (lo < hi) {\r\n const mid = Math.ceil((lo + hi) / 2);\r\n if (doc.getTextWidth(text.slice(0, mid) + ELLIPSIS) <= room) lo = mid;\r\n else hi = mid - 1;\r\n }\r\n return lo ? text.slice(0, lo).trimEnd() + ELLIPSIS : '';\r\n }\r\n\r\n private lineHeight(cell: PdfCell): number {\r\n return this.pt(cell.font.size * this.doc.getLineHeightFactor());\r\n }\r\n\r\n /** The cell's font, or the plain style of it when the document has no such style (a font added with only one). */\r\n private useFont(cell: PdfCell) {\r\n const doc = this.doc;\r\n const name = cell.font.name ?? doc.getFont().fontName;\r\n const styles = doc.getFontList()[name];\r\n const style = cell.font.style ?? 'normal';\r\n doc.setFont(name, !styles || styles.includes(style) ? style : (styles[0] ?? 'normal'));\r\n doc.setFontSize(cell.font.size);\r\n }\r\n\r\n private drawCell(placed: NonNullable<Placed<C>>, x: number, y: number, w: number, h: number) {\r\n const { doc, options } = this;\r\n const { cell, source } = placed;\r\n const rect = { x, y, w, h };\r\n const e = { doc, rect, cell: source, pdfCell: cell, cancel: false };\r\n options.customDrawCell?.(e);\r\n if (!e.cancel) {\r\n if (cell.backgroundColor) {\r\n doc.setFillColor(cell.backgroundColor);\r\n doc.rect(x, y, w, h, 'F');\r\n }\r\n this.drawText(cell, rect);\r\n }\r\n if (cell.borderWidth > 0) {\r\n doc.setDrawColor(cell.borderColor);\r\n doc.setLineWidth(cell.borderWidth);\r\n if (cell.drawTopBorder) doc.line(x, y, x + w, y);\r\n if (cell.drawBottomBorder) doc.line(x, y + h, x + w, y + h);\r\n if (cell.drawLeftBorder) doc.line(x, y, x, y + h);\r\n if (cell.drawRightBorder) doc.line(x + w, y, x + w, y + h);\r\n }\r\n }\r\n\r\n private drawText(cell: PdfCell, rect: { x: number; y: number; w: number; h: number }) {\r\n const doc = this.doc;\r\n const lines = this.lines.get(cell) ?? this.textLines(cell, rect.w);\r\n if (!lines.some((l) => l)) return;\r\n this.useFont(cell);\r\n doc.setTextColor(cell.textColor);\r\n const height = lines.length * this.lineHeight(cell);\r\n const { padding } = cell;\r\n const y = cell.verticalAlign === 'top' ? rect.y + padding.top : cell.verticalAlign === 'bottom' ? rect.y + rect.h - padding.bottom - height : rect.y + (rect.h - height) / 2;\r\n const x = cell.horizontalAlign === 'right' ? rect.x + rect.w - padding.right : cell.horizontalAlign === 'center' ? rect.x + rect.w / 2 : rect.x + padding.left;\r\n doc.text(lines, x, y, { align: cell.horizontalAlign, baseline: 'top', lineHeightFactor: doc.getLineHeightFactor() });\r\n }\r\n}\r\n","import type { PdfExportOptions } from './pdf-export-options';\r\nimport type { PdfExportResult } from './pdf-export-result';\r\nimport { PdfTable } from './pdf-table';\r\n\r\n/**\r\n * Draws a DataGrid on a jsPDF document as a table: the header rows (bands merged over their columns),\r\n * the rows in the grid's order with its filter, search and grouping (every matching row, loaded in\r\n * parts from a server), the group rows, the group footers and the totals, with the grid's text and\r\n * alignment. Columns take the grid's widths, narrowed to fit the page, and rows that do not fit continue\r\n * on the next page under repeated header rows. Only jsPDF itself is used, with no table plugin. Provide\r\n * your own jsPDF: create the document, then save it when the promise resolves.\r\n *\r\n * jsPDF's built-in fonts write Latin-1 text only. For other letters (ş, ğ, İ, Cyrillic, Greek…), add a\r\n * TrueType font that has them (`doc.addFileToVFS`, `doc.addFont`) and select it first with `doc.setFont`.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'pdf') return;\r\n * const doc = new jsPDF();\r\n * exportDataGrid({ jsPDFDocument: doc, component: e.component, selectedRowsOnly: e.selectedRowsOnly })\r\n * .then(() => doc.save('Orders.pdf'));\r\n * }}\r\n */\r\nexport function exportDataGrid<T = any>(options: PdfExportOptions<T>): Promise<PdfExportResult> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportDataGrid needs an options object.'));\r\n const { component, jsPDFDocument: doc } = options;\r\n if (!component || typeof component.exportSheet !== 'function') return Promise.reject(new TypeError('exportDataGrid: `component` must be a DataGrid.'));\r\n if (!doc || typeof doc.text !== 'function' || !doc.internal) return Promise.reject(new TypeError('exportDataGrid: `jsPDFDocument` must be a jsPDF document.'));\r\n return component.exportSheet(\r\n {\r\n format: 'pdf',\r\n selectedRowsOnly: options.selectedRowsOnly,\r\n headers: options.headers,\r\n groups: options.groups,\r\n summaries: options.summaries,\r\n pageSize: options.pageSize,\r\n onProgress: options.onProgress,\r\n signal: options.signal,\r\n loadPanel: options.loadPanel ?? true,\r\n },\r\n (sheet) => {\r\n const { customizeCell, customDrawCell } = options;\r\n return new PdfTable(sheet, {\r\n ...options,\r\n customizeCell: customizeCell && ((cell, pdfCell) => customizeCell({ gridCell: cell.gridCell, pdfCell })),\r\n customDrawCell:\r\n customDrawCell &&\r\n ((e) => {\r\n const args = { doc: e.doc, rect: e.rect, gridCell: e.cell.gridCell, pdfCell: e.pdfCell, cancel: false };\r\n customDrawCell(args);\r\n e.cancel = args.cancel;\r\n }),\r\n }).draw();\r\n },\r\n );\r\n}\r\n","import type { PdfExportResult } from './pdf-export-result';\r\nimport type { PdfPivotExportOptions } from './pdf-pivot-export-options';\r\nimport { PdfTable } from './pdf-table';\r\n\r\n/** Points a member's header is indented per level in the tree layout, by default. */\r\nconst INDENT = 10;\r\n\r\n/**\r\n * Draws a PivotGrid on a jsPDF document as a table: the rows of column headers (merged over the columns they cover) and\r\n * the corner, then a row per line of the table with its row headers (merged down the lines they cover), every open\r\n * member's (read whole where the pivot is read in parts), with the pivot's texts; totals are bold. Rows that do not fit\r\n * go on to the next page under the rows of column headers again, and columns that do not fit go on to the next pages\r\n * after the columns of row headers again. Only jsPDF itself is used, with no table plugin. Provide your own jsPDF:\r\n * create the document, then save it when the promise resolves.\r\n *\r\n * jsPDF's built-in fonts write Latin-1 text only. For other letters (ş, ğ, İ, Cyrillic, Greek…), add a TrueType font\r\n * that has them (`doc.addFileToVFS`, `doc.addFont`) and select it first with `doc.setFont`.\r\n *\r\n * @example\r\n * onExporting={(e) => {\r\n * if (e.format !== 'pdf') return;\r\n * const doc = new jsPDF({ orientation: 'landscape' });\r\n * exportPivotGrid({ jsPDFDocument: doc, component: e.component }).then(() => doc.save('Sales.pdf'));\r\n * }}\r\n */\r\nexport function exportPivotGrid<T = any>(options: PdfPivotExportOptions<T>): Promise<PdfExportResult> {\r\n if (!options || typeof options !== 'object') return Promise.reject(new TypeError('exportPivotGrid needs an options object.'));\r\n const { component, jsPDFDocument: doc } = options;\r\n if (!component || typeof component.exportSheet !== 'function' || typeof component.chartData !== 'function') return Promise.reject(new TypeError('exportPivotGrid: `component` must be a PivotGrid.'));\r\n if (!doc || typeof doc.text !== 'function' || !doc.internal) return Promise.reject(new TypeError('exportPivotGrid: `jsPDFDocument` must be a jsPDF document.'));\r\n return component.exportSheet({ format: 'pdf', headers: options.headers, onProgress: options.onProgress, signal: options.signal, loadPanel: options.loadPanel ?? true }, (sheet) => {\r\n const { customizeCell, customDrawCell } = options;\r\n return new PdfTable(sheet, {\r\n ...options,\r\n indent: options.indent ?? INDENT / (doc.internal.scaleFactor || 1),\r\n splitColumns: options.splitColumns !== false,\r\n customizeCell: customizeCell && ((cell, pdfCell) => customizeCell({ pivotCell: cell.pivotCell, pdfCell })),\r\n customDrawCell:\r\n customDrawCell &&\r\n ((e) => {\r\n const args = { doc: e.doc, rect: e.rect, pivotCell: e.cell.pivotCell, pdfCell: e.pdfCell, cancel: false };\r\n customDrawCell(args);\r\n e.cancel = args.cancel;\r\n }),\r\n }).draw();\r\n });\r\n}\r\n"],"mappings":";;;;AAUA,IAAM,KAAK;AACX,IAAM,WAAW;;;;;;;;;AA4BjB,IAAa,WAAb,MAAa,SAAmC;CAO9C,YACE,OACA,SACA;EAFiB,gBAAA,MAAA,SAAA,KAAA,CAAA;EACA,gBAAA,MAAA,WAAA,KAAA,CAAA;EARnB,gBAAA,MAAA,OAAA,KAAA,CAAA;;;;GAEA;;;EACA,gBAAA,MAAA,OAAA,KAAA,CAAA;EACA,gBAAA,MAAA,yBAAyB,IAAI,QAA2B,CAAA;EAGrC,KAAA,QAAA;EACA,KAAA,UAAA;EAEjB,KAAK,MAAM,QAAQ;EACnB,KAAK,OAAO,KAAK,IAAI,SAAS,eAAe;EAC7C,KAAK,MAAM,MAAM;CACnB;CAEA,OAAwB;EACtB,MAAM,EAAE,KAAK,OAAO,YAAY;EAChC,MAAM,QAAQ,QAAQ,eAAe,KAAK,MAAM,IAAI,CAAC;EACrD,IAAI,MAAM,SAAS,GAAG;GACpB,IAAI,SAA0B;IAAE,MAAM,IAAI,mBAAmB,CAAC,CAAC;IAAY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Q,IAAI;IACnBD,EAAEG,SAASF,KAAKE;GAClB;EACJ,CAAC,CAAC,CAACC,KAAK;CACV,CAAC;AACH"}
|
|
@@ -48,7 +48,10 @@ export interface PdfExportOptions<T = any> {
|
|
|
48
48
|
* the grid's widths (`'none'`). This does not apply with `columnWidths`. The default is `'shrink'`.
|
|
49
49
|
*/
|
|
50
50
|
fitColumns?: 'shrink' | 'fill' | 'none';
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Wraps long text to more lines (`true`), or never (`false`). When off, a line that does not fit ends in "…". By default,
|
|
53
|
+
* the data cells of the columns that wrap on screen (a column's `wrap`) wrap, and the others do not.
|
|
54
|
+
*/
|
|
52
55
|
wordWrapEnabled?: boolean;
|
|
53
56
|
/** The font size of the cells, in points. The default is `10`. */
|
|
54
57
|
fontSize?: number;
|
package/dist/styles.css
CHANGED
|
@@ -2993,6 +2993,10 @@
|
|
|
2993
2993
|
--mx-layout-space-xl: var(--mx-space-8);
|
|
2994
2994
|
--mx-layout-space-xxl: var(--mx-space-12);
|
|
2995
2995
|
--mx-layout-gap: var(--mx-space-2);
|
|
2996
|
+
--mx-layout-breakpoint-sm: var(--mx-breakpoint-sm);
|
|
2997
|
+
--mx-layout-breakpoint-md: var(--mx-breakpoint-md);
|
|
2998
|
+
--mx-layout-breakpoint-lg: var(--mx-breakpoint-lg);
|
|
2999
|
+
--mx-layout-breakpoint-xl: var(--mx-breakpoint-xl);
|
|
2996
3000
|
--mx-layout-group-box-gap: var(--mx-space-3);
|
|
2997
3001
|
--mx-layout-splitter-size: var(--mx-space-2);
|
|
2998
3002
|
--mx-layout-splitter-line-width: var(--mx-border-width-1);
|
|
@@ -11068,6 +11072,10 @@
|
|
|
11068
11072
|
--_layout-space-xl: var(--mx-layout-space-xl);
|
|
11069
11073
|
--_layout-space-xxl: var(--mx-layout-space-xxl);
|
|
11070
11074
|
--_layout-gap: var(--mx-layout-gap);
|
|
11075
|
+
--_layout-breakpoint-sm: var(--mx-layout-breakpoint-sm);
|
|
11076
|
+
--_layout-breakpoint-md: var(--mx-layout-breakpoint-md);
|
|
11077
|
+
--_layout-breakpoint-lg: var(--mx-layout-breakpoint-lg);
|
|
11078
|
+
--_layout-breakpoint-xl: var(--mx-layout-breakpoint-xl);
|
|
11071
11079
|
--_layout-group-box-gap: var(--mx-layout-group-box-gap);
|
|
11072
11080
|
--_layout-group-box-legend-float: var(--mx-layout-group-box-legend-float);
|
|
11073
11081
|
--_layout-splitter-size: var(--mx-layout-splitter-size);
|
|
@@ -21516,11 +21524,54 @@
|
|
|
21516
21524
|
inset-inline: var(--_tabs-indicator-offset) auto;
|
|
21517
21525
|
}
|
|
21518
21526
|
|
|
21519
|
-
/* Panels.
|
|
21527
|
+
/* Panels. The shown one fills the room the strip leaves: in tabs given a height, what is longer than it scrolls in
|
|
21528
|
+
the panel, its padding scrolling with it, so the scroll bar stands at the panel's edge. */
|
|
21520
21529
|
|
|
21521
21530
|
:where(.mx-tabs) > .mx-tabs__panels {
|
|
21531
|
+
display: flex;
|
|
21522
21532
|
flex: 1 1 auto;
|
|
21533
|
+
flex-direction: column;
|
|
21523
21534
|
min-inline-size: 0;
|
|
21535
|
+
min-block-size: 0;
|
|
21536
|
+
}
|
|
21537
|
+
|
|
21538
|
+
:where(.mx-tabs > .mx-tabs__panels) > .mx-tabs__panel {
|
|
21539
|
+
flex: 1 1 auto;
|
|
21540
|
+
min-block-size: 0;
|
|
21541
|
+
overflow: auto;
|
|
21542
|
+
}
|
|
21543
|
+
|
|
21544
|
+
/* A panel that holds only a part that scrolls by itself (a grid, a tree, a scroll view …) gives it all its room: no
|
|
21545
|
+
padding (over the look's, the pill's across it too), so the part's scroll bar stands at the panel's edge, and the
|
|
21546
|
+
part fills the panel. A `padding` given to the tab or the tabs is written on the panel and still holds. */
|
|
21547
|
+
:where(.mx-tabs > .mx-tabs__panels) > .mx-tabs__panel:has(
|
|
21548
|
+
> :only-child:is(
|
|
21549
|
+
.mx-data-grid, .mx-pivot-grid, .mx-tree-view, .mx-scroll-view, .mx-scheduler, .mx-chat, .mx-diagram, .mx-tabdocs,
|
|
21550
|
+
.mx-split-container, .mx-dock-panel, .mx-tile-view, .mx-panel[data-scroll]
|
|
21551
|
+
)
|
|
21552
|
+
) {
|
|
21553
|
+
display: flex;
|
|
21554
|
+
flex-direction: column;
|
|
21555
|
+
padding-block: 0;
|
|
21556
|
+
padding-inline: 0;
|
|
21557
|
+
overflow: hidden;
|
|
21558
|
+
}
|
|
21559
|
+
|
|
21560
|
+
.mx-tabs[data-variant='pill'] > .mx-tabs__panels > .mx-tabs__panel:has(
|
|
21561
|
+
> :only-child:is(
|
|
21562
|
+
.mx-data-grid, .mx-pivot-grid, .mx-tree-view, .mx-scroll-view, .mx-scheduler, .mx-chat, .mx-diagram, .mx-tabdocs,
|
|
21563
|
+
.mx-split-container, .mx-dock-panel, .mx-tile-view, .mx-panel[data-scroll]
|
|
21564
|
+
)
|
|
21565
|
+
) {
|
|
21566
|
+
padding-inline: 0;
|
|
21567
|
+
}
|
|
21568
|
+
|
|
21569
|
+
:where(.mx-tabs > .mx-tabs__panels > .mx-tabs__panel) > :only-child:is(
|
|
21570
|
+
.mx-data-grid, .mx-pivot-grid, .mx-tree-view, .mx-scroll-view, .mx-scheduler, .mx-chat, .mx-diagram, .mx-tabdocs,
|
|
21571
|
+
.mx-split-container, .mx-dock-panel, .mx-tile-view, .mx-panel[data-scroll]
|
|
21572
|
+
) {
|
|
21573
|
+
flex: 1 1 auto;
|
|
21574
|
+
min-block-size: 0;
|
|
21524
21575
|
}
|
|
21525
21576
|
|
|
21526
21577
|
:where(.mx-tabs > .mx-tabs__panels) > .mx-tabs__panel > :first-child {
|
|
@@ -21535,13 +21586,15 @@
|
|
|
21535
21586
|
shortcut editor first in it. */
|
|
21536
21587
|
:where(.mx-tabs[data-placement='top'] > .mx-tabs__panels) > .mx-tabs__panel > :is(.mx-toolbar, .mx-menubar):first-child,
|
|
21537
21588
|
:where(.mx-tabs[data-placement='top'] > .mx-tabs__panels) > .mx-tabs__panel > .mx-shortcut-editor:first-child > .mx-toolbar:first-child {
|
|
21538
|
-
margin-block-start: calc(-1 * var(--_tabs-panel-padding, 0px));
|
|
21539
|
-
margin-inline: calc(-1 * var(--_tabs-panel-padding, 0px));
|
|
21589
|
+
margin-block-start: calc(-1 * var(--_panel-block-start, var(--_tabs-panel-padding, 0px)));
|
|
21590
|
+
margin-inline: calc(-1 * var(--_panel-inline-start, var(--_tabs-panel-padding, 0px))) calc(-1 * var(--_panel-inline-end, var(--_tabs-panel-padding, 0px)));
|
|
21540
21591
|
}
|
|
21541
21592
|
|
|
21542
21593
|
:where(.mx-tabs[data-variant='pill'][data-placement='top'] > .mx-tabs__panels) > .mx-tabs__panel > :is(.mx-toolbar, .mx-menubar):first-child,
|
|
21543
21594
|
:where(.mx-tabs[data-variant='pill'][data-placement='top'] > .mx-tabs__panels) > .mx-tabs__panel > .mx-shortcut-editor:first-child > .mx-toolbar:first-child {
|
|
21544
|
-
margin-inline:
|
|
21595
|
+
margin-inline:
|
|
21596
|
+
calc(-1 * var(--_panel-inline-start, var(--_tabs-panel-pill-across-padding-inline, var(--_tabs-panel-padding, 0px))))
|
|
21597
|
+
calc(-1 * var(--_panel-inline-end, var(--_tabs-panel-pill-across-padding-inline, var(--_tabs-panel-padding, 0px))));
|
|
21545
21598
|
}
|
|
21546
21599
|
}
|
|
21547
21600
|
|
|
@@ -23528,8 +23581,16 @@
|
|
|
23528
23581
|
align-items: start;
|
|
23529
23582
|
}
|
|
23530
23583
|
|
|
23584
|
+
/* As many columns as fit, each at least `minColumnWidth` wide, and with `columns` given no more than that many: a column
|
|
23585
|
+
is never narrower than its share of the row at that count. */
|
|
23531
23586
|
.mx-form-layout[data-fluid] > .mx-form-layout__grid {
|
|
23532
|
-
grid-template-columns: repeat(
|
|
23587
|
+
grid-template-columns: repeat(
|
|
23588
|
+
auto-fill,
|
|
23589
|
+
minmax(
|
|
23590
|
+
min(100%, max(var(--_form-min), (100% - (var(--_form-columns, 1000) - 1) * var(--_form-layout-column-gap)) / var(--_form-columns, 1000))),
|
|
23591
|
+
1fr
|
|
23592
|
+
)
|
|
23593
|
+
);
|
|
23533
23594
|
}
|
|
23534
23595
|
|
|
23535
23596
|
.mx-form-layout__item {
|
|
@@ -23707,6 +23768,29 @@
|
|
|
23707
23768
|
overscroll-behavior: contain;
|
|
23708
23769
|
}
|
|
23709
23770
|
|
|
23771
|
+
/* Content that is only a part that scrolls by itself (a grid, a tree, a scroll view …) gets all the room: no padding,
|
|
23772
|
+
so its scroll bar stands at the edge, and it fills the area. A `padding` given to the form still holds. */
|
|
23773
|
+
.mx-form__content:has(
|
|
23774
|
+
> :only-child:is(
|
|
23775
|
+
.mx-data-grid, .mx-pivot-grid, .mx-tree-view, .mx-scroll-view, .mx-scheduler, .mx-chat, .mx-diagram, .mx-tabdocs,
|
|
23776
|
+
.mx-split-container, .mx-dock-panel, .mx-tile-view, .mx-panel[data-scroll]
|
|
23777
|
+
)
|
|
23778
|
+
) {
|
|
23779
|
+
display: flex;
|
|
23780
|
+
flex-direction: column;
|
|
23781
|
+
padding-block: 0;
|
|
23782
|
+
padding-inline: 0;
|
|
23783
|
+
overflow: hidden;
|
|
23784
|
+
}
|
|
23785
|
+
|
|
23786
|
+
.mx-form__content > :only-child:is(
|
|
23787
|
+
.mx-data-grid, .mx-pivot-grid, .mx-tree-view, .mx-scroll-view, .mx-scheduler, .mx-chat, .mx-diagram, .mx-tabdocs,
|
|
23788
|
+
.mx-split-container, .mx-dock-panel, .mx-tile-view, .mx-panel[data-scroll]
|
|
23789
|
+
) {
|
|
23790
|
+
flex: 1 1 auto;
|
|
23791
|
+
min-block-size: 0;
|
|
23792
|
+
}
|
|
23793
|
+
|
|
23710
23794
|
.mx-form__footer {
|
|
23711
23795
|
display: flex;
|
|
23712
23796
|
flex: none;
|
|
@@ -25468,6 +25552,10 @@
|
|
|
25468
25552
|
@layer mx.components {
|
|
25469
25553
|
.mx-data-grid {
|
|
25470
25554
|
--_row-height: calc(var(--_datagrid-record-height) + var(--_datagrid-row-space));
|
|
25555
|
+
/* A cell whose text wraps (a column's `wrap`): how tall its lines are, and the room above and below them, so its
|
|
25556
|
+
first line stands where a cell of one line has its text. The grid's own sheet gives the cells these. */
|
|
25557
|
+
--_wrap-line: 1.4em;
|
|
25558
|
+
--_wrap-space: max(0px, calc((var(--_row-height) - var(--_datagrid-row-line-width) - var(--_wrap-line)) / 2));
|
|
25471
25559
|
--_sticky-start: inset calc(var(--_datagrid-pinned-edge-width) * -1) 0 0 var(--_datagrid-pinned-edge-color);
|
|
25472
25560
|
--_sticky-end: inset var(--_datagrid-pinned-edge-width) 0 0 var(--_datagrid-pinned-edge-color);
|
|
25473
25561
|
/* Stacking inside the grid only. */
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -1376,6 +1376,26 @@ export declare const tokens: {
|
|
|
1376
1376
|
readonly type: 'dimension';
|
|
1377
1377
|
readonly layer: 'primitive';
|
|
1378
1378
|
};
|
|
1379
|
+
readonly 'breakpoint.sm': {
|
|
1380
|
+
readonly cssVar: '--mx-breakpoint-sm';
|
|
1381
|
+
readonly type: 'dimension';
|
|
1382
|
+
readonly layer: 'primitive';
|
|
1383
|
+
};
|
|
1384
|
+
readonly 'breakpoint.md': {
|
|
1385
|
+
readonly cssVar: '--mx-breakpoint-md';
|
|
1386
|
+
readonly type: 'dimension';
|
|
1387
|
+
readonly layer: 'primitive';
|
|
1388
|
+
};
|
|
1389
|
+
readonly 'breakpoint.lg': {
|
|
1390
|
+
readonly cssVar: '--mx-breakpoint-lg';
|
|
1391
|
+
readonly type: 'dimension';
|
|
1392
|
+
readonly layer: 'primitive';
|
|
1393
|
+
};
|
|
1394
|
+
readonly 'breakpoint.xl': {
|
|
1395
|
+
readonly cssVar: '--mx-breakpoint-xl';
|
|
1396
|
+
readonly type: 'dimension';
|
|
1397
|
+
readonly layer: 'primitive';
|
|
1398
|
+
};
|
|
1379
1399
|
readonly 'opacity.disabled': {
|
|
1380
1400
|
readonly cssVar: '--mx-opacity-disabled';
|
|
1381
1401
|
readonly type: 'number';
|
|
@@ -15866,6 +15886,26 @@ export declare const tokens: {
|
|
|
15866
15886
|
readonly type: 'dimension';
|
|
15867
15887
|
readonly layer: 'component';
|
|
15868
15888
|
};
|
|
15889
|
+
readonly 'layout.breakpoint.sm': {
|
|
15890
|
+
readonly cssVar: '--mx-layout-breakpoint-sm';
|
|
15891
|
+
readonly type: 'dimension';
|
|
15892
|
+
readonly layer: 'component';
|
|
15893
|
+
};
|
|
15894
|
+
readonly 'layout.breakpoint.md': {
|
|
15895
|
+
readonly cssVar: '--mx-layout-breakpoint-md';
|
|
15896
|
+
readonly type: 'dimension';
|
|
15897
|
+
readonly layer: 'component';
|
|
15898
|
+
};
|
|
15899
|
+
readonly 'layout.breakpoint.lg': {
|
|
15900
|
+
readonly cssVar: '--mx-layout-breakpoint-lg';
|
|
15901
|
+
readonly type: 'dimension';
|
|
15902
|
+
readonly layer: 'component';
|
|
15903
|
+
};
|
|
15904
|
+
readonly 'layout.breakpoint.xl': {
|
|
15905
|
+
readonly cssVar: '--mx-layout-breakpoint-xl';
|
|
15906
|
+
readonly type: 'dimension';
|
|
15907
|
+
readonly layer: 'component';
|
|
15908
|
+
};
|
|
15869
15909
|
readonly 'layout.group-box.gap': {
|
|
15870
15910
|
readonly cssVar: '--mx-layout-group-box-gap';
|
|
15871
15911
|
readonly type: 'dimension';
|
package/dist/tokens/index.js
CHANGED
|
@@ -14087,6 +14087,26 @@ var componentTokens = {
|
|
|
14087
14087
|
type: "dimension",
|
|
14088
14088
|
layer: "component"
|
|
14089
14089
|
},
|
|
14090
|
+
"layout.breakpoint.sm": {
|
|
14091
|
+
cssVar: "--mx-layout-breakpoint-sm",
|
|
14092
|
+
type: "dimension",
|
|
14093
|
+
layer: "component"
|
|
14094
|
+
},
|
|
14095
|
+
"layout.breakpoint.md": {
|
|
14096
|
+
cssVar: "--mx-layout-breakpoint-md",
|
|
14097
|
+
type: "dimension",
|
|
14098
|
+
layer: "component"
|
|
14099
|
+
},
|
|
14100
|
+
"layout.breakpoint.lg": {
|
|
14101
|
+
cssVar: "--mx-layout-breakpoint-lg",
|
|
14102
|
+
type: "dimension",
|
|
14103
|
+
layer: "component"
|
|
14104
|
+
},
|
|
14105
|
+
"layout.breakpoint.xl": {
|
|
14106
|
+
cssVar: "--mx-layout-breakpoint-xl",
|
|
14107
|
+
type: "dimension",
|
|
14108
|
+
layer: "component"
|
|
14109
|
+
},
|
|
14090
14110
|
"layout.group-box.gap": {
|
|
14091
14111
|
cssVar: "--mx-layout-group-box-gap",
|
|
14092
14112
|
type: "dimension",
|