@mmlogic/components 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_24.cjs.entry.js} +237 -34
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +14 -1
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +22 -7
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +8 -5
- package/dist/collection/components/documents/mrd-document-list/tree-view.js +13 -1
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +39 -29
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +109 -8
- package/dist/collection/components/documents/mrd-file-preview/file-preview-kind.js +30 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +59 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +212 -0
- 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.js +1 -1
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
- 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-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/layout/mrd-layout-section/mrd-layout-section.css +5 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +91 -8
- package/dist/collection/dev/api.js +9 -0
- package/dist/collection/dev/app.js +101 -3
- package/dist/collection/dev/example-data.js +24 -0
- package/dist/collection/types/client-layout.js +8 -0
- package/dist/collection/utils/i18n.js +32 -0
- package/dist/components/client-layout.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-file-field2.js +1 -1
- package/dist/components/mrd-file-preview.d.ts +11 -0
- package/dist/components/mrd-file-preview.js +1 -0
- package/dist/components/mrd-file-preview2.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_24.entry.js} +238 -36
- package/dist/mosterdcomponents/cell-renderer-PbcEU4ph.js.map +1 -0
- package/dist/mosterdcomponents/client-layout-DCOAAH92.js.map +1 -0
- package/dist/mosterdcomponents/field-helpers-CASS3akr.js.map +1 -0
- package/dist/mosterdcomponents/file-upload-common-D1ndi6cN.js.map +1 -0
- package/dist/mosterdcomponents/format-BAfsQfy1.js.map +1 -0
- package/dist/mosterdcomponents/i18n-B1IIkRF9.js.map +1 -0
- package/dist/mosterdcomponents/index-AokUFVX0.js.map +1 -0
- package/dist/mosterdcomponents/index-CprJSlzK.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/index.esm.js.map +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
- package/dist/mosterdcomponents/p-aae8a9dc.entry.js +1 -0
- package/dist/mosterdcomponents/query-params-B1HfnMOl.js.map +1 -0
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
- package/dist/mosterdcomponents/validation-DbEViuiw.js.map +1 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +6 -2
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +29 -1
- package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +9 -0
- package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +41 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +17 -1
- package/dist/types/components.d.ts +178 -7
- package/dist/types/types/client-layout.d.ts +10 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-b1a2e108.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-DbEViuiw.js","sources":["src/utils/validation.ts"],"sourcesContent":["import { ClientLayoutItemFieldDataType } from '../types';\n\nexport function validateRequired(value: unknown): boolean {\n if (value === null || value === undefined) return false;\n if (typeof value === 'string') return value.trim().length > 0;\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') {\n // HyperlinkValue check\n const hv = value as { href?: unknown };\n if ('href' in hv) return typeof hv.href === 'string' && hv.href.trim().length > 0;\n // CurrencyValue check\n const cv = value as { amount?: unknown };\n if ('amount' in cv) return cv.amount !== null && cv.amount !== undefined && cv.amount !== '';\n }\n return true;\n}\n\nexport function validateEmail(value: string): boolean {\n if (!value) return true;\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value);\n}\n\nexport function validateUrl(value: string): boolean {\n if (!value) return true;\n try {\n const url = new URL(value);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n}\n\nexport function validateNumber(value: unknown, dataType: ClientLayoutItemFieldDataType): boolean {\n if (value === null || value === undefined || value === '') return true;\n const num = Number(value);\n if (isNaN(num)) return false;\n if (dataType === ClientLayoutItemFieldDataType.INTEGER) {\n return Number.isInteger(num);\n }\n if (dataType === ClientLayoutItemFieldDataType.PERCENTAGE) {\n return num >= 0 && num <= 100;\n }\n return true;\n}\n"],"names":[],"mappings":";;;AAEM,SAAU,gBAAgB,CAAC,KAAc,EAAA;AAC7C,IAAA,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,KAAK;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;AAC7D,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;AACjD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;;QAE7B,MAAM,EAAE,GAAG,KAA2B;QACtC,IAAI,MAAM,IAAI,EAAE;AAAE,YAAA,OAAO,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;;QAEjF,MAAM,EAAE,GAAG,KAA6B;QACxC,IAAI,QAAQ,IAAI,EAAE;AAAE,YAAA,OAAO,EAAE,CAAC,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,EAAE;;AAE9F,IAAA,OAAO,IAAI;AACb;AAEM,SAAU,aAAa,CAAC,KAAa,EAAA;AACzC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AACvB,IAAA,OAAO,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC;AACjD;AAEM,SAAU,WAAW,CAAC,KAAa,EAAA;AACvC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AACvB,IAAA,IAAI;AACF,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC;QAC1B,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;;IAC5D,OAAA,EAAA,EAAM;AACN,QAAA,OAAO,KAAK;;AAEhB;AAEM,SAAU,cAAc,CAAC,KAAc,EAAE,QAAuC,EAAA;IACpF,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;AAAE,QAAA,OAAO,IAAI;AACtE,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;AAC5B,IAAA,IAAI,QAAQ,KAAK,6BAA6B,CAAC,OAAO,EAAE;AACtD,QAAA,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC;;AAE9B,IAAA,IAAI,QAAQ,KAAK,6BAA6B,CAAC,UAAU,EAAE;AACzD,QAAA,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG;;AAE/B,IAAA,OAAO,IAAI;AACb;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientArchetype, ClientLayoutItem } from '../../../types/client-layout';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem, ClientLayoutNavigateBehaviour } from '../../../types/client-layout';
|
|
3
3
|
/**
|
|
4
4
|
* Owns a document collection view: a single toolbar (view switch + collection
|
|
5
5
|
* actions like "New folder", and — later — upload / drag-drop) plus the two
|
|
@@ -49,10 +49,14 @@ export declare class MrdDocumentContainer {
|
|
|
49
49
|
qs: string;
|
|
50
50
|
aggQs: string;
|
|
51
51
|
}>;
|
|
52
|
-
/** A row / document was activated. Host routes to the object page.
|
|
52
|
+
/** A row / document was activated. Host routes to the object page. Documents
|
|
53
|
+
* are always the "quick look" use case, so navigateBehaviour is hardcoded
|
|
54
|
+
* to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in
|
|
55
|
+
* mrd-layout-section, which takes it from the item's configuration. */
|
|
53
56
|
mrdNavigate: EventEmitter<{
|
|
54
57
|
href?: string;
|
|
55
58
|
label: string;
|
|
59
|
+
navigateBehaviour?: ClientLayoutNavigateBehaviour;
|
|
56
60
|
}>;
|
|
57
61
|
/** A table toolbar action was triggered. */
|
|
58
62
|
mrdAction: EventEmitter<{
|
|
@@ -16,6 +16,15 @@ export declare class MrdDocumentView {
|
|
|
16
16
|
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
17
17
|
data: Record<string, unknown>;
|
|
18
18
|
locale: string;
|
|
19
|
+
/** Signed URL for the file's inline preview (mrd-file-preview), resolved by
|
|
20
|
+
* the host in response to mrdLoadPreview. Empty while unresolved — the
|
|
21
|
+
* preview area shows a loading state until the host injects a value. */
|
|
22
|
+
previewUrl: string;
|
|
23
|
+
/** Minimum height (px) of the inline preview area — it stretches to fill the
|
|
24
|
+
* available row height in the wide side-by-side layout (see mrd-document-view.scss),
|
|
25
|
+
* and falls back to this height when stacked. Overlay hosts typically pass a
|
|
26
|
+
* smaller value than the full-page default to fit available chrome. */
|
|
27
|
+
previewHeight: number;
|
|
19
28
|
/** Navigate to the container (dossier). Host resolves the href and routes. */
|
|
20
29
|
mrdNavigate: EventEmitter<{
|
|
21
30
|
href?: string;
|
|
@@ -26,11 +35,30 @@ export declare class MrdDocumentView {
|
|
|
26
35
|
href: string;
|
|
27
36
|
fileName: string;
|
|
28
37
|
}>;
|
|
38
|
+
/** The file slot has an href and needs a signed URL for inline preview.
|
|
39
|
+
* Fired once on load and again whenever the file href changes (e.g. the
|
|
40
|
+
* overlay is reused for a different document via prev/next). Host resolves
|
|
41
|
+
* it and calls back with `previewUrl` — the same pattern as mrdLoadImage /
|
|
42
|
+
* setImagePreview on mrd-layout-section. */
|
|
43
|
+
mrdLoadPreview: EventEmitter<{
|
|
44
|
+
href: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** Tracks the href a preview was last requested for, so componentDidLoad and
|
|
47
|
+
* the data watcher don't emit duplicate requests for the same file. */
|
|
48
|
+
private lastPreviewHref;
|
|
49
|
+
componentDidLoad(): void;
|
|
50
|
+
dataChanged(): void;
|
|
51
|
+
private requestPreviewIfNeeded;
|
|
29
52
|
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
30
53
|
private slotValue;
|
|
31
54
|
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
32
55
|
private slotLink;
|
|
33
56
|
private renderContainer;
|
|
34
|
-
|
|
57
|
+
/** Filename + download button — part of the metadata column, not the preview
|
|
58
|
+
* panel, so it stays next to the title/summary in the wide side-by-side layout. */
|
|
59
|
+
private renderFileMeta;
|
|
60
|
+
/** The preview panel itself (iframe/image/loading state) — its own grid
|
|
61
|
+
* column in the wide layout, so it can take the full available height. */
|
|
62
|
+
private renderPreviewPanel;
|
|
35
63
|
render(): any;
|
|
36
64
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Pure classification logic for mrd-file-preview — no Stencil dependency. */
|
|
2
|
+
export type FilePreviewKind = 'pdf' | 'image' | 'unsupported';
|
|
3
|
+
/**
|
|
4
|
+
* Decide how to render a file given its declared mime type and/or file name.
|
|
5
|
+
* A declared mime type is authoritative when present (a mismatched file name
|
|
6
|
+
* extension is ignored); the file name extension is only consulted as a
|
|
7
|
+
* fallback when no mime type is known.
|
|
8
|
+
*/
|
|
9
|
+
export declare function detectPreviewKind(mimeType?: string | null, fileName?: string | null): FilePreviewKind;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
|
|
4
|
+
* or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
|
|
5
|
+
* presentational: the signed URL is used directly as element `src` — a
|
|
6
|
+
* navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
|
|
7
|
+
* the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
|
|
8
|
+
* `setImagePreview` on mrd-layout-section.
|
|
9
|
+
*/
|
|
10
|
+
export declare class MrdFilePreview {
|
|
11
|
+
/** Signed URL to render. */
|
|
12
|
+
src: string;
|
|
13
|
+
/** Declared mime type (e.g. 'application/pdf', 'image/png'), when known.
|
|
14
|
+
* Authoritative over `fileName` when present. */
|
|
15
|
+
mimeType: string;
|
|
16
|
+
/** Original file name — used for extension-based detection when `mimeType`
|
|
17
|
+
* is absent, and as alt/title text. */
|
|
18
|
+
fileName: string;
|
|
19
|
+
/** The file's own reference href (not the signed preview URL in `src`).
|
|
20
|
+
* When set, an unsupported type falls back to the same download button
|
|
21
|
+
* used elsewhere in the library, so hosts need no new wiring. */
|
|
22
|
+
href: string;
|
|
23
|
+
locale: string;
|
|
24
|
+
/** The image failed to load — most likely an expired signed URL. Host
|
|
25
|
+
* should fetch a fresh signed URL and update `src`.
|
|
26
|
+
* Note: this is only raised for images. Browsers don't reliably surface
|
|
27
|
+
* HTTP-level failures (e.g. a 403 on an expired URL) through an iframe's
|
|
28
|
+
* load/error events, so the same detection isn't available for PDFs. */
|
|
29
|
+
mrdPreviewReload: EventEmitter<void>;
|
|
30
|
+
/** Download the file. Same shape as mrd-document-view / mrd-layout-section's
|
|
31
|
+
* mrdDownload — host resolves `href` to a signed URL. */
|
|
32
|
+
mrdDownload: EventEmitter<{
|
|
33
|
+
href: string;
|
|
34
|
+
fileName: string;
|
|
35
|
+
}>;
|
|
36
|
+
private imageFailed;
|
|
37
|
+
srcChanged(): void;
|
|
38
|
+
private onImageError;
|
|
39
|
+
private retry;
|
|
40
|
+
render(): any;
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, ClientArchetype, RelationSearchResult } from '../../../types/client-layout';
|
|
2
|
+
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, ClientArchetype, RelationSearchResult } from '../../../types/client-layout';
|
|
3
3
|
import { DistinctValue } from '../../documents/mrd-document-list/folder-tree';
|
|
4
4
|
export declare class MrdLayoutSection {
|
|
5
5
|
el: HTMLElement;
|
|
@@ -17,16 +17,23 @@ export declare class MrdLayoutSection {
|
|
|
17
17
|
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
18
18
|
* the record is rendered as a single-document view instead of generic fields. */
|
|
19
19
|
archetypes: ClientArchetype[];
|
|
20
|
+
/** Minimum height (px) of the commons.document inline file preview — it
|
|
21
|
+
* stretches taller in the wide side-by-side layout. Pass a smaller value
|
|
22
|
+
* when embedding the record in an overlay with limited height. */
|
|
23
|
+
documentPreviewHeight: number;
|
|
20
24
|
private searchQueryMap;
|
|
21
25
|
private searchResultsMap;
|
|
22
26
|
private imagePreviewUrl;
|
|
23
27
|
private imagePreviews;
|
|
24
28
|
private openHistoryField;
|
|
29
|
+
/** Signed URL for the commons.document archetype's inline file preview. */
|
|
30
|
+
private documentPreviewUrl;
|
|
25
31
|
private historyClickOutside;
|
|
26
32
|
mrdNavigate: EventEmitter<{
|
|
27
33
|
href?: string;
|
|
28
34
|
label: string;
|
|
29
35
|
navigate?: ClientLayoutItemNavigate;
|
|
36
|
+
navigateBehaviour?: ClientLayoutNavigateBehaviour;
|
|
30
37
|
}>;
|
|
31
38
|
mrdSearch: EventEmitter<{
|
|
32
39
|
query: string;
|
|
@@ -51,6 +58,12 @@ export declare class MrdLayoutSection {
|
|
|
51
58
|
fieldName: string;
|
|
52
59
|
href: string;
|
|
53
60
|
}>;
|
|
61
|
+
/** Re-emitted from an embedded mrd-document-view's mrdLoadPreview (commons.document
|
|
62
|
+
* single-object view); host resolves the file href to a signed URL and calls
|
|
63
|
+
* setDocumentPreviewUrl(). */
|
|
64
|
+
mrdLoadDocumentPreview: EventEmitter<{
|
|
65
|
+
href: string;
|
|
66
|
+
}>;
|
|
54
67
|
/** Re-emitted from an embedded mrd-table's mrdAction; host builds the target URL from dataClass. */
|
|
55
68
|
mrdViewAction: EventEmitter<{
|
|
56
69
|
name: string;
|
|
@@ -125,6 +138,9 @@ export declare class MrdLayoutSection {
|
|
|
125
138
|
setImagePreview(fieldName: string, url: string): Promise<void>;
|
|
126
139
|
/** Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field). */
|
|
127
140
|
openImagePreview(url: string): Promise<void>;
|
|
141
|
+
/** Provide a resolved signed URL for the commons.document archetype's inline
|
|
142
|
+
* file preview, in response to mrdLoadDocumentPreview. */
|
|
143
|
+
setDocumentPreviewUrl(url: string): Promise<void>;
|
|
128
144
|
private resolveSearchKey;
|
|
129
145
|
private handleViewLoadPage;
|
|
130
146
|
private handleSearchInput;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
|
|
9
|
-
import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
|
|
9
|
+
import { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
|
|
10
10
|
import { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
|
|
11
11
|
export { ClientLayout, ClientLayoutItem as ClientLayoutItem1, ClientLayoutItemFieldDataType, ClientLayoutItemRelationDisplayType, ClientLayoutItemRelationEditBehavior, ClientListValue, CurrencyValue, RelationSearchResult } from "./types";
|
|
12
|
-
export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
|
|
12
|
+
export { AggregationResult, ClientArchetype, ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, HyperlinkValue, RelationSearchResult as RelationSearchResult1 } from "./types/client-layout";
|
|
13
13
|
export { DistinctValue, DocRow } from "./components/documents/mrd-document-list/folder-tree";
|
|
14
14
|
export namespace Components {
|
|
15
15
|
interface MrdBooleanField {
|
|
@@ -245,6 +245,16 @@ export namespace Components {
|
|
|
245
245
|
* @default navigator.language
|
|
246
246
|
*/
|
|
247
247
|
"locale": string;
|
|
248
|
+
/**
|
|
249
|
+
* Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
|
|
250
|
+
* @default 640
|
|
251
|
+
*/
|
|
252
|
+
"previewHeight": number;
|
|
253
|
+
/**
|
|
254
|
+
* Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
|
|
255
|
+
* @default ''
|
|
256
|
+
*/
|
|
257
|
+
"previewUrl": string;
|
|
248
258
|
}
|
|
249
259
|
interface MrdEmailField {
|
|
250
260
|
/**
|
|
@@ -318,6 +328,40 @@ export namespace Components {
|
|
|
318
328
|
*/
|
|
319
329
|
"value": unknown;
|
|
320
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
|
|
333
|
+
* or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
|
|
334
|
+
* presentational: the signed URL is used directly as element `src` — a
|
|
335
|
+
* navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
|
|
336
|
+
* the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
|
|
337
|
+
* `setImagePreview` on mrd-layout-section.
|
|
338
|
+
*/
|
|
339
|
+
interface MrdFilePreview {
|
|
340
|
+
/**
|
|
341
|
+
* Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
|
|
342
|
+
* @default ''
|
|
343
|
+
*/
|
|
344
|
+
"fileName": string;
|
|
345
|
+
/**
|
|
346
|
+
* The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
|
|
347
|
+
* @default ''
|
|
348
|
+
*/
|
|
349
|
+
"href": string;
|
|
350
|
+
/**
|
|
351
|
+
* @default navigator.language
|
|
352
|
+
*/
|
|
353
|
+
"locale": string;
|
|
354
|
+
/**
|
|
355
|
+
* Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
|
|
356
|
+
* @default ''
|
|
357
|
+
*/
|
|
358
|
+
"mimeType": string;
|
|
359
|
+
/**
|
|
360
|
+
* Signed URL to render.
|
|
361
|
+
* @default ''
|
|
362
|
+
*/
|
|
363
|
+
"src": string;
|
|
364
|
+
}
|
|
321
365
|
interface MrdForm {
|
|
322
366
|
"layout": ClientLayout;
|
|
323
367
|
/**
|
|
@@ -425,6 +469,11 @@ export namespace Components {
|
|
|
425
469
|
* @default {}
|
|
426
470
|
*/
|
|
427
471
|
"data": Record<string, unknown>;
|
|
472
|
+
/**
|
|
473
|
+
* Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
|
|
474
|
+
* @default 640
|
|
475
|
+
*/
|
|
476
|
+
"documentPreviewHeight": number;
|
|
428
477
|
/**
|
|
429
478
|
* Items from one layout entry in ClientDashboardMetadata.layouts[].
|
|
430
479
|
* @default []
|
|
@@ -443,6 +492,10 @@ export namespace Components {
|
|
|
443
492
|
* Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field).
|
|
444
493
|
*/
|
|
445
494
|
"openImagePreview": (url: string) => Promise<void>;
|
|
495
|
+
/**
|
|
496
|
+
* Provide a resolved signed URL for the commons.document archetype's inline file preview, in response to mrdLoadDocumentPreview.
|
|
497
|
+
*/
|
|
498
|
+
"setDocumentPreviewUrl": (url: string) => Promise<void>;
|
|
446
499
|
/**
|
|
447
500
|
* Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox.
|
|
448
501
|
*/
|
|
@@ -848,6 +901,10 @@ export interface MrdFileFieldCustomEvent<T> extends CustomEvent<T> {
|
|
|
848
901
|
detail: T;
|
|
849
902
|
target: HTMLMrdFileFieldElement;
|
|
850
903
|
}
|
|
904
|
+
export interface MrdFilePreviewCustomEvent<T> extends CustomEvent<T> {
|
|
905
|
+
detail: T;
|
|
906
|
+
target: HTMLMrdFilePreviewElement;
|
|
907
|
+
}
|
|
851
908
|
export interface MrdFormCustomEvent<T> extends CustomEvent<T> {
|
|
852
909
|
detail: T;
|
|
853
910
|
target: HTMLMrdFormElement;
|
|
@@ -977,7 +1034,7 @@ declare global {
|
|
|
977
1034
|
"mrdLoadPage": { page: number; sort: string; path: string; qs: string; nodeId?: string };
|
|
978
1035
|
"mrdLoadDistinct": { nodeId: string; distinct: string; path: string; qs: string };
|
|
979
1036
|
"mrdLoadAggregations": { path: string; qs: string; aggQs: string };
|
|
980
|
-
"mrdNavigate": { href?: string; label: string };
|
|
1037
|
+
"mrdNavigate": { href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour };
|
|
981
1038
|
"mrdAction": { action: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
|
|
982
1039
|
"mrdUpdateObject": { href: string; values: Record<string, unknown> };
|
|
983
1040
|
"mrdUpload": { file: File };
|
|
@@ -1049,6 +1106,7 @@ declare global {
|
|
|
1049
1106
|
interface HTMLMrdDocumentViewElementEventMap {
|
|
1050
1107
|
"mrdNavigate": { href?: string; label: string };
|
|
1051
1108
|
"mrdDownload": { href: string; fileName: string };
|
|
1109
|
+
"mrdLoadPreview": { href: string };
|
|
1052
1110
|
}
|
|
1053
1111
|
/**
|
|
1054
1112
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
@@ -1131,6 +1189,32 @@ declare global {
|
|
|
1131
1189
|
prototype: HTMLMrdFileFieldElement;
|
|
1132
1190
|
new (): HTMLMrdFileFieldElement;
|
|
1133
1191
|
};
|
|
1192
|
+
interface HTMLMrdFilePreviewElementEventMap {
|
|
1193
|
+
"mrdPreviewReload": void;
|
|
1194
|
+
"mrdDownload": { href: string; fileName: string };
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
|
|
1198
|
+
* or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
|
|
1199
|
+
* presentational: the signed URL is used directly as element `src` — a
|
|
1200
|
+
* navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
|
|
1201
|
+
* the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
|
|
1202
|
+
* `setImagePreview` on mrd-layout-section.
|
|
1203
|
+
*/
|
|
1204
|
+
interface HTMLMrdFilePreviewElement extends Components.MrdFilePreview, HTMLStencilElement {
|
|
1205
|
+
addEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1206
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1207
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1208
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1209
|
+
removeEventListener<K extends keyof HTMLMrdFilePreviewElementEventMap>(type: K, listener: (this: HTMLMrdFilePreviewElement, ev: MrdFilePreviewCustomEvent<HTMLMrdFilePreviewElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1210
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1211
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1212
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1213
|
+
}
|
|
1214
|
+
var HTMLMrdFilePreviewElement: {
|
|
1215
|
+
prototype: HTMLMrdFilePreviewElement;
|
|
1216
|
+
new (): HTMLMrdFilePreviewElement;
|
|
1217
|
+
};
|
|
1134
1218
|
interface HTMLMrdFormElementEventMap {
|
|
1135
1219
|
"mrdSubmit": Record<string, unknown>;
|
|
1136
1220
|
"mrdCancel": void;
|
|
@@ -1190,11 +1274,12 @@ declare global {
|
|
|
1190
1274
|
new (): HTMLMrdImageFieldElement;
|
|
1191
1275
|
};
|
|
1192
1276
|
interface HTMLMrdLayoutSectionElementEventMap {
|
|
1193
|
-
"mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate };
|
|
1277
|
+
"mrdNavigate": { href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour };
|
|
1194
1278
|
"mrdSearch": { query: string; dataClass: string };
|
|
1195
1279
|
"mrdDownload": { href: string; fileName: string };
|
|
1196
1280
|
"mrdLoadViewPage": { name: string; page: number; sort: string; path: string; qs: string; nodeId?: string };
|
|
1197
1281
|
"mrdLoadImage": { fieldName: string; href: string };
|
|
1282
|
+
"mrdLoadDocumentPreview": { href: string };
|
|
1198
1283
|
"mrdViewAction": { name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string };
|
|
1199
1284
|
"mrdLoadViewAggregations": { name: string; dataClass: string; path: string; qs: string; aggQs: string };
|
|
1200
1285
|
"mrdLoadViewDistinct": { name: string; nodeId: string; distinct: string; path: string; qs: string };
|
|
@@ -1395,6 +1480,7 @@ declare global {
|
|
|
1395
1480
|
"mrd-email-field": HTMLMrdEmailFieldElement;
|
|
1396
1481
|
"mrd-field": HTMLMrdFieldElement;
|
|
1397
1482
|
"mrd-file-field": HTMLMrdFileFieldElement;
|
|
1483
|
+
"mrd-file-preview": HTMLMrdFilePreviewElement;
|
|
1398
1484
|
"mrd-form": HTMLMrdFormElement;
|
|
1399
1485
|
"mrd-hyperlink-field": HTMLMrdHyperlinkFieldElement;
|
|
1400
1486
|
"mrd-image-field": HTMLMrdImageFieldElement;
|
|
@@ -1579,9 +1665,9 @@ declare namespace LocalJSX {
|
|
|
1579
1665
|
*/
|
|
1580
1666
|
"onMrdLoadPage"?: (event: MrdDocumentContainerCustomEvent<{ page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
|
|
1581
1667
|
/**
|
|
1582
|
-
* A row / document was activated. Host routes to the object page.
|
|
1668
|
+
* A row / document was activated. Host routes to the object page. Documents are always the "quick look" use case, so navigateBehaviour is hardcoded to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in mrd-layout-section, which takes it from the item's configuration.
|
|
1583
1669
|
*/
|
|
1584
|
-
"onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string }>) => void;
|
|
1670
|
+
"onMrdNavigate"?: (event: MrdDocumentContainerCustomEvent<{ href?: string; label: string; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => void;
|
|
1585
1671
|
/**
|
|
1586
1672
|
* Generic "update an existing object" request, re-emitted from the folder tree (a document was dragged into another folder/container).
|
|
1587
1673
|
*/
|
|
@@ -1696,10 +1782,24 @@ declare namespace LocalJSX {
|
|
|
1696
1782
|
* Download the document file. Host resolves the href to a signed URL.
|
|
1697
1783
|
*/
|
|
1698
1784
|
"onMrdDownload"?: (event: MrdDocumentViewCustomEvent<{ href: string; fileName: string }>) => void;
|
|
1785
|
+
/**
|
|
1786
|
+
* The file slot has an href and needs a signed URL for inline preview. Fired once on load and again whenever the file href changes (e.g. the overlay is reused for a different document via prev/next). Host resolves it and calls back with `previewUrl` — the same pattern as mrdLoadImage / setImagePreview on mrd-layout-section.
|
|
1787
|
+
*/
|
|
1788
|
+
"onMrdLoadPreview"?: (event: MrdDocumentViewCustomEvent<{ href: string }>) => void;
|
|
1699
1789
|
/**
|
|
1700
1790
|
* Navigate to the container (dossier). Host resolves the href and routes.
|
|
1701
1791
|
*/
|
|
1702
1792
|
"onMrdNavigate"?: (event: MrdDocumentViewCustomEvent<{ href?: string; label: string }>) => void;
|
|
1793
|
+
/**
|
|
1794
|
+
* Minimum height (px) of the inline preview area — it stretches to fill the available row height in the wide side-by-side layout (see mrd-document-view.scss), and falls back to this height when stacked. Overlay hosts typically pass a smaller value than the full-page default to fit available chrome.
|
|
1795
|
+
* @default 640
|
|
1796
|
+
*/
|
|
1797
|
+
"previewHeight"?: number;
|
|
1798
|
+
/**
|
|
1799
|
+
* Signed URL for the file's inline preview (mrd-file-preview), resolved by the host in response to mrdLoadPreview. Empty while unresolved — the preview area shows a loading state until the host injects a value.
|
|
1800
|
+
* @default ''
|
|
1801
|
+
*/
|
|
1802
|
+
"previewUrl"?: string;
|
|
1703
1803
|
}
|
|
1704
1804
|
interface MrdEmailField {
|
|
1705
1805
|
/**
|
|
@@ -1786,6 +1886,48 @@ declare namespace LocalJSX {
|
|
|
1786
1886
|
*/
|
|
1787
1887
|
"value"?: unknown;
|
|
1788
1888
|
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
|
|
1891
|
+
* or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
|
|
1892
|
+
* presentational: the signed URL is used directly as element `src` — a
|
|
1893
|
+
* navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
|
|
1894
|
+
* the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
|
|
1895
|
+
* `setImagePreview` on mrd-layout-section.
|
|
1896
|
+
*/
|
|
1897
|
+
interface MrdFilePreview {
|
|
1898
|
+
/**
|
|
1899
|
+
* Original file name — used for extension-based detection when `mimeType` is absent, and as alt/title text.
|
|
1900
|
+
* @default ''
|
|
1901
|
+
*/
|
|
1902
|
+
"fileName"?: string;
|
|
1903
|
+
/**
|
|
1904
|
+
* The file's own reference href (not the signed preview URL in `src`). When set, an unsupported type falls back to the same download button used elsewhere in the library, so hosts need no new wiring.
|
|
1905
|
+
* @default ''
|
|
1906
|
+
*/
|
|
1907
|
+
"href"?: string;
|
|
1908
|
+
/**
|
|
1909
|
+
* @default navigator.language
|
|
1910
|
+
*/
|
|
1911
|
+
"locale"?: string;
|
|
1912
|
+
/**
|
|
1913
|
+
* Declared mime type (e.g. 'application/pdf', 'image/png'), when known. Authoritative over `fileName` when present.
|
|
1914
|
+
* @default ''
|
|
1915
|
+
*/
|
|
1916
|
+
"mimeType"?: string;
|
|
1917
|
+
/**
|
|
1918
|
+
* Download the file. Same shape as mrd-document-view / mrd-layout-section's mrdDownload — host resolves `href` to a signed URL.
|
|
1919
|
+
*/
|
|
1920
|
+
"onMrdDownload"?: (event: MrdFilePreviewCustomEvent<{ href: string; fileName: string }>) => void;
|
|
1921
|
+
/**
|
|
1922
|
+
* The image failed to load — most likely an expired signed URL. Host should fetch a fresh signed URL and update `src`. Note: this is only raised for images. Browsers don't reliably surface HTTP-level failures (e.g. a 403 on an expired URL) through an iframe's load/error events, so the same detection isn't available for PDFs.
|
|
1923
|
+
*/
|
|
1924
|
+
"onMrdPreviewReload"?: (event: MrdFilePreviewCustomEvent<void>) => void;
|
|
1925
|
+
/**
|
|
1926
|
+
* Signed URL to render.
|
|
1927
|
+
* @default ''
|
|
1928
|
+
*/
|
|
1929
|
+
"src"?: string;
|
|
1930
|
+
}
|
|
1789
1931
|
interface MrdForm {
|
|
1790
1932
|
"layout": ClientLayout;
|
|
1791
1933
|
/**
|
|
@@ -1905,6 +2047,11 @@ declare namespace LocalJSX {
|
|
|
1905
2047
|
* @default {}
|
|
1906
2048
|
*/
|
|
1907
2049
|
"data"?: Record<string, unknown>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Minimum height (px) of the commons.document inline file preview — it stretches taller in the wide side-by-side layout. Pass a smaller value when embedding the record in an overlay with limited height.
|
|
2052
|
+
* @default 640
|
|
2053
|
+
*/
|
|
2054
|
+
"documentPreviewHeight"?: number;
|
|
1908
2055
|
/**
|
|
1909
2056
|
* Items from one layout entry in ClientDashboardMetadata.layouts[].
|
|
1910
2057
|
* @default []
|
|
@@ -1924,6 +2071,10 @@ declare namespace LocalJSX {
|
|
|
1924
2071
|
*/
|
|
1925
2072
|
"onMrdCreateObject"?: (event: MrdLayoutSectionCustomEvent<{ name: string; path: string; values: Record<string, unknown> }>) => void;
|
|
1926
2073
|
"onMrdDownload"?: (event: MrdLayoutSectionCustomEvent<{ href: string; fileName: string }>) => void;
|
|
2074
|
+
/**
|
|
2075
|
+
* Re-emitted from an embedded mrd-document-view's mrdLoadPreview (commons.document single-object view); host resolves the file href to a signed URL and calls setDocumentPreviewUrl().
|
|
2076
|
+
*/
|
|
2077
|
+
"onMrdLoadDocumentPreview"?: (event: MrdLayoutSectionCustomEvent<{ href: string }>) => void;
|
|
1927
2078
|
/**
|
|
1928
2079
|
* Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview().
|
|
1929
2080
|
*/
|
|
@@ -1940,7 +2091,7 @@ declare namespace LocalJSX {
|
|
|
1940
2091
|
* Re-emitted from an embedded mrd-table's or mrd-document-list's mrdLoadPage; host fetches the rows and calls setViewPage(). `nodeId` is present for a document-list folder load.
|
|
1941
2092
|
*/
|
|
1942
2093
|
"onMrdLoadViewPage"?: (event: MrdLayoutSectionCustomEvent<{ name: string; page: number; sort: string; path: string; qs: string; nodeId?: string }>) => void;
|
|
1943
|
-
"onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate }>) => void;
|
|
2094
|
+
"onMrdNavigate"?: (event: MrdLayoutSectionCustomEvent<{ href?: string; label: string; navigate?: ClientLayoutItemNavigate; navigateBehaviour?: ClientLayoutNavigateBehaviour }>) => void;
|
|
1944
2095
|
"onMrdSearch"?: (event: MrdLayoutSectionCustomEvent<{ query: string; dataClass: string }>) => void;
|
|
1945
2096
|
/**
|
|
1946
2097
|
* Generic "update an existing object" request from an embedded document view (a document dragged into another folder). Host PATCHes `href` with `values`.
|
|
@@ -2363,6 +2514,8 @@ declare namespace LocalJSX {
|
|
|
2363
2514
|
}
|
|
2364
2515
|
interface MrdDocumentViewAttributes {
|
|
2365
2516
|
"locale": string;
|
|
2517
|
+
"previewUrl": string;
|
|
2518
|
+
"previewHeight": number;
|
|
2366
2519
|
}
|
|
2367
2520
|
interface MrdEmailFieldAttributes {
|
|
2368
2521
|
"name": string;
|
|
@@ -2385,6 +2538,13 @@ declare namespace LocalJSX {
|
|
|
2385
2538
|
"accept": string;
|
|
2386
2539
|
"maxSize": number;
|
|
2387
2540
|
}
|
|
2541
|
+
interface MrdFilePreviewAttributes {
|
|
2542
|
+
"src": string;
|
|
2543
|
+
"mimeType": string;
|
|
2544
|
+
"fileName": string;
|
|
2545
|
+
"href": string;
|
|
2546
|
+
"locale": string;
|
|
2547
|
+
}
|
|
2388
2548
|
interface MrdFormAttributes {
|
|
2389
2549
|
"locale": string;
|
|
2390
2550
|
"referenceHref": string;
|
|
@@ -2411,6 +2571,7 @@ declare namespace LocalJSX {
|
|
|
2411
2571
|
}
|
|
2412
2572
|
interface MrdLayoutSectionAttributes {
|
|
2413
2573
|
"locale": string;
|
|
2574
|
+
"documentPreviewHeight": number;
|
|
2414
2575
|
}
|
|
2415
2576
|
interface MrdListFieldAttributes {
|
|
2416
2577
|
"name": string;
|
|
@@ -2511,6 +2672,7 @@ declare namespace LocalJSX {
|
|
|
2511
2672
|
"mrd-email-field": Omit<MrdEmailField, keyof MrdEmailFieldAttributes> & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes]?: MrdEmailField[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `attr:${K}`]?: MrdEmailFieldAttributes[K] } & { [K in keyof MrdEmailField & keyof MrdEmailFieldAttributes as `prop:${K}`]?: MrdEmailField[K] };
|
|
2512
2673
|
"mrd-field": Omit<MrdField, keyof MrdFieldAttributes> & { [K in keyof MrdField & keyof MrdFieldAttributes]?: MrdField[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `attr:${K}`]?: MrdFieldAttributes[K] } & { [K in keyof MrdField & keyof MrdFieldAttributes as `prop:${K}`]?: MrdField[K] };
|
|
2513
2674
|
"mrd-file-field": Omit<MrdFileField, keyof MrdFileFieldAttributes> & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes]?: MrdFileField[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `attr:${K}`]?: MrdFileFieldAttributes[K] } & { [K in keyof MrdFileField & keyof MrdFileFieldAttributes as `prop:${K}`]?: MrdFileField[K] };
|
|
2675
|
+
"mrd-file-preview": Omit<MrdFilePreview, keyof MrdFilePreviewAttributes> & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes]?: MrdFilePreview[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `attr:${K}`]?: MrdFilePreviewAttributes[K] } & { [K in keyof MrdFilePreview & keyof MrdFilePreviewAttributes as `prop:${K}`]?: MrdFilePreview[K] };
|
|
2514
2676
|
"mrd-form": Omit<MrdForm, keyof MrdFormAttributes> & { [K in keyof MrdForm & keyof MrdFormAttributes]?: MrdForm[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `attr:${K}`]?: MrdFormAttributes[K] } & { [K in keyof MrdForm & keyof MrdFormAttributes as `prop:${K}`]?: MrdForm[K] };
|
|
2515
2677
|
"mrd-hyperlink-field": Omit<MrdHyperlinkField, keyof MrdHyperlinkFieldAttributes> & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes]?: MrdHyperlinkField[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `attr:${K}`]?: MrdHyperlinkFieldAttributes[K] } & { [K in keyof MrdHyperlinkField & keyof MrdHyperlinkFieldAttributes as `prop:${K}`]?: MrdHyperlinkField[K] };
|
|
2516
2678
|
"mrd-image-field": Omit<MrdImageField, keyof MrdImageFieldAttributes> & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes]?: MrdImageField[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `attr:${K}`]?: MrdImageFieldAttributes[K] } & { [K in keyof MrdImageField & keyof MrdImageFieldAttributes as `prop:${K}`]?: MrdImageField[K] };
|
|
@@ -2575,6 +2737,15 @@ declare module "@stencil/core" {
|
|
|
2575
2737
|
"mrd-email-field": LocalJSX.IntrinsicElements["mrd-email-field"] & JSXBase.HTMLAttributes<HTMLMrdEmailFieldElement>;
|
|
2576
2738
|
"mrd-field": LocalJSX.IntrinsicElements["mrd-field"] & JSXBase.HTMLAttributes<HTMLMrdFieldElement>;
|
|
2577
2739
|
"mrd-file-field": LocalJSX.IntrinsicElements["mrd-file-field"] & JSXBase.HTMLAttributes<HTMLMrdFileFieldElement>;
|
|
2740
|
+
/**
|
|
2741
|
+
* Renders a signed URL inline as a PDF (native browser viewer, via `<iframe>`)
|
|
2742
|
+
* or an image (`<img>`), picked from `mimeType`/`fileName`. Purely
|
|
2743
|
+
* presentational: the signed URL is used directly as element `src` — a
|
|
2744
|
+
* navigation, not a fetch/XHR, so no CORS handling is needed here. Fetching
|
|
2745
|
+
* the signed URL itself is the host's responsibility, same as `mrdLoadImage` /
|
|
2746
|
+
* `setImagePreview` on mrd-layout-section.
|
|
2747
|
+
*/
|
|
2748
|
+
"mrd-file-preview": LocalJSX.IntrinsicElements["mrd-file-preview"] & JSXBase.HTMLAttributes<HTMLMrdFilePreviewElement>;
|
|
2578
2749
|
"mrd-form": LocalJSX.IntrinsicElements["mrd-form"] & JSXBase.HTMLAttributes<HTMLMrdFormElement>;
|
|
2579
2750
|
"mrd-hyperlink-field": LocalJSX.IntrinsicElements["mrd-hyperlink-field"] & JSXBase.HTMLAttributes<HTMLMrdHyperlinkFieldElement>;
|
|
2580
2751
|
"mrd-image-field": LocalJSX.IntrinsicElements["mrd-image-field"] & JSXBase.HTMLAttributes<HTMLMrdImageFieldElement>;
|
|
@@ -48,6 +48,12 @@ export declare enum ClientLayoutItemRelationEditBehavior {
|
|
|
48
48
|
DROPDOWN = "DROPDOWN",
|
|
49
49
|
CHECKBOX = "CHECKBOX"
|
|
50
50
|
}
|
|
51
|
+
/** How navigating from a row/document in this VIEW or RELATED_VIEW should open
|
|
52
|
+
* its target: a full page navigation, or an overlay on top of the current page. */
|
|
53
|
+
export declare enum ClientLayoutNavigateBehaviour {
|
|
54
|
+
PAGE = "PAGE",
|
|
55
|
+
OVERLAY_PAGE = "OVERLAY_PAGE"
|
|
56
|
+
}
|
|
51
57
|
/** A single sub-link within a multi-value relation link. */
|
|
52
58
|
export interface DataObjectSubLink {
|
|
53
59
|
href: string;
|
|
@@ -233,6 +239,10 @@ export interface ClientLayoutItem {
|
|
|
233
239
|
* the `commons.document` archetype's `container` slot, the view is a single
|
|
234
240
|
* container context (see mrd-document-list seeding). */
|
|
235
241
|
inverseRelation?: string | null;
|
|
242
|
+
/** How navigating out of this VIEW/RELATED_VIEW opens its target. Defaults to
|
|
243
|
+
* `PAGE` (full navigation) when absent. mrd-layout-section reads this off the
|
|
244
|
+
* item and includes it in the mrdNavigate event detail it relays upward. */
|
|
245
|
+
navigateBehaviour?: ClientLayoutNavigateBehaviour;
|
|
236
246
|
icon?: string | null;
|
|
237
247
|
navigationType?: string | null;
|
|
238
248
|
actionType?: string;
|