@mmlogic/components 0.4.0 → 0.4.2

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.
Files changed (92) hide show
  1. package/dist/cjs/index.cjs.js +8 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  4. package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_24.cjs.entry.js} +348 -39
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +14 -1
  7. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +22 -7
  8. package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +8 -5
  9. package/dist/collection/components/documents/mrd-document-list/tree-view.js +13 -1
  10. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +39 -29
  11. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +109 -8
  12. package/dist/collection/components/documents/mrd-file-preview/file-preview-kind.js +30 -0
  13. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +59 -0
  14. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +212 -0
  15. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
  16. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
  17. package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
  18. package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
  19. package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
  20. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +1 -1
  21. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
  22. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
  23. package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
  24. package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
  25. package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
  26. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
  27. package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
  28. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +5 -0
  29. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +91 -8
  30. package/dist/collection/components/table/mrd-table/mrd-table.css +20 -0
  31. package/dist/collection/components/table/mrd-table/mrd-table.js +124 -5
  32. package/dist/collection/components/table/mrd-table/virtual-scroll.js +14 -0
  33. package/dist/collection/dev/api.js +9 -0
  34. package/dist/collection/dev/app.js +101 -3
  35. package/dist/collection/dev/example-data.js +24 -0
  36. package/dist/collection/types/client-layout.js +8 -0
  37. package/dist/collection/utils/i18n.js +40 -0
  38. package/dist/components/client-layout.js +1 -1
  39. package/dist/components/i18n.js +1 -1
  40. package/dist/components/index.js +1 -1
  41. package/dist/components/mrd-boolean-field2.js +1 -1
  42. package/dist/components/mrd-currency-field2.js +1 -1
  43. package/dist/components/mrd-date-field2.js +1 -1
  44. package/dist/components/mrd-datetime-field2.js +1 -1
  45. package/dist/components/mrd-document-container2.js +1 -1
  46. package/dist/components/mrd-document-list2.js +1 -1
  47. package/dist/components/mrd-document-view2.js +1 -1
  48. package/dist/components/mrd-email-field2.js +1 -1
  49. package/dist/components/mrd-file-field2.js +1 -1
  50. package/dist/components/mrd-file-preview.d.ts +11 -0
  51. package/dist/components/mrd-file-preview.js +1 -0
  52. package/dist/components/mrd-file-preview2.js +1 -0
  53. package/dist/components/mrd-image-field2.js +1 -1
  54. package/dist/components/mrd-layout-section.js +1 -1
  55. package/dist/components/mrd-longtext-field2.js +1 -1
  56. package/dist/components/mrd-number-field2.js +1 -1
  57. package/dist/components/mrd-secret-field2.js +1 -1
  58. package/dist/components/mrd-table2.js +1 -1
  59. package/dist/components/mrd-text-field2.js +1 -1
  60. package/dist/components/mrd-textarea-field2.js +1 -1
  61. package/dist/components/mrd-time-field2.js +1 -1
  62. package/dist/esm/index.js +9 -1
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/mosterdcomponents.js +1 -1
  65. package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_24.entry.js} +349 -41
  66. package/dist/mosterdcomponents/cell-renderer-PbcEU4ph.js.map +1 -0
  67. package/dist/mosterdcomponents/client-layout-DCOAAH92.js.map +1 -0
  68. package/dist/mosterdcomponents/field-helpers-CASS3akr.js.map +1 -0
  69. package/dist/mosterdcomponents/file-upload-common-D1ndi6cN.js.map +1 -0
  70. package/dist/mosterdcomponents/format-BAfsQfy1.js.map +1 -0
  71. package/dist/mosterdcomponents/i18n-B1IIkRF9.js.map +1 -0
  72. package/dist/mosterdcomponents/index-AokUFVX0.js.map +1 -0
  73. package/dist/mosterdcomponents/index-CprJSlzK.js.map +1 -0
  74. package/dist/mosterdcomponents/index.esm.js +1 -1
  75. package/dist/mosterdcomponents/index.esm.js.map +1 -0
  76. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  77. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
  78. package/dist/mosterdcomponents/p-aae8a9dc.entry.js +1 -0
  79. package/dist/mosterdcomponents/query-params-B1HfnMOl.js.map +1 -0
  80. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
  81. package/dist/mosterdcomponents/validation-DbEViuiw.js.map +1 -0
  82. package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +6 -2
  83. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +29 -1
  84. package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +9 -0
  85. package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +41 -0
  86. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +17 -1
  87. package/dist/types/components/table/mrd-table/mrd-table.d.ts +23 -0
  88. package/dist/types/components/table/mrd-table/virtual-scroll.d.ts +7 -0
  89. package/dist/types/components.d.ts +194 -7
  90. package/dist/types/types/client-layout.d.ts +10 -0
  91. package/package.json +1 -1
  92. package/dist/mosterdcomponents/p-9b3c0917.entry.js +0 -1
