@mmlogic/components 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_24.cjs.entry.js} +237 -34
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.css +14 -1
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +22 -7
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +8 -5
- package/dist/collection/components/documents/mrd-document-list/tree-view.js +13 -1
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.css +39 -29
- package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +109 -8
- package/dist/collection/components/documents/mrd-file-preview/file-preview-kind.js +30 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.css +59 -0
- package/dist/collection/components/documents/mrd-file-preview/mrd-file-preview.js +212 -0
- package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
- package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
- package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
- package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
- package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +1 -1
- package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
- package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
- package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +5 -0
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +91 -8
- package/dist/collection/dev/api.js +9 -0
- package/dist/collection/dev/app.js +101 -3
- package/dist/collection/dev/example-data.js +24 -0
- package/dist/collection/types/client-layout.js +8 -0
- package/dist/collection/utils/i18n.js +32 -0
- package/dist/components/client-layout.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-file-preview.d.ts +11 -0
- package/dist/components/mrd-file-preview.js +1 -0
- package/dist/components/mrd-file-preview2.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_24.entry.js} +238 -36
- package/dist/mosterdcomponents/cell-renderer-PbcEU4ph.js.map +1 -0
- package/dist/mosterdcomponents/client-layout-DCOAAH92.js.map +1 -0
- package/dist/mosterdcomponents/field-helpers-CASS3akr.js.map +1 -0
- package/dist/mosterdcomponents/file-upload-common-D1ndi6cN.js.map +1 -0
- package/dist/mosterdcomponents/format-BAfsQfy1.js.map +1 -0
- package/dist/mosterdcomponents/i18n-B1IIkRF9.js.map +1 -0
- package/dist/mosterdcomponents/index-AokUFVX0.js.map +1 -0
- package/dist/mosterdcomponents/index-CprJSlzK.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/index.esm.js.map +1 -0
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
- package/dist/mosterdcomponents/p-aae8a9dc.entry.js +1 -0
- package/dist/mosterdcomponents/query-params-B1HfnMOl.js.map +1 -0
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
- package/dist/mosterdcomponents/validation-DbEViuiw.js.map +1 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +6 -2
- package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +29 -1
- package/dist/types/components/documents/mrd-file-preview/file-preview-kind.d.ts +9 -0
- package/dist/types/components/documents/mrd-file-preview/mrd-file-preview.d.ts +41 -0
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +17 -1
- package/dist/types/components.d.ts +178 -7
- package/dist/types/types/client-layout.d.ts +10 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-b1a2e108.entry.js +0 -1
|
@@ -29,7 +29,7 @@ const MrdBooleanField = class {
|
|
|
29
29
|
this.checked = !!this.value;
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (index.h(index.Host, { key: '
|
|
32
|
+
return (index.h(index.Host, { key: 'c0e92a50b1512d7b7f36f151b34bcb5b9497ca59' }, index.h("div", { key: 'e3f70c88321d8e72784b81092a9ebc0451ba330d', class: "mrd-boolean-field" }, index.h("label", { key: '3e6d907b72a5e1da7e268685c67811ebf264d5d8', class: "mrd-boolean-field__toggle-label" }, index.h("input", { key: '2b6df62a72cba19aa26374a2448c26666e28b03d', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h("span", { key: '77cbe5c1a25153de745f5e91eef589f40cb3237d', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (index.h("span", { key: '34daaa269ed64ed3be71ecfd15d79eb42d746247', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
MrdBooleanField.style = mrdBooleanFieldCss();
|
|
@@ -181,6 +181,10 @@ const translations = {
|
|
|
181
181
|
folder_no_slash: "Een foldernaam mag geen '/' bevatten",
|
|
182
182
|
folder_duplicate: 'Er bestaat al een folder met deze naam',
|
|
183
183
|
doc_empty_drop: 'Nog geen documenten — sleep bestanden hierheen',
|
|
184
|
+
// mrd-file-preview
|
|
185
|
+
preview_unsupported: 'Geen voorbeeld beschikbaar voor dit bestandstype',
|
|
186
|
+
preview_error: 'Voorbeeld laden mislukt',
|
|
187
|
+
retry: 'Opnieuw proberen',
|
|
184
188
|
},
|
|
185
189
|
en: {
|
|
186
190
|
required: 'This field is required',
|
|
@@ -255,6 +259,10 @@ const translations = {
|
|
|
255
259
|
folder_no_slash: "A folder name cannot contain '/'",
|
|
256
260
|
folder_duplicate: 'A folder with this name already exists',
|
|
257
261
|
doc_empty_drop: 'No documents yet — drop files here',
|
|
262
|
+
// mrd-file-preview
|
|
263
|
+
preview_unsupported: 'No preview available for this file type',
|
|
264
|
+
preview_error: 'Failed to load preview',
|
|
265
|
+
retry: 'Retry',
|
|
258
266
|
},
|
|
259
267
|
ar: {
|
|
260
268
|
required: 'هذا الحقل مطلوب',
|
|
@@ -323,6 +331,10 @@ const translations = {
|
|
|
323
331
|
history_until: 'حتى',
|
|
324
332
|
history_badge_tooltip: 'القيم السابقة',
|
|
325
333
|
hyperlink_name: 'نص الرابط (اختياري)',
|
|
334
|
+
// mrd-file-preview
|
|
335
|
+
preview_unsupported: 'لا تتوفر معاينة لهذا النوع من الملفات',
|
|
336
|
+
preview_error: 'فشل تحميل المعاينة',
|
|
337
|
+
retry: 'إعادة المحاولة',
|
|
326
338
|
},
|
|
327
339
|
fr: {
|
|
328
340
|
required: 'Ce champ est obligatoire',
|
|
@@ -391,6 +403,10 @@ const translations = {
|
|
|
391
403
|
history_until: "jusqu'au",
|
|
392
404
|
history_badge_tooltip: 'Valeurs précédentes',
|
|
393
405
|
hyperlink_name: 'Texte du lien (optionnel)',
|
|
406
|
+
// mrd-file-preview
|
|
407
|
+
preview_unsupported: "Aucun aperçu disponible pour ce type de fichier",
|
|
408
|
+
preview_error: "Échec du chargement de l'aperçu",
|
|
409
|
+
retry: 'Réessayer',
|
|
394
410
|
},
|
|
395
411
|
de: {
|
|
396
412
|
required: 'Dieses Feld ist erforderlich',
|
|
@@ -459,6 +475,10 @@ const translations = {
|
|
|
459
475
|
history_until: 'bis',
|
|
460
476
|
history_badge_tooltip: 'Vorherige Werte',
|
|
461
477
|
hyperlink_name: 'Linktext (optional)',
|
|
478
|
+
// mrd-file-preview
|
|
479
|
+
preview_unsupported: 'Keine Vorschau für diesen Dateityp verfügbar',
|
|
480
|
+
preview_error: 'Vorschau konnte nicht geladen werden',
|
|
481
|
+
retry: 'Erneut versuchen',
|
|
462
482
|
},
|
|
463
483
|
es: {
|
|
464
484
|
required: 'Este campo es obligatorio',
|
|
@@ -527,6 +547,10 @@ const translations = {
|
|
|
527
547
|
history_until: 'hasta',
|
|
528
548
|
history_badge_tooltip: 'Valores anteriores',
|
|
529
549
|
hyperlink_name: 'Texto del enlace (opcional)',
|
|
550
|
+
// mrd-file-preview
|
|
551
|
+
preview_unsupported: 'Vista previa no disponible para este tipo de archivo',
|
|
552
|
+
preview_error: 'Error al cargar la vista previa',
|
|
553
|
+
retry: 'Reintentar',
|
|
530
554
|
},
|
|
531
555
|
it: {
|
|
532
556
|
required: 'Questo campo è obbligatorio',
|
|
@@ -595,6 +619,10 @@ const translations = {
|
|
|
595
619
|
history_until: 'fino a',
|
|
596
620
|
history_badge_tooltip: 'Valori precedenti',
|
|
597
621
|
hyperlink_name: 'Testo del collegamento (opzionale)',
|
|
622
|
+
// mrd-file-preview
|
|
623
|
+
preview_unsupported: 'Nessuna anteprima disponibile per questo tipo di file',
|
|
624
|
+
preview_error: "Impossibile caricare l'anteprima",
|
|
625
|
+
retry: 'Riprova',
|
|
598
626
|
},
|
|
599
627
|
uk: {
|
|
600
628
|
required: "Це поле обов'язкове",
|
|
@@ -663,6 +691,10 @@ const translations = {
|
|
|
663
691
|
history_until: 'до',
|
|
664
692
|
history_badge_tooltip: 'Попередні значення',
|
|
665
693
|
hyperlink_name: "Текст посилання (необов'язково)",
|
|
694
|
+
// mrd-file-preview
|
|
695
|
+
preview_unsupported: 'Попередній перегляд недоступний для цього типу файлу',
|
|
696
|
+
preview_error: 'Не вдалося завантажити попередній перегляд',
|
|
697
|
+
retry: 'Повторити',
|
|
666
698
|
},
|
|
667
699
|
};
|
|
668
700
|
function t(key, locale) {
|
|
@@ -783,7 +815,7 @@ const MrdCurrencyField = class {
|
|
|
783
815
|
}
|
|
784
816
|
render() {
|
|
785
817
|
const hasError = !!this.error;
|
|
786
|
-
return (index.h(index.Host, { key: '
|
|
818
|
+
return (index.h(index.Host, { key: '7265395c3b93c3b4daf4c4221da13e01b2fed2e8' }, index.h("div", { key: 'e644b67a7aba6e8f5b7175f5f79a4bf5e99cb611', class: "mrd-currency-field" }, index.h(FieldLabel, { key: 'd47a215c0684aea8a3253ae6edc4628d20733d90', base: "mrd-currency-field", label: this.label, required: this.required }), index.h("div", { key: 'b8f67f8188ad9cd8ba2b6869fcb2b4cd413dec32', class: "mrd-currency-field__row" }, index.h("input", { key: '8d643424d8932d11ceea0435353c54bc9399c187', class: controlClass('mrd-currency-field', hasError, 'amount'), type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), index.h("select", { key: '55b12e960646c2420883df848ae440d45f808300', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (index.h("option", { key: c, value: c, selected: c === this.currency }, c))))), index.h(FieldError, { key: 'd0a6adbb83af8fde047eff22c8efd9bbe1ae638f', base: "mrd-currency-field", error: this.error }))));
|
|
787
819
|
}
|
|
788
820
|
};
|
|
789
821
|
MrdCurrencyField.style = mrdCurrencyFieldCss();
|
|
@@ -813,7 +845,7 @@ const MrdDateField = class {
|
|
|
813
845
|
};
|
|
814
846
|
}
|
|
815
847
|
render() {
|
|
816
|
-
return (index.h(index.Host, { key: '
|
|
848
|
+
return (index.h(index.Host, { key: 'c0b9d684c5e0b5e3da785c383472ed5d6c13c39f' }, index.h("div", { key: '304c9b5c9570a369258f5f6fd0877a01a87d98d5', class: "mrd-date-field" }, index.h(FieldLabel, { key: '72c5ec21699a314920ea1217aee9a353bc8b4b7e', base: "mrd-date-field", label: this.label, required: this.required }), index.h("input", { key: 'be18df6c7e5fe89bf00cef38484711a9a685e0dc', class: controlClass('mrd-date-field', !!this.error), type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: 'f16ffb7e14f9ac9af4a34a96361a25dd4d738d68', base: "mrd-date-field", error: this.error }))));
|
|
817
849
|
}
|
|
818
850
|
};
|
|
819
851
|
MrdDateField.style = mrdDateFieldCss();
|
|
@@ -870,7 +902,7 @@ const MrdDatetimeField = class {
|
|
|
870
902
|
return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
871
903
|
}
|
|
872
904
|
render() {
|
|
873
|
-
return (index.h(index.Host, { key: '
|
|
905
|
+
return (index.h(index.Host, { key: '0ee285553f3d5e1a9984619795543d67d581c76f' }, index.h("div", { key: '2c93dffe3701da9099f4b34a9d7c1d0619fa824e', class: "mrd-datetime-field" }, index.h(FieldLabel, { key: 'ebda087fdcb2a956933758e6250a8e4dc0484ef9', base: "mrd-datetime-field", label: this.label, required: this.required }), index.h("input", { key: '06b012fc78c76e3b08ef24af5e134aa691975285', class: controlClass('mrd-datetime-field', !!this.error), type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: '54e7acdd051c00893eb17cbf4911917fceddb54f', base: "mrd-datetime-field", error: this.error }))));
|
|
874
906
|
}
|
|
875
907
|
static get watchers() { return {
|
|
876
908
|
"value": [{
|
|
@@ -880,7 +912,7 @@ const MrdDatetimeField = class {
|
|
|
880
912
|
};
|
|
881
913
|
MrdDatetimeField.style = mrdDatetimeFieldCss();
|
|
882
914
|
|
|
883
|
-
const mrdDocumentContainerCss = () => `.sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-
|
|
915
|
+
const mrdDocumentContainerCss = () => `.sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) 0;border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__body--tree.sc-mrd-document-container{border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow:hidden}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:var(--mrd-color-folder)}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed=true].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}`;
|
|
884
916
|
|
|
885
917
|
const MrdDocumentContainer = class {
|
|
886
918
|
constructor(hostRef) {
|
|
@@ -951,7 +983,7 @@ const MrdDocumentContainer = class {
|
|
|
951
983
|
this.mrdLoadPage.emit(e.detail);
|
|
952
984
|
}, onMrdNavigate: (e) => {
|
|
953
985
|
e.stopPropagation();
|
|
954
|
-
this.mrdNavigate.emit(e.detail);
|
|
986
|
+
this.mrdNavigate.emit(Object.assign(Object.assign({}, e.detail), { navigateBehaviour: index$1.ClientLayoutNavigateBehaviour.OVERLAY_PAGE }));
|
|
955
987
|
}, onMrdCanCreate: (e) => {
|
|
956
988
|
e.stopPropagation();
|
|
957
989
|
this.canCreate = e.detail;
|
|
@@ -977,7 +1009,11 @@ const MrdDocumentContainer = class {
|
|
|
977
1009
|
var _a, _b, _c;
|
|
978
1010
|
e.stopPropagation();
|
|
979
1011
|
const row = e.detail;
|
|
980
|
-
this.mrdNavigate.emit({
|
|
1012
|
+
this.mrdNavigate.emit({
|
|
1013
|
+
href: (_b = (_a = row === null || row === void 0 ? void 0 : row._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href,
|
|
1014
|
+
label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '',
|
|
1015
|
+
navigateBehaviour: index$1.ClientLayoutNavigateBehaviour.OVERLAY_PAGE,
|
|
1016
|
+
});
|
|
981
1017
|
}, onMrdAction: (e) => {
|
|
982
1018
|
e.stopPropagation();
|
|
983
1019
|
this.mrdAction.emit(e.detail);
|
|
@@ -985,7 +1021,10 @@ const MrdDocumentContainer = class {
|
|
|
985
1021
|
}
|
|
986
1022
|
render() {
|
|
987
1023
|
const treeMode = this.mode === 'tree';
|
|
988
|
-
return (index.h(index.Host, { key: '
|
|
1024
|
+
return (index.h(index.Host, { key: 'e8d37d2f818b9b2260fb2ccd3d784393a28385c4' }, this.renderToolbar(), index.h("div", { key: 'fa80a1343e9b2f1e74f30317bfbfbab78ea63e5d', class: {
|
|
1025
|
+
'mrd-document-container__body': true,
|
|
1026
|
+
'mrd-document-container__body--tree': treeMode,
|
|
1027
|
+
}, style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
|
|
989
1028
|
}
|
|
990
1029
|
get el() { return index.getElement(this); }
|
|
991
1030
|
};
|
|
@@ -1157,9 +1196,21 @@ function folderIcon() {
|
|
|
1157
1196
|
function docIcon() {
|
|
1158
1197
|
return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--doc", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("path", { d: "M14 2v6h6" })));
|
|
1159
1198
|
}
|
|
1199
|
+
/** Depth 0 renders no indent spacer at all — like Finder, the top-level
|
|
1200
|
+
* disclosure triangle sits in the row's own left margin instead of adding
|
|
1201
|
+
* an extra indent column before it. Nested levels still step in 18px each. */
|
|
1160
1202
|
function indent(depth) {
|
|
1203
|
+
if (depth === 0)
|
|
1204
|
+
return null;
|
|
1161
1205
|
return index.h("span", { class: "mrd-document-list__indent", style: { width: `${depth * 18}px` } });
|
|
1162
1206
|
}
|
|
1207
|
+
/** Pixel offset from the row's left edge to where the label text starts,
|
|
1208
|
+
* used to align the inline folder-name-error text under the label above it.
|
|
1209
|
+
* Mirrors the row's padding + (indent) + chevron + icon + gaps in tree-view.scss. */
|
|
1210
|
+
function labelOffset(depth) {
|
|
1211
|
+
const chevronAndIcon = 4 /* gap */ + 14 /* chevron */ + 4 /* gap */ + 17 /* icon */ + 4 /* gap */;
|
|
1212
|
+
return depth === 0 ? 8 + chevronAndIcon : 8 + depth * 18 + chevronAndIcon;
|
|
1213
|
+
}
|
|
1163
1214
|
function renderLoadingRow(ctx, depth) {
|
|
1164
1215
|
return (index.h("div", { class: "mrd-document-list__loading", key: "loading" }, indent(depth), index.h("span", { class: "mrd-document-list__spinner" }), t('loading', ctx.locale)));
|
|
1165
1216
|
}
|
|
@@ -1174,7 +1225,7 @@ function renderDocRow(ctx, doc, node, container, depth) {
|
|
|
1174
1225
|
return (index.h("div", { class: "mrd-document-list__row mrd-document-list__row--doc", key: (_e = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : label, draggable: true, onClick: () => ctx.on.openDoc(doc), onDragStart: (e) => ctx.on.docDragStart(e, doc, node), onDragEnd: ctx.on.docDragEnd, onDragOver: (e) => ctx.on.nodeDragOver(e, node), onDragLeave: () => ctx.on.nodeDragLeave(node), onDrop: (e) => ctx.on.nodeDrop(e, node, container) }, indent(depth), chevron(false, true), docIcon(), index.h("span", { class: "mrd-document-list__label" }, label), date && index.h("span", { class: "mrd-document-list__date" }, date)));
|
|
1175
1226
|
}
|
|
1176
1227
|
function renderFolderEditRow(ctx, node, depth) {
|
|
1177
|
-
return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: "mrd-document-list__row mrd-document-list__row--edit" }, indent(depth), chevron(false, true), folderIcon(), index.h("input", { class: "mrd-document-list__name-input", type: "text", placeholder: t('folder_name_placeholder', ctx.locale), ref: el => ctx.on.setPendingInputEl(el), onInput: ctx.on.pendingInput, onKeyDown: ctx.on.pendingKeyDown, onBlur: () => ctx.on.cancelFolder() })), node.error && (index.h("div", { class: "mrd-document-list__error", style: { paddingLeft: `${depth
|
|
1228
|
+
return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: "mrd-document-list__row mrd-document-list__row--edit" }, indent(depth), chevron(false, true), folderIcon(), index.h("input", { class: "mrd-document-list__name-input", type: "text", placeholder: t('folder_name_placeholder', ctx.locale), ref: el => ctx.on.setPendingInputEl(el), onInput: ctx.on.pendingInput, onKeyDown: ctx.on.pendingKeyDown, onBlur: () => ctx.on.cancelFolder() })), node.error && (index.h("div", { class: "mrd-document-list__error", style: { paddingLeft: `${labelOffset(depth)}px` } }, node.error))));
|
|
1178
1229
|
}
|
|
1179
1230
|
function renderNodeChildren(ctx, container, node, depth) {
|
|
1180
1231
|
const out = [];
|
|
@@ -1218,7 +1269,7 @@ function renderContainerNode(ctx, node, depth) {
|
|
|
1218
1269
|
: renderNodeChildren(ctx, node, node, depth + 1)))));
|
|
1219
1270
|
}
|
|
1220
1271
|
|
|
1221
|
-
const mrdDocumentListCss = () => `@charset "UTF-8";.sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-
|
|
1272
|
+
const mrdDocumentListCss = () => `@charset "UTF-8";.sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-1);height:2.125rem;padding:0 var(--mrd-space-4) 0 var(--mrd-space-2);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:0.875rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:var(--mrd-color-folder)}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-1);height:1.875rem;padding:0 var(--mrd-space-4) 0 var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}`;
|
|
1222
1273
|
|
|
1223
1274
|
const MrdDocumentList = class {
|
|
1224
1275
|
constructor(hostRef) {
|
|
@@ -1871,16 +1922,43 @@ const MrdDocumentList = class {
|
|
|
1871
1922
|
MrdDocumentList.ROOT = '__root__';
|
|
1872
1923
|
MrdDocumentList.style = mrdDocumentListCss();
|
|
1873
1924
|
|
|
1874
|
-
const mrdDocumentViewCss = () => `.sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:
|
|
1925
|
+
const mrdDocumentViewCss = () => `.sc-mrd-document-view-h{display:block;container-type:inline-size;container-name:mrd-document-view}.mrd-document-view.sc-mrd-document-view{max-width:1200px}.mrd-document-view__body.sc-mrd-document-view{display:grid;grid-template-columns:1fr;gap:var(--mrd-space-6)}@container mrd-document-view (min-width: 640px){.mrd-document-view__body{grid-template-columns:minmax(220px, 320px) 1fr !important;align-items:stretch !important}.mrd-document-view__crumb{margin-bottom:var(--mrd-space-2) !important}}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file-meta.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);margin-bottom:var(--mrd-space-2)}.mrd-document-view__file-name.sc-mrd-document-view{flex:1;min-width:0;font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__preview.sc-mrd-document-view{width:100%;overflow:hidden;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50)}.mrd-document-view__preview-loading.sc-mrd-document-view{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm)}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}`;
|
|
1875
1926
|
|
|
1876
1927
|
const MrdDocumentView = class {
|
|
1877
1928
|
constructor(hostRef) {
|
|
1878
1929
|
index.registerInstance(this, hostRef);
|
|
1879
1930
|
this.mrdNavigate = index.createEvent(this, "mrdNavigate");
|
|
1880
1931
|
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
1932
|
+
this.mrdLoadPreview = index.createEvent(this, "mrdLoadPreview");
|
|
1881
1933
|
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
1882
1934
|
this.data = {};
|
|
1883
1935
|
this.locale = navigator.language;
|
|
1936
|
+
/** Signed URL for the file's inline preview (mrd-file-preview), resolved by
|
|
1937
|
+
* the host in response to mrdLoadPreview. Empty while unresolved — the
|
|
1938
|
+
* preview area shows a loading state until the host injects a value. */
|
|
1939
|
+
this.previewUrl = '';
|
|
1940
|
+
/** Minimum height (px) of the inline preview area — it stretches to fill the
|
|
1941
|
+
* available row height in the wide side-by-side layout (see mrd-document-view.scss),
|
|
1942
|
+
* and falls back to this height when stacked. Overlay hosts typically pass a
|
|
1943
|
+
* smaller value than the full-page default to fit available chrome. */
|
|
1944
|
+
this.previewHeight = 640;
|
|
1945
|
+
/** Tracks the href a preview was last requested for, so componentDidLoad and
|
|
1946
|
+
* the data watcher don't emit duplicate requests for the same file. */
|
|
1947
|
+
this.lastPreviewHref = null;
|
|
1948
|
+
}
|
|
1949
|
+
componentDidLoad() {
|
|
1950
|
+
this.requestPreviewIfNeeded();
|
|
1951
|
+
}
|
|
1952
|
+
dataChanged() {
|
|
1953
|
+
this.requestPreviewIfNeeded();
|
|
1954
|
+
}
|
|
1955
|
+
requestPreviewIfNeeded() {
|
|
1956
|
+
var _a, _b;
|
|
1957
|
+
const href = (_b = (_a = this.slotValue('file')) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : null;
|
|
1958
|
+
if (href && href !== this.lastPreviewHref) {
|
|
1959
|
+
this.lastPreviewHref = href;
|
|
1960
|
+
this.mrdLoadPreview.emit({ href });
|
|
1961
|
+
}
|
|
1884
1962
|
}
|
|
1885
1963
|
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
1886
1964
|
slotValue(slot) {
|
|
@@ -1905,24 +1983,43 @@ const MrdDocumentView = class {
|
|
|
1905
1983
|
return null;
|
|
1906
1984
|
return (index.h("button", { class: "mrd-document-view__crumb", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, index.h("svg", { class: "mrd-document-view__crumb-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M19 12H5M12 19l-7-7 7-7" })), link.name));
|
|
1907
1985
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1986
|
+
/** Filename + download button — part of the metadata column, not the preview
|
|
1987
|
+
* panel, so it stays next to the title/summary in the wide side-by-side layout. */
|
|
1988
|
+
renderFileMeta(fileName, href) {
|
|
1989
|
+
return (index.h("div", { class: "mrd-document-view__file-meta" }, index.h("span", { class: "mrd-document-view__file-name" }, fileName), href && (index.h("button", { type: "button", class: "mrd-document-view__download", onClick: () => this.mrdDownload.emit({ href, fileName }) }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 21h16" })), t('download', this.locale)))));
|
|
1990
|
+
}
|
|
1991
|
+
/** The preview panel itself (iframe/image/loading state) — its own grid
|
|
1992
|
+
* column in the wide layout, so it can take the full available height. */
|
|
1993
|
+
renderPreviewPanel(fileName, href, mimeType) {
|
|
1994
|
+
if (!href)
|
|
1912
1995
|
return null;
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1996
|
+
return (index.h("div", { class: "mrd-document-view__preview", style: { minHeight: `${this.previewHeight}px` } }, this.previewUrl ? (index.h("mrd-file-preview", { src: this.previewUrl, mimeType: mimeType, fileName: fileName, href: href, locale: this.locale, onMrdDownload: (e) => {
|
|
1997
|
+
e.stopPropagation();
|
|
1998
|
+
this.mrdDownload.emit(e.detail);
|
|
1999
|
+
}, onMrdPreviewReload: (e) => {
|
|
2000
|
+
e.stopPropagation();
|
|
2001
|
+
this.mrdLoadPreview.emit({ href });
|
|
2002
|
+
} })) : (index.h("div", { class: "mrd-document-view__preview-loading" }, t('loading', this.locale)))));
|
|
1916
2003
|
}
|
|
1917
2004
|
render() {
|
|
2005
|
+
var _a, _b, _c, _d;
|
|
1918
2006
|
const titleRaw = this.slotValue('title');
|
|
1919
2007
|
const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
|
|
1920
2008
|
const dateRaw = this.slotValue('date');
|
|
1921
2009
|
const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
|
|
1922
2010
|
const summaryRaw = this.slotValue('summary');
|
|
1923
2011
|
const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
|
|
1924
|
-
|
|
2012
|
+
const fileRaw = this.slotValue('file');
|
|
2013
|
+
const fileHref = (_a = fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.href) !== null && _a !== void 0 ? _a : '';
|
|
2014
|
+
const fileName = (_b = fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.fileName) !== null && _b !== void 0 ? _b : (fileRaw ? String(fileRaw) : '');
|
|
2015
|
+
const mimeType = (_d = (_c = fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.mimeType) !== null && _c !== void 0 ? _c : fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.contentType) !== null && _d !== void 0 ? _d : '';
|
|
2016
|
+
return (index.h(index.Host, { key: '6023c8c6ca3d780fd4a9cca41189cb05a151221e' }, index.h("div", { key: 'd7d39d62964583da0ca6c1494e75321e6bab9ac8', class: "mrd-document-view" }, index.h("div", { key: '9aa14569c9ffc785ffb4f2b3d5930cf3e822e246', class: "mrd-document-view__body" }, index.h("div", { key: 'e00f3b55551429d8522fb97e7ccb43d56e98042d', class: "mrd-document-view__meta" }, this.renderContainer(), title && index.h("h1", { key: '9860273878b245fc757eb690c6cd7006b13045c4', class: "mrd-document-view__title" }, title), date && index.h("p", { key: '84c60b0b6feb6678d661000c26050e42eaaa8399', class: "mrd-document-view__date" }, date), fileRaw && this.renderFileMeta(fileName, fileHref), summary && (index.h("div", { key: 'd1cff0cc1b9376409c8e04a785deba93c986ba47', class: "mrd-document-view__summary" }, index.h("div", { key: 'fc9c4b986afc8c4f50486caf85bf58860d641a2b', class: "mrd-document-view__summary-body", innerHTML: summary })))), fileRaw && this.renderPreviewPanel(fileName, fileHref, mimeType)))));
|
|
1925
2017
|
}
|
|
2018
|
+
static get watchers() { return {
|
|
2019
|
+
"data": [{
|
|
2020
|
+
"dataChanged": 0
|
|
2021
|
+
}]
|
|
2022
|
+
}; }
|
|
1926
2023
|
};
|
|
1927
2024
|
MrdDocumentView.style = mrdDocumentViewCss();
|
|
1928
2025
|
|
|
@@ -1953,7 +2050,7 @@ const MrdEmailField = class {
|
|
|
1953
2050
|
};
|
|
1954
2051
|
}
|
|
1955
2052
|
render() {
|
|
1956
|
-
return (index.h(index.Host, { key: '
|
|
2053
|
+
return (index.h(index.Host, { key: 'e113fb3958c06ee4d4e870b6005e07b1793835a1' }, index.h("div", { key: '9393b859167f1474d944575f464e1523f1dcf469', class: "mrd-email-field" }, index.h(FieldLabel, { key: '57c134921adb7f941c19d2fa36cce213bc12ae1e', base: "mrd-email-field", label: this.label, required: this.required }), index.h("input", { key: '67496689526d2fa96a087b00a9436e9de4d69415', class: controlClass('mrd-email-field', !!this.error), type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: '5a151c2995db77771fe8f98a24c627b0060f655a', base: "mrd-email-field", error: this.error }))));
|
|
1957
2054
|
}
|
|
1958
2055
|
};
|
|
1959
2056
|
MrdEmailField.style = mrdEmailFieldCss();
|
|
@@ -2261,7 +2358,7 @@ const MrdFileField = class {
|
|
|
2261
2358
|
error: hasError,
|
|
2262
2359
|
disabled: this.disabled || this.uploading,
|
|
2263
2360
|
});
|
|
2264
|
-
return (index.h(index.Host, { key: '
|
|
2361
|
+
return (index.h(index.Host, { key: '6410e945bb873a05d0a1b3be45bc879b5e153a05' }, index.h("div", { key: '4d1d69d768b383f0d9190f88a50a87de8679d3d2', class: "mrd-file-field" }, index.h(FieldLabel, { key: '7e0009908fb4c087de16cf08251ab398199dae60', base: "mrd-file-field", label: this.label, required: this.required }), index.h("div", { key: '88dfc0d1c34670f7de8f3cf2dea4c95b0ae66f4c', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: 'b6d678b5582a58721c928cef47dd8d6645b26a86', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (index.h("div", { class: "mrd-file-field__selected" }, this.uploading ? (index.h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (index.h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("polyline", { points: "14 2 14 8 20 8" }))), index.h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (index.h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), index.h(FieldError, { key: '80f1698819c60b15476b953f5f3216f195430b84', base: "mrd-file-field", error: this.error }))));
|
|
2265
2362
|
}
|
|
2266
2363
|
static get watchers() { return {
|
|
2267
2364
|
"value": [{
|
|
@@ -2271,6 +2368,90 @@ const MrdFileField = class {
|
|
|
2271
2368
|
};
|
|
2272
2369
|
MrdFileField.style = mrdFileFieldCss();
|
|
2273
2370
|
|
|
2371
|
+
/** Pure classification logic for mrd-file-preview — no Stencil dependency. */
|
|
2372
|
+
const IMAGE_EXTENSIONS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp']);
|
|
2373
|
+
function extensionOf(fileName) {
|
|
2374
|
+
if (!fileName)
|
|
2375
|
+
return null;
|
|
2376
|
+
const match = /\.([a-z0-9]+)$/i.exec(fileName);
|
|
2377
|
+
return match ? match[1].toLowerCase() : null;
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* Decide how to render a file given its declared mime type and/or file name.
|
|
2381
|
+
* A declared mime type is authoritative when present (a mismatched file name
|
|
2382
|
+
* extension is ignored); the file name extension is only consulted as a
|
|
2383
|
+
* fallback when no mime type is known.
|
|
2384
|
+
*/
|
|
2385
|
+
function detectPreviewKind(mimeType, fileName) {
|
|
2386
|
+
const mime = (mimeType !== null && mimeType !== void 0 ? mimeType : '').toLowerCase().trim();
|
|
2387
|
+
if (mime) {
|
|
2388
|
+
if (mime === 'application/pdf')
|
|
2389
|
+
return 'pdf';
|
|
2390
|
+
if (mime.startsWith('image/'))
|
|
2391
|
+
return 'image';
|
|
2392
|
+
return 'unsupported';
|
|
2393
|
+
}
|
|
2394
|
+
const ext = extensionOf(fileName);
|
|
2395
|
+
if (ext === 'pdf')
|
|
2396
|
+
return 'pdf';
|
|
2397
|
+
if (ext && IMAGE_EXTENSIONS.has(ext))
|
|
2398
|
+
return 'image';
|
|
2399
|
+
return 'unsupported';
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
const mrdFilePreviewCss = () => `.sc-mrd-file-preview-h{display:block;width:100%;height:100%}.mrd-file-preview__frame.sc-mrd-file-preview{display:block;width:100%;height:100%;border:none}.mrd-file-preview__image.sc-mrd-file-preview{display:block;max-width:100%;max-height:100%;margin:0 auto;object-fit:contain}.mrd-file-preview__error.sc-mrd-file-preview,.mrd-file-preview__unsupported.sc-mrd-file-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--mrd-space-3);width:100%;height:100%;min-height:8rem;padding:var(--mrd-space-6);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center}.mrd-file-preview__error-text.sc-mrd-file-preview{color:var(--mrd-color-danger)}.mrd-file-preview__retry.sc-mrd-file-preview,.mrd-file-preview__download.sc-mrd-file-preview{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:2rem;padding:0 var(--mrd-space-3);border:var(--mrd-border-width) solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);background:var(--mrd-color-white);color:var(--mrd-color-neutral-700);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);cursor:pointer}.mrd-file-preview__retry.sc-mrd-file-preview:hover,.mrd-file-preview__download.sc-mrd-file-preview:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-file-preview__download.sc-mrd-file-preview svg.sc-mrd-file-preview{width:0.9375rem;height:0.9375rem}`;
|
|
2403
|
+
|
|
2404
|
+
const MrdFilePreview = class {
|
|
2405
|
+
constructor(hostRef) {
|
|
2406
|
+
index.registerInstance(this, hostRef);
|
|
2407
|
+
this.mrdPreviewReload = index.createEvent(this, "mrdPreviewReload");
|
|
2408
|
+
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
2409
|
+
/** Signed URL to render. */
|
|
2410
|
+
this.src = '';
|
|
2411
|
+
/** Declared mime type (e.g. 'application/pdf', 'image/png'), when known.
|
|
2412
|
+
* Authoritative over `fileName` when present. */
|
|
2413
|
+
this.mimeType = '';
|
|
2414
|
+
/** Original file name — used for extension-based detection when `mimeType`
|
|
2415
|
+
* is absent, and as alt/title text. */
|
|
2416
|
+
this.fileName = '';
|
|
2417
|
+
/** The file's own reference href (not the signed preview URL in `src`).
|
|
2418
|
+
* When set, an unsupported type falls back to the same download button
|
|
2419
|
+
* used elsewhere in the library, so hosts need no new wiring. */
|
|
2420
|
+
this.href = '';
|
|
2421
|
+
this.locale = navigator.language;
|
|
2422
|
+
this.imageFailed = false;
|
|
2423
|
+
this.onImageError = () => {
|
|
2424
|
+
this.imageFailed = true;
|
|
2425
|
+
};
|
|
2426
|
+
this.retry = () => {
|
|
2427
|
+
this.imageFailed = false;
|
|
2428
|
+
this.mrdPreviewReload.emit();
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
srcChanged() {
|
|
2432
|
+
this.imageFailed = false;
|
|
2433
|
+
}
|
|
2434
|
+
render() {
|
|
2435
|
+
const kind = detectPreviewKind(this.mimeType, this.fileName);
|
|
2436
|
+
if (kind === 'pdf') {
|
|
2437
|
+
return (index.h(index.Host, null, index.h("iframe", { class: "mrd-file-preview__frame", src: this.src, title: this.fileName || 'preview' })));
|
|
2438
|
+
}
|
|
2439
|
+
if (kind === 'image') {
|
|
2440
|
+
if (this.imageFailed) {
|
|
2441
|
+
return (index.h(index.Host, null, index.h("div", { class: "mrd-file-preview__error" }, index.h("span", { class: "mrd-file-preview__error-text" }, t('preview_error', this.locale)), index.h("button", { type: "button", class: "mrd-file-preview__retry", onClick: this.retry }, t('retry', this.locale)))));
|
|
2442
|
+
}
|
|
2443
|
+
return (index.h(index.Host, null, index.h("img", { class: "mrd-file-preview__image", src: this.src, alt: this.fileName || '', onError: this.onImageError })));
|
|
2444
|
+
}
|
|
2445
|
+
return (index.h(index.Host, null, index.h("div", { class: "mrd-file-preview__unsupported" }, index.h("span", null, t('preview_unsupported', this.locale)), this.href && (index.h("button", { type: "button", class: "mrd-file-preview__download", onClick: () => this.mrdDownload.emit({ href: this.href, fileName: this.fileName }) }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 21h16" })), t('download', this.locale))))));
|
|
2446
|
+
}
|
|
2447
|
+
static get watchers() { return {
|
|
2448
|
+
"src": [{
|
|
2449
|
+
"srcChanged": 0
|
|
2450
|
+
}]
|
|
2451
|
+
}; }
|
|
2452
|
+
};
|
|
2453
|
+
MrdFilePreview.style = mrdFilePreviewCss();
|
|
2454
|
+
|
|
2274
2455
|
const mrdFormCss = () => `.sc-mrd-form-h{display:block}.mrd-form.sc-mrd-form{font-family:var(--mrd-font-family);width:100%}.mrd-form__title.sc-mrd-form{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-6) 0}.mrd-form__body.sc-mrd-form{display:flex;flex-direction:column;gap:var(--mrd-space-5)}.mrd-form__field.sc-mrd-form{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-form__field-error.sc-mrd-form{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-form__section.sc-mrd-form{border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);padding:var(--mrd-space-4) var(--mrd-space-5);margin:0}.mrd-form__section-legend.sc-mrd-form{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-700);padding:0 var(--mrd-space-2)}.mrd-form__section-body.sc-mrd-form{display:flex;flex-direction:column;gap:var(--mrd-space-4);margin-top:var(--mrd-space-2)}.mrd-form__group.sc-mrd-form{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-form__group-label.sc-mrd-form{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);text-transform:uppercase;letter-spacing:0.05em}.mrd-form__group-body.sc-mrd-form{display:flex;flex-direction:column;gap:var(--mrd-space-4);padding-left:var(--mrd-space-4);border-left:3px solid var(--mrd-color-neutral-200)}.mrd-form__footer.sc-mrd-form{margin-top:var(--mrd-space-8);padding-top:var(--mrd-space-5);border-top:var(--mrd-border-width) solid var(--mrd-border-color);display:flex;justify-content:flex-end;gap:var(--mrd-space-3)}.mrd-form__submit.sc-mrd-form{display:inline-flex;align-items:center;justify-content:center;height:var(--mrd-input-height);padding:0 var(--mrd-space-6);background-color:var(--mrd-color-primary);color:var(--mrd-color-white);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);font-weight:var(--mrd-font-weight-medium);border:none;border-radius:var(--mrd-border-radius);cursor:pointer;transition:background-color var(--mrd-transition)}.mrd-form__submit.sc-mrd-form:hover{background-color:var(--mrd-color-primary-hover)}.mrd-form__submit.sc-mrd-form:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-form__submit.sc-mrd-form:active{background-color:var(--mrd-color-primary-dark)}.mrd-form__cancel.sc-mrd-form{display:inline-flex;align-items:center;justify-content:center;height:var(--mrd-input-height);padding:0 var(--mrd-space-6);background-color:transparent;color:var(--mrd-color-neutral-600);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);font-weight:var(--mrd-font-weight-medium);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background-color var(--mrd-transition), color var(--mrd-transition)}.mrd-form__cancel.sc-mrd-form:hover{background-color:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-form__cancel.sc-mrd-form:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-form__cancel.sc-mrd-form:active{background-color:var(--mrd-color-neutral-200)}`;
|
|
2275
2456
|
|
|
2276
2457
|
const MrdForm = class {
|
|
@@ -2798,7 +2979,7 @@ const MrdImageField = class {
|
|
|
2798
2979
|
error: hasError,
|
|
2799
2980
|
disabled: this.disabled || this.uploading,
|
|
2800
2981
|
});
|
|
2801
|
-
return (index.h(index.Host, { key: '
|
|
2982
|
+
return (index.h(index.Host, { key: '700310af716dcc167f98bc7ae7024bb44e1285b6' }, index.h("div", { key: '95d29a82751249e560404488fb279138eee0c1be', class: "mrd-image-field" }, index.h(FieldLabel, { key: 'f53f040257a4b65d8435c836846adab137b91a5e', base: "mrd-image-field", label: this.label, required: this.required }), index.h("div", { key: 'a9cc7a0861b1457d8e4abb11b380b6eeb519a863', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: '7112030bc2b80b4c3b31a4421656da4c926a2fe1', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (index.h("div", { class: "mrd-image-field__preview-container" }, index.h("div", { class: "mrd-image-field__preview-thumb" }, index.h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && index.h("div", { class: "mrd-image-field__preview-overlay" }, index.h("span", { class: "mrd-image-field__spinner" }))), index.h("div", { class: "mrd-image-field__preview-info" }, index.h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (index.h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (index.h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), index.h(FieldError, { key: '0cf5346ecb1a5d110822b087081b4b5f05255381', base: "mrd-image-field", error: this.error }))));
|
|
2802
2983
|
}
|
|
2803
2984
|
static get watchers() { return {
|
|
2804
2985
|
"value": [{
|
|
@@ -3048,7 +3229,7 @@ function renderField(ctx, item) {
|
|
|
3048
3229
|
return (index.h("div", { class: `mrd-layout-section__field${isBlock ? ' mrd-layout-section__field--block' : ''}`, key: item.name }, index.h("span", { class: "mrd-layout-section__field-label" }, item.label), index.h("span", { class: "mrd-layout-section__field-value" }, renderedValue, renderHistoryBadge(ctx, item, raw))));
|
|
3049
3230
|
}
|
|
3050
3231
|
|
|
3051
|
-
const mrdLayoutSectionCss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(15 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:var(--mrd-color-white);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:var(--mrd-color-white);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}`;
|
|
3232
|
+
const mrdLayoutSectionCss = () => `.sc-mrd-layout-section-h{display:block;width:100%}.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(15 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:var(--mrd-color-white);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:var(--mrd-color-white);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}`;
|
|
3052
3233
|
|
|
3053
3234
|
const MrdLayoutSection = class {
|
|
3054
3235
|
constructor(hostRef) {
|
|
@@ -3058,6 +3239,7 @@ const MrdLayoutSection = class {
|
|
|
3058
3239
|
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
3059
3240
|
this.mrdLoadViewPage = index.createEvent(this, "mrdLoadViewPage");
|
|
3060
3241
|
this.mrdLoadImage = index.createEvent(this, "mrdLoadImage");
|
|
3242
|
+
this.mrdLoadDocumentPreview = index.createEvent(this, "mrdLoadDocumentPreview");
|
|
3061
3243
|
this.mrdViewAction = index.createEvent(this, "mrdViewAction");
|
|
3062
3244
|
this.mrdLoadViewAggregations = index.createEvent(this, "mrdLoadViewAggregations");
|
|
3063
3245
|
this.mrdLoadViewDistinct = index.createEvent(this, "mrdLoadViewDistinct");
|
|
@@ -3076,11 +3258,17 @@ const MrdLayoutSection = class {
|
|
|
3076
3258
|
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
3077
3259
|
* the record is rendered as a single-document view instead of generic fields. */
|
|
3078
3260
|
this.archetypes = [];
|
|
3261
|
+
/** Minimum height (px) of the commons.document inline file preview — it
|
|
3262
|
+
* stretches taller in the wide side-by-side layout. Pass a smaller value
|
|
3263
|
+
* when embedding the record in an overlay with limited height. */
|
|
3264
|
+
this.documentPreviewHeight = 640;
|
|
3079
3265
|
this.searchQueryMap = {};
|
|
3080
3266
|
this.searchResultsMap = {};
|
|
3081
3267
|
this.imagePreviewUrl = null;
|
|
3082
3268
|
this.imagePreviews = {};
|
|
3083
3269
|
this.openHistoryField = null;
|
|
3270
|
+
/** Signed URL for the commons.document archetype's inline file preview. */
|
|
3271
|
+
this.documentPreviewUrl = null;
|
|
3084
3272
|
this.historyClickOutside = null;
|
|
3085
3273
|
this.searchTimers = {};
|
|
3086
3274
|
this.handleViewLoadPage = (e, name) => {
|
|
@@ -3204,6 +3392,11 @@ const MrdLayoutSection = class {
|
|
|
3204
3392
|
async openImagePreview(url) {
|
|
3205
3393
|
this.imagePreviewUrl = url;
|
|
3206
3394
|
}
|
|
3395
|
+
/** Provide a resolved signed URL for the commons.document archetype's inline
|
|
3396
|
+
* file preview, in response to mrdLoadDocumentPreview. */
|
|
3397
|
+
async setDocumentPreviewUrl(url) {
|
|
3398
|
+
this.documentPreviewUrl = url;
|
|
3399
|
+
}
|
|
3207
3400
|
resolveSearchKey() {
|
|
3208
3401
|
var _a;
|
|
3209
3402
|
const items = flattenItems(this.items).filter(i => i.type === index$1.ClientLayoutItemType.SEARCH);
|
|
@@ -3293,6 +3486,10 @@ const MrdLayoutSection = class {
|
|
|
3293
3486
|
e.stopPropagation();
|
|
3294
3487
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3295
3488
|
}, onMrdNavigate: (e) => {
|
|
3489
|
+
// mrd-document-container already hardcodes navigateBehaviour to
|
|
3490
|
+
// OVERLAY_PAGE (documents are always the quick-look use case) —
|
|
3491
|
+
// relay as-is, unlike the generic table path below which takes it
|
|
3492
|
+
// from the item's configuration.
|
|
3296
3493
|
e.stopPropagation();
|
|
3297
3494
|
this.mrdNavigate.emit(e.detail);
|
|
3298
3495
|
}, onMrdAction: (e) => {
|
|
@@ -3316,10 +3513,14 @@ const MrdLayoutSection = class {
|
|
|
3316
3513
|
e.stopPropagation();
|
|
3317
3514
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3318
3515
|
}, onMrdRowClick: (e) => {
|
|
3319
|
-
var _a, _b, _c;
|
|
3516
|
+
var _a, _b, _c, _d;
|
|
3320
3517
|
e.stopPropagation();
|
|
3321
3518
|
const row = e.detail;
|
|
3322
|
-
this.mrdNavigate.emit({
|
|
3519
|
+
this.mrdNavigate.emit({
|
|
3520
|
+
href: (_b = (_a = row === null || row === void 0 ? void 0 : row._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href,
|
|
3521
|
+
label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '',
|
|
3522
|
+
navigateBehaviour: (_d = item.navigateBehaviour) !== null && _d !== void 0 ? _d : index$1.ClientLayoutNavigateBehaviour.PAGE,
|
|
3523
|
+
});
|
|
3323
3524
|
}, onMrdAction: (e) => {
|
|
3324
3525
|
var _a;
|
|
3325
3526
|
e.stopPropagation();
|
|
@@ -3368,17 +3569,18 @@ const MrdLayoutSection = class {
|
|
|
3368
3569
|
* a recognisable document instead of generic fields, keeping any related views/
|
|
3369
3570
|
* searches below it. */
|
|
3370
3571
|
renderDocumentObject(archetype) {
|
|
3572
|
+
var _a;
|
|
3371
3573
|
const related = this.items.filter(it => it.type === index$1.ClientLayoutItemType.VIEW ||
|
|
3372
3574
|
it.type === index$1.ClientLayoutItemType.RELATED_VIEW ||
|
|
3373
3575
|
it.type === index$1.ClientLayoutItemType.SEARCH);
|
|
3374
3576
|
return [
|
|
3375
|
-
index.h("mrd-document-view", { archetype: archetype, data: this.data, locale: this.locale, onMrdNavigate: (e) => { e.stopPropagation(); this.mrdNavigate.emit(e.detail); }, onMrdDownload: (e) => { e.stopPropagation(); this.mrdDownload.emit(e.detail); } }),
|
|
3577
|
+
index.h("mrd-document-view", { archetype: archetype, data: this.data, locale: this.locale, previewUrl: (_a = this.documentPreviewUrl) !== null && _a !== void 0 ? _a : '', previewHeight: this.documentPreviewHeight, onMrdNavigate: (e) => { e.stopPropagation(); this.mrdNavigate.emit(e.detail); }, onMrdDownload: (e) => { e.stopPropagation(); this.mrdDownload.emit(e.detail); }, onMrdLoadPreview: (e) => { e.stopPropagation(); this.mrdLoadDocumentPreview.emit(e.detail); } }),
|
|
3376
3578
|
...related.map(it => this.renderItem(it)),
|
|
3377
3579
|
];
|
|
3378
3580
|
}
|
|
3379
3581
|
render() {
|
|
3380
3582
|
const docArchetype = index$1.resolveArchetype(this.archetypes, index$1.ARCHETYPE_DOCUMENT);
|
|
3381
|
-
return (index.h(index.Host, { key: '
|
|
3583
|
+
return (index.h(index.Host, { key: 'd73b44ed5d3529c5b01a87ddfd9a7ebe202ff3b8' }, index.h("div", { key: '1e80e202ec7c23afbca8f6a02376f0a4a4a6ba31', class: "mrd-layout-section" }, docArchetype
|
|
3382
3584
|
? this.renderDocumentObject(docArchetype)
|
|
3383
3585
|
: this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
3384
3586
|
}
|
|
@@ -3499,7 +3701,7 @@ const MrdLongtextField = class {
|
|
|
3499
3701
|
};
|
|
3500
3702
|
}
|
|
3501
3703
|
render() {
|
|
3502
|
-
return (index.h(index.Host, { key: '
|
|
3704
|
+
return (index.h(index.Host, { key: 'b27d14772f5184d41c178606629a9945120296ef' }, index.h("div", { key: '206b1b9ee1d37e05680e31bf8b324455867fd93b', class: "mrd-longtext-field" }, index.h(FieldLabel, { key: '0b6f4959f32a097907965753ed8708d7580aee53', base: "mrd-longtext-field", label: this.label, required: this.required }), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.h("textarea", { class: controlClass('mrd-longtext-field', !!this.error), name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), index.h(FieldError, { key: '0803cf0c1b6409e6c8a65121efef97d28d870119', base: "mrd-longtext-field", error: this.error }))));
|
|
3503
3705
|
}
|
|
3504
3706
|
};
|
|
3505
3707
|
MrdLongtextField.style = mrdLongtextFieldCss();
|
|
@@ -3575,7 +3777,7 @@ const MrdNumberField = class {
|
|
|
3575
3777
|
const hasError = !!this.error;
|
|
3576
3778
|
const suffix = this.dataType === index$1.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
|
|
3577
3779
|
this.dataType === index$1.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
|
|
3578
|
-
return (index.h(index.Host, { key: '
|
|
3780
|
+
return (index.h(index.Host, { key: '90cae99b332f9554bc80d4044fce892ae37a48cf' }, index.h("div", { key: '26a9cfcc662eaeb571d17785f10f74269cf78537', class: "mrd-number-field" }, index.h(FieldLabel, { key: '0d9e70c1591f309ad2875d9e9fe6dbb8aa910323', base: "mrd-number-field", label: this.label, required: this.required }), index.h("div", { key: '95e9b53fa73c452491f65355915bf04912900ded', class: "mrd-number-field__input-wrapper" }, index.h("input", { key: '1d341c270a21b1a10c51757e90257e48e741abd7', class: controlClass('mrd-number-field', hasError), type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), index.h(FieldError, { key: '0dba75e0f7355b71bfa71dab16cd1a6fcc36922f', base: "mrd-number-field", error: this.error }))));
|
|
3579
3781
|
}
|
|
3580
3782
|
};
|
|
3581
3783
|
MrdNumberField.style = mrdNumberFieldCss();
|
|
@@ -3853,9 +4055,9 @@ const MrdSecretField = class {
|
|
|
3853
4055
|
};
|
|
3854
4056
|
}
|
|
3855
4057
|
render() {
|
|
3856
|
-
return (index.h(index.Host, { key: '
|
|
4058
|
+
return (index.h(index.Host, { key: '9883a87b7fcc840aa4bbe0a3cde163cc58bda65d' }, index.h("div", { key: '3c7ec45d59a1a17863daa39b7c115db5c58815ee', class: "mrd-secret-field" }, index.h(FieldLabel, { key: '2dda66c7e6d4946661bff5a5a46589a7e17f569a', base: "mrd-secret-field", label: this.label, required: this.required }), this.disabled
|
|
3857
4059
|
? (index.h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
|
|
3858
|
-
: (index.h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), index.h(FieldError, { key: '
|
|
4060
|
+
: (index.h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), index.h(FieldError, { key: 'ad8f54a7c76c59591fee77e11a12bbd62c392d91', base: "mrd-secret-field", error: this.error }))));
|
|
3859
4061
|
}
|
|
3860
4062
|
};
|
|
3861
4063
|
MrdSecretField.style = mrdSecretFieldCss();
|
|
@@ -5180,7 +5382,7 @@ const MrdTextField = class {
|
|
|
5180
5382
|
};
|
|
5181
5383
|
}
|
|
5182
5384
|
render() {
|
|
5183
|
-
return (index.h(index.Host, { key: '
|
|
5385
|
+
return (index.h(index.Host, { key: 'd2a6fb5735a3a01887cc467274a0ff9d71312124' }, index.h("div", { key: '7864bf852d43f93ebd0120a3ec1b72e54837d1ba', class: "mrd-text-field" }, index.h(FieldLabel, { key: 'bdad112197b44a643a58dd79c4648e284311199d', base: "mrd-text-field", label: this.label, required: this.required }), index.h("input", { key: '1d3e1cf3374ea2e5a83794b5110205964fff86e1', class: controlClass('mrd-text-field', !!this.error), type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: 'bb4ec51de7b6d360fdb3d46dd53e85a5d497bcce', base: "mrd-text-field", error: this.error }))));
|
|
5184
5386
|
}
|
|
5185
5387
|
};
|
|
5186
5388
|
MrdTextField.style = mrdTextFieldCss();
|
|
@@ -5249,7 +5451,7 @@ const MrdTextareaField = class {
|
|
|
5249
5451
|
}
|
|
5250
5452
|
}
|
|
5251
5453
|
render() {
|
|
5252
|
-
return (index.h(index.Host, { key: '
|
|
5454
|
+
return (index.h(index.Host, { key: 'de39890fc23146b880e69be7a8f04c91786ae9c9' }, index.h("div", { key: '0ccc855f3ee44553559a9ea8a70690466789f76d', class: "mrd-textarea-field" }, index.h(FieldLabel, { key: '2a16dcbeedbba8b5d8d1e8e8c0f021f14813f609', base: "mrd-textarea-field", label: this.label, required: this.required }), index.h("div", { key: '979ecb0ed163e3f753d75635452eea49d76edf29', class: controlClass('mrd-textarea-field', !!this.error, 'container') }, index.h("div", { key: '8ea96a080086b68df55017a1464f6bce502f9a58', class: "mrd-textarea-field__editor" })), index.h(FieldError, { key: 'd6ac1a12f7be3594ed8cdb6d94b304c46dc8285b', base: "mrd-textarea-field", error: this.error }))));
|
|
5253
5455
|
}
|
|
5254
5456
|
get el() { return index.getElement(this); }
|
|
5255
5457
|
};
|
|
@@ -5280,7 +5482,7 @@ const MrdTimeField = class {
|
|
|
5280
5482
|
};
|
|
5281
5483
|
}
|
|
5282
5484
|
render() {
|
|
5283
|
-
return (index.h(index.Host, { key: '
|
|
5485
|
+
return (index.h(index.Host, { key: '588e298c4f52aa4e65d87bfdc6918282ed97b3ae' }, index.h("div", { key: 'eed7332ca78747d4ff8b6c8d06ad4674e1c37e69', class: "mrd-time-field" }, index.h(FieldLabel, { key: '6383beb79fd05dabdc408256e3326f9637e4c993', base: "mrd-time-field", label: this.label, required: this.required }), index.h("input", { key: 'b372d8b5dd523ee6182fe302450ce904ac17cc3c', class: controlClass('mrd-time-field', !!this.error), type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: '7d8ce1e557bf583c0409e8f02893a15fadeab634', base: "mrd-time-field", error: this.error }))));
|
|
5284
5486
|
}
|
|
5285
5487
|
};
|
|
5286
5488
|
MrdTimeField.style = mrdTimeFieldCss();
|
|
@@ -5295,6 +5497,7 @@ exports.mrd_document_view = MrdDocumentView;
|
|
|
5295
5497
|
exports.mrd_email_field = MrdEmailField;
|
|
5296
5498
|
exports.mrd_field = MrdField;
|
|
5297
5499
|
exports.mrd_file_field = MrdFileField;
|
|
5500
|
+
exports.mrd_file_preview = MrdFilePreview;
|
|
5298
5501
|
exports.mrd_form = MrdForm;
|
|
5299
5502
|
exports.mrd_hyperlink_field = MrdHyperlinkField;
|
|
5300
5503
|
exports.mrd_image_field = MrdImageField;
|