@motifx-community/ui 0.1.0-beta.17 → 0.1.0-beta.18
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 +23 -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/excel/index.js +1 -1
- package/dist/excel/index.js.map +1 -1
- package/dist/index.js +370 -24
- 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 +4 -0
- 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 +1 -1
- 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 +1 -1
- 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 +1 -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 +1 -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 +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +269 -192
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -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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CAACH,IAAII,UAAU,OAAOT,QAAQC,uBAAO,IAAIC,UAAU,4DAA4D,CAAC;CAC9J,OAAOC,UAAUG,YAAY;EAAEI,QAAQ;EAAOC,SAASb,QAAQa;EAASC,YAAYd,QAAQc;EAAYC,QAAQf,QAAQe;EAAQC,WAAWhB,QAAQgB,aAAa;CAAK,IAAIC,UAAU;EACjL,MAAM,EAAEC,eAAeC,mBAAmBnB;EAC1C,OAAO,IAAIH,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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B,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"}
|
|
@@ -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
|
@@ -25468,6 +25468,10 @@
|
|
|
25468
25468
|
@layer mx.components {
|
|
25469
25469
|
.mx-data-grid {
|
|
25470
25470
|
--_row-height: calc(var(--_datagrid-record-height) + var(--_datagrid-row-space));
|
|
25471
|
+
/* A cell whose text wraps (a column's `wrap`): how tall its lines are, and the room above and below them, so its
|
|
25472
|
+
first line stands where a cell of one line has its text. The grid's own sheet gives the cells these. */
|
|
25473
|
+
--_wrap-line: 1.4em;
|
|
25474
|
+
--_wrap-space: max(0px, calc((var(--_row-height) - var(--_datagrid-row-line-width) - var(--_wrap-line)) / 2));
|
|
25471
25475
|
--_sticky-start: inset calc(var(--_datagrid-pinned-edge-width) * -1) 0 0 var(--_datagrid-pinned-edge-color);
|
|
25472
25476
|
--_sticky-end: inset var(--_datagrid-pinned-edge-width) 0 0 var(--_datagrid-pinned-edge-color);
|
|
25473
25477
|
/* Stacking inside the grid only. */
|
package/docs/accordion.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Accordion
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
An accordion expands and collapses sections under their headers. It supports one or several open sections, sections that stay open, icons, three appearances and sections that are created when first opened.
|
|
6
6
|
|
package/docs/actionsheet.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ActionSheet
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A list of commands that slides up from the bottom of the screen, built from the kit's menu items and sized for touch. It supports a title, a message and a separate Cancel button. A context menu uses it on touch screens.
|
|
6
6
|
|
package/docs/appbar.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppBar
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
The top bar of an application, with a navigation button, a logo, a title, a control and commands. The commands are a `Toolbar`, so those that do not fit move into a menu.
|
|
6
6
|
|
package/docs/appmenu-api.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu: Programmatic changes
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
Items can be added, removed, moved and changed at any time, by their keys. Items that stay keep their place, and pages that were opened keep their state.
|
|
6
6
|
|
package/docs/appmenu-search.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu: Slots and search
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
The list can hold the app’s own content above and under its items, such as the user’s name or the version, and a search that narrows a long list as the user types.
|
|
6
6
|
|
package/docs/appmenu.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
The main menu of an application. It slides in from the start edge with a list of items, and each item shows its own page beside the list or runs a command. The menu holds nothing of its own: the items, the pages and the commands are given by the application.
|
|
6
6
|
|
package/docs/avatar.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Avatar and AvatarGroup
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
Represents a person with a picture, initials or an icon, with an optional presence indicator on its corner. A group stacks or spreads avatars and counts the ones it does not show.
|
|
6
6
|
|
package/docs/badge.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A short text, count or dot, shown inline or on the corner of a button, avatar or icon. A count above its maximum displays as “99+”, and a count of zero is hidden.
|
|
6
6
|
|
package/docs/bar-gauge-angles.md
CHANGED
package/docs/bar-gauge-data.md
CHANGED
package/docs/bar-gauge-labels.md
CHANGED
package/docs/bar-gauge.md
CHANGED
package/docs/barcode.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Barcode
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A linear barcode, drawn as vectors: Code 128, Code 39, EAN-13, EAN-8, UPC-A or Interleaved 2 of 5. It has no dependencies, works out check digits and refuses a value the format cannot hold.
|
|
6
6
|
|
package/docs/bottomnavigation.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BottomNavigation
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
The destinations of an application at the bottom of the screen, each an icon with a label. The bar is one Tab stop, marks the selected item for screen readers and keeps clear of the home indicator of a phone.
|
|
6
6
|
|
package/docs/bottomsheet.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BottomSheet
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A panel that slides up from the bottom of the page or a container and stops at set heights: peek, half, full, the height of its content, or custom values. Users can drag it by its handle and title, flick it, and swipe down to close it. It can be modal or non-modal, and the back button closes it on phones.
|
|
6
6
|
|
package/docs/breadcrumb.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Breadcrumb
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
Shows the path to the current page. Each step is a link or button, and the current page comes last. Steps that do not fit move into a menu after the first step.
|
|
6
6
|
|
package/docs/button.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Button
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A native `<button>` styled with design tokens. It comes in three variants, three tones and three sizes, and supports an icon and an `&` access key. A button can act as a toggle, indicate that work is in progress, and open a menu or any other content, either from the whole button or from an arrow next to it with `split`, so the button keeps its own action.
|
|
6
6
|
|
package/docs/buttongroup.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ButtonGroup
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A set of related buttons, used as a segmented selection of one or more options or as a row of actions. The buttons are standard kit buttons and are attached by default.
|
|
6
6
|
|
package/docs/buttons.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Buttons
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
Buttons start commands. The group covers single buttons, groups of them and a floating button for the main action of a screen. Toolbars and menus, which hold the many commands of an application, are in [Navigation](navigation.md).
|
|
6
6
|
|
package/docs/calendar.md
CHANGED
package/docs/card.md
CHANGED
package/docs/chart-bars.md
CHANGED
package/docs/chart-candles.md
CHANGED
package/docs/chart-funnel.md
CHANGED
package/docs/chart-heatmap.md
CHANGED
package/docs/chart-lines.md
CHANGED
package/docs/chart-live.md
CHANGED
package/docs/chart-pie.md
CHANGED
package/docs/chart-radar.md
CHANGED
package/docs/chart-ranges.md
CHANGED
package/docs/chart-references.md
CHANGED
package/docs/chart-scatter.md
CHANGED
package/docs/chart-waterfall.md
CHANGED
package/docs/chart-zoom.md
CHANGED
package/docs/chart.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chart
|
|
2
2
|
|
|
3
|
-
> Charts · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Charts · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
Displays lines, areas, bars, scatter points and bubbles on a shared value axis. The chart has no dependencies, takes its appearance from the design language, and makes every value available through the keyboard and a table view.
|
|
6
6
|
|
package/docs/chat.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chat
|
|
2
2
|
|
|
3
|
-
> AI chat · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AI chat · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A conversation with a model, drawn by turn: the user’s question, then what the model did, in order — its thinking, text, tool calls, to-do list — each with a dot at its start. The chat draws everything, and your app talks to the model and writes the reply. There is no built-in provider: any streaming API connects through `reply()`.
|
|
6
6
|
|
package/docs/checkbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CheckBox
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.18
|
|
4
4
|
|
|
5
5
|
A check box with a label that can be checked, unchecked or indeterminate. It supports an optional three-state cycle, read-only and required states, and validation with its group. It is a native check box styled with design tokens.
|
|
6
6
|
|