@mmlogic/components 0.5.2 → 0.5.4
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/{cell-renderer-CmaO0CZT.js → cell-renderer-Coy-aD3k.js} +146 -1
- package/dist/cjs/{client-layout-RZ3Ix-4a.js → client-layout-CqVuJumR.js} +9 -0
- package/dist/cjs/{index-DzRfoAPz.js → index-DVbdkYO3.js} +468 -6
- package/dist/cjs/index.cjs.js +4 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mosterdcomponents.cjs.js +2 -2
- package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_25.cjs.entry.js} +5696 -5229
- package/dist/cjs/mrd-merge-view.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +3 -0
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +23 -3
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +76 -2
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +7 -8
- package/dist/collection/components/email/mrd-email-view/mrd-email-view.css +126 -0
- package/dist/collection/components/email/mrd-email-view/mrd-email-view.js +247 -0
- package/dist/collection/components/fields/file-upload-common.js +23 -7
- package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
- package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
- package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +20 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +108 -47
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +44 -0
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +126 -58
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/fields/mrd-relation-field/mrd-relation-field.js +13 -3
- package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
- package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/components/form/mrd-field/mrd-field.js +5 -5
- package/dist/collection/components/form/mrd-form/mrd-form.js +63 -10
- package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.css +145 -0
- package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +281 -0
- package/dist/collection/components/layout/mrd-layout-section/field-value.js +9 -3
- package/dist/collection/components/layout/mrd-layout-section/layout-helpers.js +6 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +14 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +45 -15
- package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +2 -2
- package/dist/collection/dev/api.js +20 -5
- package/dist/collection/dev/app.js +51 -13
- package/dist/collection/dev/example-data.js +132 -3
- package/dist/collection/types/client-layout.js +6 -0
- package/dist/collection/utils/document-attachments.js +27 -14
- package/dist/collection/utils/i18n.js +144 -0
- package/dist/components/cell-renderer.js +1 -1
- package/dist/components/client-layout.js +1 -1
- package/dist/components/document-attachments.js +1 -1
- package/dist/components/file-upload-common.js +1 -1
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-email-view.d.ts +11 -0
- package/dist/components/mrd-email-view.js +1 -0
- package/dist/components/mrd-email-view2.js +1 -0
- package/dist/components/mrd-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-form.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-invoice-view.d.ts +11 -0
- package/dist/components/mrd-invoice-view.js +1 -0
- package/dist/components/mrd-invoice-view2.js +1 -0
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-merge-view.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-relation-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -2
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/components/purify.es.js +2 -0
- package/dist/esm/{cell-renderer-D63AUZxa.js → cell-renderer-C2FLUrMN.js} +146 -2
- package/dist/esm/{client-layout-DCOAAH92.js → client-layout-Bc42CfJB.js} +7 -1
- package/dist/esm/{index-DiSe6vjv.js → index-CDiBvvJU.js} +468 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mosterdcomponents.js +3 -3
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_25.entry.js} +5695 -5230
- package/dist/esm/mrd-merge-view.entry.js +5 -5
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/{p-2e16a7d0.entry.js → p-4ea5b97c.entry.js} +1 -1
- package/dist/mosterdcomponents/p-8736313b.entry.js +3 -0
- package/dist/mosterdcomponents/{p-DCOAAH92.js → p-Bc42CfJB.js} +1 -1
- package/dist/mosterdcomponents/p-BgsPVesg.js +1 -0
- package/dist/mosterdcomponents/p-CDiBvvJU.js +2 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +7 -0
- package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +17 -0
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +2 -2
- package/dist/types/components/email/mrd-email-view/mrd-email-view.d.ts +52 -0
- package/dist/types/components/fields/file-upload-common.d.ts +19 -1
- package/dist/types/components/fields/mrd-file-field/mrd-file-field.d.ts +24 -10
- package/dist/types/components/fields/mrd-image-field/mrd-image-field.d.ts +27 -11
- package/dist/types/components/fields/mrd-relation-field/mrd-relation-field.d.ts +7 -0
- package/dist/types/components/form/mrd-form/mrd-form.d.ts +19 -3
- package/dist/types/components/invoice/mrd-invoice-view/mrd-invoice-view.d.ts +60 -0
- package/dist/types/components/layout/mrd-layout-section/layout-helpers.d.ts +3 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +13 -0
- package/dist/types/components.d.ts +303 -19
- package/dist/types/types/client-layout.d.ts +13 -0
- package/dist/types/utils/document-attachments.d.ts +12 -5
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-CnqDM0Gb.js +0 -1
- package/dist/mosterdcomponents/p-DiSe6vjv.js +0 -2
- 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
|
-
|
|
13
|
-
export {
|
|
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
|
/**
|
|
@@ -223,6 +225,10 @@ export namespace Components {
|
|
|
223
225
|
* Host callback with the uploaded file reference. Builds the create payload from the archetype slots and requests the new document.
|
|
224
226
|
*/
|
|
225
227
|
"setFileReference": (uri: string) => Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Upload a file into the current target — the selected folder/container, or the only container when there is just one. Called by the host toolbar (mrd-document-container). No-op without a target, or while another upload is still awaiting its setFileReference.
|
|
230
|
+
*/
|
|
231
|
+
"uploadFile": (file: File) => Promise<void>;
|
|
226
232
|
}
|
|
227
233
|
/**
|
|
228
234
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
@@ -284,6 +290,32 @@ export namespace Components {
|
|
|
284
290
|
*/
|
|
285
291
|
"value": string;
|
|
286
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Archetype-driven single-email view. Given a `commons.email` binding and a data
|
|
295
|
+
* record, renders the message the way an Outlook printout would — subject, a
|
|
296
|
+
* compact From/To/CC/Date header block, the body and attachments — instead of a
|
|
297
|
+
* generic field form. Fully read-only: emails arrive through other channels (mail
|
|
298
|
+
* ingestion gateways), never edited here.
|
|
299
|
+
* Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
|
|
300
|
+
* hrefs itself — it only exposes attachment references via `mrdAttachments` (an
|
|
301
|
+
* email can have several) and plain download buttons; the host decides how/whether
|
|
302
|
+
* to render them.
|
|
303
|
+
*/
|
|
304
|
+
interface MrdEmailView {
|
|
305
|
+
/**
|
|
306
|
+
* Resolved `commons.email` binding: slot name → concrete field/relation name.
|
|
307
|
+
*/
|
|
308
|
+
"archetype": ClientArchetype;
|
|
309
|
+
/**
|
|
310
|
+
* The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
|
|
311
|
+
* @default {}
|
|
312
|
+
*/
|
|
313
|
+
"data": Record<string, unknown>;
|
|
314
|
+
/**
|
|
315
|
+
* @default navigator.language
|
|
316
|
+
*/
|
|
317
|
+
"locale": string;
|
|
318
|
+
}
|
|
287
319
|
interface MrdField {
|
|
288
320
|
"item": ClientLayoutItem1;
|
|
289
321
|
/**
|
|
@@ -313,6 +345,10 @@ export namespace Components {
|
|
|
313
345
|
* @default 0
|
|
314
346
|
*/
|
|
315
347
|
"maxSize": number;
|
|
348
|
+
/**
|
|
349
|
+
* @default false
|
|
350
|
+
*/
|
|
351
|
+
"multiple": boolean;
|
|
316
352
|
/**
|
|
317
353
|
* @default ''
|
|
318
354
|
*/
|
|
@@ -347,7 +383,10 @@ export namespace Components {
|
|
|
347
383
|
* @default ''
|
|
348
384
|
*/
|
|
349
385
|
"referenceHref": string;
|
|
350
|
-
|
|
386
|
+
/**
|
|
387
|
+
* 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.
|
|
388
|
+
*/
|
|
389
|
+
"setFieldValue": (name: string, value: unknown, file?: File) => Promise<void>;
|
|
351
390
|
/**
|
|
352
391
|
* When true, a cancel button is shown next to the submit button.
|
|
353
392
|
* @default false
|
|
@@ -409,6 +448,10 @@ export namespace Components {
|
|
|
409
448
|
* @default 0
|
|
410
449
|
*/
|
|
411
450
|
"maxSize": number;
|
|
451
|
+
/**
|
|
452
|
+
* @default false
|
|
453
|
+
*/
|
|
454
|
+
"multiple": boolean;
|
|
412
455
|
/**
|
|
413
456
|
* @default ''
|
|
414
457
|
*/
|
|
@@ -422,6 +465,40 @@ export namespace Components {
|
|
|
422
465
|
*/
|
|
423
466
|
"value": unknown;
|
|
424
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
|
|
470
|
+
* record, renders a clear, recognisable invoice summary — number, status, dates,
|
|
471
|
+
* customer/supplier, totals and attachments — instead of a generic field form.
|
|
472
|
+
* The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
|
|
473
|
+
* rendered here: this component only reserves a `slot="lines"` at the right spot in
|
|
474
|
+
* the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
|
|
475
|
+
* table data-loading/event wiring — via its existing `renderRelatedView()` — and
|
|
476
|
+
* projects the resulting `<mrd-table>` into that slot, so line editing keeps using
|
|
477
|
+
* the same generic create/edit-navigation mechanism every other relation already has.
|
|
478
|
+
* Like `mrd-document-view`, this component never resolves file hrefs itself — it only
|
|
479
|
+
* exposes the attachment references via `mrdAttachments` (now possibly more than one)
|
|
480
|
+
* and a plain download button; the host decides how/whether to render them.
|
|
481
|
+
*/
|
|
482
|
+
interface MrdInvoiceView {
|
|
483
|
+
/**
|
|
484
|
+
* Resolved `commons.invoice` binding: slot name → concrete field/relation name.
|
|
485
|
+
*/
|
|
486
|
+
"archetype": ClientArchetype;
|
|
487
|
+
/**
|
|
488
|
+
* The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
|
|
489
|
+
* @default {}
|
|
490
|
+
*/
|
|
491
|
+
"data": Record<string, unknown>;
|
|
492
|
+
/**
|
|
493
|
+
* @default navigator.language
|
|
494
|
+
*/
|
|
495
|
+
"locale": string;
|
|
496
|
+
/**
|
|
497
|
+
* 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.
|
|
498
|
+
* @default null
|
|
499
|
+
*/
|
|
500
|
+
"statusListItems": ClientListValue[] | null;
|
|
501
|
+
}
|
|
425
502
|
interface MrdLayoutSection {
|
|
426
503
|
/**
|
|
427
504
|
* 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 +575,7 @@ export namespace Components {
|
|
|
498
575
|
* List items from the API. Each item has a `key` (stored value) and `label`.
|
|
499
576
|
* @default []
|
|
500
577
|
*/
|
|
501
|
-
"listItems":
|
|
578
|
+
"listItems": ClientListValue1[];
|
|
502
579
|
/**
|
|
503
580
|
* @default navigator.language
|
|
504
581
|
*/
|
|
@@ -652,7 +729,7 @@ export namespace Components {
|
|
|
652
729
|
/**
|
|
653
730
|
* @default []
|
|
654
731
|
*/
|
|
655
|
-
"dropdownValues":
|
|
732
|
+
"dropdownValues": ClientListValue1[];
|
|
656
733
|
"editBehavior"?: ClientLayoutItemRelationEditBehavior | null;
|
|
657
734
|
/**
|
|
658
735
|
* @default ''
|
|
@@ -899,6 +976,10 @@ export interface MrdEmailFieldCustomEvent<T> extends CustomEvent<T> {
|
|
|
899
976
|
detail: T;
|
|
900
977
|
target: HTMLMrdEmailFieldElement;
|
|
901
978
|
}
|
|
979
|
+
export interface MrdEmailViewCustomEvent<T> extends CustomEvent<T> {
|
|
980
|
+
detail: T;
|
|
981
|
+
target: HTMLMrdEmailViewElement;
|
|
982
|
+
}
|
|
902
983
|
export interface MrdFieldCustomEvent<T> extends CustomEvent<T> {
|
|
903
984
|
detail: T;
|
|
904
985
|
target: HTMLMrdFieldElement;
|
|
@@ -919,6 +1000,10 @@ export interface MrdImageFieldCustomEvent<T> extends CustomEvent<T> {
|
|
|
919
1000
|
detail: T;
|
|
920
1001
|
target: HTMLMrdImageFieldElement;
|
|
921
1002
|
}
|
|
1003
|
+
export interface MrdInvoiceViewCustomEvent<T> extends CustomEvent<T> {
|
|
1004
|
+
detail: T;
|
|
1005
|
+
target: HTMLMrdInvoiceViewElement;
|
|
1006
|
+
}
|
|
922
1007
|
export interface MrdLayoutSectionCustomEvent<T> extends CustomEvent<T> {
|
|
923
1008
|
detail: T;
|
|
924
1009
|
target: HTMLMrdLayoutSectionElement;
|
|
@@ -1076,6 +1161,7 @@ declare global {
|
|
|
1076
1161
|
"mrdLoadPage": { nodeId: string; page: number; sort: string; path: string; qs: string };
|
|
1077
1162
|
"mrdNavigate": { href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
|
|
1078
1163
|
"mrdCanCreate": boolean;
|
|
1164
|
+
"mrdTargetLabel": string;
|
|
1079
1165
|
"mrdUpdateObject": { href: string; values: Record<string, unknown> };
|
|
1080
1166
|
"mrdUpload": { file: File };
|
|
1081
1167
|
"mrdCreateObject": { path: string; values: Record<string, unknown> };
|
|
@@ -1161,6 +1247,36 @@ declare global {
|
|
|
1161
1247
|
prototype: HTMLMrdEmailFieldElement;
|
|
1162
1248
|
new (): HTMLMrdEmailFieldElement;
|
|
1163
1249
|
};
|
|
1250
|
+
interface HTMLMrdEmailViewElementEventMap {
|
|
1251
|
+
"mrdNavigate": { href?: string; label: string };
|
|
1252
|
+
"mrdDownload": { href: string; fileName: string };
|
|
1253
|
+
"mrdAttachments": { attachments: DocumentAttachment[] };
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Archetype-driven single-email view. Given a `commons.email` binding and a data
|
|
1257
|
+
* record, renders the message the way an Outlook printout would — subject, a
|
|
1258
|
+
* compact From/To/CC/Date header block, the body and attachments — instead of a
|
|
1259
|
+
* generic field form. Fully read-only: emails arrive through other channels (mail
|
|
1260
|
+
* ingestion gateways), never edited here.
|
|
1261
|
+
* Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
|
|
1262
|
+
* hrefs itself — it only exposes attachment references via `mrdAttachments` (an
|
|
1263
|
+
* email can have several) and plain download buttons; the host decides how/whether
|
|
1264
|
+
* to render them.
|
|
1265
|
+
*/
|
|
1266
|
+
interface HTMLMrdEmailViewElement extends Components.MrdEmailView, HTMLStencilElement {
|
|
1267
|
+
addEventListener<K extends keyof HTMLMrdEmailViewElementEventMap>(type: K, listener: (this: HTMLMrdEmailViewElement, ev: MrdEmailViewCustomEvent<HTMLMrdEmailViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1268
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1269
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1270
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1271
|
+
removeEventListener<K extends keyof HTMLMrdEmailViewElementEventMap>(type: K, listener: (this: HTMLMrdEmailViewElement, ev: MrdEmailViewCustomEvent<HTMLMrdEmailViewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1272
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1273
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1274
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1275
|
+
}
|
|
1276
|
+
var HTMLMrdEmailViewElement: {
|
|
1277
|
+
prototype: HTMLMrdEmailViewElement;
|
|
1278
|
+
new (): HTMLMrdEmailViewElement;
|
|
1279
|
+
};
|
|
1164
1280
|
interface HTMLMrdFieldElementEventMap {
|
|
1165
1281
|
"mrdChange": { name: string; value: unknown };
|
|
1166
1282
|
"mrdBlur": { name: string; value: unknown };
|
|
@@ -1183,8 +1299,8 @@ declare global {
|
|
|
1183
1299
|
new (): HTMLMrdFieldElement;
|
|
1184
1300
|
};
|
|
1185
1301
|
interface HTMLMrdFileFieldElementEventMap {
|
|
1186
|
-
"mrdChange": { name: string; value:
|
|
1187
|
-
"mrdBlur": { name: string; value:
|
|
1302
|
+
"mrdChange": { name: string; value: FileEntry | FileEntry[] | null };
|
|
1303
|
+
"mrdBlur": { name: string; value: FileEntry | FileEntry[] | null };
|
|
1188
1304
|
"mrdUpload": { name: string; file: File };
|
|
1189
1305
|
}
|
|
1190
1306
|
interface HTMLMrdFileFieldElement extends Components.MrdFileField, HTMLStencilElement {
|
|
@@ -1241,8 +1357,8 @@ declare global {
|
|
|
1241
1357
|
new (): HTMLMrdHyperlinkFieldElement;
|
|
1242
1358
|
};
|
|
1243
1359
|
interface HTMLMrdImageFieldElementEventMap {
|
|
1244
|
-
"mrdChange": { name: string; value:
|
|
1245
|
-
"mrdBlur": { name: string; value:
|
|
1360
|
+
"mrdChange": { name: string; value: FileEntry | FileEntry[] | null };
|
|
1361
|
+
"mrdBlur": { name: string; value: FileEntry | FileEntry[] | null };
|
|
1246
1362
|
"mrdUpload": { name: string; file: File };
|
|
1247
1363
|
}
|
|
1248
1364
|
interface HTMLMrdImageFieldElement extends Components.MrdImageField, HTMLStencilElement {
|
|
@@ -1259,6 +1375,39 @@ declare global {
|
|
|
1259
1375
|
prototype: HTMLMrdImageFieldElement;
|
|
1260
1376
|
new (): HTMLMrdImageFieldElement;
|
|
1261
1377
|
};
|
|
1378
|
+
interface HTMLMrdInvoiceViewElementEventMap {
|
|
1379
|
+
"mrdNavigate": { href?: string; label: string };
|
|
1380
|
+
"mrdDownload": { href: string; fileName: string };
|
|
1381
|
+
"mrdAttachments": { attachments: DocumentAttachment[] };
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
|
|
1385
|
+
* record, renders a clear, recognisable invoice summary — number, status, dates,
|
|
1386
|
+
* customer/supplier, totals and attachments — instead of a generic field form.
|
|
1387
|
+
* The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
|
|
1388
|
+
* rendered here: this component only reserves a `slot="lines"` at the right spot in
|
|
1389
|
+
* the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
|
|
1390
|
+
* table data-loading/event wiring — via its existing `renderRelatedView()` — and
|
|
1391
|
+
* projects the resulting `<mrd-table>` into that slot, so line editing keeps using
|
|
1392
|
+
* the same generic create/edit-navigation mechanism every other relation already has.
|
|
1393
|
+
* Like `mrd-document-view`, this component never resolves file hrefs itself — it only
|
|
1394
|
+
* exposes the attachment references via `mrdAttachments` (now possibly more than one)
|
|
1395
|
+
* and a plain download button; the host decides how/whether to render them.
|
|
1396
|
+
*/
|
|
1397
|
+
interface HTMLMrdInvoiceViewElement extends Components.MrdInvoiceView, HTMLStencilElement {
|
|
1398
|
+
addEventListener<K extends keyof HTMLMrdInvoiceViewElementEventMap>(type: K, listener: (this: HTMLMrdInvoiceViewElement, ev: MrdInvoiceViewCustomEvent<HTMLMrdInvoiceViewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1399
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1400
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1401
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1402
|
+
removeEventListener<K extends keyof HTMLMrdInvoiceViewElementEventMap>(type: K, listener: (this: HTMLMrdInvoiceViewElement, ev: MrdInvoiceViewCustomEvent<HTMLMrdInvoiceViewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1403
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1404
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1405
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1406
|
+
}
|
|
1407
|
+
var HTMLMrdInvoiceViewElement: {
|
|
1408
|
+
prototype: HTMLMrdInvoiceViewElement;
|
|
1409
|
+
new (): HTMLMrdInvoiceViewElement;
|
|
1410
|
+
};
|
|
1262
1411
|
interface HTMLMrdLayoutSectionElementEventMap {
|
|
1263
1412
|
"mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] };
|
|
1264
1413
|
"mrdSearch": { query: string; dataClass: string };
|
|
@@ -1492,11 +1641,13 @@ declare global {
|
|
|
1492
1641
|
"mrd-document-list": HTMLMrdDocumentListElement;
|
|
1493
1642
|
"mrd-document-view": HTMLMrdDocumentViewElement;
|
|
1494
1643
|
"mrd-email-field": HTMLMrdEmailFieldElement;
|
|
1644
|
+
"mrd-email-view": HTMLMrdEmailViewElement;
|
|
1495
1645
|
"mrd-field": HTMLMrdFieldElement;
|
|
1496
1646
|
"mrd-file-field": HTMLMrdFileFieldElement;
|
|
1497
1647
|
"mrd-form": HTMLMrdFormElement;
|
|
1498
1648
|
"mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
|
|
1499
1649
|
"mrd-image-field": HTMLMrdImageFieldElement;
|
|
1650
|
+
"mrd-invoice-view": HTMLMrdInvoiceViewElement;
|
|
1500
1651
|
"mrd-layout-section": HTMLMrdLayoutSectionElement;
|
|
1501
1652
|
"mrd-list-field": HTMLMrdListFieldElement;
|
|
1502
1653
|
"mrd-longtext-field": HTMLMrdLongtextFieldElement;
|
|
@@ -1755,6 +1906,10 @@ declare namespace LocalJSX {
|
|
|
1755
1906
|
* A document row was clicked. Host routes to the document object page. `listContext` can be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1`. `attachments` is a prefetch of the clicked row's own file slot (derived from `archetype`) so the host can render a preview immediately, without waiting for the navigated-to page's own mrdAttachments — see TASK-0169 / FINDING-0111.
|
|
1756
1907
|
*/
|
|
1757
1908
|
"onMrdNavigate"?: (event: MrdDocumentListCustomEvent<{ href?: string; label: string; listContext?: ListNavigationContext; attachments?: DocumentAttachment[] }>) => void;
|
|
1909
|
+
/**
|
|
1910
|
+
* Emitted whenever the current target changes: the folder path a new folder or upload lands in, or the container's label when no folder is selected. Empty when there is no target. Lets a host toolbar name the destination.
|
|
1911
|
+
*/
|
|
1912
|
+
"onMrdTargetLabel"?: (event: MrdDocumentListCustomEvent<string>) => void;
|
|
1758
1913
|
/**
|
|
1759
1914
|
* Generic "update an existing object" request — fired when a document is dragged into another folder/container. Host PATCHes `href` with `values` (no move/folder knowledge needed). `values` carries the new folder string (or null for the container root) and, on a cross-container move, the new container relation href.
|
|
1760
1915
|
*/
|
|
@@ -1843,6 +1998,44 @@ declare namespace LocalJSX {
|
|
|
1843
1998
|
*/
|
|
1844
1999
|
"value"?: string;
|
|
1845
2000
|
}
|
|
2001
|
+
/**
|
|
2002
|
+
* Archetype-driven single-email view. Given a `commons.email` binding and a data
|
|
2003
|
+
* record, renders the message the way an Outlook printout would — subject, a
|
|
2004
|
+
* compact From/To/CC/Date header block, the body and attachments — instead of a
|
|
2005
|
+
* generic field form. Fully read-only: emails arrive through other channels (mail
|
|
2006
|
+
* ingestion gateways), never edited here.
|
|
2007
|
+
* Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
|
|
2008
|
+
* hrefs itself — it only exposes attachment references via `mrdAttachments` (an
|
|
2009
|
+
* email can have several) and plain download buttons; the host decides how/whether
|
|
2010
|
+
* to render them.
|
|
2011
|
+
*/
|
|
2012
|
+
interface MrdEmailView {
|
|
2013
|
+
/**
|
|
2014
|
+
* Resolved `commons.email` binding: slot name → concrete field/relation name.
|
|
2015
|
+
*/
|
|
2016
|
+
"archetype": ClientArchetype;
|
|
2017
|
+
/**
|
|
2018
|
+
* The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
|
|
2019
|
+
* @default {}
|
|
2020
|
+
*/
|
|
2021
|
+
"data"?: Record<string, unknown>;
|
|
2022
|
+
/**
|
|
2023
|
+
* @default navigator.language
|
|
2024
|
+
*/
|
|
2025
|
+
"locale"?: string;
|
|
2026
|
+
/**
|
|
2027
|
+
* 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.
|
|
2028
|
+
*/
|
|
2029
|
+
"onMrdAttachments"?: (event: MrdEmailViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
|
|
2030
|
+
/**
|
|
2031
|
+
* Download an attachment. Host resolves the href to a signed URL.
|
|
2032
|
+
*/
|
|
2033
|
+
"onMrdDownload"?: (event: MrdEmailViewCustomEvent<{ href: string; fileName: string }>) => void;
|
|
2034
|
+
/**
|
|
2035
|
+
* Navigate to a sender/recipient or the container. Host resolves the href and routes.
|
|
2036
|
+
*/
|
|
2037
|
+
"onMrdNavigate"?: (event: MrdEmailViewCustomEvent<{ href?: string; label: string }>) => void;
|
|
2038
|
+
}
|
|
1846
2039
|
interface MrdField {
|
|
1847
2040
|
"item": ClientLayoutItem1;
|
|
1848
2041
|
/**
|
|
@@ -1877,14 +2070,18 @@ declare namespace LocalJSX {
|
|
|
1877
2070
|
* @default 0
|
|
1878
2071
|
*/
|
|
1879
2072
|
"maxSize"?: number;
|
|
2073
|
+
/**
|
|
2074
|
+
* @default false
|
|
2075
|
+
*/
|
|
2076
|
+
"multiple"?: boolean;
|
|
1880
2077
|
/**
|
|
1881
2078
|
* @default ''
|
|
1882
2079
|
*/
|
|
1883
2080
|
"name"?: string;
|
|
1884
|
-
"onMrdBlur"?: (event: MrdFileFieldCustomEvent<{ name: string; value:
|
|
1885
|
-
"onMrdChange"?: (event: MrdFileFieldCustomEvent<{ name: string; value:
|
|
2081
|
+
"onMrdBlur"?: (event: MrdFileFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
|
|
2082
|
+
"onMrdChange"?: (event: MrdFileFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
|
|
1886
2083
|
/**
|
|
1887
|
-
* Emitted
|
|
2084
|
+
* 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
2085
|
*/
|
|
1889
2086
|
"onMrdUpload"?: (event: MrdFileFieldCustomEvent<{ name: string; file: File }>) => void;
|
|
1890
2087
|
/**
|
|
@@ -1985,14 +2182,18 @@ declare namespace LocalJSX {
|
|
|
1985
2182
|
* @default 0
|
|
1986
2183
|
*/
|
|
1987
2184
|
"maxSize"?: number;
|
|
2185
|
+
/**
|
|
2186
|
+
* @default false
|
|
2187
|
+
*/
|
|
2188
|
+
"multiple"?: boolean;
|
|
1988
2189
|
/**
|
|
1989
2190
|
* @default ''
|
|
1990
2191
|
*/
|
|
1991
2192
|
"name"?: string;
|
|
1992
|
-
"onMrdBlur"?: (event: MrdImageFieldCustomEvent<{ name: string; value:
|
|
1993
|
-
"onMrdChange"?: (event: MrdImageFieldCustomEvent<{ name: string; value:
|
|
2193
|
+
"onMrdBlur"?: (event: MrdImageFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
|
|
2194
|
+
"onMrdChange"?: (event: MrdImageFieldCustomEvent<{ name: string; value: FileEntry | FileEntry[] | null }>) => void;
|
|
1994
2195
|
/**
|
|
1995
|
-
* Emitted
|
|
2196
|
+
* 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
2197
|
*/
|
|
1997
2198
|
"onMrdUpload"?: (event: MrdImageFieldCustomEvent<{ name: string; file: File }>) => void;
|
|
1998
2199
|
/**
|
|
@@ -2004,6 +2205,52 @@ declare namespace LocalJSX {
|
|
|
2004
2205
|
*/
|
|
2005
2206
|
"value"?: unknown;
|
|
2006
2207
|
}
|
|
2208
|
+
/**
|
|
2209
|
+
* Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
|
|
2210
|
+
* record, renders a clear, recognisable invoice summary — number, status, dates,
|
|
2211
|
+
* customer/supplier, totals and attachments — instead of a generic field form.
|
|
2212
|
+
* The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
|
|
2213
|
+
* rendered here: this component only reserves a `slot="lines"` at the right spot in
|
|
2214
|
+
* the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
|
|
2215
|
+
* table data-loading/event wiring — via its existing `renderRelatedView()` — and
|
|
2216
|
+
* projects the resulting `<mrd-table>` into that slot, so line editing keeps using
|
|
2217
|
+
* the same generic create/edit-navigation mechanism every other relation already has.
|
|
2218
|
+
* Like `mrd-document-view`, this component never resolves file hrefs itself — it only
|
|
2219
|
+
* exposes the attachment references via `mrdAttachments` (now possibly more than one)
|
|
2220
|
+
* and a plain download button; the host decides how/whether to render them.
|
|
2221
|
+
*/
|
|
2222
|
+
interface MrdInvoiceView {
|
|
2223
|
+
/**
|
|
2224
|
+
* Resolved `commons.invoice` binding: slot name → concrete field/relation name.
|
|
2225
|
+
*/
|
|
2226
|
+
"archetype": ClientArchetype;
|
|
2227
|
+
/**
|
|
2228
|
+
* The data record from the /data endpoint. Fields keyed by name; relations under `_links`.
|
|
2229
|
+
* @default {}
|
|
2230
|
+
*/
|
|
2231
|
+
"data"?: Record<string, unknown>;
|
|
2232
|
+
/**
|
|
2233
|
+
* @default navigator.language
|
|
2234
|
+
*/
|
|
2235
|
+
"locale"?: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* 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.
|
|
2238
|
+
*/
|
|
2239
|
+
"onMrdAttachments"?: (event: MrdInvoiceViewCustomEvent<{ attachments: DocumentAttachment[] }>) => void;
|
|
2240
|
+
/**
|
|
2241
|
+
* Download an attachment. Host resolves the href to a signed URL.
|
|
2242
|
+
*/
|
|
2243
|
+
"onMrdDownload"?: (event: MrdInvoiceViewCustomEvent<{ href: string; fileName: string }>) => void;
|
|
2244
|
+
/**
|
|
2245
|
+
* Navigate to the customer/supplier/container. Host resolves the href and routes.
|
|
2246
|
+
*/
|
|
2247
|
+
"onMrdNavigate"?: (event: MrdInvoiceViewCustomEvent<{ href?: string; label: string }>) => void;
|
|
2248
|
+
/**
|
|
2249
|
+
* 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.
|
|
2250
|
+
* @default null
|
|
2251
|
+
*/
|
|
2252
|
+
"statusListItems"?: ClientListValue[] | null;
|
|
2253
|
+
}
|
|
2007
2254
|
interface MrdLayoutSection {
|
|
2008
2255
|
/**
|
|
2009
2256
|
* 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 +2337,7 @@ declare namespace LocalJSX {
|
|
|
2090
2337
|
* List items from the API. Each item has a `key` (stored value) and `label`.
|
|
2091
2338
|
* @default []
|
|
2092
2339
|
*/
|
|
2093
|
-
"listItems"?:
|
|
2340
|
+
"listItems"?: ClientListValue1[];
|
|
2094
2341
|
/**
|
|
2095
2342
|
* @default navigator.language
|
|
2096
2343
|
*/
|
|
@@ -2247,7 +2494,7 @@ declare namespace LocalJSX {
|
|
|
2247
2494
|
/**
|
|
2248
2495
|
* @default []
|
|
2249
2496
|
*/
|
|
2250
|
-
"dropdownValues"?:
|
|
2497
|
+
"dropdownValues"?: ClientListValue1[];
|
|
2251
2498
|
"editBehavior"?: ClientLayoutItemRelationEditBehavior | null;
|
|
2252
2499
|
/**
|
|
2253
2500
|
* @default ''
|
|
@@ -2538,6 +2785,9 @@ declare namespace LocalJSX {
|
|
|
2538
2785
|
"disabled": boolean;
|
|
2539
2786
|
"locale": string;
|
|
2540
2787
|
}
|
|
2788
|
+
interface MrdEmailViewAttributes {
|
|
2789
|
+
"locale": string;
|
|
2790
|
+
}
|
|
2541
2791
|
interface MrdFieldAttributes {
|
|
2542
2792
|
"locale": string;
|
|
2543
2793
|
}
|
|
@@ -2549,6 +2799,7 @@ declare namespace LocalJSX {
|
|
|
2549
2799
|
"locale": string;
|
|
2550
2800
|
"accept": string;
|
|
2551
2801
|
"maxSize": number;
|
|
2802
|
+
"multiple": boolean;
|
|
2552
2803
|
}
|
|
2553
2804
|
interface MrdFormAttributes {
|
|
2554
2805
|
"locale": string;
|
|
@@ -2573,6 +2824,10 @@ declare namespace LocalJSX {
|
|
|
2573
2824
|
"locale": string;
|
|
2574
2825
|
"accept": string;
|
|
2575
2826
|
"maxSize": number;
|
|
2827
|
+
"multiple": boolean;
|
|
2828
|
+
}
|
|
2829
|
+
interface MrdInvoiceViewAttributes {
|
|
2830
|
+
"locale": string;
|
|
2576
2831
|
}
|
|
2577
2832
|
interface MrdLayoutSectionAttributes {
|
|
2578
2833
|
"locale": string;
|
|
@@ -2681,11 +2936,13 @@ declare namespace LocalJSX {
|
|
|
2681
2936
|
"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
2937
|
"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
2938
|
"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] };
|
|
2939
|
+
"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
2940
|
"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
2941
|
"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
2942
|
"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
2943
|
"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
2944
|
"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] };
|
|
2945
|
+
"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
2946
|
"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
2947
|
"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
2948
|
"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 +3009,38 @@ declare module "@stencil/core" {
|
|
|
2752
3009
|
*/
|
|
2753
3010
|
"mrd-document-view": LocalJSX.IntrinsicElements["mrd-document-view"] & JSXBase.HTMLAttributes<HTMLMrdDocumentViewElement>;
|
|
2754
3011
|
"mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
|
|
3012
|
+
/**
|
|
3013
|
+
* Archetype-driven single-email view. Given a `commons.email` binding and a data
|
|
3014
|
+
* record, renders the message the way an Outlook printout would — subject, a
|
|
3015
|
+
* compact From/To/CC/Date header block, the body and attachments — instead of a
|
|
3016
|
+
* generic field form. Fully read-only: emails arrive through other channels (mail
|
|
3017
|
+
* ingestion gateways), never edited here.
|
|
3018
|
+
* Like `mrd-document-view`/`mrd-invoice-view`, this component never resolves file
|
|
3019
|
+
* hrefs itself — it only exposes attachment references via `mrdAttachments` (an
|
|
3020
|
+
* email can have several) and plain download buttons; the host decides how/whether
|
|
3021
|
+
* to render them.
|
|
3022
|
+
*/
|
|
3023
|
+
"mrd-email-view": LocalJSX.IntrinsicElements["mrd-email-view"] & JSXBase.HTMLAttributes<HTMLMrdEmailViewElement>;
|
|
2755
3024
|
"mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
|
|
2756
3025
|
"mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
|
|
2757
3026
|
"mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
|
|
2758
3027
|
"mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
|
|
2759
3028
|
"mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
|
|
3029
|
+
/**
|
|
3030
|
+
* Archetype-driven single-invoice view. Given a `commons.invoice` binding and a data
|
|
3031
|
+
* record, renders a clear, recognisable invoice summary — number, status, dates,
|
|
3032
|
+
* customer/supplier, totals and attachments — instead of a generic field form.
|
|
3033
|
+
* The line items (`lines` slot, the `commons.invoiceLine` sub-archetype) are NOT
|
|
3034
|
+
* rendered here: this component only reserves a `slot="lines"` at the right spot in
|
|
3035
|
+
* the layout. The host (`mrd-layout-section`) still owns all the actual RELATED_VIEW
|
|
3036
|
+
* table data-loading/event wiring — via its existing `renderRelatedView()` — and
|
|
3037
|
+
* projects the resulting `<mrd-table>` into that slot, so line editing keeps using
|
|
3038
|
+
* the same generic create/edit-navigation mechanism every other relation already has.
|
|
3039
|
+
* Like `mrd-document-view`, this component never resolves file hrefs itself — it only
|
|
3040
|
+
* exposes the attachment references via `mrdAttachments` (now possibly more than one)
|
|
3041
|
+
* and a plain download button; the host decides how/whether to render them.
|
|
3042
|
+
*/
|
|
3043
|
+
"mrd-invoice-view": LocalJSX.IntrinsicElements["mrd-invoice-view"] & JSXBase.HTMLAttributes<HTMLMrdInvoiceViewElement>;
|
|
2760
3044
|
"mrd-layout-section": LocalJSX.IntrinsicElements["mrd-layout-section"] & JSXBase.HTMLAttributes<HTMLMrdLayoutSectionElement>;
|
|
2761
3045
|
"mrd-list-field": LocalJSX.IntrinsicElements["mrd-list-field"] & JSXBase.HTMLAttributes<HTMLMrdListFieldElement>;
|
|
2762
3046
|
"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
|
|
@@ -133,6 +139,8 @@ export interface ClientLayoutItemField {
|
|
|
133
139
|
/** Aggregate function to render in the table totals row. */
|
|
134
140
|
aggregate?: 'sum' | 'avg' | 'count' | null;
|
|
135
141
|
historyEnabled?: boolean;
|
|
142
|
+
/** Render the item on an OBJECT_DASHBOARD even when it has no value. */
|
|
143
|
+
showEmpty?: boolean;
|
|
136
144
|
}
|
|
137
145
|
/** Response shape from the /aggregations endpoint. */
|
|
138
146
|
export interface AggregationResult {
|
|
@@ -154,6 +162,8 @@ export interface ClientLayoutItemRelation {
|
|
|
154
162
|
multiple?: boolean;
|
|
155
163
|
defaultValue?: string | null;
|
|
156
164
|
dropdownValues?: ClientListValue[];
|
|
165
|
+
/** Render the item on an OBJECT_DASHBOARD even when it has no value. */
|
|
166
|
+
showEmpty?: boolean;
|
|
157
167
|
}
|
|
158
168
|
export interface ClientLayoutItemNavigate {
|
|
159
169
|
dataClass: string;
|
|
@@ -232,6 +242,9 @@ export interface ClientLayoutItem {
|
|
|
232
242
|
decimalPrecision?: number;
|
|
233
243
|
currencyCode?: string;
|
|
234
244
|
historyEnabled?: boolean;
|
|
245
|
+
/** FIELD / RELATION — render the item on an OBJECT_DASHBOARD even when it has
|
|
246
|
+
* no value, instead of hiding it (the default). */
|
|
247
|
+
showEmpty?: boolean;
|
|
235
248
|
relatedClass?: string;
|
|
236
249
|
mostSignificantClass?: string;
|
|
237
250
|
displayType?: ClientLayoutItemRelationDisplayType;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { ClientArchetype, DocumentAttachment } from '../types/client-layout';
|
|
2
2
|
/**
|
|
3
|
-
* Extract
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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;
|