@mmlogic/components 0.3.11 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/dist/cjs/{index-BPj2cBXs.js → index-CAzwGt9u.js} +38 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  4. package/dist/cjs/mrd-boolean-field_23.cjs.entry.js +1203 -1084
  5. package/dist/collection/collection-manifest.json +23 -23
  6. package/dist/collection/components/{mrd-document-container/mrd-document-container.scss → documents/mrd-document-container/mrd-document-container.css} +3 -3
  7. package/dist/collection/components/{mrd-document-container → documents/mrd-document-container}/mrd-document-container.js +7 -7
  8. package/dist/collection/components/documents/mrd-document-list/folder-tree.js +109 -0
  9. package/dist/collection/components/{mrd-document-list/mrd-document-list.scss → documents/mrd-document-list/mrd-document-list.css} +6 -4
  10. package/dist/collection/components/{mrd-document-list → documents/mrd-document-list}/mrd-document-list.js +83 -240
  11. package/dist/collection/components/documents/mrd-document-list/tree-view.js +75 -0
  12. package/dist/collection/components/{mrd-document-view/mrd-document-view.scss → documents/mrd-document-view/mrd-document-view.css} +1 -1
  13. package/dist/collection/components/{mrd-document-view → documents/mrd-document-view}/mrd-document-view.js +4 -4
  14. package/dist/collection/components/fields/field-helpers.js +17 -0
  15. package/dist/collection/components/fields/file-upload-common.js +38 -0
  16. package/dist/collection/components/{mrd-boolean-field/mrd-boolean-field.scss → fields/mrd-boolean-field/mrd-boolean-field.css} +3 -3
  17. package/dist/collection/components/{mrd-boolean-field → fields/mrd-boolean-field}/mrd-boolean-field.js +1 -1
  18. package/dist/collection/components/{mrd-currency-field/mrd-currency-field.scss → fields/mrd-currency-field/mrd-currency-field.css} +11 -9
  19. package/dist/collection/components/{mrd-currency-field → fields/mrd-currency-field}/mrd-currency-field.js +7 -13
  20. package/dist/collection/components/{mrd-date-field/mrd-date-field.scss → fields/mrd-date-field/mrd-date-field.css} +8 -10
  21. package/dist/collection/components/{mrd-date-field → fields/mrd-date-field}/mrd-date-field.js +3 -10
  22. package/dist/collection/components/{mrd-datetime-field/mrd-datetime-field.scss → fields/mrd-datetime-field/mrd-datetime-field.css} +8 -10
  23. package/dist/collection/components/{mrd-datetime-field → fields/mrd-datetime-field}/mrd-datetime-field.js +3 -10
  24. package/dist/collection/components/{mrd-email-field/mrd-email-field.scss → fields/mrd-email-field/mrd-email-field.css} +2 -11
  25. package/dist/collection/components/{mrd-email-field → fields/mrd-email-field}/mrd-email-field.js +6 -13
  26. package/dist/collection/components/{mrd-file-field/mrd-file-field.scss → fields/mrd-file-field/mrd-file-field.css} +19 -24
  27. package/dist/collection/components/{mrd-file-field → fields/mrd-file-field}/mrd-file-field.js +13 -24
  28. package/dist/collection/components/{mrd-hyperlink-field/mrd-hyperlink-field.scss → fields/mrd-hyperlink-field/mrd-hyperlink-field.css} +7 -16
  29. package/dist/collection/components/{mrd-hyperlink-field → fields/mrd-hyperlink-field}/mrd-hyperlink-field.js +9 -15
  30. package/dist/collection/components/{mrd-image-field/mrd-image-field.scss → fields/mrd-image-field/mrd-image-field.css} +15 -24
  31. package/dist/collection/components/{mrd-image-field → fields/mrd-image-field}/mrd-image-field.js +13 -28
  32. package/dist/collection/components/{mrd-list-field/mrd-list-field.scss → fields/mrd-list-field/mrd-list-field.css} +18 -21
  33. package/dist/collection/components/{mrd-list-field → fields/mrd-list-field}/mrd-list-field.js +10 -25
  34. package/dist/collection/components/{mrd-longtext-field/mrd-longtext-field.scss → fields/mrd-longtext-field/mrd-longtext-field.css} +21 -18
  35. package/dist/collection/components/{mrd-longtext-field → fields/mrd-longtext-field}/mrd-longtext-field.js +3 -10
  36. package/dist/collection/components/{mrd-number-field/mrd-number-field.scss → fields/mrd-number-field/mrd-number-field.css} +9 -10
  37. package/dist/collection/components/{mrd-number-field → fields/mrd-number-field}/mrd-number-field.js +7 -6
  38. package/dist/collection/components/{mrd-relation-field/mrd-relation-field.scss → fields/mrd-relation-field/mrd-relation-field.css} +61 -59
  39. package/dist/collection/components/{mrd-relation-field → fields/mrd-relation-field}/mrd-relation-field.js +16 -26
  40. package/dist/collection/components/{mrd-secret-field/mrd-secret-field.scss → fields/mrd-secret-field/mrd-secret-field.css} +7 -10
  41. package/dist/collection/components/{mrd-secret-field → fields/mrd-secret-field}/mrd-secret-field.js +4 -11
  42. package/dist/collection/components/{mrd-text-field/mrd-text-field.scss → fields/mrd-text-field/mrd-text-field.css} +2 -11
  43. package/dist/collection/components/{mrd-text-field → fields/mrd-text-field}/mrd-text-field.js +3 -10
  44. package/dist/collection/components/{mrd-textarea-field/mrd-textarea-field.scss → fields/mrd-textarea-field/mrd-textarea-field.css} +7 -10
  45. package/dist/collection/components/{mrd-textarea-field → fields/mrd-textarea-field}/mrd-textarea-field.js +3 -9
  46. package/dist/collection/components/{mrd-time-field/mrd-time-field.scss → fields/mrd-time-field/mrd-time-field.css} +8 -10
  47. package/dist/collection/components/{mrd-time-field → fields/mrd-time-field}/mrd-time-field.js +3 -10
  48. package/dist/collection/components/{mrd-field/mrd-field.scss → form/mrd-field/mrd-field.css} +1 -1
  49. package/dist/collection/components/{mrd-field → form/mrd-field}/mrd-field.js +3 -3
  50. package/dist/collection/components/{mrd-form/mrd-form.scss → form/mrd-form/mrd-form.css} +1 -1
  51. package/dist/collection/components/{mrd-form → form/mrd-form}/mrd-form.js +5 -5
  52. package/dist/collection/components/layout/mrd-layout-section/field-value.js +111 -0
  53. package/dist/collection/components/layout/mrd-layout-section/layout-helpers.js +29 -0
  54. package/dist/collection/components/{mrd-layout-section/mrd-layout-section.scss → layout/mrd-layout-section/mrd-layout-section.css} +4 -4
  55. package/dist/collection/components/{mrd-layout-section → layout/mrd-layout-section}/mrd-layout-section.js +52 -142
  56. package/dist/collection/components/{mrd-table/mrd-table.scss → table/mrd-table/mrd-table.css} +11 -13
  57. package/dist/collection/components/{mrd-table → table/mrd-table}/mrd-table.js +111 -439
  58. package/dist/collection/components/table/mrd-table/table-filter-popup.js +85 -0
  59. package/dist/collection/components/table/mrd-table/table-parts.js +110 -0
  60. package/dist/collection/components/table/mrd-table/table-query.js +178 -0
  61. package/dist/collection/components/table/mrd-table/virtual-scroll.js +49 -0
  62. package/dist/collection/dev/app.js +19 -18
  63. package/dist/collection/dev/example-data.js +58 -43
  64. package/dist/collection/utils/i18n.js +8 -0
  65. package/dist/collection/utils/query-params.js +43 -0
  66. package/dist/components/field-helpers.js +1 -0
  67. package/dist/components/file-upload-common.js +1 -0
  68. package/dist/components/i18n.js +1 -1
  69. package/dist/components/mrd-boolean-field2.js +1 -1
  70. package/dist/components/mrd-currency-field2.js +1 -1
  71. package/dist/components/mrd-date-field2.js +1 -1
  72. package/dist/components/mrd-datetime-field2.js +1 -1
  73. package/dist/components/mrd-document-container2.js +1 -1
  74. package/dist/components/mrd-document-list2.js +1 -1
  75. package/dist/components/mrd-document-view2.js +1 -1
  76. package/dist/components/mrd-email-field2.js +1 -1
  77. package/dist/components/mrd-file-field2.js +1 -1
  78. package/dist/components/mrd-form.js +1 -1
  79. package/dist/components/mrd-hyperlink-field2.js +1 -1
  80. package/dist/components/mrd-image-field2.js +1 -1
  81. package/dist/components/mrd-layout-section.js +1 -1
  82. package/dist/components/mrd-list-field2.js +1 -1
  83. package/dist/components/mrd-longtext-field2.js +1 -1
  84. package/dist/components/mrd-number-field2.js +1 -1
  85. package/dist/components/mrd-relation-field2.js +1 -1
  86. package/dist/components/mrd-secret-field2.js +1 -1
  87. package/dist/components/mrd-table2.js +1 -1
  88. package/dist/components/mrd-text-field2.js +1 -1
  89. package/dist/components/mrd-textarea-field2.js +1 -1
  90. package/dist/components/mrd-time-field2.js +1 -1
  91. package/dist/components/query-params.js +1 -0
  92. package/dist/esm/{index-_tsCCkAi.js → index-DiSEJMA8.js} +38 -1
  93. package/dist/esm/loader.js +2 -2
  94. package/dist/esm/mosterdcomponents.js +2 -2
  95. package/dist/esm/mrd-boolean-field_23.entry.js +1203 -1084
  96. package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
  97. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  98. package/dist/mosterdcomponents/p-9b3c0917.entry.js +1 -0
  99. package/dist/mosterdcomponents/p-DiSEJMA8.js +2 -0
  100. package/dist/types/components/{mrd-document-container → documents/mrd-document-container}/mrd-document-container.d.ts +2 -2
  101. package/dist/types/components/documents/mrd-document-list/folder-tree.d.ts +66 -0
  102. package/dist/types/components/{mrd-document-list → documents/mrd-document-list}/mrd-document-list.d.ts +4 -37
  103. package/dist/types/components/documents/mrd-document-list/tree-view.d.ts +32 -0
  104. package/dist/types/components/{mrd-document-view → documents/mrd-document-view}/mrd-document-view.d.ts +2 -2
  105. package/dist/types/components/fields/field-helpers.d.ts +18 -0
  106. package/dist/types/components/fields/file-upload-common.d.ts +18 -0
  107. package/dist/types/components/{mrd-boolean-field → fields/mrd-boolean-field}/mrd-boolean-field.d.ts +1 -1
  108. package/dist/types/components/{mrd-currency-field → fields/mrd-currency-field}/mrd-currency-field.d.ts +2 -2
  109. package/dist/types/components/{mrd-date-field → fields/mrd-date-field}/mrd-date-field.d.ts +1 -1
  110. package/dist/types/components/{mrd-datetime-field → fields/mrd-datetime-field}/mrd-datetime-field.d.ts +1 -1
  111. package/dist/types/components/{mrd-email-field → fields/mrd-email-field}/mrd-email-field.d.ts +1 -1
  112. package/dist/types/components/{mrd-file-field → fields/mrd-file-field}/mrd-file-field.d.ts +2 -4
  113. package/dist/types/components/{mrd-hyperlink-field → fields/mrd-hyperlink-field}/mrd-hyperlink-field.d.ts +2 -2
  114. package/dist/types/components/{mrd-image-field → fields/mrd-image-field}/mrd-image-field.d.ts +2 -4
  115. package/dist/types/components/{mrd-list-field → fields/mrd-list-field}/mrd-list-field.d.ts +2 -2
  116. package/dist/types/components/{mrd-longtext-field → fields/mrd-longtext-field}/mrd-longtext-field.d.ts +1 -1
  117. package/dist/types/components/{mrd-number-field → fields/mrd-number-field}/mrd-number-field.d.ts +2 -2
  118. package/dist/types/components/{mrd-relation-field → fields/mrd-relation-field}/mrd-relation-field.d.ts +2 -2
  119. package/dist/types/components/{mrd-secret-field → fields/mrd-secret-field}/mrd-secret-field.d.ts +1 -1
  120. package/dist/types/components/{mrd-text-field → fields/mrd-text-field}/mrd-text-field.d.ts +1 -1
  121. package/dist/types/components/{mrd-textarea-field → fields/mrd-textarea-field}/mrd-textarea-field.d.ts +1 -1
  122. package/dist/types/components/{mrd-time-field → fields/mrd-time-field}/mrd-time-field.d.ts +1 -1
  123. package/dist/types/components/{mrd-field → form/mrd-field}/mrd-field.d.ts +2 -2
  124. package/dist/types/components/{mrd-form → form/mrd-form}/mrd-form.d.ts +2 -2
  125. package/dist/types/components/layout/mrd-layout-section/field-value.d.ts +22 -0
  126. package/dist/types/components/layout/mrd-layout-section/layout-helpers.d.ts +8 -0
  127. package/dist/types/components/{mrd-layout-section → layout/mrd-layout-section}/mrd-layout-section.d.ts +4 -11
  128. package/dist/types/components/{mrd-table → table/mrd-table}/mrd-table.d.ts +6 -13
  129. package/dist/types/components/table/mrd-table/table-filter-popup.d.ts +35 -0
  130. package/dist/types/components/table/mrd-table/table-parts.d.ts +61 -0
  131. package/dist/types/components/table/mrd-table/table-query.d.ts +50 -0
  132. package/dist/types/components/table/mrd-table/virtual-scroll.d.ts +26 -0
  133. package/dist/types/components.d.ts +3 -5
  134. package/dist/types/utils/query-params.d.ts +14 -0
  135. package/package.json +7 -2
  136. package/dist/components/validation.js +0 -1
  137. package/dist/mosterdcomponents/p-_tsCCkAi.js +0 -2
  138. package/dist/mosterdcomponents/p-a9618055.entry.js +0 -1
