@mmlogic/components 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  3. package/dist/cjs/mrd-boolean-field_23.cjs.entry.js +103 -15
  4. package/dist/collection/components/mrd-document-container/mrd-document-container.js +48 -2
  5. package/dist/collection/components/mrd-document-list/mrd-document-list.js +95 -9
  6. package/dist/collection/components/mrd-document-list/mrd-document-list.scss +11 -0
  7. package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +19 -4
  8. package/dist/collection/utils/i18n.js +2 -0
  9. package/dist/components/i18n.js +1 -1
  10. package/dist/components/mrd-document-container2.js +1 -1
  11. package/dist/components/mrd-document-list2.js +1 -1
  12. package/dist/components/mrd-layout-section.js +1 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/mosterdcomponents.js +1 -1
  15. package/dist/esm/mrd-boolean-field_23.entry.js +103 -15
  16. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  17. package/dist/mosterdcomponents/p-a9618055.entry.js +1 -0
  18. package/dist/types/components/mrd-document-container/mrd-document-container.d.ts +5 -0
  19. package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +24 -1
  20. package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +3 -0
  21. package/dist/types/components.d.ts +33 -0
  22. package/dist/types/types/client-layout.d.ts +5 -0
  23. package/package.json +1 -1
  24. package/dist/mosterdcomponents/cell-renderer-B-AJDBcj.js.map +0 -1
  25. package/dist/mosterdcomponents/client-layout-ChqRA3AF.js.map +0 -1
  26. package/dist/mosterdcomponents/format-BAfsQfy1.js.map +0 -1
  27. package/dist/mosterdcomponents/i18n-s1XrKcD2.js.map +0 -1
  28. package/dist/mosterdcomponents/index-DkY-NQj0.js.map +0 -1
  29. package/dist/mosterdcomponents/index-DwF_Sp__.js.map +0 -1
  30. package/dist/mosterdcomponents/index.esm.js.map +0 -1
  31. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
  32. package/dist/mosterdcomponents/p-69452249.entry.js +0 -1
  33. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
  34. package/dist/mosterdcomponents/validation-Br9k2Ztw.js.map +0 -1
@@ -1,9 +1,20 @@
1
1
  :host {
2
2
  display: block;
3
+ height: 100%;
3
4
  }
4
5
 
5
6
  .mrd-document-list {
6
7
  padding: var(--mrd-space-2) 0;
8
+ min-height: 100%;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ /* Whole-area highlight while a file/document is dragged over the root (dossier
13
+ context) — makes the drop target obvious, Finder-style. */
14
+ .mrd-document-list--drop-active {
15
+ outline: 2px dashed var(--mrd-color-primary);
16
+ outline-offset: -4px;
17
+ background: var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06));
7
18
  }
8
19
 
9
20
  .mrd-document-list__row {
@@ -313,15 +313,30 @@ export class MrdLayoutSection {
313
313
  // The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
314
314
  // (sibling of `view`), not inside `view`.
315
315
  const docArchetype = resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, ARCHETYPE_DOCUMENT);
316
+ // Canonical parent href for single-container seeding: use the RELATED_VIEW's
317
+ // fromClass (base class) rather than the route class, so polymorphic subtypes
318
+ // resolve to the same container the documents actually reference.
319
+ const containerHref = this.buildContainerHref(item, selfHref, parentId);
316
320
  return (h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype
317
- ? this.renderDocumentContainer(item, key, parentId, docArchetype)
321
+ ? this.renderDocumentContainer(item, key, parentId, docArchetype, containerHref)
318
322
  : this.renderTable(item, key, parentId)));
319
323
  }
324
+ /** Build the canonical parent href `/{base}/{tenant}/{fromClass}/{parentId}` from
325
+ * the object's self href. Empty unless it is a RELATED_VIEW with a fromClass. */
326
+ buildContainerHref(item, selfHref, parentId) {
327
+ if (item.type !== ClientLayoutItemType.RELATED_VIEW || !item.fromClass || !parentId)
328
+ return '';
329
+ const segs = selfHref.split('/').filter(Boolean);
330
+ if (segs.length < 2)
331
+ return '';
332
+ const [base, tenant] = segs;
333
+ return `/${base}/${tenant}/${item.fromClass}/${parentId}`;
334
+ }
320
335
  /** Document collection view: owns the view-switch + collection actions and
321
336
  * swaps between the folder tree and the flat table. Events are re-emitted to
322
337
  * the host with the view key, exactly as the raw list/table events were. */