@@ -6,10 +6,10 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
9
- import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
9
+ import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
10
10
  import { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
11
11
  export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
12
- export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
12
+ export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
13
13
  export { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
14
14
  export namespace Components {
15
15
  interface MrdBooleanField {
@@ -245,6 +245,16 @@ export namespace Components {
245
245
  * @default navigator.language
246
246
  */
247
247
  "locale": string;
248
+ /**
249
+ * Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
250
+ * @default 640
251
+ */
252
+ "previewHeight": number;
253
+ /**
254
+ * Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
255
+ * @default ''
256
+ */
257
+ "previewUrl": string;
248
258
  }
249
259
  interface MrdEmailField {
250
260
  /**
@@ -318,6 +328,40 @@ export namespace Components {
318
328
  */
319
329
  "value": unknown;
320
330
  }
331
+ /**
332
+ * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
333
+ * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
334
+ * presentational: the signed URL is used directly as element `src` — a
335
+ * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
336
+ * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
337
+ * `setImagePreview` on mrd-layout-section.
338
+ */
339
+ interface MrdFilePreview {
340
+ /**
341
+ * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
342
+ * @default ''
343
+ */
344
+ "fileName": string;
345
+ /**
346
+ * The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
347
+ * @default ''
348
+ */
349
+ "href": string;
350
+ /**
351
+ * @default navigator.language
352
+ */
353
+ "locale": string;
354
+ /**
355
+ * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
356
+ * @default ''
357
+ */
358
+ "mimeType": string;
359
+ /**
360
+ * Signed URL to render.
361
+ * @default ''
362
+ */
363
+ "src": string;
364
+ }
321
365
  interface MrdForm {
322
366
  "layout": ClientLayout;
323
367
  /**
@@ -425,6 +469,11 @@ export namespace Components {
425
469
  * @default {}
426
470
  */
427
471
  "data": Record<string, unknown>;
472
+ /**
473
+ * Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
474
+ * @default 640
475
+ */
476
+ "documentPreviewHeight": number;
428
477
  /**
429
478
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
430
479
  * @default []
@@ -443,6 +492,10 @@ export namespace Components {
443
492
  * Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field).
444
493
  */
445
494
  "openImagePreview": (url: string) => Promise<void>;
495
+ /**
496
+ * Provide a resolved signed URL for the commons.document archetype's inline file preview, in response to mrdLoadDocumentPreview.
497
+ */
498
+ "setDocumentPreviewUrl": (url: string) => Promise<void>;
446
499
  /**
447
500
  * Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox.
448
501
  */
@@ -687,6 +740,11 @@ export namespace Components {
687
740
  * @default ''
688
741
  */
689
742
  "parentId": string;
743
+ /**
744
+ * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
745
+ * @default REQUEST_TIMEOUT_MS
746
+ */
747
+ "requestTimeoutMs": number;
690
748
  /**
691
749
  * Row height in px — used for spacer and scroll-position maths.
692
750
  * @default 36
@@ -843,6 +901,10 @@ export interface MrdFileFieldCustomEvent<T> extends CustomEvent<T> {
843
901
  detail: T;
844
902
  target: HTMLMrdFileFieldElement;
845
903
  }
904
+ export interface MrdFilePreviewCustomEvent<T> extends CustomEvent<T> {
905
+ detail: T;
906
+ target: HTMLMrdFilePreviewElement;
907
+ }
846
908
  export interface MrdFormCustomEvent<T> extends CustomEvent<T> {
847
909
  detail: T;
848
910
  target: HTMLMrdFormElement;
@@ -972,7 +1034,7 @@ declare global {
972
1034
  "mrdLoadPage": { page: number; sort: string; path: string; qs: string; nodeId?: string };
973
1035
  "mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
974
1036
  "mrdLoadAggregations": { path: string; qs: string; aggQs: string };
975
- "mrdNavigate": { href?: string; label: string };
1037
+ "mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour };
976
1038
  "mrdAction": { action: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
977
1039
  "mrdUpdateObject": { href: string; values: Record<string, unknown> };
978
1040
  "mrdUpload": { file: File };
@@ -1044,6 +1106,7 @@ declare global {
1044
1106
  interface HTMLMrdDocumentViewElementEventMap {
1045
1107
  "mrdNavigate": { href?: string; label: string };
1046
1108
  "mrdDownload": { href: string; fileName: string };
1109
+ "mrdLoadPreview": { href: string };
1047
1110
  }
1048
1111
  /**
1049
1112
  * Archetype-driven single-document view. Given a `commons.document` binding and a
@@ -1126,6 +1189,32 @@ declare global {
1126
1189
  prototype: HTMLMrdFileFieldElement;
1127
1190
  new (): HTMLMrdFileFieldElement;
1128
1191
  };
1192
+ interface HTMLMrdFilePreviewElementEventMap {
1193
+ "mrdPreviewReload": void;
1194
+ "mrdDownload": { href: string; fileName: string };
1195
+ }
1196
+ /**
1197
+ * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1198
+ * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1199
+ * presentational: the signed URL is used directly as element `src` — a
1200
+ * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1201
+ * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1202
+ * `setImagePreview` on mrd-layout-section.
1203
+ */
1204
+ interface HTMLMrdFilePreviewElement extends Components.MrdFilePreview, HTMLStencilElement {
1205
+ addEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1206
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1207
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1208
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1209
+ removeEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1210
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1211
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1212
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1213
+ }
1214
+ var HTMLMrdFilePreviewElement: {
1215
+ prototype: HTMLMrdFilePreviewElement;
1216
+ new (): HTMLMrdFilePreviewElement;
1217
+ };
1129
1218
  interface HTMLMrdFormElementEventMap {
1130
1219
  "mrdSubmit": Record<string, unknown>;
1131
1220
  "mrdCancel": void;
@@ -1185,11 +1274,12 @@ declare global {
1185
1274
  new (): HTMLMrdImageFieldElement;
1186
1275
  };
1187
1276
  interface HTMLMrdLayoutSectionElementEventMap {
1188
- "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate };
1277
+ "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour };
1189
1278
  "mrdSearch": { query: string; dataClass: string };
1190
1279
  "mrdDownload": { href: string; fileName: string };
1191
1280
  "mrdLoadViewPage": { name: string; page: number; sort: string; path: string; qs: string; nodeId?: string };
1192
1281
  "mrdLoadImage": { fieldName: string; href: string };
1282
+ "mrdLoadDocumentPreview": { href: string };
1193
1283
  "mrdViewAction": { name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
1194
1284
  "mrdLoadViewAggregations": { name: string; dataClass: string; path: string; qs: string; aggQs: string };
1195
1285
  "mrdLoadViewDistinct": { name: string; nodeId: string; distinct: string; path: string; qs: string };
@@ -1305,6 +1395,7 @@ declare global {
1305
1395
  };
1306
1396
  interface HTMLMrdTableElementEventMap {
1307
1397
  "mrdLoadPage": { page: number; sort: string; path: string; qs: string };
1398
+ "mrdPageError": { page: number };
1308
1399
  "mrdRowClick": Record<string, any>;
1309
1400
  "mrdAction": { action: string; path?: string; qs?: string; dataClass?: string; parentPath?: string | null; basicType?: string };
1310
1401
  "mrdDownload": { href: string; fileName: string };
@@ -1389,6 +1480,7 @@ declare global {
1389
1480
  "mrd-email-field": HTMLMrdEmailFieldElement;
1390
1481
  "mrd-field": HTMLMrdFieldElement;
1391
1482
  "mrd-file-field": HTMLMrdFileFieldElement;
1483
+ "mrd-file-preview": HTMLMrdFilePreviewElement;
1392
1484
  "mrd-form": HTMLMrdFormElement;
1393
1485
  "mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
1394
1486
  "mrd-image-field": HTMLMrdImageFieldElement;
@@ -1573,9 +1665,9 @@ declare namespace LocalJSX {
1573
1665
  */
1574
1666
  "onMrdLoadPage"?: (event: MrdDocumentContainerCustomEvent<{ page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
1575
1667
  /**
1576
- * A row / document was activated. Host routes to the object page.
1668
+ * A row / document was activated. Host routes to the object page. Documents are always the "quick look" use case, so navigateBehaviour is hardcoded to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in mrd-layout-section, which takes it from the item's configuration.
1577
1669
  */
1578
- "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string }>) => void;
1670
+ "onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => void;
1579
1671
  /**
1580
1672
  * Generic "update an existing object" request, re-emitted from the folder tree (a document was dragged into another folder/container).
1581
1673
  */
@@ -1690,10 +1782,24 @@ declare namespace LocalJSX {
1690
1782
  * Download the document file. Host resolves the href to a signed URL.
1691
1783
  */
1692
1784
  "onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
1785
+ /**
1786
+ * The file slot has an href and needs a signed URL for inline preview. Fired once on load and again whenever the file href changes (e.g. the overlay is reused for a different document via prev/next). Host resolves it and calls back with `previewUrl` — the same pattern as mrdLoadImage / setImagePreview on mrd-layout-section.
1787
+ */
1788
+ "onMrdLoadPreview"?: (event: MrdDocumentViewCustomEvent<{ href: string }>) => void;
1693
1789
  /**
1694
1790
  * Navigate to the container (dossier). Host resolves the href and routes.
1695
1791
  */
1696
1792
  "onMrdNavigate"?: (event: MrdDocumentViewCustomEvent<{ href?: string; label: string }>) => void;
1793
+ /**
1794
+ * Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
1795
+ * @default 640
1796
+ */
1797
+ "previewHeight"?: number;
1798
+ /**
1799
+ * Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
1800
+ * @default ''
1801
+ */
1802
+ "previewUrl"?: string;
1697
1803
  }
1698
1804
  interface MrdEmailField {
1699
1805
  /**
@@ -1780,6 +1886,48 @@ declare namespace LocalJSX {
1780
1886
  */
1781
1887
  "value"?: unknown;
1782
1888
  }
1889
+ /**
1890
+ * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
1891
+ * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
1892
+ * presentational: the signed URL is used directly as element `src` — a
1893
+ * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
1894
+ * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
1895
+ * `setImagePreview` on mrd-layout-section.
1896
+ */
1897
+ interface MrdFilePreview {
1898
+ /**
1899
+ * Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
1900
+ * @default ''
1901
+ */
1902
+ "fileName"?: string;
1903
+ /**
1904
+ * The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
1905
+ * @default ''
1906
+ */
1907
+ "href"?: string;
1908
+ /**
1909
+ * @default navigator.language
1910
+ */
1911
+ "locale"?: string;
1912
+ /**
1913
+ * Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
1914
+ * @default ''
1915
+ */
1916
+ "mimeType"?: string;
1917
+ /**
1918
+ * Download the file. Same shape as mrd-document-view / mrd-layout-section's mrdDownload — host resolves `href` to a signed URL.
1919
+ */
1920
+ "onMrdDownload"?: (event: MrdFilePreviewCustomEvent<{ href: string; fileName: string }>) => void;
1921
+ /**
1922
+ * The image failed to load — most likely an expired signed URL. Host should fetch a fresh signed URL and update `src`. Note: this is only raised for images. Browsers don't reliably surface HTTP-level failures (e.g. a 403 on an expired URL) through an iframe's load/error events, so the same detection isn't available for PDFs.
1923
+ */
1924
+ "onMrdPreviewReload"?: (event: MrdFilePreviewCustomEvent<void>) => void;
1925
+ /**
1926
+ * Signed URL to render.
1927
+ * @default ''
1928
+ */
1929
+ "src"?: string;
1930
+ }
1783
1931
  interface MrdForm {
1784
1932
  "layout": ClientLayout;
1785
1933
  /**
@@ -1899,6 +2047,11 @@ declare namespace LocalJSX {
1899
2047
  * @default {}
1900
2048
  */
1901
2049
  "data"?: Record<string, unknown>;
2050
+ /**
2051
+ * Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
2052
+ * @default 640
2053
+ */
2054
+ "documentPreviewHeight"?: number;
1902
2055
  /**
1903
2056
  * Items from one layout entry in ClientDashboardMetadata.layouts[].
1904
2057
  * @default []
@@ -1918,6 +2071,10 @@ declare namespace LocalJSX {
1918
2071
  */
1919
2072
  "onMrdCreateObject"?: (event: MrdLayoutSectionCustomEvent<{ name: string; path: string; values: Record<string, unknown> }>) => void;
1920
2073
  "onMrdDownload"?: (event: MrdLayoutSectionCustomEvent<{ href: string; fileName: string }>) => void;
2074
+ /**
2075
+ * Re-emitted from an embedded mrd-document-view's mrdLoadPreview (commons.document single-object view); host resolves the file href to a signed URL and calls setDocumentPreviewUrl().
2076
+ */
2077
+ "onMrdLoadDocumentPreview"?: (event: MrdLayoutSectionCustomEvent<{ href: string }>) => void;
1921
2078
  /**
1922
2079
  * Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview().
1923
2080
  */
@@ -1934,7 +2091,7 @@ declare namespace LocalJSX {
1934
2091
  * Re-emitted from an embedded mrd-table's or mrd-document-list's mrdLoadPage; host fetches the rows and calls setViewPage(). `nodeId` is present for a document-list folder load.
1935
2092
  */
1936
2093
  "onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
1937
- "onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate }>) => void;
2094
+ "onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => void;
1938
2095
  "onMrdSearch"?: (event: MrdLayoutSectionCustomEvent<{ query: string; dataClass: string }>) => void;
1939
2096
  /**
1940
2097
  * Generic "update an existing object" request from an embedded document view (a document dragged into another folder). Host PATCHes `href` with `values`.
@@ -2175,6 +2332,10 @@ declare namespace LocalJSX {
2175
2332
  * 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".
2176
2333
  */
2177
2334
  "onMrdLoadPage"?: (event: MrdTableCustomEvent<{ page: number; sort: string; path: string; qs: string }>) => void;
2335
+ /**
2336
+ * Fired when a page request timed out MAX_RETRY_ATTEMPTS times without setPage() being called. Purely informational — the table shows its own retry row regardless of whether a host listens.
2337
+ */
2338
+ "onMrdPageError"?: (event: MrdTableCustomEvent<{ page: number }>) => void;
2178
2339
  /**
2179
2340
  * Fired when a data row is clicked. Detail is the full row object including _links.
2180
2341
  */
@@ -2189,6 +2350,11 @@ declare namespace LocalJSX {
2189
2350
  * @default ''
2190
2351
  */
2191
2352
  "parentId"?: string;
2353
+ /**
2354
+ * Time (ms) to wait for setPage() before retrying a page request; after MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages).
2355
+ * @default REQUEST_TIMEOUT_MS
2356
+ */
2357
+ "requestTimeoutMs"?: number;
2192
2358
  /**
2193
2359
  * Row height in px — used for spacer and scroll-position maths.
2194
2360
  * @default 36
@@ -2348,6 +2514,8 @@ declare namespace LocalJSX {
2348
2514
  }
2349
2515
  interface MrdDocumentViewAttributes {
2350
2516
  "locale": string;
2517
+ "previewUrl": string;
2518
+ "previewHeight": number;
2351
2519
  }
2352
2520
  interface MrdEmailFieldAttributes {
2353
2521
  "name": string;
@@ -2370,6 +2538,13 @@ declare namespace LocalJSX {
2370
2538
  "accept": string;
2371
2539
  "maxSize": number;
2372
2540
  }
2541
+ interface MrdFilePreviewAttributes {
2542
+ "src": string;
2543
+ "mimeType": string;
2544
+ "fileName": string;
2545
+ "href": string;
2546
+ "locale": string;
2547
+ }
2373
2548
  interface MrdFormAttributes {
2374
2549
  "locale": string;
2375
2550
  "referenceHref": string;
@@ -2396,6 +2571,7 @@ declare namespace LocalJSX {
2396
2571
  }
2397
2572
  interface MrdLayoutSectionAttributes {
2398
2573
  "locale": string;
2574
+ "documentPreviewHeight": number;
2399
2575
  }
2400
2576
  interface MrdListFieldAttributes {
2401
2577
  "name": string;
@@ -2456,6 +2632,7 @@ declare namespace LocalJSX {
2456
2632
  "pageSize": number;
2457
2633
  "rowHeight": number;
2458
2634
  "tableHeight": number;
2635
+ "requestTimeoutMs": number;
2459
2636
  }
2460
2637
  interface MrdTextFieldAttributes {
2461
2638
  "name": string;
@@ -2495,6 +2672,7 @@ declare namespace LocalJSX {
2495
2672
  "mrd-email-field": Omit<MrdEmailField, keyof MrdEmailFieldAttributes> & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes]?: MrdEmailField[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `attr:${K}`]?: MrdEmailFieldAttributes[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `prop:${K}`]?: MrdEmailField[K] };
2496
2673
  "mrd-field": Omit<MrdField, keyof MrdFieldAttributes> & { [K in keyof MrdField & keyof MrdFieldAttributes]?: MrdField[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `attr:${K}`]?: MrdFieldAttributes[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `prop:${K}`]?: MrdField[K] };
2497
2674
  "mrd-file-field": Omit<MrdFileField, keyof MrdFileFieldAttributes> & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes]?: MrdFileField[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `attr:${K}`]?: MrdFileFieldAttributes[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `prop:${K}`]?: MrdFileField[K] };
2675
+ "mrd-file-preview": Omit<MrdFilePreview, keyof MrdFilePreviewAttributes> & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes]?: MrdFilePreview[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `attr:${K}`]?: MrdFilePreviewAttributes[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `prop:${K}`]?: MrdFilePreview[K] };
2498
2676
  "mrd-form": Omit<MrdForm, keyof MrdFormAttributes> & { [K in keyof MrdForm & keyof MrdFormAttributes]?: MrdForm[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `attr:${K}`]?: MrdFormAttributes[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `prop:${K}`]?: MrdForm[K] };
2499
2677
  "mrd-hyperlink-field": Omit<MrdHyperlinkField, keyof MrdHyperlinkFieldAttributes> & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes]?: MrdHyperlinkField[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `attr:${K}`]?: MrdHyperlinkFieldAttributes[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `prop:${K}`]?: MrdHyperlinkField[K] };
2500
2678
  "mrd-image-field": Omit<MrdImageField, keyof MrdImageFieldAttributes> & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes]?: MrdImageField[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `attr:${K}`]?: MrdImageFieldAttributes[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `prop:${K}`]?: MrdImageField[K] };
@@ -2559,6 +2737,15 @@ declare module "@stencil/core" {
2559
2737
  "mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
2560
2738
  "mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
2561
2739
  "mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
2740
+ /**
2741
+ * Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
2742
+ * or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
2743
+ * presentational: the signed URL is used directly as element `src` — a
2744
+ * navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
2745
+ * the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
2746
+ * `setImagePreview` on mrd-layout-section.
2747
+ */
2748
+ "mrd-file-preview": LocalJSX.IntrinsicElements["mrd-file-preview"] & JSXBase.HTMLAttributes<HTMLMrdFilePreviewElement>;
2562
2749
  "mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
2563
2750
  "mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
2564
2751
  "mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
@@ -48,6 +48,12 @@ export declare enum ClientLayoutItemRelationEditBehavior {
48
48
  DROPDOWN = "DROPDOWN",
49
49
  CHECKBOX = "CHECKBOX"
50
50
  }
51
+ /** How navigating from a row/document in this VIEW or RELATED_VIEW should open
52
+ * its target: a full page navigation, or an overlay on top of the current page. */
53
+ export declare enum ClientLayoutNavigateBehaviour {
54
+ PAGE = "PAGE",
55
+ OVERLAY_PAGE = "OVERLAY_PAGE"
56
+ }
51
57
  /** A single sub-link within a multi-value relation link. */
52
58
  export interface DataObjectSubLink {
53
59
  href: string;
@@ -233,6 +239,10 @@ export interface ClientLayoutItem {
233
239
  * the `commons.document` archetype's `container` slot, the view is a single
234
240
  * container context (see mrd-document-list seeding). */
235
241
  inverseRelation?: string | null;
242
+ /** How navigating out of this VIEW/RELATED_VIEW opens its target. Defaults to
243
+ * `PAGE` (full navigation) when absent. mrd-layout-section reads this off the
244
+ * item and includes it in the mrdNavigate event detail it relays upward. */
245
+ navigateBehaviour?: ClientLayoutNavigateBehaviour;
236
246
  icon?: string | null;
237
247
  navigationType?: string | null;
238
248
  actionType?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmlogic/components",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Stencil.js web component library for dynamic forms and virtual-scroll data tables",
5
5
  "license": "MIT",
6
6
  "author": "Mosterd",