@mmlogic/components 0.3.9 → 0.3.11

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 (50) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  3. package/dist/cjs/{mrd-boolean-field_22.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +684 -41
  4. package/dist/collection/collection-manifest.json +1 -0
  5. package/dist/collection/components/mrd-document-container/mrd-document-container.js +421 -0
  6. package/dist/collection/components/mrd-document-container/mrd-document-container.scss +79 -0
  7. package/dist/collection/components/mrd-document-list/mrd-document-list.js +653 -16
  8. package/dist/collection/components/mrd-document-list/mrd-document-list.scss +66 -0
  9. package/dist/collection/components/mrd-document-view/mrd-document-view.js +1 -1
  10. package/dist/collection/components/mrd-email-field/mrd-email-field.js +1 -1
  11. package/dist/collection/components/mrd-file-field/mrd-file-field.js +1 -1
  12. package/dist/collection/components/mrd-image-field/mrd-image-field.js +1 -1
  13. package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +165 -14
  14. package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +0 -44
  15. package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +1 -1
  16. package/dist/collection/components/mrd-number-field/mrd-number-field.js +1 -1
  17. package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +2 -2
  18. package/dist/collection/components/mrd-text-field/mrd-text-field.js +1 -1
  19. package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +1 -1
  20. package/dist/collection/components/mrd-time-field/mrd-time-field.js +1 -1
  21. package/dist/collection/dev/app.js +47 -0
  22. package/dist/collection/utils/i18n.js +12 -0
  23. package/dist/components/i18n.js +1 -1
  24. package/dist/components/mrd-document-container.d.ts +11 -0
  25. package/dist/components/mrd-document-container.js +1 -0
  26. package/dist/components/mrd-document-container2.js +1 -0
  27. package/dist/components/mrd-document-list2.js +1 -1
  28. package/dist/components/mrd-document-view2.js +1 -1
  29. package/dist/components/mrd-email-field2.js +1 -1
  30. package/dist/components/mrd-file-field2.js +1 -1
  31. package/dist/components/mrd-image-field2.js +1 -1
  32. package/dist/components/mrd-layout-section.js +1 -1
  33. package/dist/components/mrd-longtext-field2.js +1 -1
  34. package/dist/components/mrd-number-field2.js +1 -1
  35. package/dist/components/mrd-secret-field2.js +1 -1
  36. package/dist/components/mrd-text-field2.js +1 -1
  37. package/dist/components/mrd-textarea-field2.js +1 -1
  38. package/dist/components/mrd-time-field2.js +1 -1
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/mosterdcomponents.js +1 -1
  41. package/dist/esm/{mrd-boolean-field_22.entry.js → mrd-boolean-field_23.entry.js} +684 -42
  42. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  43. package/dist/mosterdcomponents/p-a9618055.entry.js +1 -0
  44. package/dist/types/components/mrd-document-container/mrd-document-container.d.ts +99 -0
  45. package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +126 -1
  46. package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +32 -5
  47. package/dist/types/components.d.ts +250 -0
  48. package/dist/types/types/client-layout.d.ts +5 -0
  49. package/package.json +1 -1
  50. package/dist/mosterdcomponents/p-b547291b.entry.js +0 -1
@@ -98,6 +98,12 @@ const translations = {
98
98
  history_until: 'tot',
99
99
  history_badge_tooltip: 'Vorige waarden',
100
100
  hyperlink_name: 'Linktekst (optioneel)',
101
+ // mrd-document-list
102
+ new_folder: 'Nieuwe folder',
103
+ folder_name_placeholder: 'Foldernaam',
104
+ folder_no_slash: "Een foldernaam mag geen '/' bevatten",
105
+ folder_duplicate: 'Er bestaat al een folder met deze naam',
106
+ doc_empty_drop: 'Nog geen documenten — sleep bestanden hierheen',
101
107
  },
102
108
  en: {
103
109
  required: 'This field is required',
@@ -164,6 +170,12 @@ const translations = {
164
170
  history_until: 'until',
165
171
  history_badge_tooltip: 'Previous values',
166
172
  hyperlink_name: 'Link text (optional)',
173
+ // mrd-document-list
174
+ new_folder: 'New folder',
175
+ folder_name_placeholder: 'Folder name',
176
+ folder_no_slash: "A folder name cannot contain '/'",
177
+ folder_duplicate: 'A folder with this name already exists',
178
+ doc_empty_drop: 'No documents yet — drop files here',
167
179
  },
168
180
  ar: {
169
181
  required: 'هذا الحقل مطلوب',
@@ -852,7 +864,118 @@ const MrdDatetimeField = class {
852
864
  };
853
865
  MrdDatetimeField.style = mrdDatetimeFieldScss();
854
866
 
855
- const mrdDocumentListScss = () => `.sc-mrd-document-list-h{display:block}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}`;
867
+ const mrdDocumentContainerScss = () => `.sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:#d9a441}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed='true'].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}`;
868
+
869
+ const MrdDocumentContainer = class {
870
+ constructor(hostRef) {
871
+ registerInstance(this, hostRef);
872
+ this.mrdLoadPage = createEvent(this, "mrdLoadPage");
873
+ this.mrdLoadDistinct = createEvent(this, "mrdLoadDistinct");
874
+ this.mrdLoadAggregations = createEvent(this, "mrdLoadAggregations");
875
+ this.mrdNavigate = createEvent(this, "mrdNavigate");
876
+ this.mrdAction = createEvent(this, "mrdAction");
877
+ this.mrdUpdateObject = createEvent(this, "mrdUpdateObject");
878
+ this.mrdUpload = createEvent(this, "mrdUpload");
879
+ this.mrdCreateObject = createEvent(this, "mrdCreateObject");
880
+ /** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
881
+ this.item = null;
882
+ /** Parent record id — required for RELATED_VIEW path building. */
883
+ this.parentId = '';
884
+ /** Canonical parent href, forwarded to the folder tree for single-container seeding. */
885
+ this.containerHref = '';
886
+ /** Lookup key used for the embedded `data-doclist` / `data-view` attributes. */
887
+ this.viewKey = '';
888
+ /** Fixed height (px) of the scrolling folder-tree body — the toolbar stays put
889
+ * on top, Finder-style. The table manages its own height. */
890
+ this.height = 460;
891
+ this.locale = navigator.language;
892
+ /** Active body: folder tree or flat table. */
893
+ this.mode = 'tree';
894
+ /** Whether the folder tree currently has a valid target for "New folder". */
895
+ this.canCreate = false;
896
+ /** Whether the currently mounted table has been init()'d. Reset on every mode switch. */
897
+ this.tableInited = false;
898
+ this.createFolder = () => {
899
+ var _a, _b;
900
+ (_b = (_a = this.listEl) === null || _a === void 0 ? void 0 : _a.createFolder) === null || _b === void 0 ? void 0 : _b.call(_a);
901
+ };
902
+ }
903
+ /** The embedded table does not self-load: like every mrd-table it waits for the
904
+ * host to call init() (which emits mrdLoadPage, and — once page 0 lands —
905
+ * mrdLoadAggregations). The section only init()s tables mounted at load time, so
906
+ * when the user switches to list view we init the freshly mounted table here. */
907
+ componentDidRender() {
908
+ var _a;
909
+ if (this.mode === 'list' && this.tableEl && !this.tableInited) {
910
+ this.tableInited = true;
911
+ const table = this.tableEl;
912
+ Promise.resolve((_a = table.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(table)).then(() => { var _a; return (_a = table.init) === null || _a === void 0 ? void 0 : _a.call(table); });
913
+ }
914
+ }
915
+ setMode(mode) {
916
+ if (mode === this.mode)
917
+ return;
918
+ // The tree remounts on switch and re-emits mrdCanCreate; until then, disable.
919
+ this.canCreate = false;
920
+ // The table remounts on switch; re-init it once it is back in the DOM.
921
+ this.tableInited = false;
922
+ this.mode = mode;
923
+ }
924
+ // ── Toolbar ────────────────────────────────────────────────────────────────
925
+ renderToolbar() {
926
+ return (h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, onClick: this.createFolder }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), h("path", { d: "M12 11v4M10 13h4" })), t('new_folder', this.locale))), h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 5h6M3 12h9M3 19h6" }), h("circle", { cx: "18", cy: "5", r: "1.6" }), h("circle", { cx: "18", cy: "19", r: "1.6" }), h("path", { d: "M16 12h4" }))), h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: t('doc_view_list', this.locale), "aria-label": t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
927
+ }
928
+ // ── Bodies ───────────────────────────────────────────────────────────────
929
+ renderTree() {
930
+ return (h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, containerHref: this.containerHref, locale: this.locale, onMrdLoadDistinct: (e) => {
931
+ e.stopPropagation();
932
+ this.mrdLoadDistinct.emit(e.detail);
933
+ }, onMrdLoadPage: (e) => {
934
+ e.stopPropagation();
935
+ this.mrdLoadPage.emit(e.detail);
936
+ }, onMrdNavigate: (e) => {
937
+ e.stopPropagation();
938
+ this.mrdNavigate.emit(e.detail);
939
+ }, onMrdCanCreate: (e) => {
940
+ e.stopPropagation();
941
+ this.canCreate = e.detail;
942
+ }, onMrdUpdateObject: (e) => {
943
+ e.stopPropagation();
944
+ this.mrdUpdateObject.emit(e.detail);
945
+ }, onMrdUpload: (e) => {
946
+ e.stopPropagation();
947
+ this.mrdUpload.emit(e.detail);
948
+ }, onMrdCreateObject: (e) => {
949
+ e.stopPropagation();
950
+ this.mrdCreateObject.emit(e.detail);
951
+ } }));
952
+ }
953
+ renderList() {
954
+ return (h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, onMrdLoadPage: (e) => {
955
+ e.stopPropagation();
956
+ this.mrdLoadPage.emit(e.detail);
957
+ }, onMrdLoadAggregations: (e) => {
958
+ e.stopPropagation();
959
+ this.mrdLoadAggregations.emit(e.detail);
960
+ }, onMrdRowClick: (e) => {
961
+ var _a, _b, _c;
962
+ e.stopPropagation();
963
+ const row = e.detail;
964
+ this.mrdNavigate.emit({ href: (_b = (_a = row === null || row === void 0 ? void 0 : row._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href, label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '' });
965
+ }, onMrdAction: (e) => {
966
+ e.stopPropagation();
967
+ this.mrdAction.emit(e.detail);
968
+ } }));
969
+ }
970
+ render() {
971
+ const treeMode = this.mode === 'tree';
972
+ return (h(Host, { key: '5d8a9a9bb4f1126a304b796aff9d1cb0100b8fc6' }, this.renderToolbar(), h("div", { key: '80ac7e5dd39ffcc4161059447221045a6e035099', class: "mrd-document-container__body", style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
973
+ }
974
+ get el() { return getElement(this); }
975
+ };
976
+ MrdDocumentContainer.style = mrdDocumentContainerScss();
977
+
978
+ const mrdDocumentListScss = () => `.sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}`;
856
979
 
857
980
  const MrdDocumentList = class {
858
981
  constructor(hostRef) {
@@ -860,19 +983,223 @@ const MrdDocumentList = class {
860
983
  this.mrdLoadDistinct = createEvent(this, "mrdLoadDistinct");
861
984
  this.mrdLoadPage = createEvent(this, "mrdLoadPage");
862
985
  this.mrdNavigate = createEvent(this, "mrdNavigate");
986
+ this.mrdCanCreate = createEvent(this, "mrdCanCreate");
987
+ this.mrdUpdateObject = createEvent(this, "mrdUpdateObject");
988
+ this.mrdUpload = createEvent(this, "mrdUpload");
989
+ this.mrdCreateObject = createEvent(this, "mrdCreateObject");
863
990
  /** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
864
991
  this.item = null;
865
992
  /** Parent record id — required for RELATED_VIEW path building. */
866
993
  this.parentId = '';
994
+ /** Canonical parent href (`/{base}/{tenant}/{fromClass}/{parentId}`) supplied by
995
+ * the host. When the RELATED_VIEW's `inverseRelation` equals the archetype
996
+ * `container` slot, this seeds a single container so an empty dossier still
997
+ * accepts file drops and folder creation. */
998
+ this.containerHref = '';
867
999
  this.locale = navigator.language;
868
1000
  this.containers = [];
869
1001
  this.rootLoading = true;
870
1002
  /** True when the single-container level is collapsed away (dossier context). */
871
1003
  this.singleContainer = false;
1004
+ /** Currently selected node id — the target for "New folder" and (later) drops. */
1005
+ this.selectedId = null;
1006
+ /** Node id currently highlighted as a drag-drop target (null = none). */
1007
+ this.dropTargetId = null;
1008
+ /** Node id showing an "uploading…" indicator while a dropped file is processed. */
1009
+ this.uploadingNodeId = null;
1010
+ /** Whether a drag is hovering the root drop-zone (single-container area highlight). */
1011
+ this.rootDropActive = false;
872
1012
  this.nodeIndex = new Map();
1013
+ // ── New-folder editing state ───────────────────────────────────────────────
1014
+ /** The pending node whose inline name input is open (null = not creating). */
1015
+ this.pendingNode = null;
1016
+ /** The node the pending folder is being created under. */
1017
+ this.pendingParent = null;
1018
+ /** The container the pending folder belongs to. */
1019
+ this.pendingContainer = null;
1020
+ /** Current text in the inline name input. */
1021
+ this.pendingName = '';
1022
+ /** Ref to the inline input, so we can focus it after it mounts. */
1023
+ this.pendingInputEl = null;
1024
+ /** Set when a fresh input needs focus on the next render. */
1025
+ this.pendingNeedsFocus = false;
1026
+ /** Monotonic counter for unique temporary pending-node ids. */
1027
+ this.newFolderSeq = 0;
1028
+ /** Last emitted canCreateFolder value, to only emit mrdCanCreate on change. */
1029
+ this.lastCanCreate = false;
1030
+ // ── Drag & drop (move a document into another folder) ──────────────────────
1031
+ /** The document row currently being dragged. */
1032
+ this.dragDoc = null;
1033
+ /** Id of the node the dragged document currently lives in. */
1034
+ this.dragFromId = null;
1035
+ /** External file dropped onto a node, awaiting its upload to complete. */
1036
+ this.pendingUpload = null;
1037
+ /** The optimistic document row awaiting its self href from the create POST. */
1038
+ this.lastOptimisticDoc = null;
1039
+ this.startCreateFolder = () => {
1040
+ const resolved = this.resolveTarget();
1041
+ if (!resolved || this.pendingNode)
1042
+ return;
1043
+ const { target, container } = resolved;
1044
+ const tempId = `${container.id}/__new__${this.newFolderSeq++}`;
1045
+ const node = this.makeFolderNode(tempId, '', container.id);
1046
+ node.pending = true;
1047
+ node.editing = true;
1048
+ target.children = [...target.children, node];
1049
+ target.open = true;
1050
+ this.nodeIndex.set(node.id, node);
1051
+ this.pendingNode = node;
1052
+ this.pendingParent = target;
1053
+ this.pendingContainer = container;
1054
+ this.pendingName = '';
1055
+ this.pendingNeedsFocus = true;
1056
+ this.bump();
1057
+ };
1058
+ this.onPendingInput = (e) => {
1059
+ var _a;
1060
+ this.pendingName = e.target.value;
1061
+ if ((_a = this.pendingNode) === null || _a === void 0 ? void 0 : _a.error) {
1062
+ this.pendingNode.error = undefined;
1063
+ this.bump();
1064
+ }
1065
+ };
1066
+ this.onPendingKeyDown = (e) => {
1067
+ if (e.key === 'Enter') {
1068
+ e.preventDefault();
1069
+ this.commitFolder();
1070
+ }
1071
+ else if (e.key === 'Escape') {
1072
+ e.preventDefault();
1073
+ this.cancelFolder();
1074
+ }
1075
+ };
1076
+ // ── Drag & drop: move a document into another folder / container ────────────
1077
+ this.onDocDragStart = (e, doc, node) => {
1078
+ var _a, _b, _c;
1079
+ this.dragDoc = doc;
1080
+ this.dragFromId = node.id;
1081
+ if (e.dataTransfer) {
1082
+ e.dataTransfer.effectAllowed = 'move';
1083
+ // A payload is required for a drag to start in some browsers.
1084
+ e.dataTransfer.setData('text/plain', (_c = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : '');
1085
+ }
1086
+ };
1087
+ this.onDocDragEnd = () => {
1088
+ this.dragDoc = null;
1089
+ this.dragFromId = null;
1090
+ if (this.dropTargetId !== null)
1091
+ this.dropTargetId = null;
1092
+ };
1093
+ /** A folder/container node (or a document inside it) accepts an internal move
1094
+ * or an external file drop. Always claims the event so it never bubbles to the
1095
+ * root drop-zone; a different node is highlighted (its own folder = no-op). */
1096
+ this.onNodeDragOver = (e, node) => {
1097
+ const file = this.isFileDrag(e);
1098
+ if (!this.dragDoc && !file)
1099
+ return;
1100
+ e.preventDefault();
1101
+ e.stopPropagation();
1102
+ if (e.dataTransfer)
1103
+ e.dataTransfer.dropEffect = file ? 'copy' : 'move';
1104
+ const target = !file && node.id === this.dragFromId ? null : node.id;
1105
+ if (this.dropTargetId !== target)
1106
+ this.dropTargetId = target;
1107
+ };
1108
+ this.onNodeDragLeave = (node) => {
1109
+ if (this.dropTargetId === node.id)
1110
+ this.dropTargetId = null;
1111
+ };
1112
+ this.onNodeDrop = (e, node, container) => {
1113
+ if (this.isFileDrag(e)) {
1114
+ e.preventDefault();
1115
+ e.stopPropagation();
1116
+ this.startFileUpload(e, node, container);
1117
+ return;
1118
+ }
1119
+ if (!this.dragDoc)
1120
+ return;
1121
+ e.preventDefault();
1122
+ e.stopPropagation();
1123
+ this.moveDocument(node, container);
1124
+ this.onDocDragEnd();
1125
+ };
1126
+ /** Root-zone drop (dossier context): target the single container's root. */
1127
+ this.onRootDragOver = (e) => {
1128
+ if (!this.singleContainer)
1129
+ return;
1130
+ const file = this.isFileDrag(e);
1131
+ if (!this.dragDoc && !file)
1132
+ return;
1133
+ e.preventDefault();
1134
+ if (e.dataTransfer)
1135
+ e.dataTransfer.dropEffect = file ? 'copy' : 'move';
1136
+ if (!this.rootDropActive)
1137
+ this.rootDropActive = true;
1138
+ };
1139
+ this.onRootDragLeave = (e) => {
1140
+ const related = e.relatedTarget;
1141
+ if (related && this.el.contains(related))
1142
+ return; // moved onto a child, still inside
1143
+ if (this.rootDropActive)
1144
+ this.rootDropActive = false;
1145
+ };
1146
+ this.onRootDrop = (e) => {
1147
+ this.rootDropActive = false;
1148
+ if (!this.singleContainer)
1149
+ return;
1150
+ const only = this.containers[0];
1151
+ if (this.isFileDrag(e)) {
1152
+ e.preventDefault();
1153
+ this.startFileUpload(e, only, only);
1154
+ return;
1155
+ }
1156
+ if (!this.dragDoc)
1157
+ return;
1158
+ e.preventDefault();
1159
+ this.moveDocument(only, only);
1160
+ this.onDocDragEnd();
1161
+ };
873
1162
  }
874
1163
  componentDidLoad() {
875
- this.emitContainerDistinct();
1164
+ if (this.isSeededSingleContainer()) {
1165
+ this.seedSingleContainer();
1166
+ }
1167
+ else {
1168
+ this.emitContainerDistinct();
1169
+ }
1170
+ }
1171
+ /** True when the view is a single-container context: a RELATED_VIEW whose
1172
+ * `inverseRelation` matches the archetype `container` slot, with a known
1173
+ * parent href. The container is then implied by context (not by distinct),
1174
+ * so it works even with zero documents. */
1175
+ isSeededSingleContainer() {
1176
+ var _a, _b;
1177
+ return (((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === ClientLayoutItemType.RELATED_VIEW &&
1178
+ !!((_b = this.item) === null || _b === void 0 ? void 0 : _b.inverseRelation) &&
1179
+ this.item.inverseRelation === this.containerField &&
1180
+ !!this.containerHref);
1181
+ }
1182
+ /** Seed the single implied container from context and load its folders. */
1183
+ seedSingleContainer() {
1184
+ const node = this.makeContainerNode(this.containerHref, this.containerField, 0);
1185
+ this.nodeIndex.set(node.id, node);
1186
+ this.containers = [node];
1187
+ this.rootLoading = false;
1188
+ this.singleContainer = true;
1189
+ node.open = true;
1190
+ this.emitFolderDistinct(node);
1191
+ }
1192
+ componentDidRender() {
1193
+ if (this.pendingNeedsFocus && this.pendingInputEl) {
1194
+ this.pendingInputEl.focus();
1195
+ this.pendingInputEl.select();
1196
+ this.pendingNeedsFocus = false;
1197
+ }
1198
+ const can = this.canCreateFolder;
1199
+ if (can !== this.lastCanCreate) {
1200
+ this.lastCanCreate = can;
1201
+ this.mrdCanCreate.emit(can);
1202
+ }
876
1203
  }
877
1204
  // ── Slot field names ─────────────────────────────────────────────────────
878
1205
  get containerField() {
@@ -887,12 +1214,19 @@ const MrdDocumentList = class {
887
1214
  var _a, _b, _c;
888
1215
  return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'name';
889
1216
  }
1217
+ get fileField() {
1218
+ var _a, _b, _c;
1219
+ return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.file) !== null && _c !== void 0 ? _c : 'file';
1220
+ }
890
1221
  get dateField() {
891
1222
  var _a, _b;
892
1223
  return (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.date;
893
1224
  }
894
1225
  // ── Path / query building (mirrors mrd-table conventions) ────────────────
895
- /** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`. */
1226
+ /** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`.
1227
+ * Used for reads (list/distinct): `dataClass`/`relatedClass` may be an abstract
1228
+ * type (e.g. "contents"), filtered down to the concrete `filterClass` via the
1229
+ * `type` query param — see baseParams(). */
896
1230
  buildDataPath() {
897
1231
  var _a, _b, _c;
898
1232
  const it = this.item;
@@ -902,6 +1236,19 @@ const MrdDocumentList = class {
902
1236
  }
903
1237
  return `/${dataClass}`;
904
1238
  }
1239
+ /** Path for creating a new document (file-drop). Unlike buildDataPath(), this
1240
+ * must target the concrete type: `dataClass`/`relatedClass` can be an abstract
1241
+ * base type (e.g. "contents") that cannot be POSTed to directly, so prefer
1242
+ * `filterClass` (e.g. "documents") when present. */
1243
+ buildCreatePath() {
1244
+ var _a, _b, _c, _d;
1245
+ const it = this.item;
1246
+ const dataClass = (_c = (_b = (_a = it === null || it === void 0 ? void 0 : it.filterClass) !== null && _a !== void 0 ? _a : it === null || it === void 0 ? void 0 : it.dataClass) !== null && _b !== void 0 ? _b : it === null || it === void 0 ? void 0 : it.relatedClass) !== null && _c !== void 0 ? _c : '';
1247
+ if ((it === null || it === void 0 ? void 0 : it.type) === ClientLayoutItemType.RELATED_VIEW) {
1248
+ return `/${(_d = it.fromClass) !== null && _d !== void 0 ? _d : ''}/${this.parentId}/${dataClass}`;
1249
+ }
1250
+ return `/${dataClass}`;
1251
+ }
905
1252
  /** View-level static filters + filterClass, shared by every request. */
906
1253
  baseParams() {
907
1254
  var _a, _b, _c, _d, _e, _f, _g;
@@ -1039,7 +1386,7 @@ const MrdDocumentList = class {
1039
1386
  acc.push(seg);
1040
1387
  let child = node.children.find(c => c.label === seg);
1041
1388
  if (!child) {
1042
- child = this.makeFolderNode(container.id + '/' + acc.join('/'), seg);
1389
+ child = this.makeFolderNode(container.id + '/' + acc.join('/'), seg, container.id);
1043
1390
  node.children.push(child);
1044
1391
  this.nodeIndex.set(child.id, child);
1045
1392
  }
@@ -1075,9 +1422,9 @@ const MrdDocumentList = class {
1075
1422
  open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
1076
1423
  };
1077
1424
  }
1078
- makeFolderNode(id, label) {
1425
+ makeFolderNode(id, label, containerId) {
1079
1426
  return {
1080
- id, kind: 'folder', label,
1427
+ id, kind: 'folder', label, containerId,
1081
1428
  hasDocs: false, docCount: 0, totalCount: 0, children: [],
1082
1429
  open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
1083
1430
  };
@@ -1095,6 +1442,7 @@ const MrdDocumentList = class {
1095
1442
  }
1096
1443
  // ── Interaction ──────────────────────────────────────────────────────────
1097
1444
  toggleContainer(node) {
1445
+ this.selectedId = node.id;
1098
1446
  node.open = !node.open;
1099
1447
  if (node.open && !node.foldersLoaded && !node.loading) {
1100
1448
  this.emitFolderDistinct(node);
@@ -1102,12 +1450,235 @@ const MrdDocumentList = class {
1102
1450
  this.bump();
1103
1451
  }
1104
1452
  toggleFolder(container, node) {
1453
+ this.selectedId = node.id;
1105
1454
  node.open = !node.open;
1106
1455
  if (node.open && node.hasDocs && !node.docsLoaded && !node.loading) {
1107
1456
  this.emitDocuments(container, node);
1108
1457
  }
1109
1458
  this.bump();
1110
1459
  }
1460
+ // ── New folder (client-side pending, materialises on document drop) ─────────
1461
+ /** Resolve the node a new folder should be created under, and its container.
1462
+ * Uses the current selection; falls back to the single container (dossier). */
1463
+ resolveTarget() {
1464
+ if (this.selectedId) {
1465
+ const n = this.nodeIndex.get(this.selectedId);
1466
+ if (n && n.kind === 'container')
1467
+ return { target: n, container: n };
1468
+ if (n && n.kind === 'folder') {
1469
+ const container = n.containerId ? this.nodeIndex.get(n.containerId) : undefined;
1470
+ if (container)
1471
+ return { target: n, container };
1472
+ }
1473
+ }
1474
+ if (this.singleContainer && this.containers[0]) {
1475
+ const only = this.containers[0];
1476
+ return { target: only, container: only };
1477
+ }
1478
+ return null;
1479
+ }
1480
+ get canCreateFolder() {
1481
+ return !this.pendingNode && this.resolveTarget() !== null;
1482
+ }
1483
+ /** Start creating a folder under the current target. Called by the host toolbar
1484
+ * (mrd-document-container). No-op when there is no valid target. */
1485
+ async createFolder() {
1486
+ this.startCreateFolder();
1487
+ }
1488
+ /** Folder path segments of a node relative to its container (derived from its id). */
1489
+ segmentsOf(node, container) {
1490
+ if (node.kind === 'container')
1491
+ return [];
1492
+ const prefix = container.id + '/';
1493
+ const rest = node.id.startsWith(prefix) ? node.id.slice(prefix.length) : '';
1494
+ return rest ? rest.split('/') : [];
1495
+ }
1496
+ commitFolder() {
1497
+ const node = this.pendingNode;
1498
+ const parent = this.pendingParent;
1499
+ const container = this.pendingContainer;
1500
+ if (!node || !parent || !container)
1501
+ return;
1502
+ const name = this.pendingName.trim();
1503
+ if (!name) {
1504
+ this.cancelFolder();
1505
+ return;
1506
+ }
1507
+ if (name.includes('/')) {
1508
+ node.error = t('folder_no_slash', this.locale);
1509
+ this.bump();
1510
+ return;
1511
+ }
1512
+ const dup = parent.children.some(c => c !== node && c.label.toLowerCase() === name.toLowerCase());
1513
+ if (dup) {
1514
+ node.error = t('folder_duplicate', this.locale);
1515
+ this.bump();
1516
+ return;
1517
+ }
1518
+ // Finalise: swap the temp id for the real path-derived id so a later distinct
1519
+ // value with the same folder string merges onto this node.
1520
+ const segs = [...this.segmentsOf(parent, container), name];
1521
+ this.nodeIndex.delete(node.id);
1522
+ node.id = container.id + '/' + segs.join('/');
1523
+ node.fullPath = '/' + segs.join('/');
1524
+ node.label = name;
1525
+ node.editing = false;
1526
+ node.error = undefined;
1527
+ node.open = true;
1528
+ this.nodeIndex.set(node.id, node);
1529
+ this.selectedId = node.id;
1530
+ this.clearPending();
1531
+ this.bump();
1532
+ }
1533
+ cancelFolder() {
1534
+ const node = this.pendingNode;
1535
+ const parent = this.pendingParent;
1536
+ if (node && parent) {
1537
+ parent.children = parent.children.filter(c => c !== node);
1538
+ this.nodeIndex.delete(node.id);
1539
+ }
1540
+ this.clearPending();
1541
+ this.bump();
1542
+ }
1543
+ clearPending() {
1544
+ this.pendingNode = null;
1545
+ this.pendingParent = null;
1546
+ this.pendingContainer = null;
1547
+ this.pendingName = '';
1548
+ this.pendingInputEl = null;
1549
+ this.pendingNeedsFocus = false;
1550
+ }
1551
+ /** True when the drag carries external files (an OS file drop, not an internal move). */
1552
+ isFileDrag(e) {
1553
+ return !this.dragDoc && !!e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files');
1554
+ }
1555
+ // ── External file drop → upload → create document ──────────────────────────
1556
+ /** Begin an upload: emit mrdUpload; the host uploads and calls setFileReference. */
1557
+ startFileUpload(e, node, container) {
1558
+ var _a, _b;
1559
+ const file = (_b = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]; // single file per drop
1560
+ this.dropTargetId = null;
1561
+ if (!file)
1562
+ return;
1563
+ this.pendingUpload = { file, node, container };
1564
+ node.open = true;
1565
+ this.uploadingNodeId = node.id;
1566
+ this.bump();
1567
+ this.mrdUpload.emit({ file });
1568
+ }
1569
+ /** Strip a single trailing extension for the document title. */
1570
+ stripExtension(name) {
1571
+ return name.replace(/\.[^./\\]+$/, '');
1572
+ }
1573
+ /** Host callback with the uploaded file reference. Builds the create payload
1574
+ * from the archetype slots and requests the new document. */
1575
+ async setFileReference(uri) {
1576
+ const up = this.pendingUpload;
1577
+ if (!up)
1578
+ return;
1579
+ const { file, node, container } = up;
1580
+ const folder = this.folderStringOf(node, container);
1581
+ const values = {
1582
+ [this.fileField]: uri,
1583
+ [this.titleField]: this.stripExtension(file.name),
1584
+ [this.folderField]: folder,
1585
+ [this.containerField]: container.href,
1586
+ };
1587
+ this.mrdCreateObject.emit({ path: this.buildCreatePath(), values });
1588
+ // Optimistically show the new document (no href until a reload).
1589
+ const optimistic = { [this.titleField]: this.stripExtension(file.name), _optimistic: true };
1590
+ const wasUnloadedEmpty = !node.docsLoaded && node.docCount === 0;
1591
+ node.hasDocs = true;
1592
+ node.pending = false;
1593
+ node.docCount += 1;
1594
+ if (wasUnloadedEmpty) {
1595
+ node.docsLoaded = true;
1596
+ node.docs = [optimistic];
1597
+ }
1598
+ else if (node.docsLoaded)
1599
+ node.docs = [...node.docs, optimistic];
1600
+ this.recomputeContainerTotals(container, 1);
1601
+ this.lastOptimisticDoc = optimistic;
1602
+ this.pendingUpload = null;
1603
+ this.uploadingNodeId = null;
1604
+ this.bump();
1605
+ }
1606
+ /** Host callback with the created document's self href, so the optimistic row
1607
+ * becomes navigable without waiting for a reload. */
1608
+ async setCreatedHref(href) {
1609
+ var _a;
1610
+ const doc = this.lastOptimisticDoc;
1611
+ if (!doc || !href)
1612
+ return;
1613
+ doc._links = Object.assign(Object.assign({}, ((_a = doc._links) !== null && _a !== void 0 ? _a : {})), { self: { href } });
1614
+ doc._optimistic = false;
1615
+ this.lastOptimisticDoc = null;
1616
+ this.bump();
1617
+ }
1618
+ /** Folder string a node represents: the raw distinct value when it holds
1619
+ * documents, else derived from its path segments; null for a container root. */
1620
+ folderStringOf(node, container) {
1621
+ if (node.kind === 'container')
1622
+ return null;
1623
+ if (node.fullPath != null && node.fullPath !== '')
1624
+ return node.fullPath;
1625
+ const segs = this.segmentsOf(node, container);
1626
+ return segs.length ? '/' + segs.join('/') : null;
1627
+ }
1628
+ moveDocument(toNode, toContainer) {
1629
+ var _a, _b;
1630
+ const doc = this.dragDoc;
1631
+ const fromNode = this.dragFromId ? this.nodeIndex.get(this.dragFromId) : undefined;
1632
+ if (!doc || !fromNode)
1633
+ return;
1634
+ const fromContainer = fromNode.kind === 'container'
1635
+ ? fromNode
1636
+ : (fromNode.containerId ? this.nodeIndex.get(fromNode.containerId) : undefined);
1637
+ if (!fromContainer)
1638
+ return;
1639
+ const targetFolder = this.folderStringOf(toNode, toContainer);
1640
+ const sourceFolder = this.folderStringOf(fromNode, fromContainer);
1641
+ const sameContainer = toContainer === fromContainer;
1642
+ // No-op: dropped back onto its own folder.
1643
+ if (toNode === fromNode || (sameContainer && targetFolder === sourceFolder))
1644
+ return;
1645
+ // ── Optimistic tree update (fire-and-forget; no refetch) ──
1646
+ fromNode.docs = fromNode.docs.filter(d => d !== doc);
1647
+ fromNode.docCount = Math.max(0, fromNode.docCount - 1);
1648
+ // A now-empty folder should stop showing an expand chevron (it disappears on
1649
+ // the next reload anyway, since it is derived from document folder strings).
1650
+ if (fromNode.docsLoaded)
1651
+ fromNode.hasDocs = fromNode.docs.length > 0;
1652
+ toNode.hasDocs = true;
1653
+ toNode.pending = false; // a pending folder is now materialised
1654
+ toNode.docCount += 1;
1655
+ if (toNode.kind === 'folder')
1656
+ toNode.fullPath = targetFolder !== null && targetFolder !== void 0 ? targetFolder : '';
1657
+ if (toNode.docsLoaded)
1658
+ toNode.docs = [...toNode.docs, doc];
1659
+ this.recomputeContainerTotals(fromContainer, -1);
1660
+ if (!sameContainer)
1661
+ this.recomputeContainerTotals(toContainer, 1);
1662
+ // ── Emit the generic update; host PATCHes the document ──
1663
+ const href = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href;
1664
+ if (href) {
1665
+ const values = { [this.folderField]: targetFolder };
1666
+ if (!sameContainer)
1667
+ values[this.containerField] = toContainer.href;
1668
+ this.mrdUpdateObject.emit({ href, values });
1669
+ }
1670
+ this.bump();
1671
+ }
1672
+ /** Recompute a container's subtree totals from docCounts when its folders are
1673
+ * loaded; otherwise just nudge the aggregate badge by the delta. */
1674
+ recomputeContainerTotals(container, delta) {
1675
+ if (container.foldersLoaded) {
1676
+ this.computeTotals(container);
1677
+ }
1678
+ else {
1679
+ container.totalCount = Math.max(0, container.totalCount + delta);
1680
+ }
1681
+ }
1111
1682
  openDoc(doc) {
1112
1683
  var _a, _b, _c, _d;
1113
1684
  const href = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href;
@@ -1130,12 +1701,12 @@ const MrdDocumentList = class {
1130
1701
  indent(depth) {
1131
1702
  return h("span", { class: "mrd-document-list__indent", style: { width: `${depth * 18}px` } });
1132
1703
  }
1133
- renderDocRow(doc, depth) {
1704
+ renderDocRow(doc, node, container, depth) {
1134
1705
  var _a, _b, _c, _d, _e;
1135
1706
  const label = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc[this.titleField]) !== null && _a !== void 0 ? _a : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _b !== void 0 ? _b : '';
1136
1707
  const dateRaw = this.dateField ? doc === null || doc === void 0 ? void 0 : doc[this.dateField] : undefined;
1137
1708
  const date = dateRaw ? formatDate(dateRaw, this.locale) : '';
1138
- return (h("div", { class: "mrd-document-list__row mrd-document-list__row--doc", key: (_e = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : label, onClick: () => this.openDoc(doc) }, this.indent(depth), this.renderChevron(false, true), this.renderDocIcon(), h("span", { class: "mrd-document-list__label" }, label), date && h("span", { class: "mrd-document-list__date" }, date)));
1709
+ return (h("div", { class: "mrd-document-list__row mrd-document-list__row--doc", key: (_e = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : label, draggable: true, onClick: () => this.openDoc(doc), onDragStart: (e) => this.onDocDragStart(e, doc, node), onDragEnd: this.onDocDragEnd, onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, container) }, this.indent(depth), this.renderChevron(false, true), this.renderDocIcon(), h("span", { class: "mrd-document-list__label" }, label), date && h("span", { class: "mrd-document-list__date" }, date)));
1139
1710
  }
1140
1711
  renderLoadingRow(depth) {
1141
1712
  return (h("div", { class: "mrd-document-list__loading", key: "loading" }, this.indent(depth), h("span", { class: "mrd-document-list__spinner" }), t('loading', this.locale)));
@@ -1146,7 +1717,7 @@ const MrdDocumentList = class {
1146
1717
  if (node.hasDocs) {
1147
1718
  if (node.docsLoaded) {
1148
1719
  for (const doc of node.docs)
1149
- out.push(this.renderDocRow(doc, depth));
1720
+ out.push(this.renderDocRow(doc, node, container, depth));
1150
1721
  }
1151
1722
  else if (node.loading) {
1152
1723
  out.push(this.renderLoadingRow(depth));
@@ -1156,14 +1727,34 @@ const MrdDocumentList = class {
1156
1727
  for (const child of node.children) {
1157
1728
  out.push(this.renderFolderNode(container, child, depth));
1158
1729
  }
1730
+ // An uploading file dropped onto this node.
1731
+ if (node.id === this.uploadingNodeId)
1732
+ out.push(this.renderUploadingRow(depth));
1159
1733
  return out;
1160
1734
  }
1735
+ renderUploadingRow(depth) {
1736
+ return (h("div", { class: "mrd-document-list__loading", key: "uploading" }, this.indent(depth), h("span", { class: "mrd-document-list__spinner" }), t('upload_file', this.locale)));
1737
+ }
1738
+ renderFolderEditRow(node, depth) {
1739
+ return (h("div", { class: "mrd-document-list__node", key: node.id }, h("div", { class: "mrd-document-list__row mrd-document-list__row--edit" }, this.indent(depth), this.renderChevron(false, true), this.renderFolderIcon(), h("input", { class: "mrd-document-list__name-input", type: "text", placeholder: t('folder_name_placeholder', this.locale), ref: el => (this.pendingInputEl = el), onInput: this.onPendingInput, onKeyDown: this.onPendingKeyDown, onBlur: () => this.cancelFolder() })), node.error && (h("div", { class: "mrd-document-list__error", style: { paddingLeft: `${depth * 18 + 52}px` } }, node.error))));
1740
+ }
1161
1741
  renderFolderNode(container, node, depth) {
1742
+ if (node.editing)
1743
+ return this.renderFolderEditRow(node, depth);
1162
1744
  const leaf = node.children.length === 0 && !node.hasDocs;
1163
- return (h("div", { class: "mrd-document-list__node", key: node.id }, h("div", { class: "mrd-document-list__row", onClick: () => this.toggleFolder(container, node) }, this.indent(depth), this.renderChevron(node.open, leaf), this.renderFolderIcon(), h("span", { class: "mrd-document-list__label" }, node.label), h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && h("div", { class: "mrd-document-list__kids" }, this.renderChildren(container, node, depth + 1))));
1745
+ const selected = node.id === this.selectedId;
1746
+ const cls = 'mrd-document-list__row'
1747
+ + (selected ? ' mrd-document-list__row--selected' : '')
1748
+ + (node.pending ? ' mrd-document-list__row--pending' : '')
1749
+ + (node.id === this.dropTargetId ? ' mrd-document-list__row--drop' : '');
1750
+ return (h("div", { class: "mrd-document-list__node", key: node.id }, h("div", { class: cls, onClick: () => this.toggleFolder(container, node), onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, container) }, this.indent(depth), this.renderChevron(node.open, leaf), this.renderFolderIcon(), h("span", { class: "mrd-document-list__label" }, node.label), h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && h("div", { class: "mrd-document-list__kids" }, this.renderChildren(container, node, depth + 1))));
1164
1751
  }
1165
1752
  renderContainerNode(node, depth) {
1166
- return (h("div", { class: "mrd-document-list__node", key: node.id }, h("div", { class: "mrd-document-list__row mrd-document-list__row--dossier", onClick: () => this.toggleContainer(node) }, this.indent(depth), this.renderChevron(node.open, false), this.renderDossierIcon(), h("span", { class: "mrd-document-list__label" }, node.label), h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && (h("div", { class: "mrd-document-list__kids" }, node.loading && !node.foldersLoaded
1753
+ const selected = node.id === this.selectedId;
1754
+ const cls = 'mrd-document-list__row mrd-document-list__row--dossier'
1755
+ + (selected ? ' mrd-document-list__row--selected' : '')
1756
+ + (node.id === this.dropTargetId ? ' mrd-document-list__row--drop' : '');
1757
+ return (h("div", { class: "mrd-document-list__node", key: node.id }, h("div", { class: cls, onClick: () => this.toggleContainer(node), onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, node) }, this.indent(depth), this.renderChevron(node.open, false), this.renderDossierIcon(), h("span", { class: "mrd-document-list__label" }, node.label), h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && (h("div", { class: "mrd-document-list__kids" }, node.loading && !node.foldersLoaded
1167
1758
  ? this.renderLoadingRow(depth + 1)
1168
1759
  : this.renderChildren(node, node, depth + 1)))));
1169
1760
  }
@@ -1173,19 +1764,25 @@ const MrdDocumentList = class {
1173
1764
  body = this.renderLoadingRow(0);
1174
1765
  }
1175
1766
  else if (this.containers.length === 0) {
1176
- body = h("div", { key: '0c4190bb86543e2d37cc1584b3495eb6eab5664c', class: "mrd-document-list__empty" }, t('no_results', this.locale));
1767
+ body = h("div", { key: '9c38a2e26320a8173ba82cac412c1b32a8a1882e', class: "mrd-document-list__empty" }, t('no_results', this.locale));
1177
1768
  }
1178
1769
  else if (this.singleContainer) {
1179
1770
  // Dossier context: render the single container's folder tree at the root.
1180
1771
  const only = this.containers[0];
1181
- body = only.loading && !only.foldersLoaded
1182
- ? this.renderLoadingRow(0)
1183
- : this.renderChildren(only, only, 0);
1772
+ if (only.loading && !only.foldersLoaded) {
1773
+ body = this.renderLoadingRow(0);
1774
+ }
1775
+ else {
1776
+ const kids = this.renderChildren(only, only, 0);
1777
+ body = kids.length
1778
+ ? kids
1779
+ : h("div", { class: "mrd-document-list__empty" }, t('doc_empty_drop', this.locale));
1780
+ }
1184
1781
  }
1185
1782
  else {
1186
1783
  body = this.containers.map(c => this.renderContainerNode(c, 0));
1187
1784
  }
1188
- return (h(Host, { key: '4e38d9ef5a1df137a41516a47dc5debbea6b2f35' }, h("div", { key: '6d2f162624e5bbc8650a2978a3b045c21fe13ea3', class: "mrd-document-list" }, body)));
1785
+ return (h(Host, { key: 'dd83a6a609e01d21a2b5da5b3ab929f6f9315402' }, h("div", { key: 'd539d938e1efd759730cccc90c4d6c2e535db936', class: 'mrd-document-list' + (this.rootDropActive ? ' mrd-document-list--drop-active' : ''), onDragOver: this.onRootDragOver, onDragLeave: this.onRootDragLeave, onDrop: this.onRootDrop }, body)));
1189
1786
  }
1190
1787
  get el() { return getElement(this); }
1191
1788
  };
@@ -1243,7 +1840,7 @@ const MrdDocumentView = class {
1243
1840
  const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
1244
1841
  const summaryRaw = this.slotValue('summary');
1245
1842
  const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
1246
- return (h(Host, { key: 'b6c2dbc45d5cfe551ac16b43b1a152a0d793b794' }, h("div", { key: 'df70848b4aa54ea414ea5d577a600779ee002b13', class: "mrd-document-view" }, this.renderContainer(), title && h("h1", { key: '46ff550fccd6de02972c6ee77b3cd5e7e394481a', class: "mrd-document-view__title" }, title), date && h("p", { key: '501c75cfc78722bd486d4a1db366675a1c519264', class: "mrd-document-view__date" }, date), this.renderFile(), summary && (h("div", { key: 'ee4475d06e5ca81a760e0c9e1e4b5f32ed894d89', class: "mrd-document-view__summary" }, h("div", { key: '9d196abdcc56b84b2b07203d7e5167be196a342a', class: "mrd-document-view__summary-body", innerHTML: summary }))))));
1843
+ return (h(Host, { key: '0a2071925ecdb21738376d66fa4babf4590e694c' }, h("div", { key: 'a2d29c0b6e211cab142adc780466bc885a602e96', class: "mrd-document-view" }, this.renderContainer(), title && h("h1", { key: '7f5ac202c21bc8a70f0dd15e2e1fa06e651b5bce', class: "mrd-document-view__title" }, title), date && h("p", { key: 'b1dce94d5fd8bfd5e078644f631a38f91b87e7ff', class: "mrd-document-view__date" }, date), this.renderFile(), summary && (h("div", { key: '588b9ca40a49ae9ea303852620bde75333b440ab', class: "mrd-document-view__summary" }, h("div", { key: 'd3b8adb85ac346b72451e789c10aedd539c966de', class: "mrd-document-view__summary-body", innerHTML: summary }))))));
1247
1844
  }
1248
1845
  };
1249
1846
  MrdDocumentView.style = mrdDocumentViewScss();
@@ -1283,7 +1880,7 @@ const MrdEmailField = class {
1283
1880
  }
1284
1881
  render() {
1285
1882
  const hasError = !!this.error;
1286
- return (h(Host, { key: 'bf888feadb6585a845f6d610165e192e342be5d2' }, h("div", { key: 'ab43101242a92df1643d218c0d35bb7b80452fef', class: "mrd-email-field" }, this.label && (h("label", { key: '854c9bd733f5803616ab8b70f0316a7a8a82ffd4', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), h("input", { key: '39ed16119a2329fdc67db578dcc7bafc35f4acf0', class: `mrd-email-field__input${hasError ? ' mrd-email-field__input--error' : ''}`, type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: 'c5881e21a2314e5d339464b16982add69be9f68a', class: "mrd-email-field__error" }, this.error))));
1883
+ return (h(Host, { key: '0d442ab2a711c26c83fcdbf0fd8cd006d8dd8649' }, h("div", { key: 'ceb2a80679514c4c5b888fe096c90ed6cc973f64', class: "mrd-email-field" }, this.label && (h("label", { key: '663f95eff1002ee56cfc3104514bf31b47e26750', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), h("input", { key: '42dbdec25a47b37cfd68d00d0b8a481f96fe8241', class: `mrd-email-field__input${hasError ? ' mrd-email-field__input--error' : ''}`, type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: '626ee856ceaa7051fb9dd1de8b7cbd708e83f617', class: "mrd-email-field__error" }, this.error))));
1287
1884
  }
1288
1885
  };
1289
1886
  MrdEmailField.style = mrdEmailFieldScss();
@@ -1566,7 +2163,7 @@ const MrdFileField = class {
1566
2163
  hasError ? 'mrd-file-field__zone--error' : '',
1567
2164
  this.disabled || this.uploading ? 'mrd-file-field__zone--disabled' : '',
1568
2165
  ].filter(Boolean).join(' ');
1569
- return (h(Host, { key: '424a55ff5c141a51ed2e253a126e0046808cf1b1' }, h("div", { key: '49407e31c019a27bbaa3ccbc81cd4597d992d03a', class: "mrd-file-field" }, this.label && (h("label", { key: '0477b203f2b8df03cf9d11153bc547e9490800f7', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), h("div", { key: 'aff3e5f258cfa8320150048af0b0087081cbbc13', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: 'ee4366f0c4b8871524288ca47c98b4749def0b81', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (h("div", { class: "mrd-file-field__selected" }, this.uploading ? (h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), h("polyline", { points: "14 2 14 8 20 8" }))), h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (h("div", { class: "mrd-file-field__prompt" }, h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "16 16 12 12 8 16" }), h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'b67b7770e194843a1b75caaff807ea14d62eba6a', class: "mrd-file-field__error" }, this.error))));
2166
+ return (h(Host, { key: '095bb39f3cb1680cf5e7e51bdfd06d8eb087f237' }, h("div", { key: '7e5b5fe6e63b6530221083c8bcb82bcac59a5fe7', class: "mrd-file-field" }, this.label && (h("label", { key: 'c34723f4199371d6fe8ea87463d878b89c038590', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), h("div", { key: '4727667345d3cd4a5c65a431744a09f366943c13', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: '45ed41c0f094dbe269561c8586e473f908cdf4a4', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (h("div", { class: "mrd-file-field__selected" }, this.uploading ? (h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), h("polyline", { points: "14 2 14 8 20 8" }))), h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (h("div", { class: "mrd-file-field__prompt" }, h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "16 16 12 12 8 16" }), h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: '00ce94ead3c32ed63e903cfd9d8480084a308d84', class: "mrd-file-field__error" }, this.error))));
1570
2167
  }
1571
2168
  static get watchers() { return {
1572
2169
  "value": [{
@@ -2127,7 +2724,7 @@ const MrdImageField = class {
2127
2724
  hasError ? 'mrd-image-field__zone--error' : '',
2128
2725
  this.disabled || this.uploading ? 'mrd-image-field__zone--disabled' : '',
2129
2726
  ].filter(Boolean).join(' ');
2130
- return (h(Host, { key: '105ebf20023291a1e5c8524eedba4f04573943cd' }, h("div", { key: '59e6fe3b81c2ec1c07db7aaba819d79d2525b21f', class: "mrd-image-field" }, this.label && (h("label", { key: '2f3815ad6fe3f35932a8cc4d625751935272b629', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), h("div", { key: '8b45fbf8d0a229110a53068620a316ab6d48dbb8', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: 'b6039e85f3f456e7c8d8e7d4db29e111a7f6d8d9', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (h("div", { class: "mrd-image-field__preview-container" }, h("div", { class: "mrd-image-field__preview-thumb" }, h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && h("div", { class: "mrd-image-field__preview-overlay" }, h("span", { class: "mrd-image-field__spinner" }))), h("div", { class: "mrd-image-field__preview-info" }, h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (h("div", { class: "mrd-image-field__prompt" }, h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), h("polyline", { points: "21 15 16 10 5 21" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'f53ade0f627f3c840bc133690d40034c12665b5c', class: "mrd-image-field__error" }, this.error))));
2727
+ return (h(Host, { key: '97db2df72839f36b7a46e153a5dd1c208c52b522' }, h("div", { key: 'c8f2d3d858f90d322d26082aaf5adb57acfc78f4', class: "mrd-image-field" }, this.label && (h("label", { key: '6625e5031ff0b7c06f76c1ea0387f1bd5c1858a4', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), h("div", { key: '364216e6a96e845e21c42e821fdff02bd2612ff8', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, h("input", { key: '0487706ddd9f48cda1cb0c2a178809d90674486b', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (h("div", { class: "mrd-image-field__preview-container" }, h("div", { class: "mrd-image-field__preview-thumb" }, h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && h("div", { class: "mrd-image-field__preview-overlay" }, h("span", { class: "mrd-image-field__spinner" }))), h("div", { class: "mrd-image-field__preview-info" }, h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (h("div", { class: "mrd-image-field__prompt" }, h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), h("polyline", { points: "21 15 16 10 5 21" })), h("span", null, t('drop_file_here', this.locale), ' ', h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && h("span", { key: 'bd505ef4f4b67c4e9138d8825c6e600f583f4cab', class: "mrd-image-field__error" }, this.error))));
2131
2728
  }
2132
2729
  static get watchers() { return {
2133
2730
  "value": [{
@@ -2241,7 +2838,7 @@ class CellRenderer {
2241
2838
  }
2242
2839
  }
2243
2840
 
2244
- const mrdLayoutSectionScss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__doc-toolbar.sc-mrd-layout-section{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) 0}.mrd-layout-section__seg.sc-mrd-layout-section{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-layout-section__seg-btn.sc-mrd-layout-section{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-layout-section__seg-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-800)}.mrd-layout-section__seg-btn[aria-pressed='true'].sc-mrd-layout-section{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-layout-section__seg-btn.sc-mrd-layout-section svg.sc-mrd-layout-section{width:1rem;height:1rem}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}`;
2841
+ const mrdLayoutSectionScss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}`;
2245
2842
 
2246
2843
  const MrdLayoutSection = class {
2247
2844
  constructor(hostRef) {
@@ -2254,6 +2851,9 @@ const MrdLayoutSection = class {
2254
2851
  this.mrdViewAction = createEvent(this, "mrdViewAction");
2255
2852
  this.mrdLoadViewAggregations = createEvent(this, "mrdLoadViewAggregations");
2256
2853
  this.mrdLoadViewDistinct = createEvent(this, "mrdLoadViewDistinct");
2854
+ this.mrdUpdateObject = createEvent(this, "mrdUpdateObject");
2855
+ this.mrdViewUpload = createEvent(this, "mrdViewUpload");
2856
+ this.mrdCreateObject = createEvent(this, "mrdCreateObject");
2257
2857
  /** Items from one layout entry in ClientDashboardMetadata.layouts[]. */
2258
2858
  this.items = [];
2259
2859
  /** Record data object; keys are field names, _links holds relation and related-view links. */
@@ -2271,8 +2871,6 @@ const MrdLayoutSection = class {
2271
2871
  this.imagePreviewUrl = null;
2272
2872
  this.imagePreviews = {};
2273
2873
  this.openHistoryField = null;
2274
- /** Per-view display mode for document collection views. Default 'tree'. */
2275
- this.docViewMode = {};
2276
2874
  this.historyClickOutside = null;
2277
2875
  this.searchTimers = {};
2278
2876
  this.handleViewLoadPage = (e, name) => {
@@ -2389,6 +2987,20 @@ const MrdLayoutSection = class {
2389
2987
  if (list === null || list === void 0 ? void 0 : list.setDistinct)
2390
2988
  await list.setDistinct(nodeId, values);
2391
2989
  }
2990
+ /** Inject the uploaded file reference for a dropped file, so the document view
2991
+ * can request creation of the new document (see mrdViewUpload). */
2992
+ async setViewFileReference(name, uri) {
2993
+ const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
2994
+ if (list === null || list === void 0 ? void 0 : list.setFileReference)
2995
+ await list.setFileReference(uri);
2996
+ }
2997
+ /** Inject the created document's href after a file-drop create, so the
2998
+ * optimistic row becomes navigable (see mrdCreateObject). */
2999
+ async setViewCreatedObject(name, href) {
3000
+ const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
3001
+ if (list === null || list === void 0 ? void 0 : list.setCreatedHref)
3002
+ await list.setCreatedHref(href);
3003
+ }
2392
3004
  /** Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox. */
2393
3005
  async setImagePreview(fieldName, url) {
2394
3006
  this.imagePreviews = Object.assign(Object.assign({}, this.imagePreviews), { [fieldName]: url });
@@ -2537,7 +3149,7 @@ const MrdLayoutSection = class {
2537
3149
  return (h("div", { class: "mrd-layout-section__search", key: `search-${dataClass}` }, h("div", { class: "mrd-layout-section__search-wrap" }, h("svg", { class: "mrd-layout-section__search-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, h("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z", "clip-rule": "evenodd" })), h("input", { class: "mrd-layout-section__search-input", type: "text", value: query, placeholder: (_c = item.label) !== null && _c !== void 0 ? _c : '', onInput: e => this.handleSearchInput(dataClass, e.target.value) })), results.length > 0 && (h("ul", { class: "mrd-layout-section__search-results" }, results.map(r => (h("li", { key: r.id, class: "mrd-layout-section__search-result" }, h("button", { class: "mrd-layout-section__search-result-btn", onClick: () => this.mrdNavigate.emit({ href: r.id, label: r.label }) }, h("span", { class: "mrd-layout-section__search-result-label" }, r.label), r.description && h("span", { class: "mrd-layout-section__search-result-desc" }, r.description)))))))));
2538
3150
  }
2539
3151
  renderRelatedView(item) {
2540
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3152
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2541
3153
  const key = this.viewKeyFor(item);
2542
3154
  if (!key)
2543
3155
  return null;
@@ -2550,25 +3162,55 @@ const MrdLayoutSection = class {
2550
3162
  // The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
2551
3163
  // (sibling of `view`), not inside `view`.
2552
3164
  const docArchetype = resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, ARCHETYPE_DOCUMENT);
2553
- const mode = (_j = this.docViewMode[key]) !== null && _j !== void 0 ? _j : 'tree';
2554
- return (h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype && this.renderDocToolbar(key, mode), docArchetype && mode === 'tree'
2555
- ? this.renderDocumentList(item, key, parentId, docArchetype)
3165
+ // Canonical parent href for single-container seeding: use the RELATED_VIEW's
3166
+ // fromClass (base class) rather than the route class, so polymorphic subtypes
3167
+ // resolve to the same container the documents actually reference.
3168
+ const containerHref = this.buildContainerHref(item, selfHref, parentId);
3169
+ return (h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype
3170
+ ? this.renderDocumentContainer(item, key, parentId, docArchetype, containerHref)
2556
3171
  : this.renderTable(item, key, parentId)));
2557
3172
  }
2558
- /** Tree / list segmented toggle for document collection views (+ upload placeholder). */
2559
- renderDocToolbar(key, mode) {
2560
- return (h("div", { class: "mrd-layout-section__doc-toolbar" }, h("div", { class: "mrd-layout-section__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, h("button", { class: "mrd-layout-section__seg-btn", "aria-pressed": String(mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => { this.docViewMode = Object.assign(Object.assign({}, this.docViewMode), { [key]: 'tree' }); } }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 5h6M3 12h9M3 19h6" }), h("circle", { cx: "18", cy: "5", r: "1.6" }), h("circle", { cx: "18", cy: "19", r: "1.6" }), h("path", { d: "M16 12h4" }))), h("button", { class: "mrd-layout-section__seg-btn", "aria-pressed": String(mode === 'list'), title: t('doc_view_list', this.locale), "aria-label": t('doc_view_list', this.locale), onClick: () => { this.docViewMode = Object.assign(Object.assign({}, this.docViewMode), { [key]: 'list' }); } }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
2561
- }
2562
- renderDocumentList(item, key, parentId, archetype) {
2563
- return (h("mrd-document-list", { "data-doclist": key, item: item, archetype: archetype, parentId: parentId, locale: this.locale, onMrdLoadDistinct: (e) => {
3173
+ /** Build the canonical parent href `/{base}/{tenant}/{fromClass}/{parentId}` from
3174
+ * the object's self href. Empty unless it is a RELATED_VIEW with a fromClass. */
3175
+ buildContainerHref(item, selfHref, parentId) {
3176
+ if (item.type !== ClientLayoutItemType.RELATED_VIEW || !item.fromClass || !parentId)
3177
+ return '';
3178
+ const segs = selfHref.split('/').filter(Boolean);
3179
+ if (segs.length < 2)
3180
+ return '';
3181
+ const [base, tenant] = segs;
3182
+ return `/${base}/${tenant}/${item.fromClass}/${parentId}`;
3183
+ }
3184
+ /** Document collection view: owns the view-switch + collection actions and
3185
+ * swaps between the folder tree and the flat table. Events are re-emitted to
3186
+ * the host with the view key, exactly as the raw list/table events were. */
3187
+ renderDocumentContainer(item, key, parentId, archetype, containerHref) {
3188
+ return (h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
2564
3189
  e.stopPropagation();
2565
3190
  this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
2566
3191
  }, onMrdLoadPage: (e) => {
2567
3192
  e.stopPropagation();
2568
3193
  this.mrdLoadViewPage.emit(Object.assign({ name: key }, e.detail));
3194
+ }, onMrdLoadAggregations: (e) => {
3195
+ var _a;
3196
+ e.stopPropagation();
3197
+ this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
2569
3198
  }, onMrdNavigate: (e) => {
2570
3199
  e.stopPropagation();
2571
3200
  this.mrdNavigate.emit(e.detail);
3201
+ }, onMrdAction: (e) => {
3202
+ var _a;
3203
+ e.stopPropagation();
3204
+ this.mrdViewAction.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
3205
+ }, onMrdUpdateObject: (e) => {
3206
+ e.stopPropagation();
3207
+ this.mrdUpdateObject.emit(e.detail);
3208
+ }, onMrdUpload: (e) => {
3209
+ e.stopPropagation();
3210
+ this.mrdViewUpload.emit(Object.assign({ name: key }, e.detail));
3211
+ }, onMrdCreateObject: (e) => {
3212
+ e.stopPropagation();
3213
+ this.mrdCreateObject.emit(Object.assign({ name: key }, e.detail));
2572
3214
  } }));
2573
3215
  }
2574
3216
  renderTable(item, key, parentId) {
@@ -2639,7 +3281,7 @@ const MrdLayoutSection = class {
2639
3281
  }
2640
3282
  render() {
2641
3283
  const docArchetype = resolveArchetype(this.archetypes, ARCHETYPE_DOCUMENT);
2642
- return (h(Host, { key: '4fbba410f9b8cab2bf21497467f99ff25f109bcc' }, h("div", { key: '679d2c34f1eaff694873ba18d679cbccecdae1a6', class: "mrd-layout-section" }, docArchetype
3284
+ return (h(Host, { key: '231f5c3e282375b5850291611645fe3c904831bb' }, h("div", { key: '314e39ec3aa1eabeb1a98f6e6d63fcf07e13ccec', class: "mrd-layout-section" }, docArchetype
2643
3285
  ? this.renderDocumentObject(docArchetype)
2644
3286
  : this.items.map(item => this.renderItem(item))), this.renderImageModal()));
2645
3287
  }
@@ -2781,7 +3423,7 @@ const MrdLongtextField = class {
2781
3423
  }
2782
3424
  render() {
2783
3425
  const hasError = !!this.error;
2784
- return (h(Host, { key: '624be9369a37f0901ada13bd0e8a3bb8b40f54c8' }, h("div", { key: '6544e7b10af59a5628a119d5ea907fb968f21d42', class: "mrd-longtext-field" }, this.label && (h("label", { key: 'd56386e3fc2984b522bcbf5ec6908e044ed6f3d3', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (h("textarea", { class: `mrd-longtext-field__input${hasError ? ' mrd-longtext-field__input--error' : ''}`, name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), hasError && h("span", { key: '9423d70dec9c6439cc629746f1038a61a14da5e4', class: "mrd-longtext-field__error" }, this.error))));
3426
+ return (h(Host, { key: 'f00f81944748f8f09e22d44befe5e288456b7cc8' }, h("div", { key: '7b0ae9cf5b6b684cddb648fe4db6005494322535', class: "mrd-longtext-field" }, this.label && (h("label", { key: '3fc6a8710d0e98fe685c45d214a88ae1b0947973', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (h("textarea", { class: `mrd-longtext-field__input${hasError ? ' mrd-longtext-field__input--error' : ''}`, name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), hasError && h("span", { key: 'e96f1dbc6c00a1602f4ce3c97d514a229aeb7cb7', class: "mrd-longtext-field__error" }, this.error))));
2785
3427
  }
2786
3428
  };
2787
3429
  MrdLongtextField.style = mrdLongtextFieldScss();
@@ -2857,7 +3499,7 @@ const MrdNumberField = class {
2857
3499
  const hasError = !!this.error;
2858
3500
  const suffix = this.dataType === ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
2859
3501
  this.dataType === ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
2860
- return (h(Host, { key: '2c844e94a7cbb3fcf33f9552329443260e9490ab' }, h("div", { key: 'b87bdc2a17552e74b27d6da16e4db9bfd2f7e4ac', class: "mrd-number-field" }, this.label && (h("label", { key: '4aca381054b0ce27c94a9a7c779642d44dbbebcc', class: `mrd-number-field__label${this.required ? ' mrd-number-field__label--required' : ''}` }, this.label)), h("div", { key: 'b7e8d122bfbd92152ce44a7ba56222425eed73f9', class: "mrd-number-field__input-wrapper" }, h("input", { key: '906330075f0b8a50ff45344e865217fd1938f199', class: `mrd-number-field__input${hasError ? ' mrd-number-field__input--error' : ''}`, type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), hasError && h("span", { key: '5f56d6f2e0a878703f35d50b1932a39a82dace3b', class: "mrd-number-field__error" }, this.error))));
3502
+ return (h(Host, { key: 'b034a3cc8d841641c0ec167e138904586b044121' }, h("div", { key: '7379bfadb8bd0c4e0a945a37013053a4e22477ab', class: "mrd-number-field" }, this.label && (h("label", { key: '5518d40b7158e17704633c2b95ac7e3efc0c5568', class: `mrd-number-field__label${this.required ? ' mrd-number-field__label--required' : ''}` }, this.label)), h("div", { key: '38ad9f3c945d66c23bd77c743306e916eaefed7f', class: "mrd-number-field__input-wrapper" }, h("input", { key: 'ac8b4bc1ea4431cc9306664522ebfda21760ae83', class: `mrd-number-field__input${hasError ? ' mrd-number-field__input--error' : ''}`, type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), hasError && h("span", { key: '09f5a58b769c81acdf4bdd48f9325934c4bb875d', class: "mrd-number-field__error" }, this.error))));
2861
3503
  }
2862
3504
  };
2863
3505
  MrdNumberField.style = mrdNumberFieldScss();
@@ -3151,9 +3793,9 @@ const MrdSecretField = class {
3151
3793
  }
3152
3794
  render() {
3153
3795
  const hasError = !!this.error;
3154
- return (h(Host, { key: 'e0d516f7e76c1fab5441567cc371569a8eab07f8' }, h("div", { key: 'fac6fb517a0f37560429c828251f7db3841d3301', class: "mrd-secret-field" }, this.label && (h("label", { key: 'b2dd3189f2fcf3fd3feea741a39dbd5c3f4d437f', class: `mrd-secret-field__label${this.required ? ' mrd-secret-field__label--required' : ''}` }, this.label)), this.disabled
3796
+ return (h(Host, { key: 'c850ec5bc5967ca0aefca7d7cb65ecae121a9dc1' }, h("div", { key: '3249ffbc441422af054a20806dd8dfce954a8ffc', class: "mrd-secret-field" }, this.label && (h("label", { key: '0b4a86da9cafad32f153af1bc5487a4e9b941e2f', class: `mrd-secret-field__label${this.required ? ' mrd-secret-field__label--required' : ''}` }, this.label)), this.disabled
3155
3797
  ? (h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
3156
- : (h("input", { class: `mrd-secret-field__input${hasError ? ' mrd-secret-field__input--error' : ''}`, type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), hasError && h("span", { key: 'dbd6667d7f2c6ed26220ac83a46235cf3ad777d7', class: "mrd-secret-field__error" }, this.error))));
3798
+ : (h("input", { class: `mrd-secret-field__input${hasError ? ' mrd-secret-field__input--error' : ''}`, type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), hasError && h("span", { key: 'b0d0105f3d43d2e214f070b24e745dbce0e33977', class: "mrd-secret-field__error" }, this.error))));
3157
3799
  }
3158
3800
  };
3159
3801
  MrdSecretField.style = mrdSecretFieldScss();
@@ -4300,7 +4942,7 @@ const MrdTextField = class {
4300
4942
  }
4301
4943
  render() {
4302
4944
  const hasError = !!this.error;
4303
- return (h(Host, { key: '124c46a83d30993aed5045eda42134d5c28ec989' }, h("div", { key: '5497fab2938f875fe9b4cd539a9feaaf907007e1', class: "mrd-text-field" }, this.label && (h("label", { key: '4d43255f45de8e7c4596a211797403479d2240b6', class: `mrd-text-field__label${this.required ? ' mrd-text-field__label--required' : ''}` }, this.label)), h("input", { key: 'df3d61fc60e41731e9783dc4484f3c3ca3ea8b13', class: `mrd-text-field__input${hasError ? ' mrd-text-field__input--error' : ''}`, type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: '9bf08d3a77d7616674caf3325b6598490f2d50fc', class: "mrd-text-field__error" }, this.error))));
4945
+ return (h(Host, { key: 'e9252b251faf98ab190e643b97c13fa32d12ef22' }, h("div", { key: '37f4259a111c293f2fe12f321f08c00c25e77feb', class: "mrd-text-field" }, this.label && (h("label", { key: 'c59e0346fb71a765ea38629b03c06341567ed210', class: `mrd-text-field__label${this.required ? ' mrd-text-field__label--required' : ''}` }, this.label)), h("input", { key: 'dc09953a672472348719f29904d900966d945843', class: `mrd-text-field__input${hasError ? ' mrd-text-field__input--error' : ''}`, type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && h("span", { key: '037653857a372854a16b28ebf8994b23e3e0d696', class: "mrd-text-field__error" }, this.error))));
4304
4946
  }
4305
4947
  };
4306
4948
  MrdTextField.style = mrdTextFieldScss();
@@ -4374,7 +5016,7 @@ const MrdTextareaField = class {
4374
5016
  }
4375
5017
  }
4376
5018
  render() {
4377
- return (h(Host, { key: '2413906076dee3f48118d44574dadd36bcedadfe' }, h("div", { key: '59e369a54e906b09a1062c7c5f701b8bbd631479', class: "mrd-textarea-field" }, this.label && (h("label", { key: 'd400c499eb6e35581fc2af9d372917287fcc60eb', class: `mrd-textarea-field__label${this.required ? ' mrd-textarea-field__label--required' : ''}` }, this.label)), h("div", { key: '62765821b5280e71918db0d070a136ef07e1eecd', class: `mrd-textarea-field__container${this.error ? ' mrd-textarea-field__container--error' : ''}` }, h("div", { key: 'f41b73291542d4582c492bce0a89240a171aba32', class: "mrd-textarea-field__editor" })), this.error && h("span", { key: 'eaba5b735be7aa8deebfbc46eac03be970bb1d13', class: "mrd-textarea-field__error" }, this.error))));
5019
+ return (h(Host, { key: 'fe7824c81e082c3f2c1cf18c11dde20cb1f40f2c' }, h("div", { key: 'adf394a7e146d16bc79006873a209b11d88b2e17', class: "mrd-textarea-field" }, this.label && (h("label", { key: '1b0dd2b4cf26c55a0af05c67a3178edc0c9d56c4', class: `mrd-textarea-field__label${this.required ? ' mrd-textarea-field__label--required' : ''}` }, this.label)), h("div", { key: '7c8fe88b222af0beed08db492aa9f6d890e0dc5b', class: `mrd-textarea-field__container${this.error ? ' mrd-textarea-field__container--error' : ''}` }, h("div", { key: '295968283e94812cb04660117c5bdeaf3647469c', class: "mrd-textarea-field__editor" })), this.error && h("span", { key: '5b5ab61053ab0792d4c249de04bd1d13b51469bf', class: "mrd-textarea-field__error" }, this.error))));
4378
5020
  }
4379
5021
  get el() { return getElement(this); }
4380
5022
  };
@@ -4411,9 +5053,9 @@ const MrdTimeField = class {
4411
5053
  }
4412
5054
  render() {
4413
5055
  const hasError = !!this.error;
4414
- return (h(Host, { key: 'e93a6492a7bdc17f04f5aac0b8ecd63435a6280f' }, h("div", { key: 'b9692c11f21ccd354ba5475e1a60e6afc8ead22e', class: "mrd-time-field" }, this.label && (h("label", { key: '668492f16b6b96065fe65204a4f053c2ef2796e5', class: `mrd-time-field__label${this.required ? ' mrd-time-field__label--required' : ''}` }, this.label)), h("input", { key: 'bd2df39240c42b4a337554b0747c7b89eb5d8760', class: `mrd-time-field__input${hasError ? ' mrd-time-field__input--error' : ''}`, type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: '19a81211f3b630436a379f785768d28ffa01c12c', class: "mrd-time-field__error" }, this.error))));
5056
+ return (h(Host, { key: '579219a478e31325b5a676465807c1d936724a2b' }, h("div", { key: '51b25f6e083a29989505c0ad79edbcd3b0060736', class: "mrd-time-field" }, this.label && (h("label", { key: '67d98bebb8803deea2d2a4a63f36706789ccd8c7', class: `mrd-time-field__label${this.required ? ' mrd-time-field__label--required' : ''}` }, this.label)), h("input", { key: '734741e0db1bdd5886fef37bba3b2f8d7200a0ab', class: `mrd-time-field__input${hasError ? ' mrd-time-field__input--error' : ''}`, type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: '0dbd168d14966dc56a77c97cd8fd8f9b208a4bf5', class: "mrd-time-field__error" }, this.error))));
4415
5057
  }
4416
5058
  };
4417
5059
  MrdTimeField.style = mrdTimeFieldScss();
4418
5060
 
4419
- export { MrdBooleanField as mrd_boolean_field, MrdCurrencyField as mrd_currency_field, MrdDateField as mrd_date_field, MrdDatetimeField as mrd_datetime_field, MrdDocumentList as mrd_document_list, MrdDocumentView as mrd_document_view, MrdEmailField as mrd_email_field, MrdField as mrd_field, MrdFileField as mrd_file_field, MrdForm as mrd_form, MrdHyperlinkField as mrd_hyperlink_field, MrdImageField as mrd_image_field, MrdLayoutSection as mrd_layout_section, MrdListField as mrd_list_field, MrdLongtextField as mrd_longtext_field, MrdNumberField as mrd_number_field, MrdRelationField as mrd_relation_field, MrdSecretField as mrd_secret_field, MrdTable as mrd_table, MrdTextField as mrd_text_field, MrdTextareaField as mrd_textarea_field, MrdTimeField as mrd_time_field };
5061
+ export { MrdBooleanField as mrd_boolean_field, MrdCurrencyField as mrd_currency_field, MrdDateField as mrd_date_field, MrdDatetimeField as mrd_datetime_field, MrdDocumentContainer as mrd_document_container, MrdDocumentList as mrd_document_list, MrdDocumentView as mrd_document_view, MrdEmailField as mrd_email_field, MrdField as mrd_field, MrdFileField as mrd_file_field, MrdForm as mrd_form, MrdHyperlinkField as mrd_hyperlink_field, MrdImageField as mrd_image_field, MrdLayoutSection as mrd_layout_section, MrdListField as mrd_list_field, MrdLongtextField as mrd_longtext_field, MrdNumberField as mrd_number_field, MrdRelationField as mrd_relation_field, MrdSecretField as mrd_secret_field, MrdTable as mrd_table, MrdTextField as mrd_text_field, MrdTextareaField as mrd_textarea_field, MrdTimeField as mrd_time_field };