@mmlogic/components 0.5.2 → 0.5.3

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 (105) hide show
  1. package/dist/cjs/{cell-renderer-CmaO0CZT.js → cell-renderer-7KX9Qbml.js} +122 -1
  2. package/dist/cjs/{client-layout-RZ3Ix-4a.js → client-layout-CqVuJumR.js} +9 -0
  3. package/dist/cjs/{index-DzRfoAPz.js → index-DVbdkYO3.js} +468 -6
  4. package/dist/cjs/index.cjs.js +4 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mosterdcomponents.cjs.js +2 -2
  7. package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_25.cjs.entry.js} +5618 -5225
  8. package/dist/cjs/mrd-merge-view.cjs.entry.js +5 -5
  9. package/dist/collection/collection-manifest.json +2 -0
  10. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +7 -8
  11. package/dist/collection/components/email/mrd-email-view/mrd-email-view.css +126 -0
  12. package/dist/collection/components/email/mrd-email-view/mrd-email-view.js +247 -0
  13. package/dist/collection/components/fields/file-upload-common.js +23 -7
  14. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
  15. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
  16. package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
  17. package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
  18. package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
  19. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +20 -1
  20. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +108 -47
  21. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +44 -0
  22. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +126 -58
  23. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
  24. package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
  25. package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
  26. package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
  27. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
  28. package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
  29. package/dist/collection/components/form/mrd-field/mrd-field.js +5 -5
  30. package/dist/collection/components/form/mrd-form/mrd-form.js +55 -6
  31. package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.css +145 -0
  32. package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +281 -0
  33. package/dist/collection/components/layout/mrd-layout-section/field-value.js +5 -1
  34. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +10 -0
  35. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +38 -8
  36. package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +2 -2
  37. package/dist/collection/dev/api.js +20 -5
  38. package/dist/collection/dev/app.js +51 -13
  39. package/dist/collection/dev/example-data.js +126 -2
  40. package/dist/collection/types/client-layout.js +6 -0
  41. package/dist/collection/utils/document-attachments.js +27 -14
  42. package/dist/collection/utils/i18n.js +120 -0
  43. package/dist/components/cell-renderer.js +1 -1
  44. package/dist/components/client-layout.js +1 -1
  45. package/dist/components/document-attachments.js +1 -1
  46. package/dist/components/file-upload-common.js +1 -1
  47. package/dist/components/format.js +1 -1
  48. package/dist/components/i18n.js +1 -1
  49. package/dist/components/index.js +1 -1
  50. package/dist/components/mrd-boolean-field2.js +1 -1
  51. package/dist/components/mrd-currency-field2.js +1 -1
  52. package/dist/components/mrd-date-field2.js +1 -1
  53. package/dist/components/mrd-datetime-field2.js +1 -1
  54. package/dist/components/mrd-document-view2.js +1 -1
  55. package/dist/components/mrd-email-field2.js +1 -1
  56. package/dist/components/mrd-email-view.d.ts +11 -0
  57. package/dist/components/mrd-email-view.js +1 -0
  58. package/dist/components/mrd-email-view2.js +1 -0
  59. package/dist/components/mrd-field2.js +1 -1
  60. package/dist/components/mrd-file-field2.js +1 -1
  61. package/dist/components/mrd-form.js +1 -1
  62. package/dist/components/mrd-image-field2.js +1 -1
  63. package/dist/components/mrd-invoice-view.d.ts +11 -0
  64. package/dist/components/mrd-invoice-view.js +1 -0
  65. package/dist/components/mrd-invoice-view2.js +1 -0
  66. package/dist/components/mrd-layout-section.js +1 -1
  67. package/dist/components/mrd-longtext-field2.js +1 -1
  68. package/dist/components/mrd-merge-view.js +1 -1
  69. package/dist/components/mrd-number-field2.js +1 -1
  70. package/dist/components/mrd-secret-field2.js +1 -1
  71. package/dist/components/mrd-table2.js +1 -1
  72. package/dist/components/mrd-text-field2.js +1 -1
  73. package/dist/components/mrd-textarea-field2.js +1 -2
  74. package/dist/components/mrd-time-field2.js +1 -1
  75. package/dist/components/purify.es.js +2 -0
  76. package/dist/esm/{cell-renderer-D63AUZxa.js → cell-renderer-DIsNX9D7.js} +122 -2
  77. package/dist/esm/{client-layout-DCOAAH92.js → client-layout-Bc42CfJB.js} +7 -1
  78. package/dist/esm/{index-DiSe6vjv.js → index-CDiBvvJU.js} +468 -6
  79. package/dist/esm/index.js +1 -1
  80. package/dist/esm/loader.js +3 -3
  81. package/dist/esm/mosterdcomponents.js +3 -3
  82. package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_25.entry.js} +5617 -5226
  83. package/dist/esm/mrd-merge-view.entry.js +5 -5
  84. package/dist/mosterdcomponents/index.esm.js +1 -1
  85. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  86. package/dist/mosterdcomponents/{p-2e16a7d0.entry.js → p-4e061416.entry.js} +1 -1
  87. package/dist/mosterdcomponents/p-910ebfee.entry.js +3 -0
  88. package/dist/mosterdcomponents/{p-DCOAAH92.js → p-Bc42CfJB.js} +1 -1
  89. package/dist/mosterdcomponents/p-CDiBvvJU.js +2 -0
  90. package/dist/mosterdcomponents/p-Ce2QDq0t.js +1 -0
  91. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +2 -2
  92. package/dist/types/components/email/mrd-email-view/mrd-email-view.d.ts +52 -0
  93. package/dist/types/components/fields/file-upload-common.d.ts +19 -1
  94. package/dist/types/components/fields/mrd-file-field/mrd-file-field.d.ts +24 -10
  95. package/dist/types/components/fields/mrd-image-field/mrd-image-field.d.ts +27 -11
  96. package/dist/types/components/form/mrd-form/mrd-form.d.ts +16 -1
  97. package/dist/types/components/invoice/mrd-invoice-view/mrd-invoice-view.d.ts +60 -0
  98. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +13 -0
  99. package/dist/types/components.d.ts +294 -19
  100. package/dist/types/types/client-layout.d.ts +6 -0
  101. package/dist/types/utils/document-attachments.d.ts +12 -5
  102. package/package.json +1 -1
  103. package/dist/mosterdcomponents/p-CnqDM0Gb.js +0 -1
  104. package/dist/mosterdcomponents/p-DiSe6vjv.js +0 -2
  105. package/dist/mosterdcomponents/p-b5f38707.entry.js +0 -3
