@guiexpert/demo-table-models 1.1.96 → 1.1.98
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 +6 -6
- package/index.d.ts +6 -0
- package/index.js +580 -388
- package/lib/createMasterDetailModel.d.ts +24 -0
- package/lib/createRtlCitiesModel.d.ts +20 -0
- package/lib/createTimeTableModel.d.ts +4 -2
- package/lib/treepeople/generateTreePeopleModel.d.ts +5 -2
- package/model/master-order.if.d.ts +19 -0
- package/model/rtl-city-sales.if.d.ts +23 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TableModelAndOptionsIf, TableModelIf, MasterDetailOptionsIf } from '@guiexpert/table';
|
|
2
|
+
import { MasterOrderIf } from '../model/master-order.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `count` orders with 1 … 8 items each for master/detail demos (since 1.1.97). Fixed seed: the same count gives the
|
|
6
|
+
* same orders.
|
|
7
|
+
*
|
|
8
|
+
* @param count - number of orders (default 1000)
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateMasterOrders(count?: number): MasterOrderIf[];
|
|
11
|
+
/**
|
|
12
|
+
* The table model of the items of one order – the nested table of a detail row.
|
|
13
|
+
*
|
|
14
|
+
* @param order - the master row
|
|
15
|
+
*/
|
|
16
|
+
export declare function createOrderItemsModel(order: MasterOrderIf): TableModelIf;
|
|
17
|
+
/**
|
|
18
|
+
* Master/detail demo (since 1.1.97): orders (the order number fixed on the left) – expand an order with the arrow
|
|
19
|
+
* (or Enter) and its items appear below as a second GuiExpert table over the full width.
|
|
20
|
+
*
|
|
21
|
+
* @param orders - the rows (default: 100.000 orders of {@link generateMasterOrders})
|
|
22
|
+
* @param masterDetail - overrides of the master/detail options (default: nested item table, 6 rows high)
|
|
23
|
+
*/
|
|
24
|
+
export declare function createMasterDetailModelAndOptions(orders?: MasterOrderIf[], masterDetail?: Partial<MasterDetailOptionsIf<MasterOrderIf>>): TableModelAndOptionsIf;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TableModelAndOptionsIf, TableDirection } from '@guiexpert/table';
|
|
2
|
+
import { RtlCitySalesIf } from '../model/rtl-city-sales.if.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Sales of branches in Arabic cities per month (since 1.1.98) – data for right-to-left demos. The same count and
|
|
6
|
+
* seed give the same rows.
|
|
7
|
+
*
|
|
8
|
+
* @param count - number of branches (default 2,000; cities repeat with a higher branch number)
|
|
9
|
+
* @param seed - the same seed gives the same rows
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateRtlCitySales(count?: number, seed?: number): RtlCitySalesIf[];
|
|
12
|
+
/**
|
|
13
|
+
* Right-to-left demo (since 1.1.98): Arabic headers and data, row numbers and the city fixed at the **start** (on the
|
|
14
|
+
* right in right-to-left), a calculated total fixed at the end, a total row, range selection and focus.
|
|
15
|
+
* The same model works left-to-right – pass `"ltr"` to compare.
|
|
16
|
+
*
|
|
17
|
+
* @param direction - `"rtl"` (default), `"ltr"` or `"auto"` (`tableOptions.direction`)
|
|
18
|
+
* @param rows - the rows (default: {@link generateRtlCitySales})
|
|
19
|
+
*/
|
|
20
|
+
export declare function createRtlCitiesModelAndOptions(direction?: TableDirection, rows?: RtlCitySalesIf[]): TableModelAndOptionsIf;
|
|
@@ -24,8 +24,8 @@ export declare const tableOptions: {
|
|
|
24
24
|
};
|
|
25
25
|
columnsDraggable: boolean;
|
|
26
26
|
columnsResizable: boolean;
|
|
27
|
-
overflowX: "
|
|
28
|
-
overflowY: "
|
|
27
|
+
overflowX: "auto" | "scroll";
|
|
28
|
+
overflowY: "auto" | "scroll";
|
|
29
29
|
horizontalBorderVisible: boolean;
|
|
30
30
|
verticalBorderVisible: boolean;
|
|
31
31
|
footerSeparatorBorderVisible: boolean;
|
|
@@ -57,6 +57,8 @@ export declare const tableOptions: {
|
|
|
57
57
|
overlayOptions?: Partial<import('@guiexpert/table').OverlayOptionsIf> | undefined;
|
|
58
58
|
rowDragOptions?: Partial<import('@guiexpert/table').RowDragOptionsIf> | undefined;
|
|
59
59
|
fillHandle?: boolean | Partial<import('@guiexpert/table').FillHandleOptionsIf> | undefined;
|
|
60
|
+
masterDetail?: Partial<import('@guiexpert/table').MasterDetailOptionsIf<any>> | undefined;
|
|
60
61
|
batchEdit?: boolean | Partial<import('@guiexpert/table').BatchEditOptionsIf> | undefined;
|
|
62
|
+
direction?: import('@guiexpert/table').TableDirection | undefined;
|
|
61
63
|
};
|
|
62
64
|
export declare function createTimeTableModel(): TableModelIf;
|
|
@@ -18,13 +18,14 @@ export declare function createTreePeopleTableOptions(addDemoSelection?: boolean)
|
|
|
18
18
|
autoRestoreColumnLayout: boolean;
|
|
19
19
|
autoRestoreHeaderGroupState: boolean;
|
|
20
20
|
autoRestoreCustomState: boolean;
|
|
21
|
+
autoRestoreDetailState: boolean;
|
|
21
22
|
isSame: (r1: PersonIf, r2: PersonIf, options: import('@guiexpert/table').AutoRestoreOptionsIf<PersonIf>) => boolean;
|
|
22
23
|
getRowId: (row: PersonIf) => string | number;
|
|
23
24
|
};
|
|
24
25
|
externalFilterFunction: (_value: TreeRow<PersonIf>, _index: number, _array: PersonIf[]) => boolean;
|
|
25
26
|
getSelectionModel: () => SelectionModel;
|
|
26
|
-
overflowX: "
|
|
27
|
-
overflowY: "
|
|
27
|
+
overflowX: "auto" | "scroll";
|
|
28
|
+
overflowY: "auto" | "scroll";
|
|
28
29
|
horizontalBorderVisible: boolean;
|
|
29
30
|
verticalBorderVisible: boolean;
|
|
30
31
|
footerSeparatorBorderVisible: boolean;
|
|
@@ -57,7 +58,9 @@ export declare function createTreePeopleTableOptions(addDemoSelection?: boolean)
|
|
|
57
58
|
overlayOptions?: Partial<import('@guiexpert/table').OverlayOptionsIf> | undefined;
|
|
58
59
|
rowDragOptions?: Partial<import('@guiexpert/table').RowDragOptionsIf> | undefined;
|
|
59
60
|
fillHandle?: boolean | Partial<import('@guiexpert/table').FillHandleOptionsIf> | undefined;
|
|
61
|
+
masterDetail?: Partial<import('@guiexpert/table').MasterDetailOptionsIf<any>> | undefined;
|
|
60
62
|
batchEdit?: boolean | Partial<import('@guiexpert/table').BatchEditOptionsIf> | undefined;
|
|
63
|
+
direction?: import('@guiexpert/table').TableDirection | undefined;
|
|
61
64
|
};
|
|
62
65
|
export declare function createTreePeopleColumnDefs(): ColumnDefIf[];
|
|
63
66
|
export declare function createTreePeopleModelAndOptions(addDemoSelection?: boolean): TableModelAndOptionsIf;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** One item of an order of the master/detail demo (since 1.1.97). */
|
|
2
|
+
export interface MasterOrderItemIf {
|
|
3
|
+
sku: string;
|
|
4
|
+
product: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
unitPrice: number;
|
|
7
|
+
}
|
|
8
|
+
/** An order of the master/detail demo (since 1.1.97): the master row; its items are the detail. */
|
|
9
|
+
export interface MasterOrderIf {
|
|
10
|
+
id: number;
|
|
11
|
+
orderNo: string;
|
|
12
|
+
customer: string;
|
|
13
|
+
city: string;
|
|
14
|
+
/** ISO date `YYYY-MM-DD` */
|
|
15
|
+
date: string;
|
|
16
|
+
status: string;
|
|
17
|
+
total: number;
|
|
18
|
+
items: MasterOrderItemIf[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** One row of the right-to-left demo (since 1.1.98): sales of a branch in an Arabic city per month. */
|
|
2
|
+
export interface RtlCitySalesIf {
|
|
3
|
+
id: number;
|
|
4
|
+
/** city in Arabic, e.g. "الرياض" */
|
|
5
|
+
city: string;
|
|
6
|
+
/** country in Arabic */
|
|
7
|
+
country: string;
|
|
8
|
+
/** branch code – mixed Arabic and Latin text with digits, e.g. "فرع RUH-01" */
|
|
9
|
+
branch: string;
|
|
10
|
+
/** sales per month, January (m1) … December (m12) */
|
|
11
|
+
m1: number;
|
|
12
|
+
m2: number;
|
|
13
|
+
m3: number;
|
|
14
|
+
m4: number;
|
|
15
|
+
m5: number;
|
|
16
|
+
m6: number;
|
|
17
|
+
m7: number;
|
|
18
|
+
m8: number;
|
|
19
|
+
m9: number;
|
|
20
|
+
m10: number;
|
|
21
|
+
m11: number;
|
|
22
|
+
m12: number;
|
|
23
|
+
}
|
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.98",
|
|
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.98"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^20.11.17",
|