@@ -13,6 +13,7 @@ const translations = {
13
13
  drop_file_here: 'Sleep bestand hierheen of',
14
14
  browse: 'bladeren',
15
15
  file_too_large: 'Bestand is te groot',
16
+ invalid_image: 'Selecteer een afbeeldingsbestand',
16
17
  search_results: 'Zoekresultaten',
17
18
  no_results: 'Geen resultaten gevonden',
18
19
  loading: 'Laden...',
@@ -85,6 +86,7 @@ const translations = {
85
86
  drop_file_here: 'Drop file here or',
86
87
  browse: 'browse',
87
88
  file_too_large: 'File is too large',
89
+ invalid_image: 'Please select an image file',
88
90
  search_results: 'Search results',
89
91
  no_results: 'No results found',
90
92
  loading: 'Loading...',
@@ -157,6 +159,7 @@ const translations = {
157
159
  drop_file_here: 'اسحب الملف هنا أو',
158
160
  browse: 'تصفح',
159
161
  file_too_large: 'الملف كبير جداً',
162
+ invalid_image: 'يرجى اختيار ملف صورة',
160
163
  search_results: 'نتائج البحث',
161
164
  no_results: 'لم يتم العثور على نتائج',
162
165
  loading: 'جار التحميل...',
@@ -223,6 +226,7 @@ const translations = {
223
226
  drop_file_here: 'Déposez le fichier ici ou',
224
227
  browse: 'parcourir',
225
228
  file_too_large: 'Le fichier est trop volumineux',
229
+ invalid_image: 'Veuillez sélectionner un fichier image',
226
230
  search_results: 'Résultats de recherche',
227
231
  no_results: 'Aucun résultat trouvé',
228
232
  loading: 'Chargement...',
@@ -289,6 +293,7 @@ const translations = {
289
293
  drop_file_here: 'Datei hier ablegen oder',
290
294
  browse: 'durchsuchen',
291
295
  file_too_large: 'Datei ist zu groß',
296
+ invalid_image: 'Bitte eine Bilddatei auswählen',
292
297
  search_results: 'Suchergebnisse',
293
298
  no_results: 'Keine Ergebnisse gefunden',
294
299
  loading: 'Laden...',
@@ -355,6 +360,7 @@ const translations = {
355
360
  drop_file_here: 'Suelte el archivo aquí o',
356
361
  browse: 'explorar',
357
362
  file_too_large: 'El archivo es demasiado grande',
363
+ invalid_image: 'Seleccione un archivo de imagen',
358
364
  search_results: 'Resultados de búsqueda',
359
365
  no_results: 'No se encontraron resultados',
360
366
  loading: 'Cargando...',
@@ -421,6 +427,7 @@ const translations = {
421
427
  drop_file_here: 'Trascina il file qui o',
422
428
  browse: 'sfoglia',
423
429
  file_too_large: 'Il file è troppo grande',
430
+ invalid_image: 'Seleziona un file immagine',
424
431
  search_results: 'Risultati della ricerca',
425
432
  no_results: 'Nessun risultato trovato',
426
433
  loading: 'Caricamento...',
@@ -487,6 +494,7 @@ const translations = {
487
494
  drop_file_here: 'Перетягніть файл сюди або',
488
495
  browse: 'огляд',
489
496
  file_too_large: 'Файл занадто великий',
497
+ invalid_image: 'Будь ласка, виберіть файл зображення',
490
498
  search_results: 'Результати пошуку',
491
499
  no_results: 'Результатів не знайдено',
492
500
  loading: 'Завантаження...',
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Shared path/query-param conventions for list requests,
3
+ * used by mrd-table and mrd-document-list.
4
+ */
5
+ /** Applies the view-level static filters to `params` using the API operator conventions. */
6
+ export function applyViewFilters(params, filters) {
7
+ var _a, _b, _c;
8
+ for (const f of filters !== null && filters !== void 0 ? filters : []) {
9
+ if (!f.name)
10
+ continue;
11
+ if (f.operator === 'EMPTY') {
12
+ params.set(f.name, '');
13
+ continue;
14
+ }
15
+ if (f.operator === 'NOT_EMPTY') {
16
+ params.set(f.name + '_notempty', 'true');
17
+ continue;
18
+ }
19
+ if (f.operator === 'STARTS_WITH') {
20
+ params.set(f.name + '_startswith', String((_a = f.value) !== null && _a !== void 0 ? _a : ''));
21
+ continue;
22
+ }
23
+ if (f.operator === 'FROM') {
24
+ params.set(f.name + '_from', String((_b = f.value) !== null && _b !== void 0 ? _b : ''));
25
+ continue;
26
+ }
27
+ if (f.operator === 'TO') {
28
+ params.set(f.name + '_to', String((_c = f.value) !== null && _c !== void 0 ? _c : ''));
29
+ continue;
30
+ }
31
+ if (f.value != null) {
32
+ params.set(f.name, String(f.value));
33
+ }
34
+ }
35
+ }
36
+ /** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`. */
37
+ export function buildListPath(opts) {
38
+ var _a, _b, _c;
39
+ if (opts.isRelatedView) {
40
+ return `/${(_a = opts.fromClass) !== null && _a !== void 0 ? _a : ''}/${opts.parentId}/${(_b = opts.dataClass) !== null && _b !== void 0 ? _b : ''}`;
41
+ }
42
+ return `/${(_c = opts.dataClass) !== null && _c !== void 0 ? _c : ''}`;
43
+ }
@@ -0,0 +1 @@
1
+ import{h as r}from"@stencil/core/internal/client";import{t as n}from"./i18n.js";import{b as t}from"./client-layout.js";function e(r){if(null==r)return!1;if("string"==typeof r)return r.trim().length>0;if(Array.isArray(r))return r.length>0;if("object"==typeof r){if("href"in r)return"string"==typeof r.href&&r.href.trim().length>0;if("amount"in r)return null!=r.amount&&""!==r.amount}return!0}function u(r){return!r||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)}function i(r){if(!r)return!0;try{const n=new URL(r);return"http:"===n.protocol||"https:"===n.protocol}catch(r){return!1}}function s(r,n){if(null==r||""===r)return!0;const e=Number(r);return!isNaN(e)&&(n===t.INTEGER?Number.isInteger(e):n!==t.PERCENTAGE||e>=0&&e<=100)}const o=({base:n,label:t,required:e})=>t?r("label",{class:`${n}__label${e?` ${n}__label--required`:""}`},t):null,a=({base:n,error:t})=>t?r("span",{class:`${n}__error`},t):null;function l(r,n,t="input"){return`${r}__${t}${n?` ${r}__${t}--error`:""}`}function f(r,t,u){return t&&!e(r)?n("required",u):""}export{o as F,a,i as b,l as c,s as d,e,f as r,u as v}
@@ -0,0 +1 @@
1
+ import{t as n}from"./i18n.js";function o(o,r,e,i=!1){return r>0&&o.size>r?n("file_too_large",e):i&&!o.type.startsWith("image/")?n("invalid_image",e):""}function r(n,o){return[`${n}__zone`,o.dragging?`${n}__zone--dragging`:"",o.error?`${n}__zone--error`:"",o.disabled?`${n}__zone--disabled`:""].filter(Boolean).join(" ")}function e(n,o){return{onDragOver:o=>{o.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:r=>{var e,i,a;r.preventDefault(),n(!1),o(null!==(a=null===(i=null===(e=r.dataTransfer)||void 0===e?void 0:e.files)||void 0===i?void 0:i[0])&&void 0!==a?a:null)}}}export{e as m,r as u,o as v}
@@ -1 +1 @@
1
- const e={nl:{required:"Dit veld is verplicht",select_placeholder:"Selecteer een optie",search_placeholder:"Zoeken...",upload_file:"Bestand uploaden",choose_file:"Bestand kiezen",clear:"Wissen",today:"Vandaag",invalid_email:"Voer een geldig e-mailadres in",invalid_url:"Voer een geldige URL in",invalid_number:"Voer een geldig getal in",drop_file_here:"Sleep bestand hierheen of",browse:"bladeren",file_too_large:"Bestand is te groot",search_results:"Zoekresultaten",no_results:"Geen resultaten gevonden",loading:"Laden...",submit:"Opslaan",cancel:"Annuleren",remove:"Verwijderen",add:"Toevoegen",yes:"Ja",no:"Nee",table_of:"van",download:"Downloaden",table_filter:"Filteren",table_filter_hide:"Filter verbergen",table_filter_active:"actief",table_filter_clear_all:"Alle filters wissen",table_new_record:"Nieuw record",table_export_excel:"Exporteer naar Excel",doc_view_switch:"Weergave wisselen",doc_view_tree:"Boomweergave",doc_view_list:"Lijstweergave",filter_sorting:"Sortering",filter_ascending:"Oplopend",filter_descending:"Aflopend",filter_section:"Filter",filter_apply:"Toepassen",filter_clear:"Wissen",filter_contains:"Bevat",filter_starts_with:"Begint met",filter_equals:"Gelijk aan",filter_has_value:"Heeft waarde",filter_is_empty:"Is leeg",filter_is_not_empty:"Is niet leeg",filter_exact:"Exact",filter_range:"Bereik",filter_from:"Van",filter_to:"Tot",filter_all:"Alle",filter_select_all:"Alles",filter_select_none:"Geen",filter_search_value:"Zoekwaarde...",filter_no_support:"Geen filtering beschikbaar voor dit veldtype.",textblock_show_more:"Meer tonen",close:"Sluiten",history_until:"tot",history_badge_tooltip:"Vorige waarden",hyperlink_name:"Linktekst (optioneel)",new_folder:"Nieuwe folder",folder_name_placeholder:"Foldernaam",folder_no_slash:"Een foldernaam mag geen '/' bevatten",folder_duplicate:"Er bestaat al een folder met deze naam",doc_empty_drop:"Nog geen documenten — sleep bestanden hierheen"},en:{required:"This field is required",select_placeholder:"Select an option",search_placeholder:"Search...",upload_file:"Upload file",choose_file:"Choose file",clear:"Clear",today:"Today",invalid_email:"Please enter a valid email address",invalid_url:"Please enter a valid URL",invalid_number:"Please enter a valid number",drop_file_here:"Drop file here or",browse:"browse",file_too_large:"File is too large",search_results:"Search results",no_results:"No results found",loading:"Loading...",submit:"Save",cancel:"Cancel",remove:"Remove",add:"Add",yes:"Yes",no:"No",table_of:"of",download:"Download",table_filter:"Filter",table_filter_hide:"Hide filter",table_filter_active:"active",table_filter_clear_all:"Clear all filters",table_new_record:"New record",table_export_excel:"Export to Excel",doc_view_switch:"Switch view",doc_view_tree:"Tree view",doc_view_list:"List view",filter_sorting:"Sorting",filter_ascending:"Ascending",filter_descending:"Descending",filter_section:"Filter",filter_apply:"Apply",filter_clear:"Clear",filter_contains:"Contains",filter_starts_with:"Starts with",filter_equals:"Equals",filter_has_value:"Has value",filter_is_empty:"Is empty",filter_is_not_empty:"Is not empty",filter_exact:"Exact",filter_range:"Range",filter_from:"From",filter_to:"To",filter_all:"All",filter_select_all:"All",filter_select_none:"None",filter_search_value:"Search value...",filter_no_support:"Filtering is not available for this field type.",textblock_show_more:"Show more",close:"Close",history_until:"until",history_badge_tooltip:"Previous values",hyperlink_name:"Link text (optional)",new_folder:"New folder",folder_name_placeholder:"Folder name",folder_no_slash:"A folder name cannot contain '/'",folder_duplicate:"A folder with this name already exists",doc_empty_drop:"No documents yet — drop files here"},ar:{required:"هذا الحقل مطلوب",select_placeholder:"اختر خياراً",search_placeholder:"بحث...",upload_file:"رفع ملف",choose_file:"اختر ملفاً",clear:"مسح",today:"اليوم",invalid_email:"يرجى إدخال عنوان بريد إلكتروني صحيح",invalid_url:"يرجى إدخال رابط صحيح",invalid_number:"يرجى إدخال رقم صحيح",drop_file_here:"اسحب الملف هنا أو",browse:"تصفح",file_too_large:"الملف كبير جداً",search_results:"نتائج البحث",no_results:"لم يتم العثور على نتائج",loading:"جار التحميل...",submit:"حفظ",cancel:"إلغاء",remove:"إزالة",add:"إضافة",yes:"نعم",no:"لا",table_of:"من أصل",download:"تنزيل",table_filter:"تصفية",table_filter_hide:"إخفاء التصفية",table_filter_active:"نشط",table_filter_clear_all:"مسح جميع الفلاتر",table_new_record:"سجل جديد",table_export_excel:"تصدير إلى Excel",doc_view_switch:"تبديل العرض",doc_view_tree:"عرض شجري",doc_view_list:"عرض القائمة",filter_sorting:"الترتيب",filter_ascending:"تصاعدي",filter_descending:"تنازلي",filter_section:"تصفية",filter_apply:"تطبيق",filter_clear:"مسح",filter_contains:"يحتوي على",filter_starts_with:"يبدأ بـ",filter_equals:"يساوي",filter_has_value:"له قيمة",filter_is_empty:"فارغ",filter_is_not_empty:"ليس فارغاً",filter_exact:"دقيق",filter_range:"نطاق",filter_from:"من",filter_to:"إلى",filter_all:"الكل",filter_select_all:"الكل",filter_select_none:"لا شيء",filter_search_value:"قيمة البحث...",filter_no_support:"التصفية غير متاحة لهذا النوع من الحقول.",textblock_show_more:"عرض المزيد",close:"إغلاق",history_until:"حتى",history_badge_tooltip:"القيم السابقة",hyperlink_name:"نص الرابط (اختياري)"},fr:{required:"Ce champ est obligatoire",select_placeholder:"Sélectionner une option",search_placeholder:"Rechercher...",upload_file:"Télécharger un fichier",choose_file:"Choisir un fichier",clear:"Effacer",today:"Aujourd'hui",invalid_email:"Veuillez saisir une adresse e-mail valide",invalid_url:"Veuillez saisir une URL valide",invalid_number:"Veuillez saisir un nombre valide",drop_file_here:"Déposez le fichier ici ou",browse:"parcourir",file_too_large:"Le fichier est trop volumineux",search_results:"Résultats de recherche",no_results:"Aucun résultat trouvé",loading:"Chargement...",submit:"Enregistrer",cancel:"Annuler",remove:"Supprimer",add:"Ajouter",yes:"Oui",no:"Non",table_of:"sur",download:"Télécharger",table_filter:"Filtrer",table_filter_hide:"Masquer le filtre",table_filter_active:"actif",table_filter_clear_all:"Effacer tous les filtres",table_new_record:"Nouvel enregistrement",table_export_excel:"Exporter vers Excel",doc_view_switch:"Changer de vue",doc_view_tree:"Vue arborescente",doc_view_list:"Vue liste",filter_sorting:"Tri",filter_ascending:"Croissant",filter_descending:"Décroissant",filter_section:"Filtre",filter_apply:"Appliquer",filter_clear:"Effacer",filter_contains:"Contient",filter_starts_with:"Commence par",filter_equals:"Égal à",filter_has_value:"A une valeur",filter_is_empty:"Est vide",filter_is_not_empty:"N'est pas vide",filter_exact:"Exact",filter_range:"Plage",filter_from:"De",filter_to:"À",filter_all:"Tous",filter_select_all:"Tous",filter_select_none:"Aucun",filter_search_value:"Valeur de recherche...",filter_no_support:"Le filtrage n'est pas disponible pour ce type de champ.",textblock_show_more:"Voir plus",close:"Fermer",history_until:"jusqu'au",history_badge_tooltip:"Valeurs précédentes",hyperlink_name:"Texte du lien (optionnel)"},de:{required:"Dieses Feld ist erforderlich",select_placeholder:"Option auswählen",search_placeholder:"Suchen...",upload_file:"Datei hochladen",choose_file:"Datei auswählen",clear:"Löschen",today:"Heute",invalid_email:"Bitte geben Sie eine gültige E-Mail-Adresse ein",invalid_url:"Bitte geben Sie eine gültige URL ein",invalid_number:"Bitte geben Sie eine gültige Zahl ein",drop_file_here:"Datei hier ablegen oder",browse:"durchsuchen",file_too_large:"Datei ist zu groß",search_results:"Suchergebnisse",no_results:"Keine Ergebnisse gefunden",loading:"Laden...",submit:"Speichern",cancel:"Abbrechen",remove:"Entfernen",add:"Hinzufügen",yes:"Ja",no:"Nein",table_of:"von",download:"Herunterladen",table_filter:"Filtern",table_filter_hide:"Filter ausblenden",table_filter_active:"aktiv",table_filter_clear_all:"Alle Filter löschen",table_new_record:"Neuer Eintrag",table_export_excel:"Als Excel exportieren",doc_view_switch:"Ansicht wechseln",doc_view_tree:"Baumansicht",doc_view_list:"Listenansicht",filter_sorting:"Sortierung",filter_ascending:"Aufsteigend",filter_descending:"Absteigend",filter_section:"Filter",filter_apply:"Anwenden",filter_clear:"Löschen",filter_contains:"Enthält",filter_starts_with:"Beginnt mit",filter_equals:"Gleich",filter_has_value:"Hat Wert",filter_is_empty:"Ist leer",filter_is_not_empty:"Ist nicht leer",filter_exact:"Genau",filter_range:"Bereich",filter_from:"Von",filter_to:"Bis",filter_all:"Alle",filter_select_all:"Alle",filter_select_none:"Keine",filter_search_value:"Suchwert...",filter_no_support:"Filterung ist für diesen Feldtyp nicht verfügbar.",textblock_show_more:"Mehr anzeigen",close:"Schließen",history_until:"bis",history_badge_tooltip:"Vorherige Werte",hyperlink_name:"Linktext (optional)"},es:{required:"Este campo es obligatorio",select_placeholder:"Seleccionar una opción",search_placeholder:"Buscar...",upload_file:"Subir archivo",choose_file:"Elegir archivo",clear:"Borrar",today:"Hoy",invalid_email:"Por favor, introduzca una dirección de correo electrónico válida",invalid_url:"Por favor, introduzca una URL válida",invalid_number:"Por favor, introduzca un número válido",drop_file_here:"Suelte el archivo aquí o",browse:"explorar",file_too_large:"El archivo es demasiado grande",search_results:"Resultados de búsqueda",no_results:"No se encontraron resultados",loading:"Cargando...",submit:"Guardar",cancel:"Cancelar",remove:"Eliminar",add:"Añadir",yes:"Sí",no:"No",table_of:"de",download:"Descargar",table_filter:"Filtrar",table_filter_hide:"Ocultar filtro",table_filter_active:"activo",table_filter_clear_all:"Borrar todos los filtros",table_new_record:"Nuevo registro",table_export_excel:"Exportar a Excel",doc_view_switch:"Cambiar vista",doc_view_tree:"Vista de árbol",doc_view_list:"Vista de lista",filter_sorting:"Ordenación",filter_ascending:"Ascendente",filter_descending:"Descendente",filter_section:"Filtro",filter_apply:"Aplicar",filter_clear:"Borrar",filter_contains:"Contiene",filter_starts_with:"Empieza por",filter_equals:"Igual a",filter_has_value:"Tiene valor",filter_is_empty:"Está vacío",filter_is_not_empty:"No está vacío",filter_exact:"Exacto",filter_range:"Rango",filter_from:"Desde",filter_to:"Hasta",filter_all:"Todos",filter_select_all:"Todos",filter_select_none:"Ninguno",filter_search_value:"Valor de búsqueda...",filter_no_support:"El filtrado no está disponible para este tipo de campo.",textblock_show_more:"Mostrar más",close:"Cerrar",history_until:"hasta",history_badge_tooltip:"Valores anteriores",hyperlink_name:"Texto del enlace (opcional)"},it:{required:"Questo campo è obbligatorio",select_placeholder:"Seleziona un'opzione",search_placeholder:"Cerca...",upload_file:"Carica file",choose_file:"Scegli file",clear:"Cancella",today:"Oggi",invalid_email:"Inserisci un indirizzo email valido",invalid_url:"Inserisci un URL valido",invalid_number:"Inserisci un numero valido",drop_file_here:"Trascina il file qui o",browse:"sfoglia",file_too_large:"Il file è troppo grande",search_results:"Risultati della ricerca",no_results:"Nessun risultato trovato",loading:"Caricamento...",submit:"Salva",cancel:"Annulla",remove:"Rimuovi",add:"Aggiungi",yes:"Sì",no:"No",table_of:"di",download:"Scarica",table_filter:"Filtra",table_filter_hide:"Nascondi filtro",table_filter_active:"attivo",table_filter_clear_all:"Cancella tutti i filtri",table_new_record:"Nuovo record",table_export_excel:"Esporta in Excel",doc_view_switch:"Cambia vista",doc_view_tree:"Vista ad albero",doc_view_list:"Vista elenco",filter_sorting:"Ordinamento",filter_ascending:"Crescente",filter_descending:"Decrescente",filter_section:"Filtro",filter_apply:"Applica",filter_clear:"Cancella",filter_contains:"Contiene",filter_starts_with:"Inizia con",filter_equals:"Uguale a",filter_has_value:"Ha valore",filter_is_empty:"È vuoto",filter_is_not_empty:"Non è vuoto",filter_exact:"Esatto",filter_range:"Intervallo",filter_from:"Da",filter_to:"A",filter_all:"Tutti",filter_select_all:"Tutti",filter_select_none:"Nessuno",filter_search_value:"Valore di ricerca...",filter_no_support:"Il filtro non è disponibile per questo tipo di campo.",textblock_show_more:"Mostra altro",close:"Chiudi",history_until:"fino a",history_badge_tooltip:"Valori precedenti",hyperlink_name:"Testo del collegamento (opzionale)"},uk:{required:"Це поле обов'язкове",select_placeholder:"Виберіть варіант",search_placeholder:"Пошук...",upload_file:"Завантажити файл",choose_file:"Вибрати файл",clear:"Очистити",today:"Сьогодні",invalid_email:"Будь ласка, введіть дійсну адресу електронної пошти",invalid_url:"Будь ласка, введіть дійсну URL-адресу",invalid_number:"Будь ласка, введіть дійсне число",drop_file_here:"Перетягніть файл сюди або",browse:"огляд",file_too_large:"Файл занадто великий",search_results:"Результати пошуку",no_results:"Результатів не знайдено",loading:"Завантаження...",submit:"Зберегти",cancel:"Скасувати",remove:"Видалити",add:"Додати",yes:"Так",no:"Ні",table_of:"з",download:"Завантажити",table_filter:"Фільтрувати",table_filter_hide:"Сховати фільтр",table_filter_active:"активний",table_filter_clear_all:"Очистити всі фільтри",table_new_record:"Новий запис",table_export_excel:"Експортувати до Excel",doc_view_switch:"Змінити вигляд",doc_view_tree:"Деревоподібний вигляд",doc_view_list:"Список",filter_sorting:"Сортування",filter_ascending:"За зростанням",filter_descending:"За спаданням",filter_section:"Фільтр",filter_apply:"Застосувати",filter_clear:"Очистити",filter_contains:"Містить",filter_starts_with:"Починається з",filter_equals:"Дорівнює",filter_has_value:"Має значення",filter_is_empty:"Порожнє",filter_is_not_empty:"Не порожнє",filter_exact:"Точно",filter_range:"Діапазон",filter_from:"Від",filter_to:"До",filter_all:"Всі",filter_select_all:"Всі",filter_select_none:"Жодного",filter_search_value:"Значення для пошуку...",filter_no_support:"Фільтрування недоступне для цього типу поля.",textblock_show_more:"Показати більше",close:"Закрити",history_until:"до",history_badge_tooltip:"Попередні значення",hyperlink_name:"Текст посилання (необов'язково)"}};function l(l,i){var t,r,a;const o=(null!=i?i:"en").split("-")[0].toLowerCase();return null!==(a=null!==(r=(null!==(t=e[o])&&void 0!==t?t:e.en)[l])&&void 0!==r?r:e.en[l])&&void 0!==a?a:l}export{l as t}
1
+ 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 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as o,createEvent as d,h as l,Host as r,transformTag as a}from"@stencil/core/internal/client";const i=e(class extends o{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=!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 l(r,{key:"38e65a1c7971912f8259d09281b272d7cbd446f2"},l("div",{key:"e10919998731d744cc2a13130c5f355c9b8fc9aa",class:"mrd-boolean-field"},l("label",{key:"db85a2c80cc62fdfd25237e3f5c7750bf1666819",class:"mrd-boolean-field__toggle-label"},l("input",{key:"cddd7004593fa4671abb89f4f805c4a009db99ef",class:"mrd-boolean-field__checkbox",type:"checkbox",name:this.name,checked:this.checked,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),l("span",{key:"f90f0ed6d74d6688e51b8d85a5397a0597d95ad8",class:"mrd-boolean-field__toggle","aria-hidden":"true"}),this.label&&l("span",{key:"7e4582b1d9a5b08c00c220bec53baa6c14cbfe43",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(a(e))||customElements.define(a(e),i))}))}export{i as M,t as d}
1
+ import{proxyCustomElement as e,HTMLElement as o,createEvent as l,h as d,Host as r,transformTag as a}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(r,{key:"f7851813646d31c565c262bf3c8d4083177dd993"},d("div",{key:"4b3c9f46e8b79bdc97ef5815afb85ba5ddde0c9a",class:"mrd-boolean-field"},d("label",{key:"f81fa28d5a79de0445c2c192352343f0807609a1",class:"mrd-boolean-field__toggle-label"},d("input",{key:"510a4f5533cbe2741b8df34cb64fc739475a26cf",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:"949e042c8af0f2872cf973a0d5407fce972eb240",class:"mrd-boolean-field__toggle","aria-hidden":"true"}),this.label&&d("span",{key:"e8c52b5820887b2a8ec9a20eb7e4116a528d27d4",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(a(e))||customElements.define(a(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 i,transformTag as o}from"@stencil/core/internal/client";import{t as a}from"./i18n.js";import{v as t}from"./validation.js";import{p as n}from"./format.js";const s=["EUR","USD","GBP","CHF","JPY","CNY","AUD","CAD","SEK","NOK","DKK","NZD","SGD","HKD","PLN","CZK","HUF","MXN","BRL","INR","TRY","ZAR","AED","SAR"],l=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=n(e,this.locale);this.error=this.required&&!t(e)?a("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=n(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(i,{key:"fe3520c44d831caf36b388cb5968a9518b16cb8b"},c("div",{key:"50c1fd2d53038e46da575d3e46e1ec26c2da423b",class:"mrd-currency-field"},this.label&&c("label",{key:"a2649d41bf6e3765c8a62ba6559c64c41615027a",class:"mrd-currency-field__label"+(this.required?" mrd-currency-field__label--required":"")},this.label),c("div",{key:"952b51f315b4a5c05a8373ce3a3f1041086ba8b8",class:"mrd-currency-field__row"},c("input",{key:"137a72ffc5d79fc8e0a8cf44c012d84a50c26d5b",class:"mrd-currency-field__amount"+(r?" mrd-currency-field__amount--error":""),type:"text",inputMode:"decimal",name:`${this.name}_amount`,value:this.amountDisplay,placeholder:"0.00",required:this.required,disabled:this.disabled,onInput:this.handleAmountInput,onBlur:this.handleAmountBlur}),c("select",{key:"1755854ca9b76dc4b41ad84b6b788685931ace36",class:"mrd-currency-field__currency",disabled:this.disabled,onChange:this.handleCurrencyChange},s.map((r=>c("option",{key:r,value:r,selected:r===this.currency},r))))),r&&c("span",{key:"0f10eb98c2e6444651d79d1de92acd0dbcc7133b",class:"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{flex:1;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;text-align:right;box-sizing:border-box}.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__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 m(){"undefined"!=typeof customElements&&["mrd-currency-field"].forEach((r=>{"mrd-currency-field"===r&&(customElements.get(o(r))||customElements.define(o(r),l))}))}export{l as M,m as d}
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:"24c530db6e0420af39fa0a35b31e966286f2d00c"},c("div",{key:"795bc336425fbf1b86828f4a8f5df93930169a3c",class:"mrd-currency-field"},c(n,{key:"b302cd9296c29ed5719b1f768bd5d4eea86f6406",base:"mrd-currency-field",label:this.label,required:this.required}),c("div",{key:"7efca51615f405ffd660e120accae32f55a9b5a0",class:"mrd-currency-field__row"},c("input",{key:"5c6fd3549d5631fba49a8a701e6c3a1d0a672890",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:"83ad5e92b623c3c60d161b8828e780adb476682c",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:"b059290bb566b119c4f192e750b3e365446243e6",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{t as o}from"./i18n.js";import{v as s}from"./validation.js";const l=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=this.required&&!s(d)?o("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(){const r=!!this.error;return a(t,{key:"2c0dc2311068a5c759fe8efe58a98a71a9cf4b7b"},a("div",{key:"ee1cc0e9a2943cc42439825b8f21cd3492eaca05",class:"mrd-date-field"},this.label&&a("label",{key:"3f836a991e676b6070a8b3800edfce00cc0d3b3d",class:"mrd-date-field__label"+(this.required?" mrd-date-field__label--required":"")},this.label),a("input",{key:"575185661987eea3dc91950f51995b2cc75debea",class:"mrd-date-field__input"+(r?" mrd-date-field__input--error":""),type:"date",name:this.name,value:this.value,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),r&&a("span",{key:"480ec99200989f3dc543d9afc648d83d31992b3c",class:"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;cursor:pointer}.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)}"}},[2,"mrd-date-field",{name:[1],label:[1],value:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function n(){"undefined"!=typeof customElements&&["mrd-date-field"].forEach((r=>{"mrd-date-field"===r&&(customElements.get(i(r))||customElements.define(i(r),l))}))}export{l as M,n as d}
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:"71be9e4bcc87b40cf3b777d3fe0bff23c1a0fa94"},a("div",{key:"40ced03df5d4185264ba9d03c832b3870ce8ae19",class:"mrd-date-field"},a(l,{key:"d85ec7c4617a22c8c5862253e8090c85484f8c41",base:"mrd-date-field",label:this.label,required:this.required}),a("input",{key:"c9211fdefdd9527c7ff40ed9de33153303fc1742",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:"9dd64475bf8a77bea5344faa71f20485b34b86f9",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 f(){"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,f as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as r,createEvent as t,h as d,Host as i,transformTag as a}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";import{v as s}from"./validation.js";const l=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=t(this,"mrdChange",7),this.mrdBlur=t(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=this.required&&!s(r)?o("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 t=e=>String(e).padStart(2,"0");return`${r.getFullYear()}-${t(r.getMonth()+1)}-${t(r.getDate())}T${t(r.getHours())}:${t(r.getMinutes())}`}localToUtc(e){if(!e)return"";const r=new Date(e);return isNaN(r.getTime())?"":r.toISOString().replace(/\.\d{3}Z$/,"Z")}render(){const e=!!this.error;return d(i,{key:"ea8b3b68100ffdb316bc5048f82d85d238bb2e4b"},d("div",{key:"c192c6998ee474aaf4df7b3b97ae0bd61f6d624d",class:"mrd-datetime-field"},this.label&&d("label",{key:"1fbd66c17d76508f0d698a2c258be6779e98d85e",class:"mrd-datetime-field__label"+(this.required?" mrd-datetime-field__label--required":"")},this.label),d("input",{key:"fc9612c062a1cab5076a06598cabf227adce996c",class:"mrd-datetime-field__input"+(e?" mrd-datetime-field__input--error":""),type:"datetime-local",name:this.name,value:this.localValue,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),e&&d("span",{key:"8788ac01739302f6ad61010b238ff38d45e1b68a",class:"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;cursor:pointer}.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)}"}},[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 m(){"undefined"!=typeof customElements&&["mrd-datetime-field"].forEach((e=>{"mrd-datetime-field"===e&&(customElements.get(a(e))||customElements.define(a(e),l))}))}export{l as M,m as d}
1
+ import{proxyCustomElement as e,HTMLElement as r,createEvent as t,h as d,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=t(this,"mrdChange",7),this.mrdBlur=t(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 t=e=>String(e).padStart(2,"0");return`${r.getFullYear()}-${t(r.getMonth()+1)}-${t(r.getDate())}T${t(r.getHours())}:${t(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 d(i,{key:"ac07ec2ba79cde998d1247e9d71de336c0e72a64"},d("div",{key:"8144cf68c4b6b9cbc8396903b84bb355f380ceda",class:"mrd-datetime-field"},d(l,{key:"972686469f68c932e33b8d2c3806422553a3cce3",base:"mrd-datetime-field",label:this.label,required:this.required}),d("input",{key:"370b6032c38fbee22e662c1b2871f96b53b58956",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}),d(m,{key:"b7a812f82a6b0d2c938aa1f1c2494df685258555",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{t as d}from"./i18n.js";import{d as a}from"./mrd-document-list2.js";import{d as s}from"./mrd-table2.js";const c=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdLoadPage=e(this,"mrdLoadPage",7),this.mrdLoadDistinct=e(this,"mrdLoadDistinct",7),this.mrdLoadAggregations=e(this,"mrdLoadAggregations",7),this.mrdNavigate=e(this,"mrdNavigate",7),this.mrdAction=e(this,"mrdAction",7),this.mrdUpdateObject=e(this,"mrdUpdateObject",7),this.mrdUpload=e(this,"mrdUpload",7),this.mrdCreateObject=e(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.containerHref="",this.viewKey="",this.height=460,this.locale=navigator.language,this.mode="tree",this.canCreate=!1,this.tableInited=!1,this.createFolder=()=>{var r,t;null===(t=null===(r=this.listEl)||void 0===r?void 0:r.createFolder)||void 0===t||t.call(r)}}componentDidRender(){var r;if("list"===this.mode&&this.tableEl&&!this.tableInited){this.tableInited=!0;const t=this.tableEl;Promise.resolve(null===(r=t.componentOnReady)||void 0===r?void 0:r.call(t)).then((()=>{var r;return null===(r=t.init)||void 0===r?void 0:r.call(t)}))}}setMode(r){r!==this.mode&&(this.canCreate=!1,this.tableInited=!1,this.mode=r)}renderToolbar(){return o("div",{class:"mrd-document-container__toolbar"},"tree"===this.mode&&o("button",{type:"button",class:"mrd-document-container__action",disabled:!this.canCreate,onClick:this.createFolder},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),o("path",{d:"M12 11v4M10 13h4"})),d("new_folder",this.locale)),o("div",{class:"mrd-document-container__seg",role:"group","aria-label":d("doc_view_switch",this.locale)},o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("tree"===this.mode),title:d("doc_view_tree",this.locale),"aria-label":d("doc_view_tree",this.locale),onClick:()=>this.setMode("tree")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M3 5h6M3 12h9M3 19h6"}),o("circle",{cx:"18",cy:"5",r:"1.6"}),o("circle",{cx:"18",cy:"19",r:"1.6"}),o("path",{d:"M16 12h4"}))),o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("list"===this.mode),title:d("doc_view_list",this.locale),"aria-label":d("doc_view_list",this.locale),onClick:()=>this.setMode("list")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})))))}renderTree(){return o("mrd-document-list",{"data-doclist":this.viewKey,ref:r=>this.listEl=r,item:this.item,archetype:this.archetype,parentId:this.parentId,containerHref:this.containerHref,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadDistinct.emit(r.detail)},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdCanCreate:r=>{r.stopPropagation(),this.canCreate=r.detail},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdUpload.emit(r.detail)},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(r.detail)}})}renderList(){return o("mrd-table",{"data-view":this.viewKey,ref:r=>this.tableEl=r,item:this.item,parentId:this.parentId,locale:this.locale,onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdLoadAggregations:r=>{r.stopPropagation(),this.mrdLoadAggregations.emit(r.detail)},onMrdRowClick:r=>{var t,e,o;r.stopPropagation();const i=r.detail;this.mrdNavigate.emit({href:null===(e=null===(t=null==i?void 0:i._links)||void 0===t?void 0:t.self)||void 0===e?void 0:e.href,label:null!==(o=null==i?void 0:i.name)&&void 0!==o?o:""})},onMrdAction:r=>{r.stopPropagation(),this.mrdAction.emit(r.detail)}})}render(){const r="tree"===this.mode;return o(i,{key:"5d8a9a9bb4f1126a304b796aff9d1cb0100b8fc6"},this.renderToolbar(),o("div",{key:"80ac7e5dd39ffcc4161059447221045a6e035099",class:"mrd-document-container__body",style:r?{height:`${this.height}px`,overflowY:"auto"}:{}},r?this.renderTree():this.renderList()))}get el(){return this}static get style(){return".sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:#d9a441}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed='true'].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}"}},[2,"mrd-document-container",{item:[16],archetype:[16],parentId:[1,"parent-id"],containerHref:[1,"container-href"],viewKey:[1,"view-key"],height:[2],locale:[1],mode:[32],canCreate:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-document-container","mrd-document-list","mrd-table"].forEach((r=>{switch(r){case"mrd-document-container":customElements.get(n(r))||customElements.define(n(r),c);break;case"mrd-document-list":customElements.get(n(r))||a();break;case"mrd-table":customElements.get(n(r))||s()}}))}export{c as M,m as d}
1
+ import{proxyCustomElement as r,HTMLElement as t,createEvent as e,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{t as d}from"./i18n.js";import{d as a}from"./mrd-document-list2.js";import{d as s}from"./mrd-table2.js";const c=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdLoadPage=e(this,"mrdLoadPage",7),this.mrdLoadDistinct=e(this,"mrdLoadDistinct",7),this.mrdLoadAggregations=e(this,"mrdLoadAggregations",7),this.mrdNavigate=e(this,"mrdNavigate",7),this.mrdAction=e(this,"mrdAction",7),this.mrdUpdateObject=e(this,"mrdUpdateObject",7),this.mrdUpload=e(this,"mrdUpload",7),this.mrdCreateObject=e(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.containerHref="",this.viewKey="",this.height=460,this.locale=navigator.language,this.mode="tree",this.canCreate=!1,this.tableInited=!1,this.createFolder=()=>{var r;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"})),d("new_folder",this.locale)),o("div",{class:"mrd-document-container__seg",role:"group","aria-label":d("doc_view_switch",this.locale)},o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("tree"===this.mode),title:d("doc_view_tree",this.locale),"aria-label":d("doc_view_tree",this.locale),onClick:()=>this.setMode("tree")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M3 5h6M3 12h9M3 19h6"}),o("circle",{cx:"18",cy:"5",r:"1.6"}),o("circle",{cx:"18",cy:"19",r:"1.6"}),o("path",{d:"M16 12h4"}))),o("button",{class:"mrd-document-container__seg-btn","aria-pressed":String("list"===this.mode),title:d("doc_view_list",this.locale),"aria-label":d("doc_view_list",this.locale),onClick:()=>this.setMode("list")},o("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},o("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})))))}renderTree(){return o("mrd-document-list",{"data-doclist":this.viewKey,ref:r=>this.listEl=r,item:this.item,archetype:this.archetype,parentId:this.parentId,containerHref:this.containerHref,locale:this.locale,onMrdLoadDistinct:r=>{r.stopPropagation(),this.mrdLoadDistinct.emit(r.detail)},onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdNavigate:r=>{r.stopPropagation(),this.mrdNavigate.emit(r.detail)},onMrdCanCreate:r=>{r.stopPropagation(),this.canCreate=r.detail},onMrdUpdateObject:r=>{r.stopPropagation(),this.mrdUpdateObject.emit(r.detail)},onMrdUpload:r=>{r.stopPropagation(),this.mrdUpload.emit(r.detail)},onMrdCreateObject:r=>{r.stopPropagation(),this.mrdCreateObject.emit(r.detail)}})}renderList(){return o("mrd-table",{"data-view":this.viewKey,ref:r=>this.tableEl=r,item:this.item,parentId:this.parentId,locale:this.locale,onMrdLoadPage:r=>{r.stopPropagation(),this.mrdLoadPage.emit(r.detail)},onMrdLoadAggregations:r=>{r.stopPropagation(),this.mrdLoadAggregations.emit(r.detail)},onMrdRowClick:r=>{var t,e,o;r.stopPropagation();const i=r.detail;this.mrdNavigate.emit({href:null===(e=null===(t=null==i?void 0:i._links)||void 0===t?void 0:t.self)||void 0===e?void 0:e.href,label:null!==(o=null==i?void 0:i.name)&&void 0!==o?o:""})},onMrdAction:r=>{r.stopPropagation(),this.mrdAction.emit(r.detail)}})}render(){const r="tree"===this.mode;return o(i,{key:"018c9eacd169fdf7d352a51472651348af2b45df"},this.renderToolbar(),o("div",{key:"5ff2ac77d4d12369905696ff075f99785dc1c809",class:"mrd-document-container__body",style:r?{height:`${this.height}px`,overflowY:"auto"}:{}},r?this.renderTree():this.renderList()))}get el(){return this}static get style(){return".sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color: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 m(){"undefined"!=typeof customElements&&["mrd-document-container","mrd-document-list","mrd-table"].forEach((r=>{switch(r){case"mrd-document-container":customElements.get(n(r))||customElements.define(n(r),c);break;case"mrd-document-list":customElements.get(n(r))||a();break;case"mrd-table":customElements.get(n(r))||s()}}))}export{c as M,m as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as i,createEvent as s,h as r,Host as o,transformTag as e}from"@stencil/core/internal/client";import{a as n}from"./client-layout.js";import{t as d}from"./i18n.js";import{f as l}from"./format.js";const c=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadDistinct=s(this,"mrdLoadDistinct",7),this.mrdLoadPage=s(this,"mrdLoadPage",7),this.mrdNavigate=s(this,"mrdNavigate",7),this.mrdCanCreate=s(this,"mrdCanCreate",7),this.mrdUpdateObject=s(this,"mrdUpdateObject",7),this.mrdUpload=s(this,"mrdUpload",7),this.mrdCreateObject=s(this,"mrdCreateObject",7),this.item=null,this.parentId="",this.containerHref="",this.locale=navigator.language,this.containers=[],this.rootLoading=!0,this.singleContainer=!1,this.selectedId=null,this.dropTargetId=null,this.uploadingNodeId=null,this.rootDropActive=!1,this.nodeIndex=new Map,this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1,this.newFolderSeq=0,this.lastCanCreate=!1,this.dragDoc=null,this.dragFromId=null,this.pendingUpload=null,this.lastOptimisticDoc=null,this.startCreateFolder=()=>{const t=this.resolveTarget();if(!t||this.pendingNode)return;const{target:i,container:s}=t,r=`${s.id}/__new__${this.newFolderSeq++}`,o=this.makeFolderNode(r,"",s.id);o.pending=!0,o.editing=!0,i.children=[...i.children,o],i.open=!0,this.nodeIndex.set(o.id,o),this.pendingNode=o,this.pendingParent=i,this.pendingContainer=s,this.pendingName="",this.pendingNeedsFocus=!0,this.bump()},this.onPendingInput=t=>{var i;this.pendingName=t.target.value,(null===(i=this.pendingNode)||void 0===i?void 0:i.error)&&(this.pendingNode.error=void 0,this.bump())},this.onPendingKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitFolder()):"Escape"===t.key&&(t.preventDefault(),this.cancelFolder())},this.onDocDragStart=(t,i,s)=>{var r,o,e;this.dragDoc=i,this.dragFromId=s.id,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",null!==(e=null===(o=null===(r=null==i?void 0:i._links)||void 0===r?void 0:r.self)||void 0===o?void 0:o.href)&&void 0!==e?e:""))},this.onDocDragEnd=()=>{this.dragDoc=null,this.dragFromId=null,null!==this.dropTargetId&&(this.dropTargetId=null)},this.onNodeDragOver=(t,i)=>{const s=this.isFileDrag(t);if(!this.dragDoc&&!s)return;t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect=s?"copy":"move");const r=s||i.id!==this.dragFromId?i.id:null;this.dropTargetId!==r&&(this.dropTargetId=r)},this.onNodeDragLeave=t=>{this.dropTargetId===t.id&&(this.dropTargetId=null)},this.onNodeDrop=(t,i,s)=>{if(this.isFileDrag(t))return t.preventDefault(),t.stopPropagation(),void this.startFileUpload(t,i,s);this.dragDoc&&(t.preventDefault(),t.stopPropagation(),this.moveDocument(i,s),this.onDocDragEnd())},this.onRootDragOver=t=>{if(!this.singleContainer)return;const i=this.isFileDrag(t);(this.dragDoc||i)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=i?"copy":"move"),this.rootDropActive||(this.rootDropActive=!0))},this.onRootDragLeave=t=>{const i=t.relatedTarget;i&&this.el.contains(i)||this.rootDropActive&&(this.rootDropActive=!1)},this.onRootDrop=t=>{if(this.rootDropActive=!1,!this.singleContainer)return;const i=this.containers[0];if(this.isFileDrag(t))return t.preventDefault(),void this.startFileUpload(t,i,i);this.dragDoc&&(t.preventDefault(),this.moveDocument(i,i),this.onDocDragEnd())}}componentDidLoad(){this.isSeededSingleContainer()?this.seedSingleContainer():this.emitContainerDistinct()}isSeededSingleContainer(){var t,i;return(null===(t=this.item)||void 0===t?void 0:t.type)===n.RELATED_VIEW&&!!(null===(i=this.item)||void 0===i?void 0:i.inverseRelation)&&this.item.inverseRelation===this.containerField&&!!this.containerHref}seedSingleContainer(){const t=this.makeContainerNode(this.containerHref,this.containerField,0);this.nodeIndex.set(t.id,t),this.containers=[t],this.rootLoading=!1,this.singleContainer=!0,t.open=!0,this.emitFolderDistinct(t)}componentDidRender(){this.pendingNeedsFocus&&this.pendingInputEl&&(this.pendingInputEl.focus(),this.pendingInputEl.select(),this.pendingNeedsFocus=!1);const t=this.canCreateFolder;t!==this.lastCanCreate&&(this.lastCanCreate=t,this.mrdCanCreate.emit(t))}get containerField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.container)&&void 0!==s?s:"container"}get folderField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.folder)&&void 0!==s?s:"folder"}get titleField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.title)&&void 0!==s?s:"name"}get fileField(){var t,i,s;return null!==(s=null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.file)&&void 0!==s?s:"file"}get dateField(){var t,i;return null===(i=null===(t=this.archetype)||void 0===t?void 0:t.slots)||void 0===i?void 0:i.date}buildDataPath(){var t,i,s;const r=this.item,o=null!==(i=null!==(t=null==r?void 0:r.dataClass)&&void 0!==t?t:null==r?void 0:r.relatedClass)&&void 0!==i?i:"";return(null==r?void 0:r.type)===n.RELATED_VIEW?`/${null!==(s=r.fromClass)&&void 0!==s?s:""}/${this.parentId}/${o}`:`/${o}`}buildCreatePath(){var t,i,s,r;const o=this.item,e=null!==(s=null!==(i=null!==(t=null==o?void 0:o.filterClass)&&void 0!==t?t:null==o?void 0:o.dataClass)&&void 0!==i?i:null==o?void 0:o.relatedClass)&&void 0!==s?s:"";return(null==o?void 0:o.type)===n.RELATED_VIEW?`/${null!==(r=o.fromClass)&&void 0!==r?r:""}/${this.parentId}/${e}`:`/${e}`}baseParams(){var t,i,s,r,o,e,n;const d=new URLSearchParams,l=null===(t=this.item)||void 0===t?void 0:t.filterClass;l&&d.set("type",l);for(const t of null!==(r=null===(s=null===(i=this.item)||void 0===i?void 0:i.view)||void 0===s?void 0:s.filter)&&void 0!==r?r:[])t.name&&("EMPTY"!==t.operator?"NOT_EMPTY"!==t.operator?"STARTS_WITH"!==t.operator?"FROM"!==t.operator?"TO"!==t.operator?null!=t.value&&d.set(t.name,String(t.value)):d.set(t.name+"_to",String(null!==(n=t.value)&&void 0!==n?n:"")):d.set(t.name+"_from",String(null!==(e=t.value)&&void 0!==e?e:"")):d.set(t.name+"_startswith",String(null!==(o=t.value)&&void 0!==o?o:"")):d.set(t.name+"_notempty","true"):d.set(t.name,""));return d}emitContainerDistinct(){const i=this.baseParams();i.set("distinct",this.containerField),this.mrdLoadDistinct.emit({nodeId:t.ROOT,distinct:this.containerField,path:this.buildDataPath()+"/distinct",qs:i.toString()})}emitFolderDistinct(t){var i;const s=this.baseParams();s.set("distinct",this.folderField),s.set(this.containerField+"_href",null!==(i=t.href)&&void 0!==i?i:""),t.loading=!0,this.mrdLoadDistinct.emit({nodeId:t.id,distinct:this.folderField,path:this.buildDataPath()+"/distinct",qs:s.toString()})}emitDocuments(t,i){var s,r;const o=this.baseParams();o.set(this.containerField+"_href",null!==(s=t.href)&&void 0!==s?s:""),o.set(this.folderField,null!==(r=i.fullPath)&&void 0!==r?r:""),i.loading=!0,this.mrdLoadPage.emit({nodeId:i.id,page:0,sort:"",path:this.buildDataPath(),qs:o.toString()})}async setDistinct(i,s){i===t.ROOT?this.applyContainers(s):this.applyFolders(i,s)}async setDocuments(t,i){const s=this.nodeIndex.get(t);s&&(s.docs=null!=i?i:[],s.docsLoaded=!0,s.loading=!1,this.bump())}applyContainers(t){const i=[];for(const s of t){if(!s.value||"object"!=typeof s.value)continue;const t=this.makeContainerNode(s.value.href,s.value.name,s.count);i.push(t),this.nodeIndex.set(t.id,t)}if(this.containers=i,this.rootLoading=!1,this.singleContainer=1===i.length,this.singleContainer){const t=i[0];t.open=!0,this.emitFolderDistinct(t)}}applyFolders(t,i){const s=this.nodeIndex.get(t);if(s){s.children=[],s.hasDocs=!1,s.docCount=0;for(const t of i){const i="string"==typeof t.value?t.value:null==t.value?"":String(t.value),r=this.splitFolder(i);if(0===r.length){s.hasDocs=!0,s.docCount=t.count,s.fullPath=i;continue}let o=s;const e=[];for(const t of r){e.push(t);let i=o.children.find((i=>i.label===t));i||(i=this.makeFolderNode(s.id+"/"+e.join("/"),t,s.id),o.children.push(i),this.nodeIndex.set(i.id,i)),o=i}o.hasDocs=!0,o.docCount=t.count,o.fullPath=i}this.computeTotals(s),s.foldersLoaded=!0,s.loading=!1,s.hasDocs&&!s.docsLoaded&&this.emitDocuments(s,s),this.bump()}}splitFolder(t){if(null==t)return[];const i=String(t).trim();return""===i||"/"===i?[]:i.split("/").map((t=>t.trim())).filter(Boolean)}makeContainerNode(t,i,s){return{id:"c:"+t,kind:"container",label:i,href:t,hasDocs:!1,docCount:0,totalCount:s,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}makeFolderNode(t,i,s){return{id:t,kind:"folder",label:i,containerId:s,hasDocs:!1,docCount:0,totalCount:0,children:[],open:!1,loading:!1,foldersLoaded:!1,docsLoaded:!1,docs:[]}}computeTotals(t){let i=t.docCount;for(const s of t.children)i+=this.computeTotals(s);return t.totalCount=i,i}bump(){this.containers=[...this.containers]}toggleContainer(t){this.selectedId=t.id,t.open=!t.open,!t.open||t.foldersLoaded||t.loading||this.emitFolderDistinct(t),this.bump()}toggleFolder(t,i){this.selectedId=i.id,i.open=!i.open,i.open&&i.hasDocs&&!i.docsLoaded&&!i.loading&&this.emitDocuments(t,i),this.bump()}resolveTarget(){if(this.selectedId){const t=this.nodeIndex.get(this.selectedId);if(t&&"container"===t.kind)return{target:t,container:t};if(t&&"folder"===t.kind){const i=t.containerId?this.nodeIndex.get(t.containerId):void 0;if(i)return{target:t,container:i}}}if(this.singleContainer&&this.containers[0]){const t=this.containers[0];return{target:t,container:t}}return null}get canCreateFolder(){return!this.pendingNode&&null!==this.resolveTarget()}async createFolder(){this.startCreateFolder()}segmentsOf(t,i){if("container"===t.kind)return[];const s=i.id+"/",r=t.id.startsWith(s)?t.id.slice(s.length):"";return r?r.split("/"):[]}commitFolder(){const t=this.pendingNode,i=this.pendingParent,s=this.pendingContainer;if(!t||!i||!s)return;const r=this.pendingName.trim();if(!r)return void this.cancelFolder();if(r.includes("/"))return t.error=d("folder_no_slash",this.locale),void this.bump();if(i.children.some((i=>i!==t&&i.label.toLowerCase()===r.toLowerCase())))return t.error=d("folder_duplicate",this.locale),void this.bump();const o=[...this.segmentsOf(i,s),r];this.nodeIndex.delete(t.id),t.id=s.id+"/"+o.join("/"),t.fullPath="/"+o.join("/"),t.label=r,t.editing=!1,t.error=void 0,t.open=!0,this.nodeIndex.set(t.id,t),this.selectedId=t.id,this.clearPending(),this.bump()}cancelFolder(){const t=this.pendingNode,i=this.pendingParent;t&&i&&(i.children=i.children.filter((i=>i!==t)),this.nodeIndex.delete(t.id)),this.clearPending(),this.bump()}clearPending(){this.pendingNode=null,this.pendingParent=null,this.pendingContainer=null,this.pendingName="",this.pendingInputEl=null,this.pendingNeedsFocus=!1}isFileDrag(t){return!this.dragDoc&&!!t.dataTransfer&&Array.from(t.dataTransfer.types).includes("Files")}startFileUpload(t,i,s){var r,o;const e=null===(o=null===(r=t.dataTransfer)||void 0===r?void 0:r.files)||void 0===o?void 0:o[0];this.dropTargetId=null,e&&(this.pendingUpload={file:e,node:i,container:s},i.open=!0,this.uploadingNodeId=i.id,this.bump(),this.mrdUpload.emit({file:e}))}stripExtension(t){return t.replace(/\.[^./\\]+$/,"")}async setFileReference(t){const i=this.pendingUpload;if(!i)return;const{file:s,node:r,container:o}=i,e=this.folderStringOf(r,o),n={[this.fileField]:t,[this.titleField]:this.stripExtension(s.name),[this.folderField]:e,[this.containerField]:o.href};this.mrdCreateObject.emit({path:this.buildCreatePath(),values:n});const d={[this.titleField]:this.stripExtension(s.name),_optimistic:!0},l=!r.docsLoaded&&0===r.docCount;r.hasDocs=!0,r.pending=!1,r.docCount+=1,l?(r.docsLoaded=!0,r.docs=[d]):r.docsLoaded&&(r.docs=[...r.docs,d]),this.recomputeContainerTotals(o,1),this.lastOptimisticDoc=d,this.pendingUpload=null,this.uploadingNodeId=null,this.bump()}async setCreatedHref(t){var i;const s=this.lastOptimisticDoc;s&&t&&(s._links=Object.assign(Object.assign({},null!==(i=s._links)&&void 0!==i?i:{}),{self:{href:t}}),s._optimistic=!1,this.lastOptimisticDoc=null,this.bump())}folderStringOf(t,i){if("container"===t.kind)return null;if(null!=t.fullPath&&""!==t.fullPath)return t.fullPath;const s=this.segmentsOf(t,i);return s.length?"/"+s.join("/"):null}moveDocument(t,i){var s,r;const o=this.dragDoc,e=this.dragFromId?this.nodeIndex.get(this.dragFromId):void 0;if(!o||!e)return;const n="container"===e.kind?e:e.containerId?this.nodeIndex.get(e.containerId):void 0;if(!n)return;const d=this.folderStringOf(t,i),l=this.folderStringOf(e,n),c=i===n;if(t===e||c&&d===l)return;e.docs=e.docs.filter((t=>t!==o)),e.docCount=Math.max(0,e.docCount-1),e.docsLoaded&&(e.hasDocs=e.docs.length>0),t.hasDocs=!0,t.pending=!1,t.docCount+=1,"folder"===t.kind&&(t.fullPath=null!=d?d:""),t.docsLoaded&&(t.docs=[...t.docs,o]),this.recomputeContainerTotals(n,-1),c||this.recomputeContainerTotals(i,1);const h=null===(r=null===(s=null==o?void 0:o._links)||void 0===s?void 0:s.self)||void 0===r?void 0:r.href;if(h){const t={[this.folderField]:d};c||(t[this.containerField]=i.href),this.mrdUpdateObject.emit({href:h,values:t})}this.bump()}recomputeContainerTotals(t,i){t.foldersLoaded?this.computeTotals(t):t.totalCount=Math.max(0,t.totalCount+i)}openDoc(t){var i,s,r,o;const e=null===(s=null===(i=null==t?void 0:t._links)||void 0===i?void 0:i.self)||void 0===s?void 0:s.href,n=null!==(o=null!==(r=null==t?void 0:t[this.titleField])&&void 0!==r?r:null==t?void 0:t.name)&&void 0!==o?o:"";this.mrdNavigate.emit({href:e,label:n})}renderChevron(t,i){return r("span",{class:`mrd-document-list__chev${i?" mrd-document-list__chev--leaf":""}${t?" mrd-document-list__chev--open":""}`},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M9 6l6 6-6 6"})))}renderDossierIcon(){return r("svg",{class:"mrd-document-list__icon mrd-document-list__icon--dossier",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}))}renderFolderIcon(){return r("svg",{class:"mrd-document-list__icon mrd-document-list__icon--folder",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}))}renderDocIcon(){return r("svg",{class:"mrd-document-list__icon mrd-document-list__icon--doc",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r("path",{d:"M14 2v6h6"}))}indent(t){return r("span",{class:"mrd-document-list__indent",style:{width:18*t+"px"}})}renderDocRow(t,i,s,o){var e,n,d,c,h;const a=null!==(n=null!==(e=null==t?void 0:t[this.titleField])&&void 0!==e?e:null==t?void 0:t.name)&&void 0!==n?n:"",m=this.dateField?null==t?void 0:t[this.dateField]:void 0,u=m?l(m,this.locale):"";return r("div",{class:"mrd-document-list__row mrd-document-list__row--doc",key:null!==(h=null===(c=null===(d=null==t?void 0:t._links)||void 0===d?void 0:d.self)||void 0===c?void 0:c.href)&&void 0!==h?h:a,draggable:!0,onClick:()=>this.openDoc(t),onDragStart:s=>this.onDocDragStart(s,t,i),onDragEnd:this.onDocDragEnd,onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:t=>this.onNodeDrop(t,i,s)},this.indent(o),this.renderChevron(!1,!0),this.renderDocIcon(),r("span",{class:"mrd-document-list__label"},a),u&&r("span",{class:"mrd-document-list__date"},u))}renderLoadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"loading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("loading",this.locale))}renderChildren(t,i,s){const r=[];if(i.hasDocs)if(i.docsLoaded)for(const o of i.docs)r.push(this.renderDocRow(o,i,t,s));else i.loading&&r.push(this.renderLoadingRow(s));for(const o of i.children)r.push(this.renderFolderNode(t,o,s));return i.id===this.uploadingNodeId&&r.push(this.renderUploadingRow(s)),r}renderUploadingRow(t){return r("div",{class:"mrd-document-list__loading",key:"uploading"},this.indent(t),r("span",{class:"mrd-document-list__spinner"}),d("upload_file",this.locale))}renderFolderEditRow(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--edit"},this.indent(i),this.renderChevron(!1,!0),this.renderFolderIcon(),r("input",{class:"mrd-document-list__name-input",type:"text",placeholder:d("folder_name_placeholder",this.locale),ref:t=>this.pendingInputEl=t,onInput:this.onPendingInput,onKeyDown:this.onPendingKeyDown,onBlur:()=>this.cancelFolder()})),t.error&&r("div",{class:"mrd-document-list__error",style:{paddingLeft:18*i+52+"px"}},t.error))}renderFolderNode(t,i,s){if(i.editing)return this.renderFolderEditRow(i,s);const o=0===i.children.length&&!i.hasDocs;return r("div",{class:"mrd-document-list__node",key:i.id},r("div",{class:"mrd-document-list__row"+(i.id===this.selectedId?" mrd-document-list__row--selected":"")+(i.pending?" mrd-document-list__row--pending":"")+(i.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleFolder(t,i),onDragOver:t=>this.onNodeDragOver(t,i),onDragLeave:()=>this.onNodeDragLeave(i),onDrop:s=>this.onNodeDrop(s,i,t)},this.indent(s),this.renderChevron(i.open,o),this.renderFolderIcon(),r("span",{class:"mrd-document-list__label"},i.label),r("span",{class:"mrd-document-list__count"},i.totalCount)),i.open&&r("div",{class:"mrd-document-list__kids"},this.renderChildren(t,i,s+1)))}renderContainerNode(t,i){return r("div",{class:"mrd-document-list__node",key:t.id},r("div",{class:"mrd-document-list__row mrd-document-list__row--dossier"+(t.id===this.selectedId?" mrd-document-list__row--selected":"")+(t.id===this.dropTargetId?" mrd-document-list__row--drop":""),onClick:()=>this.toggleContainer(t),onDragOver:i=>this.onNodeDragOver(i,t),onDragLeave:()=>this.onNodeDragLeave(t),onDrop:i=>this.onNodeDrop(i,t,t)},this.indent(i),this.renderChevron(t.open,!1),this.renderDossierIcon(),r("span",{class:"mrd-document-list__label"},t.label),r("span",{class:"mrd-document-list__count"},t.totalCount)),t.open&&r("div",{class:"mrd-document-list__kids"},t.loading&&!t.foldersLoaded?this.renderLoadingRow(i+1):this.renderChildren(t,t,i+1)))}render(){let t;if(this.rootLoading)t=this.renderLoadingRow(0);else if(0===this.containers.length)t=r("div",{key:"9c38a2e26320a8173ba82cac412c1b32a8a1882e",class:"mrd-document-list__empty"},d("no_results",this.locale));else if(this.singleContainer){const i=this.containers[0];if(i.loading&&!i.foldersLoaded)t=this.renderLoadingRow(0);else{const s=this.renderChildren(i,i,0);t=s.length?s:r("div",{class:"mrd-document-list__empty"},d("doc_empty_drop",this.locale))}}else t=this.containers.map((t=>this.renderContainerNode(t,0)));return r(o,{key:"dd83a6a609e01d21a2b5da5b3ab929f6f9315402"},r("div",{key:"d539d938e1efd759730cccc90c4d6c2e535db936",class:"mrd-document-list"+(this.rootDropActive?" mrd-document-list--drop-active":""),onDragOver:this.onRootDragOver,onDragLeave:this.onRootDragLeave,onDrop:this.onRootDrop},t))}get el(){return this}static get style(){return".sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}"}},[2,"mrd-document-list",{item:[16],archetype:[16],parentId:[1,"parent-id"],containerHref:[1,"container-href"],locale:[1],containers:[32],rootLoading:[32],singleContainer:[32],selectedId:[32],dropTargetId:[32],uploadingNodeId:[32],rootDropActive:[32],setDistinct:[64],setDocuments:[64],createFolder:[64],setFileReference:[64],setCreatedHref:[64]}]);function h(){"undefined"!=typeof customElements&&["mrd-document-list"].forEach((t=>{"mrd-document-list"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}c.ROOT="__root__";export{c as M,h as d}
1
+ 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 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as o,Host as i,transformTag as t}from"@stencil/core/internal/client";import{t as m}from"./i18n.js";import{f as n}from"./format.js";const a=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=d(this,"mrdNavigate",7),this.mrdDownload=d(this,"mrdDownload",7),this.data={},this.locale=navigator.language}slotValue(r){var e,d;const o=null===(d=null===(e=this.archetype)||void 0===e?void 0:e.slots)||void 0===d?void 0:d[r];if(o)return this.data[o]}slotLink(r){var e,d,o,i;const t=null===(d=null===(e=this.archetype)||void 0===e?void 0:e.slots)||void 0===d?void 0:d[r];if(t)return(null!==(i=null===(o=this.data)||void 0===o?void 0:o._links)&&void 0!==i?i:{})[t]}renderContainer(){const r=this.slotLink("container");return(null==r?void 0:r.href)&&r.name?o("button",{class:"mrd-document-view__crumb",onClick:()=>this.mrdNavigate.emit({href:r.href,label:r.name})},o("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"},o("path",{d:"M19 12H5M12 19l-7-7 7-7"})),r.name):null}renderFile(){var r,e;const d=this.slotValue("file");if(!d)return null;const i=null!==(r=null==d?void 0:d.href)&&void 0!==r?r:"",t=null!==(e=null==d?void 0:d.fileName)&&void 0!==e?e:String(d);return o("div",{class:"mrd-document-view__file"},o("div",{class:"mrd-document-view__file-preview","aria-hidden":"true"},o("svg",{viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6H6zm7 1.5L18.5 9H13V3.5z"}))),o("div",{class:"mrd-document-view__file-meta"},o("span",{class:"mrd-document-view__file-name"},t)),i&&o("button",{class:"mrd-document-view__download",onClick:()=>this.mrdDownload.emit({href:i,fileName:t})},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:"M12 3v12m0 0l-4-4m4 4l4-4M4 21h16"})),m("download",this.locale)))}render(){const r=this.slotValue("title"),e=null!=r&&""!==r?String(r):null,d=this.slotValue("date"),t=null!=d&&""!==d?n(d,this.locale):null,m=this.slotValue("summary"),a=null!=m&&""!==m?String(m):null;return o(i,{key:"0a2071925ecdb21738376d66fa4babf4590e694c"},o("div",{key:"a2d29c0b6e211cab142adc780466bc885a602e96",class:"mrd-document-view"},this.renderContainer(),e&&o("h1",{key:"7f5ac202c21bc8a70f0dd15e2e1fa06e651b5bce",class:"mrd-document-view__title"},e),t&&o("p",{key:"b1dce94d5fd8bfd5e078644f631a38f91b87e7ff",class:"mrd-document-view__date"},t),this.renderFile(),a&&o("div",{key:"588b9ca40a49ae9ea303852620bde75333b440ab",class:"mrd-document-view__summary"},o("div",{key:"d3b8adb85ac346b72451e789c10aedd539c966de",class:"mrd-document-view__summary-body",innerHTML:a}))))}static get style(){return".sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:720px}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);padding:var(--mrd-space-4);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50);margin-bottom:var(--mrd-space-6)}.mrd-document-view__file-preview.sc-mrd-document-view{width:2.875rem;height:3.625rem;flex-shrink:0;display:grid;place-items:center;border-radius:var(--mrd-border-radius-sm);background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);color:var(--mrd-color-danger);box-shadow:var(--mrd-shadow-sm)}.mrd-document-view__file-preview.sc-mrd-document-view svg.sc-mrd-document-view{width:1.5rem;height:1.5rem}.mrd-document-view__file-meta.sc-mrd-document-view{flex:1;min-width:0}.mrd-document-view__file-name.sc-mrd-document-view{font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}"}},[2,"mrd-document-view",{archetype:[16],data:[16],locale:[1]}]);function c(){"undefined"!=typeof customElements&&["mrd-document-view"].forEach((r=>{"mrd-document-view"===r&&(customElements.get(t(r))||customElements.define(t(r),a))}))}export{a as M,c as d}
1
+ import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as o,Host as i,transformTag as t}from"@stencil/core/internal/client";import{t as m}from"./i18n.js";import{f as n}from"./format.js";const a=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=d(this,"mrdNavigate",7),this.mrdDownload=d(this,"mrdDownload",7),this.data={},this.locale=navigator.language}slotValue(r){var e,d;const o=null===(d=null===(e=this.archetype)||void 0===e?void 0:e.slots)||void 0===d?void 0:d[r];if(o)return this.data[o]}slotLink(r){var e,d,o,i;const t=null===(d=null===(e=this.archetype)||void 0===e?void 0:e.slots)||void 0===d?void 0:d[r];if(t)return(null!==(i=null===(o=this.data)||void 0===o?void 0:o._links)&&void 0!==i?i:{})[t]}renderContainer(){const r=this.slotLink("container");return(null==r?void 0:r.href)&&r.name?o("button",{class:"mrd-document-view__crumb",onClick:()=>this.mrdNavigate.emit({href:r.href,label:r.name})},o("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"},o("path",{d:"M19 12H5M12 19l-7-7 7-7"})),r.name):null}renderFile(){var r,e;const d=this.slotValue("file");if(!d)return null;const i=null!==(r=null==d?void 0:d.href)&&void 0!==r?r:"",t=null!==(e=null==d?void 0:d.fileName)&&void 0!==e?e:String(d);return o("div",{class:"mrd-document-view__file"},o("div",{class:"mrd-document-view__file-preview","aria-hidden":"true"},o("svg",{viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6H6zm7 1.5L18.5 9H13V3.5z"}))),o("div",{class:"mrd-document-view__file-meta"},o("span",{class:"mrd-document-view__file-name"},t)),i&&o("button",{class:"mrd-document-view__download",onClick:()=>this.mrdDownload.emit({href:i,fileName:t})},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:"M12 3v12m0 0l-4-4m4 4l4-4M4 21h16"})),m("download",this.locale)))}render(){const r=this.slotValue("title"),e=null!=r&&""!==r?String(r):null,d=this.slotValue("date"),t=null!=d&&""!==d?n(d,this.locale):null,m=this.slotValue("summary"),a=null!=m&&""!==m?String(m):null;return o(i,{key:"0c64c72eaf5e1eefc2ca9aebb2543081eb1eae32"},o("div",{key:"70cce81b089fee81a4c163a6ba5fbcc8cb46131c",class:"mrd-document-view"},this.renderContainer(),e&&o("h1",{key:"50f85b32a6740d6cf57fdf1bb0bcc597b5e97b31",class:"mrd-document-view__title"},e),t&&o("p",{key:"b3c8fb3b4382104858d49ef9a1597034665122bb",class:"mrd-document-view__date"},t),this.renderFile(),a&&o("div",{key:"2046c1eca7601549115de0c95ff778abaf5faf46",class:"mrd-document-view__summary"},o("div",{key:"875863d3e438eee3d4df10473a93f09370fde08c",class:"mrd-document-view__summary-body",innerHTML:a}))))}static get style(){return".sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:720px}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);padding:var(--mrd-space-4);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50);margin-bottom:var(--mrd-space-6)}.mrd-document-view__file-preview.sc-mrd-document-view{width:2.875rem;height:3.625rem;flex-shrink:0;display:grid;place-items:center;border-radius:var(--mrd-border-radius-sm);background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);color:var(--mrd-color-danger);box-shadow:var(--mrd-shadow-sm)}.mrd-document-view__file-preview.sc-mrd-document-view svg.sc-mrd-document-view{width:1.5rem;height:1.5rem}.mrd-document-view__file-meta.sc-mrd-document-view{flex:1;min-width:0}.mrd-document-view__file-name.sc-mrd-document-view{font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}"}},[2,"mrd-document-view",{archetype:[16],data:[16],locale:[1]}]);function c(){"undefined"!=typeof customElements&&["mrd-document-view"].forEach((r=>{"mrd-document-view"===r&&(customElements.get(t(r))||customElements.define(t(r),a))}))}export{a as M,c as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as l,transformTag as a}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";import{v as m,a as t}from"./validation.js";const s=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=this.required&&!m(e)?o("required",this.locale):e&&!t(e)?o("invalid_email",this.locale):"",this.mrdBlur.emit({name:this.name,value:e})}}render(){const r=!!this.error;return d(l,{key:"0d442ab2a711c26c83fcdbf0fd8cd006d8dd8649"},d("div",{key:"ceb2a80679514c4c5b888fe096c90ed6cc973f64",class:"mrd-email-field"},this.label&&d("label",{key:"663f95eff1002ee56cfc3104514bf31b47e26750",class:"mrd-email-field__label"+(this.required?" mrd-email-field__label--required":"")},this.label),d("input",{key:"42dbdec25a47b37cfd68d00d0b8a481f96fe8241",class:"mrd-email-field__input"+(r?" mrd-email-field__input--error":""),type:"email",name:this.name,value:this.value,placeholder:this.placeholder||"name@example.com",required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur}),r&&d("span",{key:"626ee856ceaa7051fb9dd1de8b7cbd708e83f617",class:"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 n(){"undefined"!=typeof customElements&&["mrd-email-field"].forEach((r=>{"mrd-email-field"===r&&(customElements.get(a(r))||customElements.define(a(r),s))}))}export{s as M,n as d}
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 n}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:"93f7c4975c24e6001e772f2858344edec04cda10"},d("div",{key:"4f49a2a1f68a4161762861c5d54fd3690c88ac5d",class:"mrd-email-field"},d(t,{key:"23b20799f3e7c04889b7bc3a271e61b0bb5d7537",base:"mrd-email-field",label:this.label,required:this.required}),d("input",{key:"0fc452bfb9295a80102eeed4b32bcc9475c9d17b",class:c("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(n,{key:"34945fff9c69cf2f0aeb56492c95052250514d5c",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}from"./i18n.js";const s=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.handleDragOver=e=>{e.preventDefault(),this.isDragging=!0},this.handleDragLeave=()=>{this.isDragging=!1},this.handleDrop=e=>{var i,r,l;e.preventDefault(),this.isDragging=!1;const d=null!==(l=null===(r=null===(i=e.dataTransfer)||void 0===i?void 0:i.files)||void 0===r?void 0:r[0])&&void 0!==l?l:null;this.handleFile(d)},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});this.maxSize>0&&e.size>this.maxSize?this.error=t("file_too_large",this.locale):(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=!!this.error,r=["mrd-file-field__zone",this.isDragging?"mrd-file-field__zone--dragging":"",i?"mrd-file-field__zone--error":"",this.disabled||this.uploading?"mrd-file-field__zone--disabled":""].filter(Boolean).join(" ");return l(d,{key:"095bb39f3cb1680cf5e7e51bdfd06d8eb087f237"},l("div",{key:"7e5b5fe6e63b6530221083c8bcb82bcac59a5fe7",class:"mrd-file-field"},this.label&&l("label",{key:"c34723f4199371d6fe8ea87463d878b89c038590",class:"mrd-file-field__label"+(this.required?" mrd-file-field__label--required":"")},this.label),l("div",{key:"4727667345d3cd4a5c65a431744a09f366943c13",class:r,onClick:this.handleZoneClick,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},l("input",{key:"45ed41c0f094dbe269561c8586e473f908cdf4a4",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":t("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":t("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,t("drop_file_here",this.locale)," ",l("span",{class:"mrd-file-field__browse"},t("browse",this.locale))))),i&&l("span",{key:"00ce94ead3c32ed63e903cfd9d8480084a308d84",class:"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__zone.sc-mrd-file-field{display:flex;align-items:center;justify-content:center;padding:var(--mrd-space-6);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{border-color:var(--mrd-color-primary);background-color:var(--mrd-color-primary-light)}.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__input.sc-mrd-file-field{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer;pointer-events:none}.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;flex-shrink:0;width:18px;height:18px;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-file-spin 0.6s linear infinite}@keyframes mrd-file-spin{to{transform:rotate(360deg)}}.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)}"}},[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 a(){"undefined"!=typeof customElements&&["mrd-file-field"].forEach((e=>{"mrd-file-field"===e&&(customElements.get(o(e))||customElements.define(o(e),s))}))}export{s as M,a as d}
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:"2c4cee79cd0f95ed3750dfc86007a2b36aa3da15"},l("div",{key:"5b47d0f83e8e38b22bb04409544ec2af580274f1",class:"mrd-file-field"},l(t,{key:"47a92d5680670bf750854fa6e7883da54a40baec",base:"mrd-file-field",label:this.label,required:this.required}),l("div",{key:"684f6ab39c32635fb5ca966ccab4a061d8682f89",class:i,onClick:this.handleZoneClick,onDragOver:this.drag.onDragOver,onDragLeave:this.drag.onDragLeave,onDrop:this.drag.onDrop},l("input",{key:"a47231d8c68280623daf0c5a2e4341417e7a88d0",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:"5f18e91aa94319a5571c368e745c108fb0d371a7",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}