@mmlogic/components 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client-layout-RZ3Ix-4a.js +87 -0
- package/dist/cjs/{index-CAzwGt9u.js → index-DzRfoAPz.js} +36 -9
- package/dist/cjs/index.cjs.js +56 -81
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mosterdcomponents.cjs.js +3 -3
- package/dist/cjs/{mrd-boolean-field_24.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +146 -274
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +0 -17
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +12 -4
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +9 -43
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +14 -6
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +3 -44
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +37 -85
- package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.css +0 -10
- package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.css +0 -7
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +0 -11
- package/dist/collection/components/fields/mrd-hyperlink-field/mrd-hyperlink-field.css +0 -3
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +6 -20
- package/dist/collection/components/fields/mrd-list-field/mrd-list-field.css +0 -4
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.css +0 -1
- package/dist/collection/components/fields/mrd-relation-field/mrd-relation-field.css +9 -35
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.css +0 -9
- package/dist/collection/components/form/mrd-field/mrd-field.css +0 -13
- package/dist/collection/components/form/mrd-form/mrd-form.css +0 -19
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +3 -58
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +25 -66
- package/dist/collection/components/table/mrd-table/mrd-table.css +38 -185
- package/dist/collection/components/table/mrd-table/mrd-table.js +1 -1
- package/dist/collection/dev/app.js +76 -40
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/document-attachments.js +20 -0
- package/dist/collection/{components/documents/mrd-file-preview → utils}/file-preview-kind.js +4 -4
- package/dist/collection/utils/i18n.js +0 -32
- package/dist/components/document-attachments.js +1 -0
- package/dist/components/field-helpers.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.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-form.js +1 -1
- package/dist/components/mrd-hyperlink-field2.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.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-table2.js +1 -1
- package/dist/esm/client-layout-DCOAAH92.js +84 -0
- package/dist/esm/{index-DiSEJMA8.js → index-DiSe6vjv.js} +36 -9
- package/dist/esm/index.js +30 -80
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mosterdcomponents.js +4 -4
- package/dist/esm/{mrd-boolean-field_24.entry.js → mrd-boolean-field_23.entry.js} +56 -183
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.css +7 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-DCOAAH92.js +1 -0
- package/dist/mosterdcomponents/p-DiSe6vjv.js +2 -0
- package/dist/mosterdcomponents/p-b56f9802.entry.js +1 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +4 -2
- package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +6 -2
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +21 -27
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +12 -15
- package/dist/types/components.d.ts +49 -187
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/types/client-layout.d.ts +8 -0
- package/dist/types/utils/document-attachments.d.ts +8 -0
- package/dist/types/utils/file-preview-kind.d.ts +9 -0
- package/package.json +10 -12
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +0 -59
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +0 -212
- package/dist/components/mrd-file-preview.d.ts +0 -11
- package/dist/components/mrd-file-preview.js +0 -1
- package/dist/components/mrd-file-preview2.js +0 -1
- package/dist/mosterdcomponents/p-DiSEJMA8.js +0 -2
- package/dist/mosterdcomponents/p-e816d459.entry.js +0 -1
- package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +0 -9
- package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientArchetype, ClientLayoutItem, ClientLayoutNavigateBehaviour } from '../../../types/client-layout';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem, ClientLayoutNavigateBehaviour, DocumentAttachment } from '../../../types/client-layout';
|
|
3
3
|
import { ListNavigationContext } from '../../../utils/query-params';
|
|
4
4
|
/**
|
|
5
5
|
* Owns a document collection view: a single toolbar (view switch + collection
|
|
@@ -53,12 +53,14 @@ export declare class MrdDocumentContainer {
|
|
|
53
53
|
/** A row / document was activated. Host routes to the object page. Documents
|
|
54
54
|
* are always the "quick look" use case, so navigateBehaviour is hardcoded
|
|
55
55
|
* to OVERLAY_PAGE here — unlike the generic VIEW/RELATED_VIEW table path in
|
|
56
|
-
* mrd-layout-section, which takes it from the item's configuration.
|
|
56
|
+
* mrd-layout-section, which takes it from the item's configuration.
|
|
57
|
+
* `attachments` prefetches the clicked row's file slot (see TASK-0169). */
|
|
57
58
|
mrdNavigate: EventEmitter<{
|
|
58
59
|
href?: string;
|
|
59
60
|
label: string;
|
|
60
61
|
navigateBehaviour?: ClientLayoutNavigateBehaviour;
|
|
61
62
|
listContext?: ListNavigationContext;
|
|
63
|
+
attachments?: DocumentAttachment[];
|
|
62
64
|
}>;
|
|
63
65
|
/** A table toolbar action was triggered. */
|
|
64
66
|
mrdAction: EventEmitter<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientArchetype, ClientLayoutItem } from '../../../types/client-layout';
|
|
2
|
+
import { ClientArchetype, ClientLayoutItem, DocumentAttachment } from '../../../types/client-layout';
|
|
3
3
|
import { ListNavigationContext } from '../../../utils/query-params';
|
|
4
4
|
import { DistinctValue, DocRow } from './folder-tree';
|
|
5
5
|
/**
|
|
@@ -50,11 +50,15 @@ export declare class MrdDocumentList {
|
|
|
50
50
|
qs: string;
|
|
51
51
|
}>;
|
|
52
52
|
/** A document row was clicked. Host routes to the document object page. `listContext` can
|
|
53
|
-
* be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1`.
|
|
53
|
+
* be used to re-fetch this exact record (or its neighbours) via `{path}?{qs}&page={index}&size=1`.
|
|
54
|
+
* `attachments` is a prefetch of the clicked row's own file slot (derived from `archetype`)
|
|
55
|
+
* so the host can render a preview immediately, without waiting for the navigated-to
|
|
56
|
+
* page's own mrdAttachments — see TASK-0169 / FINDING-0111. */
|
|
54
57
|
mrdNavigate: EventEmitter<{
|
|
55
58
|
href?: string;
|
|
56
59
|
label: string;
|
|
57
60
|
listContext?: ListNavigationContext;
|
|
61
|
+
attachments?: DocumentAttachment[];
|
|
58
62
|
}>;
|
|
59
63
|
/** Emitted whenever the "can create a folder here" state changes, so a host
|
|
60
64
|
* toolbar (mrd-document-container) can enable/disable its New folder button. */
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientArchetype } from '../../../types/client-layout';
|
|
2
|
+
import { ClientArchetype, DocumentAttachment } from '../../../types/client-layout';
|
|
3
3
|
/**
|
|
4
4
|
* Archetype-driven single-document view. Given a `commons.document` binding and a
|
|
5
|
-
* data record, renders the document recognisably — title,
|
|
5
|
+
* data record, renders the document recognisably — title, filename/download,
|
|
6
6
|
* summary and date — plus a navigation link to the container (the dossier),
|
|
7
7
|
* instead of a generic field form.
|
|
8
8
|
*
|
|
9
9
|
* The component keys on the slot→field map (`archetype.slots`) to locate values:
|
|
10
10
|
* value slots read `data[field]`; the `container` relation slot reads
|
|
11
11
|
* `data._links[field]` (`{ href, name }`). Empty slots are omitted.
|
|
12
|
+
*
|
|
13
|
+
* This component never renders the file itself (no iframe/image preview) — it
|
|
14
|
+
* only ever exposes the file reference via `mrdAttachments`. The host resolves
|
|
15
|
+
* the href and decides how (or whether) to show it inline, so the preview can
|
|
16
|
+
* live anywhere in the host's own layout instead of being boxed into this
|
|
17
|
+
* component's DOM (see TASK-0165 / FINDING-0111).
|
|
12
18
|
*/
|
|
13
19
|
export declare class MrdDocumentView {
|
|
14
20
|
/** Resolved `commons.document` binding: slot name → concrete field/relation name. */
|
|
@@ -16,15 +22,6 @@ export declare class MrdDocumentView {
|
|
|
16
22
|
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
17
23
|
data: Record<string, unknown>;
|
|
18
24
|
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;
|
|
28
25
|
/** Navigate to the container (dossier). Host resolves the href and routes. */
|
|
29
26
|
mrdNavigate: EventEmitter<{
|
|
30
27
|
href?: string;
|
|
@@ -35,30 +32,27 @@ export declare class MrdDocumentView {
|
|
|
35
32
|
href: string;
|
|
36
33
|
fileName: string;
|
|
37
34
|
}>;
|
|
38
|
-
/** The file
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
/** The file(s) belonging to this document, fired once on load and again
|
|
36
|
+
* whenever the file slot's value changes (e.g. the overlay is reused for a
|
|
37
|
+
* different document via prev/next). The host resolves the href(s) itself
|
|
38
|
+
* and decides whether/how to render them (e.g. pdf.js next to the layout) —
|
|
39
|
+
* this component does not fetch or preview the file. */
|
|
40
|
+
mrdAttachments: EventEmitter<{
|
|
41
|
+
attachments: DocumentAttachment[];
|
|
45
42
|
}>;
|
|
46
|
-
/** Tracks the href
|
|
47
|
-
* the data watcher don't emit duplicate
|
|
48
|
-
private
|
|
43
|
+
/** Tracks the href attachments were last emitted for, so componentDidLoad and
|
|
44
|
+
* the data watcher don't emit duplicate events for the same file. */
|
|
45
|
+
private lastAttachmentHref;
|
|
49
46
|
componentDidLoad(): void;
|
|
50
47
|
dataChanged(): void;
|
|
51
|
-
private
|
|
48
|
+
private emitAttachmentsIfNeeded;
|
|
52
49
|
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
53
50
|
private slotValue;
|
|
54
51
|
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
55
52
|
private slotLink;
|
|
56
53
|
private renderContainer;
|
|
57
|
-
/** Filename + download button —
|
|
58
|
-
*
|
|
54
|
+
/** Filename + download button — the only file-related UI this component owns;
|
|
55
|
+
* inline preview rendering is entirely the host's responsibility. */
|
|
59
56
|
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;
|
|
63
57
|
render(): any;
|
|
64
58
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
-
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, ClientArchetype, RelationSearchResult } from '../../../types/client-layout';
|
|
2
|
+
import { ClientLayoutItem, ClientLayoutItemNavigate, ClientLayoutNavigateBehaviour, ClientViewMetadata, ClientArchetype, RelationSearchResult, DocumentAttachment } from '../../../types/client-layout';
|
|
3
3
|
import { DistinctValue } from '../../documents/mrd-document-list/folder-tree';
|
|
4
4
|
import { ListNavigationContext } from '../../../utils/query-params';
|
|
5
5
|
export declare class MrdLayoutSection {
|
|
@@ -18,24 +18,23 @@ export declare class MrdLayoutSection {
|
|
|
18
18
|
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
19
19
|
* the record is rendered as a single-document view instead of generic fields. */
|
|
20
20
|
archetypes: ClientArchetype[];
|
|
21
|
-
/** Minimum height (px) of the commons.document inline file preview — it
|
|
22
|
-
* stretches taller in the wide side-by-side layout. Pass a smaller value
|
|
23
|
-
* when embedding the record in an overlay with limited height. */
|
|
24
|
-
documentPreviewHeight: number;
|
|
25
21
|
private searchQueryMap;
|
|
26
22
|
private searchResultsMap;
|
|
27
23
|
private imagePreviewUrl;
|
|
28
24
|
private imagePreviews;
|
|
29
25
|
private openHistoryField;
|
|
30
|
-
/** Signed URL for the commons.document archetype's inline file preview. */
|
|
31
|
-
private documentPreviewUrl;
|
|
32
26
|
private historyClickOutside;
|
|
27
|
+
/** `attachments`, when present, prefetches the clicked document row's file slot
|
|
28
|
+
* (see TASK-0169 / FINDING-0111) so the host can render a preview immediately,
|
|
29
|
+
* without waiting for the navigated-to page's own mrdAttachments. Only set for
|
|
30
|
+
* commons.document rows opened from an embedded document view. */
|
|
33
31
|
mrdNavigate: EventEmitter<{
|
|
34
32
|
href?: string;
|
|
35
33
|
label: string;
|
|
36
34
|
navigate?: ClientLayoutItemNavigate;
|
|
37
35
|
navigateBehaviour?: ClientLayoutNavigateBehaviour;
|
|
38
36
|
listContext?: ListNavigationContext;
|
|
37
|
+
attachments?: DocumentAttachment[];
|
|
39
38
|
}>;
|
|
40
39
|
mrdSearch: EventEmitter<{
|
|
41
40
|
query: string;
|
|
@@ -60,11 +59,12 @@ export declare class MrdLayoutSection {
|
|
|
60
59
|
fieldName: string;
|
|
61
60
|
href: string;
|
|
62
61
|
}>;
|
|
63
|
-
/** Re-emitted from an embedded mrd-document-view
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
/** Re-emitted from an embedded mrd-document-view (commons.document single-object
|
|
63
|
+
* view) whenever its file slot's value changes. The component never renders the
|
|
64
|
+
* file itself — the host resolves the href(s) and decides how/whether to show
|
|
65
|
+
* them, e.g. in a panel next to this mrd-layout-section. */
|
|
66
|
+
mrdAttachments: EventEmitter<{
|
|
67
|
+
attachments: DocumentAttachment[];
|
|
68
68
|
}>;
|
|
69
69
|
/** Re-emitted from an embedded mrd-table's mrdAction; host builds the target URL from dataClass. */
|
|
70
70
|
mrdViewAction: EventEmitter<{
|
|
@@ -140,9 +140,6 @@ export declare class MrdLayoutSection {
|
|
|
140
140
|
setImagePreview(fieldName: string, url: string): Promise<void>;
|
|
141
141
|
/** Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field). */
|
|
142
142
|
openImagePreview(url: string): Promise<void>;
|
|
143
|
-
/** Provide a resolved signed URL for the commons.document archetype's inline
|
|
144
|
-
* file preview, in response to mrdLoadDocumentPreview. */
|
|
145
|
-
setDocumentPreviewUrl(url: string): Promise<void>;
|
|
146
143
|
private resolveSearchKey;
|
|
147
144
|
private handleViewLoadPage;
|
|
148
145
|
private handleSearchInput;
|