@mmlogic/components 0.4.3 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/cjs/client-layout-RZ3Ix-4a.js +87 -0
  2. package/dist/cjs/{index-CAzwGt9u.js → index-DzRfoAPz.js} +36 -9
  3. package/dist/cjs/index.cjs.js +56 -81
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mosterdcomponents.cjs.js +3 -3
  6. package/dist/cjs/{mrd-boolean-field_24.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +159 -286
  7. package/dist/collection/collection-manifest.json +1 -2
  8. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +0 -17
  9. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +12 -4
  10. package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +9 -43
  11. package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +14 -6
  12. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +30 -68
  13. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +49 -90
  14. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.css +0 -10
  15. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.css +0 -7
  16. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +0 -11
  17. package/dist/collection/components/fields/mrd-hyperlink-field/mrd-hyperlink-field.css +0 -3
  18. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +6 -20
  19. package/dist/collection/components/fields/mrd-list-field/mrd-list-field.css +0 -4
  20. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.css +0 -1
  21. package/dist/collection/components/fields/mrd-relation-field/mrd-relation-field.css +9 -35
  22. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.css +0 -9
  23. package/dist/collection/components/form/mrd-field/mrd-field.css +0 -13
  24. package/dist/collection/components/form/mrd-form/mrd-form.css +0 -19
  25. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +3 -58
  26. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +25 -66
  27. package/dist/collection/components/table/mrd-table/mrd-table.css +38 -185
  28. package/dist/collection/components/table/mrd-table/mrd-table.js +3 -5
  29. package/dist/collection/components/table/mrd-table/table-parts.js +2 -5
  30. package/dist/collection/dev/app.js +76 -40
  31. package/dist/collection/dev/example-data.js +2 -1
  32. package/dist/collection/index.js +1 -0
  33. package/dist/collection/utils/document-attachments.js +20 -0
  34. package/dist/collection/{components/documents/mrd-file-preview → utils}/file-preview-kind.js +4 -4
  35. package/dist/collection/utils/i18n.js +0 -32
  36. package/dist/components/document-attachments.js +1 -0
  37. package/dist/components/field-helpers.js +1 -1
  38. package/dist/components/i18n.js +1 -1
  39. package/dist/components/index.js +1 -1
  40. package/dist/components/mrd-document-container2.js +1 -1
  41. package/dist/components/mrd-document-list2.js +1 -1
  42. package/dist/components/mrd-document-view2.js +1 -1
  43. package/dist/components/mrd-email-field2.js +1 -1
  44. package/dist/components/mrd-form.js +1 -1
  45. package/dist/components/mrd-hyperlink-field2.js +1 -1
  46. package/dist/components/mrd-image-field2.js +1 -1
  47. package/dist/components/mrd-layout-section.js +1 -1
  48. package/dist/components/mrd-number-field2.js +1 -1
  49. package/dist/components/mrd-relation-field2.js +1 -1
  50. package/dist/components/mrd-table2.js +1 -1
  51. package/dist/esm/client-layout-DCOAAH92.js +84 -0
  52. package/dist/esm/{index-DiSEJMA8.js → index-DiSe6vjv.js} +36 -9
  53. package/dist/esm/index.js +30 -80
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm/mosterdcomponents.js +4 -4
  56. package/dist/esm/{mrd-boolean-field_24.entry.js → mrd-boolean-field_23.entry.js} +69 -195
  57. package/dist/mosterdcomponents/index.esm.js +1 -1
  58. package/dist/mosterdcomponents/mosterdcomponents.css +7 -1
  59. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  60. package/dist/mosterdcomponents/p-DCOAAH92.js +1 -0
  61. package/dist/mosterdcomponents/p-DiSe6vjv.js +2 -0
  62. package/dist/mosterdcomponents/p-cdecc698.entry.js +1 -0
  63. package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +4 -2
  64. package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +6 -2
  65. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +27 -29
  66. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +12 -15
  67. package/dist/types/components.d.ts +61 -195
  68. package/dist/types/index.d.ts +2 -0
  69. package/dist/types/stencil-public-runtime.d.ts +1 -0
  70. package/dist/types/types/client-layout.d.ts +10 -3
  71. package/dist/types/utils/document-attachments.d.ts +8 -0
  72. package/dist/types/utils/file-preview-kind.d.ts +9 -0
  73. package/package.json +10 -12
  74. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +0 -59
  75. package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +0 -212
  76. package/dist/components/mrd-file-preview.d.ts +0 -11
  77. package/dist/components/mrd-file-preview.js +0 -1
  78. package/dist/components/mrd-file-preview2.js +0 -1
  79. package/dist/mosterdcomponents/p-DiSEJMA8.js +0 -2
  80. package/dist/mosterdcomponents/p-e816d459.entry.js +0 -1
  81. package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +0 -9
  82. 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,21 @@
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, file preview/download,
6
- * summary and date — plus a navigation link to the container (the dossier),
7
- * instead of a generic field form.
5
+ * data record, renders the document recognisably — title, date, a navigation
6
+ * link to the container (the dossier) presented like any other data-object link
7
+ * (primary-coloured text link), an optional muted folder path, a download button
8
+ * and summary — instead of a generic field form.
8
9
  *
9
10
  * The component keys on the slot→field map (`archetype.slots`) to locate values:
10
11
  * value slots read `data[field]`; the `container` relation slot reads
11
12
  * `data._links[field]` (`{ href, name }`). Empty slots are omitted.
13
+ *
14
+ * This component never renders the file itself (no iframe/image preview) — it
15
+ * only ever exposes the file reference via `mrdAttachments`. The host resolves
16
+ * the href and decides how (or whether) to show it inline, so the preview can
17
+ * live anywhere in the host's own layout instead of being boxed into this
18
+ * component's DOM (see TASK-0165 / FINDING-0111).
12
19
  */
13
20
  export declare class MrdDocumentView {
14
21
  /** Resolved `commons.document` binding: slot name → concrete field/relation name. */
@@ -16,15 +23,6 @@ export declare class MrdDocumentView {
16
23
  /** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
17
24
  data: Record<string, unknown>;
18
25
  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
26
  /** Navigate to the container (dossier). Host resolves the href and routes. */
29
27
  mrdNavigate: EventEmitter<{
30
28
  href?: string;
@@ -35,30 +33,30 @@ export declare class MrdDocumentView {
35
33
  href: string;
36
34
  fileName: string;
37
35
  }>;
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;
36
+ /** The file(s) belonging to this document, fired once on load and again
37
+ * whenever the file slot's value changes (e.g. the overlay is reused for a
38
+ * different document via prev/next). The host resolves the href(s) itself
39
+ * and decides whether/how to render them (e.g. pdf.js next to the layout) —
40
+ * this component does not fetch or preview the file. */
41
+ mrdAttachments: EventEmitter<{
42
+ attachments: DocumentAttachment[];
45
43
  }>;
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;
44
+ /** Tracks the href attachments were last emitted for, so componentDidLoad and
45
+ * the data watcher don't emit duplicate events for the same file. */
46
+ private lastAttachmentHref;
49
47
  componentDidLoad(): void;
50
48
  dataChanged(): void;
51
- private requestPreviewIfNeeded;
49
+ private emitAttachmentsIfNeeded;
52
50
  /** Value of a value-slot: reads data[field] via the slot→field map. */
53
51
  private slotValue;
54
52
  /** Relation link for a relation-slot: reads data._links[field]. */
55
53
  private slotLink;
54
+ /** Container link (styled like relation links in layout sections: primary text
55
+ * link) plus a muted, non-interactive folder path when present. */
56
56
  private renderContainer;
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. */
57
+ /** Download button — the only file-related UI this component owns; the filename
58
+ * is deliberately not shown (rarely relevant, the title identifies the document)
59
+ * and inline preview rendering is entirely the host's responsibility. */
59
60
  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
61
  render(): any;
64
62
  }
@@ -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's mrdLoadPreview (commons.document
64
- * single-object view); host resolves the file href to a signed URL and calls
65
- * setDocumentPreviewUrl(). */
66
- mrdLoadDocumentPreview: EventEmitter<{
67
- href: string;
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;