@mmlogic/components 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/mrd-boolean-field_19.cjs.entry.js +416 -34
- package/dist/collection/components/mrd-field/mrd-field.js +129 -26
- package/dist/collection/components/mrd-field/mrd-field.scss +118 -0
- package/dist/collection/components/mrd-form/mrd-form.js +3 -3
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +40 -4
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +67 -0
- package/dist/collection/dev/app.js +9 -4
- package/dist/collection/utils/i18n.js +261 -1
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/mrd-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_19.entry.js +416 -34
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-74d100dd.entry.js +1 -0
- package/dist/types/components/mrd-field/mrd-field.d.ts +14 -0
- package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +4 -0
- package/dist/types/types/client-layout.d.ts +2 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-2a099635.entry.js +0 -1
|
@@ -57,6 +57,9 @@ const translations = {
|
|
|
57
57
|
// mrd-table textblock
|
|
58
58
|
textblock_show_more: 'Meer tonen',
|
|
59
59
|
close: 'Sluiten',
|
|
60
|
+
// history badge
|
|
61
|
+
history_until: 'tot',
|
|
62
|
+
history_badge_tooltip: 'Vorige waarden',
|
|
60
63
|
},
|
|
61
64
|
en: {
|
|
62
65
|
required: 'This field is required',
|
|
@@ -116,6 +119,9 @@ const translations = {
|
|
|
116
119
|
// mrd-table textblock
|
|
117
120
|
textblock_show_more: 'Show more',
|
|
118
121
|
close: 'Close',
|
|
122
|
+
// history badge
|
|
123
|
+
history_until: 'until',
|
|
124
|
+
history_badge_tooltip: 'Previous values',
|
|
119
125
|
},
|
|
120
126
|
ar: {
|
|
121
127
|
required: 'هذا الحقل مطلوب',
|
|
@@ -175,6 +181,9 @@ const translations = {
|
|
|
175
181
|
// mrd-table textblock
|
|
176
182
|
textblock_show_more: 'عرض المزيد',
|
|
177
183
|
close: 'إغلاق',
|
|
184
|
+
// history badge
|
|
185
|
+
history_until: 'حتى',
|
|
186
|
+
history_badge_tooltip: 'القيم السابقة',
|
|
178
187
|
},
|
|
179
188
|
fr: {
|
|
180
189
|
required: 'Ce champ est obligatoire',
|
|
@@ -234,11 +243,262 @@ const translations = {
|
|
|
234
243
|
// mrd-table textblock
|
|
235
244
|
textblock_show_more: 'Voir plus',
|
|
236
245
|
close: 'Fermer',
|
|
246
|
+
// history badge
|
|
247
|
+
history_until: "jusqu'au",
|
|
248
|
+
history_badge_tooltip: 'Valeurs précédentes',
|
|
249
|
+
},
|
|
250
|
+
de: {
|
|
251
|
+
required: 'Dieses Feld ist erforderlich',
|
|
252
|
+
select_placeholder: 'Option auswählen',
|
|
253
|
+
search_placeholder: 'Suchen...',
|
|
254
|
+
upload_file: 'Datei hochladen',
|
|
255
|
+
choose_file: 'Datei auswählen',
|
|
256
|
+
clear: 'Löschen',
|
|
257
|
+
today: 'Heute',
|
|
258
|
+
invalid_email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein',
|
|
259
|
+
invalid_url: 'Bitte geben Sie eine gültige URL ein',
|
|
260
|
+
invalid_number: 'Bitte geben Sie eine gültige Zahl ein',
|
|
261
|
+
drop_file_here: 'Datei hier ablegen oder',
|
|
262
|
+
browse: 'durchsuchen',
|
|
263
|
+
file_too_large: 'Datei ist zu groß',
|
|
264
|
+
search_results: 'Suchergebnisse',
|
|
265
|
+
no_results: 'Keine Ergebnisse gefunden',
|
|
266
|
+
loading: 'Laden...',
|
|
267
|
+
submit: 'Speichern',
|
|
268
|
+
cancel: 'Abbrechen',
|
|
269
|
+
remove: 'Entfernen',
|
|
270
|
+
add: 'Hinzufügen',
|
|
271
|
+
yes: 'Ja',
|
|
272
|
+
no: 'Nein',
|
|
273
|
+
// mrd-table footer
|
|
274
|
+
table_of: 'von',
|
|
275
|
+
download: 'Herunterladen',
|
|
276
|
+
// mrd-table toolbar
|
|
277
|
+
table_filter: 'Filtern',
|
|
278
|
+
table_filter_hide: 'Filter ausblenden',
|
|
279
|
+
table_filter_active: 'aktiv',
|
|
280
|
+
table_filter_clear_all: 'Alle Filter löschen',
|
|
281
|
+
table_new_record: 'Neuer Eintrag',
|
|
282
|
+
table_export_excel: 'Als Excel exportieren',
|
|
283
|
+
// mrd-table filter popup
|
|
284
|
+
filter_sorting: 'Sortierung',
|
|
285
|
+
filter_ascending: 'Aufsteigend',
|
|
286
|
+
filter_descending: 'Absteigend',
|
|
287
|
+
filter_section: 'Filter',
|
|
288
|
+
filter_apply: 'Anwenden',
|
|
289
|
+
filter_clear: 'Löschen',
|
|
290
|
+
filter_contains: 'Enthält',
|
|
291
|
+
filter_starts_with: 'Beginnt mit',
|
|
292
|
+
filter_equals: 'Gleich',
|
|
293
|
+
filter_has_value: 'Hat Wert',
|
|
294
|
+
filter_is_empty: 'Ist leer',
|
|
295
|
+
filter_is_not_empty: 'Ist nicht leer',
|
|
296
|
+
filter_exact: 'Genau',
|
|
297
|
+
filter_range: 'Bereich',
|
|
298
|
+
filter_from: 'Von',
|
|
299
|
+
filter_to: 'Bis',
|
|
300
|
+
filter_all: 'Alle',
|
|
301
|
+
filter_select_all: 'Alle',
|
|
302
|
+
filter_select_none: 'Keine',
|
|
303
|
+
filter_search_value: 'Suchwert...',
|
|
304
|
+
filter_no_support: 'Filterung ist für diesen Feldtyp nicht verfügbar.',
|
|
305
|
+
// mrd-table textblock
|
|
306
|
+
textblock_show_more: 'Mehr anzeigen',
|
|
307
|
+
close: 'Schließen',
|
|
308
|
+
// history badge
|
|
309
|
+
history_until: 'bis',
|
|
310
|
+
history_badge_tooltip: 'Vorherige Werte',
|
|
311
|
+
},
|
|
312
|
+
es: {
|
|
313
|
+
required: 'Este campo es obligatorio',
|
|
314
|
+
select_placeholder: 'Seleccionar una opción',
|
|
315
|
+
search_placeholder: 'Buscar...',
|
|
316
|
+
upload_file: 'Subir archivo',
|
|
317
|
+
choose_file: 'Elegir archivo',
|
|
318
|
+
clear: 'Borrar',
|
|
319
|
+
today: 'Hoy',
|
|
320
|
+
invalid_email: 'Por favor, introduzca una dirección de correo electrónico válida',
|
|
321
|
+
invalid_url: 'Por favor, introduzca una URL válida',
|
|
322
|
+
invalid_number: 'Por favor, introduzca un número válido',
|
|
323
|
+
drop_file_here: 'Suelte el archivo aquí o',
|
|
324
|
+
browse: 'explorar',
|
|
325
|
+
file_too_large: 'El archivo es demasiado grande',
|
|
326
|
+
search_results: 'Resultados de búsqueda',
|
|
327
|
+
no_results: 'No se encontraron resultados',
|
|
328
|
+
loading: 'Cargando...',
|
|
329
|
+
submit: 'Guardar',
|
|
330
|
+
cancel: 'Cancelar',
|
|
331
|
+
remove: 'Eliminar',
|
|
332
|
+
add: 'Añadir',
|
|
333
|
+
yes: 'Sí',
|
|
334
|
+
no: 'No',
|
|
335
|
+
// mrd-table footer
|
|
336
|
+
table_of: 'de',
|
|
337
|
+
download: 'Descargar',
|
|
338
|
+
// mrd-table toolbar
|
|
339
|
+
table_filter: 'Filtrar',
|
|
340
|
+
table_filter_hide: 'Ocultar filtro',
|
|
341
|
+
table_filter_active: 'activo',
|
|
342
|
+
table_filter_clear_all: 'Borrar todos los filtros',
|
|
343
|
+
table_new_record: 'Nuevo registro',
|
|
344
|
+
table_export_excel: 'Exportar a Excel',
|
|
345
|
+
// mrd-table filter popup
|
|
346
|
+
filter_sorting: 'Ordenación',
|
|
347
|
+
filter_ascending: 'Ascendente',
|
|
348
|
+
filter_descending: 'Descendente',
|
|
349
|
+
filter_section: 'Filtro',
|
|
350
|
+
filter_apply: 'Aplicar',
|
|
351
|
+
filter_clear: 'Borrar',
|
|
352
|
+
filter_contains: 'Contiene',
|
|
353
|
+
filter_starts_with: 'Empieza por',
|
|
354
|
+
filter_equals: 'Igual a',
|
|
355
|
+
filter_has_value: 'Tiene valor',
|
|
356
|
+
filter_is_empty: 'Está vacío',
|
|
357
|
+
filter_is_not_empty: 'No está vacío',
|
|
358
|
+
filter_exact: 'Exacto',
|
|
359
|
+
filter_range: 'Rango',
|
|
360
|
+
filter_from: 'Desde',
|
|
361
|
+
filter_to: 'Hasta',
|
|
362
|
+
filter_all: 'Todos',
|
|
363
|
+
filter_select_all: 'Todos',
|
|
364
|
+
filter_select_none: 'Ninguno',
|
|
365
|
+
filter_search_value: 'Valor de búsqueda...',
|
|
366
|
+
filter_no_support: 'El filtrado no está disponible para este tipo de campo.',
|
|
367
|
+
// mrd-table textblock
|
|
368
|
+
textblock_show_more: 'Mostrar más',
|
|
369
|
+
close: 'Cerrar',
|
|
370
|
+
// history badge
|
|
371
|
+
history_until: 'hasta',
|
|
372
|
+
history_badge_tooltip: 'Valores anteriores',
|
|
373
|
+
},
|
|
374
|
+
it: {
|
|
375
|
+
required: 'Questo campo è obbligatorio',
|
|
376
|
+
select_placeholder: "Seleziona un'opzione",
|
|
377
|
+
search_placeholder: 'Cerca...',
|
|
378
|
+
upload_file: 'Carica file',
|
|
379
|
+
choose_file: 'Scegli file',
|
|
380
|
+
clear: 'Cancella',
|
|
381
|
+
today: 'Oggi',
|
|
382
|
+
invalid_email: 'Inserisci un indirizzo email valido',
|
|
383
|
+
invalid_url: 'Inserisci un URL valido',
|
|
384
|
+
invalid_number: 'Inserisci un numero valido',
|
|
385
|
+
drop_file_here: 'Trascina il file qui o',
|
|
386
|
+
browse: 'sfoglia',
|
|
387
|
+
file_too_large: 'Il file è troppo grande',
|
|
388
|
+
search_results: 'Risultati della ricerca',
|
|
389
|
+
no_results: 'Nessun risultato trovato',
|
|
390
|
+
loading: 'Caricamento...',
|
|
391
|
+
submit: 'Salva',
|
|
392
|
+
cancel: 'Annulla',
|
|
393
|
+
remove: 'Rimuovi',
|
|
394
|
+
add: 'Aggiungi',
|
|
395
|
+
yes: 'Sì',
|
|
396
|
+
no: 'No',
|
|
397
|
+
// mrd-table footer
|
|
398
|
+
table_of: 'di',
|
|
399
|
+
download: 'Scarica',
|
|
400
|
+
// mrd-table toolbar
|
|
401
|
+
table_filter: 'Filtra',
|
|
402
|
+
table_filter_hide: 'Nascondi filtro',
|
|
403
|
+
table_filter_active: 'attivo',
|
|
404
|
+
table_filter_clear_all: 'Cancella tutti i filtri',
|
|
405
|
+
table_new_record: 'Nuovo record',
|
|
406
|
+
table_export_excel: 'Esporta in Excel',
|
|
407
|
+
// mrd-table filter popup
|
|
408
|
+
filter_sorting: 'Ordinamento',
|
|
409
|
+
filter_ascending: 'Crescente',
|
|
410
|
+
filter_descending: 'Decrescente',
|
|
411
|
+
filter_section: 'Filtro',
|
|
412
|
+
filter_apply: 'Applica',
|
|
413
|
+
filter_clear: 'Cancella',
|
|
414
|
+
filter_contains: 'Contiene',
|
|
415
|
+
filter_starts_with: 'Inizia con',
|
|
416
|
+
filter_equals: 'Uguale a',
|
|
417
|
+
filter_has_value: 'Ha valore',
|
|
418
|
+
filter_is_empty: 'È vuoto',
|
|
419
|
+
filter_is_not_empty: 'Non è vuoto',
|
|
420
|
+
filter_exact: 'Esatto',
|
|
421
|
+
filter_range: 'Intervallo',
|
|
422
|
+
filter_from: 'Da',
|
|
423
|
+
filter_to: 'A',
|
|
424
|
+
filter_all: 'Tutti',
|
|
425
|
+
filter_select_all: 'Tutti',
|
|
426
|
+
filter_select_none: 'Nessuno',
|
|
427
|
+
filter_search_value: 'Valore di ricerca...',
|
|
428
|
+
filter_no_support: 'Il filtro non è disponibile per questo tipo di campo.',
|
|
429
|
+
// mrd-table textblock
|
|
430
|
+
textblock_show_more: 'Mostra altro',
|
|
431
|
+
close: 'Chiudi',
|
|
432
|
+
// history badge
|
|
433
|
+
history_until: 'fino a',
|
|
434
|
+
history_badge_tooltip: 'Valori precedenti',
|
|
435
|
+
},
|
|
436
|
+
uk: {
|
|
437
|
+
required: "Це поле обов'язкове",
|
|
438
|
+
select_placeholder: 'Виберіть варіант',
|
|
439
|
+
search_placeholder: 'Пошук...',
|
|
440
|
+
upload_file: 'Завантажити файл',
|
|
441
|
+
choose_file: 'Вибрати файл',
|
|
442
|
+
clear: 'Очистити',
|
|
443
|
+
today: 'Сьогодні',
|
|
444
|
+
invalid_email: 'Будь ласка, введіть дійсну адресу електронної пошти',
|
|
445
|
+
invalid_url: 'Будь ласка, введіть дійсну URL-адресу',
|
|
446
|
+
invalid_number: 'Будь ласка, введіть дійсне число',
|
|
447
|
+
drop_file_here: 'Перетягніть файл сюди або',
|
|
448
|
+
browse: 'огляд',
|
|
449
|
+
file_too_large: 'Файл занадто великий',
|
|
450
|
+
search_results: 'Результати пошуку',
|
|
451
|
+
no_results: 'Результатів не знайдено',
|
|
452
|
+
loading: 'Завантаження...',
|
|
453
|
+
submit: 'Зберегти',
|
|
454
|
+
cancel: 'Скасувати',
|
|
455
|
+
remove: 'Видалити',
|
|
456
|
+
add: 'Додати',
|
|
457
|
+
yes: 'Так',
|
|
458
|
+
no: 'Ні',
|
|
459
|
+
// mrd-table footer
|
|
460
|
+
table_of: 'з',
|
|
461
|
+
download: 'Завантажити',
|
|
462
|
+
// mrd-table toolbar
|
|
463
|
+
table_filter: 'Фільтрувати',
|
|
464
|
+
table_filter_hide: 'Сховати фільтр',
|
|
465
|
+
table_filter_active: 'активний',
|
|
466
|
+
table_filter_clear_all: 'Очистити всі фільтри',
|
|
467
|
+
table_new_record: 'Новий запис',
|
|
468
|
+
table_export_excel: 'Експортувати до Excel',
|
|
469
|
+
// mrd-table filter popup
|
|
470
|
+
filter_sorting: 'Сортування',
|
|
471
|
+
filter_ascending: 'За зростанням',
|
|
472
|
+
filter_descending: 'За спаданням',
|
|
473
|
+
filter_section: 'Фільтр',
|
|
474
|
+
filter_apply: 'Застосувати',
|
|
475
|
+
filter_clear: 'Очистити',
|
|
476
|
+
filter_contains: 'Містить',
|
|
477
|
+
filter_starts_with: 'Починається з',
|
|
478
|
+
filter_equals: 'Дорівнює',
|
|
479
|
+
filter_has_value: 'Має значення',
|
|
480
|
+
filter_is_empty: 'Порожнє',
|
|
481
|
+
filter_is_not_empty: 'Не порожнє',
|
|
482
|
+
filter_exact: 'Точно',
|
|
483
|
+
filter_range: 'Діапазон',
|
|
484
|
+
filter_from: 'Від',
|
|
485
|
+
filter_to: 'До',
|
|
486
|
+
filter_all: 'Всі',
|
|
487
|
+
filter_select_all: 'Всі',
|
|
488
|
+
filter_select_none: 'Жодного',
|
|
489
|
+
filter_search_value: 'Значення для пошуку...',
|
|
490
|
+
filter_no_support: 'Фільтрування недоступне для цього типу поля.',
|
|
491
|
+
// mrd-table textblock
|
|
492
|
+
textblock_show_more: 'Показати більше',
|
|
493
|
+
close: 'Закрити',
|
|
494
|
+
// history badge
|
|
495
|
+
history_until: 'до',
|
|
496
|
+
history_badge_tooltip: 'Попередні значення',
|
|
237
497
|
},
|
|
238
498
|
};
|
|
239
499
|
export function t(key, locale) {
|
|
240
500
|
var _a, _b, _c;
|
|
241
|
-
const lang = locale.split('-')[0].toLowerCase();
|
|
501
|
+
const lang = (locale !== null && locale !== void 0 ? locale : 'en').split('-')[0].toLowerCase();
|
|
242
502
|
const dict = (_a = translations[lang]) !== null && _a !== void 0 ? _a : translations['en'];
|
|
243
503
|
return (_c = (_b = dict[key]) !== null && _b !== void 0 ? _b : translations['en'][key]) !== null && _c !== void 0 ? _c : key;
|
|
244
504
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,i,t){return null==n||isNaN(n)?"":new Intl.NumberFormat(i,t).format(n)}function i(n,i,t){return null==n||isNaN(n)?"":new Intl.NumberFormat(t,{style:"currency",currency:i,minimumFractionDigits:2,maximumFractionDigits:2}).format(n)}function t(n,i,t=2){return null==n||isNaN(n)?"":new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:t,maximumFractionDigits:t}).format(n)}function e(n,i){if(!n)return"";const t="string"==typeof n?new Date(n):n;return isNaN(t.getTime())?"":new Intl.DateTimeFormat(i,{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}function r(n,i){if(!n)return"";const t="string"==typeof n?new Date(n):n;return isNaN(t.getTime())?"":new Intl.DateTimeFormat(i,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(t)}function u(n,i){if(!n)return"";const[t,e]=n.split(":").map(Number),r=new Date;return r.setHours(t,e,0,0),new Intl.DateTimeFormat(i,{hour:"2-digit",minute:"2-digit"}).format(r)}function a(n,i){var t,e,r,u;if(!n||!n.trim())return null;const a=new Intl.NumberFormat(i).formatToParts(1234567.89),o=null!==(e=null===(t=a.find((n=>"group"===n.type)))||void 0===t?void 0:t.value)&&void 0!==e?e:",",l=null!==(u=null===(r=a.find((n=>"decimal"===n.type)))||void 0===r?void 0:r.value)&&void 0!==u?u:".",s=n.replace(new RegExp(`\\${o}`,"g"),"").replace(new RegExp(`\\${l}`),".").replace("%","").trim(),c=parseFloat(s);return isNaN(c)?null:c}export{
|
|
1
|
+
function n(n,i,t){return null==n||isNaN(n)?"":new Intl.NumberFormat(i,t).format(n)}function i(n,i,t){return null==n||isNaN(n)?"":new Intl.NumberFormat(t,{style:"currency",currency:i,minimumFractionDigits:2,maximumFractionDigits:2}).format(n)}function t(n,i,t=2){return null==n||isNaN(n)?"":new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:t,maximumFractionDigits:t}).format(n)}function e(n,i){if(!n)return"";const t="string"==typeof n?new Date(n):n;return isNaN(t.getTime())?"":new Intl.DateTimeFormat(i,{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}function r(n,i){if(!n)return"";const t="string"==typeof n?new Date(n):n;return isNaN(t.getTime())?"":new Intl.DateTimeFormat(i,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(t)}function u(n,i){if(!n)return"";const[t,e]=n.split(":").map(Number),r=new Date;return r.setHours(t,e,0,0),new Intl.DateTimeFormat(i,{hour:"2-digit",minute:"2-digit"}).format(r)}function a(n,i){var t,e,r,u;if(!n||!n.trim())return null;const a=new Intl.NumberFormat(i).formatToParts(1234567.89),o=null!==(e=null===(t=a.find((n=>"group"===n.type)))||void 0===t?void 0:t.value)&&void 0!==e?e:",",l=null!==(u=null===(r=a.find((n=>"decimal"===n.type)))||void 0===r?void 0:r.value)&&void 0!==u?u:".",s=n.replace(new RegExp(`\\${o}`,"g"),"").replace(new RegExp(`\\${l}`),".").replace("%","").trim(),c=parseFloat(s);return isNaN(c)?null:c}export{e as a,u as b,r as c,i as d,t as e,n as f,a as p}
|
package/dist/components/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={nl:{required:"Dit veld is verplicht",select_placeholder:"Selecteer een optie",search_placeholder:"Zoeken...",upload_file:"Bestand uploaden",choose_file:"Bestand kiezen",clear:"Wissen",today:"Vandaag",invalid_email:"Voer een geldig e-mailadres in",invalid_url:"Voer een geldige URL in",invalid_number:"Voer een geldig getal in",drop_file_here:"Sleep bestand hierheen of",browse:"bladeren",file_too_large:"Bestand is te groot",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",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"},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",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"},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",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:"إغلاق"},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",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"}};function l(l,r){var t,i,a;const _=r.split("-")[0].toLowerCase();return null!==(a=null!==(i=(null!==(t=e[_])&&void 0!==t?t:e.en)[l])&&void 0!==i?i:e.en[l])&&void 0!==a?a:l}export{l as t}
|
|
1
|
+
const e={nl:{required:"Dit veld is verplicht",select_placeholder:"Selecteer een optie",search_placeholder:"Zoeken...",upload_file:"Bestand uploaden",choose_file:"Bestand kiezen",clear:"Wissen",today:"Vandaag",invalid_email:"Voer een geldig e-mailadres in",invalid_url:"Voer een geldige URL in",invalid_number:"Voer een geldig getal in",drop_file_here:"Sleep bestand hierheen of",browse:"bladeren",file_too_large:"Bestand is te groot",search_results:"Zoekresultaten",no_results:"Geen resultaten gevonden",loading:"Laden...",submit:"Opslaan",cancel:"Annuleren",remove:"Verwijderen",add:"Toevoegen",yes:"Ja",no:"Nee",table_of:"van",download:"Downloaden",table_filter:"Filteren",table_filter_hide:"Filter verbergen",table_filter_active:"actief",table_filter_clear_all:"Alle filters wissen",table_new_record:"Nieuw record",table_export_excel:"Exporteer naar Excel",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"},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",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"},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",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:"القيم السابقة"},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",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"},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",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"},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",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"},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",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"},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",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:"Попередні значення"}};function l(l,r){var i,t,a;const o=(null!=r?r:"en").split("-")[0].toLowerCase();return null!==(a=null!==(t=(null!==(i=e[o])&&void 0!==i?i:e.en)[l])&&void 0!==t?t:e.en[l])&&void 0!==a?a:l}export{l as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as l,createEvent as d,h as r,Host as i,transformTag as t}from"@stencil/core/internal/client";import{a as m,c as a,b as s}from"./client-layout.js";import{d as n}from"./mrd-boolean-field2.js";import{d as o}from"./mrd-currency-field2.js";import{d as u}from"./mrd-date-field2.js";import{d as c}from"./mrd-datetime-field2.js";import{d as f}from"./mrd-email-field2.js";import{d as v}from"./mrd-file-field2.js";import{d as h}from"./mrd-hyperlink-field2.js";import{d as b}from"./mrd-image-field2.js";import{d as p}from"./mrd-list-field2.js";import{d as j}from"./mrd-longtext-field2.js";import{d as k}from"./mrd-number-field2.js";import{d as E}from"./mrd-relation-field2.js";import{d as x}from"./mrd-text-field2.js";import{d as g}from"./mrd-textarea-field2.js";import{d as y}from"./mrd-time-field2.js";const O=e(class extends l{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.mrdSearch=d(this,"mrdSearch",7),this.mrdFetchAll=d(this,"mrdFetchAll",7),this.mrdUpload=d(this,"mrdUpload",7),this.locale=navigator.language,this.handleChange=e=>{e.stopPropagation(),this.mrdChange.emit(e.detail)},this.handleBlur=e=>{e.stopPropagation(),this.mrdBlur.emit(e.detail)},this.handleSearch=e=>{e.stopPropagation(),this.mrdSearch.emit(e.detail)},this.handleFetchAll=e=>{e.stopPropagation(),this.mrdFetchAll.emit(e.detail)},this.handleUpload=e=>{e.stopPropagation(),this.mrdUpload.emit(e.detail)}}render(){var e,l,d,t,n,o,u,c,f,v,h,b,p,j,k,E,x,g,y,O,M,C,S,B,U,w,q,z,A,F,R,T,I;const{item:P,locale:V,value:D}=this;if(P.type===m.RELATION)return r(i,null,r("mrd-relation-field",{name:P.name,label:P.label,required:P.required,disabled:null!==(e=P.disabled)&&void 0!==e&&e,locale:V,relatedClass:P.relatedClass,mostSignificantClass:null!==(l=P.mostSignificantClass)&&void 0!==l?l:"",displayType:null!==(d=P.displayType)&&void 0!==d?d:a.SEARCH,editBehavior:null!==(t=P.editBehavior)&&void 0!==t?t:null,commonRelation:P.commonRelation,multiple:null!==(n=P.multiple)&&void 0!==n&&n,dropdownValues:null!==(o=P.dropdownValues)&&void 0!==o?o:[],value:D,onMrdChange:this.handleChange,onMrdBlur:this.handleBlur,onMrdSearch:this.handleSearch,onMrdFetchAll:this.handleFetchAll}));if(P.type!==m.FIELD)return r(i,null);const G={name:P.name,label:P.label,required:P.required,disabled:null!==(u=P.disabled)&&void 0!==u&&u,locale:V,onMrdChange:this.handleChange,onMrdBlur:this.handleBlur};switch(P.dataType){case s.TEXT:return r(i,null,r("mrd-text-field",Object.assign({},G,{value:null!==(c=D)&&void 0!==c?c:"",placeholder:null!==(f=P.placeholder)&&void 0!==f?f:""})));case s.TEXTBLOCK:return r(i,null,r("mrd-textarea-field",Object.assign({},G,{value:null!==(v=D)&&void 0!==v?v:"",placeholder:null!==(h=P.placeholder)&&void 0!==h?h:""})));case s.INTEGER:case s.DECIMAL:case s.PERCENTAGE:return r(i,null,r("mrd-number-field",Object.assign({},G,{value:null!==(b=D)&&void 0!==b?b:null,dataType:P.dataType,decimalPrecision:null!==(p=P.decimalPrecision)&&void 0!==p?p:2,placeholder:null!==(j=P.placeholder)&&void 0!==j?j:""})));case s.CURRENCY:return r(i,null,r("mrd-currency-field",Object.assign({},G,{value:null!==(k=D)&&void 0!==k?k:{amount:null,currency:null!==(E=P.currencyCode)&&void 0!==E?E:"EUR"}})));case s.BOOLEAN:return r(i,null,r("mrd-boolean-field",Object.assign({},G,{value:null!==(x=D)&&void 0!==x&&x})));case s.DATE:return r(i,null,r("mrd-date-field",Object.assign({},G,{value:null!==(g=D)&&void 0!==g?g:""})));case s.DATETIME:return r(i,null,r("mrd-datetime-field",Object.assign({},G,{value:null!==(y=D)&&void 0!==y?y:""})));case s.TIME:return r(i,null,r("mrd-time-field",Object.assign({},G,{value:null!==(O=D)&&void 0!==O?O:""})));case s.EMAIL:return r(i,null,r("mrd-email-field",Object.assign({},G,{value:null!==(M=D)&&void 0!==M?M:"",placeholder:null!==(C=P.placeholder)&&void 0!==C?C:""})));case s.HYPERLINK:return r(i,null,r("mrd-hyperlink-field",Object.assign({},G,{value:null!==(S=D)&&void 0!==S?S:"",placeholder:null!==(B=P.placeholder)&&void 0!==B?B:""})));case s.LIST:return r(i,null,r("mrd-list-field",Object.assign({},G,{value:null!==(U=D)&&void 0!==U?U:"",multiple:null!==(w=P.multiple)&&void 0!==w&&w,listItems:null!==(q=P.listItems)&&void 0!==q?q:[]})));case s.FILE:return r(i,null,r("mrd-file-field",Object.assign({},G,{value:D,accept:null!==(z=P.accept)&&void 0!==z?z:"",maxSize:null!==(A=P.maxSize)&&void 0!==A?A:0,onMrdUpload:this.handleUpload})));case s.IMAGE:return r(i,null,r("mrd-image-field",Object.assign({},G,{value:D,accept:null!==(F=P.accept)&&void 0!==F?F:"image/*",maxSize:null!==(R=P.maxSize)&&void 0!==R?R:0,onMrdUpload:this.handleUpload})));case s.LONGTEXT:return r(i,null,r("mrd-longtext-field",Object.assign({},G,{value:null!==(T=D)&&void 0!==T?T:"",placeholder:null!==(I=P.placeholder)&&void 0!==I?I:""})));default:return r(i,null)}}},[2,"mrd-field",{item:[16],locale:[1],value:[16]}]);function M(){"undefined"!=typeof customElements&&["mrd-field","mrd-boolean-field","mrd-currency-field","mrd-date-field","mrd-datetime-field","mrd-email-field","mrd-file-field","mrd-hyperlink-field","mrd-image-field","mrd-list-field","mrd-longtext-field","mrd-number-field","mrd-relation-field","mrd-text-field","mrd-textarea-field","mrd-time-field"].forEach((e=>{switch(e){case"mrd-field":customElements.get(t(e))||customElements.define(t(e),O);break;case"mrd-boolean-field":customElements.get(t(e))||n();break;case"mrd-currency-field":customElements.get(t(e))||o();break;case"mrd-date-field":customElements.get(t(e))||u();break;case"mrd-datetime-field":customElements.get(t(e))||c();break;case"mrd-email-field":customElements.get(t(e))||f();break;case"mrd-file-field":customElements.get(t(e))||v();break;case"mrd-hyperlink-field":customElements.get(t(e))||h();break;case"mrd-image-field":customElements.get(t(e))||b();break;case"mrd-list-field":customElements.get(t(e))||p();break;case"mrd-longtext-field":customElements.get(t(e))||j();break;case"mrd-number-field":customElements.get(t(e))||k();break;case"mrd-relation-field":customElements.get(t(e))||E();break;case"mrd-text-field":customElements.get(t(e))||x();break;case"mrd-textarea-field":customElements.get(t(e))||g();break;case"mrd-time-field":customElements.get(t(e))||y()}}))}export{O as M,M as d}
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as l,transformTag as t}from"@stencil/core/internal/client";import{b as o,a,c as s}from"./client-layout.js";import{t as n}from"./i18n.js";import{d as m}from"./mrd-boolean-field2.js";import{d as c}from"./mrd-currency-field2.js";import{d as u}from"./mrd-date-field2.js";import{d as f}from"./mrd-datetime-field2.js";import{d as v}from"./mrd-email-field2.js";import{d as h}from"./mrd-file-field2.js";import{d as p}from"./mrd-hyperlink-field2.js";import{d as b}from"./mrd-image-field2.js";import{d as y}from"./mrd-list-field2.js";import{d as g}from"./mrd-longtext-field2.js";import{d as _}from"./mrd-number-field2.js";import{d as j}from"./mrd-relation-field2.js";import{d as k}from"./mrd-text-field2.js";import{d as x}from"./mrd-textarea-field2.js";import{d as w}from"./mrd-time-field2.js";const E=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.mrdSearch=i(this,"mrdSearch",7),this.mrdFetchAll=i(this,"mrdFetchAll",7),this.mrdUpload=i(this,"mrdUpload",7),this.locale=navigator.language,this.historyEntries=[],this.currentValue=void 0,this.handleChange=r=>{var e,i,d,l;r.stopPropagation(),(null!==(i=null===(e=this.item)||void 0===e?void 0:e.historyEnabled)&&void 0!==i?i:null===(l=null===(d=this.item)||void 0===d?void 0:d.field)||void 0===l?void 0:l.historyEnabled)?(this.currentValue=r.detail.value,this.mrdChange.emit({name:r.detail.name,value:{current:r.detail.value,history:this.historyEntries}})):this.mrdChange.emit(r.detail)},this.handleBlur=r=>{r.stopPropagation(),this.mrdBlur.emit(r.detail)},this.handleSearch=r=>{r.stopPropagation(),this.mrdSearch.emit(r.detail)},this.handleFetchAll=r=>{r.stopPropagation(),this.mrdFetchAll.emit(r.detail)},this.handleUpload=r=>{r.stopPropagation(),this.mrdUpload.emit(r.detail)}}componentWillLoad(){this.initHistoryState()}valueChanged(){this.initHistoryState()}initHistoryState(){var r,e,i,d,l;if(!(null!==(e=null===(r=this.item)||void 0===r?void 0:r.historyEnabled)&&void 0!==e?e:null===(d=null===(i=this.item)||void 0===i?void 0:i.field)||void 0===d?void 0:d.historyEnabled))return;const t=this.value;this.currentValue=null!==(l=null==t?void 0:t.current)&&void 0!==l?l:t,this.historyEntries=Array.isArray(null==t?void 0:t.history)?[...t.history]:[]}getDisplayValue(){var r,e,i,d;return(null!==(e=null===(r=this.item)||void 0===r?void 0:r.historyEnabled)&&void 0!==e?e:null===(d=null===(i=this.item)||void 0===i?void 0:i.field)||void 0===d?void 0:d.historyEnabled)&&null!==this.value&&"object"==typeof this.value&&"current"in this.value?this.value.current:this.value}historyValueInputType(){var r;switch(null===(r=this.item)||void 0===r?void 0:r.dataType){case o.DATE:return"date";case o.DATETIME:return"datetime-local";case o.TIME:return"time";case o.INTEGER:case o.DECIMAL:case o.PERCENTAGE:return"number";case o.EMAIL:return"email";default:return"text"}}emitHistoryChange(r){this.historyEntries=r,this.mrdChange.emit({name:this.item.name,value:{current:this.currentValue,history:r}})}renderHistoryEditor(){var r,e,i,l;if(!(null!==(e=null===(r=this.item)||void 0===r?void 0:r.historyEnabled)&&void 0!==e?e:null===(l=null===(i=this.item)||void 0===i?void 0:i.field)||void 0===l?void 0:l.historyEnabled))return null;const{locale:t}=this,o=this.historyValueInputType(),a=(r,e,i)=>{const d=this.historyEntries.map(((d,l)=>l===r?Object.assign(Object.assign({},d),{[e]:i}):d));this.emitHistoryChange(d)},s=r=>{this.emitHistoryChange(this.historyEntries.filter(((e,i)=>i!==r)))};return d("div",{class:"mrd-field__history-editor"},this.historyEntries.length>0&&d("span",{class:"mrd-field__history-editor-label"},n("history_badge_tooltip",t)),this.historyEntries.map(((r,e)=>d("div",{key:String(e),class:"mrd-field__history-editor-row"},d("input",{class:"mrd-field__history-editor-value",type:o,value:r.value,onInput:r=>a(e,"value",r.target.value)}),d("span",{class:"mrd-field__history-editor-sep"},n("history_until",t)),d("input",{class:"mrd-field__history-editor-until",type:"date",value:r.until,onInput:r=>a(e,"until",r.target.value)}),d("button",{type:"button",class:"mrd-field__history-editor-remove",onClick:()=>s(e),"aria-label":n("remove",t)},d("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},d("path",{"fill-rule":"evenodd",d:"M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z","clip-rule":"evenodd"})))))),d("button",{type:"button",class:"mrd-field__history-editor-add",onClick:()=>{this.emitHistoryChange([...this.historyEntries,{value:"",until:""}])}},"+ ",n("add",t)))}renderLeafField(r){var e,i,l,t,a,s,n,m,c,u,f,v,h,p,b,y,g,_,j,k,x,w,E,z,O,C,M;const{item:A,locale:S}=this,V={name:A.name,label:A.label,required:A.required,disabled:null!==(e=A.disabled)&&void 0!==e&&e,locale:S,onMrdChange:this.handleChange,onMrdBlur:this.handleBlur};switch(A.dataType){case o.TEXT:return d("mrd-text-field",Object.assign({},V,{value:null!==(i=r)&&void 0!==i?i:"",placeholder:null!==(l=A.placeholder)&&void 0!==l?l:""}));case o.TEXTBLOCK:return d("mrd-textarea-field",Object.assign({},V,{value:null!==(t=r)&&void 0!==t?t:"",placeholder:null!==(a=A.placeholder)&&void 0!==a?a:""}));case o.INTEGER:case o.DECIMAL:case o.PERCENTAGE:return d("mrd-number-field",Object.assign({},V,{value:null!==(s=r)&&void 0!==s?s:null,dataType:A.dataType,decimalPrecision:null!==(n=A.decimalPrecision)&&void 0!==n?n:2,placeholder:null!==(m=A.placeholder)&&void 0!==m?m:""}));case o.CURRENCY:return d("mrd-currency-field",Object.assign({},V,{value:null!==(c=r)&&void 0!==c?c:{amount:null,currency:null!==(u=A.currencyCode)&&void 0!==u?u:"EUR"}}));case o.BOOLEAN:return d("mrd-boolean-field",Object.assign({},V,{value:null!==(f=r)&&void 0!==f&&f}));case o.DATE:return d("mrd-date-field",Object.assign({},V,{value:null!==(v=r)&&void 0!==v?v:""}));case o.DATETIME:return d("mrd-datetime-field",Object.assign({},V,{value:null!==(h=r)&&void 0!==h?h:""}));case o.TIME:return d("mrd-time-field",Object.assign({},V,{value:null!==(p=r)&&void 0!==p?p:""}));case o.EMAIL:return d("mrd-email-field",Object.assign({},V,{value:null!==(b=r)&&void 0!==b?b:"",placeholder:null!==(y=A.placeholder)&&void 0!==y?y:""}));case o.HYPERLINK:return d("mrd-hyperlink-field",Object.assign({},V,{value:null!==(g=r)&&void 0!==g?g:"",placeholder:null!==(_=A.placeholder)&&void 0!==_?_:""}));case o.LIST:return d("mrd-list-field",Object.assign({},V,{value:null!==(j=r)&&void 0!==j?j:"",multiple:null!==(k=A.multiple)&&void 0!==k&&k,listItems:null!==(x=A.listItems)&&void 0!==x?x:[]}));case o.FILE:return d("mrd-file-field",Object.assign({},V,{value:r,accept:null!==(w=A.accept)&&void 0!==w?w:"",maxSize:null!==(E=A.maxSize)&&void 0!==E?E:0,onMrdUpload:this.handleUpload}));case o.IMAGE:return d("mrd-image-field",Object.assign({},V,{value:r,accept:null!==(z=A.accept)&&void 0!==z?z:"image/*",maxSize:null!==(O=A.maxSize)&&void 0!==O?O:0,onMrdUpload:this.handleUpload}));case o.LONGTEXT:return d("mrd-longtext-field",Object.assign({},V,{value:null!==(C=r)&&void 0!==C?C:"",placeholder:null!==(M=A.placeholder)&&void 0!==M?M:""}));default:return null}}render(){var r,e,i,t,o,n;const{item:m,locale:c,value:u}=this;if(m.type===a.RELATION)return d(l,null,d("mrd-relation-field",{name:m.name,label:m.label,required:m.required,disabled:null!==(r=m.disabled)&&void 0!==r&&r,locale:c,relatedClass:m.relatedClass,mostSignificantClass:null!==(e=m.mostSignificantClass)&&void 0!==e?e:"",displayType:null!==(i=m.displayType)&&void 0!==i?i:s.SEARCH,editBehavior:null!==(t=m.editBehavior)&&void 0!==t?t:null,commonRelation:m.commonRelation,multiple:null!==(o=m.multiple)&&void 0!==o&&o,dropdownValues:null!==(n=m.dropdownValues)&&void 0!==n?n:[],value:u,onMrdChange:this.handleChange,onMrdBlur:this.handleBlur,onMrdSearch:this.handleSearch,onMrdFetchAll:this.handleFetchAll}));if(m.type!==a.FIELD)return d(l,null);const f=this.getDisplayValue();return d(l,null,d("div",{class:"mrd-field__inner"},this.renderLeafField(f),this.renderHistoryEditor()))}get el(){return this}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return".sc-mrd-field-h{display:block}.mrd-field__inner.sc-mrd-field{display:block;width:100%}.mrd-field__history-editor.sc-mrd-field{margin-top:var(--mrd-space-2);display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-field__history-editor-label.sc-mrd-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-500)}.mrd-field__history-editor-row.sc-mrd-field{display:flex;align-items:center;gap:var(--mrd-space-2)}.mrd-field__history-editor-sep.sc-mrd-field{flex-shrink:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500)}.mrd-field__history-editor-value.sc-mrd-field{flex:1 1 0;min-width:0;height:var(--mrd-input-height);padding:0 var(--mrd-space-3);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);outline:none;transition:border-color var(--mrd-transition-fast), box-shadow var(--mrd-transition-fast)}.mrd-field__history-editor-value.sc-mrd-field:focus{border-color:var(--mrd-color-primary);box-shadow:var(--mrd-shadow-focus)}.mrd-field__history-editor-until.sc-mrd-field{flex:0 0 10rem;height:var(--mrd-input-height);padding:0 var(--mrd-space-3);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);outline:none;transition:border-color var(--mrd-transition-fast), box-shadow var(--mrd-transition-fast)}.mrd-field__history-editor-until.sc-mrd-field:focus{border-color:var(--mrd-color-primary);box-shadow:var(--mrd-shadow-focus)}.mrd-field__history-editor-remove.sc-mrd-field{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:2rem;height:2rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-field__history-editor-remove.sc-mrd-field:hover{color:var(--mrd-color-danger);background-color:var(--mrd-color-danger-light)}.mrd-field__history-editor-remove.sc-mrd-field svg.sc-mrd-field{width:1rem;height:1rem}.mrd-field__history-editor-add.sc-mrd-field{align-self:flex-start;padding:var(--mrd-space-1) var(--mrd-space-3);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-primary);background:transparent;border:var(--mrd-border-width) solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius-md);cursor:pointer;transition:background-color var(--mrd-transition-fast), color var(--mrd-transition-fast)}.mrd-field__history-editor-add.sc-mrd-field:hover{background-color:var(--mrd-color-primary-light)}"}},[2,"mrd-field",{item:[16],locale:[1],value:[16],historyEntries:[32],currentValue:[32]},void 0,{value:[{valueChanged:0}]}]);function z(){"undefined"!=typeof customElements&&["mrd-field","mrd-boolean-field","mrd-currency-field","mrd-date-field","mrd-datetime-field","mrd-email-field","mrd-file-field","mrd-hyperlink-field","mrd-image-field","mrd-list-field","mrd-longtext-field","mrd-number-field","mrd-relation-field","mrd-text-field","mrd-textarea-field","mrd-time-field"].forEach((r=>{switch(r){case"mrd-field":customElements.get(t(r))||customElements.define(t(r),E);break;case"mrd-boolean-field":customElements.get(t(r))||m();break;case"mrd-currency-field":customElements.get(t(r))||c();break;case"mrd-date-field":customElements.get(t(r))||u();break;case"mrd-datetime-field":customElements.get(t(r))||f();break;case"mrd-email-field":customElements.get(t(r))||v();break;case"mrd-file-field":customElements.get(t(r))||h();break;case"mrd-hyperlink-field":customElements.get(t(r))||p();break;case"mrd-image-field":customElements.get(t(r))||b();break;case"mrd-list-field":customElements.get(t(r))||y();break;case"mrd-longtext-field":customElements.get(t(r))||g();break;case"mrd-number-field":customElements.get(t(r))||_();break;case"mrd-relation-field":customElements.get(t(r))||j();break;case"mrd-text-field":customElements.get(t(r))||k();break;case"mrd-textarea-field":customElements.get(t(r))||x();break;case"mrd-time-field":customElements.get(t(r))||w()}}))}export{E as M,z as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as t,createEvent as o,h as e,Host as a,transformTag as i}from"@stencil/core/internal/client";import{a as s,b as l}from"./client-layout.js";import{C as n,d}from"./mrd-table2.js";import{t as c}from"./i18n.js";const m=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=o(this,"mrdNavigate",7),this.mrdSearch=o(this,"mrdSearch",7),this.mrdDownload=o(this,"mrdDownload",7),this.mrdLoadViewPage=o(this,"mrdLoadViewPage",7),this.mrdLoadImage=o(this,"mrdLoadImage",7),this.mrdViewAction=o(this,"mrdViewAction",7),this.mrdLoadViewAggregations=o(this,"mrdLoadViewAggregations",7),this.items=[],this.data={},this.views={},this.links={},this.locale=navigator.language,this.searchQueryMap={},this.searchResultsMap={},this.imagePreviewUrl=null,this.imagePreviews={},this.searchTimers={},this.handleViewLoadPage=(r,t)=>{r.stopPropagation(),this.mrdLoadViewPage.emit({name:t,page:r.detail.page,sort:r.detail.sort,path:r.detail.path,qs:r.detail.qs})},this.handleSearchInput=(r,t)=>{this.searchQueryMap=Object.assign(Object.assign({},this.searchQueryMap),{[r]:t}),this.searchTimers[r]&&clearTimeout(this.searchTimers[r]),t.length<2?this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[r]:[]}):this.searchTimers[r]=setTimeout((()=>{this.mrdSearch.emit({query:t,dataClass:r})}),300)}}componentDidLoad(){setTimeout((()=>{this.initEmbeddedTables(),this.emitLoadImages()}),0)}dataChanged(r){r&&Object.keys(r).length>0&&setTimeout((()=>this.initEmbeddedTables()),0)}async initEmbeddedTables(){const r=this.el.querySelectorAll("mrd-table[data-view]");for(const t of Array.from(r))"function"==typeof t.init&&await t.init()}viewKeyFor(r){var t,o,e,a;return r.type===s.RELATED_VIEW?null!==(o=null!==(t=r.relatedClass)&&void 0!==t?t:r.name)&&void 0!==o?o:"":null!==(a=null!==(e=r.dataClass)&&void 0!==e?e:r.name)&&void 0!==a?a:""}emitLoadImages(){for(const r of this.flattenItems(this.items))if(r.type===s.FIELD&&r.dataType===l.IMAGE){const t=r.name,o=this.data[t],e=null==o?void 0:o.href;e&&this.mrdLoadImage.emit({fieldName:t,href:e})}}flattenItems(r){const t=[];for(const o of r)t.push(o),o.items&&t.push(...this.flattenItems(o.items));return t}async setSearchResults(r,t){const o=null!=t?t:this.resolveSearchKey();o&&(this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[o]:r}))}async setViewPage(r,t,o,e,a){const i=this.el.querySelector(`mrd-table[data-view="${r}"]`);i&&(void 0!==e&&(i.totalElements=e),await i.setPage(t,o,a))}async setViewAggregations(r,t){const o=this.el.querySelector(`mrd-table[data-view="${r}"]`);o&&await o.setAggregations(t)}async setImagePreview(r,t){this.imagePreviews=Object.assign(Object.assign({},this.imagePreviews),{[r]:t})}async openImagePreview(r){this.imagePreviewUrl=r}resolveSearchKey(){var r;const t=this.flattenItems(this.items).filter((r=>r.type===s.SEARCH));return 1===t.length&&null!==(r=t[0].dataClass)&&void 0!==r?r:null}renderSingleFieldValue(r,t){var o,a,i,s,d,m,u,v,h,y;const p=r.dataType;switch(p){case l.HYPERLINK:{const r=null!==(o=null==t?void 0:t.href)&&void 0!==o?o:t+"",s=null!==(i=null!==(a=null==t?void 0:t.text)&&void 0!==a?a:null==t?void 0:t.label)&&void 0!==i?i:r;return e("a",{class:"mrd-layout-section__link",href:r,target:"_blank",rel:"noopener noreferrer"},s)}case l.TEXTBLOCK:return e("span",{innerHTML:t+""});case l.LONGTEXT:return e("pre",{class:"mrd-layout-section__pre"},t+"");case l.JSON:return e("pre",{class:"mrd-layout-section__pre",innerHTML:n.formatJson(t)});case l.FILE:{const r=null!==(s=null==t?void 0:t.fileName)&&void 0!==s?s:t+"",o=null!==(d=null==t?void 0:t.href)&&void 0!==d?d:"";return e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:r})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),c("download",this.locale))}case l.IMAGE:{const o=null!==(m=null==t?void 0:t.href)&&void 0!==m?m:"",a=null!==(u=null==t?void 0:t.fileName)&&void 0!==u?u:"",i=this.imagePreviews[r.name];return i?e("button",{class:"mrd-layout-section__image-thumb-btn",onClick:()=>{this.imagePreviewUrl=i},title:a||void 0},e("img",{class:"mrd-layout-section__image-thumb",src:i,alt:a})):e("button",{class:"mrd-layout-section__download-link",onClick:()=>o&&this.mrdDownload.emit({href:o,fileName:a})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),a||o)}case l.BOOLEAN:return e("span",{class:"mrd-layout-section__boolean mrd-layout-section__boolean--"+(t?"true":"false")},c(t?"yes":"no",this.locale));case l.LIST:{const o=(null!==(v=r.listItems)&&void 0!==v?v:[]).find((r=>r.key===t+"")),a=null!==(h=null==o?void 0:o.label)&&void 0!==h?h:t+"",i=null==o?void 0:o.color,s=null==o?void 0:o.backgroundColor;return i&&s?e("span",{class:"mrd-layout-section__badge",style:{color:i,backgroundColor:s}},a):i?e("span",{class:"mrd-layout-section__badge-dot-row"},e("span",{class:"mrd-layout-section__badge-dot",style:{backgroundColor:i}}),a):a}default:return n.renderValue(p,t,null!==(y=r.listItems)&&void 0!==y?y:[],this.locale)||null}}renderFieldValue(r,t){if(null==t||""===t)return null;if(r.multiple&&Array.isArray(t)){const o=t.map((t=>this.renderSingleFieldValue(r,t)));return o.every((r=>"string"==typeof r||null==r))?o.filter(Boolean).join(", ")||null:e("span",null,o.map(((r,t)=>e("span",{key:t+""},r,t<o.length-1?", ":""))))}return this.renderSingleFieldValue(r,t)}renderField(r){if(!r.name)return null;const t=this.data[r.name],o=this.renderFieldValue(r,t);return r.header?e("h1",{class:"mrd-layout-section__field-header",key:r.name},"string"==typeof o?o:null!=t?t+"":r.label):null==o?null:e("div",{class:"mrd-layout-section__field"+(r.dataType===l.TEXTBLOCK||r.dataType===l.LONGTEXT||r.dataType===l.JSON?" mrd-layout-section__field--block":""),key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},o))}renderRelation(r){var t,o,a;if(!r.name)return null;const i=(null!==(o=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==o?o:{})[r.name];if(!i)return null;const s=(r,t)=>e("button",{key:r,class:"mrd-layout-section__relation-link",onClick:()=>this.mrdNavigate.emit({href:r,label:t})},t);let l;return(null===(a=i.values)||void 0===a?void 0:a.length)?l=i.values.map((r=>s(r.href,r.name))):i.name&&(l=s(i.href,i.name)),l?e("div",{class:"mrd-layout-section__field",key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},l)):null}renderSearch(r){var t,o,a;if(!r.dataClass)return null;const i=r.dataClass,s=null!==(t=this.searchQueryMap[i])&&void 0!==t?t:"",l=null!==(o=this.searchResultsMap[i])&&void 0!==o?o:[];return e("div",{class:"mrd-layout-section__search",key:"search-"+i},e("div",{class:"mrd-layout-section__search-wrap"},e("svg",{class:"mrd-layout-section__search-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z","clip-rule":"evenodd"})),e("input",{class:"mrd-layout-section__search-input",type:"text",value:s,placeholder:null!==(a=r.label)&&void 0!==a?a:"",onInput:r=>this.handleSearchInput(i,r.target.value)})),l.length>0&&e("ul",{class:"mrd-layout-section__search-results"},l.map((r=>e("li",{key:r.id,class:"mrd-layout-section__search-result"},e("button",{class:"mrd-layout-section__search-result-btn",onClick:()=>this.mrdNavigate.emit({href:r.id,label:r.label})},e("span",{class:"mrd-layout-section__search-result-label"},r.label),r.description&&e("span",{class:"mrd-layout-section__search-result-desc"},r.description)))))))}renderRelatedView(r){var t,o,a,i,s,l;const n=this.viewKeyFor(r);if(!n)return null;if(!r.view)return null;const d=null!==(t=r.showTitle)&&void 0!==t&&t,c=null!==(l=(null!==(s=null===(i=null===(a=null===(o=this.data)||void 0===o?void 0:o._links)||void 0===a?void 0:a.self)||void 0===i?void 0:i.href)&&void 0!==s?s:"").split("/").filter(Boolean).pop())&&void 0!==l?l:"";return e("div",{class:"mrd-layout-section__related-view",key:"view-"+n},d&&r.label&&e("h3",{class:"mrd-layout-section__related-view-title"},r.label),e("mrd-table",{"data-view":n,item:r,parentId:c,locale:this.locale,onMrdLoadPage:r=>this.handleViewLoadPage(r,n),onMrdLoadAggregations:t=>{var o;t.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:n,dataClass:null!==(o=r.dataClass)&&void 0!==o?o:n},t.detail))},onMrdRowClick:r=>{var t,o,e;r.stopPropagation();const a=r.detail;this.mrdNavigate.emit({href:null===(o=null===(t=null==a?void 0:a._links)||void 0===t?void 0:t.self)||void 0===o?void 0:o.href,label:null!==(e=null==a?void 0:a.name)&&void 0!==e?e:""})},onMrdAction:t=>{var o;t.stopPropagation(),this.mrdViewAction.emit({name:n,action:t.detail.action,dataClass:null!==(o=r.dataClass)&&void 0!==o?o:n,path:t.detail.path,qs:t.detail.qs,parentPath:t.detail.parentPath})}}))}renderItem(r){var t,o;switch(r.type){case s.FIELD:return this.renderField(r);case s.RELATION:return this.renderRelation(r);case s.HEADER:return e("h2",{class:"mrd-layout-section__header",key:"header-"+r.label},r.label);case s.TEXT:return e("div",{class:"mrd-layout-section__text",key:"text-"+r.label,innerHTML:null!==(t=r.label)&&void 0!==t?t:""});case s.NAVIGATE:return e("button",{class:"mrd-layout-section__navigate",key:"nav-"+r.label,onClick:()=>{var t,o,e;return this.mrdNavigate.emit({label:null!==(t=r.label)&&void 0!==t?t:"",navigate:null!==(o=r.navigate)&&void 0!==o?o:{dataClass:null!==(e=r.dataClass)&&void 0!==e?e:"",icon:r.icon,navigationType:r.navigationType}})}},r.label);case s.SEARCH:return this.renderSearch(r);case s.SECTION:case s.GROUP:return e("div",{class:"mrd-layout-section__group",key:"group-"+r.label},r.label&&e("h3",{class:"mrd-layout-section__group-title"},r.label),(null!==(o=r.items)&&void 0!==o?o:[]).map((r=>this.renderItem(r))));case s.RELATED_VIEW:case s.VIEW:return this.renderRelatedView(r);default:return null}}renderImageModal(){return this.imagePreviewUrl?e("div",{class:"mrd-layout-section__modal-backdrop",onClick:()=>{this.imagePreviewUrl=null}},e("div",{class:"mrd-layout-section__modal",onClick:r=>r.stopPropagation()},e("button",{class:"mrd-layout-section__modal-close",onClick:()=>{this.imagePreviewUrl=null}},"✕"),e("img",{class:"mrd-layout-section__modal-image",src:this.imagePreviewUrl,alt:""}))):null}render(){return e(a,{key:"0a3a58f5c80716bc0a7ba1b9468b721706d2ce4a"},e("div",{key:"7cf63580c584811c1bb84b419e8d13026e432fba",class:"mrd-layout-section"},this.items.map((r=>this.renderItem(r)))),this.renderImageModal())}get el(){return this}static get watchers(){return{data:[{dataChanged:0}]}}static get style(){return".mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;text-transform:uppercase;letter-spacing:0.05em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}"}},[2,"mrd-layout-section",{items:[16],data:[16],views:[16],links:[16],locale:[1],searchQueryMap:[32],searchResultsMap:[32],imagePreviewUrl:[32],imagePreviews:[32],setSearchResults:[64],setViewPage:[64],setViewAggregations:[64],setImagePreview:[64],openImagePreview:[64]},void 0,{data:[{dataChanged:0}]}]),u=m,v=function(){"undefined"!=typeof customElements&&["mrd-layout-section","mrd-table"].forEach((r=>{switch(r){case"mrd-layout-section":customElements.get(i(r))||customElements.define(i(r),m);break;case"mrd-table":customElements.get(i(r))||d()}}))};export{u as MrdLayoutSection,v as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as o,createEvent as t,h as e,Host as a,transformTag as i}from"@stencil/core/internal/client";import{a as s,b as l}from"./client-layout.js";import{C as n,d}from"./mrd-table2.js";import{t as c}from"./i18n.js";import{a as m}from"./format.js";const u=r(class extends o{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdNavigate=t(this,"mrdNavigate",7),this.mrdSearch=t(this,"mrdSearch",7),this.mrdDownload=t(this,"mrdDownload",7),this.mrdLoadViewPage=t(this,"mrdLoadViewPage",7),this.mrdLoadImage=t(this,"mrdLoadImage",7),this.mrdViewAction=t(this,"mrdViewAction",7),this.mrdLoadViewAggregations=t(this,"mrdLoadViewAggregations",7),this.items=[],this.data={},this.views={},this.links={},this.locale=navigator.language,this.searchQueryMap={},this.searchResultsMap={},this.imagePreviewUrl=null,this.imagePreviews={},this.openHistoryField=null,this.historyClickOutside=null,this.searchTimers={},this.handleViewLoadPage=(r,o)=>{r.stopPropagation(),this.mrdLoadViewPage.emit({name:o,page:r.detail.page,sort:r.detail.sort,path:r.detail.path,qs:r.detail.qs})},this.handleSearchInput=(r,o)=>{this.searchQueryMap=Object.assign(Object.assign({},this.searchQueryMap),{[r]:o}),this.searchTimers[r]&&clearTimeout(this.searchTimers[r]),o.length<2?this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[r]:[]}):this.searchTimers[r]=setTimeout((()=>{this.mrdSearch.emit({query:o,dataClass:r})}),300)}}componentDidLoad(){setTimeout((()=>{this.initEmbeddedTables(),this.emitLoadImages()}),0),this.historyClickOutside=r=>{this.el.contains(r.target)||(this.openHistoryField=null)},document.addEventListener("mousedown",this.historyClickOutside)}disconnectedCallback(){this.historyClickOutside&&(document.removeEventListener("mousedown",this.historyClickOutside),this.historyClickOutside=null)}dataChanged(r){r&&Object.keys(r).length>0&&setTimeout((()=>this.initEmbeddedTables()),0)}async initEmbeddedTables(){const r=this.el.querySelectorAll("mrd-table[data-view]");for(const o of Array.from(r))"function"==typeof o.init&&await o.init()}viewKeyFor(r){var o,t,e,a;return r.type===s.RELATED_VIEW?null!==(t=null!==(o=r.relatedClass)&&void 0!==o?o:r.name)&&void 0!==t?t:"":null!==(a=null!==(e=r.dataClass)&&void 0!==e?e:r.name)&&void 0!==a?a:""}emitLoadImages(){for(const r of this.flattenItems(this.items))if(r.type===s.FIELD&&r.dataType===l.IMAGE){const o=r.name,t=this.data[o],e=null==t?void 0:t.href;e&&this.mrdLoadImage.emit({fieldName:o,href:e})}}flattenItems(r){const o=[];for(const t of r)o.push(t),t.items&&o.push(...this.flattenItems(t.items));return o}async setSearchResults(r,o){const t=null!=o?o:this.resolveSearchKey();t&&(this.searchResultsMap=Object.assign(Object.assign({},this.searchResultsMap),{[t]:r}))}async setViewPage(r,o,t,e,a){const i=this.el.querySelector(`mrd-table[data-view="${r}"]`);i&&(void 0!==e&&(i.totalElements=e),await i.setPage(o,t,a))}async setViewAggregations(r,o){const t=this.el.querySelector(`mrd-table[data-view="${r}"]`);t&&await t.setAggregations(o)}async setImagePreview(r,o){this.imagePreviews=Object.assign(Object.assign({},this.imagePreviews),{[r]:o})}async openImagePreview(r){this.imagePreviewUrl=r}resolveSearchKey(){var r;const o=this.flattenItems(this.items).filter((r=>r.type===s.SEARCH));return 1===o.length&&null!==(r=o[0].dataClass)&&void 0!==r?r:null}renderSingleFieldValue(r,o){var t,a,i,s,d,m,u,h,v,y;const p=r.dataType;switch(p){case l.HYPERLINK:{const r=null!==(t=null==o?void 0:o.href)&&void 0!==t?t:o+"",s=null!==(i=null!==(a=null==o?void 0:o.text)&&void 0!==a?a:null==o?void 0:o.label)&&void 0!==i?i:r;return e("a",{class:"mrd-layout-section__link",href:r,target:"_blank",rel:"noopener noreferrer"},s)}case l.TEXTBLOCK:return e("span",{innerHTML:o+""});case l.LONGTEXT:return e("pre",{class:"mrd-layout-section__pre"},o+"");case l.JSON:return e("pre",{class:"mrd-layout-section__pre",innerHTML:n.formatJson(o)});case l.FILE:{const r=null!==(s=null==o?void 0:o.fileName)&&void 0!==s?s:o+"",t=null!==(d=null==o?void 0:o.href)&&void 0!==d?d:"";return e("button",{class:"mrd-layout-section__download-link",onClick:()=>t&&this.mrdDownload.emit({href:t,fileName:r})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),c("download",this.locale))}case l.IMAGE:{const t=null!==(m=null==o?void 0:o.href)&&void 0!==m?m:"",a=null!==(u=null==o?void 0:o.fileName)&&void 0!==u?u:"",i=this.imagePreviews[r.name];return i?e("button",{class:"mrd-layout-section__image-thumb-btn",onClick:()=>{this.imagePreviewUrl=i},title:a||void 0},e("img",{class:"mrd-layout-section__image-thumb",src:i,alt:a})):e("button",{class:"mrd-layout-section__download-link",onClick:()=>t&&this.mrdDownload.emit({href:t,fileName:a})},e("svg",{class:"mrd-layout-section__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},e("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),a||t)}case l.BOOLEAN:return e("span",{class:"mrd-layout-section__boolean mrd-layout-section__boolean--"+(o?"true":"false")},c(o?"yes":"no",this.locale));case l.LIST:{const t=(null!==(h=r.listItems)&&void 0!==h?h:[]).find((r=>r.key===o+"")),a=null!==(v=null==t?void 0:t.label)&&void 0!==v?v:o+"",i=null==t?void 0:t.color,s=null==t?void 0:t.backgroundColor;return i&&s?e("span",{class:"mrd-layout-section__badge",style:{color:i,backgroundColor:s}},a):i?e("span",{class:"mrd-layout-section__badge-dot-row"},e("span",{class:"mrd-layout-section__badge-dot",style:{backgroundColor:i}}),a):a}default:return n.renderValue(p,o,null!==(y=r.listItems)&&void 0!==y?y:[],this.locale)||null}}renderFieldValue(r,o){if(null==o||""===o)return null;if(r.multiple&&Array.isArray(o)){const t=o.map((o=>this.renderSingleFieldValue(r,o)));return t.every((r=>"string"==typeof r||null==r))?t.filter(Boolean).join(", ")||null:e("span",null,t.map(((r,o)=>e("span",{key:o+""},r,o<t.length-1?", ":""))))}return this.renderSingleFieldValue(r,o)}renderHistoryBadge(r,o){var t,a,i;if(!(null!==(t=r.historyEnabled)&&void 0!==t?t:null===(a=r.field)||void 0===a?void 0:a.historyEnabled)||!r.name)return null;const s=null!==(i=null==o?void 0:o.history)&&void 0!==i?i:[];if(!s.length)return null;const l=[...s].sort(((r,o)=>o.until.localeCompare(r.until))),n=this.openHistoryField===r.name,{locale:d}=this;return e("span",{class:"mrd-layout-section__history-wrap"},e("button",{type:"button",class:"mrd-layout-section__history-btn",title:c("history_badge_tooltip",d),"aria-label":c("history_badge_tooltip",d),onClick:o=>{o.stopPropagation(),this.openHistoryField=n?null:r.name}},e("svg",{class:"mrd-layout-section__history-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.75-13a.75.75 0 00-1.5 0v5c0 .207.085.394.22.53l2.5 2.5a.75.75 0 101.06-1.06L10.75 9.69V5z","clip-rule":"evenodd"}))),n&&e("div",{class:"mrd-layout-section__history-popover",role:"listbox"},l.map(((r,o)=>e("div",{key:o+"",class:"mrd-layout-section__history-entry"},r.value," (",c("history_until",d)," ",m(r.until,d),")")))))}renderField(r){var o,t;if(!r.name)return null;const a=this.data[r.name],i=(null!==(o=r.historyEnabled)&&void 0!==o?o:null===(t=r.field)||void 0===t?void 0:t.historyEnabled)&&null!==a&&"object"==typeof a&&"current"in a?a.current:a,s=this.renderFieldValue(r,i);return r.header?e("h1",{class:"mrd-layout-section__field-header",key:r.name},"string"==typeof s?s:null!=i?i+"":r.label):null==s?null:e("div",{class:"mrd-layout-section__field"+(r.dataType===l.TEXTBLOCK||r.dataType===l.LONGTEXT||r.dataType===l.JSON?" mrd-layout-section__field--block":""),key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},s,this.renderHistoryBadge(r,a)))}renderRelation(r){var o,t,a;if(!r.name)return null;const i=(null!==(t=null===(o=this.data)||void 0===o?void 0:o._links)&&void 0!==t?t:{})[r.name];if(!i)return null;const s=(r,o)=>e("button",{key:r,class:"mrd-layout-section__relation-link",onClick:()=>this.mrdNavigate.emit({href:r,label:o})},o);let l;return(null===(a=i.values)||void 0===a?void 0:a.length)?l=i.values.map((r=>s(r.href,r.name))):i.name&&(l=s(i.href,i.name)),l?e("div",{class:"mrd-layout-section__field",key:r.name},e("span",{class:"mrd-layout-section__field-label"},r.label),e("span",{class:"mrd-layout-section__field-value"},l)):null}renderSearch(r){var o,t,a;if(!r.dataClass)return null;const i=r.dataClass,s=null!==(o=this.searchQueryMap[i])&&void 0!==o?o:"",l=null!==(t=this.searchResultsMap[i])&&void 0!==t?t:[];return e("div",{class:"mrd-layout-section__search",key:"search-"+i},e("div",{class:"mrd-layout-section__search-wrap"},e("svg",{class:"mrd-layout-section__search-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},e("path",{"fill-rule":"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z","clip-rule":"evenodd"})),e("input",{class:"mrd-layout-section__search-input",type:"text",value:s,placeholder:null!==(a=r.label)&&void 0!==a?a:"",onInput:r=>this.handleSearchInput(i,r.target.value)})),l.length>0&&e("ul",{class:"mrd-layout-section__search-results"},l.map((r=>e("li",{key:r.id,class:"mrd-layout-section__search-result"},e("button",{class:"mrd-layout-section__search-result-btn",onClick:()=>this.mrdNavigate.emit({href:r.id,label:r.label})},e("span",{class:"mrd-layout-section__search-result-label"},r.label),r.description&&e("span",{class:"mrd-layout-section__search-result-desc"},r.description)))))))}renderRelatedView(r){var o,t,a,i,s,l;const n=this.viewKeyFor(r);if(!n)return null;if(!r.view)return null;const d=null!==(o=r.showTitle)&&void 0!==o&&o,c=null!==(l=(null!==(s=null===(i=null===(a=null===(t=this.data)||void 0===t?void 0:t._links)||void 0===a?void 0:a.self)||void 0===i?void 0:i.href)&&void 0!==s?s:"").split("/").filter(Boolean).pop())&&void 0!==l?l:"";return e("div",{class:"mrd-layout-section__related-view",key:"view-"+n},d&&r.label&&e("h3",{class:"mrd-layout-section__related-view-title"},r.label),e("mrd-table",{"data-view":n,item:r,parentId:c,locale:this.locale,onMrdLoadPage:r=>this.handleViewLoadPage(r,n),onMrdLoadAggregations:o=>{var t;o.stopPropagation(),this.mrdLoadViewAggregations.emit(Object.assign({name:n,dataClass:null!==(t=r.dataClass)&&void 0!==t?t:n},o.detail))},onMrdRowClick:r=>{var o,t,e;r.stopPropagation();const a=r.detail;this.mrdNavigate.emit({href:null===(t=null===(o=null==a?void 0:a._links)||void 0===o?void 0:o.self)||void 0===t?void 0:t.href,label:null!==(e=null==a?void 0:a.name)&&void 0!==e?e:""})},onMrdAction:o=>{var t;o.stopPropagation(),this.mrdViewAction.emit({name:n,action:o.detail.action,dataClass:null!==(t=r.dataClass)&&void 0!==t?t:n,path:o.detail.path,qs:o.detail.qs,parentPath:o.detail.parentPath})}}))}renderItem(r){var o,t;switch(r.type){case s.FIELD:return this.renderField(r);case s.RELATION:return this.renderRelation(r);case s.HEADER:return e("h2",{class:"mrd-layout-section__header",key:"header-"+r.label},r.label);case s.TEXT:return e("div",{class:"mrd-layout-section__text",key:"text-"+r.label,innerHTML:null!==(o=r.label)&&void 0!==o?o:""});case s.NAVIGATE:return e("button",{class:"mrd-layout-section__navigate",key:"nav-"+r.label,onClick:()=>{var o,t,e;return this.mrdNavigate.emit({label:null!==(o=r.label)&&void 0!==o?o:"",navigate:null!==(t=r.navigate)&&void 0!==t?t:{dataClass:null!==(e=r.dataClass)&&void 0!==e?e:"",icon:r.icon,navigationType:r.navigationType}})}},r.label);case s.SEARCH:return this.renderSearch(r);case s.SECTION:case s.GROUP:return e("div",{class:"mrd-layout-section__group",key:"group-"+r.label},r.label&&e("h3",{class:"mrd-layout-section__group-title"},r.label),(null!==(t=r.items)&&void 0!==t?t:[]).map((r=>this.renderItem(r))));case s.RELATED_VIEW:case s.VIEW:return this.renderRelatedView(r);default:return null}}renderImageModal(){return this.imagePreviewUrl?e("div",{class:"mrd-layout-section__modal-backdrop",onClick:()=>{this.imagePreviewUrl=null}},e("div",{class:"mrd-layout-section__modal",onClick:r=>r.stopPropagation()},e("button",{class:"mrd-layout-section__modal-close",onClick:()=>{this.imagePreviewUrl=null}},"✕"),e("img",{class:"mrd-layout-section__modal-image",src:this.imagePreviewUrl,alt:""}))):null}render(){return e(a,{key:"39ba6fc1fc823864025ca6a8df4c97b0f4cb96e6"},e("div",{key:"b1af15adfec5c699e00546b03b535149b834b6e4",class:"mrd-layout-section"},this.items.map((r=>this.renderItem(r)))),this.renderImageModal())}get el(){return this}static get watchers(){return{data:[{dataChanged:0}]}}static get style(){return".mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;text-transform:uppercase;letter-spacing:0.05em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}"}},[2,"mrd-layout-section",{items:[16],data:[16],views:[16],links:[16],locale:[1],searchQueryMap:[32],searchResultsMap:[32],imagePreviewUrl:[32],imagePreviews:[32],openHistoryField:[32],setSearchResults:[64],setViewPage:[64],setViewAggregations:[64],setImagePreview:[64],openImagePreview:[64]},void 0,{data:[{dataChanged:0}]}]),h=u,v=function(){"undefined"!=typeof customElements&&["mrd-layout-section","mrd-table"].forEach((r=>{switch(r){case"mrd-layout-section":customElements.get(i(r))||customElements.define(i(r),u);break;case"mrd-table":customElements.get(i(r))||d()}}))};export{h as MrdLayoutSection,v as defineCustomElement}
|