@mmlogic/components 0.3.8 → 0.3.9

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 (77) hide show
  1. package/dist/cjs/index.cjs.js +13 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  4. package/dist/cjs/{mrd-boolean-field_20.cjs.entry.js → mrd-boolean-field_22.cjs.entry.js} +504 -23
  5. package/dist/collection/collection-manifest.json +2 -0
  6. package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +1 -1
  7. package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +1 -1
  8. package/dist/collection/components/mrd-date-field/mrd-date-field.js +1 -1
  9. package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +1 -1
  10. package/dist/collection/components/mrd-document-list/mrd-document-list.js +578 -0
  11. package/dist/collection/components/mrd-document-list/mrd-document-list.scss +126 -0
  12. package/dist/collection/components/mrd-document-view/mrd-document-view.js +177 -0
  13. package/dist/collection/components/mrd-document-view/mrd-document-view.scss +121 -0
  14. package/dist/collection/components/mrd-email-field/mrd-email-field.js +1 -1
  15. package/dist/collection/components/mrd-file-field/mrd-file-field.js +1 -1
  16. package/dist/collection/components/mrd-image-field/mrd-image-field.js +1 -1
  17. package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +153 -15
  18. package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +46 -3
  19. package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +1 -1
  20. package/dist/collection/components/mrd-number-field/mrd-number-field.js +1 -1
  21. package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +2 -2
  22. package/dist/collection/components/mrd-text-field/mrd-text-field.js +1 -1
  23. package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +1 -1
  24. package/dist/collection/components/mrd-time-field/mrd-time-field.js +1 -1
  25. package/dist/collection/dev/app.js +19 -2
  26. package/dist/collection/types/client-layout.js +10 -0
  27. package/dist/collection/utils/i18n.js +24 -0
  28. package/dist/components/client-layout.js +1 -1
  29. package/dist/components/format.js +1 -1
  30. package/dist/components/i18n.js +1 -1
  31. package/dist/components/index.js +1 -1
  32. package/dist/components/mrd-boolean-field2.js +1 -1
  33. package/dist/components/mrd-currency-field2.js +1 -1
  34. package/dist/components/mrd-date-field2.js +1 -1
  35. package/dist/components/mrd-datetime-field2.js +1 -1
  36. package/dist/components/mrd-document-list.d.ts +11 -0
  37. package/dist/components/mrd-document-list.js +1 -0
  38. package/dist/components/mrd-document-list2.js +1 -0
  39. package/dist/components/mrd-document-view.d.ts +11 -0
  40. package/dist/components/mrd-document-view.js +1 -0
  41. package/dist/components/mrd-document-view2.js +1 -0
  42. package/dist/components/mrd-email-field2.js +1 -1
  43. package/dist/components/mrd-file-field2.js +1 -1
  44. package/dist/components/mrd-image-field2.js +1 -1
  45. package/dist/components/mrd-layout-section.js +1 -1
  46. package/dist/components/mrd-longtext-field2.js +1 -1
  47. package/dist/components/mrd-number-field2.js +1 -1
  48. package/dist/components/mrd-secret-field2.js +1 -1
  49. package/dist/components/mrd-table2.js +1 -1
  50. package/dist/components/mrd-text-field2.js +1 -1
  51. package/dist/components/mrd-textarea-field2.js +1 -1
  52. package/dist/components/mrd-time-field2.js +1 -1
  53. package/dist/esm/index.js +11 -1
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/mosterdcomponents.js +1 -1
  56. package/dist/esm/{mrd-boolean-field_20.entry.js → mrd-boolean-field_22.entry.js} +504 -25
  57. package/dist/mosterdcomponents/index.esm.js +1 -1
  58. package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
  59. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  60. package/dist/mosterdcomponents/p-b547291b.entry.js +1 -0
  61. package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +108 -0
  62. package/dist/types/components/mrd-document-view/mrd-document-view.d.ts +36 -0
  63. package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +33 -6
  64. package/dist/types/components.d.ts +290 -15
  65. package/dist/types/types/client-layout.d.ts +38 -0
  66. package/package.json +1 -1
  67. package/dist/mosterdcomponents/cell-renderer-CbRwLOo8.js.map +0 -1
  68. package/dist/mosterdcomponents/client-layout-D88nn5zf.js.map +0 -1
  69. package/dist/mosterdcomponents/format-BAfsQfy1.js.map +0 -1
  70. package/dist/mosterdcomponents/i18n-hoGGKbKU.js.map +0 -1
  71. package/dist/mosterdcomponents/index-6yQUNVww.js.map +0 -1
  72. package/dist/mosterdcomponents/index-I5SuYv7a.js.map +0 -1
  73. package/dist/mosterdcomponents/index.esm.js.map +0 -1
  74. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
  75. package/dist/mosterdcomponents/p-7bfaee51.entry.js +0 -1
  76. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
  77. package/dist/mosterdcomponents/validation-ixb43cqU.js.map +0 -1
@@ -29,7 +29,7 @@ const MrdBooleanField = class {
29
29
  this.checked = !!this.value;
30
30
  }
