@guiexpert/demo-table-models 1.1.92 → 1.1.94
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/index.cjs +10 -10
- package/index.d.ts +5 -0
- package/index.js +566 -409
- package/lib/createAggregationModel.d.ts +10 -0
- package/lib/createLargeModel.d.ts +14 -3
- package/lib/createPivotModel.d.ts +24 -0
- package/lib/createRowGroupModel.d.ts +21 -0
- package/model/pivot-order.if.d.ts +6 -0
- package/model/sales-order.if.d.ts +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TableModelAndOptionsIf } from '@guiexpert/table';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Aggregation demo (since 1.1.94): flat sales orders with three total rows in the footer (sum, average, maximum) and a range
|
|
5
|
+
* selection model – `tableApi.getSelectionAggregates()` gives the numbers for a status bar.
|
|
6
|
+
* The totals follow `externalFilterFunction` (set it on the returned options before the table is created).
|
|
7
|
+
*
|
|
8
|
+
* @param count - number of orders (default 50,000)
|
|
9
|
+
*/
|
|
10
|
+
export declare function createAggregationModelAndOptions(count?: number): TableModelAndOptionsIf;
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { AreaModel, CellRendererIf, TableModelAndOptionsIf } from '@guiexpert/table';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Two million rows (or `rowcount`) without row objects: an own body model computes the cells.
|
|
5
|
+
*
|
|
6
|
+
* @param rowcount - number of rows
|
|
7
|
+
* @param rowNumbersVisible - since 1.1.93: a fixed row number column in front ("#", 1 … 2,000,000)
|
|
8
|
+
*/
|
|
9
|
+
export declare function createLargeModelAndOptions(rowcount?: number, rowNumbersVisible?: boolean): TableModelAndOptionsIf;
|
|
4
10
|
export declare class LargeBodyModel extends AreaModel {
|
|
5
11
|
private rowcount;
|
|
12
|
+
private readonly columnOffset;
|
|
6
13
|
private readonly nf;
|
|
7
14
|
private barRenderer;
|
|
8
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @param rowcount - number of rows
|
|
17
|
+
* @param columnOffset - columns in front of the data columns (1 for a RowNumberColumnDef)
|
|
18
|
+
*/
|
|
19
|
+
constructor(rowcount?: number, columnOffset?: number);
|
|
9
20
|
getRowCount(): number;
|
|
10
21
|
getRowHeight(_rowIndex: number): number;
|
|
11
22
|
getConstantRowHeight(): number | undefined;
|
|
12
|
-
getValueAt(rowIndex: number,
|
|
23
|
+
getValueAt(rowIndex: number, col: number): number | string;
|
|
13
24
|
getCellRenderer(_rowIndex: number, columnIndex: number): CellRendererIf | undefined;
|
|
14
25
|
getYPosByRowIndex(rowIndex: number): number;
|
|
15
26
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RowGroupField, TableModelAndOptionsIf } from '@guiexpert/table';
|
|
2
|
+
import { PivotOrderIf } from '../model/pivot-order.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Deterministic orders for pivot demos: {@link generateSalesOrders} plus an order date between 2024-01-01 and 2026-12-31.
|
|
6
|
+
*
|
|
7
|
+
* @param count - number of orders
|
|
8
|
+
* @param seed - the same seed gives the same orders
|
|
9
|
+
*/
|
|
10
|
+
export declare function generatePivotOrders(count: number, seed?: number): PivotOrderIf[];
|
|
11
|
+
/** The year of an order (pivot field). */
|
|
12
|
+
export declare const pivotYear: RowGroupField<PivotOrderIf>;
|
|
13
|
+
/** The quarter of an order as 1 … 4, shown as "Q1" … "Q4" (pivot field). */
|
|
14
|
+
export declare const pivotQuarter: RowGroupField<PivotOrderIf>;
|
|
15
|
+
/**
|
|
16
|
+
* Pivot demo (since 1.1.94): orders by country › city (rows) × year › quarter (columns), revenue (sum of total) and
|
|
17
|
+
* number of orders, year totals (collapsible years), total column and total row. Pivot again at runtime with
|
|
18
|
+
* `tableApi.setPivotConfig({ columnFields: [pivotYear] })`.
|
|
19
|
+
*
|
|
20
|
+
* @param count - number of orders (default 50,000)
|
|
21
|
+
* @param columnFields - the column fields (default year › quarter)
|
|
22
|
+
* @param expanded - open row levels (default 0: countries closed)
|
|
23
|
+
*/
|
|
24
|
+
export declare function createPivotModelAndOptions(count?: number, columnFields?: RowGroupField<PivotOrderIf>[], expanded?: number): TableModelAndOptionsIf;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ColumnDefIf, RowGroupField, TableModelAndOptionsIf } from '@guiexpert/table';
|
|
2
|
+
import { SalesOrderIf } from '../model/sales-order.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Deterministic sales orders for row grouping demos (country, city, product, category, quantity, price, total).
|
|
6
|
+
*
|
|
7
|
+
* @param count - number of orders
|
|
8
|
+
* @param seed - the same seed gives the same orders
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateSalesOrders(count: number, seed?: number): SalesOrderIf[];
|
|
11
|
+
/** The columns of {@link generateSalesOrders}. */
|
|
12
|
+
export declare function createSalesOrderColumnDefs(): ColumnDefIf[];
|
|
13
|
+
/**
|
|
14
|
+
* Row grouping demo (since 1.1.94): orders grouped by country › city (default), with the sum of quantity and total, the
|
|
15
|
+
* average price and a total row. Regroup at runtime with `tableApi.setRowGroupBy(["category", "product"])`.
|
|
16
|
+
*
|
|
17
|
+
* @param count - number of orders (default 50,000)
|
|
18
|
+
* @param groupBy - the levels (default country › city)
|
|
19
|
+
* @param expanded - open levels (default 1: countries open, cities closed)
|
|
20
|
+
*/
|
|
21
|
+
export declare function createRowGroupModelAndOptions(count?: number, groupBy?: RowGroupField<SalesOrderIf>[], expanded?: number): TableModelAndOptionsIf;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/demo-table-models",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.94",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@guiexpert/table": "^1.1.
|
|
34
|
+
"@guiexpert/table": "^1.1.94"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^20.11.17",
|