323
- renderDocumentContainer(item, key, parentId, archetype) {
324
- return (h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
338
+ renderDocumentContainer(item, key, parentId, archetype, containerHref) {
339
+ return (h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
325
340
  e.stopPropagation();
326
341
  this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
327
342
  }, onMrdLoadPage: (e) => {
@@ -417,7 +432,7 @@ export class MrdLayoutSection {
417
432
  }
418
433
  render() {
419
434
  const docArchetype = resolveArchetype(this.archetypes, ARCHETYPE_DOCUMENT);
420
- return (h(Host, { key: '6e737354daec0137b6ebe304efcce9990f02739f' }, h("div", { key: '31a73a8a78999793f5dacee5f2da41df5f23156e', class: "mrd-layout-section" }, docArchetype
435
+ return (h(Host, { key: '231f5c3e282375b5850291611645fe3c904831bb' }, h("div", { key: '314e39ec3aa1eabeb1a98f6e6d63fcf07e13ccec', class: "mrd-layout-section" }, docArchetype
421
436
  ? this.renderDocumentObject(docArchetype)
422
437
  : this.items.map(item => this.renderItem(item))), this.renderImageModal()));
423
438
  }
@@ -69,6 +69,7 @@ const translations = {
69
69
  folder_name_placeholder: 'Foldernaam',
70
70
  folder_no_slash: "Een foldernaam mag geen '/' bevatten",
71
71
  folder_duplicate: 'Er bestaat al een folder met deze naam',
72
+ doc_empty_drop: 'Nog geen documenten — sleep bestanden hierheen',
72
73
  },
73
74
  en: {
74
75
  required: 'This field is required',
@@ -140,6 +141,7 @@ const translations = {
140
141
  folder_name_placeholder: 'Folder name',
141
142
  folder_no_slash: "A folder name cannot contain '/'",
142
143
  folder_duplicate: 'A folder with this name already exists',
144
+ doc_empty_drop: 'No documents yet — drop files here',
143
145
  },
144
146
  ar: {
145
147
  required: 'هذا الحقل مطلوب',
@@ -1 +1 @@
1
- const e={nl:{required:"Dit veld is verplicht",select_placeholder:"Selecteer een optie",search_placeholder:"Zoeken...",upload_file:"Bestand uploaden",choose_file:"Bestand kiezen",clear:"Wissen",today:"Vandaag",invalid_email:"Voer een geldig e-mailadres in",invalid_url:"Voer een geldige URL in",invalid_number:"Voer een geldig getal in",drop_file_here:"Sleep bestand hierheen of",browse:"bladeren",file_too_large:"Bestand is te groot",search_results:"Zoekresultaten",no_results:"Geen resultaten gevonden",loading:"Laden...",submit:"Opslaan",cancel:"Annuleren",remove:"Verwijderen",add:"Toevoegen",yes:"Ja",no:"Nee",table_of:"van",download:"Downloaden",table_filter:"Filteren",table_filter_hide:"Filter verbergen",table_filter_active:"actief",table_filter_clear_all:"Alle filters wissen",table_new_record:"Nieuw record",table_export_excel:"Exporteer naar Excel",doc_view_switch:"Weergave wisselen",doc_view_tree:"Boomweergave",doc_view_list:"Lijstweergave",filter_sorting:"Sortering",filter_ascending:"Oplopend",filter_descending:"Aflopend",filter_section:"Filter",filter_apply:"Toepassen",filter_clear:"Wissen",filter_contains:"Bevat",filter_starts_with:"Begint met",filter_equals:"Gelijk aan",filter_has_value:"Heeft waarde",filter_is_empty:"Is leeg",filter_is_not_empty:"Is niet leeg",filter_exact:"Exact",filter_range:"Bereik",filter_from:"Van",filter_to:"Tot",filter_all:"Alle",filter_select_all:"Alles",filter_select_none:"Geen",filter_search_value:"Zoekwaarde...",filter_no_support:"Geen filtering beschikbaar voor dit veldtype.",textblock_show_more:"Meer tonen",close:"Sluiten",history_until:"tot",history_badge_tooltip:"Vorige waarden",hyperlink_name:"Linktekst (optioneel)",new_folder:"Nieuwe folder",folder_name_placeholder:"Foldernaam",folder_no_slash:"Een foldernaam mag geen '/' bevatten",folder_duplicate:"Er bestaat al een folder met deze naam"},en:{required:"This field is required",select_placeholder:"Select an option",search_placeholder:"Search...",upload_file:"Upload file",choose_file:"Choose file",clear:"Clear",today:"Today",invalid_email:"Please enter a valid email address",invalid_url:"Please enter a valid URL",invalid_number:"Please enter a valid number",drop_file_here:"Drop file here or",browse:"browse",file_too_large:"File is too large",search_results:"Search results",no_results:"No results found",loading:"Loading...",submit:"Save",cancel:"Cancel",remove:"Remove",add:"Add",yes:"Yes",no:"No",table_of:"of",download:"Download",table_filter:"Filter",table_filter_hide:"Hide filter",table_filter_active:"active",table_filter_clear_all:"Clear all filters",table_new_record:"New record",table_export_excel:"Export to Excel",doc_view_switch:"Switch view",doc_view_tree:"Tree view",doc_view_list:"List view",filter_sorting:"Sorting",filter_ascending:"Ascending",filter_descending:"Descending",filter_section:"Filter",filter_apply:"Apply",filter_clear:"Clear",filter_contains:"Contains",filter_starts_with:"Starts with",filter_equals:"Equals",filter_has_value:"Has value",filter_is_empty:"Is empty",filter_is_not_empty:"Is not empty",filter_exact:"Exact",filter_range:"Range",filter_from:"From",filter_to:"To",filter_all:"All",filter_select_all:"All",filter_select_none:"None",filter_search_value:"Search value...",filter_no_support:"Filtering is not available for this field type.",textblock_show_more:"Show more",close:"Close",history_until:"until",history_badge_tooltip:"Previous values",hyperlink_name:"Link text (optional)",new_folder:"New folder",folder_name_placeholder:"Folder name",folder_no_slash:"A folder name cannot contain '/'",folder_duplicate:"A folder with this name already exists"},ar:{required:"هذا الحقل مطلوب",select_placeholder:"اختر خياراً",search_placeholder:"بحث...",upload_file:"رفع ملف",choose_file:"اختر ملفاً",clear:"مسح",today:"اليوم",invalid_email:"يرجى إدخال عنوان بريد إلكتروني صحيح",invalid_url:"يرجى إدخال رابط صحيح",invalid_number:"يرجى إدخال رقم صحيح",drop_file_here:"اسحب الملف هنا أو",browse:"تصفح",file_too_large:"الملف كبير جداً",search_results:"نتائج البحث",no_results:"لم يتم العثور على نتائج",loading:"جار التحميل...",submit:"حفظ",cancel:"إلغاء",remove:"إزالة",add:"إضافة",yes:"نعم",no:"لا",table_of:"من أصل",download:"تنزيل",table_filter:"تصفية",table_filter_hide:"إخفاء التصفية",table_filter_active:"نشط",table_filter_clear_all:"مسح جميع الفلاتر",table_new_record:"سجل جديد",table_export_excel:"تصدير إلى Excel",doc_view_switch:"تبديل العرض",doc_view_tree:"عرض شجري",doc_view_list:"عرض القائمة",filter_sorting:"الترتيب",filter_ascending:"تصاعدي",filter_descending:"تنازلي",filter_section:"تصفية",filter_apply:"تطبيق",filter_clear:"مسح",filter_contains:"يحتوي على",filter_starts_with:"يبدأ بـ",filter_equals:"يساوي",filter_has_value:"له قيمة",filter_is_empty:"فارغ",filter_is_not_empty:"ليس فارغاً",filter_exact:"دقيق",filter_range:"نطاق",filter_from:"من",filter_to:"إلى",filter_all:"الكل",filter_select_all:"الكل",filter_select_none:"لا شيء",filter_search_value:"قيمة البحث...",filter_no_support:"التصفية غير متاحة لهذا النوع من الحقول.",textblock_show_more:"عرض المزيد",close:"إغلاق",history_until:"حتى",history_badge_tooltip:"القيم السابقة",hyperlink_name:"نص الرابط (اختياري)"},fr:{required:"Ce champ est obligatoire",select_placeholder:"Sélectionner une option",search_placeholder:"Rechercher...",upload_file:"Télécharger un fichier",choose_file:"Choisir un fichier",clear:"Effacer",today:"Aujourd'hui",invalid_email:"Veuillez saisir une adresse e-mail valide",invalid_url:"Veuillez saisir une URL valide",invalid_number:"Veuillez saisir un nombre valide",drop_file_here:"Déposez le fichier ici ou",browse:"parcourir",file_too_large:"Le fichier est trop volumineux",search_results:"Résultats de recherche",no_results:"Aucun résultat trouvé",loading:"Chargement...",submit:"Enregistrer",cancel:"Annuler",remove:"Supprimer",add:"Ajouter",yes:"Oui",no:"Non",table_of:"sur",download:"Télécharger",table_filter:"Filtrer",table_filter_hide:"Masquer le filtre",table_filter_active:"actif",table_filter_clear_all:"Effacer tous les filtres",table_new_record:"Nouvel enregistrement",table_export_excel:"Exporter vers Excel",doc_view_switch:"Changer de vue",doc_view_tree:"Vue arborescente",doc_view_list:"Vue liste",filter_sorting:"Tri",filter_ascending:"Croissant",filter_descending:"Décroissant",filter_section:"Filtre",filter_apply:"Appliquer",filter_clear:"Effacer",filter_contains:"Contient",filter_starts_with:"Commence par",filter_equals:"Égal à",filter_has_value:"A une valeur",filter_is_empty:"Est vide",filter_is_not_empty:"N'est pas vide",filter_exact:"Exact",filter_range:"Plage",filter_from:"De",filter_to:"À",filter_all:"Tous",filter_select_all:"Tous",filter_select_none:"Aucun",filter_search_value:"Valeur de recherche...",filter_no_support:"Le filtrage n'est pas disponible pour ce type de champ.",textblock_show_more:"Voir plus",close:"Fermer",history_until:"jusqu'au",history_badge_tooltip:"Valeurs précédentes",hyperlink_name:"Texte du lien (optionnel)"},de:{required:"Dieses Feld ist erforderlich",select_placeholder:"Option auswählen",search_placeholder:"Suchen...",upload_file:"Datei hochladen",choose_file:"Datei auswählen",clear:"Löschen",today:"Heute",invalid_email:"Bitte geben Sie eine gültige E-Mail-Adresse ein",invalid_url:"Bitte geben Sie eine gültige URL ein",invalid_number:"Bitte geben Sie eine gültige Zahl ein",drop_file_here:"Datei hier ablegen oder",browse:"durchsuchen",file_too_large:"Datei ist zu groß",search_results:"Suchergebnisse",no_results:"Keine Ergebnisse gefunden",loading:"Laden...",submit:"Speichern",cancel:"Abbrechen",remove:"Entfernen",add:"Hinzufügen",yes:"Ja",no:"Nein",table_of:"von",download:"Herunterladen",table_filter:"Filtern",table_filter_hide:"Filter ausblenden",table_filter_active:"aktiv",table_filter_clear_all:"Alle Filter löschen",table_new_record:"Neuer Eintrag",table_export_excel:"Als Excel exportieren",doc_view_switch:"Ansicht wechseln",doc_view_tree:"Baumansicht",doc_view_list:"Listenansicht",filter_sorting:"Sortierung",filter_ascending:"Aufsteigend",filter_descending:"Absteigend",filter_section:"Filter",filter_apply:"Anwenden",filter_clear:"Löschen",filter_contains:"Enthält",filter_starts_with:"Beginnt mit",filter_equals:"Gleich",filter_has_value:"Hat Wert",filter_is_empty:"Ist leer",filter_is_not_empty:"Ist nicht leer",filter_exact:"Genau",filter_range:"Bereich",filter_from:"Von",filter_to:"Bis",filter_all:"Alle",filter_select_all:"Alle",filter_select_none:"Keine",filter_search_value:"Suchwert...",filter_no_support:"Filterung ist für diesen Feldtyp nicht verfügbar.",textblock_show_more:"Mehr anzeigen",close:"Schließen",history_until:"bis",history_badge_tooltip:"Vorherige Werte",hyperlink_name:"Linktext (optional)"},es:{required:"Este campo es obligatorio",select_placeholder:"Seleccionar una opción",search_placeholder:"Buscar...",upload_file:"Subir archivo",choose_file:"Elegir archivo",clear:"Borrar",today:"Hoy",invalid_email:"Por favor, introduzca una dirección de correo electrónico válida",invalid_url:"Por favor, introduzca una URL válida",invalid_number:"Por favor, introduzca un número válido",drop_file_here:"Suelte el archivo aquí o",browse:"explorar",file_too_large:"El archivo es demasiado grande",search_results:"Resultados de búsqueda",no_results:"No se encontraron resultados",loading:"Cargando...",submit:"Guardar",cancel:"Cancelar",remove:"Eliminar",add:"Añadir",yes:"Sí",no:"No",table_of:"de",download:"Descargar",table_filter:"Filtrar",table_filter_hide:"Ocultar filtro",table_filter_active:"activo",table_filter_clear_all:"Borrar todos los filtros",table_new_record:"Nuevo registro",table_export_excel:"Exportar a Excel",doc_view_switch:"Cambiar vista",doc_view_tree:"Vista de árbol",doc_view_list:"Vista de lista",filter_sorting:"Ordenación",filter_ascending:"Ascendente",filter_descending:"Descendente",filter_section:"Filtro",filter_apply:"Aplicar",filter_clear:"Borrar",filter_contains:"Contiene",filter_starts_with:"Empieza por",filter_equals:"Igual a",filter_has_value:"Tiene valor",filter_is_empty:"Está vacío",filter_is_not_empty:"No está vacío",filter_exact:"Exacto",filter_range:"Rango",filter_from:"Desde",filter_to:"Hasta",filter_all:"Todos",filter_select_all:"Todos",filter_select_none:"Ninguno",filter_search_value:"Valor de búsqueda...",filter_no_support:"El filtrado no está disponible para este tipo de campo.",textblock_show_more:"Mostrar más",close:"Cerrar",history_until:"hasta",history_badge_tooltip:"Valores anteriores",hyperlink_name:"Texto del enlace (opcional)"},it:{required:"Questo campo è obbligatorio",select_placeholder:"Seleziona un'opzione",search_placeholder:"Cerca...",upload_file:"Carica file",choose_file:"Scegli file",clear:"Cancella",today:"Oggi",invalid_email:"Inserisci un indirizzo email valido",invalid_url:"Inserisci un URL valido",invalid_number:"Inserisci un numero valido",drop_file_here:"Trascina il file qui o",browse:"sfoglia",file_too_large:"Il file è troppo grande",search_results:"Risultati della ricerca",no_results:"Nessun risultato trovato",loading:"Caricamento...",submit:"Salva",cancel:"Annulla",remove:"Rimuovi",add:"Aggiungi",yes:"Sì",no:"No",table_of:"di",download:"Scarica",table_filter:"Filtra",table_filter_hide:"Nascondi filtro",table_filter_active:"attivo",table_filter_clear_all:"Cancella tutti i filtri",table_new_record:"Nuovo record",table_export_excel:"Esporta in Excel",doc_view_switch:"Cambia vista",doc_view_tree:"Vista ad albero",doc_view_list:"Vista elenco",filter_sorting:"Ordinamento",filter_ascending:"Crescente",filter_descending:"Decrescente",filter_section:"Filtro",filter_apply:"Applica",filter_clear:"Cancella",filter_contains:"Contiene",filter_starts_with:"Inizia con",filter_equals:"Uguale a",filter_has_value:"Ha valore",filter_is_empty:"È vuoto",filter_is_not_empty:"Non è vuoto",filter_exact:"Esatto",filter_range:"Intervallo",filter_from:"Da",filter_to:"A",filter_all:"Tutti",filter_select_all:"Tutti",filter_select_none:"Nessuno",filter_search_value:"Valore di ricerca...",filter_no_support:"Il filtro non è disponibile per questo tipo di campo.",textblock_show_more:"Mostra altro",close:"Chiudi",history_until:"fino a",history_badge_tooltip:"Valori precedenti",hyperlink_name:"Testo del collegamento (opzionale)"},uk:{required:"Це поле обов'язкове",select_placeholder:"Виберіть варіант",search_placeholder:"Пошук...",upload_file:"Завантажити файл",choose_file:"Вибрати файл",clear:"Очистити",today:"Сьогодні",invalid_email:"Будь ласка, введіть дійсну адресу електронної пошти",invalid_url:"Будь ласка, введіть дійсну URL-адресу",invalid_number:"Будь ласка, введіть дійсне число",drop_file_here:"Перетягніть файл сюди або",browse:"огляд",file_too_large:"Файл занадто великий",search_results:"Результати пошуку",no_results:"Результатів не знайдено",loading:"Завантаження...",submit:"Зберегти",cancel:"Скасувати",remove:"Видалити",add:"Додати",yes:"Так",no:"Ні",table_of:"з",download:"Завантажити",table_filter:"Фільтрувати",table_filter_hide:"Сховати фільтр",table_filter_active:"активний",table_filter_clear_all:"Очистити всі фільтри",table_new_record:"Новий запис",table_export_excel:"Експортувати до Excel",doc_view_switch:"Змінити вигляд",doc_view_tree:"Деревоподібний вигляд",doc_view_list:"Список",filter_sorting:"Сортування",filter_ascending:"За зростанням",filter_descending:"За спаданням",filter_section:"Фільтр",filter_apply:"Застосувати",filter_clear:"Очистити",filter_contains:"Містить",filter_starts_with:"Починається з",filter_equals:"Дорівнює",filter_has_value:"Має значення",filter_is_empty:"Порожнє",filter_is_not_empty:"Не порожнє",filter_exact:"Точно",filter_range:"Діапазон",filter_from:"Від",filter_to:"До",filter_all:"Всі",filter_select_all:"Всі",filter_select_none:"Жодного",filter_search_value:"Значення для пошуку...",filter_no_support:"Фільтрування недоступне для цього типу поля.",textblock_show_more:"Показати більше",close:"Закрити",history_until:"до",history_badge_tooltip:"Попередні значення",hyperlink_name:"Текст посилання (необов'язково)"}};function l(l,i){var r,t,a;const o=(null!=i?i:"en").split("-")[0].toLowerCase();return null!==(a=null!==(t=(null!==(r=e[o])&&void 0!==r?r:e.en)[l])&&void 0!==t?t:e.en[l])&&void 0!==a?a:l}export{l as t}
1
+ const e={nl:{required:"Dit veld is verplicht",select_placeholder:"Selecteer een optie",search_placeholder:"Zoeken...",upload_file:"Bestand uploaden",choose_file:"Bestand kiezen",clear:"Wissen",today:"Vandaag",invalid_email:"Voer een geldig e-mailadres in",invalid_url:"Voer een geldige URL in",invalid_number:"Voer een geldig getal in",drop_file_here:"Sleep bestand hierheen of",browse:"bladeren",file_too_large:"Bestand is te groot",search_results:"Zoekresultaten",no_results:"Geen resultaten gevonden",loading:"Laden...",submit:"Opslaan",cancel:"Annuleren",remove:"Verwijderen",add:"Toevoegen",yes:"Ja",no:"Nee",table_of:"van",download:"Downloaden",table_filter:"Filteren",table_filter_hide:"Filter verbergen",table_filter_active:"actief",table_filter_clear_all:"Alle filters wissen",table_new_record:"Nieuw record",table_export_excel:"Exporteer naar Excel",doc_view_switch:"Weergave wisselen",doc_view_tree:"Boomweergave",doc_view_list:"Lijstweergave",filter_sorting:"Sortering",filter_ascending:"Oplopend",filter_descending:"Aflopend",filter_section:"Filter",filter_apply:"Toepassen",filter_clear:"Wissen",filter_contains:"Bevat",filter_starts_with:"Begint met",filter_equals:"Gelijk aan",filter_has_value:"Heeft waarde",filter_is_empty:"Is leeg",filter_is_not_empty:"Is niet leeg",filter_exact:"Exact",filter_range:"Bereik",filter_from:"Van",filter_to:"Tot",filter_all:"Alle",filter_select_all:"Alles",filter_select_none:"Geen",filter_search_value:"Zoekwaarde...",filter_no_support:"Geen filtering beschikbaar voor dit veldtype.",textblock_show_more:"Meer tonen",close:"Sluiten",history_until:"tot",history_badge_tooltip:"Vorige waarden",hyperlink_name:"Linktekst (optioneel)",new_folder:"Nieuwe folder",folder_name_placeholder:"Foldernaam",folder_no_slash:"Een foldernaam mag geen '/' bevatten",folder_duplicate:"Er bestaat al een folder met deze naam",doc_empty_drop:"Nog geen documenten — sleep bestanden hierheen"},en:{required:"This field is required",select_placeholder:"Select an option",search_placeholder:"Search...",upload_file:"Upload file",choose_file:"Choose file",clear:"Clear",today:"Today",invalid_email:"Please enter a valid email address",invalid_url:"Please enter a valid URL",invalid_number:"Please enter a valid number",drop_file_here:"Drop file here or",browse:"browse",file_too_large:"File is too large",search_results:"Search results",no_results:"No results found",loading:"Loading...",submit:"Save",cancel:"Cancel",remove:"Remove",add:"Add",yes:"Yes",no:"No",table_of:"of",download:"Download",table_filter:"Filter",table_filter_hide:"Hide filter",table_filter_active:"active",table_filter_clear_all:"Clear all filters",table_new_record:"New record",table_export_excel:"Export to Excel",doc_view_switch:"Switch view",doc_view_tree:"Tree view",doc_view_list:"List view",filter_sorting:"Sorting",filter_ascending:"Ascending",filter_descending:"Descending",filter_section:"Filter",filter_apply:"Apply",filter_clear:"Clear",filter_contains:"Contains",filter_starts_with:"Starts with",filter_equals:"Equals",filter_has_value:"Has value",filter_is_empty:"Is empty",filter_is_not_empty:"Is not empty",filter_exact:"Exact",filter_range:"Range",filter_from:"From",filter_to:"To",filter_all:"All",filter_select_all:"All",filter_select_none:"None",filter_search_value:"Search value...",filter_no_support:"Filtering is not available for this field type.",textblock_show_more:"Show more",close:"Close",history_until:"until",history_badge_tooltip:"Previous values",hyperlink_name:"Link text (optional)",new_folder:"New folder",folder_name_placeholder:"Folder name",folder_no_slash:"A folder name cannot contain '/'",folder_duplicate:"A folder with this name already exists",doc_empty_drop:"No documents yet — drop files here"},ar:{required:"هذا الحقل مطلوب",select_placeholder:"اختر خياراً",search_placeholder:"بحث...",upload_file:"رفع ملف",choose_file:"اختر ملفاً",clear:"مسح",today:"اليوم",invalid_email:"يرجى إدخال عنوان بريد إلكتروني صحيح",invalid_url:"يرجى إدخال رابط صحيح",invalid_number:"يرجى إدخال رقم صحيح",drop_file_here:"اسحب الملف هنا أو",browse:"تصفح",file_too_large:"الملف كبير جداً",search_results:"نتائج البحث",no_results:"لم يتم العثور على نتائج",loading:"جار التحميل...",submit:"حفظ",cancel:"إلغاء",remove:"إزالة",add:"إضافة",yes:"نعم",no:"لا",table_of:"من أصل",download:"تنزيل",table_filter:"تصفية",table_filter_hide:"إخفاء التصفية",table_filter_active:"نشط",table_filter_clear_all:"مسح جميع الفلاتر",table_new_record:"سجل جديد",table_export_excel:"تصدير إلى Excel",doc_view_switch:"تبديل العرض",doc_view_tree:"عرض شجري",doc_view_list:"عرض القائمة",filter_sorting:"الترتيب",filter_ascending:"تصاعدي",filter_descending:"تنازلي",filter_section:"تصفية",filter_apply:"تطبيق",filter_clear:"مسح",filter_contains:"يحتوي على",filter_starts_with:"يبدأ بـ",filter_equals:"يساوي",filter_has_value:"له قيمة",filter_is_empty:"فارغ",filter_is_not_empty:"ليس فارغاً",filter_exact:"دقيق",filter_range:"نطاق",filter_from:"من",filter_to:"إلى",filter_all:"الكل",filter_select_all:"الكل",filter_select_none:"لا شيء",filter_search_value:"قيمة البحث...",filter_no_support:"التصفية غير متاحة لهذا النوع من الحقول.",textblock_show_more:"عرض المزيد",close:"إغلاق",history_until:"حتى",history_badge_tooltip:"القيم السابقة",hyperlink_name:"نص الرابط (اختياري)"},fr:{required:"Ce champ est obligatoire",select_placeholder:"Sélectionner une option",search_placeholder:"Rechercher...",upload_file:"Télécharger un fichier",choose_file:"Choisir un fichier",clear:"Effacer",today:"Aujourd'hui",invalid_email:"Veuillez saisir une adresse e-mail valide",invalid_url:"Veuillez saisir une URL valide",invalid_number:"Veuillez saisir un nombre valide",drop_file_here:"Déposez le fichier ici ou",browse:"parcourir",file_too_large:"Le fichier est trop volumineux",search_results:"Résultats de recherche",no_results:"Aucun résultat trouvé",loading:"Chargement...",submit:"Enregistrer",cancel:"Annuler",remove:"Supprimer",add:"Ajouter",yes:"Oui",no:"Non",table_of:"sur",download:"Télécharger",table_filter:"Filtrer",table_filter_hide:"Masquer le filtre",table_filter_active:"actif",table_filter_clear_all:"Effacer tous les filtres",table_new_record:"Nouvel enregistrement",table_export_excel:"Exporter vers Excel",doc_view_switch:"Changer de vue",doc_view_tree:"Vue arborescente",doc_view_list:"Vue liste",filter_sorting:"Tri",filter_ascending:"Croissant",filter_descending:"Décroissant",filter_section:"Filtre",filter_apply:"Appliquer",filter_clear:"Effacer",filter_contains:"Contient",filter_starts_with:"Commence par",filter_equals:"Égal à",filter_has_value:"A une valeur",filter_is_empty:"Est vide",filter_is_not_empty:"N'est pas vide",filter_exact:"Exact",filter_range:"Plage",filter_from:"De",filter_to:"À",filter_all:"Tous",filter_select_all:"Tous",filter_select_none:"Aucun",filter_search_value:"Valeur de recherche...",filter_no_support:"Le filtrage n'est pas disponible pour ce type de champ.",textblock_show_more:"Voir plus",close:"Fermer",history_until:"jusqu'au",history_badge_tooltip:"Valeurs précédentes",hyperlink_name:"Texte du lien (optionnel)"},de:{required:"Dieses Feld ist erforderlich",select_placeholder:"Option auswählen",search_placeholder:"Suchen...",upload_file:"Datei hochladen",choose_file:"Datei auswählen",clear:"Löschen",today:"Heute",invalid_email:"Bitte geben Sie eine gültige E-Mail-Adresse ein",invalid_url:"Bitte geben Sie eine gültige URL ein",invalid_number:"Bitte geben Sie eine gültige Zahl ein",drop_file_here:"Datei hier ablegen oder",browse:"durchsuchen",file_too_large:"Datei ist zu groß",search_results:"Suchergebnisse",no_results:"Keine Ergebnisse gefunden",loading:"Laden...",submit:"Speichern",cancel:"Abbrechen",remove:"Entfernen",add:"Hinzufügen",yes:"Ja",no:"Nein",table_of:"von",download:"Herunterladen",table_filter:"Filtern",table_filter_hide:"Filter ausblenden",table_filter_active:"aktiv",table_filter_clear_all:"Alle Filter löschen",table_new_record:"Neuer Eintrag",table_export_excel:"Als Excel exportieren",doc_view_switch:"Ansicht wechseln",doc_view_tree:"Baumansicht",doc_view_list:"Listenansicht",filter_sorting:"Sortierung",filter_ascending:"Aufsteigend",filter_descending:"Absteigend",filter_section:"Filter",filter_apply:"Anwenden",filter_clear:"Löschen",filter_contains:"Enthält",filter_starts_with:"Beginnt mit",filter_equals:"Gleich",filter_has_value:"Hat Wert",filter_is_empty:"Ist leer",filter_is_not_empty:"Ist nicht leer",filter_exact:"Genau",filter_range:"Bereich",filter_from:"Von",filter_to:"Bis",filter_all:"Alle",filter_select_all:"Alle",filter_select_none:"Keine",filter_search_value:"Suchwert...",filter_no_support:"Filterung ist für diesen Feldtyp nicht verfügbar.",textblock_show_more:"Mehr anzeigen",close:"Schließen",history_until:"bis",history_badge_tooltip:"Vorherige Werte",hyperlink_name:"Linktext (optional)"},es:{required:"Este campo es obligatorio",select_placeholder:"Seleccionar una opción",search_placeholder:"Buscar...",upload_file:"Subir archivo",choose_file:"Elegir archivo",clear:"Borrar",today:"Hoy",invalid_email:"Por favor, introduzca una dirección de correo electrónico válida",invalid_url:"Por favor, introduzca una URL válida",invalid_number:"Por favor, introduzca un número válido",drop_file_here:"Suelte el archivo aquí o",browse:"explorar",file_too_large:"El archivo es demasiado grande",search_results:"Resultados de búsqueda",no_results:"No se encontraron resultados",loading:"Cargando...",submit:"Guardar",cancel:"Cancelar",remove:"Eliminar",add:"Añadir",yes:"Sí",no:"No",table_of:"de",download:"Descargar",table_filter:"Filtrar",table_filter_hide:"Ocultar filtro",table_filter_active:"activo",table_filter_clear_all:"Borrar todos los filtros",table_new_record:"Nuevo registro",table_export_excel:"Exportar a Excel",doc_view_switch:"Cambiar vista",doc_view_tree:"Vista de árbol",doc_view_list:"Vista de lista",filter_sorting:"Ordenación",filter_ascending:"Ascendente",filter_descending:"Descendente",filter_section:"Filtro",filter_apply:"Aplicar",filter_clear:"Borrar",filter_contains:"Contiene",filter_starts_with:"Empieza por",filter_equals:"Igual a",filter_has_value:"Tiene valor",filter_is_empty:"Está vacío",filter_is_not_empty:"No está vacío",filter_exact:"Exacto",filter_range:"Rango",filter_from:"Desde",filter_to:"Hasta",filter_all:"Todos",filter_select_all:"Todos",filter_select_none:"Ninguno",filter_search_value:"Valor de búsqueda...",filter_no_support:"El filtrado no está disponible para este tipo de campo.",textblock_show_more:"Mostrar más",close:"Cerrar",history_until:"hasta",history_badge_tooltip:"Valores anteriores",hyperlink_name:"Texto del enlace (opcional)"},it:{required:"Questo campo è obbligatorio",select_placeholder:"Seleziona un'opzione",search_placeholder:"Cerca...",upload_file:"Carica file",choose_file:"Scegli file",clear:"Cancella",today:"Oggi",invalid_email:"Inserisci un indirizzo email valido",invalid_url:"Inserisci un URL valido",invalid_number:"Inserisci un numero valido",drop_file_here:"Trascina il file qui o",browse:"sfoglia",file_too_large:"Il file è troppo grande",search_results:"Risultati della ricerca",no_results:"Nessun risultato trovato",loading:"Caricamento...",submit:"Salva",cancel:"Annulla",remove:"Rimuovi",add:"Aggiungi",yes:"Sì",no:"No",table_of:"di",download:"Scarica",table_filter:"Filtra",table_filter_hide:"Nascondi filtro",table_filter_active:"attivo",table_filter_clear_all:"Cancella tutti i filtri",table_new_record:"Nuovo record",table_export_excel:"Esporta in Excel",doc_view_switch:"Cambia vista",doc_view_tree:"Vista ad albero",doc_view_list:"Vista elenco",filter_sorting:"Ordinamento",filter_ascending:"Crescente",filter_descending:"Decrescente",filter_section:"Filtro",filter_apply:"Applica",filter_clear:"Cancella",filter_contains:"Contiene",filter_starts_with:"Inizia con",filter_equals:"Uguale a",filter_has_value:"Ha valore",filter_is_empty:"È vuoto",filter_is_not_empty:"Non è vuoto",filter_exact:"Esatto",filter_range:"Intervallo",filter_from:"Da",filter_to:"A",filter_all:"Tutti",filter_select_all:"Tutti",filter_select_none:"Nessuno",filter_search_value:"Valore di ricerca...",filter_no_support:"Il filtro non è disponibile per questo tipo di campo.",textblock_show_more:"Mostra altro",close:"Chiudi",history_until:"fino a",history_badge_tooltip:"Valori precedenti",hyperlink_name:"Testo del collegamento (opzionale)"},uk:{required:"Це поле обов'язкове",select_placeholder:"Виберіть варіант",search_placeholder:"Пошук...",upload_file:"Завантажити файл",choose_file:"Вибрати файл",clear:"Очистити",today:"Сьогодні",invalid_email:"Будь ласка, введіть дійсну адресу електронної пошти",invalid_url:"Будь ласка, введіть дійсну URL-адресу",invalid_number:"Будь ласка, введіть дійсне число",drop_file_here:"Перетягніть файл сюди або",browse:"огляд",file_too_large:"Файл занадто великий",search_results:"Результати пошуку",no_results:"Результатів не знайдено",loading:"Завантаження...",submit:"Зберегти",cancel:"Скасувати",remove:"Видалити",add:"Додати",yes:"Так",no:"Ні",table_of:"з",download:"Завантажити",table_filter:"Фільтрувати",table_filter_hide:"Сховати фільтр",table_filter_active:"активний",table_filter_clear_all:"Очистити всі фільтри",table_new_record:"Новий запис",table_export_excel:"Експортувати до Excel",doc_view_switch:"Змінити вигляд",doc_view_tree:"Деревоподібний вигляд",doc_view_list:"Список",filter_sorting:"Сортування",filter_ascending:"За зростанням",filter_descending:"За спаданням",filter_section:"Фільтр",filter_apply:"Застосувати",filter_clear:"Очистити",filter_contains:"Містить",filter_starts_with:"Починається з",filter_equals:"Дорівнює",filter_has_value:"Має значення",filter_is_empty:"Порожнє",filter_is_not_empty:"Не порожнє",filter_exact:"Точно",filter_range:"Діапазон",filter_from:"Від",filter_to:"До",filter_all:"Всі",filter_select_all:"Всі",filter_select_none:"Жодного",filter_search_value:"Значення для пошуку...",filter_no_support:"Фільтрування недоступне для цього типу поля.",textblock_show_more:"Показати більше",close:"Закрити",history_until:"до",history_badge_tooltip:"Попередні значення",hyperlink_name:"Текст посилання (необов'язково)"}};function l(l,i){var t,r,a;const o=(null!=i?i:"en").split("-")[0].toLowerCase();return null!==(a=null!==(r=(null!==(t=e[o])&&void 0!==t?t:e.en)[l])&&void 0!==r?r:e.en[l])&&void 0!==a?a:l}export{l as t}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as t,createEvent as e,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{t as d}from"./i18n.js";import{d as a}from"./mrd-document-list2.js";import{d as s}from"./mrd-table2.js";const c=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdLoadPage=e(this,"mrdLoadPage",7),this.mrdLoadDistinct=e(this,"mrdLoadDistinct",7),this.mrdLoadAggregations=e(this,"mrdLoadAggregations",7),this.mrdNavigate=e(this,"mrdNavigate",7),this.mrdAction=e(this,"mrdAction",7),this.mrdUpdateObject=e(this,"mrdUpdateObject",7),this.mrdUpload=e(this,"mrdUpload",7),this.mrdCreateObject=e(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.viewKey="",this.locale=navigator.language,this.mode="tree",this.canCreate=!1,this.tableInited=!1,this.createFolder=()=>{var r,t;null===(t=null===(r=this.listEl)||void 0===r?void 0:r.createFolder)||void 0===t||t.call(r)}}componentDidRender(){var r;if("list"===this.mode&&this.tableEl&&!this.tableInited){this.tableInited=!0;const t=this.tableEl;Promise.resolve(null===(r=t.componentOnReady)||void 0===r?void 0:r.call(t)).then((()=>{var r;return null===(r=t.init)||void 0===r?void 0:r.call(t)}))}}setMode(r){r!==this.mode&&(this.canCreate=!1,this.tableInited=!1,this.mode=r)}renderToolbar(){return o("div",{class:"mrd-document-container__toolbar"},"tree"===this.mode&&o("button",{type:"button",class:"mrd-document-container__action",disabled:!this.canCreate,onClick:this.createFolder},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("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"}),o("path",{d:"M12 11v4M10 13h4"})),d("new_folder",this.locale)),o("div",{class:"mrd-document-container__seg",role:"group","aria-label":d("doc_view_switch",this.locale)},o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("tree"===this.mode),title:d("doc_view_tree",this.locale),"aria-label":d("doc_view_tree",this.locale),onClick:()=>this.setMode("tree")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M3 5h6M3 12h9M3 19h6"}),o("circle",{cx:"18",cy:"5",r:"1.6"}),o("circle",{cx:"18",cy:"19",r:"1.6"}),o("path",{d:"M16 12h4"}))),o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("list"===this.mode),title:d("doc_view_list",this.locale),"aria-label":d("doc_view_list",this.locale),onClick:()=>this.setMode("list")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})))))}renderTree(){return o("mrd-document-list",{"data-doclist":this.viewKey,ref:r=>this.listEl=r,item:this.item,archetype:this.archetype,parentId:this.parentId,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadDistinct.emit(r.detail)},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdCanCreate:r=>{r.stopPropagation(),this.canCreate=r.detail},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdUpload.emit(r.detail)},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(r.detail)}})}renderList(){return o("mrd-table",{"data-view":this.viewKey,ref:r=>this.tableEl=r,item:this.item,parentId:this.parentId,locale:this.locale,onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdLoadAggregations:r=>{r.stopPropagation(),this.mrdLoadAggregations.emit(r.detail)},onMrdRowClick:r=>{var t,e,o;r.stopPropagation();const i=r.detail;this.mrdNavigate.emit({href:null===(e=null===(t=null==i?void 0:i._links)||void 0===t?void 0:t.self)||void 0===e?void 0:e.href,label:null!==(o=null==i?void 0:i.name)&&void 0!==o?o:""})},onMrdAction:r=>{r.stopPropagation(),this.mrdAction.emit(r.detail)}})}render(){return o(i,{key:"a5393d484bdc202b57c6d32d9ce917e760aff95a"},this.renderToolbar(),o("div",{key:"52f82de8f7734e13f34d323e3e831e6de5676f46",class:"mrd-document-container__body"},"tree"===this.mode?this.renderTree():this.renderList()))}get el(){return this}static get style(){return".sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:#d9a441}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed='true'].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}"}},[2,"mrd-document-container",{item:[16],archetype:[16],parentId:[1,"parent-id"],viewKey:[1,"view-key"],locale:[1],mode:[32],canCreate:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-document-container","mrd-document-list","mrd-table"].forEach((r=>{switch(r){case"mrd-document-container":customElements.get(n(r))||customElements.define(n(r),c);break;case"mrd-document-list":customElements.get(n(r))||a();break;case"mrd-table":customElements.get(n(r))||s()}}))}export{c as M,m as d}
1
+ import{proxyCustomElement as r,HTMLElement as t,createEvent as e,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{t as d}from"./i18n.js";import{d as a}from"./mrd-document-list2.js";import{d as s}from"./mrd-table2.js";const c=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdLoadPage=e(this,"mrdLoadPage",7),this.mrdLoadDistinct=e(this,"mrdLoadDistinct",7),this.mrdLoadAggregations=e(this,"mrdLoadAggregations",7),this.mrdNavigate=e(this,"mrdNavigate",7),this.mrdAction=e(this,"mrdAction",7),this.mrdUpdateObject=e(this,"mrdUpdateObject",7),this.mrdUpload=e(this,"mrdUpload",7),this.mrdCreateObject=e(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.containerHref="",this.viewKey="",this.height=460,this.locale=navigator.language,this.mode="tree",this.canCreate=!1,this.tableInited=!1,this.createFolder=()=>{var r,t;null===(t=null===(r=this.listEl)||void 0===r?void 0:r.createFolder)||void 0===t||t.call(r)}}componentDidRender(){var r;if("list"===this.mode&&this.tableEl&&!this.tableInited){this.tableInited=!0;const t=this.tableEl;Promise.resolve(null===(r=t.componentOnReady)||void 0===r?void 0:r.call(t)).then((()=>{var r;return null===(r=t.init)||void 0===r?void 0:r.call(t)}))}}setMode(r){r!==this.mode&&(this.canCreate=!1,this.tableInited=!1,this.mode=r)}renderToolbar(){return o("div",{class:"mrd-document-container__toolbar"},"tree"===this.mode&&o("button",{type:"button",class:"mrd-document-container__action",disabled:!this.canCreate,onClick:this.createFolder},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("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"}),o("path",{d:"M12 11v4M10 13h4"})),d("new_folder",this.locale)),o("div",{class:"mrd-document-container__seg",role:"group","aria-label":d("doc_view_switch",this.locale)},o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("tree"===this.mode),title:d("doc_view_tree",this.locale),"aria-label":d("doc_view_tree",this.locale),onClick:()=>this.setMode("tree")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M3 5h6M3 12h9M3 19h6"}),o("circle",{cx:"18",cy:"5",r:"1.6"}),o("circle",{cx:"18",cy:"19",r:"1.6"}),o("path",{d:"M16 12h4"}))),o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("list"===this.mode),title:d("doc_view_list",this.locale),"aria-label":d("doc_view_list",this.locale),onClick:()=>this.setMode("list")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})))))}renderTree(){return o("mrd-document-list",{"data-doclist":this.viewKey,ref:r=>this.listEl=r,item:this.item,archetype:this.archetype,parentId:this.parentId,containerHref:this.containerHref,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadDistinct.emit(r.detail)},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdCanCreate:r=>{r.stopPropagation(),this.canCreate=r.detail},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdUpload.emit(r.detail)},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(r.detail)}})}renderList(){return o("mrd-table",{"data-view":this.viewKey,ref:r=>this.tableEl=r,item:this.item,parentId:this.parentId,locale:this.locale,onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdLoadAggregations:r=>{r.stopPropagation(),this.mrdLoadAggregations.emit(r.detail)},onMrdRowClick:r=>{var t,e,o;r.stopPropagation();const i=r.detail;this.mrdNavigate.emit({href:null===(e=null===(t=null==i?void 0:i._links)||void 0===t?void 0:t.self)||void 0===e?void 0:e.href,label:null!==(o=null==i?void 0:i.name)&&void 0!==o?o:""})},onMrdAction:r=>{r.stopPropagation(),this.mrdAction.emit(r.detail)}})}render(){const r="tree"===this.mode;return o(i,{key:"5d8a9a9bb4f1126a304b796aff9d1cb0100b8fc6"},this.renderToolbar(),o("div",{key:"80ac7e5dd39ffcc4161059447221045a6e035099",class:"mrd-document-container__body",style:r?{height:`${this.height}px`,overflowY:"auto"}:{}},r?this.renderTree():this.renderList()))}get el(){return this}static get style(){return".sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:#d9a441}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed='true'].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}"}},[2,"mrd-document-container",{item:[16],archetype:[16],parentId:[1,"parent-id"],containerHref:[1,"container-href"],viewKey:[1,"view-key"],height:[2],locale:[1],mode:[32],canCreate:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-document-container","mrd-document-list","mrd-table"].forEach((r=>{switch(r){case"mrd-document-container":customElements.get(n(r))||customElements.define(n(r),c);break;case"mrd-document-list":customElements.get(n(r))||a();break;case"mrd-table":customElements.get(n(r))||s()}}))}export{c as M,m as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,createEvent as s,h as r,Host as o,transformTag as e}from"@stencil/core/internal/client";import{a as n}from"./client-layout.js";import{t as d}from"./i18n.js";import{f as l}from"./format.js";const c=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadDistinct=s(this,"mrdLoadDistinct",7),this.mrdLoadPage=s(this,"mrdLoadPage",7),this.mrdNavigate=s(this,"mrdNavigate",7),this.mrdCanCreate=s(this,"mrdCanCreate",7),this.mrdUpdateObject=s(this,"mrdUpdateObject",7),this.mrdUpload=s(this,"mrdUpload",7),this.mrdCreateObject=s(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.locale=navigator.language,this.containers=[],this.rootLoading=!0,this.singleContainer=!1,this.selectedId=null,this.dropTargetId=null,this.uploadingNodeId=null,this.nodeIndex=new Map,this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1,this.newFolderSeq=0,this.lastCanCreate=!1,this.dragDoc=null,this.dragFromId=null,this.pendingUpload=null,this.lastOptimisticDoc=null,this.startCreateFolder=()=>{const t=this.resolveTarget();if(!t||this.pendingNode)return;const{target:i,container:s}=t,r=`${s.id}/__new__${this.newFolderSeq++}`,o=this.makeFolderNode(r,"",s.id);o.pending=!0,o.editing=!0,i.children=[...i.children,o],i.open=!0,this.nodeIndex.set(o.id,o),this.pendingNode=o,this.pendingParent=i,this.pendingContainer=s,this.pendingName="",this.pendingNeedsFocus=!0,this.bump()},this.onPendingInput=t=>{var i;this.pendingName=t.target.value,(null===(i=this.pendingNode)||void 0===i?void 0:i.error)&&(this.pendingNode.error=void 0,this.bump())},this.onPendingKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitFolder()):"Escape"===t.key&&(t.preventDefault(),this.cancelFolder())},this.onDocDragStart=(t,i,s)=>{var r,o,e;this.dragDoc=i,this.dragFromId=s.id,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",null!==(e=null===(o=null===(r=null==i?void 0:i._links)||void 0===r?void 0:r.self)||void 0===o?void 0:o.href)&&void 0!==e?e:""))},this.onDocDragEnd=()=>{this.dragDoc=null,this.dragFromId=null,null!==this.dropTargetId&&(this.dropTargetId=null)},this.onNodeDragOver=(t,i)=>{const s=this.isFileDrag(t);if(!this.dragDoc&&!s)return;t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect=s?"copy":"move");const r=s||i.id!==this.dragFromId?i.id:null;this.dropTargetId!==r&&(this.dropTargetId=r)},this.onNodeDragLeave=t=>{this.dropTargetId===t.id&&(this.dropTargetId=null)},this.onNodeDrop=(t,i,s)=>{if(this.isFileDrag(t))return t.preventDefault(),t.stopPropagation(),void this.startFileUpload(t,i,s);this.dragDoc&&(t.preventDefault(),t.stopPropagation(),this.moveDocument(i,s),this.onDocDragEnd())},this.onRootDragOver=t=>{if(!this.singleContainer)return;const i=this.isFileDrag(t);(this.dragDoc||i)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=i?"copy":"move"))},this.onRootDrop=t=>{if(!this.singleContainer)return;const i=this.containers[0];if(this.isFileDrag(t))return t.preventDefault(),void this.startFileUpload(t,i,i);this.dragDoc&&(t.preventDefault(),this.moveDocument(i,i),this.onDocDragEnd())}}componentDidLoad(){this.emitContainerDistinct()}componentDidRender(){this.pendingNeedsFocus&&this.pendingInputEl&&(this.pendingInputEl.focus(),this.pendingInputEl.select(),this.pendingNeedsFocus=!1);const t=this.canCreateFolder;t!==this.lastCanCreate&&(this.lastCanCreate=t,this.mrdCanCreate.emit(t))}get containerField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.container)&&void 0!==s?s:"container"}get folderField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.folder)&&void 0!==s?s:"folder"}get titleField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.title)&&void 0!==s?s:"name"}get fileField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.file)&&void 0!==s?s:"file"}get dateField(){var t,i;return null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.date}buildDataPath(){var t,i,s;const r=this.item,o=null!==(i=null!==(t=null==r?void 0:r.dataClass)&&void 0!==t?t:null==r?void 0:r.relatedClass)&&void 0!==i?i:"";return(null==r?void 0:r.type)===n.RELATED_VIEW?`/${null!==(s=r.fromClass)&&void 0!==s?s:""}/${this.parentId}/${o}`:`/${o}`}baseParams(){var t,i,s,r,o,e,n;const d=new URLSearchParams,l=null===(t=this.item)||void 0===t?void 0:t.filterClass;l&&d.set("type",l);for(const t of null!==(r=null===(s=null===(i=this.item)||void 0===i?void 0:i.view)||void 0===s?void 0:s.filter)&&void 0!==r?r:[])t.name&&("EMPTY"!==t.operator?"NOT_EMPTY"!==t.operator?"STARTS_WITH"!==t.operator?"FROM"!==t.operator?"TO"!==t.operator?null!=t.value&&d.set(t.name,String(t.value)):d.set(t.name+"_to",String(null!==(n=t.value)&&void 0!==n?n:"")):d.set(t.name+"_from",String(null!==(e=t.value)&&void 0!==e?e:"")):d.set(t.name+"_startswith",String(null!==(o=t.value)&&void 0!==o?o:"")):d.set(t.name+"_notempty","true"):d.set(t.name,""));return d}emitContainerDistinct(){const i=this.baseParams();i.set("distinct",this.containerField),this.mrdLoadDistinct.emit({nodeId:t.ROOT,distinct:this.containerField,path:this.buildDataPath()+"/distinct",qs:i.toString()})}emitFolderDistinct(t){var i;const s=this.baseParams();s.set("distinct",this.folderField),s.set(this.containerField+"_href",null!==(i=t.href)&&void 0!==i?i:""),t.loading=!0,this.mrdLoadDistinct.emit({nodeId:t.id,distinct:this.folderField,path:this.buildDataPath()+"/distinct",qs:s.toString()})}emitDocuments(t,i){var s,r;const o=this.baseParams();o.set(this.containerField+"_href",null!==(s=t.href)&&void 0!==s?s:""),o.set(this.folderField,null!==(r=i.fullPath)&&void 0!==r?r:""),i.loading=!0,this.mrdLoadPage.emit({nodeId:i.id,page:0,sort:"",path:this.buildDataPath(),qs:o.toString()})}async setDistinct(i,s){i===t.ROOT?this.applyContainers(s):this.applyFolders(i,s)}async setDocuments(t,i){const s=this.nodeIndex.get(t);s&&(s.docs=null!=i?i:[],s.docsLoaded=!0,s.loading=!1,this.bump())}applyContainers(t){const i=[];for(const s of t){if(!s.value||"object"!=typeof s.value)continue;const t=this.makeContainerNode(s.value.href,s.value.name,s.count);i.push(t),this.nodeIndex.set(t.id,t)}if(this.containers=i,this.rootLoading=!1,this.singleContainer=1===i.length,this.singleContainer){const t=i[0];t.open=!0,this.emitFolderDistinct(t)}}applyFolders(t,i){const s=this.nodeIndex.get(t);if(s){s.children=[],s.hasDocs=!1,s.docCount=0;for(const t of i){const i="string"==typeof t.value?t.value:null==t.value?"":String(t.value),r=this.splitFolder(i);if(0===r.length){s.hasDocs=!0,s.docCount=t.count,s.fullPath=i;continue}let o=s;const e=[];for(const t of r){e.push(t);let i=o.children.find((i=>i.label===t));i||(i=this.makeFolderNode(s.id+"/"+e.join("/"),t,s.id),o.children.push(i),this.nodeIndex.set(i.id,i)),o=i}o.hasDocs=!0,o.docCount=t.count,o.fullPath=i}this.computeTotals(s),s.foldersLoaded=!0,s.loading=!1,s.hasDocs&&!s.docsLoaded&&this.emitDocuments(s,s),this.bump()}}splitFolder(t){if(null==t)return[];const i=String(t).trim();return""===i||"/"===i?[]:i.split("/").map((t=>t.trim())).filter(Boolean)}makeContainerNode(t,i,s){return{id:"c:"+t,kind:"container",label:i,href:t,hasDocs:!1,docCount:0,totalCount:s,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}makeFolderNode(t,i,s){return{id:t,kind:"folder",label:i,containerId:s,hasDocs:!1,docCount:0,totalCount:0,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}computeTotals(t){let i=t.docCount;for(const s of t.children)i+=this.computeTotals(s);return t.totalCount=i,i}bump(){this.containers=[...this.containers]}toggleContainer(t){this.selectedId=t.id,t.open=!t.open,!t.open||t.foldersLoaded||t.loading||this.emitFolderDistinct(t),this.bump()}toggleFolder(t,i){this.selectedId=i.id,i.open=!i.open,i.open&&i.hasDocs&&!i.docsLoaded&&!i.loading&&this.emitDocuments(t,i),this.bump()}resolveTarget(){if(this.selectedId){const t=this.nodeIndex.get(this.selectedId);if(t&&"container"===t.kind)return{target:t,container:t};if(t&&"folder"===t.kind){const i=t.containerId?this.nodeIndex.get(t.containerId):void 0;if(i)return{target:t,container:i}}}if(this.singleContainer&&this.containers[0]){const t=this.containers[0];return{target:t,container:t}}return null}get canCreateFolder(){return!this.pendingNode&&null!==this.resolveTarget()}async createFolder(){this.startCreateFolder()}segmentsOf(t,i){if("container"===t.kind)return[];const s=i.id+"/",r=t.id.startsWith(s)?t.id.slice(s.length):"";return r?r.split("/"):[]}commitFolder(){const t=this.pendingNode,i=this.pendingParent,s=this.pendingContainer;if(!t||!i||!s)return;const r=this.pendingName.trim();if(!r)return void this.cancelFolder();if(r.includes("/"))return t.error=d("folder_no_slash",this.locale),void this.bump();if(i.children.some((i=>i!==t&&i.label.toLowerCase()===r.toLowerCase())))return t.error=d("folder_duplicate",this.locale),void this.bump();const o=[...this.segmentsOf(i,s),r];this.nodeIndex.delete(t.id),t.id=s.id+"/"+o.join("/"),t.fullPath="/"+o.join("/"),t.label=r,t.editing=!1,t.error=void 0,t.open=!0,this.nodeIndex.set(t.id,t),this.selectedId=t.id,this.clearPending(),this.bump()}cancelFolder(){const t=this.pendingNode,i=this.pendingParent;t&&i&&(i.children=i.children.filter((i=>i!==t)),this.nodeIndex.delete(t.id)),this.clearPending(),this.bump()}clearPending(){this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1}isFileDrag(t){return!this.dragDoc&&!!t.dataTransfer&&Array.from(t.dataTransfer.types).includes("Files")}startFileUpload(t,i,s){var r,o;const e=null===(o=null===(r=t.dataTransfer)||void 0===r?void 0:r.files)||void 0===o?void 0:o[0];this.dropTargetId=null,e&&(this.pendingUpload={file:e,node:i,container:s},i.open=!0,this.uploadingNodeId=i.id,this.bump(),this.mrdUpload.emit({file:e}))}stripExtension(t){return t.replace(/\.[^./\\]+$/,"")}async setFileReference(t){const i=this.pendingUpload;if(!i)return;const{file:s,node:r,container:o}=i,e=this.folderStringOf(r,o),n={[this.fileField]:t,[this.titleField]:this.stripExtension(s.name),[this.folderField]:e,[this.containerField]:o.href};this.mrdCreateObject.emit({path:this.buildDataPath(),values:n});const d={[this.titleField]:this.stripExtension(s.name),_optimistic:!0},l=!r.docsLoaded&&0===r.docCount;r.hasDocs=!0,r.pending=!1,r.docCount+=1,l?(r.docsLoaded=!0,r.docs=[d]):r.docsLoaded&&(r.docs=[...r.docs,d]),this.recomputeContainerTotals(o,1),this.lastOptimisticDoc=d,this.pendingUpload=null,this.uploadingNodeId=null,this.bump()}async setCreatedHref(t){var i;const s=this.lastOptimisticDoc;s&&t&&(s._links=Object.assign(Object.assign({},null!==(i=s._links)&&void 0!==i?i:{}),{self:{href:t}}),s._optimistic=!1,this.lastOptimisticDoc=null,this.bump())}folderStringOf(t,i){if("container"===t.kind)return null;if(null!=t.fullPath&&""!==t.fullPath)return t.fullPath;const s=this.segmentsOf(t,i);return s.length?"/"+s.join("/"):null}moveDocument(t,i){var s,r;const o=this.dragDoc,e=this.dragFromId?this.nodeIndex.get(this.dragFromId):void 0;if(!o||!e)return;const n="container"===e.kind?e:e.containerId?this.nodeIndex.get(e.containerId):void 0;if(!n)return;const d=this.folderStringOf(t,i),l=this.folderStringOf(e,n),c=i===n;if(t===e||c&&d===l)return;e.docs=e.docs.filter((t=>t!==o)),e.docCount=Math.max(0,e.docCount-1),e.docsLoaded&&(e.hasDocs=e.docs.length>0),t.hasDocs=!0,t.pending=!1,t.docCount+=1,"folder"===t.kind&&(t.fullPath=null!=d?d:""),t.docsLoaded&&(t.docs=[...t.docs,o]),this.recomputeContainerTotals(n,-1),c||this.recomputeContainerTotals(i,1);const a=null===(r=null===(s=null==o?void 0:o._links)||void 0===s?void 0:s.self)||void 0===r?void 0:r.href;if(a){const t={[this.folderField]:d};c||(t[this.containerField]=i.href),this.mrdUpdateObject.emit({href:a,values:t})}this.bump()}recomputeContainerTotals(t,i){t.foldersLoaded?this.computeTotals(t):t.totalCount=Math.max(0,t.totalCount+i)}openDoc(t){var i,s,r,o;const e=null===(s=null===(i=null==t?void 0:t._links)||void 0===i?void 0:i.self)||void 0===s?void 0:s.href,n=null!==(o=null!==(r=null==t?void 0:t[this.titleField])&&void 0!==r?r:null==t?void 0:t.name)&&void 0!==o?o:"";this.mrdNavigate.emit({href:e,label:n})}renderChevron(t,i){return r("span",{class:`mrd-document-list__chev${i?" mrd-document-list__chev--leaf":""}${t?" mrd-document-list__chev--open":""}`},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M9 6l6 6-6 6"})))}renderDossierIcon(){return r("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"},r("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"}))}renderFolderIcon(){return r("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"},r("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"}))}renderDocIcon(){return r("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"},r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r("path",{d:"M14 2v6h6"}))}indent(t){return r("span",{class:"mrd-document-list__indent",style:{width:18*t+"px"}})}renderDocRow(t,i,s,o){var e,n,d,c,a;const h=null!==(n=null!==(e=null==t?void 0:t[this.titleField])&&void 0!==e?e:null==t?void 0:t.name)&&void 0!==n?n:"",m=this.dateField?null==t?void 0:t[this.dateField]:void 0,u=m?l(m,this.locale):"";return r("div",{class:"mrd-document-list__row mrd-document-list__row--doc",key:null!==(a=null===(c=null===(d=null==t?void 0:t._links)||void 0===d?void 0:d.self)||void 0===c?void 0:c.href)&&void 0!==a?a:h,draggable:!0,onClick:()=>this.openDoc(t),onDragStart:s=>this.onDocDragStart(s,t,i),onDragEnd:this.onDocDragEnd,onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:t=>this.onNodeDrop(t,i,s)},this.indent(o),this.renderChevron(!1,!0),this.renderDocIcon(),r("span",{class:"mrd-document-list__label"},h),u&&r("span",{class:"mrd-document-list__date"},u))}renderLoadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"loading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("loading",this.locale))}renderChildren(t,i,s){const r=[];if(i.hasDocs)if(i.docsLoaded)for(const o of i.docs)r.push(this.renderDocRow(o,i,t,s));else i.loading&&r.push(this.renderLoadingRow(s));for(const o of i.children)r.push(this.renderFolderNode(t,o,s));return i.id===this.uploadingNodeId&&r.push(this.renderUploadingRow(s)),r}renderUploadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"uploading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("upload_file",this.locale))}renderFolderEditRow(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--edit"},this.indent(i),this.renderChevron(!1,!0),this.renderFolderIcon(),r("input",{class:"mrd-document-list__name-input",type:"text",placeholder:d("folder_name_placeholder",this.locale),ref:t=>this.pendingInputEl=t,onInput:this.onPendingInput,onKeyDown:this.onPendingKeyDown,onBlur:()=>this.cancelFolder()})),t.error&&r("div",{class:"mrd-document-list__error",style:{paddingLeft:18*i+52+"px"}},t.error))}renderFolderNode(t,i,s){if(i.editing)return this.renderFolderEditRow(i,s);const o=0===i.children.length&&!i.hasDocs;return r("div",{class:"mrd-document-list__node",key:i.id},r("div",{class:"mrd-document-list__row"+(i.id===this.selectedId?" mrd-document-list__row--selected":"")+(i.pending?" mrd-document-list__row--pending":"")+(i.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleFolder(t,i),onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:s=>this.onNodeDrop(s,i,t)},this.indent(s),this.renderChevron(i.open,o),this.renderFolderIcon(),r("span",{class:"mrd-document-list__label"},i.label),r("span",{class:"mrd-document-list__count"},i.totalCount)),i.open&&r("div",{class:"mrd-document-list__kids"},this.renderChildren(t,i,s+1)))}renderContainerNode(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--dossier"+(t.id===this.selectedId?" mrd-document-list__row--selected":"")+(t.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleContainer(t),onDragOver:i=>this.onNodeDragOver(i,t),onDragLeave:()=>this.onNodeDragLeave(t),onDrop:i=>this.onNodeDrop(i,t,t)},this.indent(i),this.renderChevron(t.open,!1),this.renderDossierIcon(),r("span",{class:"mrd-document-list__label"},t.label),r("span",{class:"mrd-document-list__count"},t.totalCount)),t.open&&r("div",{class:"mrd-document-list__kids"},t.loading&&!t.foldersLoaded?this.renderLoadingRow(i+1):this.renderChildren(t,t,i+1)))}render(){let t;if(this.rootLoading)t=this.renderLoadingRow(0);else if(0===this.containers.length)t=r("div",{key:"b8c3297cd7cff5bf79ce694d2ee1a64c570df5ce",class:"mrd-document-list__empty"},d("no_results",this.locale));else if(this.singleContainer){const i=this.containers[0];t=i.loading&&!i.foldersLoaded?this.renderLoadingRow(0):this.renderChildren(i,i,0)}else t=this.containers.map((t=>this.renderContainerNode(t,0)));return r(o,{key:"ff3b024a79ba2270aa28861923bc6406f98061aa"},r("div",{key:"9db121e5336a4e3c82443257f6424db5ab4f0baf",class:"mrd-document-list",onDragOver:this.onRootDragOver,onDrop:this.onRootDrop},t))}get el(){return this}static get style(){return".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--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}"}},[2,"mrd-document-list",{item:[16],archetype:[16],parentId:[1,"parent-id"],locale:[1],containers:[32],rootLoading:[32],singleContainer:[32],selectedId:[32],dropTargetId:[32],uploadingNodeId:[32],setDistinct:[64],setDocuments:[64],createFolder:[64],setFileReference:[64],setCreatedHref:[64]}]);function a(){"undefined"!=typeof customElements&&["mrd-document-list"].forEach((t=>{"mrd-document-list"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}c.ROOT="__root__";export{c as M,a as d}
1
+ import{proxyCustomElement as t,HTMLElement as i,createEvent as s,h as r,Host as o,transformTag as e}from"@stencil/core/internal/client";import{a as n}from"./client-layout.js";import{t as d}from"./i18n.js";import{f as l}from"./format.js";const c=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadDistinct=s(this,"mrdLoadDistinct",7),this.mrdLoadPage=s(this,"mrdLoadPage",7),this.mrdNavigate=s(this,"mrdNavigate",7),this.mrdCanCreate=s(this,"mrdCanCreate",7),this.mrdUpdateObject=s(this,"mrdUpdateObject",7),this.mrdUpload=s(this,"mrdUpload",7),this.mrdCreateObject=s(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.containerHref="",this.locale=navigator.language,this.containers=[],this.rootLoading=!0,this.singleContainer=!1,this.selectedId=null,this.dropTargetId=null,this.uploadingNodeId=null,this.rootDropActive=!1,this.nodeIndex=new Map,this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1,this.newFolderSeq=0,this.lastCanCreate=!1,this.dragDoc=null,this.dragFromId=null,this.pendingUpload=null,this.lastOptimisticDoc=null,this.startCreateFolder=()=>{const t=this.resolveTarget();if(!t||this.pendingNode)return;const{target:i,container:s}=t,r=`${s.id}/__new__${this.newFolderSeq++}`,o=this.makeFolderNode(r,"",s.id);o.pending=!0,o.editing=!0,i.children=[...i.children,o],i.open=!0,this.nodeIndex.set(o.id,o),this.pendingNode=o,this.pendingParent=i,this.pendingContainer=s,this.pendingName="",this.pendingNeedsFocus=!0,this.bump()},this.onPendingInput=t=>{var i;this.pendingName=t.target.value,(null===(i=this.pendingNode)||void 0===i?void 0:i.error)&&(this.pendingNode.error=void 0,this.bump())},this.onPendingKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitFolder()):"Escape"===t.key&&(t.preventDefault(),this.cancelFolder())},this.onDocDragStart=(t,i,s)=>{var r,o,e;this.dragDoc=i,this.dragFromId=s.id,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",null!==(e=null===(o=null===(r=null==i?void 0:i._links)||void 0===r?void 0:r.self)||void 0===o?void 0:o.href)&&void 0!==e?e:""))},this.onDocDragEnd=()=>{this.dragDoc=null,this.dragFromId=null,null!==this.dropTargetId&&(this.dropTargetId=null)},this.onNodeDragOver=(t,i)=>{const s=this.isFileDrag(t);if(!this.dragDoc&&!s)return;t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect=s?"copy":"move");const r=s||i.id!==this.dragFromId?i.id:null;this.dropTargetId!==r&&(this.dropTargetId=r)},this.onNodeDragLeave=t=>{this.dropTargetId===t.id&&(this.dropTargetId=null)},this.onNodeDrop=(t,i,s)=>{if(this.isFileDrag(t))return t.preventDefault(),t.stopPropagation(),void this.startFileUpload(t,i,s);this.dragDoc&&(t.preventDefault(),t.stopPropagation(),this.moveDocument(i,s),this.onDocDragEnd())},this.onRootDragOver=t=>{if(!this.singleContainer)return;const i=this.isFileDrag(t);(this.dragDoc||i)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=i?"copy":"move"),this.rootDropActive||(this.rootDropActive=!0))},this.onRootDragLeave=t=>{const i=t.relatedTarget;i&&this.el.contains(i)||this.rootDropActive&&(this.rootDropActive=!1)},this.onRootDrop=t=>{if(this.rootDropActive=!1,!this.singleContainer)return;const i=this.containers[0];if(this.isFileDrag(t))return t.preventDefault(),void this.startFileUpload(t,i,i);this.dragDoc&&(t.preventDefault(),this.moveDocument(i,i),this.onDocDragEnd())}}componentDidLoad(){this.isSeededSingleContainer()?this.seedSingleContainer():this.emitContainerDistinct()}isSeededSingleContainer(){var t,i;return(null===(t=this.item)||void 0===t?void 0:t.type)===n.RELATED_VIEW&&!!(null===(i=this.item)||void 0===i?void 0:i.inverseRelation)&&this.item.inverseRelation===this.containerField&&!!this.containerHref}seedSingleContainer(){const t=this.makeContainerNode(this.containerHref,this.containerField,0);this.nodeIndex.set(t.id,t),this.containers=[t],this.rootLoading=!1,this.singleContainer=!0,t.open=!0,this.emitFolderDistinct(t)}componentDidRender(){this.pendingNeedsFocus&&this.pendingInputEl&&(this.pendingInputEl.focus(),this.pendingInputEl.select(),this.pendingNeedsFocus=!1);const t=this.canCreateFolder;t!==this.lastCanCreate&&(this.lastCanCreate=t,this.mrdCanCreate.emit(t))}get containerField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.container)&&void 0!==s?s:"container"}get folderField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.folder)&&void 0!==s?s:"folder"}get titleField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.title)&&void 0!==s?s:"name"}get fileField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.file)&&void 0!==s?s:"file"}get dateField(){var t,i;return null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.date}buildDataPath(){var t,i,s;const r=this.item,o=null!==(i=null!==(t=null==r?void 0:r.dataClass)&&void 0!==t?t:null==r?void 0:r.relatedClass)&&void 0!==i?i:"";return(null==r?void 0:r.type)===n.RELATED_VIEW?`/${null!==(s=r.fromClass)&&void 0!==s?s:""}/${this.parentId}/${o}`:`/${o}`}buildCreatePath(){var t,i,s,r;const o=this.item,e=null!==(s=null!==(i=null!==(t=null==o?void 0:o.filterClass)&&void 0!==t?t:null==o?void 0:o.dataClass)&&void 0!==i?i:null==o?void 0:o.relatedClass)&&void 0!==s?s:"";return(null==o?void 0:o.type)===n.RELATED_VIEW?`/${null!==(r=o.fromClass)&&void 0!==r?r:""}/${this.parentId}/${e}`:`/${e}`}baseParams(){var t,i,s,r,o,e,n;const d=new URLSearchParams,l=null===(t=this.item)||void 0===t?void 0:t.filterClass;l&&d.set("type",l);for(const t of null!==(r=null===(s=null===(i=this.item)||void 0===i?void 0:i.view)||void 0===s?void 0:s.filter)&&void 0!==r?r:[])t.name&&("EMPTY"!==t.operator?"NOT_EMPTY"!==t.operator?"STARTS_WITH"!==t.operator?"FROM"!==t.operator?"TO"!==t.operator?null!=t.value&&d.set(t.name,String(t.value)):d.set(t.name+"_to",String(null!==(n=t.value)&&void 0!==n?n:"")):d.set(t.name+"_from",String(null!==(e=t.value)&&void 0!==e?e:"")):d.set(t.name+"_startswith",String(null!==(o=t.value)&&void 0!==o?o:"")):d.set(t.name+"_notempty","true"):d.set(t.name,""));return d}emitContainerDistinct(){const i=this.baseParams();i.set("distinct",this.containerField),this.mrdLoadDistinct.emit({nodeId:t.ROOT,distinct:this.containerField,path:this.buildDataPath()+"/distinct",qs:i.toString()})}emitFolderDistinct(t){var i;const s=this.baseParams();s.set("distinct",this.folderField),s.set(this.containerField+"_href",null!==(i=t.href)&&void 0!==i?i:""),t.loading=!0,this.mrdLoadDistinct.emit({nodeId:t.id,distinct:this.folderField,path:this.buildDataPath()+"/distinct",qs:s.toString()})}emitDocuments(t,i){var s,r;const o=this.baseParams();o.set(this.containerField+"_href",null!==(s=t.href)&&void 0!==s?s:""),o.set(this.folderField,null!==(r=i.fullPath)&&void 0!==r?r:""),i.loading=!0,this.mrdLoadPage.emit({nodeId:i.id,page:0,sort:"",path:this.buildDataPath(),qs:o.toString()})}async setDistinct(i,s){i===t.ROOT?this.applyContainers(s):this.applyFolders(i,s)}async setDocuments(t,i){const s=this.nodeIndex.get(t);s&&(s.docs=null!=i?i:[],s.docsLoaded=!0,s.loading=!1,this.bump())}applyContainers(t){const i=[];for(const s of t){if(!s.value||"object"!=typeof s.value)continue;const t=this.makeContainerNode(s.value.href,s.value.name,s.count);i.push(t),this.nodeIndex.set(t.id,t)}if(this.containers=i,this.rootLoading=!1,this.singleContainer=1===i.length,this.singleContainer){const t=i[0];t.open=!0,this.emitFolderDistinct(t)}}applyFolders(t,i){const s=this.nodeIndex.get(t);if(s){s.children=[],s.hasDocs=!1,s.docCount=0;for(const t of i){const i="string"==typeof t.value?t.value:null==t.value?"":String(t.value),r=this.splitFolder(i);if(0===r.length){s.hasDocs=!0,s.docCount=t.count,s.fullPath=i;continue}let o=s;const e=[];for(const t of r){e.push(t);let i=o.children.find((i=>i.label===t));i||(i=this.makeFolderNode(s.id+"/"+e.join("/"),t,s.id),o.children.push(i),this.nodeIndex.set(i.id,i)),o=i}o.hasDocs=!0,o.docCount=t.count,o.fullPath=i}this.computeTotals(s),s.foldersLoaded=!0,s.loading=!1,s.hasDocs&&!s.docsLoaded&&this.emitDocuments(s,s),this.bump()}}splitFolder(t){if(null==t)return[];const i=String(t).trim();return""===i||"/"===i?[]:i.split("/").map((t=>t.trim())).filter(Boolean)}makeContainerNode(t,i,s){return{id:"c:"+t,kind:"container",label:i,href:t,hasDocs:!1,docCount:0,totalCount:s,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}makeFolderNode(t,i,s){return{id:t,kind:"folder",label:i,containerId:s,hasDocs:!1,docCount:0,totalCount:0,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}computeTotals(t){let i=t.docCount;for(const s of t.children)i+=this.computeTotals(s);return t.totalCount=i,i}bump(){this.containers=[...this.containers]}toggleContainer(t){this.selectedId=t.id,t.open=!t.open,!t.open||t.foldersLoaded||t.loading||this.emitFolderDistinct(t),this.bump()}toggleFolder(t,i){this.selectedId=i.id,i.open=!i.open,i.open&&i.hasDocs&&!i.docsLoaded&&!i.loading&&this.emitDocuments(t,i),this.bump()}resolveTarget(){if(this.selectedId){const t=this.nodeIndex.get(this.selectedId);if(t&&"container"===t.kind)return{target:t,container:t};if(t&&"folder"===t.kind){const i=t.containerId?this.nodeIndex.get(t.containerId):void 0;if(i)return{target:t,container:i}}}if(this.singleContainer&&this.containers[0]){const t=this.containers[0];return{target:t,container:t}}return null}get canCreateFolder(){return!this.pendingNode&&null!==this.resolveTarget()}async createFolder(){this.startCreateFolder()}segmentsOf(t,i){if("container"===t.kind)return[];const s=i.id+"/",r=t.id.startsWith(s)?t.id.slice(s.length):"";return r?r.split("/"):[]}commitFolder(){const t=this.pendingNode,i=this.pendingParent,s=this.pendingContainer;if(!t||!i||!s)return;const r=this.pendingName.trim();if(!r)return void this.cancelFolder();if(r.includes("/"))return t.error=d("folder_no_slash",this.locale),void this.bump();if(i.children.some((i=>i!==t&&i.label.toLowerCase()===r.toLowerCase())))return t.error=d("folder_duplicate",this.locale),void this.bump();const o=[...this.segmentsOf(i,s),r];this.nodeIndex.delete(t.id),t.id=s.id+"/"+o.join("/"),t.fullPath="/"+o.join("/"),t.label=r,t.editing=!1,t.error=void 0,t.open=!0,this.nodeIndex.set(t.id,t),this.selectedId=t.id,this.clearPending(),this.bump()}cancelFolder(){const t=this.pendingNode,i=this.pendingParent;t&&i&&(i.children=i.children.filter((i=>i!==t)),this.nodeIndex.delete(t.id)),this.clearPending(),this.bump()}clearPending(){this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1}isFileDrag(t){return!this.dragDoc&&!!t.dataTransfer&&Array.from(t.dataTransfer.types).includes("Files")}startFileUpload(t,i,s){var r,o;const e=null===(o=null===(r=t.dataTransfer)||void 0===r?void 0:r.files)||void 0===o?void 0:o[0];this.dropTargetId=null,e&&(this.pendingUpload={file:e,node:i,container:s},i.open=!0,this.uploadingNodeId=i.id,this.bump(),this.mrdUpload.emit({file:e}))}stripExtension(t){return t.replace(/\.[^./\\]+$/,"")}async setFileReference(t){const i=this.pendingUpload;if(!i)return;const{file:s,node:r,container:o}=i,e=this.folderStringOf(r,o),n={[this.fileField]:t,[this.titleField]:this.stripExtension(s.name),[this.folderField]:e,[this.containerField]:o.href};this.mrdCreateObject.emit({path:this.buildCreatePath(),values:n});const d={[this.titleField]:this.stripExtension(s.name),_optimistic:!0},l=!r.docsLoaded&&0===r.docCount;r.hasDocs=!0,r.pending=!1,r.docCount+=1,l?(r.docsLoaded=!0,r.docs=[d]):r.docsLoaded&&(r.docs=[...r.docs,d]),this.recomputeContainerTotals(o,1),this.lastOptimisticDoc=d,this.pendingUpload=null,this.uploadingNodeId=null,this.bump()}async setCreatedHref(t){var i;const s=this.lastOptimisticDoc;s&&t&&(s._links=Object.assign(Object.assign({},null!==(i=s._links)&&void 0!==i?i:{}),{self:{href:t}}),s._optimistic=!1,this.lastOptimisticDoc=null,this.bump())}folderStringOf(t,i){if("container"===t.kind)return null;if(null!=t.fullPath&&""!==t.fullPath)return t.fullPath;const s=this.segmentsOf(t,i);return s.length?"/"+s.join("/"):null}moveDocument(t,i){var s,r;const o=this.dragDoc,e=this.dragFromId?this.nodeIndex.get(this.dragFromId):void 0;if(!o||!e)return;const n="container"===e.kind?e:e.containerId?this.nodeIndex.get(e.containerId):void 0;if(!n)return;const d=this.folderStringOf(t,i),l=this.folderStringOf(e,n),c=i===n;if(t===e||c&&d===l)return;e.docs=e.docs.filter((t=>t!==o)),e.docCount=Math.max(0,e.docCount-1),e.docsLoaded&&(e.hasDocs=e.docs.length>0),t.hasDocs=!0,t.pending=!1,t.docCount+=1,"folder"===t.kind&&(t.fullPath=null!=d?d:""),t.docsLoaded&&(t.docs=[...t.docs,o]),this.recomputeContainerTotals(n,-1),c||this.recomputeContainerTotals(i,1);const h=null===(r=null===(s=null==o?void 0:o._links)||void 0===s?void 0:s.self)||void 0===r?void 0:r.href;if(h){const t={[this.folderField]:d};c||(t[this.containerField]=i.href),this.mrdUpdateObject.emit({href:h,values:t})}this.bump()}recomputeContainerTotals(t,i){t.foldersLoaded?this.computeTotals(t):t.totalCount=Math.max(0,t.totalCount+i)}openDoc(t){var i,s,r,o;const e=null===(s=null===(i=null==t?void 0:t._links)||void 0===i?void 0:i.self)||void 0===s?void 0:s.href,n=null!==(o=null!==(r=null==t?void 0:t[this.titleField])&&void 0!==r?r:null==t?void 0:t.name)&&void 0!==o?o:"";this.mrdNavigate.emit({href:e,label:n})}renderChevron(t,i){return r("span",{class:`mrd-document-list__chev${i?" mrd-document-list__chev--leaf":""}${t?" mrd-document-list__chev--open":""}`},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M9 6l6 6-6 6"})))}renderDossierIcon(){return r("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"},r("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"}))}renderFolderIcon(){return r("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"},r("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"}))}renderDocIcon(){return r("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"},r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r("path",{d:"M14 2v6h6"}))}indent(t){return r("span",{class:"mrd-document-list__indent",style:{width:18*t+"px"}})}renderDocRow(t,i,s,o){var e,n,d,c,h;const a=null!==(n=null!==(e=null==t?void 0:t[this.titleField])&&void 0!==e?e:null==t?void 0:t.name)&&void 0!==n?n:"",m=this.dateField?null==t?void 0:t[this.dateField]:void 0,u=m?l(m,this.locale):"";return r("div",{class:"mrd-document-list__row mrd-document-list__row--doc",key:null!==(h=null===(c=null===(d=null==t?void 0:t._links)||void 0===d?void 0:d.self)||void 0===c?void 0:c.href)&&void 0!==h?h:a,draggable:!0,onClick:()=>this.openDoc(t),onDragStart:s=>this.onDocDragStart(s,t,i),onDragEnd:this.onDocDragEnd,onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:t=>this.onNodeDrop(t,i,s)},this.indent(o),this.renderChevron(!1,!0),this.renderDocIcon(),r("span",{class:"mrd-document-list__label"},a),u&&r("span",{class:"mrd-document-list__date"},u))}renderLoadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"loading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("loading",this.locale))}renderChildren(t,i,s){const r=[];if(i.hasDocs)if(i.docsLoaded)for(const o of i.docs)r.push(this.renderDocRow(o,i,t,s));else i.loading&&r.push(this.renderLoadingRow(s));for(const o of i.children)r.push(this.renderFolderNode(t,o,s));return i.id===this.uploadingNodeId&&r.push(this.renderUploadingRow(s)),r}renderUploadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"uploading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("upload_file",this.locale))}renderFolderEditRow(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--edit"},this.indent(i),this.renderChevron(!1,!0),this.renderFolderIcon(),r("input",{class:"mrd-document-list__name-input",type:"text",placeholder:d("folder_name_placeholder",this.locale),ref:t=>this.pendingInputEl=t,onInput:this.onPendingInput,onKeyDown:this.onPendingKeyDown,onBlur:()=>this.cancelFolder()})),t.error&&r("div",{class:"mrd-document-list__error",style:{paddingLeft:18*i+52+"px"}},t.error))}renderFolderNode(t,i,s){if(i.editing)return this.renderFolderEditRow(i,s);const o=0===i.children.length&&!i.hasDocs;return r("div",{class:"mrd-document-list__node",key:i.id},r("div",{class:"mrd-document-list__row"+(i.id===this.selectedId?" mrd-document-list__row--selected":"")+(i.pending?" mrd-document-list__row--pending":"")+(i.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleFolder(t,i),onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:s=>this.onNodeDrop(s,i,t)},this.indent(s),this.renderChevron(i.open,o),this.renderFolderIcon(),r("span",{class:"mrd-document-list__label"},i.label),r("span",{class:"mrd-document-list__count"},i.totalCount)),i.open&&r("div",{class:"mrd-document-list__kids"},this.renderChildren(t,i,s+1)))}renderContainerNode(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--dossier"+(t.id===this.selectedId?" mrd-document-list__row--selected":"")+(t.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleContainer(t),onDragOver:i=>this.onNodeDragOver(i,t),onDragLeave:()=>this.onNodeDragLeave(t),onDrop:i=>this.onNodeDrop(i,t,t)},this.indent(i),this.renderChevron(t.open,!1),this.renderDossierIcon(),r("span",{class:"mrd-document-list__label"},t.label),r("span",{class:"mrd-document-list__count"},t.totalCount)),t.open&&r("div",{class:"mrd-document-list__kids"},t.loading&&!t.foldersLoaded?this.renderLoadingRow(i+1):this.renderChildren(t,t,i+1)))}render(){let t;if(this.rootLoading)t=this.renderLoadingRow(0);else if(0===this.containers.length)t=r("div",{key:"9c38a2e26320a8173ba82cac412c1b32a8a1882e",class:"mrd-document-list__empty"},d("no_results",this.locale));else if(this.singleContainer){const i=this.containers[0];if(i.loading&&!i.foldersLoaded)t=this.renderLoadingRow(0);else{const s=this.renderChildren(i,i,0);t=s.length?s:r("div",{class:"mrd-document-list__empty"},d("doc_empty_drop",this.locale))}}else t=this.containers.map((t=>this.renderContainerNode(t,0)));return r(o,{key:"dd83a6a609e01d21a2b5da5b3ab929f6f9315402"},r("div",{key:"d539d938e1efd759730cccc90c4d6c2e535db936",class:"mrd-document-list"+(this.rootDropActive?" mrd-document-list--drop-active":""),onDragOver:this.onRootDragOver,onDragLeave:this.onRootDragLeave,onDrop:this.onRootDrop},t))}get el(){return this}static get style(){return".sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}"}},[2,"mrd-document-list",{item:[16],archetype:[16],parentId:[1,"parent-id"],containerHref:[1,"container-href"],locale:[1],containers:[32],rootLoading:[32],singleContainer:[32],selectedId:[32],dropTargetId:[32],uploadingNodeId:[32],rootDropActive:[32],setDistinct:[64],setDocuments:[64],createFolder:[64],setFileReference:[64],setCreatedHref:[64]}]);function h(){"undefined"!=typeof customElements&&["mrd-document-list"].forEach((t=>{"mrd-document-list"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}c.ROOT="__root__";export{c as M,h as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as t,createEvent as o,h as e,Host as a,transformTag as i}from"@stencil/core/internal/client";import{a as s,b as n,r as l,A as d}from"./client-layout.js";import{C as c,d as m}from"./mrd-table2.js";import{t as u}from"./i18n.js";import{f as h}from"./format.js";import{d as v}from"./mrd-document-container2.js";import{d as y}from"./mrd-document-list2.js";import{d as p}from"./mrd-document-view2.js";const f=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=o(this,"mrdNavigate",7),this.mrdSearch=o(this,"mrdSearch",7),this.mrdDownload=o(this,"mrdDownload",7),this.mrdLoadViewPage=o(this,"mrdLoadViewPage",7),this.mrdLoadImage=o(this,"mrdLoadImage",7),this.mrdViewAction=o(this,"mrdViewAction",7),this.mrdLoadViewAggregations=o(this,"mrdLoadViewAggregations",7),this.mrdLoadViewDistinct=o(this,"mrdLoadViewDistinct",7),this.mrdUpdateObject=o(this,"mrdUpdateObject",7),this.mrdViewUpload=o(this,"mrdViewUpload",7),this.mrdCreateObject=o(this,"mrdCreateObject",7),this.items=[],this.data={},this.views={},this.links={},this.locale=navigator.language,this.archetypes=[],this.searchQueryMap={},this.searchResultsMap={},this.imagePreviewUrl=null,this.imagePreviews={},this.openHistoryField=null,this.historyClickOutside=null,this.searchTimers={},this.handleViewLoadPage=(r,t)=>{r.stopPropagation(),this.mrdLoadViewPage.emit({name:t,page:r.detail.page,sort:r.detail.sort,path:r.detail.path,qs:r.detail.qs})},this.handleSearchInput=(r,t)=>{this.searchQueryMap=Object.assign(Object.assign({},this.searchQueryMap),{[r]:t}),this.searchTimers[r]&&clearTimeout(this.searchTimers[r]),t.length<2?this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[r]:[]}):this.searchTimers[r]=setTimeout((()=>{this.mrdSearch.emit({query:t,dataClass:r})}),300)}}componentDidLoad(){setTimeout((()=>{this.initEmbeddedTables(),this.emitLoadImages()}),0),this.historyClickOutside=r=>{this.el.contains(r.target)||(this.openHistoryField=null)},document.addEventListener("mousedown",this.historyClickOutside)}disconnectedCallback(){this.historyClickOutside&&(document.removeEventListener("mousedown",this.historyClickOutside),this.historyClickOutside=null)}dataChanged(r){r&&Object.keys(r).length>0&&setTimeout((()=>this.initEmbeddedTables()),0)}async initEmbeddedTables(){const r=this.el.querySelectorAll("mrd-table[data-view]");for(const t of Array.from(r))"function"==typeof t.init&&await t.init()}viewKeyFor(r){var t,o,e,a;return r.type===s.RELATED_VIEW?null!==(o=null!==(t=r.relatedClass)&&void 0!==t?t:r.name)&&void 0!==o?o:"":null!==(a=null!==(e=r.dataClass)&&void 0!==e?e:r.name)&&void 0!==a?a:""}emitLoadImages(){for(const r of this.flattenItems(this.items))if(r.type===s.FIELD&&r.dataType===n.IMAGE){const t=r.name,o=this.data[t],e=null==o?void 0:o.href;e&&this.mrdLoadImage.emit({fieldName:t,href:e})}}flattenItems(r){const t=[];for(const o of r)t.push(o),o.items&&t.push(...this.flattenItems(o.items));return t}async setSearchResults(r,t){const o=null!=t?t:this.resolveSearchKey();o&&(this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[o]:r}))}async setViewPage(r,t,o,e,a,i){if(i){const t=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);return void((null==t?void 0:t.setDocuments)&&await t.setDocuments(i,o))}const s=this.el.querySelector(`mrd-table[data-view="${r}"]`);s&&(void 0!==e&&(s.totalElements=e),await s.setPage(t,o,a))}async setViewAggregations(r,t){const o=this.el.querySelector(`mrd-table[data-view="${r}"]`);o&&await o.setAggregations(t)}async setViewDistinct(r,t,o){const e=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==e?void 0:e.setDistinct)&&await e.setDistinct(t,o)}async setViewFileReference(r,t){const o=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==o?void 0:o.setFileReference)&&await o.setFileReference(t)}async setViewCreatedObject(r,t){const o=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==o?void 0:o.setCreatedHref)&&await o.setCreatedHref(t)}async setImagePreview(r,t){this.imagePreviews=Object.assign(Object.assign({},this.imagePreviews),{[r]:t})}async openImagePreview(r){this.imagePreviewUrl=r}resolveSearchKey(){var r;const t=this.flattenItems(this.items).filter((r=>r.type===s.SEARCH));return 1===t.length&&null!==(r=t[0].dataClass)&&void 0!==r?r:null}renderSingleFieldValue(r,t){var o,a,i,s,l,d,m,h,v,y,p;const f=r.dataType;switch(f){case n.HYPERLINK:{const r=null!==(o=null==t?void 0:t.href)&&void 0!==o?o:t+"",n=null!==(s=null!==(i=null!==(a=null==t?void 0:t.name)&&void 0!==a?a:null==t?void 0:t.text)&&void 0!==i?i:null==t?void 0:t.label)&&void 0!==s?s:r;return e("a",{class:"mrd-layout-section__link",href:r,target:"_blank",rel:"noopener noreferrer"},n)}case n.TEXTBLOCK:return e("div",{class:"mrd-layout-section__prose",innerHTML:t+""});case n.LONGTEXT:return e("pre",{class:"mrd-layout-section__pre"},t+"");case n.JSON:return e("pre",{class:"mrd-layout-section__pre",innerHTML:c.formatJson(t)});case n.FILE:{const r=null!==(l=null==t?void 0:t.fileName)&&void 0!==l?l:t+"",o=null!==(d=null==t?void 0:t.href)&&void 0!==d?d:"";return e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:r})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),u("download",this.locale))}case n.IMAGE:{const o=null!==(m=null==t?void 0:t.href)&&void 0!==m?m:"",a=null!==(h=null==t?void 0:t.fileName)&&void 0!==h?h:"",i=this.imagePreviews[r.name];return i?e("button",{class:"mrd-layout-section__image-thumb-btn",onClick:()=>{this.imagePreviewUrl=i},title:a||void 0},e("img",{class:"mrd-layout-section__image-thumb",src:i,alt:a})):e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:a})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),a||o)}case n.BOOLEAN:return e("span",{class:"mrd-layout-section__boolean mrd-layout-section__boolean--"+(t?"true":"false")},u(t?"yes":"no",this.locale));case n.LIST:{const o=(null!==(v=r.listItems)&&void 0!==v?v:[]).find((r=>r.key===t+"")),a=null!==(y=null==o?void 0:o.label)&&void 0!==y?y:t+"",i=null==o?void 0:o.color,s=null==o?void 0:o.backgroundColor;return i&&s?e("span",{class:"mrd-layout-section__badge",style:{color:i,backgroundColor:s}},a):i?e("span",{class:"mrd-layout-section__badge-dot-row"},e("span",{class:"mrd-layout-section__badge-dot",style:{backgroundColor:i}}),a):a}case n.SECRET:return t?e("span",{class:"mrd-layout-section__secret-masked"},"••••••••"):null;default:return c.renderValue(f,t,null!==(p=r.listItems)&&void 0!==p?p:[],this.locale)||null}}renderFieldValue(r,t){if(null==t||""===t)return null;if(r.multiple&&Array.isArray(t)){const o=t.map((t=>this.renderSingleFieldValue(r,t)));return o.every((r=>"string"==typeof r||null==r))?o.filter(Boolean).join(", ")||null:e("span",null,o.map(((r,t)=>e("span",{key:t+""},r,t<o.length-1?", ":""))))}return this.renderSingleFieldValue(r,t)}renderHistoryBadge(r,t){var o,a,i;if(!(null!==(o=r.historyEnabled)&&void 0!==o?o:null===(a=r.field)||void 0===a?void 0:a.historyEnabled)||!r.name)return null;const s=null!==(i=null==t?void 0:t.history)&&void 0!==i?i:[];if(!s.length)return null;const n=[...s].sort(((r,t)=>t.until.localeCompare(r.until))),l=this.openHistoryField===r.name,{locale:d}=this;return e("span",{class:"mrd-layout-section__history-wrap"},e("button",{type:"button",class:"mrd-layout-section__history-btn",title:u("history_badge_tooltip",d),"aria-label":u("history_badge_tooltip",d),onClick:t=>{t.stopPropagation(),this.openHistoryField=l?null:r.name}},e("svg",{class:"mrd-layout-section__history-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.75-13a.75.75 0 00-1.5 0v5c0 .207.085.394.22.53l2.5 2.5a.75.75 0 101.06-1.06L10.75 9.69V5z","clip-rule":"evenodd"}))),l&&e("div",{class:"mrd-layout-section__history-popover",role:"listbox"},n.map(((r,t)=>e("div",{key:t+"",class:"mrd-layout-section__history-entry"},r.value," (",u("history_until",d)," ",h(r.until,d),")")))))}renderField(r){var t,o;if(!r.name)return null;const a=this.data[r.name],i=(null!==(t=r.historyEnabled)&&void 0!==t?t:null===(o=r.field)||void 0===o?void 0:o.historyEnabled)&&null!==a&&"object"==typeof a&&"current"in a?a.current:a,s=this.renderFieldValue(r,i);return r.header?e("h1",{class:"mrd-layout-section__field-header",key:r.name},"string"==typeof s?s:null!=i?i+"":r.label):null==s?null:e("div",{class:"mrd-layout-section__field"+(r.dataType===n.TEXTBLOCK||r.dataType===n.LONGTEXT||r.dataType===n.JSON?" mrd-layout-section__field--block":""),key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},s,this.renderHistoryBadge(r,a)))}renderRelation(r){var t,o,a;if(!r.name)return null;const i=(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==o?o:{})[r.name];if(!i)return null;const s=(r,t)=>e("button",{key:r,class:"mrd-layout-section__relation-link",onClick:()=>this.mrdNavigate.emit({href:r,label:t})},t);let n;return(null===(a=i.values)||void 0===a?void 0:a.length)?n=i.values.map((r=>s(r.href,r.name))):i.name&&(n=s(i.href,i.name)),n?e("div",{class:"mrd-layout-section__field",key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},n)):null}renderSearch(r){var t,o,a;if(!r.dataClass)return null;const i=r.dataClass,s=null!==(t=this.searchQueryMap[i])&&void 0!==t?t:"",n=null!==(o=this.searchResultsMap[i])&&void 0!==o?o:[];return e("div",{class:"mrd-layout-section__search",key:"search-"+i},e("div",{class:"mrd-layout-section__search-wrap"},e("svg",{class:"mrd-layout-section__search-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("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"})),e("input",{class:"mrd-layout-section__search-input",type:"text",value:s,placeholder:null!==(a=r.label)&&void 0!==a?a:"",onInput:r=>this.handleSearchInput(i,r.target.value)})),n.length>0&&e("ul",{class:"mrd-layout-section__search-results"},n.map((r=>e("li",{key:r.id,class:"mrd-layout-section__search-result"},e("button",{class:"mrd-layout-section__search-result-btn",onClick:()=>this.mrdNavigate.emit({href:r.id,label:r.label})},e("span",{class:"mrd-layout-section__search-result-label"},r.label),r.description&&e("span",{class:"mrd-layout-section__search-result-desc"},r.description)))))))}renderRelatedView(r){var t,o,a,i,s,n,c,m;const u=this.viewKeyFor(r);if(!u)return null;if(!r.view)return null;const h=null!==(t=r.showTitle)&&void 0!==t&&t,v=null!==(n=(null!==(s=null===(i=null===(a=null===(o=this.data)||void 0===o?void 0:o._links)||void 0===a?void 0:a.self)||void 0===i?void 0:i.href)&&void 0!==s?s:"").split("/").filter(Boolean).pop())&&void 0!==n?n:"",y=l(null!==(c=r.archetypes)&&void 0!==c?c:null===(m=r.view)||void 0===m?void 0:m.archetypes,d);return e("div",{class:"mrd-layout-section__related-view",key:"view-"+u},h&&r.label&&e("h3",{class:"mrd-layout-section__related-view-title"},r.label),y?this.renderDocumentContainer(r,u,v,y):this.renderTable(r,u,v))}renderDocumentContainer(r,t,o,a){return e("mrd-document-container",{item:r,archetype:a,parentId:o,viewKey:t,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadViewDistinct.emit(Object.assign({name:t},r.detail))},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadViewPage.emit(Object.assign({name:t},r.detail))},onMrdLoadAggregations:o=>{var e;o.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdAction:o=>{var e;o.stopPropagation(),this.mrdViewAction.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdViewUpload.emit(Object.assign({name:t},r.detail))},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(Object.assign({name:t},r.detail))}})}renderTable(r,t,o){return e("mrd-table",{"data-view":t,item:r,parentId:o,locale:this.locale,onMrdLoadPage:r=>this.handleViewLoadPage(r,t),onMrdLoadAggregations:o=>{var e;o.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdRowClick:r=>{var t,o,e;r.stopPropagation();const a=r.detail;this.mrdNavigate.emit({href:null===(o=null===(t=null==a?void 0:a._links)||void 0===t?void 0:t.self)||void 0===o?void 0:o.href,label:null!==(e=null==a?void 0:a.name)&&void 0!==e?e:""})},onMrdAction:o=>{var e;o.stopPropagation(),this.mrdViewAction.emit({name:t,action:o.detail.action,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t,path:o.detail.path,qs:o.detail.qs,parentPath:o.detail.parentPath,basicType:o.detail.basicType})}})}renderItem(r){var t,o;switch(r.type){case s.FIELD:return this.renderField(r);case s.RELATION:return this.renderRelation(r);case s.HEADER:return e("h2",{class:"mrd-layout-section__header",key:"header-"+r.label},r.label);case s.TEXT:return e("div",{class:"mrd-layout-section__text",key:"text-"+r.label,innerHTML:null!==(t=r.label)&&void 0!==t?t:""});case s.NAVIGATE:return e("button",{class:"mrd-layout-section__navigate",key:"nav-"+r.label,onClick:()=>{var t,o,e;return this.mrdNavigate.emit({label:null!==(t=r.label)&&void 0!==t?t:"",navigate:null!==(o=r.navigate)&&void 0!==o?o:{dataClass:null!==(e=r.dataClass)&&void 0!==e?e:"",icon:r.icon,navigationType:r.navigationType}})}},r.label);case s.SEARCH:return this.renderSearch(r);case s.SECTION:case s.GROUP:return e("div",{class:"mrd-layout-section__group",key:"group-"+r.label},r.label&&e("h3",{class:"mrd-layout-section__group-title"},r.label),(null!==(o=r.items)&&void 0!==o?o:[]).map((r=>this.renderItem(r))));case s.RELATED_VIEW:case s.VIEW:return this.renderRelatedView(r);default:return null}}renderImageModal(){return this.imagePreviewUrl?e("div",{class:"mrd-layout-section__modal-backdrop",onClick:()=>{this.imagePreviewUrl=null}},e("div",{class:"mrd-layout-section__modal",onClick:r=>r.stopPropagation()},e("button",{class:"mrd-layout-section__modal-close",onClick:()=>{this.imagePreviewUrl=null}},"✕"),e("img",{class:"mrd-layout-section__modal-image",src:this.imagePreviewUrl,alt:""}))):null}renderDocumentObject(r){const t=this.items.filter((r=>r.type===s.VIEW||r.type===s.RELATED_VIEW||r.type===s.SEARCH));return[e("mrd-document-view",{archetype:r,data:this.data,locale:this.locale,onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdDownload:r=>{r.stopPropagation(),this.mrdDownload.emit(r.detail)}}),...t.map((r=>this.renderItem(r)))]}render(){const r=l(this.archetypes,d);return e(a,{key:"6e737354daec0137b6ebe304efcce9990f02739f"},e("div",{key:"31a73a8a78999793f5dacee5f2da41df5f23156e",class:"mrd-layout-section"},r?this.renderDocumentObject(r):this.items.map((r=>this.renderItem(r)))),this.renderImageModal())}get el(){return this}static get watchers(){return{data:[{dataChanged:0}]}}static get style(){return".mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}"}},[2,"mrd-layout-section",{items:[16],data:[16],views:[16],links:[16],locale:[1],archetypes:[16],searchQueryMap:[32],searchResultsMap:[32],imagePreviewUrl:[32],imagePreviews:[32],openHistoryField:[32],setSearchResults:[64],setViewPage:[64],setViewAggregations:[64],setViewDistinct:[64],setViewFileReference:[64],setViewCreatedObject:[64],setImagePreview:[64],openImagePreview:[64]},void 0,{data:[{dataChanged:0}]}]),_=f,g=function(){"undefined"!=typeof customElements&&["mrd-layout-section","mrd-document-container","mrd-document-list","mrd-document-view","mrd-table"].forEach((r=>{switch(r){case"mrd-layout-section":customElements.get(i(r))||customElements.define(i(r),f);break;case"mrd-document-container":customElements.get(i(r))||v();break;case"mrd-document-list":customElements.get(i(r))||y();break;case"mrd-document-view":customElements.get(i(r))||p();break;case"mrd-table":customElements.get(i(r))||m()}}))};export{_ as MrdLayoutSection,g as defineCustomElement}
1
+ import{proxyCustomElement as r,HTMLElement as t,createEvent as o,h as e,Host as a,transformTag as i}from"@stencil/core/internal/client";import{a as s,b as n,r as l,A as d}from"./client-layout.js";import{C as c,d as m}from"./mrd-table2.js";import{t as u}from"./i18n.js";import{f as h}from"./format.js";import{d as v}from"./mrd-document-container2.js";import{d as y}from"./mrd-document-list2.js";import{d as p}from"./mrd-document-view2.js";const f=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=o(this,"mrdNavigate",7),this.mrdSearch=o(this,"mrdSearch",7),this.mrdDownload=o(this,"mrdDownload",7),this.mrdLoadViewPage=o(this,"mrdLoadViewPage",7),this.mrdLoadImage=o(this,"mrdLoadImage",7),this.mrdViewAction=o(this,"mrdViewAction",7),this.mrdLoadViewAggregations=o(this,"mrdLoadViewAggregations",7),this.mrdLoadViewDistinct=o(this,"mrdLoadViewDistinct",7),this.mrdUpdateObject=o(this,"mrdUpdateObject",7),this.mrdViewUpload=o(this,"mrdViewUpload",7),this.mrdCreateObject=o(this,"mrdCreateObject",7),this.items=[],this.data={},this.views={},this.links={},this.locale=navigator.language,this.archetypes=[],this.searchQueryMap={},this.searchResultsMap={},this.imagePreviewUrl=null,this.imagePreviews={},this.openHistoryField=null,this.historyClickOutside=null,this.searchTimers={},this.handleViewLoadPage=(r,t)=>{r.stopPropagation(),this.mrdLoadViewPage.emit({name:t,page:r.detail.page,sort:r.detail.sort,path:r.detail.path,qs:r.detail.qs})},this.handleSearchInput=(r,t)=>{this.searchQueryMap=Object.assign(Object.assign({},this.searchQueryMap),{[r]:t}),this.searchTimers[r]&&clearTimeout(this.searchTimers[r]),t.length<2?this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[r]:[]}):this.searchTimers[r]=setTimeout((()=>{this.mrdSearch.emit({query:t,dataClass:r})}),300)}}componentDidLoad(){setTimeout((()=>{this.initEmbeddedTables(),this.emitLoadImages()}),0),this.historyClickOutside=r=>{this.el.contains(r.target)||(this.openHistoryField=null)},document.addEventListener("mousedown",this.historyClickOutside)}disconnectedCallback(){this.historyClickOutside&&(document.removeEventListener("mousedown",this.historyClickOutside),this.historyClickOutside=null)}dataChanged(r){r&&Object.keys(r).length>0&&setTimeout((()=>this.initEmbeddedTables()),0)}async initEmbeddedTables(){const r=this.el.querySelectorAll("mrd-table[data-view]");for(const t of Array.from(r))"function"==typeof t.init&&await t.init()}viewKeyFor(r){var t,o,e,a;return r.type===s.RELATED_VIEW?null!==(o=null!==(t=r.relatedClass)&&void 0!==t?t:r.name)&&void 0!==o?o:"":null!==(a=null!==(e=r.dataClass)&&void 0!==e?e:r.name)&&void 0!==a?a:""}emitLoadImages(){for(const r of this.flattenItems(this.items))if(r.type===s.FIELD&&r.dataType===n.IMAGE){const t=r.name,o=this.data[t],e=null==o?void 0:o.href;e&&this.mrdLoadImage.emit({fieldName:t,href:e})}}flattenItems(r){const t=[];for(const o of r)t.push(o),o.items&&t.push(...this.flattenItems(o.items));return t}async setSearchResults(r,t){const o=null!=t?t:this.resolveSearchKey();o&&(this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[o]:r}))}async setViewPage(r,t,o,e,a,i){if(i){const t=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);return void((null==t?void 0:t.setDocuments)&&await t.setDocuments(i,o))}const s=this.el.querySelector(`mrd-table[data-view="${r}"]`);s&&(void 0!==e&&(s.totalElements=e),await s.setPage(t,o,a))}async setViewAggregations(r,t){const o=this.el.querySelector(`mrd-table[data-view="${r}"]`);o&&await o.setAggregations(t)}async setViewDistinct(r,t,o){const e=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==e?void 0:e.setDistinct)&&await e.setDistinct(t,o)}async setViewFileReference(r,t){const o=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==o?void 0:o.setFileReference)&&await o.setFileReference(t)}async setViewCreatedObject(r,t){const o=this.el.querySelector(`mrd-document-list[data-doclist="${r}"]`);(null==o?void 0:o.setCreatedHref)&&await o.setCreatedHref(t)}async setImagePreview(r,t){this.imagePreviews=Object.assign(Object.assign({},this.imagePreviews),{[r]:t})}async openImagePreview(r){this.imagePreviewUrl=r}resolveSearchKey(){var r;const t=this.flattenItems(this.items).filter((r=>r.type===s.SEARCH));return 1===t.length&&null!==(r=t[0].dataClass)&&void 0!==r?r:null}renderSingleFieldValue(r,t){var o,a,i,s,l,d,m,h,v,y,p;const f=r.dataType;switch(f){case n.HYPERLINK:{const r=null!==(o=null==t?void 0:t.href)&&void 0!==o?o:t+"",n=null!==(s=null!==(i=null!==(a=null==t?void 0:t.name)&&void 0!==a?a:null==t?void 0:t.text)&&void 0!==i?i:null==t?void 0:t.label)&&void 0!==s?s:r;return e("a",{class:"mrd-layout-section__link",href:r,target:"_blank",rel:"noopener noreferrer"},n)}case n.TEXTBLOCK:return e("div",{class:"mrd-layout-section__prose",innerHTML:t+""});case n.LONGTEXT:return e("pre",{class:"mrd-layout-section__pre"},t+"");case n.JSON:return e("pre",{class:"mrd-layout-section__pre",innerHTML:c.formatJson(t)});case n.FILE:{const r=null!==(l=null==t?void 0:t.fileName)&&void 0!==l?l:t+"",o=null!==(d=null==t?void 0:t.href)&&void 0!==d?d:"";return e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:r})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),u("download",this.locale))}case n.IMAGE:{const o=null!==(m=null==t?void 0:t.href)&&void 0!==m?m:"",a=null!==(h=null==t?void 0:t.fileName)&&void 0!==h?h:"",i=this.imagePreviews[r.name];return i?e("button",{class:"mrd-layout-section__image-thumb-btn",onClick:()=>{this.imagePreviewUrl=i},title:a||void 0},e("img",{class:"mrd-layout-section__image-thumb",src:i,alt:a})):e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:a})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),a||o)}case n.BOOLEAN:return e("span",{class:"mrd-layout-section__boolean mrd-layout-section__boolean--"+(t?"true":"false")},u(t?"yes":"no",this.locale));case n.LIST:{const o=(null!==(v=r.listItems)&&void 0!==v?v:[]).find((r=>r.key===t+"")),a=null!==(y=null==o?void 0:o.label)&&void 0!==y?y:t+"",i=null==o?void 0:o.color,s=null==o?void 0:o.backgroundColor;return i&&s?e("span",{class:"mrd-layout-section__badge",style:{color:i,backgroundColor:s}},a):i?e("span",{class:"mrd-layout-section__badge-dot-row"},e("span",{class:"mrd-layout-section__badge-dot",style:{backgroundColor:i}}),a):a}case n.SECRET:return t?e("span",{class:"mrd-layout-section__secret-masked"},"••••••••"):null;default:return c.renderValue(f,t,null!==(p=r.listItems)&&void 0!==p?p:[],this.locale)||null}}renderFieldValue(r,t){if(null==t||""===t)return null;if(r.multiple&&Array.isArray(t)){const o=t.map((t=>this.renderSingleFieldValue(r,t)));return o.every((r=>"string"==typeof r||null==r))?o.filter(Boolean).join(", ")||null:e("span",null,o.map(((r,t)=>e("span",{key:t+""},r,t<o.length-1?", ":""))))}return this.renderSingleFieldValue(r,t)}renderHistoryBadge(r,t){var o,a,i;if(!(null!==(o=r.historyEnabled)&&void 0!==o?o:null===(a=r.field)||void 0===a?void 0:a.historyEnabled)||!r.name)return null;const s=null!==(i=null==t?void 0:t.history)&&void 0!==i?i:[];if(!s.length)return null;const n=[...s].sort(((r,t)=>t.until.localeCompare(r.until))),l=this.openHistoryField===r.name,{locale:d}=this;return e("span",{class:"mrd-layout-section__history-wrap"},e("button",{type:"button",class:"mrd-layout-section__history-btn",title:u("history_badge_tooltip",d),"aria-label":u("history_badge_tooltip",d),onClick:t=>{t.stopPropagation(),this.openHistoryField=l?null:r.name}},e("svg",{class:"mrd-layout-section__history-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.75-13a.75.75 0 00-1.5 0v5c0 .207.085.394.22.53l2.5 2.5a.75.75 0 101.06-1.06L10.75 9.69V5z","clip-rule":"evenodd"}))),l&&e("div",{class:"mrd-layout-section__history-popover",role:"listbox"},n.map(((r,t)=>e("div",{key:t+"",class:"mrd-layout-section__history-entry"},r.value," (",u("history_until",d)," ",h(r.until,d),")")))))}renderField(r){var t,o;if(!r.name)return null;const a=this.data[r.name],i=(null!==(t=r.historyEnabled)&&void 0!==t?t:null===(o=r.field)||void 0===o?void 0:o.historyEnabled)&&null!==a&&"object"==typeof a&&"current"in a?a.current:a,s=this.renderFieldValue(r,i);return r.header?e("h1",{class:"mrd-layout-section__field-header",key:r.name},"string"==typeof s?s:null!=i?i+"":r.label):null==s?null:e("div",{class:"mrd-layout-section__field"+(r.dataType===n.TEXTBLOCK||r.dataType===n.LONGTEXT||r.dataType===n.JSON?" mrd-layout-section__field--block":""),key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},s,this.renderHistoryBadge(r,a)))}renderRelation(r){var t,o,a;if(!r.name)return null;const i=(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==o?o:{})[r.name];if(!i)return null;const s=(r,t)=>e("button",{key:r,class:"mrd-layout-section__relation-link",onClick:()=>this.mrdNavigate.emit({href:r,label:t})},t);let n;return(null===(a=i.values)||void 0===a?void 0:a.length)?n=i.values.map((r=>s(r.href,r.name))):i.name&&(n=s(i.href,i.name)),n?e("div",{class:"mrd-layout-section__field",key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},n)):null}renderSearch(r){var t,o,a;if(!r.dataClass)return null;const i=r.dataClass,s=null!==(t=this.searchQueryMap[i])&&void 0!==t?t:"",n=null!==(o=this.searchResultsMap[i])&&void 0!==o?o:[];return e("div",{class:"mrd-layout-section__search",key:"search-"+i},e("div",{class:"mrd-layout-section__search-wrap"},e("svg",{class:"mrd-layout-section__search-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("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"})),e("input",{class:"mrd-layout-section__search-input",type:"text",value:s,placeholder:null!==(a=r.label)&&void 0!==a?a:"",onInput:r=>this.handleSearchInput(i,r.target.value)})),n.length>0&&e("ul",{class:"mrd-layout-section__search-results"},n.map((r=>e("li",{key:r.id,class:"mrd-layout-section__search-result"},e("button",{class:"mrd-layout-section__search-result-btn",onClick:()=>this.mrdNavigate.emit({href:r.id,label:r.label})},e("span",{class:"mrd-layout-section__search-result-label"},r.label),r.description&&e("span",{class:"mrd-layout-section__search-result-desc"},r.description)))))))}renderRelatedView(r){var t,o,a,i,s,n,c,m;const u=this.viewKeyFor(r);if(!u)return null;if(!r.view)return null;const h=null!==(t=r.showTitle)&&void 0!==t&&t,v=null!==(s=null===(i=null===(a=null===(o=this.data)||void 0===o?void 0:o._links)||void 0===a?void 0:a.self)||void 0===i?void 0:i.href)&&void 0!==s?s:"",y=null!==(n=v.split("/").filter(Boolean).pop())&&void 0!==n?n:"",p=l(null!==(c=r.archetypes)&&void 0!==c?c:null===(m=r.view)||void 0===m?void 0:m.archetypes,d),f=this.buildContainerHref(r,v,y);return e("div",{class:"mrd-layout-section__related-view",key:"view-"+u},h&&r.label&&e("h3",{class:"mrd-layout-section__related-view-title"},r.label),p?this.renderDocumentContainer(r,u,y,p,f):this.renderTable(r,u,y))}buildContainerHref(r,t,o){if(r.type!==s.RELATED_VIEW||!r.fromClass||!o)return"";const e=t.split("/").filter(Boolean);if(e.length<2)return"";const[a,i]=e;return`/${a}/${i}/${r.fromClass}/${o}`}renderDocumentContainer(r,t,o,a,i){return e("mrd-document-container",{item:r,archetype:a,parentId:o,containerHref:i,viewKey:t,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadViewDistinct.emit(Object.assign({name:t},r.detail))},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadViewPage.emit(Object.assign({name:t},r.detail))},onMrdLoadAggregations:o=>{var e;o.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdAction:o=>{var e;o.stopPropagation(),this.mrdViewAction.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdViewUpload.emit(Object.assign({name:t},r.detail))},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(Object.assign({name:t},r.detail))}})}renderTable(r,t,o){return e("mrd-table",{"data-view":t,item:r,parentId:o,locale:this.locale,onMrdLoadPage:r=>this.handleViewLoadPage(r,t),onMrdLoadAggregations:o=>{var e;o.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:t,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t},o.detail))},onMrdRowClick:r=>{var t,o,e;r.stopPropagation();const a=r.detail;this.mrdNavigate.emit({href:null===(o=null===(t=null==a?void 0:a._links)||void 0===t?void 0:t.self)||void 0===o?void 0:o.href,label:null!==(e=null==a?void 0:a.name)&&void 0!==e?e:""})},onMrdAction:o=>{var e;o.stopPropagation(),this.mrdViewAction.emit({name:t,action:o.detail.action,dataClass:null!==(e=r.dataClass)&&void 0!==e?e:t,path:o.detail.path,qs:o.detail.qs,parentPath:o.detail.parentPath,basicType:o.detail.basicType})}})}renderItem(r){var t,o;switch(r.type){case s.FIELD:return this.renderField(r);case s.RELATION:return this.renderRelation(r);case s.HEADER:return e("h2",{class:"mrd-layout-section__header",key:"header-"+r.label},r.label);case s.TEXT:return e("div",{class:"mrd-layout-section__text",key:"text-"+r.label,innerHTML:null!==(t=r.label)&&void 0!==t?t:""});case s.NAVIGATE:return e("button",{class:"mrd-layout-section__navigate",key:"nav-"+r.label,onClick:()=>{var t,o,e;return this.mrdNavigate.emit({label:null!==(t=r.label)&&void 0!==t?t:"",navigate:null!==(o=r.navigate)&&void 0!==o?o:{dataClass:null!==(e=r.dataClass)&&void 0!==e?e:"",icon:r.icon,navigationType:r.navigationType}})}},r.label);case s.SEARCH:return this.renderSearch(r);case s.SECTION:case s.GROUP:return e("div",{class:"mrd-layout-section__group",key:"group-"+r.label},r.label&&e("h3",{class:"mrd-layout-section__group-title"},r.label),(null!==(o=r.items)&&void 0!==o?o:[]).map((r=>this.renderItem(r))));case s.RELATED_VIEW:case s.VIEW:return this.renderRelatedView(r);default:return null}}renderImageModal(){return this.imagePreviewUrl?e("div",{class:"mrd-layout-section__modal-backdrop",onClick:()=>{this.imagePreviewUrl=null}},e("div",{class:"mrd-layout-section__modal",onClick:r=>r.stopPropagation()},e("button",{class:"mrd-layout-section__modal-close",onClick:()=>{this.imagePreviewUrl=null}},"✕"),e("img",{class:"mrd-layout-section__modal-image",src:this.imagePreviewUrl,alt:""}))):null}renderDocumentObject(r){const t=this.items.filter((r=>r.type===s.VIEW||r.type===s.RELATED_VIEW||r.type===s.SEARCH));return[e("mrd-document-view",{archetype:r,data:this.data,locale:this.locale,onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdDownload:r=>{r.stopPropagation(),this.mrdDownload.emit(r.detail)}}),...t.map((r=>this.renderItem(r)))]}render(){const r=l(this.archetypes,d);return e(a,{key:"231f5c3e282375b5850291611645fe3c904831bb"},e("div",{key:"314e39ec3aa1eabeb1a98f6e6d63fcf07e13ccec",class:"mrd-layout-section"},r?this.renderDocumentObject(r):this.items.map((r=>this.renderItem(r)))),this.renderImageModal())}get el(){return this}static get watchers(){return{data:[{dataChanged:0}]}}static get style(){return".mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}"}},[2,"mrd-layout-section",{items:[16],data:[16],views:[16],links:[16],locale:[1],archetypes:[16],searchQueryMap:[32],searchResultsMap:[32],imagePreviewUrl:[32],imagePreviews:[32],openHistoryField:[32],setSearchResults:[64],setViewPage:[64],setViewAggregations:[64],setViewDistinct:[64],setViewFileReference:[64],setViewCreatedObject:[64],setImagePreview:[64],openImagePreview:[64]},void 0,{data:[{dataChanged:0}]}]),_=f,g=function(){"undefined"!=typeof customElements&&["mrd-layout-section","mrd-document-container","mrd-document-list","mrd-document-view","mrd-table"].forEach((r=>{switch(r){case"mrd-layout-section":customElements.get(i(r))||customElements.define(i(r),f);break;case"mrd-document-container":customElements.get(i(r))||v();break;case"mrd-document-list":customElements.get(i(r))||y();break;case"mrd-document-view":customElements.get(i(r))||p();break;case"mrd-table":customElements.get(i(r))||m()}}))};export{_ as MrdLayoutSection,g as defineCustomElement}
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["mrd-boolean-field_23",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"viewKey":[1,"view-key"],"locale":[1],"mode":[32],"canCreate":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
8
+ return bootstrapLazy([["mrd-boolean-field_23",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"mode":[32],"canCreate":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["mrd-boolean-field_23",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"viewKey":[1,"view-key"],"locale":[1],"mode":[32],"canCreate":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
20
+ return bootstrapLazy([["mrd-boolean-field_23",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"mode":[32],"canCreate":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
21
21
  });