@@ -5,14 +5,16 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
9
- import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
8
+ import { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue as ClientListValue1, CurrencyValue, RelationSearchResult } from "./types";
9
+ import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientListValue, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
10
10
  import { ListNavigationContext } from "./utils/query-params";
11
11
  import { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
12
- export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
13
- export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
12
+ import { FileEntry } from "./components/fields/file-upload-common";
13
+ export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue as ClientListValue1, CurrencyValue, RelationSearchResult } from "./types";
14
+ export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientListValue, ClientViewMetadata, DocumentAttachment, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
14
15
  export { ListNavigationContext } from "./utils/query-params";
15
16
  export { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
17
+ export { FileEntry } from "./components/fields/file-upload-common";
16
18
  export namespace Components {
17
19
  interface MrdBooleanField {
18
20
  /**
@@ -284,6 +286,32 @@ export namespace Components {
284
286
  */
285
287
  "value": string;
286
288
  }
289
+ /**
290
+ * Archetype-driven single-email view. Given a `commons.email` binding and a data
291
+ * record, renders the message the way an Outlook printout would — subject, a
292
+ * compact From/To/CC/Date header block, the body and attachments — instead of a
293
+ * generic field form. Fully read-only: emails arrive through other channels (mail
294
+ * ingestion gateways), never edited here.
295
+ * Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
296
+ * hrefs itself — it only exposes attachment references via `mrdAttachments` (an
297
+ * email can have several) and plain download buttons; the host decides how/whether
298
+ * to render them.
299
+ */
300
+ interface MrdEmailView {
301
+ /**
302
+ * Resolved `commons.email` binding: slot name → concrete field/relation name.
303
+ */
304
+ "archetype": ClientArchetype;
305
+ /**
306
+ * The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
307
+ * @default {}
308
+ */
309
+ "data": Record<string, unknown>;
310
+ /**
311
+ * @default navigator.language
312
+ */
313
+ "locale": string;
314
+ }
287
315
  interface MrdField {
288
316
  "item": ClientLayoutItem1;
289
317
  /**
@@ -313,6 +341,10 @@ export namespace Components {
313
341
  * @default 0
314
342
  */
315
343
  "maxSize": number;
344
+ /**
345
+ * @default false
346
+ */
347
+ "multiple": boolean;
316
348
  /**
317
349
  * @default ''
318
350
  */
@@ -347,7 +379,10 @@ export namespace Components {
347
379
  * @default ''
348
380
  */
349
381
  "referenceHref": string;
350
- "setFieldValue": (name: string, value: unknown) => Promise<void>;
382
+ /**
383
+ * Inject a value from outside (e.g. after a file upload completes). `file` is optional and only meaningful for `multiple` FILE/IMAGE fields: when the field's current value is an array, mrd-form replaces the array entry that `=== file` with `value`, leaving other pending/resolved entries untouched — this is how mrd-file-field/mrd-image-field resolve concurrent per-file uploads. Pass the `file` from the originating mrdUpload event back unchanged.
384
+ */
385
+ "setFieldValue": (name: string, value: unknown, file?: File) => Promise<void>;
351
386
  /**
352
387
  * When true, a cancel button is shown next to the submit button.
353
388
  * @default false
@@ -409,6 +444,10 @@ export namespace Components {
409
444
  * @default 0
410
445
  */
411
446
  "maxSize": number;
447
+ /**
448
+ * @default false
449
+ */
450
+ "multiple": boolean;
412
451
  /**
413
452
  * @default ''
414
453
  */
@@ -422,6 +461,40 @@ export namespace Components {
422
461
  */
423
462
  "value": unknown;
424
463
  }
464
+ /**
465
+ * Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
466
+ * record, renders a clear, recognisable invoice summary — number, status, dates,
467
+ * customer/supplier, totals and attachments — instead of a generic field form.
468
+ * The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
469
+ * rendered here: this component only reserves a `slot="lines"` at the right spot in
470
+ * the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
471
+ * table data-loading/event wiring — via its existing `renderRelatedView()` — and
472
+ * projects the resulting `<mrd-table>` into that slot, so line editing keeps using
473
+ * the same generic create/edit-navigation mechanism every other relation already has.
474
+ * Like `mrd-document-view`, this component never resolves file hrefs itself — it only
475
+ * exposes the attachment references via `mrdAttachments` (now possibly more than one)
476
+ * and a plain download button; the host decides how/whether to render them.
477
+ */
478
+ interface MrdInvoiceView {
479
+ /**
480
+ * Resolved `commons.invoice` binding: slot name → concrete field/relation name.
481
+ */
482
+ "archetype": ClientArchetype;
483
+ /**
484
+ * The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
485
+ * @default {}
486
+ */
487
+ "data": Record<string, unknown>;
488
+ /**
489
+ * @default navigator.language
490
+ */
491
+ "locale": string;
492
+ /**
493
+ * listItems of the FIELD bound to the `status` slot, resolved by mrd-layout-section from its own items array (archetype metadata does not publish listItems), so the status badge can get a real label/color instead of the raw stored key.
494
+ * @default null
495
+ */
496
+ "statusListItems": ClientListValue[] | null;
497
+ }
425
498
  interface MrdLayoutSection {
426
499
  /**
427
500
  * Top-level archetypes on the object dashboard. When it contains commons.document, the record is rendered as a single-document view instead of generic fields.
@@ -498,7 +571,7 @@ export namespace Components {
498
571
  * List items from the API. Each item has a `key` (stored value) and `label`.
499
572
  * @default []
500
573
  */
501
- "listItems": ClientListValue[];
574
+ "listItems": ClientListValue1[];
502
575
  /**
503
576
  * @default navigator.language
504
577
  */
@@ -652,7 +725,7 @@ export namespace Components {
652
725
  /**
653
726
  * @default []
654
727
  */
655
- "dropdownValues": ClientListValue[];
728
+ "dropdownValues": ClientListValue1[];
656
729
  "editBehavior"?: ClientLayoutItemRelationEditBehavior | null;
657
730
  /**
658
731
  * @default ''
@@ -899,6 +972,10 @@ export interface MrdEmailFieldCustomEvent<T> extends CustomEvent<T> {
899
972
  detail: T;
900
973
  target: HTMLMrdEmailFieldElement;
901
974
  }
975
+ export interface MrdEmailViewCustomEvent<T> extends CustomEvent<T> {
976
+ detail: T;
977
+ target: HTMLMrdEmailViewElement;
978
+ }
902
979
  export interface MrdFieldCustomEvent<T> extends CustomEvent<T> {
903
980
  detail: T;
904
981
  target: HTMLMrdFieldElement;
@@ -919,6 +996,10 @@ export interface MrdImageFieldCustomEvent<T> extends CustomEvent<T> {
919
996
  detail: T;
920
997
  target: HTMLMrdImageFieldElement;
921
998
  }
999
+ export interface MrdInvoiceViewCustomEvent<T> extends CustomEvent<T> {
1000
+ detail: T;
1001
+ target: HTMLMrdInvoiceViewElement;
1002
+ }
922
1003
  export interface MrdLayoutSectionCustomEvent<T> extends CustomEvent<T> {
923
1004
  detail: T;
924
1005
  target: HTMLMrdLayoutSectionElement;
@@ -1161,6 +1242,36 @@ declare global {
1161
1242
  prototype: HTMLMrdEmailFieldElement;
1162
1243
  new (): HTMLMrdEmailFieldElement;
1163
1244
  };
1245
+ interface HTMLMrdEmailViewElementEventMap {
1246
+ "mrdNavigate": { href?: string; label: string };
1247
+ "mrdDownload": { href: string; fileName: string };
1248
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1249
+ }
1250
+ /**
1251
+ * Archetype-driven single-email view. Given a `commons.email` binding and a data
1252
+ * record, renders the message the way an Outlook printout would — subject, a
1253
+ * compact From/To/CC/Date header block, the body and attachments — instead of a
1254
+ * generic field form. Fully read-only: emails arrive through other channels (mail
1255
+ * ingestion gateways), never edited here.
1256
+ * Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
1257
+ * hrefs itself — it only exposes attachment references via `mrdAttachments` (an
1258
+ * email can have several) and plain download buttons; the host decides how/whether
1259
+ * to render them.
1260
+ */
1261
+ interface HTMLMrdEmailViewElement extends Components.MrdEmailView, HTMLStencilElement {
1262
+ addEventListener<K extends keyof HTMLMrdEmailViewElementEventMap>(type: K, listener: (this: HTMLMrdEmailViewElement, ev: MrdEmailViewCustomEvent<HTMLMrdEmailViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1263
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1264
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1265
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1266
+ removeEventListener<K extends keyof HTMLMrdEmailViewElementEventMap>(type: K, listener: (this: HTMLMrdEmailViewElement, ev: MrdEmailViewCustomEvent<HTMLMrdEmailViewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1267
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1268
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1269
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1270
+ }
1271
+ var HTMLMrdEmailViewElement: {
1272
+ prototype: HTMLMrdEmailViewElement;
1273
+ new (): HTMLMrdEmailViewElement;
1274
+ };
1164
1275
  interface HTMLMrdFieldElementEventMap {
1165
1276
  "mrdChange": { name: string; value: unknown };
1166
1277
  "mrdBlur": { name: string; value: unknown };
@@ -1183,8 +1294,8 @@ declare global {
1183
1294
  new (): HTMLMrdFieldElement;
1184
1295
  };
1185
1296
  interface HTMLMrdFileFieldElementEventMap {
1186
- "mrdChange": { name: string; value: File | null };
1187
- "mrdBlur": { name: string; value: File | null };
1297
+ "mrdChange": { name: string; value: FileEntry | FileEntry[] | null };
1298
+ "mrdBlur": { name: string; value: FileEntry | FileEntry[] | null };
1188
1299
  "mrdUpload": { name: string; file: File };
1189
1300
  }
1190
1301
  interface HTMLMrdFileFieldElement extends Components.MrdFileField, HTMLStencilElement {
@@ -1241,8 +1352,8 @@ declare global {
1241
1352
  new (): HTMLMrdHyperlinkFieldElement;
1242
1353
  };
1243
1354
  interface HTMLMrdImageFieldElementEventMap {
1244
- "mrdChange": { name: string; value: File | null };
1245
- "mrdBlur": { name: string; value: File | null };
1355
+ "mrdChange": { name: string; value: FileEntry | FileEntry[] | null };
1356
+ "mrdBlur": { name: string; value: FileEntry | FileEntry[] | null };
1246
1357
  "mrdUpload": { name: string; file: File };
1247
1358
  }
1248
1359
  interface HTMLMrdImageFieldElement extends Components.MrdImageField, HTMLStencilElement {
@@ -1259,6 +1370,39 @@ declare global {
1259
1370
  prototype: HTMLMrdImageFieldElement;
1260
1371
  new (): HTMLMrdImageFieldElement;
1261
1372
  };
1373
+ interface HTMLMrdInvoiceViewElementEventMap {
1374
+ "mrdNavigate": { href?: string; label: string };
1375
+ "mrdDownload": { href: string; fileName: string };
1376
+ "mrdAttachments": { attachments: DocumentAttachment[] };
1377
+ }
1378
+ /**
1379
+ * Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
1380
+ * record, renders a clear, recognisable invoice summary — number, status, dates,
1381
+ * customer/supplier, totals and attachments — instead of a generic field form.
1382
+ * The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
1383
+ * rendered here: this component only reserves a `slot="lines"` at the right spot in
1384
+ * the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
1385
+ * table data-loading/event wiring — via its existing `renderRelatedView()` — and
1386
+ * projects the resulting `<mrd-table>` into that slot, so line editing keeps using
1387
+ * the same generic create/edit-navigation mechanism every other relation already has.
1388
+ * Like `mrd-document-view`, this component never resolves file hrefs itself — it only
1389
+ * exposes the attachment references via `mrdAttachments` (now possibly more than one)
1390
+ * and a plain download button; the host decides how/whether to render them.
1391
+ */
1392
+ interface HTMLMrdInvoiceViewElement extends Components.MrdInvoiceView, HTMLStencilElement {
1393
+ addEventListener<K extends keyof HTMLMrdInvoiceViewElementEventMap>(type: K, listener: (this: HTMLMrdInvoiceViewElement, ev: MrdInvoiceViewCustomEvent<HTMLMrdInvoiceViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
1394
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1395
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1396
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1397
+ removeEventListener<K extends keyof HTMLMrdInvoiceViewElementEventMap>(type: K, listener: (this: HTMLMrdInvoiceViewElement, ev: MrdInvoiceViewCustomEvent<HTMLMrdInvoiceViewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
1398
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1399
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1400
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1401
+ }
1402
+ var HTMLMrdInvoiceViewElement: {
1403
+ prototype: HTMLMrdInvoiceViewElement;
1404
+ new (): HTMLMrdInvoiceViewElement;
1405
+ };
1262
1406
  interface HTMLMrdLayoutSectionElementEventMap {
1263
1407
  "mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
1264
1408
  "mrdSearch": { query: string; dataClass: string };
@@ -1492,11 +1636,13 @@ declare global {
1492
1636
  "mrd-document-list": HTMLMrdDocumentListElement;
1493
1637
  "mrd-document-view": HTMLMrdDocumentViewElement;
1494
1638
  "mrd-email-field": HTMLMrdEmailFieldElement;
1639
+ "mrd-email-view": HTMLMrdEmailViewElement;
1495
1640
  "mrd-field": HTMLMrdFieldElement;
1496
1641
  "mrd-file-field": HTMLMrdFileFieldElement;
1497
1642
  "mrd-form": HTMLMrdFormElement;
1498
1643
  "mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
1499
1644
  "mrd-image-field": HTMLMrdImageFieldElement;
1645
+ "mrd-invoice-view": HTMLMrdInvoiceViewElement;
1500
1646
  "mrd-layout-section": HTMLMrdLayoutSectionElement;
1501
1647
  "mrd-list-field": HTMLMrdListFieldElement;
1502
1648
  "mrd-longtext-field": HTMLMrdLongtextFieldElement;
@@ -1843,6 +1989,44 @@ declare namespace LocalJSX {
1843
1989
  */
1844
1990
  "value"?: string;
1845
1991
  }
1992
+ /**
1993
+ * Archetype-driven single-email view. Given a `commons.email` binding and a data
1994
+ * record, renders the message the way an Outlook printout would — subject, a
1995
+ * compact From/To/CC/Date header block, the body and attachments — instead of a
1996
+ * generic field form. Fully read-only: emails arrive through other channels (mail
1997
+ * ingestion gateways), never edited here.
1998
+ * Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
1999
+ * hrefs itself — it only exposes attachment references via `mrdAttachments` (an
2000
+ * email can have several) and plain download buttons; the host decides how/whether
2001
+ * to render them.
2002
+ */
2003
+ interface MrdEmailView {
2004
+ /**
2005
+ * Resolved `commons.email` binding: slot name → concrete field/relation name.
2006
+ */
2007
+ "archetype": ClientArchetype;
2008
+ /**
2009
+ * The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
2010
+ * @default {}
2011
+ */
2012
+ "data"?: Record<string, unknown>;
2013
+ /**
2014
+ * @default navigator.language
2015
+ */
2016
+ "locale"?: string;
2017
+ /**
2018
+ * The file(s) belonging to this email, fired once on load and again whenever the attachments slot's value changes. The host resolves the href(s) itself.
2019
+ */
2020
+ "onMrdAttachments"?: (event: MrdEmailViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
2021
+ /**
2022
+ * Download an attachment. Host resolves the href to a signed URL.
2023
+ */
2024
+ "onMrdDownload"?: (event: MrdEmailViewCustomEvent<{ href: string; fileName: string }>) => void;
2025
+ /**
2026
+ * Navigate to a sender/recipient or the container. Host resolves the href and routes.
2027
+ */
2028
+ "onMrdNavigate"?: (event: MrdEmailViewCustomEvent<{ href?: string; label: string }>) => void;
2029
+ }
1846
2030
  interface MrdField {
1847
2031
  "item": ClientLayoutItem1;
1848
2032
  /**
@@ -1877,14 +2061,18 @@ declare namespace LocalJSX {
1877
2061
  * @default 0
1878
2062
  */
1879
2063
  "maxSize"?: number;
2064
+ /**
2065
+ * @default false
2066
+ */
2067
+ "multiple"?: boolean;
1880
2068
  /**
1881
2069
  * @default ''
1882
2070
  */
1883
2071
  "name"?: string;
1884
- "onMrdBlur"?: (event: MrdFileFieldCustomEvent<{ name: string; value: File | null }>) => void;
1885
- "onMrdChange"?: (event: MrdFileFieldCustomEvent<{ name: string; value: File | null }>) => void;
2072
+ "onMrdBlur"?: (event: MrdFileFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
2073
+ "onMrdChange"?: (event: MrdFileFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
1886
2074
  /**
1887
- * Emitted when a file is selected and needs to be uploaded. Host should upload the file and call form.setFieldValue(name, uri) with the result.
2075
+ * Emitted once per selected/dropped file that needs to be uploaded. Host should upload the file and call form.setFieldValue(name, { href, fileName: file.name }, file) with the result — passing `file` back lets mrd-form resolve the right entry in a `multiple` field.
1888
2076
  */
1889
2077
  "onMrdUpload"?: (event: MrdFileFieldCustomEvent<{ name: string; file: File }>) => void;
1890
2078
  /**
@@ -1985,14 +2173,18 @@ declare namespace LocalJSX {
1985
2173
  * @default 0
1986
2174
  */
1987
2175
  "maxSize"?: number;
2176
+ /**
2177
+ * @default false
2178
+ */
2179
+ "multiple"?: boolean;
1988
2180
  /**
1989
2181
  * @default ''
1990
2182
  */
1991
2183
  "name"?: string;
1992
- "onMrdBlur"?: (event: MrdImageFieldCustomEvent<{ name: string; value: File | null }>) => void;
1993
- "onMrdChange"?: (event: MrdImageFieldCustomEvent<{ name: string; value: File | null }>) => void;
2184
+ "onMrdBlur"?: (event: MrdImageFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
2185
+ "onMrdChange"?: (event: MrdImageFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
1994
2186
  /**
1995
- * Emitted when an image is selected and needs to be uploaded. Host should upload the file and call form.setFieldValue(name, uri) with the result.
2187
+ * Emitted once per selected/dropped image that needs to be uploaded. Host should upload the file and call form.setFieldValue(name, { href, fileName: file.name }, file) with the result — passing `file` back lets mrd-form resolve the right entry in a `multiple` field.
1996
2188
  */
1997
2189
  "onMrdUpload"?: (event: MrdImageFieldCustomEvent<{ name: string; file: File }>) => void;
1998
2190
  /**
@@ -2004,6 +2196,52 @@ declare namespace LocalJSX {
2004
2196
  */
2005
2197
  "value"?: unknown;
2006
2198
  }
2199
+ /**
2200
+ * Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
2201
+ * record, renders a clear, recognisable invoice summary — number, status, dates,
2202
+ * customer/supplier, totals and attachments — instead of a generic field form.
2203
+ * The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
2204
+ * rendered here: this component only reserves a `slot="lines"` at the right spot in
2205
+ * the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
2206
+ * table data-loading/event wiring — via its existing `renderRelatedView()` — and
2207
+ * projects the resulting `<mrd-table>` into that slot, so line editing keeps using
2208
+ * the same generic create/edit-navigation mechanism every other relation already has.
2209
+ * Like `mrd-document-view`, this component never resolves file hrefs itself — it only
2210
+ * exposes the attachment references via `mrdAttachments` (now possibly more than one)
2211
+ * and a plain download button; the host decides how/whether to render them.
2212
+ */
2213
+ interface MrdInvoiceView {
2214
+ /**
2215
+ * Resolved `commons.invoice` binding: slot name → concrete field/relation name.
2216
+ */
2217
+ "archetype": ClientArchetype;
2218
+ /**
2219
+ * The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
2220
+ * @default {}
2221
+ */
2222
+ "data"?: Record<string, unknown>;
2223
+ /**
2224
+ * @default navigator.language
2225
+ */
2226
+ "locale"?: string;
2227
+ /**
2228
+ * The file(s) belonging to this invoice, fired once on load and again whenever the attachments slot's value changes. The host resolves the href(s) itself.
2229
+ */
2230
+ "onMrdAttachments"?: (event: MrdInvoiceViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
2231
+ /**
2232
+ * Download an attachment. Host resolves the href to a signed URL.
2233
+ */
2234
+ "onMrdDownload"?: (event: MrdInvoiceViewCustomEvent<{ href: string; fileName: string }>) => void;
2235
+ /**
2236
+ * Navigate to the customer/supplier/container. Host resolves the href and routes.
2237
+ */
2238
+ "onMrdNavigate"?: (event: MrdInvoiceViewCustomEvent<{ href?: string; label: string }>) => void;
2239
+ /**
2240
+ * listItems of the FIELD bound to the `status` slot, resolved by mrd-layout-section from its own items array (archetype metadata does not publish listItems), so the status badge can get a real label/color instead of the raw stored key.
2241
+ * @default null
2242
+ */
2243
+ "statusListItems"?: ClientListValue[] | null;
2244
+ }
2007
2245
  interface MrdLayoutSection {
2008
2246
  /**
2009
2247
  * Top-level archetypes on the object dashboard. When it contains commons.document, the record is rendered as a single-document view instead of generic fields.
@@ -2090,7 +2328,7 @@ declare namespace LocalJSX {
2090
2328
  * List items from the API. Each item has a `key` (stored value) and `label`.
2091
2329
  * @default []
2092
2330
  */
2093
- "listItems"?: ClientListValue[];
2331
+ "listItems"?: ClientListValue1[];
2094
2332
  /**
2095
2333
  * @default navigator.language
2096
2334
  */
@@ -2247,7 +2485,7 @@ declare namespace LocalJSX {
2247
2485
  /**
2248
2486
  * @default []
2249
2487
  */
2250
- "dropdownValues"?: ClientListValue[];
2488
+ "dropdownValues"?: ClientListValue1[];
2251
2489
  "editBehavior"?: ClientLayoutItemRelationEditBehavior | null;
2252
2490
  /**
2253
2491
  * @default ''
@@ -2538,6 +2776,9 @@ declare namespace LocalJSX {
2538
2776
  "disabled": boolean;
2539
2777
  "locale": string;
2540
2778
  }
2779
+ interface MrdEmailViewAttributes {
2780
+ "locale": string;
2781
+ }
2541
2782
  interface MrdFieldAttributes {
2542
2783
  "locale": string;
2543
2784
  }
@@ -2549,6 +2790,7 @@ declare namespace LocalJSX {
2549
2790
  "locale": string;
2550
2791
  "accept": string;
2551
2792
  "maxSize": number;
2793
+ "multiple": boolean;
2552
2794
  }
2553
2795
  interface MrdFormAttributes {
2554
2796
  "locale": string;
@@ -2573,6 +2815,10 @@ declare namespace LocalJSX {
2573
2815
  "locale": string;
2574
2816
  "accept": string;
2575
2817
  "maxSize": number;
2818
+ "multiple": boolean;
2819
+ }
2820
+ interface MrdInvoiceViewAttributes {
2821
+ "locale": string;
2576
2822
  }
2577
2823
  interface MrdLayoutSectionAttributes {
2578
2824
  "locale": string;
@@ -2681,11 +2927,13 @@ declare namespace LocalJSX {
2681
2927
  "mrd-document-list": Omit<MrdDocumentList, keyof MrdDocumentListAttributes> & { [K in keyof MrdDocumentList & keyof MrdDocumentListAttributes]?: MrdDocumentList[K] } & { [K in keyof MrdDocumentList & keyof MrdDocumentListAttributes as `attr:${K}`]?: MrdDocumentListAttributes[K] } & { [K in keyof MrdDocumentList & keyof MrdDocumentListAttributes as `prop:${K}`]?: MrdDocumentList[K] };
2682
2928
  "mrd-document-view": Omit<MrdDocumentView, keyof MrdDocumentViewAttributes> & { [K in keyof MrdDocumentView & keyof MrdDocumentViewAttributes]?: MrdDocumentView[K] } & { [K in keyof MrdDocumentView & keyof MrdDocumentViewAttributes as `attr:${K}`]?: MrdDocumentViewAttributes[K] } & { [K in keyof MrdDocumentView & keyof MrdDocumentViewAttributes as `prop:${K}`]?: MrdDocumentView[K] };
2683
2929
  "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] };
2930
+ "mrd-email-view": Omit<MrdEmailView, keyof MrdEmailViewAttributes> & { [K in keyof MrdEmailView & keyof MrdEmailViewAttributes]?: MrdEmailView[K] } & { [K in keyof MrdEmailView & keyof MrdEmailViewAttributes as `attr:${K}`]?: MrdEmailViewAttributes[K] } & { [K in keyof MrdEmailView & keyof MrdEmailViewAttributes as `prop:${K}`]?: MrdEmailView[K] };
2684
2931
  "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] };
2685
2932
  "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] };
2686
2933
  "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] };
2687
2934
  "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] };
2688
2935
  "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] };
2936
+ "mrd-invoice-view": Omit<MrdInvoiceView, keyof MrdInvoiceViewAttributes> & { [K in keyof MrdInvoiceView & keyof MrdInvoiceViewAttributes]?: MrdInvoiceView[K] } & { [K in keyof MrdInvoiceView & keyof MrdInvoiceViewAttributes as `attr:${K}`]?: MrdInvoiceViewAttributes[K] } & { [K in keyof MrdInvoiceView & keyof MrdInvoiceViewAttributes as `prop:${K}`]?: MrdInvoiceView[K] };
2689
2937
  "mrd-layout-section": Omit<MrdLayoutSection, keyof MrdLayoutSectionAttributes> & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes]?: MrdLayoutSection[K] } & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes as `attr:${K}`]?: MrdLayoutSectionAttributes[K] } & { [K in keyof MrdLayoutSection & keyof MrdLayoutSectionAttributes as `prop:${K}`]?: MrdLayoutSection[K] };
2690
2938
  "mrd-list-field": Omit<MrdListField, keyof MrdListFieldAttributes> & { [K in keyof MrdListField & keyof MrdListFieldAttributes]?: MrdListField[K] } & { [K in keyof MrdListField & keyof MrdListFieldAttributes as `attr:${K}`]?: MrdListFieldAttributes[K] } & { [K in keyof MrdListField & keyof MrdListFieldAttributes as `prop:${K}`]?: MrdListField[K] };
2691
2939
  "mrd-longtext-field": Omit<MrdLongtextField, keyof MrdLongtextFieldAttributes> & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes]?: MrdLongtextField[K] } & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes as `attr:${K}`]?: MrdLongtextFieldAttributes[K] } & { [K in keyof MrdLongtextField & keyof MrdLongtextFieldAttributes as `prop:${K}`]?: MrdLongtextField[K] };
@@ -2752,11 +3000,38 @@ declare module "@stencil/core" {
2752
3000
  */
2753
3001
  "mrd-document-view": LocalJSX.IntrinsicElements["mrd-document-view"] & JSXBase.HTMLAttributes<HTMLMrdDocumentViewElement>;
2754
3002
  "mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
3003
+ /**
3004
+ * Archetype-driven single-email view. Given a `commons.email` binding and a data
3005
+ * record, renders the message the way an Outlook printout would — subject, a
3006
+ * compact From/To/CC/Date header block, the body and attachments — instead of a
3007
+ * generic field form. Fully read-only: emails arrive through other channels (mail
3008
+ * ingestion gateways), never edited here.
3009
+ * Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
3010
+ * hrefs itself — it only exposes attachment references via `mrdAttachments` (an
3011
+ * email can have several) and plain download buttons; the host decides how/whether
3012
+ * to render them.
3013
+ */
3014
+ "mrd-email-view": LocalJSX.IntrinsicElements["mrd-email-view"] & JSXBase.HTMLAttributes<HTMLMrdEmailViewElement>;
2755
3015
  "mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
2756
3016
  "mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
2757
3017
  "mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
2758
3018
  "mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
2759
3019
  "mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
3020
+ /**
3021
+ * Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
3022
+ * record, renders a clear, recognisable invoice summary — number, status, dates,
3023
+ * customer/supplier, totals and attachments — instead of a generic field form.
3024
+ * The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
3025
+ * rendered here: this component only reserves a `slot="lines"` at the right spot in
3026
+ * the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
3027
+ * table data-loading/event wiring — via its existing `renderRelatedView()` — and
3028
+ * projects the resulting `<mrd-table>` into that slot, so line editing keeps using
3029
+ * the same generic create/edit-navigation mechanism every other relation already has.
3030
+ * Like `mrd-document-view`, this component never resolves file hrefs itself — it only
3031
+ * exposes the attachment references via `mrdAttachments` (now possibly more than one)
3032
+ * and a plain download button; the host decides how/whether to render them.
3033
+ */
3034
+ "mrd-invoice-view": LocalJSX.IntrinsicElements["mrd-invoice-view"] & JSXBase.HTMLAttributes<HTMLMrdInvoiceViewElement>;
2760
3035
  "mrd-layout-section": LocalJSX.IntrinsicElements["mrd-layout-section"] & JSXBase.HTMLAttributes<HTMLMrdLayoutSectionElement>;
2761
3036
  "mrd-list-field": LocalJSX.IntrinsicElements["mrd-list-field"] & JSXBase.HTMLAttributes<HTMLMrdListFieldElement>;
2762
3037
  "mrd-longtext-field": LocalJSX.IntrinsicElements["mrd-longtext-field"] & JSXBase.HTMLAttributes<HTMLMrdLongtextFieldElement>;
@@ -109,6 +109,12 @@ export interface ClientArchetype {
109
109
  }
110
110
  /** Well-known archetype ids the client renders specially. */
111
111
  export declare const ARCHETYPE_DOCUMENT = "commons.document";
112
+ export declare const ARCHETYPE_INVOICE = "commons.invoice";
113
+ export declare const ARCHETYPE_EMAIL = "commons.email";
114
+ /** Bound by a `commons.invoice`'s `lines` relation target class. Used to find the
115
+ * RELATED_VIEW item for the line items generically, by archetype id rather than
116
+ * by name/class string. */
117
+ export declare const ARCHETYPE_INVOICE_LINE = "commons.invoiceLine";
112
118
  /**
113
119
  * Find a binding for `archetypeId` in a published `archetypes` list.
114
120
  * Returns `undefined` when the archetype is absent — callers fall back to the
@@ -1,8 +1,15 @@
1
1
  import { ClientArchetype, DocumentAttachment } from '../types/client-layout';
2
2
  /**
3
- * Extract the `commons.document` archetype's file slot from a data record as a
4
- * `DocumentAttachment[]` — empty when the slot is unmapped or has no value.
5
- * Shared by mrd-document-view (on load/data-change) and mrd-document-container
6
- * (row-click prefetch on mrdNavigate), so both report the exact same shape.
3
+ * Extract an archetype's file slot from a data record as a `DocumentAttachment[]` —
4
+ * empty when the slot is unmapped or has no value. `slot` defaults to `'file'` (the
5
+ * commons.document single-file slot); pass `'attachments'` for the multi-file slots
6
+ * on commons.email / commons.invoice. A single-object slot value yields a one-entry
7
+ * array, an array-valued slot yields one entry per item.
8
+ * Shared by mrd-document-view / mrd-invoice-view / mrd-email-view (on load/data-change)
9
+ * and mrd-document-container (row-click prefetch on mrdNavigate), so all report the
10
+ * exact same shape.
7
11
  */
8
- export declare function attachmentsFromRecord(archetype: ClientArchetype | null | undefined, record: Record<string, unknown> | null | undefined): DocumentAttachment[];
12
+ export declare function attachmentsFromRecord(archetype: ClientArchetype | null | undefined, record: Record<string, unknown> | null | undefined, slot?: string): DocumentAttachment[];
13
+ /** Dedup key for the componentDidLoad/@Watch('data') "emit mrdAttachments only on
14
+ * change" guard shared by mrd-document-view / mrd-invoice-view / mrd-email-view. */
15
+ export declare function attachmentsKey(attachments: DocumentAttachment[]): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmlogic/components",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Stencil.js web component library for dynamic forms and virtual-scroll data tables",
5
5
  "license": "MIT",
6
6
  "author": "Mosterd",