@mmlogic/components 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_24.cjs.entry.js} +348 -39
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +14 -1
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +22 -7
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +8 -5
- package/dist/collection/components/documents/mrd-document-list/tree-view.js +13 -1
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +39 -29
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +109 -8
- package/dist/collection/components/documents/mrd-file-preview/file-preview-kind.js +30 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +59 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +212 -0
- package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
- package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
- package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +1 -1
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
- package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +5 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +91 -8
- package/dist/collection/components/table/mrd-table/mrd-table.css +20 -0
- package/dist/collection/components/table/mrd-table/mrd-table.js +124 -5
- package/dist/collection/components/table/mrd-table/virtual-scroll.js +14 -0
- package/dist/collection/dev/api.js +9 -0
- package/dist/collection/dev/app.js +101 -3
- package/dist/collection/dev/example-data.js +24 -0
- package/dist/collection/types/client-layout.js +8 -0
- package/dist/collection/utils/i18n.js +40 -0
- package/dist/components/client-layout.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-file-preview.d.ts +11 -0
- package/dist/components/mrd-file-preview.js +1 -0
- package/dist/components/mrd-file-preview2.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_24.entry.js} +349 -41
- package/dist/mosterdcomponents/cell-renderer-PbcEU4ph.js.map +1 -0
- package/dist/mosterdcomponents/client-layout-DCOAAH92.js.map +1 -0
- package/dist/mosterdcomponents/field-helpers-CASS3akr.js.map +1 -0
- package/dist/mosterdcomponents/file-upload-common-D1ndi6cN.js.map +1 -0
- package/dist/mosterdcomponents/format-BAfsQfy1.js.map +1 -0
- package/dist/mosterdcomponents/i18n-B1IIkRF9.js.map +1 -0
- package/dist/mosterdcomponents/index-AokUFVX0.js.map +1 -0
- package/dist/mosterdcomponents/index-CprJSlzK.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/index.esm.js.map +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
- package/dist/mosterdcomponents/p-aae8a9dc.entry.js +1 -0
- package/dist/mosterdcomponents/query-params-B1HfnMOl.js.map +1 -0
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
- package/dist/mosterdcomponents/validation-DbEViuiw.js.map +1 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +6 -2
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +29 -1
- package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +9 -0
- package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +41 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +17 -1
- package/dist/types/components/table/mrd-table/mrd-table.d.ts +23 -0
- package/dist/types/components/table/mrd-table/virtual-scroll.d.ts +7 -0
- package/dist/types/components.d.ts +194 -7
- package/dist/types/types/client-layout.d.ts +10 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-9b3c0917.entry.js +0 -1
package/dist/components/i18n.js
CHANGED
|
@@ -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",invalid_image:"Selecteer een afbeeldingsbestand",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",invalid_image:"Please select an image file",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:"الملف كبير جداً",invalid_image:"يرجى اختيار ملف صورة",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",invalid_image:"Veuillez sélectionner un fichier image",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ß",invalid_image:"Bitte eine Bilddatei auswählen",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",invalid_image:"Seleccione un archivo de imagen",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",invalid_image:"Seleziona un file immagine",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:"Файл занадто великий",invalid_image:"Будь ласка, виберіть файл зображення",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
|
+
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",invalid_image:"Selecteer een afbeeldingsbestand",search_results:"Zoekresultaten",no_results:"Geen resultaten gevonden",load_failed_retry:"Laden mislukt — opnieuw proberen",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",preview_unsupported:"Geen voorbeeld beschikbaar voor dit bestandstype",preview_error:"Voorbeeld laden mislukt",retry:"Opnieuw proberen"},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",invalid_image:"Please select an image file",search_results:"Search results",no_results:"No results found",load_failed_retry:"Failed to load — retry",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",preview_unsupported:"No preview available for this file type",preview_error:"Failed to load preview",retry:"Retry"},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:"الملف كبير جداً",invalid_image:"يرجى اختيار ملف صورة",search_results:"نتائج البحث",no_results:"لم يتم العثور على نتائج",load_failed_retry:"فشل التحميل — إعادة المحاولة",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:"نص الرابط (اختياري)",preview_unsupported:"لا تتوفر معاينة لهذا النوع من الملفات",preview_error:"فشل تحميل المعاينة",retry:"إعادة المحاولة"},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",invalid_image:"Veuillez sélectionner un fichier image",search_results:"Résultats de recherche",no_results:"Aucun résultat trouvé",load_failed_retry:"Échec du chargement — réessayer",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)",preview_unsupported:"Aucun aperçu disponible pour ce type de fichier",preview_error:"Échec du chargement de l'aperçu",retry:"Réessayer"},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ß",invalid_image:"Bitte eine Bilddatei auswählen",search_results:"Suchergebnisse",no_results:"Keine Ergebnisse gefunden",load_failed_retry:"Laden fehlgeschlagen — erneut versuchen",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)",preview_unsupported:"Keine Vorschau für diesen Dateityp verfügbar",preview_error:"Vorschau konnte nicht geladen werden",retry:"Erneut versuchen"},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",invalid_image:"Seleccione un archivo de imagen",search_results:"Resultados de búsqueda",no_results:"No se encontraron resultados",load_failed_retry:"Error al cargar — reintentar",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)",preview_unsupported:"Vista previa no disponible para este tipo de archivo",preview_error:"Error al cargar la vista previa",retry:"Reintentar"},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",invalid_image:"Seleziona un file immagine",search_results:"Risultati della ricerca",no_results:"Nessun risultato trovato",load_failed_retry:"Caricamento non riuscito — riprova",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)",preview_unsupported:"Nessuna anteprima disponibile per questo tipo di file",preview_error:"Impossibile caricare l'anteprima",retry:"Riprova"},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:"Файл занадто великий",invalid_image:"Будь ласка, виберіть файл зображення",search_results:"Результати пошуку",no_results:"Результатів не знайдено",load_failed_retry:"Не вдалося завантажити — повторити",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:"Текст посилання (необов'язково)",preview_unsupported:"Попередній перегляд недоступний для цього типу файлу",preview_error:"Не вдалося завантажити попередній перегляд",retry:"Повторити"}};function l(l,r){var i,t,a;const o=(null!=r?r:"en").split("-")[0].toLowerCase();return null!==(a=null!==(t=(null!==(i=e[o])&&void 0!==i?i:e.en)[l])&&void 0!==t?t:e.en[l])&&void 0!==a?a:l}export{l as t}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";export{A as ARCHETYPE_DOCUMENT,b as ClientLayoutItemFieldDataType,c as ClientLayoutItemRelationDisplayType,d as ClientLayoutItemRelationEditBehavior,a as ClientLayoutItemType,C as ClientLayoutType,r as resolveArchetype}from"./client-layout.js";
|
|
1
|
+
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";export{A as ARCHETYPE_DOCUMENT,b as ClientLayoutItemFieldDataType,c as ClientLayoutItemRelationDisplayType,d as ClientLayoutItemRelationEditBehavior,a as ClientLayoutItemType,e as ClientLayoutNavigateBehaviour,C as ClientLayoutType,r as resolveArchetype}from"./client-layout.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as o,createEvent as l,h as d,Host as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as o,createEvent as l,h as d,Host as a,transformTag as r}from"@stencil/core/internal/client";const i=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=l(this,"mrdChange",7),this.mrdBlur=l(this,"mrdBlur",7),this.name="",this.label="",this.value=!1,this.required=!1,this.disabled=!1,this.locale=navigator.language,this.checked=!1,this.handleChange=e=>{this.checked=e.target.checked,this.mrdChange.emit({name:this.name,value:this.checked})},this.handleBlur=()=>{this.mrdBlur.emit({name:this.name,value:this.checked})}}componentWillLoad(){this.checked=!!this.value}render(){return d(a,{key:"c0e92a50b1512d7b7f36f151b34bcb5b9497ca59"},d("div",{key:"e3f70c88321d8e72784b81092a9ebc0451ba330d",class:"mrd-boolean-field"},d("label",{key:"3e6d907b72a5e1da7e268685c67811ebf264d5d8",class:"mrd-boolean-field__toggle-label"},d("input",{key:"2b6df62a72cba19aa26374a2448c26666e28b03d",class:"mrd-boolean-field__checkbox",type:"checkbox",name:this.name,checked:this.checked,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),d("span",{key:"77cbe5c1a25153de745f5e91eef589f40cb3237d",class:"mrd-boolean-field__toggle","aria-hidden":"true"}),this.label&&d("span",{key:"34daaa269ed64ed3be71ecfd15d79eb42d746247",class:"mrd-boolean-field__text"+(this.required?" mrd-boolean-field__text--required":"")},this.label))))}static get style(){return'.sc-mrd-boolean-field-h{display:block}.mrd-boolean-field.sc-mrd-boolean-field{display:flex;align-items:center;width:100%}.mrd-boolean-field__toggle-label.sc-mrd-boolean-field{display:flex;align-items:center;gap:var(--mrd-space-3);cursor:pointer;user-select:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field{background-color:var(--mrd-color-primary)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{transform:translateX(20px)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:focus+.mrd-boolean-field__toggle.sc-mrd-boolean-field{box-shadow:var(--mrd-shadow-focus)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:disabled+.mrd-boolean-field__toggle.sc-mrd-boolean-field{opacity:0.5;cursor:not-allowed}.mrd-boolean-field__toggle.sc-mrd-boolean-field{position:relative;display:inline-block;width:44px;height:24px;background-color:var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius-full);transition:background-color var(--mrd-transition);flex-shrink:0}.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:var(--mrd-color-white);border-radius:50%;transition:transform var(--mrd-transition);box-shadow:var(--mrd-shadow-sm)}.mrd-boolean-field__text.sc-mrd-boolean-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-boolean-field__text--required.sc-mrd-boolean-field::after{content:" *";color:var(--mrd-color-danger)}'}},[2,"mrd-boolean-field",{name:[1],label:[1],value:[4],required:[4],disabled:[4],locale:[1],checked:[32]}]);function t(){"undefined"!=typeof customElements&&["mrd-boolean-field"].forEach((e=>{"mrd-boolean-field"===e&&(customElements.get(r(e))||customElements.define(r(e),i))}))}export{i as M,t as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as c,Host as o,transformTag as i}from"@stencil/core/internal/client";import{p as a}from"./format.js";import{r as t,F as n,c as s,a as l}from"./field-helpers.js";const m=["EUR","USD","GBP","CHF","JPY","CNY","AUD","CAD","SEK","NOK","DKK","NZD","SGD","HKD","PLN","CZK","HUF","MXN","BRL","INR","TRY","ZAR","AED","SAR"],u=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.name="",this.label="",this.value={amount:null,currency:"EUR"},this.required=!1,this.disabled=!1,this.locale=navigator.language,this.amountDisplay="",this.currency="EUR",this.error="",this.handleAmountInput=r=>{this.amountDisplay=r.target.value},this.handleAmountBlur=r=>{const e=r.target.value,d=a(e,this.locale);this.error=t(e,this.required,this.locale);const c={amount:d,currency:this.currency};this.mrdChange.emit({name:this.name,value:c}),this.mrdBlur.emit({name:this.name,value:c})},this.handleCurrencyChange=r=>{this.currency=r.target.value;const e=a(this.amountDisplay,this.locale);this.mrdChange.emit({name:this.name,value:{amount:e,currency:this.currency}})}}componentWillLoad(){this.value&&(this.currency=this.value.currency||"EUR",this.amountDisplay=null!==this.value.amount?String(this.value.amount):"")}render(){const r=!!this.error;return c(o,{key:"
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as c,Host as o,transformTag as i}from"@stencil/core/internal/client";import{p as a}from"./format.js";import{r as t,F as n,c as s,a as l}from"./field-helpers.js";const m=["EUR","USD","GBP","CHF","JPY","CNY","AUD","CAD","SEK","NOK","DKK","NZD","SGD","HKD","PLN","CZK","HUF","MXN","BRL","INR","TRY","ZAR","AED","SAR"],u=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.name="",this.label="",this.value={amount:null,currency:"EUR"},this.required=!1,this.disabled=!1,this.locale=navigator.language,this.amountDisplay="",this.currency="EUR",this.error="",this.handleAmountInput=r=>{this.amountDisplay=r.target.value},this.handleAmountBlur=r=>{const e=r.target.value,d=a(e,this.locale);this.error=t(e,this.required,this.locale);const c={amount:d,currency:this.currency};this.mrdChange.emit({name:this.name,value:c}),this.mrdBlur.emit({name:this.name,value:c})},this.handleCurrencyChange=r=>{this.currency=r.target.value;const e=a(this.amountDisplay,this.locale);this.mrdChange.emit({name:this.name,value:{amount:e,currency:this.currency}})}}componentWillLoad(){this.value&&(this.currency=this.value.currency||"EUR",this.amountDisplay=null!==this.value.amount?String(this.value.amount):"")}render(){const r=!!this.error;return c(o,{key:"7265395c3b93c3b4daf4c4221da13e01b2fed2e8"},c("div",{key:"e644b67a7aba6e8f5b7175f5f79a4bf5e99cb611",class:"mrd-currency-field"},c(n,{key:"d47a215c0684aea8a3253ae6edc4628d20733d90",base:"mrd-currency-field",label:this.label,required:this.required}),c("div",{key:"b8f67f8188ad9cd8ba2b6869fcb2b4cd413dec32",class:"mrd-currency-field__row"},c("input",{key:"8d643424d8932d11ceea0435353c54bc9399c187",class:s("mrd-currency-field",r,"amount"),type:"text",inputMode:"decimal",name:`${this.name}_amount`,value:this.amountDisplay,placeholder:"0.00",required:this.required,disabled:this.disabled,onInput:this.handleAmountInput,onBlur:this.handleAmountBlur}),c("select",{key:"55b12e960646c2420883df848ae440d45f808300",class:"mrd-currency-field__currency",disabled:this.disabled,onChange:this.handleCurrencyChange},m.map((r=>c("option",{key:r,value:r,selected:r===this.currency},r))))),c(l,{key:"d0a6adbb83af8fde047eff22c8efd9bbe1ae638f",base:"mrd-currency-field",error:this.error})))}static get style(){return'.sc-mrd-currency-field-h{display:block}.mrd-currency-field.sc-mrd-currency-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-currency-field__label.sc-mrd-currency-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-currency-field__label--required.sc-mrd-currency-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-currency-field__row.sc-mrd-currency-field{display:flex;gap:var(--mrd-space-2);align-items:stretch}.mrd-currency-field__amount.sc-mrd-currency-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-currency-field__amount.sc-mrd-currency-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-currency-field__amount.sc-mrd-currency-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-currency-field__amount.sc-mrd-currency-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-currency-field__amount--error.sc-mrd-currency-field{border-color:var(--mrd-border-color-error)}.mrd-currency-field__amount--error.sc-mrd-currency-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-currency-field__amount.sc-mrd-currency-field{flex:1;text-align:right}.mrd-currency-field__currency.sc-mrd-currency-field{width:90px;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-space-2);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-input-color);background-color:var(--mrd-color-neutral-50);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;cursor:pointer;box-sizing:border-box;appearance:none;text-align:center}.mrd-currency-field__currency.sc-mrd-currency-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-currency-field__currency.sc-mrd-currency-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-currency-field__error.sc-mrd-currency-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-currency-field",{name:[1],label:[1],value:[16],required:[4],disabled:[4],locale:[1],amountDisplay:[32],currency:[32],error:[32]}]);function f(){"undefined"!=typeof customElements&&["mrd-currency-field"].forEach((r=>{"mrd-currency-field"===r&&(customElements.get(i(r))||customElements.define(i(r),u))}))}export{u as M,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as d,createEvent as e,h as a,Host as t,transformTag as i}from"@stencil/core/internal/client";import{r as o,F as l,c as s,a as c}from"./field-helpers.js";const n=r(class extends d{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=e(this,"mrdChange",7),this.mrdBlur=e(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleChange=r=>{const d=r.target.value;this.error=o(d,this.required,this.locale),this.mrdChange.emit({name:this.name,value:d})},this.handleBlur=r=>{this.mrdBlur.emit({name:this.name,value:r.target.value})}}render(){return a(t,{key:"
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as d,createEvent as e,h as a,Host as t,transformTag as i}from"@stencil/core/internal/client";import{r as o,F as l,c as s,a as c}from"./field-helpers.js";const n=r(class extends d{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=e(this,"mrdChange",7),this.mrdBlur=e(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleChange=r=>{const d=r.target.value;this.error=o(d,this.required,this.locale),this.mrdChange.emit({name:this.name,value:d})},this.handleBlur=r=>{this.mrdBlur.emit({name:this.name,value:r.target.value})}}render(){return a(t,{key:"c0b9d684c5e0b5e3da785c383472ed5d6c13c39f"},a("div",{key:"304c9b5c9570a369258f5f6fd0877a01a87d98d5",class:"mrd-date-field"},a(l,{key:"72c5ec21699a314920ea1217aee9a353bc8b4b7e",base:"mrd-date-field",label:this.label,required:this.required}),a("input",{key:"be18df6c7e5fe89bf00cef38484711a9a685e0dc",class:s("mrd-date-field",!!this.error),type:"date",name:this.name,value:this.value,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),a(c,{key:"f16ffb7e14f9ac9af4a34a96361a25dd4d738d68",base:"mrd-date-field",error:this.error})))}static get style(){return'.sc-mrd-date-field-h{display:block}.mrd-date-field.sc-mrd-date-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-date-field__label.sc-mrd-date-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-date-field__label--required.sc-mrd-date-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-date-field__input.sc-mrd-date-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-date-field__input.sc-mrd-date-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-date-field__input.sc-mrd-date-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-date-field__input.sc-mrd-date-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-date-field__input--error.sc-mrd-date-field{border-color:var(--mrd-border-color-error)}.mrd-date-field__input--error.sc-mrd-date-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-date-field__error.sc-mrd-date-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-date-field__input.sc-mrd-date-field{cursor:pointer}'}},[2,"mrd-date-field",{name:[1],label:[1],value:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-date-field"].forEach((r=>{"mrd-date-field"===r&&(customElements.get(i(r))||customElements.define(i(r),n))}))}export{n as M,m as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as r,createEvent as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,createEvent as d,h as t,Host as i,transformTag as a}from"@stencil/core/internal/client";import{r as o,F as l,c as s,a as m}from"./field-helpers.js";const n=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.localValue="",this.handleChange=e=>{const r=e.target.value;this.localValue=r,this.error=o(r,this.required,this.locale),this.mrdChange.emit({name:this.name,value:this.localToUtc(r)})},this.handleBlur=e=>{this.mrdBlur.emit({name:this.name,value:this.localToUtc(e.target.value)})}}componentWillLoad(){this.localValue=this.utcToLocal(this.value)}valueChanged(e){this.localValue=this.utcToLocal(e)}utcToLocal(e){if(!e)return"";const r=new Date(e);if(isNaN(r.getTime()))return"";const d=e=>String(e).padStart(2,"0");return`${r.getFullYear()}-${d(r.getMonth()+1)}-${d(r.getDate())}T${d(r.getHours())}:${d(r.getMinutes())}`}localToUtc(e){if(!e)return"";const r=new Date(e);return isNaN(r.getTime())?"":r.toISOString().replace(/\.\d{3}Z$/,"Z")}render(){return t(i,{key:"0ee285553f3d5e1a9984619795543d67d581c76f"},t("div",{key:"2c93dffe3701da9099f4b34a9d7c1d0619fa824e",class:"mrd-datetime-field"},t(l,{key:"ebda087fdcb2a956933758e6250a8e4dc0484ef9",base:"mrd-datetime-field",label:this.label,required:this.required}),t("input",{key:"06b012fc78c76e3b08ef24af5e134aa691975285",class:s("mrd-datetime-field",!!this.error),type:"datetime-local",name:this.name,value:this.localValue,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),t(m,{key:"54e7acdd051c00893eb17cbf4911917fceddb54f",base:"mrd-datetime-field",error:this.error})))}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return'.sc-mrd-datetime-field-h{display:block}.mrd-datetime-field.sc-mrd-datetime-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-datetime-field__label.sc-mrd-datetime-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-datetime-field__label--required.sc-mrd-datetime-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-datetime-field__input.sc-mrd-datetime-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-datetime-field__input.sc-mrd-datetime-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-datetime-field__input.sc-mrd-datetime-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-datetime-field__input.sc-mrd-datetime-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-datetime-field__input--error.sc-mrd-datetime-field{border-color:var(--mrd-border-color-error)}.mrd-datetime-field__input--error.sc-mrd-datetime-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-datetime-field__error.sc-mrd-datetime-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-datetime-field__input.sc-mrd-datetime-field{cursor:pointer}'}},[2,"mrd-datetime-field",{name:[1],label:[1],value:[1],required:[4],disabled:[4],locale:[1],error:[32],localValue:[32]},void 0,{value:[{valueChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["mrd-datetime-field"].forEach((e=>{"mrd-datetime-field"===e&&(customElements.get(a(e))||customElements.define(a(e),n))}))}export{n as M,c as d}
|
|
@@ -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{
|
|
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{e as d}from"./client-layout.js";import{t as a}from"./i18n.js";import{d as s}from"./mrd-document-list2.js";import{d as c}from"./mrd-table2.js";const m=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;null===(r=this.listEl)||void 0===r||r.createFolder()}}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((()=>t.init()))}}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"})),a("new_folder",this.locale)),o("div",{class:"mrd-document-container__seg",role:"group","aria-label":a("doc_view_switch",this.locale)},o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("tree"===this.mode),title:a("doc_view_tree",this.locale),"aria-label":a("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:a("doc_view_list",this.locale),"aria-label":a("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(Object.assign(Object.assign({},r.detail),{navigateBehaviour:d.OVERLAY_PAGE}))},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:"",navigateBehaviour:d.OVERLAY_PAGE})},onMrdAction:r=>{r.stopPropagation(),this.mrdAction.emit(r.detail)}})}render(){const r="tree"===this.mode;return o(i,{key:"e8d37d2f818b9b2260fb2ccd3d784393a28385c4"},this.renderToolbar(),o("div",{key:"fa80a1343e9b2f1e74f30317bfbfbab78ea63e5d",class:{"mrd-document-container__body":!0,"mrd-document-container__body--tree":r},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) 0;border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__body--tree.sc-mrd-document-container{border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow:hidden}.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:var(--mrd-color-folder)}.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 l(){"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),m);break;case"mrd-document-list":customElements.get(n(r))||s();break;case"mrd-table":customElements.get(n(r))||c()}}))}export{m as M,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,proxyCustomElement as i,HTMLElement as s,createEvent as o,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a as e}from"./client-layout.js";import{t as d}from"./i18n.js";import{b as l,a as c}from"./query-params.js";import{f as a}from"./format.js";function u(t){if(null==t)return[];const i=String(t).trim();return""===i||"/"===i?[]:i.split("/").map((t=>t.trim())).filter(Boolean)}function m(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:[]}}function h(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:[]}}function v(t){let i=t.docCount;for(const s of t.children)i+=v(s);return t.totalCount=i,i}function f(t,i){if("container"===t.kind)return[];const s=i.id+"/",o=t.id.startsWith(s)?t.id.slice(s.length):"";return o?o.split("/"):[]}function _(t,i){if("container"===t.kind)return null;if(null!=t.fullPath&&""!==t.fullPath)return t.fullPath;const s=f(t,i);return s.length?"/"+s.join("/"):null}function p(t){return t.replace(/\.[^./\\]+$/,"")}function g(i,s){return t("span",{class:`mrd-document-list__chev${s?" mrd-document-list__chev--leaf":""}${i?" mrd-document-list__chev--open":""}`},t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},t("path",{d:"M9 6l6 6-6 6"})))}function b(){return t("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"},t("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"}))}function y(i){return t("span",{class:"mrd-document-list__indent",style:{width:18*i+"px"}})}function w(i,s){return t("div",{class:"mrd-document-list__loading",key:"loading"},y(s),t("span",{class:"mrd-document-list__spinner"}),d("loading",i.locale))}function k(i,s,o,r,n){var e,d,l,c,u;const m=null!==(d=null!==(e=null==s?void 0:s[i.titleField])&&void 0!==e?e:null==s?void 0:s.name)&&void 0!==d?d:"",h=i.dateField?null==s?void 0:s[i.dateField]:void 0,v=h?a(h,i.locale):"";return t("div",{class:"mrd-document-list__row mrd-document-list__row--doc",key:null!==(u=null===(c=null===(l=null==s?void 0:s._links)||void 0===l?void 0:l.self)||void 0===c?void 0:c.href)&&void 0!==u?u:m,draggable:!0,onClick:()=>i.on.openDoc(s),onDragStart:t=>i.on.docDragStart(t,s,o),onDragEnd:i.on.docDragEnd,onDragOver:t=>i.on.nodeDragOver(t,o),onDragLeave:()=>i.on.nodeDragLeave(o),onDrop:t=>i.on.nodeDrop(t,o,r)},y(n),g(!1,!0),t("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"},t("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 2v6h6"})),t("span",{class:"mrd-document-list__label"},m),v&&t("span",{class:"mrd-document-list__date"},v))}function D(i,s,o,r){const n=[];if(o.hasDocs)if(o.docsLoaded)for(const t of o.docs)n.push(k(i,t,o,s,r));else o.loading&&n.push(w(i,r));for(const t of o.children)n.push(x(i,s,t,r));return o.id===i.uploadingNodeId&&n.push(function(i,s){return t("div",{class:"mrd-document-list__loading",key:"uploading"},y(s),t("span",{class:"mrd-document-list__spinner"}),d("upload_file",i.locale))}(i,r)),n}function x(i,s,o,r){if(o.editing)return function(i,s,o){return t("div",{class:"mrd-document-list__node",key:s.id},t("div",{class:"mrd-document-list__row mrd-document-list__row--edit"},y(o),g(!1,!0),b(),t("input",{class:"mrd-document-list__name-input",type:"text",placeholder:d("folder_name_placeholder",i.locale),ref:t=>i.on.setPendingInputEl(t),onInput:i.on.pendingInput,onKeyDown:i.on.pendingKeyDown,onBlur:()=>i.on.cancelFolder()})),s.error&&t("div",{class:"mrd-document-list__error",style:{paddingLeft:18*o+52+"px"}},s.error))}(i,o,r);const n=0===o.children.length&&!o.hasDocs;return t("div",{class:"mrd-document-list__node",key:o.id},t("div",{class:"mrd-document-list__row"+(o.id===i.selectedId?" mrd-document-list__row--selected":"")+(o.pending?" mrd-document-list__row--pending":"")+(o.id===i.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>i.on.toggleFolder(s,o),onDragOver:t=>i.on.nodeDragOver(t,o),onDragLeave:()=>i.on.nodeDragLeave(o),onDrop:t=>i.on.nodeDrop(t,o,s)},y(r),g(o.open,n),b(),t("span",{class:"mrd-document-list__label"},o.label),t("span",{class:"mrd-document-list__count"},o.totalCount)),o.open&&t("div",{class:"mrd-document-list__kids"},D(i,s,o,r+1)))}const C=i(class i extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadDistinct=o(this,"mrdLoadDistinct",7),this.mrdLoadPage=o(this,"mrdLoadPage",7),this.mrdNavigate=o(this,"mrdNavigate",7),this.mrdCanCreate=o(this,"mrdCanCreate",7),this.mrdUpdateObject=o(this,"mrdUpdateObject",7),this.mrdUpload=o(this,"mrdUpload",7),this.mrdCreateObject=o(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,o=h(`${s.id}/__new__${this.newFolderSeq++}`,"",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 o,r,n;this.dragDoc=i,this.dragFromId=s.id,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",null!==(n=null===(r=null===(o=null==i?void 0:i._links)||void 0===o?void 0:o.self)||void 0===r?void 0:r.href)&&void 0!==n?n:""))},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 o=s||i.id!==this.dragFromId?i.id:null;this.dropTargetId!==o&&(this.dropTargetId=o)},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)===e.RELATED_VIEW&&!!(null===(i=this.item)||void 0===i?void 0:i.inverseRelation)&&this.item.inverseRelation===this.containerField&&!!this.containerHref}seedSingleContainer(){const t=m(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;const s=this.item;return l({isRelatedView:(null==s?void 0:s.type)===e.RELATED_VIEW,fromClass:null==s?void 0:s.fromClass,parentId:this.parentId,dataClass:null!==(i=null!==(t=null==s?void 0:s.dataClass)&&void 0!==t?t:null==s?void 0:s.relatedClass)&&void 0!==i?i:""})}buildCreatePath(){var t,i,s;const o=this.item;return l({isRelatedView:(null==o?void 0:o.type)===e.RELATED_VIEW,fromClass:null==o?void 0:o.fromClass,parentId:this.parentId,dataClass: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:""})}baseParams(){var t,i,s;const o=new URLSearchParams,r=null===(t=this.item)||void 0===t?void 0:t.filterClass;return r&&o.set("type",r),c(o,null===(s=null===(i=this.item)||void 0===i?void 0:i.view)||void 0===s?void 0:s.filter),o}emitContainerDistinct(){const t=this.baseParams();t.set("distinct",this.containerField),this.mrdLoadDistinct.emit({nodeId:i.ROOT,distinct:this.containerField,path:this.buildDataPath()+"/distinct",qs:t.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,o;const r=this.baseParams();r.set(this.containerField+"_href",null!==(s=t.href)&&void 0!==s?s:""),r.set(this.folderField,null!==(o=i.fullPath)&&void 0!==o?o:""),i.loading=!0,this.mrdLoadPage.emit({nodeId:i.id,page:0,sort:"",path:this.buildDataPath(),qs:r.toString()})}async setDistinct(t,s){t===i.ROOT?this.applyContainers(s):this.applyFolders(t,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=m(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);s&&(function(t,i,s){t.children=[],t.hasDocs=!1,t.docCount=0;for(const o of i){const i="string"==typeof o.value?o.value:null==o.value?"":String(o.value),r=u(i);if(0===r.length){t.hasDocs=!0,t.docCount=o.count,t.fullPath=i;continue}let n=t;const e=[];for(const i of r){e.push(i);let o=n.children.find((t=>t.label===i));o||(o=h(t.id+"/"+e.join("/"),i,t.id),n.children.push(o),s.set(o.id,o)),n=o}n.hasDocs=!0,n.docCount=o.count,n.fullPath=i}v(t),t.foldersLoaded=!0,t.loading=!1}(s,i,this.nodeIndex),s.hasDocs&&!s.docsLoaded&&this.emitDocuments(s,s),this.bump())}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()}commitFolder(){const t=this.pendingNode,i=this.pendingParent,s=this.pendingContainer;if(!t||!i||!s)return;const o=this.pendingName.trim();if(!o)return void this.cancelFolder();if(o.includes("/"))return t.error=d("folder_no_slash",this.locale),void this.bump();if(i.children.some((i=>i!==t&&i.label.toLowerCase()===o.toLowerCase())))return t.error=d("folder_duplicate",this.locale),void this.bump();const r=[...f(i,s),o];this.nodeIndex.delete(t.id),t.id=s.id+"/"+r.join("/"),t.fullPath="/"+r.join("/"),t.label=o,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 o,r;const n=null===(r=null===(o=t.dataTransfer)||void 0===o?void 0:o.files)||void 0===r?void 0:r[0];this.dropTargetId=null,n&&(this.pendingUpload={file:n,node:i,container:s},i.open=!0,this.uploadingNodeId=i.id,this.bump(),this.mrdUpload.emit({file:n}))}async setFileReference(t){const i=this.pendingUpload;if(!i)return;const{file:s,node:o,container:r}=i,n=_(o,r),e={[this.fileField]:t,[this.titleField]:p(s.name),[this.folderField]:n};this.isSeededSingleContainer()||(e[this.containerField]=r.href),this.mrdCreateObject.emit({path:this.buildCreatePath(),values:e});const d={[this.titleField]:p(s.name),_optimistic:!0},l=!o.docsLoaded&&0===o.docCount;o.hasDocs=!0,o.pending=!1,o.docCount+=1,l?(o.docsLoaded=!0,o.docs=[d]):o.docsLoaded&&(o.docs=[...o.docs,d]),this.recomputeContainerTotals(r,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())}moveDocument(t,i){var s,o;const r=this.dragDoc,n=this.dragFromId?this.nodeIndex.get(this.dragFromId):void 0;if(!r||!n)return;const e="container"===n.kind?n:n.containerId?this.nodeIndex.get(n.containerId):void 0;if(!e)return;const d=_(t,i),l=_(n,e),c=i===e;if(t===n||c&&d===l)return;!function(t,i,s,o){i.docs=i.docs.filter((i=>i!==t)),i.docCount=Math.max(0,i.docCount-1),i.docsLoaded&&(i.hasDocs=i.docs.length>0),s.hasDocs=!0,s.pending=!1,s.docCount+=1,"folder"===s.kind&&(s.fullPath=null!=o?o:""),s.docsLoaded&&(s.docs=[...s.docs,t])}(r,n,t,d),this.recomputeContainerTotals(e,-1),c||this.recomputeContainerTotals(i,1);const a=null===(o=null===(s=null==r?void 0:r._links)||void 0===s?void 0:s.self)||void 0===o?void 0:o.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?v(t):t.totalCount=Math.max(0,t.totalCount+i)}openDoc(t){var i,s,o,r;const n=null===(s=null===(i=null==t?void 0:t._links)||void 0===i?void 0:i.self)||void 0===s?void 0:s.href,e=null!==(r=null!==(o=null==t?void 0:t[this.titleField])&&void 0!==o?o:null==t?void 0:t.name)&&void 0!==r?r:"";this.mrdNavigate.emit({href:n,label:e})}treeCtx(){return{locale:this.locale,titleField:this.titleField,dateField:this.dateField,selectedId:this.selectedId,dropTargetId:this.dropTargetId,uploadingNodeId:this.uploadingNodeId,on:{toggleContainer:t=>this.toggleContainer(t),toggleFolder:(t,i)=>this.toggleFolder(t,i),openDoc:t=>this.openDoc(t),docDragStart:this.onDocDragStart,docDragEnd:this.onDocDragEnd,nodeDragOver:this.onNodeDragOver,nodeDragLeave:this.onNodeDragLeave,nodeDrop:this.onNodeDrop,pendingInput:this.onPendingInput,pendingKeyDown:this.onPendingKeyDown,cancelFolder:()=>this.cancelFolder(),setPendingInputEl:t=>this.pendingInputEl=t}}}render(){const i=this.treeCtx();let s;if(this.rootLoading)s=w(i,0);else if(0===this.containers.length)s=t("div",{key:"ce40dab51ab61447838e5059159ae4778209a6f3",class:"mrd-document-list__empty"},d("no_results",this.locale));else if(this.singleContainer){const o=this.containers[0];if(o.loading&&!o.foldersLoaded)s=w(i,0);else{const r=D(i,o,o,0);s=r.length?r:t("div",{class:"mrd-document-list__empty"},d("doc_empty_drop",this.locale))}}else s=this.containers.map((s=>function(i,s,o){return t("div",{class:"mrd-document-list__node",key:s.id},t("div",{class:"mrd-document-list__row mrd-document-list__row--dossier"+(s.id===i.selectedId?" mrd-document-list__row--selected":"")+(s.id===i.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>i.on.toggleContainer(s),onDragOver:t=>i.on.nodeDragOver(t,s),onDragLeave:()=>i.on.nodeDragLeave(s),onDrop:t=>i.on.nodeDrop(t,s,s)},y(o),g(s.open,!1),t("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"},t("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"})),t("span",{class:"mrd-document-list__label"},s.label),t("span",{class:"mrd-document-list__count"},s.totalCount)),s.open&&t("div",{class:"mrd-document-list__kids"},s.loading&&!s.foldersLoaded?w(i,o+1):D(i,s,s,o+1)))}(i,s,0)));return t(r,{key:"9e1f7805ae18bce506c530a481db902900ad95f3"},t("div",{key:"a51334634e94310a71650ad49f17f0a20e2aed4d",class:"mrd-document-list"+(this.rootDropActive?" mrd-document-list--drop-active":""),onDragOver:this.onRootDragOver,onDragLeave:this.onRootDragLeave,onDrop:this.onRootDrop},s))}get el(){return this}static get style(){return'@charset "UTF-8";.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:var(--mrd-color-folder)}.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 F(){"undefined"!=typeof customElements&&["mrd-document-list"].forEach((t=>{"mrd-document-list"===t&&(customElements.get(n(t))||customElements.define(n(t),C))}))}C.ROOT="__root__";export{C as M,F as d}
|
|
1
|
+
import{h as t,proxyCustomElement as i,HTMLElement as s,createEvent as o,Host as r,transformTag as n}from"@stencil/core/internal/client";import{a as e}from"./client-layout.js";import{t as d}from"./i18n.js";import{b as l,a as c}from"./query-params.js";import{f as a}from"./format.js";function u(t){if(null==t)return[];const i=String(t).trim();return""===i||"/"===i?[]:i.split("/").map((t=>t.trim())).filter(Boolean)}function m(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:[]}}function h(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:[]}}function v(t){let i=t.docCount;for(const s of t.children)i+=v(s);return t.totalCount=i,i}function f(t,i){if("container"===t.kind)return[];const s=i.id+"/",o=t.id.startsWith(s)?t.id.slice(s.length):"";return o?o.split("/"):[]}function _(t,i){if("container"===t.kind)return null;if(null!=t.fullPath&&""!==t.fullPath)return t.fullPath;const s=f(t,i);return s.length?"/"+s.join("/"):null}function p(t){return t.replace(/\.[^./\\]+$/,"")}function g(i,s){return t("span",{class:`mrd-document-list__chev${s?" mrd-document-list__chev--leaf":""}${i?" mrd-document-list__chev--open":""}`},t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},t("path",{d:"M9 6l6 6-6 6"})))}function b(){return t("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"},t("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"}))}function y(i){return 0===i?null:t("span",{class:"mrd-document-list__indent",style:{width:18*i+"px"}})}function w(t){return 0===t?51:8+18*t+43}function k(i,s){return t("div",{class:"mrd-document-list__loading",key:"loading"},y(s),t("span",{class:"mrd-document-list__spinner"}),d("loading",i.locale))}function D(i,s,o,r,n){var e,d,l,c,u;const m=null!==(d=null!==(e=null==s?void 0:s[i.titleField])&&void 0!==e?e:null==s?void 0:s.name)&&void 0!==d?d:"",h=i.dateField?null==s?void 0:s[i.dateField]:void 0,v=h?a(h,i.locale):"";return t("div",{class:"mrd-document-list__row mrd-document-list__row--doc",key:null!==(u=null===(c=null===(l=null==s?void 0:s._links)||void 0===l?void 0:l.self)||void 0===c?void 0:c.href)&&void 0!==u?u:m,draggable:!0,onClick:()=>i.on.openDoc(s),onDragStart:t=>i.on.docDragStart(t,s,o),onDragEnd:i.on.docDragEnd,onDragOver:t=>i.on.nodeDragOver(t,o),onDragLeave:()=>i.on.nodeDragLeave(o),onDrop:t=>i.on.nodeDrop(t,o,r)},y(n),g(!1,!0),t("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"},t("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 2v6h6"})),t("span",{class:"mrd-document-list__label"},m),v&&t("span",{class:"mrd-document-list__date"},v))}function x(i,s,o,r){const n=[];if(o.hasDocs)if(o.docsLoaded)for(const t of o.docs)n.push(D(i,t,o,s,r));else o.loading&&n.push(k(i,r));for(const t of o.children)n.push(C(i,s,t,r));return o.id===i.uploadingNodeId&&n.push(function(i,s){return t("div",{class:"mrd-document-list__loading",key:"uploading"},y(s),t("span",{class:"mrd-document-list__spinner"}),d("upload_file",i.locale))}(i,r)),n}function C(i,s,o,r){if(o.editing)return function(i,s,o){return t("div",{class:"mrd-document-list__node",key:s.id},t("div",{class:"mrd-document-list__row mrd-document-list__row--edit"},y(o),g(!1,!0),b(),t("input",{class:"mrd-document-list__name-input",type:"text",placeholder:d("folder_name_placeholder",i.locale),ref:t=>i.on.setPendingInputEl(t),onInput:i.on.pendingInput,onKeyDown:i.on.pendingKeyDown,onBlur:()=>i.on.cancelFolder()})),s.error&&t("div",{class:"mrd-document-list__error",style:{paddingLeft:`${w(o)}px`}},s.error))}(i,o,r);const n=0===o.children.length&&!o.hasDocs;return t("div",{class:"mrd-document-list__node",key:o.id},t("div",{class:"mrd-document-list__row"+(o.id===i.selectedId?" mrd-document-list__row--selected":"")+(o.pending?" mrd-document-list__row--pending":"")+(o.id===i.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>i.on.toggleFolder(s,o),onDragOver:t=>i.on.nodeDragOver(t,o),onDragLeave:()=>i.on.nodeDragLeave(o),onDrop:t=>i.on.nodeDrop(t,o,s)},y(r),g(o.open,n),b(),t("span",{class:"mrd-document-list__label"},o.label),t("span",{class:"mrd-document-list__count"},o.totalCount)),o.open&&t("div",{class:"mrd-document-list__kids"},x(i,s,o,r+1)))}const F=i(class i extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadDistinct=o(this,"mrdLoadDistinct",7),this.mrdLoadPage=o(this,"mrdLoadPage",7),this.mrdNavigate=o(this,"mrdNavigate",7),this.mrdCanCreate=o(this,"mrdCanCreate",7),this.mrdUpdateObject=o(this,"mrdUpdateObject",7),this.mrdUpload=o(this,"mrdUpload",7),this.mrdCreateObject=o(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,o=h(`${s.id}/__new__${this.newFolderSeq++}`,"",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 o,r,n;this.dragDoc=i,this.dragFromId=s.id,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",null!==(n=null===(r=null===(o=null==i?void 0:i._links)||void 0===o?void 0:o.self)||void 0===r?void 0:r.href)&&void 0!==n?n:""))},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 o=s||i.id!==this.dragFromId?i.id:null;this.dropTargetId!==o&&(this.dropTargetId=o)},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)===e.RELATED_VIEW&&!!(null===(i=this.item)||void 0===i?void 0:i.inverseRelation)&&this.item.inverseRelation===this.containerField&&!!this.containerHref}seedSingleContainer(){const t=m(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;const s=this.item;return l({isRelatedView:(null==s?void 0:s.type)===e.RELATED_VIEW,fromClass:null==s?void 0:s.fromClass,parentId:this.parentId,dataClass:null!==(i=null!==(t=null==s?void 0:s.dataClass)&&void 0!==t?t:null==s?void 0:s.relatedClass)&&void 0!==i?i:""})}buildCreatePath(){var t,i,s;const o=this.item;return l({isRelatedView:(null==o?void 0:o.type)===e.RELATED_VIEW,fromClass:null==o?void 0:o.fromClass,parentId:this.parentId,dataClass: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:""})}baseParams(){var t,i,s;const o=new URLSearchParams,r=null===(t=this.item)||void 0===t?void 0:t.filterClass;return r&&o.set("type",r),c(o,null===(s=null===(i=this.item)||void 0===i?void 0:i.view)||void 0===s?void 0:s.filter),o}emitContainerDistinct(){const t=this.baseParams();t.set("distinct",this.containerField),this.mrdLoadDistinct.emit({nodeId:i.ROOT,distinct:this.containerField,path:this.buildDataPath()+"/distinct",qs:t.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,o;const r=this.baseParams();r.set(this.containerField+"_href",null!==(s=t.href)&&void 0!==s?s:""),r.set(this.folderField,null!==(o=i.fullPath)&&void 0!==o?o:""),i.loading=!0,this.mrdLoadPage.emit({nodeId:i.id,page:0,sort:"",path:this.buildDataPath(),qs:r.toString()})}async setDistinct(t,s){t===i.ROOT?this.applyContainers(s):this.applyFolders(t,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=m(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);s&&(function(t,i,s){t.children=[],t.hasDocs=!1,t.docCount=0;for(const o of i){const i="string"==typeof o.value?o.value:null==o.value?"":String(o.value),r=u(i);if(0===r.length){t.hasDocs=!0,t.docCount=o.count,t.fullPath=i;continue}let n=t;const e=[];for(const i of r){e.push(i);let o=n.children.find((t=>t.label===i));o||(o=h(t.id+"/"+e.join("/"),i,t.id),n.children.push(o),s.set(o.id,o)),n=o}n.hasDocs=!0,n.docCount=o.count,n.fullPath=i}v(t),t.foldersLoaded=!0,t.loading=!1}(s,i,this.nodeIndex),s.hasDocs&&!s.docsLoaded&&this.emitDocuments(s,s),this.bump())}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()}commitFolder(){const t=this.pendingNode,i=this.pendingParent,s=this.pendingContainer;if(!t||!i||!s)return;const o=this.pendingName.trim();if(!o)return void this.cancelFolder();if(o.includes("/"))return t.error=d("folder_no_slash",this.locale),void this.bump();if(i.children.some((i=>i!==t&&i.label.toLowerCase()===o.toLowerCase())))return t.error=d("folder_duplicate",this.locale),void this.bump();const r=[...f(i,s),o];this.nodeIndex.delete(t.id),t.id=s.id+"/"+r.join("/"),t.fullPath="/"+r.join("/"),t.label=o,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 o,r;const n=null===(r=null===(o=t.dataTransfer)||void 0===o?void 0:o.files)||void 0===r?void 0:r[0];this.dropTargetId=null,n&&(this.pendingUpload={file:n,node:i,container:s},i.open=!0,this.uploadingNodeId=i.id,this.bump(),this.mrdUpload.emit({file:n}))}async setFileReference(t){const i=this.pendingUpload;if(!i)return;const{file:s,node:o,container:r}=i,n=_(o,r),e={[this.fileField]:t,[this.titleField]:p(s.name),[this.folderField]:n};this.isSeededSingleContainer()||(e[this.containerField]=r.href),this.mrdCreateObject.emit({path:this.buildCreatePath(),values:e});const d={[this.titleField]:p(s.name),_optimistic:!0},l=!o.docsLoaded&&0===o.docCount;o.hasDocs=!0,o.pending=!1,o.docCount+=1,l?(o.docsLoaded=!0,o.docs=[d]):o.docsLoaded&&(o.docs=[...o.docs,d]),this.recomputeContainerTotals(r,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())}moveDocument(t,i){var s,o;const r=this.dragDoc,n=this.dragFromId?this.nodeIndex.get(this.dragFromId):void 0;if(!r||!n)return;const e="container"===n.kind?n:n.containerId?this.nodeIndex.get(n.containerId):void 0;if(!e)return;const d=_(t,i),l=_(n,e),c=i===e;if(t===n||c&&d===l)return;!function(t,i,s,o){i.docs=i.docs.filter((i=>i!==t)),i.docCount=Math.max(0,i.docCount-1),i.docsLoaded&&(i.hasDocs=i.docs.length>0),s.hasDocs=!0,s.pending=!1,s.docCount+=1,"folder"===s.kind&&(s.fullPath=null!=o?o:""),s.docsLoaded&&(s.docs=[...s.docs,t])}(r,n,t,d),this.recomputeContainerTotals(e,-1),c||this.recomputeContainerTotals(i,1);const a=null===(o=null===(s=null==r?void 0:r._links)||void 0===s?void 0:s.self)||void 0===o?void 0:o.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?v(t):t.totalCount=Math.max(0,t.totalCount+i)}openDoc(t){var i,s,o,r;const n=null===(s=null===(i=null==t?void 0:t._links)||void 0===i?void 0:i.self)||void 0===s?void 0:s.href,e=null!==(r=null!==(o=null==t?void 0:t[this.titleField])&&void 0!==o?o:null==t?void 0:t.name)&&void 0!==r?r:"";this.mrdNavigate.emit({href:n,label:e})}treeCtx(){return{locale:this.locale,titleField:this.titleField,dateField:this.dateField,selectedId:this.selectedId,dropTargetId:this.dropTargetId,uploadingNodeId:this.uploadingNodeId,on:{toggleContainer:t=>this.toggleContainer(t),toggleFolder:(t,i)=>this.toggleFolder(t,i),openDoc:t=>this.openDoc(t),docDragStart:this.onDocDragStart,docDragEnd:this.onDocDragEnd,nodeDragOver:this.onNodeDragOver,nodeDragLeave:this.onNodeDragLeave,nodeDrop:this.onNodeDrop,pendingInput:this.onPendingInput,pendingKeyDown:this.onPendingKeyDown,cancelFolder:()=>this.cancelFolder(),setPendingInputEl:t=>this.pendingInputEl=t}}}render(){const i=this.treeCtx();let s;if(this.rootLoading)s=k(i,0);else if(0===this.containers.length)s=t("div",{key:"ce40dab51ab61447838e5059159ae4778209a6f3",class:"mrd-document-list__empty"},d("no_results",this.locale));else if(this.singleContainer){const o=this.containers[0];if(o.loading&&!o.foldersLoaded)s=k(i,0);else{const r=x(i,o,o,0);s=r.length?r:t("div",{class:"mrd-document-list__empty"},d("doc_empty_drop",this.locale))}}else s=this.containers.map((s=>function(i,s,o){return t("div",{class:"mrd-document-list__node",key:s.id},t("div",{class:"mrd-document-list__row mrd-document-list__row--dossier"+(s.id===i.selectedId?" mrd-document-list__row--selected":"")+(s.id===i.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>i.on.toggleContainer(s),onDragOver:t=>i.on.nodeDragOver(t,s),onDragLeave:()=>i.on.nodeDragLeave(s),onDrop:t=>i.on.nodeDrop(t,s,s)},y(o),g(s.open,!1),t("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"},t("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"})),t("span",{class:"mrd-document-list__label"},s.label),t("span",{class:"mrd-document-list__count"},s.totalCount)),s.open&&t("div",{class:"mrd-document-list__kids"},s.loading&&!s.foldersLoaded?k(i,o+1):x(i,s,s,o+1)))}(i,s,0)));return t(r,{key:"9e1f7805ae18bce506c530a481db902900ad95f3"},t("div",{key:"a51334634e94310a71650ad49f17f0a20e2aed4d",class:"mrd-document-list"+(this.rootDropActive?" mrd-document-list--drop-active":""),onDragOver:this.onRootDragOver,onDragLeave:this.onRootDragLeave,onDrop:this.onRootDrop},s))}get el(){return this}static get style(){return'@charset "UTF-8";.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-1);height:2.125rem;padding:0 var(--mrd-space-4) 0 var(--mrd-space-2);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:0.875rem;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:var(--mrd-color-folder)}.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-1);height:1.875rem;padding:0 var(--mrd-space-4) 0 var(--mrd-space-2);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 z(){"undefined"!=typeof customElements&&["mrd-document-list"].forEach((t=>{"mrd-document-list"===t&&(customElements.get(n(t))||customElements.define(n(t),F))}))}F.ROOT="__root__";export{F as M,z as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,createEvent as d,h as i,Host as t,transformTag as o}from"@stencil/core/internal/client";import{t as n}from"./i18n.js";import{f as m}from"./format.js";import{d as a}from"./mrd-file-preview2.js";const c=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdNavigate=d(this,"mrdNavigate",7),this.mrdDownload=d(this,"mrdDownload",7),this.mrdLoadPreview=d(this,"mrdLoadPreview",7),this.data={},this.locale=navigator.language,this.previewUrl="",this.previewHeight=640,this.lastPreviewHref=null}componentDidLoad(){this.requestPreviewIfNeeded()}dataChanged(){this.requestPreviewIfNeeded()}requestPreviewIfNeeded(){var e,r;const d=null!==(r=null===(e=this.slotValue("file"))||void 0===e?void 0:e.href)&&void 0!==r?r:null;d&&d!==this.lastPreviewHref&&(this.lastPreviewHref=d,this.mrdLoadPreview.emit({href:d}))}slotValue(e){var r,d;const i=null===(d=null===(r=this.archetype)||void 0===r?void 0:r.slots)||void 0===d?void 0:d[e];if(i)return this.data[i]}slotLink(e){var r,d,i,t;const o=null===(d=null===(r=this.archetype)||void 0===r?void 0:r.slots)||void 0===d?void 0:d[e];if(o)return(null!==(t=null===(i=this.data)||void 0===i?void 0:i._links)&&void 0!==t?t:{})[o]}renderContainer(){const e=this.slotLink("container");return(null==e?void 0:e.href)&&e.name?i("button",{class:"mrd-document-view__crumb",onClick:()=>this.mrdNavigate.emit({href:e.href,label:e.name})},i("svg",{class:"mrd-document-view__crumb-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("path",{d:"M19 12H5M12 19l-7-7 7-7"})),e.name):null}renderFileMeta(e,r){return i("div",{class:"mrd-document-view__file-meta"},i("span",{class:"mrd-document-view__file-name"},e),r&&i("button",{type:"button",class:"mrd-document-view__download",onClick:()=>this.mrdDownload.emit({href:r,fileName:e})},i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i("path",{d:"M12 3v12m0 0l-4-4m4 4l4-4M4 21h16"})),n("download",this.locale)))}renderPreviewPanel(e,r,d){return r?i("div",{class:"mrd-document-view__preview",style:{minHeight:`${this.previewHeight}px`}},this.previewUrl?i("mrd-file-preview",{src:this.previewUrl,mimeType:d,fileName:e,href:r,locale:this.locale,onMrdDownload:e=>{e.stopPropagation(),this.mrdDownload.emit(e.detail)},onMrdPreviewReload:e=>{e.stopPropagation(),this.mrdLoadPreview.emit({href:r})}}):i("div",{class:"mrd-document-view__preview-loading"},n("loading",this.locale))):null}render(){var e,r,d,o;const n=this.slotValue("title"),a=null!=n&&""!==n?String(n):null,c=this.slotValue("date"),l=null!=c&&""!==c?m(c,this.locale):null,s=this.slotValue("summary"),v=null!=s&&""!==s?String(s):null,u=this.slotValue("file"),w=null!==(e=null==u?void 0:u.href)&&void 0!==e?e:"",h=null!==(r=null==u?void 0:u.fileName)&&void 0!==r?r:u?String(u):"",f=null!==(o=null!==(d=null==u?void 0:u.mimeType)&&void 0!==d?d:null==u?void 0:u.contentType)&&void 0!==o?o:"";return i(t,{key:"6023c8c6ca3d780fd4a9cca41189cb05a151221e"},i("div",{key:"d7d39d62964583da0ca6c1494e75321e6bab9ac8",class:"mrd-document-view"},i("div",{key:"9aa14569c9ffc785ffb4f2b3d5930cf3e822e246",class:"mrd-document-view__body"},i("div",{key:"e00f3b55551429d8522fb97e7ccb43d56e98042d",class:"mrd-document-view__meta"},this.renderContainer(),a&&i("h1",{key:"9860273878b245fc757eb690c6cd7006b13045c4",class:"mrd-document-view__title"},a),l&&i("p",{key:"84c60b0b6feb6678d661000c26050e42eaaa8399",class:"mrd-document-view__date"},l),u&&this.renderFileMeta(h,w),v&&i("div",{key:"d1cff0cc1b9376409c8e04a785deba93c986ba47",class:"mrd-document-view__summary"},i("div",{key:"fc9c4b986afc8c4f50486caf85bf58860d641a2b",class:"mrd-document-view__summary-body",innerHTML:v}))),u&&this.renderPreviewPanel(h,w,f))))}static get watchers(){return{data:[{dataChanged:0}]}}static get style(){return".sc-mrd-document-view-h{display:block;container-type:inline-size;container-name:mrd-document-view}.mrd-document-view.sc-mrd-document-view{max-width:1200px}.mrd-document-view__body.sc-mrd-document-view{display:grid;grid-template-columns:1fr;gap:var(--mrd-space-6)}@container mrd-document-view (min-width: 640px){.mrd-document-view__body{grid-template-columns:minmax(220px, 320px) 1fr !important;align-items:stretch !important}.mrd-document-view__crumb{margin-bottom:var(--mrd-space-2) !important}}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file-meta.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);margin-bottom:var(--mrd-space-2)}.mrd-document-view__file-name.sc-mrd-document-view{flex:1;min-width:0;font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__preview.sc-mrd-document-view{width:100%;overflow:hidden;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50)}.mrd-document-view__preview-loading.sc-mrd-document-view{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm)}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}"}},[2,"mrd-document-view",{archetype:[16],data:[16],locale:[1],previewUrl:[1,"preview-url"],previewHeight:[2,"preview-height"]},void 0,{data:[{dataChanged:0}]}]);function l(){"undefined"!=typeof customElements&&["mrd-document-view","mrd-file-preview"].forEach((e=>{switch(e){case"mrd-document-view":customElements.get(o(e))||customElements.define(o(e),c);break;case"mrd-file-preview":customElements.get(o(e))||a()}}))}export{c as M,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as a,transformTag as l}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";import{r as m,v as s,F as t,c,a as
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as a,transformTag as l}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";import{r as m,v as s,F as t,c as n,a as c}from"./field-helpers.js";const f=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleInput=r=>{this.mrdChange.emit({name:this.name,value:r.target.value})},this.handleBlur=r=>{const e=r.target.value;this.error=m(e,this.required,this.locale)||(e&&!s(e)?o("invalid_email",this.locale):""),this.mrdBlur.emit({name:this.name,value:e})}}render(){return d(a,{key:"e113fb3958c06ee4d4e870b6005e07b1793835a1"},d("div",{key:"9393b859167f1474d944575f464e1523f1dcf469",class:"mrd-email-field"},d(t,{key:"57c134921adb7f941c19d2fa36cce213bc12ae1e",base:"mrd-email-field",label:this.label,required:this.required}),d("input",{key:"67496689526d2fa96a087b00a9436e9de4d69415",class:n("mrd-email-field",!!this.error),type:"email",name:this.name,value:this.value,placeholder:this.placeholder||"name@example.com",required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur}),d(c,{key:"5a151c2995db77771fe8f98a24c627b0060f655a",base:"mrd-email-field",error:this.error})))}static get style(){return'.sc-mrd-email-field-h{display:block}.mrd-email-field.sc-mrd-email-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-email-field__label.sc-mrd-email-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-email-field__label--required.sc-mrd-email-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-email-field__input.sc-mrd-email-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-email-field__input.sc-mrd-email-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-email-field__input.sc-mrd-email-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-email-field__input.sc-mrd-email-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-email-field__input--error.sc-mrd-email-field{border-color:var(--mrd-border-color-error)}.mrd-email-field__input--error.sc-mrd-email-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-email-field__error.sc-mrd-email-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-email-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function h(){"undefined"!=typeof customElements&&["mrd-email-field"].forEach((r=>{"mrd-email-field"===r&&(customElements.get(l(r))||customElements.define(l(r),f))}))}export{f as M,h as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,createEvent as r,h as l,Host as d,transformTag as o}from"@stencil/core/internal/client";import{t as s}from"./i18n.js";import{F as t,a}from"./field-helpers.js";import{m as f,v as n,u as m}from"./file-upload-common.js";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=r(this,"mrdChange",7),this.mrdBlur=r(this,"mrdBlur",7),this.mrdUpload=r(this,"mrdUpload",7),this.name="",this.label="",this.value=null,this.required=!1,this.disabled=!1,this.locale=navigator.language,this.accept="",this.maxSize=0,this.fileName="",this.isDragging=!1,this.uploading=!1,this.error="",this.handleInputChange=e=>{var i;const r=e.target.files;this.handleFile(null!==(i=null==r?void 0:r[0])&&void 0!==i?i:null)},this.drag=f((e=>this.isDragging=e),(e=>this.handleFile(e))),this.handleZoneClick=()=>{var e;this.disabled||this.uploading||null===(e=this.fileInputRef)||void 0===e||e.click()},this.handleClear=e=>{e.stopPropagation(),this.fileName="",this.error="",this.uploading=!1,this.fileInputRef&&(this.fileInputRef.value=""),this.mrdChange.emit({name:this.name,value:null})}}valueChanged(e){"string"==typeof e&&e?this.uploading=!1:e||(this.uploading=!1,this.fileName="")}handleFile(e){if(!e)return this.fileName="",this.uploading=!1,void this.mrdChange.emit({name:this.name,value:null});const i=n(e,this.maxSize,this.locale);i?this.error=i:(this.error="",this.fileName=e.name,this.uploading=!0,this.mrdChange.emit({name:this.name,value:e}),this.mrdUpload.emit({name:this.name,file:e}))}render(){const e=this.uploading||"string"==typeof this.value&&this.value||this.fileName,i=m("mrd-file-field",{dragging:this.isDragging,error:!!this.error,disabled:this.disabled||this.uploading});return l(d,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,createEvent as r,h as l,Host as d,transformTag as o}from"@stencil/core/internal/client";import{t as s}from"./i18n.js";import{F as t,a}from"./field-helpers.js";import{m as f,v as n,u as m}from"./file-upload-common.js";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=r(this,"mrdChange",7),this.mrdBlur=r(this,"mrdBlur",7),this.mrdUpload=r(this,"mrdUpload",7),this.name="",this.label="",this.value=null,this.required=!1,this.disabled=!1,this.locale=navigator.language,this.accept="",this.maxSize=0,this.fileName="",this.isDragging=!1,this.uploading=!1,this.error="",this.handleInputChange=e=>{var i;const r=e.target.files;this.handleFile(null!==(i=null==r?void 0:r[0])&&void 0!==i?i:null)},this.drag=f((e=>this.isDragging=e),(e=>this.handleFile(e))),this.handleZoneClick=()=>{var e;this.disabled||this.uploading||null===(e=this.fileInputRef)||void 0===e||e.click()},this.handleClear=e=>{e.stopPropagation(),this.fileName="",this.error="",this.uploading=!1,this.fileInputRef&&(this.fileInputRef.value=""),this.mrdChange.emit({name:this.name,value:null})}}valueChanged(e){"string"==typeof e&&e?this.uploading=!1:e||(this.uploading=!1,this.fileName="")}handleFile(e){if(!e)return this.fileName="",this.uploading=!1,void this.mrdChange.emit({name:this.name,value:null});const i=n(e,this.maxSize,this.locale);i?this.error=i:(this.error="",this.fileName=e.name,this.uploading=!0,this.mrdChange.emit({name:this.name,value:e}),this.mrdUpload.emit({name:this.name,file:e}))}render(){const e=this.uploading||"string"==typeof this.value&&this.value||this.fileName,i=m("mrd-file-field",{dragging:this.isDragging,error:!!this.error,disabled:this.disabled||this.uploading});return l(d,{key:"6410e945bb873a05d0a1b3be45bc879b5e153a05"},l("div",{key:"4d1d69d768b383f0d9190f88a50a87de8679d3d2",class:"mrd-file-field"},l(t,{key:"7e0009908fb4c087de16cf08251ab398199dae60",base:"mrd-file-field",label:this.label,required:this.required}),l("div",{key:"88dfc0d1c34670f7de8f3cf2dea4c95b0ae66f4c",class:i,onClick:this.handleZoneClick,onDragOver:this.drag.onDragOver,onDragLeave:this.drag.onDragLeave,onDrop:this.drag.onDrop},l("input",{key:"b6d678b5582a58721c928cef47dd8d6645b26a86",ref:e=>this.fileInputRef=e,class:"mrd-file-field__input",type:"file",name:this.name,accept:this.accept,disabled:this.disabled||this.uploading,required:this.required&&!e,onChange:this.handleInputChange}),e?l("div",{class:"mrd-file-field__selected"},this.uploading?l("span",{class:"mrd-file-field__spinner","aria-label":s("loading",this.locale)}):l("svg",{class:"mrd-file-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},l("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),l("polyline",{points:"14 2 14 8 20 8"})),l("span",{class:"mrd-file-field__filename"},this.fileName),!this.uploading&&l("button",{class:"mrd-file-field__clear",type:"button",onClick:this.handleClear,"aria-label":s("clear",this.locale)},"✕")):l("div",{class:"mrd-file-field__prompt"},l("svg",{class:"mrd-file-field__upload-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},l("polyline",{points:"16 16 12 12 8 16"}),l("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),l("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"})),l("span",null,s("drop_file_here",this.locale)," ",l("span",{class:"mrd-file-field__browse"},s("browse",this.locale))))),l(a,{key:"80f1698819c60b15476b953f5f3216f195430b84",base:"mrd-file-field",error:this.error})))}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return'.sc-mrd-file-field-h{display:block}.mrd-file-field.sc-mrd-file-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-file-field__label.sc-mrd-file-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-file-field__label--required.sc-mrd-file-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-file-field__error.sc-mrd-file-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-file-field__zone.sc-mrd-file-field{display:flex;align-items:center;justify-content:center;border:2px dashed var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background-color:var(--mrd-color-neutral-50);cursor:pointer;transition:border-color var(--mrd-transition), background-color var(--mrd-transition);min-height:100px;position:relative}.mrd-file-field__zone.sc-mrd-file-field:hover,.mrd-file-field__zone--dragging.sc-mrd-file-field{border-color:var(--mrd-color-primary);background-color:var(--mrd-color-primary-light)}.mrd-file-field__zone--error.sc-mrd-file-field{border-color:var(--mrd-border-color-error)}.mrd-file-field__zone--disabled.sc-mrd-file-field{opacity:0.6;cursor:not-allowed}.mrd-file-field__zone--disabled.sc-mrd-file-field:hover{border-color:var(--mrd-border-color);background-color:var(--mrd-color-neutral-50)}.mrd-file-field__zone.sc-mrd-file-field{padding:var(--mrd-space-6)}.mrd-file-field__input.sc-mrd-file-field{position:absolute;inset:0;opacity:0;width:100%;height:100%;pointer-events:none;cursor:pointer}.mrd-file-field__prompt.sc-mrd-file-field{display:flex;flex-direction:column;align-items:center;gap:var(--mrd-space-2);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);text-align:center}.mrd-file-field__upload-icon.sc-mrd-file-field{width:32px;height:32px;color:var(--mrd-color-neutral-400)}.mrd-file-field__browse.sc-mrd-file-field{color:var(--mrd-color-primary);font-weight:var(--mrd-font-weight-medium);text-decoration:underline}.mrd-file-field__selected.sc-mrd-file-field{display:flex;align-items:center;gap:var(--mrd-space-2);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700)}.mrd-file-field__icon.sc-mrd-file-field{width:20px;height:20px;color:var(--mrd-color-primary);flex-shrink:0}.mrd-file-field__filename.sc-mrd-file-field{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.mrd-file-field__clear.sc-mrd-file-field{background:none;border:none;cursor:pointer;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm);padding:var(--mrd-space-1);border-radius:var(--mrd-border-radius-sm);line-height:1}.mrd-file-field__clear.sc-mrd-file-field:hover{color:var(--mrd-color-danger);background-color:var(--mrd-color-danger-light)}.mrd-file-field__spinner.sc-mrd-file-field{display:inline-block;width:18px;height:18px;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-spin 0.6s linear infinite;flex-shrink:0}@keyframes mrd-spin{to{transform:rotate(360deg)}}'}},[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]},void 0,{value:[{valueChanged:0}]}]);function h(){"undefined"!=typeof customElements&&["mrd-file-field"].forEach((e=>{"mrd-file-field"===e&&(customElements.get(o(e))||customElements.define(o(e),c))}))}export{c as M,h as d}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface MrdFilePreview extends Components.MrdFilePreview, HTMLElement {}
|
|
4
|
+
export const MrdFilePreview: {
|
|
5
|
+
prototype: MrdFilePreview;
|
|
6
|
+
new (): MrdFilePreview;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as r,d as e}from"./mrd-file-preview2.js";const o=r,s=e;export{o as MrdFilePreview,s as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,createEvent as i,h as t,Host as s,transformTag as d}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";const l=new Set(["png","jpg","jpeg","gif","webp","svg","bmp"]),n=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdPreviewReload=i(this,"mrdPreviewReload",7),this.mrdDownload=i(this,"mrdDownload",7),this.src="",this.mimeType="",this.fileName="",this.href="",this.locale=navigator.language,this.imageFailed=!1,this.onImageError=()=>{this.imageFailed=!0},this.retry=()=>{this.imageFailed=!1,this.mrdPreviewReload.emit()}}srcChanged(){this.imageFailed=!1}render(){const e=function(e,r){const i=(null!=e?e:"").toLowerCase().trim();if(i)return"application/pdf"===i?"pdf":i.startsWith("image/")?"image":"unsupported";const t=function(e){if(!e)return null;const r=/\.([a-z0-9]+)$/i.exec(e);return r?r[1].toLowerCase():null}(r);return"pdf"===t?"pdf":t&&l.has(t)?"image":"unsupported"}(this.mimeType,this.fileName);return t(s,null,"pdf"===e?t("iframe",{class:"mrd-file-preview__frame",src:this.src,title:this.fileName||"preview"}):"image"===e?this.imageFailed?t("div",{class:"mrd-file-preview__error"},t("span",{class:"mrd-file-preview__error-text"},o("preview_error",this.locale)),t("button",{type:"button",class:"mrd-file-preview__retry",onClick:this.retry},o("retry",this.locale))):t("img",{class:"mrd-file-preview__image",src:this.src,alt:this.fileName||"",onError:this.onImageError}):t("div",{class:"mrd-file-preview__unsupported"},t("span",null,o("preview_unsupported",this.locale)),this.href&&t("button",{type:"button",class:"mrd-file-preview__download",onClick:()=>this.mrdDownload.emit({href:this.href,fileName:this.fileName})},t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},t("path",{d:"M12 3v12m0 0l-4-4m4 4l4-4M4 21h16"})),o("download",this.locale))))}static get watchers(){return{src:[{srcChanged:0}]}}static get style(){return".sc-mrd-file-preview-h{display:block;width:100%;height:100%}.mrd-file-preview__frame.sc-mrd-file-preview{display:block;width:100%;height:100%;border:none}.mrd-file-preview__image.sc-mrd-file-preview{display:block;max-width:100%;max-height:100%;margin:0 auto;object-fit:contain}.mrd-file-preview__error.sc-mrd-file-preview,.mrd-file-preview__unsupported.sc-mrd-file-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--mrd-space-3);width:100%;height:100%;min-height:8rem;padding:var(--mrd-space-6);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center}.mrd-file-preview__error-text.sc-mrd-file-preview{color:var(--mrd-color-danger)}.mrd-file-preview__retry.sc-mrd-file-preview,.mrd-file-preview__download.sc-mrd-file-preview{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:2rem;padding:0 var(--mrd-space-3);border:var(--mrd-border-width) solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);background:var(--mrd-color-white);color:var(--mrd-color-neutral-700);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);cursor:pointer}.mrd-file-preview__retry.sc-mrd-file-preview:hover,.mrd-file-preview__download.sc-mrd-file-preview:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-file-preview__download.sc-mrd-file-preview svg.sc-mrd-file-preview{width:0.9375rem;height:0.9375rem}"}},[2,"mrd-file-preview",{src:[1],mimeType:[1,"mime-type"],fileName:[1,"file-name"],href:[1],locale:[1],imageFailed:[32]},void 0,{src:[{srcChanged:0}]}]);function a(){"undefined"!=typeof customElements&&["mrd-file-preview"].forEach((e=>{"mrd-file-preview"===e&&(customElements.get(d(e))||customElements.define(d(e),n))}))}export{n as M,a as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as a,Host as d,transformTag as o}from"@stencil/core/internal/client";import{t as l}from"./i18n.js";import{F as t,a as s}from"./field-helpers.js";import{m,v as n,u as c}from"./file-upload-common.js";const f=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.mrdUpload=i(this,"mrdUpload",7),this.name="",this.label="",this.value=null,this.required=!1,this.disabled=!1,this.locale=navigator.language,this.accept="image/*",this.maxSize=0,this.previewUrl="",this.fileName="",this.isDragging=!1,this.uploading=!1,this.error="",this.handleInputChange=r=>{var e;const i=r.target.files;this.handleFile(null!==(e=null==i?void 0:i[0])&&void 0!==e?e:null)},this.drag=m((r=>this.isDragging=r),(r=>this.handleFile(r))),this.handleZoneClick=()=>{var r;this.disabled||this.uploading||null===(r=this.fileInputRef)||void 0===r||r.click()},this.handleClear=r=>{r.stopPropagation(),this.previewUrl="",this.fileName="",this.error="",this.uploading=!1,this.fileInputRef&&(this.fileInputRef.value=""),this.mrdChange.emit({name:this.name,value:null})}}valueChanged(r){"string"==typeof r&&r?this.uploading=!1:r||(this.uploading=!1,this.previewUrl="",this.fileName="")}handleFile(r){if(!r)return this.previewUrl="",this.fileName="",this.uploading=!1,void this.mrdChange.emit({name:this.name,value:null});const e=n(r,this.maxSize,this.locale,!0);if(e)return void(this.error=e);this.error="",this.fileName=r.name,this.uploading=!0;const i=new FileReader;i.onload=r=>{var e;this.previewUrl=null===(e=r.target)||void 0===e?void 0:e.result},i.readAsDataURL(r),this.mrdChange.emit({name:this.name,value:r}),this.mrdUpload.emit({name:this.name,file:r})}render(){const r=c("mrd-image-field",{dragging:this.isDragging,error:!!this.error,disabled:this.disabled||this.uploading});return a(d,{key:"
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as a,Host as d,transformTag as o}from"@stencil/core/internal/client";import{t as l}from"./i18n.js";import{F as t,a as s}from"./field-helpers.js";import{m,v as n,u as c}from"./file-upload-common.js";const f=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.mrdUpload=i(this,"mrdUpload",7),this.name="",this.label="",this.value=null,this.required=!1,this.disabled=!1,this.locale=navigator.language,this.accept="image/*",this.maxSize=0,this.previewUrl="",this.fileName="",this.isDragging=!1,this.uploading=!1,this.error="",this.handleInputChange=r=>{var e;const i=r.target.files;this.handleFile(null!==(e=null==i?void 0:i[0])&&void 0!==e?e:null)},this.drag=m((r=>this.isDragging=r),(r=>this.handleFile(r))),this.handleZoneClick=()=>{var r;this.disabled||this.uploading||null===(r=this.fileInputRef)||void 0===r||r.click()},this.handleClear=r=>{r.stopPropagation(),this.previewUrl="",this.fileName="",this.error="",this.uploading=!1,this.fileInputRef&&(this.fileInputRef.value=""),this.mrdChange.emit({name:this.name,value:null})}}valueChanged(r){"string"==typeof r&&r?this.uploading=!1:r||(this.uploading=!1,this.previewUrl="",this.fileName="")}handleFile(r){if(!r)return this.previewUrl="",this.fileName="",this.uploading=!1,void this.mrdChange.emit({name:this.name,value:null});const e=n(r,this.maxSize,this.locale,!0);if(e)return void(this.error=e);this.error="",this.fileName=r.name,this.uploading=!0;const i=new FileReader;i.onload=r=>{var e;this.previewUrl=null===(e=r.target)||void 0===e?void 0:e.result},i.readAsDataURL(r),this.mrdChange.emit({name:this.name,value:r}),this.mrdUpload.emit({name:this.name,file:r})}render(){const r=c("mrd-image-field",{dragging:this.isDragging,error:!!this.error,disabled:this.disabled||this.uploading});return a(d,{key:"700310af716dcc167f98bc7ae7024bb44e1285b6"},a("div",{key:"95d29a82751249e560404488fb279138eee0c1be",class:"mrd-image-field"},a(t,{key:"f53f040257a4b65d8435c836846adab137b91a5e",base:"mrd-image-field",label:this.label,required:this.required}),a("div",{key:"a9cc7a0861b1457d8e4abb11b380b6eeb519a863",class:r,onClick:this.handleZoneClick,onDragOver:this.drag.onDragOver,onDragLeave:this.drag.onDragLeave,onDrop:this.drag.onDrop},a("input",{key:"7112030bc2b80b4c3b31a4421656da4c926a2fe1",ref:r=>this.fileInputRef=r,class:"mrd-image-field__input",type:"file",name:this.name,accept:this.accept,disabled:this.disabled||this.uploading,required:this.required&&!this.previewUrl,onChange:this.handleInputChange}),this.previewUrl?a("div",{class:"mrd-image-field__preview-container"},a("div",{class:"mrd-image-field__preview-thumb"},a("img",{class:"mrd-image-field__preview",src:this.previewUrl,alt:this.fileName}),this.uploading&&a("div",{class:"mrd-image-field__preview-overlay"},a("span",{class:"mrd-image-field__spinner"}))),a("div",{class:"mrd-image-field__preview-info"},a("span",{class:"mrd-image-field__preview-name"},this.fileName),this.uploading&&a("span",{class:"mrd-image-field__upload-status"},l("loading",this.locale))),!this.uploading&&a("button",{class:"mrd-image-field__clear",type:"button",onClick:this.handleClear,"aria-label":l("clear",this.locale)},l("remove",this.locale))):a("div",{class:"mrd-image-field__prompt"},a("svg",{class:"mrd-image-field__upload-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},a("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),a("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),a("polyline",{points:"21 15 16 10 5 21"})),a("span",null,l("drop_file_here",this.locale)," ",a("span",{class:"mrd-image-field__browse"},l("browse",this.locale))))),a(s,{key:"0cf5346ecb1a5d110822b087081b4b5f05255381",base:"mrd-image-field",error:this.error})))}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return'.sc-mrd-image-field-h{display:block}.mrd-image-field.sc-mrd-image-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-image-field__label.sc-mrd-image-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-image-field__label--required.sc-mrd-image-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-image-field__error.sc-mrd-image-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-image-field__zone.sc-mrd-image-field{display:flex;align-items:center;justify-content:center;border:2px dashed var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background-color:var(--mrd-color-neutral-50);cursor:pointer;transition:border-color var(--mrd-transition), background-color var(--mrd-transition);min-height:100px;position:relative}.mrd-image-field__zone.sc-mrd-image-field:hover,.mrd-image-field__zone--dragging.sc-mrd-image-field{border-color:var(--mrd-color-primary);background-color:var(--mrd-color-primary-light)}.mrd-image-field__zone--error.sc-mrd-image-field{border-color:var(--mrd-border-color-error)}.mrd-image-field__zone--disabled.sc-mrd-image-field{opacity:0.6;cursor:not-allowed}.mrd-image-field__zone--disabled.sc-mrd-image-field:hover{border-color:var(--mrd-border-color);background-color:var(--mrd-color-neutral-50)}.mrd-image-field__input.sc-mrd-image-field{position:absolute;inset:0;opacity:0;width:100%;height:100%;pointer-events:none}.mrd-image-field__prompt.sc-mrd-image-field{display:flex;flex-direction:column;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-6);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);text-align:center}.mrd-image-field__upload-icon.sc-mrd-image-field{width:40px;height:40px;color:var(--mrd-color-neutral-400)}.mrd-image-field__browse.sc-mrd-image-field{color:var(--mrd-color-primary);font-weight:var(--mrd-font-weight-medium);text-decoration:underline}.mrd-image-field__preview-container.sc-mrd-image-field{display:flex;align-items:center;gap:var(--mrd-space-4);padding:var(--mrd-space-4);width:100%}.mrd-image-field__preview-thumb.sc-mrd-image-field{flex-shrink:0;width:80px;height:80px;border-radius:var(--mrd-border-radius);overflow:hidden;border:var(--mrd-border-width) solid var(--mrd-border-color);background-color:var(--mrd-color-neutral-100)}.mrd-image-field__preview.sc-mrd-image-field{width:100%;height:100%;object-fit:cover;display:block}.mrd-image-field__preview-info.sc-mrd-image-field{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-image-field__preview-name.sc-mrd-image-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mrd-image-field__preview-overlay.sc-mrd-image-field{position:absolute;inset:0;background:rgba(255, 255, 255, 0.7);display:flex;align-items:center;justify-content:center;border-radius:var(--mrd-border-radius)}.mrd-image-field__spinner.sc-mrd-image-field{display:inline-block;width:24px;height:24px;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-spin 0.6s linear infinite}@keyframes mrd-spin{to{transform:rotate(360deg)}}.mrd-image-field__upload-status.sc-mrd-image-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500)}.mrd-image-field__clear.sc-mrd-image-field{flex-shrink:0;background-color:var(--mrd-color-white);color:var(--mrd-color-danger);border:var(--mrd-border-width) solid var(--mrd-color-danger);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-1) var(--mrd-space-3);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);cursor:pointer;transition:background-color var(--mrd-transition), color var(--mrd-transition)}.mrd-image-field__clear.sc-mrd-image-field:hover{background-color:var(--mrd-color-danger);color:var(--mrd-color-white)}'}},[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]},void 0,{value:[{valueChanged:0}]}]);function h(){"undefined"!=typeof customElements&&["mrd-image-field"].forEach((r=>{"mrd-image-field"===r&&(customElements.get(o(r))||customElements.define(o(r),f))}))}export{f as M,h as d}
|