@guiexpert/demo-table-models 1.1.96 → 1.1.97

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.
@@ -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;
@@ -57,6 +57,7 @@ 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;
61
62
  };
62
63
  export declare function createTimeTableModel(): TableModelIf;
@@ -18,6 +18,7 @@ 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
  };
@@ -57,6 +58,7 @@ 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;
61
63
  };
62
64
  export declare function createTreePeopleColumnDefs(): ColumnDefIf[];
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/demo-table-models",
3
- "version": "1.1.96",
3
+ "version": "1.1.97",
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.96"
34
+ "@guiexpert/table": "^1.1.97"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.11.17",