@mmlogic/components 0.2.0 → 0.3.0
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/mrd-boolean-field_19.cjs.entry.js +228 -159
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +57 -178
- package/dist/collection/components/mrd-table/mrd-table.js +222 -186
- package/dist/collection/dev/api.js +23 -6
- package/dist/collection/dev/app.js +365 -268
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_19.entry.js +228 -159
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-f6d0f02b.entry.js +1 -0
- package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +16 -29
- package/dist/types/components/mrd-table/mrd-table.d.ts +36 -24
- package/dist/types/components.d.ts +39 -85
- package/dist/types/types/client-layout.d.ts +14 -15
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-61ef0232.entry.js +0 -1
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import { AggregationResult } from '../../types/client-layout';
|
|
2
|
+
import { ColumnFilter } from '../../utils/cell-renderer';
|
|
3
|
+
import { AggregationResult, ClientLayoutItem } from '../../types/client-layout';
|
|
4
4
|
export declare class MrdTable {
|
|
5
5
|
el: HTMLElement;
|
|
6
6
|
private pendingPages;
|
|
7
7
|
private debounceTimer;
|
|
8
8
|
private outsideClickHandler;
|
|
9
9
|
private keydownHandler;
|
|
10
|
-
|
|
10
|
+
/** The VIEW or RELATED_VIEW layout item. Contains view config, dataClass, fromClass, actions etc. */
|
|
11
|
+
item: ClientLayoutItem | null;
|
|
12
|
+
/** Parent record id — required for RELATED_VIEW to build /{fromClass}/{parentId}/{dataClass}. */
|
|
13
|
+
parentId: string;
|
|
11
14
|
/** Direct rows (non-paginated mode, used when totalElements === 0). */
|
|
12
15
|
rows: Record<string, any>[];
|
|
13
16
|
locale: string;
|
|
@@ -19,19 +22,12 @@ export declare class MrdTable {
|
|
|
19
22
|
rowHeight: number;
|
|
20
23
|
/** Height of the scroll container in px. */
|
|
21
24
|
tableHeight: number;
|
|
22
|
-
/** Initial sort applied on load, e.g. "timestamp,desc" or "name".
|
|
23
|
-
* Parsed by init() into sortField + sortDir. */
|
|
24
|
-
defaultSort: string;
|
|
25
|
-
/** Toolbar action buttons rendered above the table. */
|
|
26
|
-
actions: TableAction[];
|
|
27
|
-
/** Display label of the current view — shown in the toolbar center as a view picker trigger. */
|
|
28
|
-
viewLabel: string;
|
|
29
|
-
/** Alternative views available for this table; renders a dropdown when non-empty. */
|
|
30
|
-
alternativeViews: AlternativeView[];
|
|
31
25
|
/** Clamp renderEnd when totalElements shrinks (e.g. after a filter is applied). */
|
|
32
26
|
totalElementsChanged(newVal: number): void;
|
|
33
|
-
/**
|
|
34
|
-
|
|
27
|
+
/** Reset to primary view when the item prop is replaced from outside. */
|
|
28
|
+
itemChanged(newVal: ClientLayoutItem | null): void;
|
|
29
|
+
/** Index into allViews[] for the currently displayed view. 0 = primary, 1+ = alternatives. */
|
|
30
|
+
private activeViewIdx;
|
|
35
31
|
loadedPages: Map<number, Record<string, any>[]>;
|
|
36
32
|
requestedPages: Set<number>;
|
|
37
33
|
renderStart: number;
|
|
@@ -65,27 +61,26 @@ export declare class MrdTable {
|
|
|
65
61
|
mrdLoadPage: EventEmitter<{
|
|
66
62
|
page: number;
|
|
67
63
|
sort: string;
|
|
64
|
+
path: string;
|
|
65
|
+
qs: string;
|
|
68
66
|
}>;
|
|
69
67
|
/** Fired when a data row is clicked. Detail is the full row object including _links. */
|
|
70
68
|
mrdRowClick: EventEmitter<Record<string, any>>;
|
|
71
|
-
/** Fired when a toolbar action button is clicked.
|
|
69
|
+
/** Fired when a toolbar action button is clicked.
|
|
70
|
+
* For 'export': includes `path` (relative excel path) and `qs` (current sort+filter params).
|
|
71
|
+
* For 'create': includes `dataClass` (target type) and `parentPath` (e.g. /buyers/123 for RELATED_VIEW). */
|
|
72
72
|
mrdAction: EventEmitter<{
|
|
73
73
|
action: string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
path?: string;
|
|
75
|
+
qs?: string;
|
|
76
|
+
dataClass?: string;
|
|
77
|
+
parentPath?: string | null;
|
|
78
78
|
}>;
|
|
79
79
|
/** Fired when a FILE or IMAGE cell is clicked. Host resolves the href to a signed download URL. */
|
|
80
80
|
mrdDownload: EventEmitter<{
|
|
81
81
|
href: string;
|
|
82
82
|
fileName: string;
|
|
83
83
|
}>;
|
|
84
|
-
/** Fired when the user selects an alternative view from the view switcher dropdown. */
|
|
85
|
-
mrdSwitchView: EventEmitter<{
|
|
86
|
-
name: string;
|
|
87
|
-
class?: string;
|
|
88
|
-
}>;
|
|
89
84
|
/** Fired when aggregation totals need to be (re-)fetched.
|
|
90
85
|
* Detail contains the fields grouped by aggregate function.
|
|
91
86
|
* Host calls the /aggregations endpoint and passes the result to setAggregations(). */
|
|
@@ -93,6 +88,8 @@ export declare class MrdTable {
|
|
|
93
88
|
sum?: string[];
|
|
94
89
|
avg?: string[];
|
|
95
90
|
count?: string[];
|
|
91
|
+
path: string;
|
|
92
|
+
qs: string;
|
|
96
93
|
}>;
|
|
97
94
|
componentWillLoad(): void;
|
|
98
95
|
private applyDefaultSort;
|
|
@@ -117,6 +114,21 @@ export declare class MrdTable {
|
|
|
117
114
|
componentDidRender(): void;
|
|
118
115
|
private visibleCount;
|
|
119
116
|
private sortParam;
|
|
117
|
+
/** Stable ordered list: primary view first, then alternatives (from the item prop). */
|
|
118
|
+
private get allViews();
|
|
119
|
+
/** Relative excel export path for the current view.
|
|
120
|
+
* VIEW: /excel/{dataClass}
|
|
121
|
+
* RELATED_VIEW: /excel/{fromClass}/{parentId}/{dataClass} */
|
|
122
|
+
private buildExcelPath;
|
|
123
|
+
private buildActionDetail;
|
|
124
|
+
/** Relative data path for the current view, without query string.
|
|
125
|
+
* VIEW: /{dataClass}
|
|
126
|
+
* RELATED_VIEW: /{fromClass}/{parentId}/{dataClass} */
|
|
127
|
+
private buildDataPath;
|
|
128
|
+
/** Build query params for a page request from current sort, view filters, filterClass and active column filters. */
|
|
129
|
+
private buildQueryParams;
|
|
130
|
+
private get columns();
|
|
131
|
+
private get tableActions();
|
|
120
132
|
private colName;
|
|
121
133
|
private colDataType;
|
|
122
134
|
private buildAggregationParams;
|
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { ClientLayout, ClientLayoutItem, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult as RelationSearchResult1 } from "./types";
|
|
9
9
|
import { AggregationResult, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemNavigate, ClientViewMetadata, RelationSearchResult } from "./types/client-layout";
|
|
10
|
-
import { AlternativeView, ColumnFilter, TableAction, TableColumn } from "./utils/cell-renderer";
|
|
11
10
|
export { ClientLayout, ClientLayoutItem, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult as RelationSearchResult1 } from "./types";
|
|
12
11
|
export { AggregationResult, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemNavigate, ClientViewMetadata, RelationSearchResult } from "./types/client-layout";
|
|
13
|
-
export { AlternativeView, ColumnFilter, TableAction, TableColumn } from "./utils/cell-renderer";
|
|
14
12
|
export namespace Components {
|
|
15
13
|
interface MrdBooleanField {
|
|
16
14
|
/**
|
|
@@ -291,7 +289,7 @@ export namespace Components {
|
|
|
291
289
|
*/
|
|
292
290
|
"items": ClientLayoutItem1[];
|
|
293
291
|
/**
|
|
294
|
-
*
|
|
292
|
+
* Legacy: top-level _links from ClientDashboardMetadata. Not needed in new flat format.
|
|
295
293
|
* @default {}
|
|
296
294
|
*/
|
|
297
295
|
"links": Record<string, { href: string }>;
|
|
@@ -316,11 +314,11 @@ export namespace Components {
|
|
|
316
314
|
*/
|
|
317
315
|
"setViewAggregations": (name: string, data: any) => Promise<void>;
|
|
318
316
|
/**
|
|
319
|
-
* Inject data into an embedded mrd-table for a RELATED_VIEW or VIEW item. Pass totalElements
|
|
317
|
+
* Inject data into an embedded mrd-table for a RELATED_VIEW or VIEW item. Pass totalElements to update the pagination total (safe to pass on every page).
|
|
320
318
|
*/
|
|
321
|
-
"setViewPage": (name: string, page: number, rows: any[], totalElements?: number
|
|
319
|
+
"setViewPage": (name: string, page: number, rows: any[], totalElements?: number) => Promise<void>;
|
|
322
320
|
/**
|
|
323
|
-
*
|
|
321
|
+
* Legacy: view metadata map (ClientDashboardMetadata.views). Not needed in new flat format.
|
|
324
322
|
* @default {}
|
|
325
323
|
*/
|
|
326
324
|
"views": Record<string, ClientViewMetadata>;
|
|
@@ -482,29 +480,15 @@ export namespace Components {
|
|
|
482
480
|
"value": string | string[] | RelationSearchResult1 | RelationSearchResult1[] | null;
|
|
483
481
|
}
|
|
484
482
|
interface MrdTable {
|
|
485
|
-
/**
|
|
486
|
-
* Toolbar action buttons rendered above the table.
|
|
487
|
-
* @default []
|
|
488
|
-
*/
|
|
489
|
-
"actions": TableAction[];
|
|
490
|
-
/**
|
|
491
|
-
* Alternative views available for this table; renders a dropdown when non-empty.
|
|
492
|
-
* @default []
|
|
493
|
-
*/
|
|
494
|
-
"alternativeViews": AlternativeView[];
|
|
495
|
-
/**
|
|
496
|
-
* @default []
|
|
497
|
-
*/
|
|
498
|
-
"columns": TableColumn[];
|
|
499
|
-
/**
|
|
500
|
-
* Initial sort applied on load, e.g. "timestamp,desc" or "name". Parsed by init() into sortField + sortDir.
|
|
501
|
-
* @default ''
|
|
502
|
-
*/
|
|
503
|
-
"defaultSort": string;
|
|
504
483
|
/**
|
|
505
484
|
* Initialise (or reset) the virtual scroll. Call after setting all props and registering the mrdLoadPage listener, but before calling setPage(0, rows).
|
|
506
485
|
*/
|
|
507
486
|
"init": () => Promise<void>;
|
|
487
|
+
/**
|
|
488
|
+
* The VIEW or RELATED_VIEW layout item. Contains view config, dataClass, fromClass, actions etc.
|
|
489
|
+
* @default null
|
|
490
|
+
*/
|
|
491
|
+
"item": ClientLayoutItem1 | null;
|
|
508
492
|
/**
|
|
509
493
|
* @default navigator.language
|
|
510
494
|
*/
|
|
@@ -514,6 +498,11 @@ export namespace Components {
|
|
|
514
498
|
* @default 20
|
|
515
499
|
*/
|
|
516
500
|
"pageSize": number;
|
|
501
|
+
/**
|
|
502
|
+
* Parent record id — required for RELATED_VIEW to build /{fromClass}/{parentId}/{dataClass}.
|
|
503
|
+
* @default ''
|
|
504
|
+
*/
|
|
505
|
+
"parentId": string;
|
|
517
506
|
/**
|
|
518
507
|
* Row height in px — used for spacer and scroll-position maths.
|
|
519
508
|
* @default 36
|
|
@@ -542,11 +531,6 @@ export namespace Components {
|
|
|
542
531
|
* @default 0
|
|
543
532
|
*/
|
|
544
533
|
"totalElements": number;
|
|
545
|
-
/**
|
|
546
|
-
* Display label of the current view — shown in the toolbar center as a view picker trigger.
|
|
547
|
-
* @default ''
|
|
548
|
-
*/
|
|
549
|
-
"viewLabel": string;
|
|
550
534
|
}
|
|
551
535
|
interface MrdTextField {
|
|
552
536
|
/**
|
|
@@ -904,11 +888,10 @@ declare global {
|
|
|
904
888
|
"mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate };
|
|
905
889
|
"mrdSearch": { query: string; dataClass: string };
|
|
906
890
|
"mrdDownload": { href: string; fileName: string };
|
|
907
|
-
"
|
|
908
|
-
"mrdLoadViewPage": { name: string; page: number; sort: string; filters: ColumnFilter[] };
|
|
891
|
+
"mrdLoadViewPage": { name: string; page: number; sort: string; path: string; qs: string };
|
|
909
892
|
"mrdLoadImage": { fieldName: string; href: string };
|
|
910
|
-
"mrdViewAction": { name: string; action: string;
|
|
911
|
-
"mrdLoadViewAggregations": { name: string;
|
|
893
|
+
"mrdViewAction": { name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null };
|
|
894
|
+
"mrdLoadViewAggregations": { name: string; dataClass: string; path: string; qs: string; sum?: string[]; avg?: string[]; count?: string[] };
|
|
912
895
|
}
|
|
913
896
|
interface HTMLMrdLayoutSectionElement extends Components.MrdLayoutSection, HTMLStencilElement {
|
|
914
897
|
addEventListener<K extends keyof HTMLMrdLayoutSectionElementEventMap>(type: K, listener: (this: HTMLMrdLayoutSectionElement, ev: MrdLayoutSectionCustomEvent<HTMLMrdLayoutSectionElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -999,13 +982,11 @@ declare global {
|
|
|
999
982
|
new (): HTMLMrdRelationFieldElement;
|
|
1000
983
|
};
|
|
1001
984
|
interface HTMLMrdTableElementEventMap {
|
|
1002
|
-
"mrdLoadPage": { page: number; sort: string };
|
|
985
|
+
"mrdLoadPage": { page: number; sort: string; path: string; qs: string };
|
|
1003
986
|
"mrdRowClick": Record<string, any>;
|
|
1004
|
-
"mrdAction": { action: string };
|
|
1005
|
-
"mrdFilter": { filters: ColumnFilter[] };
|
|
987
|
+
"mrdAction": { action: string; path?: string; qs?: string; dataClass?: string; parentPath?: string | null };
|
|
1006
988
|
"mrdDownload": { href: string; fileName: string };
|
|
1007
|
-
"
|
|
1008
|
-
"mrdLoadAggregations": { sum?: string[]; avg?: string[]; count?: string[] };
|
|
989
|
+
"mrdLoadAggregations": { sum?: string[]; avg?: string[]; count?: string[]; path: string; qs: string };
|
|
1009
990
|
}
|
|
1010
991
|
interface HTMLMrdTableElement extends Components.MrdTable, HTMLStencilElement {
|
|
1011
992
|
addEventListener<K extends keyof HTMLMrdTableElementEventMap>(type: K, listener: (this: HTMLMrdTableElement, ev: MrdTableCustomEvent<HTMLMrdTableElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -1410,7 +1391,7 @@ declare namespace LocalJSX {
|
|
|
1410
1391
|
*/
|
|
1411
1392
|
"items"?: ClientLayoutItem1[];
|
|
1412
1393
|
/**
|
|
1413
|
-
*
|
|
1394
|
+
* Legacy: top-level _links from ClientDashboardMetadata. Not needed in new flat format.
|
|
1414
1395
|
* @default {}
|
|
1415
1396
|
*/
|
|
1416
1397
|
"links"?: Record<string, { href: string }>;
|
|
@@ -1423,26 +1404,22 @@ declare namespace LocalJSX {
|
|
|
1423
1404
|
* Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview().
|
|
1424
1405
|
*/
|
|
1425
1406
|
"onMrdLoadImage"?: (event: MrdLayoutSectionCustomEvent<{ fieldName: string; href: string }>) => void;
|
|
1426
|
-
/**
|
|
1427
|
-
* Fired once on load for each RELATED_VIEW and VIEW item; host fetches page 0 and calls setViewPage().
|
|
1428
|
-
*/
|
|
1429
|
-
"onMrdLoadView"?: (event: MrdLayoutSectionCustomEvent<{ name: string; href?: string; viewConfig: ClientViewMetadata; sort: string; filters: ColumnFilter[] }>) => void;
|
|
1430
1407
|
/**
|
|
1431
1408
|
* Re-emitted from an embedded mrd-table's mrdLoadAggregations; host calls setViewAggregations() with the result.
|
|
1432
1409
|
*/
|
|
1433
|
-
"onMrdLoadViewAggregations"?: (event: MrdLayoutSectionCustomEvent<{ name: string;
|
|
1410
|
+
"onMrdLoadViewAggregations"?: (event: MrdLayoutSectionCustomEvent<{ name: string; dataClass: string; path: string; qs: string; sum?: string[]; avg?: string[]; count?: string[] }>) => void;
|
|
1434
1411
|
/**
|
|
1435
1412
|
* Re-emitted from an embedded mrd-table's mrdLoadPage; host fetches the next page and calls setViewPage().
|
|
1436
1413
|
*/
|
|
1437
|
-
"onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string;
|
|
1414
|
+
"onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string; path: string; qs: string }>) => void;
|
|
1438
1415
|
"onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate }>) => void;
|
|
1439
1416
|
"onMrdSearch"?: (event: MrdLayoutSectionCustomEvent<{ query: string; dataClass: string }>) => void;
|
|
1440
1417
|
/**
|
|
1441
|
-
* Re-emitted from an embedded mrd-table's mrdAction;
|
|
1418
|
+
* Re-emitted from an embedded mrd-table's mrdAction; host builds the target URL from dataClass.
|
|
1442
1419
|
*/
|
|
1443
|
-
"onMrdViewAction"?: (event: MrdLayoutSectionCustomEvent<{ name: string; action: string;
|
|
1420
|
+
"onMrdViewAction"?: (event: MrdLayoutSectionCustomEvent<{ name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null }>) => void;
|
|
1444
1421
|
/**
|
|
1445
|
-
*
|
|
1422
|
+
* Legacy: view metadata map (ClientDashboardMetadata.views). Not needed in new flat format.
|
|
1446
1423
|
* @default {}
|
|
1447
1424
|
*/
|
|
1448
1425
|
"views"?: Record<string, ClientViewMetadata>;
|
|
@@ -1612,61 +1589,44 @@ declare namespace LocalJSX {
|
|
|
1612
1589
|
}
|
|
1613
1590
|
interface MrdTable {
|
|
1614
1591
|
/**
|
|
1615
|
-
*
|
|
1616
|
-
* @default
|
|
1617
|
-
*/
|
|
1618
|
-
"actions"?: TableAction[];
|
|
1619
|
-
/**
|
|
1620
|
-
* Alternative views available for this table; renders a dropdown when non-empty.
|
|
1621
|
-
* @default []
|
|
1622
|
-
*/
|
|
1623
|
-
"alternativeViews"?: AlternativeView[];
|
|
1624
|
-
/**
|
|
1625
|
-
* @default []
|
|
1626
|
-
*/
|
|
1627
|
-
"columns"?: TableColumn[];
|
|
1628
|
-
/**
|
|
1629
|
-
* Initial sort applied on load, e.g. "timestamp,desc" or "name". Parsed by init() into sortField + sortDir.
|
|
1630
|
-
* @default ''
|
|
1592
|
+
* The VIEW or RELATED_VIEW layout item. Contains view config, dataClass, fromClass, actions etc.
|
|
1593
|
+
* @default null
|
|
1631
1594
|
*/
|
|
1632
|
-
"
|
|
1595
|
+
"item"?: ClientLayoutItem1 | null;
|
|
1633
1596
|
/**
|
|
1634
1597
|
* @default navigator.language
|
|
1635
1598
|
*/
|
|
1636
1599
|
"locale"?: string;
|
|
1637
1600
|
/**
|
|
1638
|
-
* Fired when a toolbar action button is clicked.
|
|
1601
|
+
* Fired when a toolbar action button is clicked. For 'export': includes `path` (relative excel path) and `qs` (current sort+filter params). For 'create': includes `dataClass` (target type) and `parentPath` (e.g. /buyers/123 for RELATED_VIEW).
|
|
1639
1602
|
*/
|
|
1640
|
-
"onMrdAction"?: (event: MrdTableCustomEvent<{ action: string }>) => void;
|
|
1603
|
+
"onMrdAction"?: (event: MrdTableCustomEvent<{ action: string; path?: string; qs?: string; dataClass?: string; parentPath?: string | null }>) => void;
|
|
1641
1604
|
/**
|
|
1642
1605
|
* Fired when a FILE or IMAGE cell is clicked. Host resolves the href to a signed download URL.
|
|
1643
1606
|
*/
|
|
1644
1607
|
"onMrdDownload"?: (event: MrdTableCustomEvent<{ href: string; fileName: string }>) => void;
|
|
1645
|
-
/**
|
|
1646
|
-
* Fired when active filters change. Host translates filters to API query params.
|
|
1647
|
-
*/
|
|
1648
|
-
"onMrdFilter"?: (event: MrdTableCustomEvent<{ filters: ColumnFilter[] }>) => void;
|
|
1649
1608
|
/**
|
|
1650
1609
|
* Fired when aggregation totals need to be (re-)fetched. Detail contains the fields grouped by aggregate function. Host calls the /aggregations endpoint and passes the result to setAggregations().
|
|
1651
1610
|
*/
|
|
1652
|
-
"onMrdLoadAggregations"?: (event: MrdTableCustomEvent<{ sum?: string[]; avg?: string[]; count?: string[] }>) => void;
|
|
1611
|
+
"onMrdLoadAggregations"?: (event: MrdTableCustomEvent<{ sum?: string[]; avg?: string[]; count?: string[]; path: string; qs: string }>) => void;
|
|
1653
1612
|
/**
|
|
1654
1613
|
* Fired when a page needs to be fetched. Host fetches and calls setPage(). `sort` is the raw query-param value, e.g. "name" or "name,desc".
|
|
1655
1614
|
*/
|
|
1656
|
-
"onMrdLoadPage"?: (event: MrdTableCustomEvent<{ page: number; sort: string }>) => void;
|
|
1615
|
+
"onMrdLoadPage"?: (event: MrdTableCustomEvent<{ page: number; sort: string; path: string; qs: string }>) => void;
|
|
1657
1616
|
/**
|
|
1658
1617
|
* Fired when a data row is clicked. Detail is the full row object including _links.
|
|
1659
1618
|
*/
|
|
1660
1619
|
"onMrdRowClick"?: (event: MrdTableCustomEvent<Record<string, any>>) => void;
|
|
1661
|
-
/**
|
|
1662
|
-
* Fired when the user selects an alternative view from the view switcher dropdown.
|
|
1663
|
-
*/
|
|
1664
|
-
"onMrdSwitchView"?: (event: MrdTableCustomEvent<{ name: string; class?: string }>) => void;
|
|
1665
1620
|
/**
|
|
1666
1621
|
* Records per page (must match the API page size).
|
|
1667
1622
|
* @default 20
|
|
1668
1623
|
*/
|
|
1669
1624
|
"pageSize"?: number;
|
|
1625
|
+
/**
|
|
1626
|
+
* Parent record id — required for RELATED_VIEW to build /{fromClass}/{parentId}/{dataClass}.
|
|
1627
|
+
* @default ''
|
|
1628
|
+
*/
|
|
1629
|
+
"parentId"?: string;
|
|
1670
1630
|
/**
|
|
1671
1631
|
* Row height in px — used for spacer and scroll-position maths.
|
|
1672
1632
|
* @default 36
|
|
@@ -1687,11 +1647,6 @@ declare namespace LocalJSX {
|
|
|
1687
1647
|
* @default 0
|
|
1688
1648
|
*/
|
|
1689
1649
|
"totalElements"?: number;
|
|
1690
|
-
/**
|
|
1691
|
-
* Display label of the current view — shown in the toolbar center as a view picker trigger.
|
|
1692
|
-
* @default ''
|
|
1693
|
-
*/
|
|
1694
|
-
"viewLabel"?: string;
|
|
1695
1650
|
}
|
|
1696
1651
|
interface MrdTextField {
|
|
1697
1652
|
/**
|
|
@@ -1909,13 +1864,12 @@ declare namespace LocalJSX {
|
|
|
1909
1864
|
"value": string | string[] | RelationSearchResult | RelationSearchResult[] | null;
|
|
1910
1865
|
}
|
|
1911
1866
|
interface MrdTableAttributes {
|
|
1867
|
+
"parentId": string;
|
|
1912
1868
|
"locale": string;
|
|
1913
1869
|
"totalElements": number;
|
|
1914
1870
|
"pageSize": number;
|
|
1915
1871
|
"rowHeight": number;
|
|
1916
1872
|
"tableHeight": number;
|
|
1917
|
-
"defaultSort": string;
|
|
1918
|
-
"viewLabel": string;
|
|
1919
1873
|
}
|
|
1920
1874
|
interface MrdTextFieldAttributes {
|
|
1921
1875
|
"name": string;
|
|
@@ -119,12 +119,6 @@ export interface ClientLayoutItemNavigate {
|
|
|
119
119
|
icon?: string | null;
|
|
120
120
|
navigationType?: string | null;
|
|
121
121
|
}
|
|
122
|
-
export interface ClientLayoutItemView {
|
|
123
|
-
/** Key into the `views` map of DashboardMetadata. */
|
|
124
|
-
name: string;
|
|
125
|
-
dataClass: string;
|
|
126
|
-
showTitle: boolean;
|
|
127
|
-
}
|
|
128
122
|
export interface ClientLayoutItemRelatedView {
|
|
129
123
|
name: string;
|
|
130
124
|
fromClass?: string | null;
|
|
@@ -152,16 +146,19 @@ export interface ClientLayoutItem {
|
|
|
152
146
|
relation?: ClientLayoutItemRelation;
|
|
153
147
|
items?: ClientLayoutItem[];
|
|
154
148
|
navigate?: ClientLayoutItemNavigate;
|
|
155
|
-
view?:
|
|
149
|
+
view?: ClientViewMetadata;
|
|
156
150
|
relatedView?: ClientLayoutItemRelatedView;
|
|
157
151
|
relatedObject?: ClientLayoutItemRelatedObject;
|
|
158
152
|
search?: ClientLayoutItemSearch;
|
|
159
153
|
name?: string;
|
|
160
154
|
showTitle?: boolean;
|
|
155
|
+
/** Embedded alternative view configs (new flat format). */
|
|
161
156
|
alternativeViews?: Array<{
|
|
162
|
-
name: string;
|
|
163
157
|
label?: string;
|
|
164
|
-
|
|
158
|
+
dataClass?: string;
|
|
159
|
+
fromClass?: string | null;
|
|
160
|
+
filterClass?: string | null;
|
|
161
|
+
view?: ClientViewMetadata;
|
|
165
162
|
}>;
|
|
166
163
|
/** Toolbar buttons for embedded views. null/omitted = ["NEW","EXPORT"]; [] = none. */
|
|
167
164
|
actions?: string[] | null;
|
|
@@ -199,6 +196,11 @@ export interface ClientLayout {
|
|
|
199
196
|
tabPage?: boolean;
|
|
200
197
|
items: ClientLayoutItem[];
|
|
201
198
|
}
|
|
199
|
+
export interface ViewFilter {
|
|
200
|
+
name: string;
|
|
201
|
+
value?: string | null;
|
|
202
|
+
operator?: 'EQUALS' | 'FROM' | 'TO' | 'STARTS_WITH' | 'NOT_EMPTY' | 'EMPTY' | null;
|
|
203
|
+
}
|
|
202
204
|
export interface ClientViewMetadata {
|
|
203
205
|
name: string | null;
|
|
204
206
|
defaultView: boolean;
|
|
@@ -206,11 +208,7 @@ export interface ClientViewMetadata {
|
|
|
206
208
|
/** Column definitions — each item is a FIELD or RELATION item. */
|
|
207
209
|
values: ClientLayoutItem[];
|
|
208
210
|
/** Static query-param filters baked into the view definition. */
|
|
209
|
-
filter?:
|
|
210
|
-
name: string;
|
|
211
|
-
value?: string | null;
|
|
212
|
-
operator?: 'EQUALS' | 'FROM' | 'TO' | 'STARTS_WITH' | 'NOT_EMPTY' | 'EMPTY' | null;
|
|
213
|
-
}> | null;
|
|
211
|
+
filter?: ViewFilter[] | null;
|
|
214
212
|
type?: string;
|
|
215
213
|
referenceType?: string | null;
|
|
216
214
|
filterType?: string | null;
|
|
@@ -219,7 +217,8 @@ export interface ClientViewMetadata {
|
|
|
219
217
|
}
|
|
220
218
|
export interface ClientDashboardMetadata {
|
|
221
219
|
layouts: ClientLayout[];
|
|
222
|
-
|
|
220
|
+
/** Legacy: view metadata map keyed by generated name. Absent in new flat format. */
|
|
221
|
+
views?: Record<string, ClientViewMetadata>;
|
|
223
222
|
layoutType: ClientLayoutType;
|
|
224
223
|
_links?: Record<string, {
|
|
225
224
|
href: string;
|