31
31
  render() {
32
- return (index.h(index.Host, { key: 'aed1d936d686870114a12aad9fc4cccb76ecd31e' }, index.h("div", { key: '5cc8aaa0f12d4195d02fce8a810d7d993e2e8c99', class: "mrd-boolean-field" }, index.h("label", { key: '41c3b3e0f01778fc2654ba86e3fe4e5a07c8537a', class: "mrd-boolean-field__toggle-label" }, index.h("input", { key: 'c261e6903e050d2f3d8df8abb90c74d99ed20161', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h("span", { key: '079ee220fe692536af15a7fb4286626102ae940e', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (index.h("span", { key: '1f4f52a41f0bd6ba4c61cf9d4db74ab2f1aa8877', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
32
+ return (index.h(index.Host, { key: '38e65a1c7971912f8259d09281b272d7cbd446f2' }, index.h("div", { key: 'e10919998731d744cc2a13130c5f355c9b8fc9aa', class: "mrd-boolean-field" }, index.h("label", { key: 'db85a2c80cc62fdfd25237e3f5c7750bf1666819', class: "mrd-boolean-field__toggle-label" }, index.h("input", { key: 'cddd7004593fa4671abb89f4f805c4a009db99ef', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h("span", { key: 'f90f0ed6d74d6688e51b8d85a5397a0597d95ad8', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (index.h("span", { key: '7e4582b1d9a5b08c00c220bec53baa6c14cbfe43', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
33
33
  }
34
34
  };
35
35
  MrdBooleanField.style = mrdBooleanFieldScss();
@@ -68,6 +68,9 @@ const translations = {
68
68
  table_filter_clear_all: 'Alle filters wissen',
69
69
  table_new_record: 'Nieuw record',
70
70
  table_export_excel: 'Exporteer naar Excel',
71
+ doc_view_switch: 'Weergave wisselen',
72
+ doc_view_tree: 'Boomweergave',
73
+ doc_view_list: 'Lijstweergave',
71
74
  // mrd-table filter popup
72
75
  filter_sorting: 'Sortering',
73
76
  filter_ascending: 'Oplopend',
@@ -131,6 +134,9 @@ const translations = {
131
134
  table_filter_clear_all: 'Clear all filters',
132
135
  table_new_record: 'New record',
133
136
  table_export_excel: 'Export to Excel',
137
+ doc_view_switch: 'Switch view',
138
+ doc_view_tree: 'Tree view',
139
+ doc_view_list: 'List view',
134
140
  // mrd-table filter popup
135
141
  filter_sorting: 'Sorting',
136
142
  filter_ascending: 'Ascending',
@@ -194,6 +200,9 @@ const translations = {
194
200
  table_filter_clear_all: 'مسح جميع الفلاتر',
195
201
  table_new_record: 'سجل جديد',
196
202
  table_export_excel: 'تصدير إلى Excel',
203
+ doc_view_switch: 'تبديل العرض',
204
+ doc_view_tree: 'عرض شجري',
205
+ doc_view_list: 'عرض القائمة',
197
206
  // mrd-table filter popup
198
207
  filter_sorting: 'الترتيب',
199
208
  filter_ascending: 'تصاعدي',
@@ -257,6 +266,9 @@ const translations = {
257
266
  table_filter_clear_all: 'Effacer tous les filtres',
258
267
  table_new_record: 'Nouvel enregistrement',
259
268
  table_export_excel: 'Exporter vers Excel',
269
+ doc_view_switch: 'Changer de vue',
270
+ doc_view_tree: 'Vue arborescente',
271
+ doc_view_list: 'Vue liste',
260
272
  // mrd-table filter popup
261
273
  filter_sorting: 'Tri',
262
274
  filter_ascending: 'Croissant',
@@ -320,6 +332,9 @@ const translations = {
320
332
  table_filter_clear_all: 'Alle Filter löschen',
321
333
  table_new_record: 'Neuer Eintrag',
322
334
  table_export_excel: 'Als Excel exportieren',
335
+ doc_view_switch: 'Ansicht wechseln',
336
+ doc_view_tree: 'Baumansicht',
337
+ doc_view_list: 'Listenansicht',
323
338
  // mrd-table filter popup
324
339
  filter_sorting: 'Sortierung',
325
340
  filter_ascending: 'Aufsteigend',
@@ -383,6 +398,9 @@ const translations = {
383
398
  table_filter_clear_all: 'Borrar todos los filtros',
384
399
  table_new_record: 'Nuevo registro',
385
400
  table_export_excel: 'Exportar a Excel',
401
+ doc_view_switch: 'Cambiar vista',
402
+ doc_view_tree: 'Vista de árbol',
403
+ doc_view_list: 'Vista de lista',
386
404
  // mrd-table filter popup
387
405
  filter_sorting: 'Ordenación',
388
406
  filter_ascending: 'Ascendente',
@@ -446,6 +464,9 @@ const translations = {
446
464
  table_filter_clear_all: 'Cancella tutti i filtri',
447
465
  table_new_record: 'Nuovo record',
448
466
  table_export_excel: 'Esporta in Excel',
467
+ doc_view_switch: 'Cambia vista',
468
+ doc_view_tree: 'Vista ad albero',
469
+ doc_view_list: 'Vista elenco',
449
470
  // mrd-table filter popup
450
471
  filter_sorting: 'Ordinamento',
451
472
  filter_ascending: 'Crescente',
@@ -509,6 +530,9 @@ const translations = {
509
530
  table_filter_clear_all: 'Очистити всі фільтри',
510
531
  table_new_record: 'Новий запис',
511
532
  table_export_excel: 'Експортувати до Excel',
533
+ doc_view_switch: 'Змінити вигляд',
534
+ doc_view_tree: 'Деревоподібний вигляд',
535
+ doc_view_list: 'Список',
512
536
  // mrd-table filter popup
513
537
  filter_sorting: 'Сортування',
514
538
  filter_ascending: 'За зростанням',
@@ -721,7 +745,7 @@ const MrdCurrencyField = class {
721
745
  }
722
746
  render() {
723
747
  const hasError = !!this.error;
724
- return (index.h(index.Host, { key: 'd3450e9c26b1a755d3e6a5a3561d93b2ac566a28' }, index.h("div", { key: 'b66942cc1953daff728504deef8a9cc1330ef549', class: "mrd-currency-field" }, this.label && (index.h("label", { key: '3d3f2f06e9ffea944552f0f7cf3150d0246c54f0', class: `mrd-currency-field__label${this.required ? ' mrd-currency-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'd30a2adfceefdbefef2d4fe6633a163a753b15d0', class: "mrd-currency-field__row" }, index.h("input", { key: '9af09b19b6cbe24498d6ca8edf7b28f675afdec5', class: `mrd-currency-field__amount${hasError ? ' mrd-currency-field__amount--error' : ''}`, type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), index.h("select", { key: '21e55b04b7bf16586b5cfaa82d77db45c6dedf21', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (index.h("option", { key: c, value: c, selected: c === this.currency }, c))))), hasError && index.h("span", { key: '7a0006d4230557cf9c58f82f21de73b5d12f7e17', class: "mrd-currency-field__error" }, this.error))));
748
+ return (index.h(index.Host, { key: 'fe3520c44d831caf36b388cb5968a9518b16cb8b' }, index.h("div", { key: '50c1fd2d53038e46da575d3e46e1ec26c2da423b', class: "mrd-currency-field" }, this.label && (index.h("label", { key: 'a2649d41bf6e3765c8a62ba6559c64c41615027a', class: `mrd-currency-field__label${this.required ? ' mrd-currency-field__label--required' : ''}` }, this.label)), index.h("div", { key: '952b51f315b4a5c05a8373ce3a3f1041086ba8b8', class: "mrd-currency-field__row" }, index.h("input", { key: '137a72ffc5d79fc8e0a8cf44c012d84a50c26d5b', class: `mrd-currency-field__amount${hasError ? ' mrd-currency-field__amount--error' : ''}`, type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), index.h("select", { key: '1755854ca9b76dc4b41ad84b6b788685931ace36', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (index.h("option", { key: c, value: c, selected: c === this.currency }, c))))), hasError && index.h("span", { key: '0f10eb98c2e6444651d79d1de92acd0dbcc7133b', class: "mrd-currency-field__error" }, this.error))));
725
749
  }
726
750
  };
727
751
  MrdCurrencyField.style = mrdCurrencyFieldScss();
@@ -757,7 +781,7 @@ const MrdDateField = class {
757
781
  }
758
782
  render() {
759
783
  const hasError = !!this.error;
760
- return (index.h(index.Host, { key: '84c777fc68a95e0b1ceb08d61e3af7afa199ce94' }, index.h("div", { key: '6653d94ab79c74342ce792792547018e4464a814', class: "mrd-date-field" }, this.label && (index.h("label", { key: '2fa7b7ec50c784f9410ca48b93d50e39dc6e0bee', class: `mrd-date-field__label${this.required ? ' mrd-date-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'f79ebbaf0e28ad7668a5400d1df514b66457b72d', class: `mrd-date-field__input${hasError ? ' mrd-date-field__input--error' : ''}`, type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: 'e52f0b720d76e8ba0586fb40395b6875860762db', class: "mrd-date-field__error" }, this.error))));
784
+ return (index.h(index.Host, { key: '2c0dc2311068a5c759fe8efe58a98a71a9cf4b7b' }, index.h("div", { key: 'ee1cc0e9a2943cc42439825b8f21cd3492eaca05', class: "mrd-date-field" }, this.label && (index.h("label", { key: '3f836a991e676b6070a8b3800edfce00cc0d3b3d', class: `mrd-date-field__label${this.required ? ' mrd-date-field__label--required' : ''}` }, this.label)), index.h("input", { key: '575185661987eea3dc91950f51995b2cc75debea', class: `mrd-date-field__input${hasError ? ' mrd-date-field__input--error' : ''}`, type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: '480ec99200989f3dc543d9afc648d83d31992b3c', class: "mrd-date-field__error" }, this.error))));
761
785
  }
762
786
  };
763
787
  MrdDateField.style = mrdDateFieldScss();
@@ -820,7 +844,7 @@ const MrdDatetimeField = class {
820
844
  }
821
845
  render() {
822
846
  const hasError = !!this.error;
823
- return (index.h(index.Host, { key: '6052b08238484bee345ae4bb9b3025c7f2474c35' }, index.h("div", { key: 'f9073be4496e35a7d40405ae4e6a27a5c1607626', class: "mrd-datetime-field" }, this.label && (index.h("label", { key: '5933c3b2dfcae9bfad378441210ada6b625657a2', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), index.h("input", { key: '7a947b104c38960d2326a4877e4ca52db9fd9d84', class: `mrd-datetime-field__input${hasError ? ' mrd-datetime-field__input--error' : ''}`, type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: 'cea3dba7e14e18a3a08394ef3027b661f1808969', class: "mrd-datetime-field__error" }, this.error))));
847
+ return (index.h(index.Host, { key: 'ea8b3b68100ffdb316bc5048f82d85d238bb2e4b' }, index.h("div", { key: 'c192c6998ee474aaf4df7b3b97ae0bd61f6d624d', class: "mrd-datetime-field" }, this.label && (index.h("label", { key: '1fbd66c17d76508f0d698a2c258be6779e98d85e', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'fc9612c062a1cab5076a06598cabf227adce996c', class: `mrd-datetime-field__input${hasError ? ' mrd-datetime-field__input--error' : ''}`, type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: '8788ac01739302f6ad61010b238ff38d45e1b68a', class: "mrd-datetime-field__error" }, this.error))));
824
848
  }
825
849
  static get watchers() { return {
826
850
  "value": [{
@@ -830,6 +854,402 @@ const MrdDatetimeField = class {
830
854
  };
831
855
  MrdDatetimeField.style = mrdDatetimeFieldScss();
832
856
 
857
+ 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)}`;
858
+
859
+ const MrdDocumentList = class {
860
+ constructor(hostRef) {
861
+ index.registerInstance(this, hostRef);
862
+ this.mrdLoadDistinct = index.createEvent(this, "mrdLoadDistinct");
863
+ this.mrdLoadPage = index.createEvent(this, "mrdLoadPage");
864
+ this.mrdNavigate = index.createEvent(this, "mrdNavigate");
865
+ /** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
866
+ this.item = null;
867
+ /** Parent record id — required for RELATED_VIEW path building. */
868
+ this.parentId = '';
869
+ this.locale = navigator.language;
870
+ this.containers = [];
871
+ this.rootLoading = true;
872
+ /** True when the single-container level is collapsed away (dossier context). */
873
+ this.singleContainer = false;
874
+ this.nodeIndex = new Map();
875
+ }
876
+ componentDidLoad() {
877
+ this.emitContainerDistinct();
878
+ }
879
+ // ── Slot field names ─────────────────────────────────────────────────────
880
+ get containerField() {
881
+ var _a, _b, _c;
882
+ return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : 'container';
883
+ }
884
+ get folderField() {
885
+ var _a, _b, _c;
886
+ return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.folder) !== null && _c !== void 0 ? _c : 'folder';
887
+ }
888
+ get titleField() {
889
+ var _a, _b, _c;
890
+ 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';
891
+ }
892
+ get dateField() {
893
+ var _a, _b;
894
+ return (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.date;
895
+ }
896
+ // ── Path / query building (mirrors mrd-table conventions) ────────────────
897
+ /** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`. */
898
+ buildDataPath() {
899
+ var _a, _b, _c;
900
+ const it = this.item;
901
+ const dataClass = (_b = (_a = it === null || it === void 0 ? void 0 : it.dataClass) !== null && _a !== void 0 ? _a : it === null || it === void 0 ? void 0 : it.relatedClass) !== null && _b !== void 0 ? _b : '';
902
+ if ((it === null || it === void 0 ? void 0 : it.type) === index$1.ClientLayoutItemType.RELATED_VIEW) {
903
+ return `/${(_c = it.fromClass) !== null && _c !== void 0 ? _c : ''}/${this.parentId}/${dataClass}`;
904
+ }
905
+ return `/${dataClass}`;
906
+ }
907
+ /** View-level static filters + filterClass, shared by every request. */
908
+ baseParams() {
909
+ var _a, _b, _c, _d, _e, _f, _g;
910
+ const p = new URLSearchParams();
911
+ const filterClass = (_a = this.item) === null || _a === void 0 ? void 0 : _a.filterClass;
912
+ if (filterClass)
913
+ p.set('type', filterClass);
914
+ for (const f of ((_d = (_c = (_b = this.item) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.filter) !== null && _d !== void 0 ? _d : [])) {
915
+ if (!f.name)
916
+ continue;
917
+ if (f.operator === 'EMPTY') {
918
+ p.set(f.name, '');
919
+ continue;
920
+ }
921
+ if (f.operator === 'NOT_EMPTY') {
922
+ p.set(f.name + '_notempty', 'true');
923
+ continue;
924
+ }
925
+ if (f.operator === 'STARTS_WITH') {
926
+ p.set(f.name + '_startswith', String((_e = f.value) !== null && _e !== void 0 ? _e : ''));
927
+ continue;
928
+ }
929
+ if (f.operator === 'FROM') {
930
+ p.set(f.name + '_from', String((_f = f.value) !== null && _f !== void 0 ? _f : ''));
931
+ continue;
932
+ }
933
+ if (f.operator === 'TO') {
934
+ p.set(f.name + '_to', String((_g = f.value) !== null && _g !== void 0 ? _g : ''));
935
+ continue;
936
+ }
937
+ if (f.value != null) {
938
+ p.set(f.name, String(f.value));
939
+ }
940
+ }
941
+ return p;
942
+ }
943
+ emitContainerDistinct() {
944
+ const p = this.baseParams();
945
+ p.set('distinct', this.containerField);
946
+ this.mrdLoadDistinct.emit({
947
+ nodeId: MrdDocumentList.ROOT,
948
+ distinct: this.containerField,
949
+ path: this.buildDataPath() + '/distinct',
950
+ qs: p.toString(),
951
+ });
952
+ }
953
+ emitFolderDistinct(container) {
954
+ var _a;
955
+ const p = this.baseParams();
956
+ p.set('distinct', this.folderField);
957
+ p.set(this.containerField + '_href', (_a = container.href) !== null && _a !== void 0 ? _a : '');
958
+ container.loading = true;
959
+ this.mrdLoadDistinct.emit({
960
+ nodeId: container.id,
961
+ distinct: this.folderField,
962
+ path: this.buildDataPath() + '/distinct',
963
+ qs: p.toString(),
964
+ });
965
+ }
966
+ emitDocuments(container, node) {
967
+ var _a, _b;
968
+ const p = this.baseParams();
969
+ p.set(this.containerField + '_href', (_a = container.href) !== null && _a !== void 0 ? _a : '');
970
+ p.set(this.folderField, (_b = node.fullPath) !== null && _b !== void 0 ? _b : '');
971
+ node.loading = true;
972
+ this.mrdLoadPage.emit({
973
+ nodeId: node.id,
974
+ page: 0,
975
+ sort: '',
976
+ path: this.buildDataPath(),
977
+ qs: p.toString(),
978
+ });
979
+ }
980
+ // ── Public injection API ─────────────────────────────────────────────────
981
+ /** Inject distinct values for a node. `nodeId` is the sentinel root (containers)
982
+ * or a container node id (folders). */
983
+ async setDistinct(nodeId, values) {
984
+ if (nodeId === MrdDocumentList.ROOT) {
985
+ this.applyContainers(values);
986
+ }
987
+ else {
988
+ this.applyFolders(nodeId, values);
989
+ }
990
+ }
991
+ /** Inject the documents loaded for one folder node. */
992
+ async setDocuments(nodeId, docs) {
993
+ const node = this.nodeIndex.get(nodeId);
994
+ if (!node)
995
+ return;
996
+ node.docs = docs !== null && docs !== void 0 ? docs : [];
997
+ node.docsLoaded = true;
998
+ node.loading = false;
999
+ this.bump();
1000
+ }
1001
+ applyContainers(values) {
1002
+ const nodes = [];
1003
+ for (const v of values) {
1004
+ if (!v.value || typeof v.value !== 'object')
1005
+ continue;
1006
+ const href = v.value.href;
1007
+ const node = this.makeContainerNode(href, v.value.name, v.count);
1008
+ nodes.push(node);
1009
+ this.nodeIndex.set(node.id, node);
1010
+ }
1011
+ this.containers = nodes;
1012
+ this.rootLoading = false;
1013
+ this.singleContainer = nodes.length === 1;
1014
+ // Single container (dossier context): collapse the level away, load its folders now.
1015
+ if (this.singleContainer) {
1016
+ const only = nodes[0];
1017
+ only.open = true;
1018
+ this.emitFolderDistinct(only);
1019
+ }
1020
+ }
1021
+ applyFolders(containerId, values) {
1022
+ const container = this.nodeIndex.get(containerId);
1023
+ if (!container)
1024
+ return;
1025
+ container.children = [];
1026
+ container.hasDocs = false;
1027
+ container.docCount = 0;
1028
+ for (const v of values) {
1029
+ const raw = typeof v.value === 'string' ? v.value : v.value == null ? '' : String(v.value);
1030
+ const segs = this.splitFolder(raw);
1031
+ if (segs.length === 0) {
1032
+ // Root documents — the container's own direct documents.
1033
+ container.hasDocs = true;
1034
+ container.docCount = v.count;
1035
+ container.fullPath = raw;
1036
+ continue;
1037
+ }
1038
+ let node = container;
1039
+ const acc = [];
1040
+ for (const seg of segs) {
1041
+ acc.push(seg);
1042
+ let child = node.children.find(c => c.label === seg);
1043
+ if (!child) {
1044
+ child = this.makeFolderNode(container.id + '/' + acc.join('/'), seg);
1045
+ node.children.push(child);
1046
+ this.nodeIndex.set(child.id, child);
1047
+ }
1048
+ node = child;
1049
+ }
1050
+ node.hasDocs = true;
1051
+ node.docCount = v.count;
1052
+ node.fullPath = raw;
1053
+ }
1054
+ this.computeTotals(container);
1055
+ container.foldersLoaded = true;
1056
+ container.loading = false;
1057
+ // If the container has root documents, load them now (they show inline on expand).
1058
+ if (container.hasDocs && !container.docsLoaded) {
1059
+ this.emitDocuments(container, container);
1060
+ }
1061
+ this.bump();
1062
+ }
1063
+ // ── Tree helpers ─────────────────────────────────────────────────────────
1064
+ /** Normalise a folder path: null/""/"/" → root ([]); else split on "/" dropping empties. */
1065
+ splitFolder(path) {
1066
+ if (path == null)
1067
+ return [];
1068
+ const s = String(path).trim();
1069
+ if (s === '' || s === '/')
1070
+ return [];
1071
+ return s.split('/').map(x => x.trim()).filter(Boolean);
1072
+ }
1073
+ makeContainerNode(href, label, count) {
1074
+ return {
1075
+ id: 'c:' + href, kind: 'container', label, href,
1076
+ hasDocs: false, docCount: 0, totalCount: count, children: [],
1077
+ open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
1078
+ };
1079
+ }
1080
+ makeFolderNode(id, label) {
1081
+ return {
1082
+ id, kind: 'folder', label,
1083
+ hasDocs: false, docCount: 0, totalCount: 0, children: [],
1084
+ open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
1085
+ };
1086
+ }
1087
+ computeTotals(node) {
1088
+ let total = node.docCount;
1089
+ for (const c of node.children)
1090
+ total += this.computeTotals(c);
1091
+ node.totalCount = total;
1092
+ return total;
1093
+ }
1094
+ /** Force a re-render after mutating nodes in place. */
1095
+ bump() {
1096
+ this.containers = [...this.containers];
1097
+ }
1098
+ // ── Interaction ──────────────────────────────────────────────────────────
1099
+ toggleContainer(node) {
1100
+ node.open = !node.open;
1101
+ if (node.open && !node.foldersLoaded && !node.loading) {
1102
+ this.emitFolderDistinct(node);
1103
+ }
1104
+ this.bump();
1105
+ }
1106
+ toggleFolder(container, node) {
1107
+ node.open = !node.open;
1108
+ if (node.open && node.hasDocs && !node.docsLoaded && !node.loading) {
1109
+ this.emitDocuments(container, node);
1110
+ }
1111
+ this.bump();
1112
+ }
1113
+ openDoc(doc) {
1114
+ var _a, _b, _c, _d;
1115
+ 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;
1116
+ const label = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc[this.titleField]) !== null && _c !== void 0 ? _c : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _d !== void 0 ? _d : '';
1117
+ this.mrdNavigate.emit({ href, label });
1118
+ }
1119
+ // ── Render ───────────────────────────────────────────────────────────────
1120
+ renderChevron(open, leaf) {
1121
+ return (index.h("span", { class: `mrd-document-list__chev${leaf ? ' mrd-document-list__chev--leaf' : ''}${open ? ' mrd-document-list__chev--open' : ''}` }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M9 6l6 6-6 6" }))));
1122
+ }
1123
+ renderDossierIcon() {
1124
+ return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--dossier", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.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" })));
1125
+ }
1126
+ renderFolderIcon() {
1127
+ return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--folder", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.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" })));
1128
+ }
1129
+ renderDocIcon() {
1130
+ return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--doc", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("path", { d: "M14 2v6h6" })));
1131
+ }
1132
+ indent(depth) {
1133
+ return index.h("span", { class: "mrd-document-list__indent", style: { width: `${depth * 18}px` } });
1134
+ }
1135
+ renderDocRow(doc, depth) {
1136
+ var _a, _b, _c, _d, _e;
1137
+ 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 : '';
1138
+ const dateRaw = this.dateField ? doc === null || doc === void 0 ? void 0 : doc[this.dateField] : undefined;
1139
+ const date = dateRaw ? formatDate(dateRaw, this.locale) : '';
1140
+ return (index.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(), index.h("span", { class: "mrd-document-list__label" }, label), date && index.h("span", { class: "mrd-document-list__date" }, date)));
1141
+ }
1142
+ renderLoadingRow(depth) {
1143
+ return (index.h("div", { class: "mrd-document-list__loading", key: "loading" }, this.indent(depth), index.h("span", { class: "mrd-document-list__spinner" }), t('loading', this.locale)));
1144
+ }
1145
+ renderChildren(container, node, depth) {
1146
+ const out = [];
1147
+ // Direct documents of this node (root docs live on the container node).
1148
+ if (node.hasDocs) {
1149
+ if (node.docsLoaded) {
1150
+ for (const doc of node.docs)
1151
+ out.push(this.renderDocRow(doc, depth));
1152
+ }
1153
+ else if (node.loading) {
1154
+ out.push(this.renderLoadingRow(depth));
1155
+ }
1156
+ }
1157
+ // Child folders.
1158
+ for (const child of node.children) {
1159
+ out.push(this.renderFolderNode(container, child, depth));
1160
+ }
1161
+ return out;
1162
+ }
1163
+ renderFolderNode(container, node, depth) {
1164
+ const leaf = node.children.length === 0 && !node.hasDocs;
1165
+ return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: "mrd-document-list__row", onClick: () => this.toggleFolder(container, node) }, this.indent(depth), this.renderChevron(node.open, leaf), this.renderFolderIcon(), index.h("span", { class: "mrd-document-list__label" }, node.label), index.h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && index.h("div", { class: "mrd-document-list__kids" }, this.renderChildren(container, node, depth + 1))));
1166
+ }
1167
+ renderContainerNode(node, depth) {
1168
+ return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.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(), index.h("span", { class: "mrd-document-list__label" }, node.label), index.h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && (index.h("div", { class: "mrd-document-list__kids" }, node.loading && !node.foldersLoaded
1169
+ ? this.renderLoadingRow(depth + 1)
1170
+ : this.renderChildren(node, node, depth + 1)))));
1171
+ }
1172
+ render() {
1173
+ let body;
1174
+ if (this.rootLoading) {
1175
+ body = this.renderLoadingRow(0);
1176
+ }
1177
+ else if (this.containers.length === 0) {
1178
+ body = index.h("div", { key: '0c4190bb86543e2d37cc1584b3495eb6eab5664c', class: "mrd-document-list__empty" }, t('no_results', this.locale));
1179
+ }
1180
+ else if (this.singleContainer) {
1181
+ // Dossier context: render the single container's folder tree at the root.
1182
+ const only = this.containers[0];
1183
+ body = only.loading && !only.foldersLoaded
1184
+ ? this.renderLoadingRow(0)
1185
+ : this.renderChildren(only, only, 0);
1186
+ }
1187
+ else {
1188
+ body = this.containers.map(c => this.renderContainerNode(c, 0));
1189
+ }
1190
+ return (index.h(index.Host, { key: '4e38d9ef5a1df137a41516a47dc5debbea6b2f35' }, index.h("div", { key: '6d2f162624e5bbc8650a2978a3b045c21fe13ea3', class: "mrd-document-list" }, body)));
1191
+ }
1192
+ get el() { return index.getElement(this); }
1193
+ };
1194
+ /** Root sentinel id for the container-level distinct request. */
1195
+ MrdDocumentList.ROOT = '__root__';
1196
+ MrdDocumentList.style = mrdDocumentListScss();
1197
+
1198
+ const mrdDocumentViewScss = () => `.sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:720px}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);padding:var(--mrd-space-4);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50);margin-bottom:var(--mrd-space-6)}.mrd-document-view__file-preview.sc-mrd-document-view{width:2.875rem;height:3.625rem;flex-shrink:0;display:grid;place-items:center;border-radius:var(--mrd-border-radius-sm);background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);color:var(--mrd-color-danger);box-shadow:var(--mrd-shadow-sm)}.mrd-document-view__file-preview.sc-mrd-document-view svg.sc-mrd-document-view{width:1.5rem;height:1.5rem}.mrd-document-view__file-meta.sc-mrd-document-view{flex:1;min-width:0}.mrd-document-view__file-name.sc-mrd-document-view{font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);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);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}`;
1199
+
1200
+ const MrdDocumentView = class {
1201
+ constructor(hostRef) {
1202
+ index.registerInstance(this, hostRef);
1203
+ this.mrdNavigate = index.createEvent(this, "mrdNavigate");
1204
+ this.mrdDownload = index.createEvent(this, "mrdDownload");
1205
+ /** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
1206
+ this.data = {};
1207
+ this.locale = navigator.language;
1208
+ }
1209
+ /** Value of a value-slot: reads data[field] via the slot→field map. */
1210
+ slotValue(slot) {
1211
+ var _a, _b;
1212
+ const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
1213
+ if (!field)
1214
+ return undefined;
1215
+ return this.data[field];
1216
+ }
1217
+ /** Relation link for a relation-slot: reads data._links[field]. */
1218
+ slotLink(slot) {
1219
+ var _a, _b, _c, _d;
1220
+ const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
1221
+ if (!field)
1222
+ return undefined;
1223
+ const links = ((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c._links) !== null && _d !== void 0 ? _d : {});
1224
+ return links[field];
1225
+ }
1226
+ renderContainer() {
1227
+ const link = this.slotLink('container');
1228
+ if (!(link === null || link === void 0 ? void 0 : link.href) || !link.name)
1229
+ return null;
1230
+ return (index.h("button", { class: "mrd-document-view__crumb", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, index.h("svg", { class: "mrd-document-view__crumb-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M19 12H5M12 19l-7-7 7-7" })), link.name));
1231
+ }
1232
+ renderFile() {
1233
+ var _a, _b;
1234
+ const raw = this.slotValue('file');
1235
+ if (!raw)
1236
+ return null;
1237
+ const href = (_a = raw === null || raw === void 0 ? void 0 : raw.href) !== null && _a !== void 0 ? _a : '';
1238
+ const fileName = (_b = raw === null || raw === void 0 ? void 0 : raw.fileName) !== null && _b !== void 0 ? _b : String(raw);
1239
+ return (index.h("div", { class: "mrd-document-view__file" }, index.h("div", { class: "mrd-document-view__file-preview", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, index.h("path", { d: "M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6H6zm7 1.5L18.5 9H13V3.5z" }))), index.h("div", { class: "mrd-document-view__file-meta" }, index.h("span", { class: "mrd-document-view__file-name" }, fileName)), href && (index.h("button", { class: "mrd-document-view__download", onClick: () => this.mrdDownload.emit({ href, fileName }) }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 21h16" })), t('download', this.locale)))));
1240
+ }
1241
+ render() {
1242
+ const titleRaw = this.slotValue('title');
1243
+ const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
1244
+ const dateRaw = this.slotValue('date');
1245
+ const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
1246
+ const summaryRaw = this.slotValue('summary');
1247
+ const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
1248
+ return (index.h(index.Host, { key: 'b6c2dbc45d5cfe551ac16b43b1a152a0d793b794' }, index.h("div", { key: 'df70848b4aa54ea414ea5d577a600779ee002b13', class: "mrd-document-view" }, this.renderContainer(), title && index.h("h1", { key: '46ff550fccd6de02972c6ee77b3cd5e7e394481a', class: "mrd-document-view__title" }, title), date && index.h("p", { key: '501c75cfc78722bd486d4a1db366675a1c519264', class: "mrd-document-view__date" }, date), this.renderFile(), summary && (index.h("div", { key: 'ee4475d06e5ca81a760e0c9e1e4b5f32ed894d89', class: "mrd-document-view__summary" }, index.h("div", { key: '9d196abdcc56b84b2b07203d7e5167be196a342a', class: "mrd-document-view__summary-body", innerHTML: summary }))))));
1249
+ }
1250
+ };
1251
+ MrdDocumentView.style = mrdDocumentViewScss();
1252
+
833
1253
  const mrdEmailFieldScss = () => `.sc-mrd-email-field-h{display:block}.mrd-email-field.sc-mrd-email-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-email-field__label.sc-mrd-email-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-email-field__label--required.sc-mrd-email-field::after{content:' *';color:var(--mrd-color-danger)}.mrd-email-field__input.sc-mrd-email-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);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);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-email-field__input.sc-mrd-email-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-email-field__input.sc-mrd-email-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-email-field__input.sc-mrd-email-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-email-field__input--error.sc-mrd-email-field{border-color:var(--mrd-border-color-error)}.mrd-email-field__input--error.sc-mrd-email-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-email-field__error.sc-mrd-email-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}`;
834
1254
 
835
1255
  const MrdEmailField = class {
@@ -865,7 +1285,7 @@ const MrdEmailField = class {
865
1285
  }
866
1286
  render() {
867
1287
  const hasError = !!this.error;
868
- return (index.h(index.Host, { key: '851ec092957ab86e811b292eaabe29d04a600fe0' }, index.h("div", { key: '2d8969d60378f3161656369494549d682de8ec0e', class: "mrd-email-field" }, this.label && (index.h("label", { key: '7a35cc60d4804097e1a54f984c7da1829f6bbd11', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), index.h("input", { key: '1fc20e860aa021886f7ed522c3a0c8dd2cb1e093', 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 && index.h("span", { key: 'a44b3b41b7cd6b8c643cc64e6aadd884a2ba4961', class: "mrd-email-field__error" }, this.error))));
1288
+ return (index.h(index.Host, { key: 'bf888feadb6585a845f6d610165e192e342be5d2' }, index.h("div", { key: 'ab43101242a92df1643d218c0d35bb7b80452fef', class: "mrd-email-field" }, this.label && (index.h("label", { key: '854c9bd733f5803616ab8b70f0316a7a8a82ffd4', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), index.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 && index.h("span", { key: 'c5881e21a2314e5d339464b16982add69be9f68a', class: "mrd-email-field__error" }, this.error))));
869
1289
  }
870
1290
  };
871
1291
  MrdEmailField.style = mrdEmailFieldScss();
@@ -1148,7 +1568,7 @@ const MrdFileField = class {
1148
1568
  hasError ? 'mrd-file-field__zone--error' : '',
1149
1569
  this.disabled || this.uploading ? 'mrd-file-field__zone--disabled' : '',
1150
1570
  ].filter(Boolean).join(' ');
1151
- return (index.h(index.Host, { key: '2090102df8169226c1e66f87cbc837296e4b55d4' }, index.h("div", { key: '7a37a09df1bfa2eaf28ed04c806ad5f7c0337bb0', class: "mrd-file-field" }, this.label && (index.h("label", { key: '8f1fcb8adbb66b792be902c7c548e50db99b6a53', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), index.h("div", { key: '66d992298f537b24d69ce3ead3dd229f6d124f3d', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("input", { key: '95ba6560e71ee08c6b2526802727b29a18cdc454', 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 ? (index.h("div", { class: "mrd-file-field__selected" }, this.uploading ? (index.h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (index.h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("polyline", { points: "14 2 14 8 20 8" }))), index.h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (index.h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: 'a6020e63bebb01e31a980a903f81badd486585aa', class: "mrd-file-field__error" }, this.error))));
1571
+ return (index.h(index.Host, { key: '424a55ff5c141a51ed2e253a126e0046808cf1b1' }, index.h("div", { key: '49407e31c019a27bbaa3ccbc81cd4597d992d03a', class: "mrd-file-field" }, this.label && (index.h("label", { key: '0477b203f2b8df03cf9d11153bc547e9490800f7', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'aff3e5f258cfa8320150048af0b0087081cbbc13', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.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 ? (index.h("div", { class: "mrd-file-field__selected" }, this.uploading ? (index.h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (index.h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("polyline", { points: "14 2 14 8 20 8" }))), index.h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (index.h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: 'b67b7770e194843a1b75caaff807ea14d62eba6a', class: "mrd-file-field__error" }, this.error))));
1152
1572
  }
1153
1573
  static get watchers() { return {
1154
1574
  "value": [{
@@ -1709,7 +2129,7 @@ const MrdImageField = class {
1709
2129
  hasError ? 'mrd-image-field__zone--error' : '',
1710
2130
  this.disabled || this.uploading ? 'mrd-image-field__zone--disabled' : '',
1711
2131
  ].filter(Boolean).join(' ');
1712
- return (index.h(index.Host, { key: '71be4c1df559cff87280cac30be58beab3149064' }, index.h("div", { key: '9d0811d87068ce258aca9b2c5223a5594af9f6a3', class: "mrd-image-field" }, this.label && (index.h("label", { key: '63e129db968a2edfcc04fcac466d908ba4715158', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'c7e560ad4dda43499707a2d1771a8eb561653a1b', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("input", { key: 'd325ee1aa3baccd689cc579e4cfa21abe977a575', 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 ? (index.h("div", { class: "mrd-image-field__preview-container" }, index.h("div", { class: "mrd-image-field__preview-thumb" }, index.h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && index.h("div", { class: "mrd-image-field__preview-overlay" }, index.h("span", { class: "mrd-image-field__spinner" }))), index.h("div", { class: "mrd-image-field__preview-info" }, index.h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (index.h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (index.h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: 'b0442d6f5c07ef22443194b3f1a95d2dfc409c4e', class: "mrd-image-field__error" }, this.error))));
2132
+ return (index.h(index.Host, { key: '105ebf20023291a1e5c8524eedba4f04573943cd' }, index.h("div", { key: '59e6fe3b81c2ec1c07db7aaba819d79d2525b21f', class: "mrd-image-field" }, this.label && (index.h("label", { key: '2f3815ad6fe3f35932a8cc4d625751935272b629', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), index.h("div", { key: '8b45fbf8d0a229110a53068620a316ab6d48dbb8', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.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 ? (index.h("div", { class: "mrd-image-field__preview-container" }, index.h("div", { class: "mrd-image-field__preview-thumb" }, index.h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && index.h("div", { class: "mrd-image-field__preview-overlay" }, index.h("span", { class: "mrd-image-field__spinner" }))), index.h("div", { class: "mrd-image-field__preview-info" }, index.h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (index.h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (index.h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: 'f53ade0f627f3c840bc133690d40034c12665b5c', class: "mrd-image-field__error" }, this.error))));
1713
2133
  }
1714
2134
  static get watchers() { return {
1715
2135
  "value": [{
@@ -1823,7 +2243,7 @@ class CellRenderer {
1823
2243
  }
1824
2244
  }
1825
2245
 
1826
- 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-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;text-transform:uppercase;letter-spacing:0.05em}.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}`;
2246
+ 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}`;
1827
2247
 
1828
2248
  const MrdLayoutSection = class {
1829
2249
  constructor(hostRef) {
@@ -1835,6 +2255,7 @@ const MrdLayoutSection = class {
1835
2255
  this.mrdLoadImage = index.createEvent(this, "mrdLoadImage");
1836
2256
  this.mrdViewAction = index.createEvent(this, "mrdViewAction");
1837
2257
  this.mrdLoadViewAggregations = index.createEvent(this, "mrdLoadViewAggregations");
2258
+ this.mrdLoadViewDistinct = index.createEvent(this, "mrdLoadViewDistinct");
1838
2259
  /** Items from one layout entry in ClientDashboardMetadata.layouts[]. */
1839
2260
  this.items = [];
1840
2261
  /** Record data object; keys are field names, _links holds relation and related-view links. */
@@ -1844,11 +2265,16 @@ const MrdLayoutSection = class {
1844
2265
  /** Legacy: top-level _links from ClientDashboardMetadata. Not needed in new flat format. */
1845
2266
  this.links = {};
1846
2267
  this.locale = navigator.language;
2268
+ /** Top-level archetypes on the object dashboard. When it contains commons.document,
2269
+ * the record is rendered as a single-document view instead of generic fields. */
2270
+ this.archetypes = [];
1847
2271
  this.searchQueryMap = {};
1848
2272
  this.searchResultsMap = {};
1849
2273
  this.imagePreviewUrl = null;
1850
2274
  this.imagePreviews = {};
1851
2275
  this.openHistoryField = null;
2276
+ /** Per-view display mode for document collection views. Default 'tree'. */
2277
+ this.docViewMode = {};
1852
2278
  this.historyClickOutside = null;
1853
2279
  this.searchTimers = {};
1854
2280
  this.handleViewLoadPage = (e, name) => {
@@ -1932,11 +2358,18 @@ const MrdLayoutSection = class {
1932
2358
  }
1933
2359
  }
1934
2360
  /**
1935
- * Inject data into an embedded mrd-table for a RELATED_VIEW or VIEW item.
1936
- * Pass totalElements to update the pagination total (safe to pass on every page).
1937
- * Pass hasNext (from _links.next presence) so the table can decide whether to emit aggregations.
2361
+ * Inject rows for a VIEW / RELATED_VIEW item.
2362
+ * - Table view: injects the page into the embedded mrd-table (pass totalElements/hasNext).
2363
+ * - Document view: pass `nodeId` to route the rows to that folder node in the embedded
2364
+ * mrd-document-list. Folder loading is just a filtered list load, so it reuses this method.
1938
2365
  */
1939
- async setViewPage(name, page, rows, totalElements, hasNext) {
2366
+ async setViewPage(name, page, rows, totalElements, hasNext, nodeId) {
2367
+ if (nodeId) {
2368
+ const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
2369
+ if (list === null || list === void 0 ? void 0 : list.setDocuments)
2370
+ await list.setDocuments(nodeId, rows);
2371
+ return;
2372
+ }
1940
2373
  const table = this.el.querySelector(`mrd-table[data-view="${name}"]`);
1941
2374
  if (!table)
1942
2375
  return;
@@ -1952,6 +2385,12 @@ const MrdLayoutSection = class {
1952
2385
  return;
1953
2386
  await table.setAggregations(data);
1954
2387
  }
2388
+ /** Inject distinct values into an embedded mrd-document-list for a document view. */
2389
+ async setViewDistinct(name, nodeId, values) {
2390
+ const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
2391
+ if (list === null || list === void 0 ? void 0 : list.setDistinct)
2392
+ await list.setDistinct(nodeId, values);
2393
+ }
1955
2394
  /** Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox. */
1956
2395
  async setImagePreview(fieldName, url) {
1957
2396
  this.imagePreviews = Object.assign(Object.assign({}, this.imagePreviews), { [fieldName]: url });
@@ -2100,7 +2539,7 @@ const MrdLayoutSection = class {
2100
2539
  return (index.h("div", { class: "mrd-layout-section__search", key: `search-${dataClass}` }, index.h("div", { class: "mrd-layout-section__search-wrap" }, index.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" }, index.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" })), index.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 && (index.h("ul", { class: "mrd-layout-section__search-results" }, results.map(r => (index.h("li", { key: r.id, class: "mrd-layout-section__search-result" }, index.h("button", { class: "mrd-layout-section__search-result-btn", onClick: () => this.mrdNavigate.emit({ href: r.id, label: r.label }) }, index.h("span", { class: "mrd-layout-section__search-result-label" }, r.label), r.description && index.h("span", { class: "mrd-layout-section__search-result-desc" }, r.description)))))))));
2101
2540
  }
2102
2541
  renderRelatedView(item) {
2103
- var _a, _b, _c, _d, _e, _f;
2542
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2104
2543
  const key = this.viewKeyFor(item);
2105
2544
  if (!key)
2106
2545
  return null;
@@ -2110,7 +2549,32 @@ const MrdLayoutSection = class {
2110
2549
  // Extract parentId from data._links.self.href for RELATED_VIEW path construction
2111
2550
  const selfHref = (_e = (_d = (_c = (_b = this.data) === null || _b === void 0 ? void 0 : _b._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : '';
2112
2551
  const parentId = (_f = selfHref.split('/').filter(Boolean).pop()) !== null && _f !== void 0 ? _f : '';
2113
- return (index.h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && index.h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
2552
+ // The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
2553
+ // (sibling of `view`), not inside `view`.
2554
+ const docArchetype = index$1.resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, index$1.ARCHETYPE_DOCUMENT);
2555
+ const mode = (_j = this.docViewMode[key]) !== null && _j !== void 0 ? _j : 'tree';
2556
+ return (index.h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && index.h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype && this.renderDocToolbar(key, mode), docArchetype && mode === 'tree'
2557
+ ? this.renderDocumentList(item, key, parentId, docArchetype)
2558
+ : this.renderTable(item, key, parentId)));
2559
+ }
2560
+ /** Tree / list segmented toggle for document collection views (+ upload placeholder). */
2561
+ renderDocToolbar(key, mode) {
2562
+ return (index.h("div", { class: "mrd-layout-section__doc-toolbar" }, index.h("div", { class: "mrd-layout-section__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, index.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' }); } }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M3 5h6M3 12h9M3 19h6" }), index.h("circle", { cx: "18", cy: "5", r: "1.6" }), index.h("circle", { cx: "18", cy: "19", r: "1.6" }), index.h("path", { d: "M16 12h4" }))), index.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' }); } }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
2563
+ }
2564
+ renderDocumentList(item, key, parentId, archetype) {
2565
+ return (index.h("mrd-document-list", { "data-doclist": key, item: item, archetype: archetype, parentId: parentId, locale: this.locale, onMrdLoadDistinct: (e) => {
2566
+ e.stopPropagation();
2567
+ this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
2568
+ }, onMrdLoadPage: (e) => {
2569
+ e.stopPropagation();
2570
+ this.mrdLoadViewPage.emit(Object.assign({ name: key }, e.detail));
2571
+ }, onMrdNavigate: (e) => {
2572
+ e.stopPropagation();
2573
+ this.mrdNavigate.emit(e.detail);
2574
+ } }));
2575
+ }
2576
+ renderTable(item, key, parentId) {
2577
+ return (index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
2114
2578
  var _a;
2115
2579
  e.stopPropagation();
2116
2580
  this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
@@ -2131,7 +2595,7 @@ const MrdLayoutSection = class {
2131
2595
  parentPath: e.detail.parentPath,
2132
2596
  basicType: e.detail.basicType,
2133
2597
  });
2134
- } })));
2598
+ } }));
2135
2599
  }
2136
2600
  renderItem(item) {
2137
2601
  var _a, _b;
@@ -2163,8 +2627,23 @@ const MrdLayoutSection = class {
2163
2627
  return null;
2164
2628
  return (index.h("div", { class: "mrd-layout-section__modal-backdrop", onClick: () => { this.imagePreviewUrl = null; } }, index.h("div", { class: "mrd-layout-section__modal", onClick: (e) => e.stopPropagation() }, index.h("button", { class: "mrd-layout-section__modal-close", onClick: () => { this.imagePreviewUrl = null; } }, "\u2715"), index.h("img", { class: "mrd-layout-section__modal-image", src: this.imagePreviewUrl, alt: "" }))));
2165
2629
  }
2630
+ /** Single-document view: the record's own type carries commons.document. Renders
2631
+ * a recognisable document instead of generic fields, keeping any related views/
2632
+ * searches below it. */
2633
+ renderDocumentObject(archetype) {
2634
+ const related = this.items.filter(it => it.type === index$1.ClientLayoutItemType.VIEW ||
2635
+ it.type === index$1.ClientLayoutItemType.RELATED_VIEW ||
2636
+ it.type === index$1.ClientLayoutItemType.SEARCH);
2637
+ return [
2638
+ index.h("mrd-document-view", { archetype: archetype, data: this.data, locale: this.locale, onMrdNavigate: (e) => { e.stopPropagation(); this.mrdNavigate.emit(e.detail); }, onMrdDownload: (e) => { e.stopPropagation(); this.mrdDownload.emit(e.detail); } }),
2639
+ ...related.map(it => this.renderItem(it)),
2640
+ ];
2641
+ }
2166
2642
  render() {
2167
- return (index.h(index.Host, { key: '39d21b05016b901ff73a90dc0c6ef04cc30b4d42' }, index.h("div", { key: '546d956676d66438930665e97c2ed618fb8d1d4c', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
2643
+ const docArchetype = index$1.resolveArchetype(this.archetypes, index$1.ARCHETYPE_DOCUMENT);
2644
+ return (index.h(index.Host, { key: '4fbba410f9b8cab2bf21497467f99ff25f109bcc' }, index.h("div", { key: '679d2c34f1eaff694873ba18d679cbccecdae1a6', class: "mrd-layout-section" }, docArchetype
2645
+ ? this.renderDocumentObject(docArchetype)
2646
+ : this.items.map(item => this.renderItem(item))), this.renderImageModal()));
2168
2647
  }
2169
2648
  get el() { return index.getElement(this); }
2170
2649
  static get watchers() { return {
@@ -2304,7 +2783,7 @@ const MrdLongtextField = class {
2304
2783
  }
2305
2784
  render() {
2306
2785
  const hasError = !!this.error;
2307
- return (index.h(index.Host, { key: '10d998b80f54cf7b10be26bf451d808c78579e69' }, index.h("div", { key: 'af45fe94a41f668bf6ddca670b42e065ee83ef23', class: "mrd-longtext-field" }, this.label && (index.h("label", { key: '31a08490d695ac9f4bbe5dff6a1ae3bb2a94337d', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.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 && index.h("span", { key: '7f133e72a882a8aaf33245445829754da1e6377b', class: "mrd-longtext-field__error" }, this.error))));
2786
+ return (index.h(index.Host, { key: '624be9369a37f0901ada13bd0e8a3bb8b40f54c8' }, index.h("div", { key: '6544e7b10af59a5628a119d5ea907fb968f21d42', class: "mrd-longtext-field" }, this.label && (index.h("label", { key: 'd56386e3fc2984b522bcbf5ec6908e044ed6f3d3', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.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 && index.h("span", { key: '9423d70dec9c6439cc629746f1038a61a14da5e4', class: "mrd-longtext-field__error" }, this.error))));
2308
2787
  }
2309
2788
  };
2310
2789
  MrdLongtextField.style = mrdLongtextFieldScss();
@@ -2380,7 +2859,7 @@ const MrdNumberField = class {
2380
2859
  const hasError = !!this.error;
2381
2860
  const suffix = this.dataType === index$1.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
2382
2861
  this.dataType === index$1.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
2383
- return (index.h(index.Host, { key: '195beed4d6453597320b79654feaabe8f742eff2' }, index.h("div", { key: 'c641d7a4d27ba28dd34acda98d38f245945d20bb', class: "mrd-number-field" }, this.label && (index.h("label", { key: '2a5f6eb48889a3ab0aa76d6b2ca5d59b20625bb2', class: `mrd-number-field__label${this.required ? ' mrd-number-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'a844b89e6a278629a8aefa4ac72e5e18e5904cab', class: "mrd-number-field__input-wrapper" }, index.h("input", { key: '1ce9c3d67b458601a0de95b3b8478ef05df73069', 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 && index.h("span", { key: '4226614a65a8d27543d1287e2c1f61f67c427e63', class: "mrd-number-field__error" }, this.error))));
2862
+ return (index.h(index.Host, { key: '2c844e94a7cbb3fcf33f9552329443260e9490ab' }, index.h("div", { key: 'b87bdc2a17552e74b27d6da16e4db9bfd2f7e4ac', class: "mrd-number-field" }, this.label && (index.h("label", { key: '4aca381054b0ce27c94a9a7c779642d44dbbebcc', class: `mrd-number-field__label${this.required ? ' mrd-number-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'b7e8d122bfbd92152ce44a7ba56222425eed73f9', class: "mrd-number-field__input-wrapper" }, index.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 && index.h("span", { key: '5f56d6f2e0a878703f35d50b1932a39a82dace3b', class: "mrd-number-field__error" }, this.error))));
2384
2863
  }
2385
2864
  };
2386
2865
  MrdNumberField.style = mrdNumberFieldScss();
@@ -2674,9 +3153,9 @@ const MrdSecretField = class {
2674
3153
  }
2675
3154
  render() {
2676
3155
  const hasError = !!this.error;
2677
- return (index.h(index.Host, { key: '08f1aa9d8ab9f4e41abb6d3286e5e383427a5409' }, index.h("div", { key: 'fabe38aa130e211cea81f2c2f227bc15ad3ebf7d', class: "mrd-secret-field" }, this.label && (index.h("label", { key: '69af8844eff8ce84daa622635c79130fb491eb0b', class: `mrd-secret-field__label${this.required ? ' mrd-secret-field__label--required' : ''}` }, this.label)), this.disabled
3156
+ return (index.h(index.Host, { key: 'e0d516f7e76c1fab5441567cc371569a8eab07f8' }, index.h("div", { key: 'fac6fb517a0f37560429c828251f7db3841d3301', class: "mrd-secret-field" }, this.label && (index.h("label", { key: 'b2dd3189f2fcf3fd3feea741a39dbd5c3f4d437f', class: `mrd-secret-field__label${this.required ? ' mrd-secret-field__label--required' : ''}` }, this.label)), this.disabled
2678
3157
  ? (index.h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
2679
- : (index.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 && index.h("span", { key: 'e602004f0bb10916d1015e3c2b003523a292997c', class: "mrd-secret-field__error" }, this.error))));
3158
+ : (index.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 && index.h("span", { key: 'dbd6667d7f2c6ed26220ac83a46235cf3ad777d7', class: "mrd-secret-field__error" }, this.error))));
2680
3159
  }
2681
3160
  };
2682
3161
  MrdSecretField.style = mrdSecretFieldScss();
@@ -3823,7 +4302,7 @@ const MrdTextField = class {
3823
4302
  }
3824
4303
  render() {
3825
4304
  const hasError = !!this.error;
3826
- return (index.h(index.Host, { key: 'fd4e1f389cb452ab80a1e1c7295d884ca935999e' }, index.h("div", { key: '7b7bde7a18fcd9b8d5779daab88ddabb45dd8692', class: "mrd-text-field" }, this.label && (index.h("label", { key: '8e2ad4053473cfad4eae4c4634b863ac5ef32fea', class: `mrd-text-field__label${this.required ? ' mrd-text-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'd32712a6dc2aee4691bc4a580d5ca2ad81e0ff9f', 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 && index.h("span", { key: '31585dbf82020c81834e1eeada5cd9907a5ead56', class: "mrd-text-field__error" }, this.error))));
4305
+ return (index.h(index.Host, { key: '124c46a83d30993aed5045eda42134d5c28ec989' }, index.h("div", { key: '5497fab2938f875fe9b4cd539a9feaaf907007e1', class: "mrd-text-field" }, this.label && (index.h("label", { key: '4d43255f45de8e7c4596a211797403479d2240b6', class: `mrd-text-field__label${this.required ? ' mrd-text-field__label--required' : ''}` }, this.label)), index.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 && index.h("span", { key: '9bf08d3a77d7616674caf3325b6598490f2d50fc', class: "mrd-text-field__error" }, this.error))));
3827
4306
  }
3828
4307
  };
3829
4308
  MrdTextField.style = mrdTextFieldScss();
@@ -3897,7 +4376,7 @@ const MrdTextareaField = class {
3897
4376
  }
3898
4377
  }
3899
4378
  render() {
3900
- return (index.h(index.Host, { key: 'e1fd819c598f01e3986946357ec18d608f2c7adc' }, index.h("div", { key: '20c28e54e61429655b2d4f297bd84e183ad7e971', class: "mrd-textarea-field" }, this.label && (index.h("label", { key: 'fa46a20badc35c931563600f24a32e0a8c8c07ad', class: `mrd-textarea-field__label${this.required ? ' mrd-textarea-field__label--required' : ''}` }, this.label)), index.h("div", { key: 'ee928eca0a1b85401b346b7fae8adbe9214a7664', class: `mrd-textarea-field__container${this.error ? ' mrd-textarea-field__container--error' : ''}` }, index.h("div", { key: '89b00f3c526623c47f0aff7ad862f70dfdc2fe15', class: "mrd-textarea-field__editor" })), this.error && index.h("span", { key: '458cf8fddee36ddbc384ce4d25765e5aacd3c9d5', class: "mrd-textarea-field__error" }, this.error))));
4379
+ return (index.h(index.Host, { key: '2413906076dee3f48118d44574dadd36bcedadfe' }, index.h("div", { key: '59e369a54e906b09a1062c7c5f701b8bbd631479', class: "mrd-textarea-field" }, this.label && (index.h("label", { key: 'd400c499eb6e35581fc2af9d372917287fcc60eb', class: `mrd-textarea-field__label${this.required ? ' mrd-textarea-field__label--required' : ''}` }, this.label)), index.h("div", { key: '62765821b5280e71918db0d070a136ef07e1eecd', class: `mrd-textarea-field__container${this.error ? ' mrd-textarea-field__container--error' : ''}` }, index.h("div", { key: 'f41b73291542d4582c492bce0a89240a171aba32', class: "mrd-textarea-field__editor" })), this.error && index.h("span", { key: 'eaba5b735be7aa8deebfbc46eac03be970bb1d13', class: "mrd-textarea-field__error" }, this.error))));
3901
4380
  }
3902
4381
  get el() { return index.getElement(this); }
3903
4382
  };
@@ -3934,7 +4413,7 @@ const MrdTimeField = class {
3934
4413
  }
3935
4414
  render() {
3936
4415
  const hasError = !!this.error;
3937
- return (index.h(index.Host, { key: 'c507996709437d8982f9175b286e25598997002d' }, index.h("div", { key: 'd5f1b7f14d26cae8298cd40491898b39044158f8', class: "mrd-time-field" }, this.label && (index.h("label", { key: '10976e18df09240e00b045314c4ddd3845d4bfdc', class: `mrd-time-field__label${this.required ? ' mrd-time-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'bc557333f107a371a7005f9b56dd0395190e63d7', 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 && index.h("span", { key: 'b5a09c2aa063fa9e2fc3aba411e86b57d879c408', class: "mrd-time-field__error" }, this.error))));
4416
+ return (index.h(index.Host, { key: 'e93a6492a7bdc17f04f5aac0b8ecd63435a6280f' }, index.h("div", { key: 'b9692c11f21ccd354ba5475e1a60e6afc8ead22e', class: "mrd-time-field" }, this.label && (index.h("label", { key: '668492f16b6b96065fe65204a4f053c2ef2796e5', class: `mrd-time-field__label${this.required ? ' mrd-time-field__label--required' : ''}` }, this.label)), index.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 && index.h("span", { key: '19a81211f3b630436a379f785768d28ffa01c12c', class: "mrd-time-field__error" }, this.error))));
3938
4417
  }
3939
4418
  };
3940
4419
  MrdTimeField.style = mrdTimeFieldScss();
@@ -3943,6 +4422,8 @@ exports.mrd_boolean_field = MrdBooleanField;
3943
4422
  exports.mrd_currency_field = MrdCurrencyField;
3944
4423
  exports.mrd_date_field = MrdDateField;
3945
4424
  exports.mrd_datetime_field = MrdDatetimeField;
4425
+ exports.mrd_document_list = MrdDocumentList;
4426
+ exports.mrd_document_view = MrdDocumentView;
3946
4427
  exports.mrd_email_field = MrdEmailField;
3947
4428
  exports.mrd_field = MrdField;
3948
4429
  exports.mrd_file_field = MrdFileField;